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

Function ByteReversedLoad

arch/powerpc/il.cpp:458–474  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

456
457
458static void ByteReversedLoad(LowLevelILFunction &il, struct cs_ppc* ppc, size_t size, size_t addressSize_a=4)
459{
460 ExprId addr = operToIL(il, &ppc->operands[1], OTI_GPR0_ZERO, PPC_IL_EXTRA_DEFAULT, addressSize_a); // (rA|0)
461 ExprId val = il.Load(size, il.Add(addressSize_a, addr, operToIL_a(il, &ppc->operands[2], addressSize_a))); // [(rA|0) + (rB)]
462
463 if (size < addressSize_a)
464 {
465 val = il.ZeroExtend(addressSize_a, val);
466 }
467
468 /* set reg immediately; this will cause xrefs to be sized correctly,
469 * we'll use this as the scratch while we calculate the swapped value */
470 il.AddInstruction(il.SetRegister(addressSize_a, ppc->operands[0].reg, val)); // rD = [(rA|0) + (rB)]
471 ExprId swap = ByteReverseRegister(il, ppc->operands[0].reg, size);
472
473 il.AddInstruction(il.SetRegister(addressSize_a, ppc->operands[0].reg, swap)); // rD = swap([(rA|0) + (rB)])
474}
475
476static void ByteReversedStore(LowLevelILFunction &il, struct cs_ppc* ppc, size_t size, size_t addressSize_a=4)
477{

Callers

nothing calls this directly

Calls 7

operToILFunction · 0.85
ByteReverseRegisterFunction · 0.85
SetRegisterMethod · 0.80
LoadMethod · 0.45
AddMethod · 0.45
ZeroExtendMethod · 0.45
AddInstructionMethod · 0.45

Tested by

no test coverage detected