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

Function WriteILOperand

arch/armv7/thumb2_disasm/il_thumb2.cpp:209–233  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

207
208
209static ExprId WriteILOperand(LowLevelILFunction& il, decomp_result* instr, size_t operand, ExprId value,
210 size_t size = 4, uint32_t flags = 0)
211{
212 uint32_t reg;
213 switch (instr->format->operands[operand].type)
214 {
215 case OPERAND_FORMAT_REG:
216 reg = instr->fields[instr->format->operands[operand].field0];
217 if (reg == 15)
218 return il.Jump(value);
219 return il.SetRegister(size, GetRegisterByIndex(reg), value, flags);
220 case OPERAND_FORMAT_REG_FP:
221 reg = instr->fields[instr->format->operands[operand].field0];
222 size = GetRegisterSize(instr, operand);
223 return il.SetRegister(size, GetRegisterByIndex(reg, instr->format->operands[operand].prefix), value, flags);
224 case OPERAND_FORMAT_SP:
225 return il.SetRegister(size, armv7::REG_SP, value, flags);
226 case OPERAND_FORMAT_LR:
227 return il.SetRegister(size, armv7::REG_LR, value, flags);
228 case OPERAND_FORMAT_PC:
229 return il.Jump(value);
230 default:
231 return il.Unimplemented();
232 }
233}
234
235
236static ExprId WriteArithOperand(LowLevelILFunction& il, decomp_result* instr, ExprId value, size_t size = 4,

Callers 3

WriteArithOperandFunction · 0.70

Calls 5

GetRegisterByIndexFunction · 0.85
GetRegisterSizeFunction · 0.85
SetRegisterMethod · 0.80
JumpMethod · 0.45
UnimplementedMethod · 0.45

Tested by

no test coverage detected