MCPcopy Create free account
hub / github.com/Vector35/binaryninja-api / ReadAddress

Function ReadAddress

arch/armv7/il.cpp:237–270  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

235
236
237static ExprId ReadAddress(LowLevelILFunction& il, InstructionOperand& op, size_t addr)
238{
239 //This should only be called by with cls or MEM_* or label
240 // <op.imm>
241 // <op.reg> +/- <op.imm>
242 // <op.reg> +/- (<op.offset> <shift> <op.imm>)
243 ExprId expr;
244 if (op.cls == LABEL)
245 return il.ConstPointer(4, op.imm);
246
247 if (op.shift == SHIFT_NONE)
248 {
249 if (op.flags.offsetRegUsed == 1)
250 {
251 expr = il.Register(get_register_size(op.offset), op.offset);
252 }
253 else
254 {
255 expr = il.Const(4, op.imm);
256 }
257 }
258 else
259 {
260 if (op.flags.offsetRegUsed == 1)
261 expr = GetShiftedOffset(il, op);
262 else
263 return GetShiftedRegister(il, op);
264 }
265
266 if (op.flags.add == 1)
267 return il.Add(4, ReadRegisterOrPointer(il, op, addr), expr);
268 else
269 return il.Sub(4, ReadRegisterOrPointer(il, op, addr), expr);
270}
271
272
273static ExprId ReadILOperand(LowLevelILFunction& il, InstructionOperand& op, size_t addr, bool isPointer=false)

Callers 8

LoadFunction · 0.85
LoadExclusiveFunction · 0.85
LoadPairFunction · 0.85
LoadPairExclusiveFunction · 0.85
StoreFunction · 0.85
StoreExclusiveFunction · 0.85
StorePairFunction · 0.85
StorePairExclusiveFunction · 0.85

Calls 9

GetShiftedOffsetFunction · 0.85
ReadRegisterOrPointerFunction · 0.85
GetShiftedRegisterFunction · 0.70
get_register_sizeFunction · 0.50
ConstPointerMethod · 0.45
RegisterMethod · 0.45
ConstMethod · 0.45
AddMethod · 0.45
SubMethod · 0.45

Tested by

no test coverage detected