MCPcopy Create free account
hub / github.com/GJDuck/e9patch / tactic_B2

Function tactic_B2

src/e9patch/e9tactics.cpp:469–480  ·  view source on GitHub ↗

* Tactic B2: replace the instruction with a punned jump. */

Source from the content-addressed store, hash-verified

467 * Tactic B2: replace the instruction with a punned jump.
468 */
469static Patch *tactic_B2(Binary &B, Instr *I, const Trampoline *T,
470 Tactic tactic = TACTIC_B2)
471{
472 if (I->size >= JMP_SIZE || !option_tactic_B2 || !canPatch(I))
473 return nullptr;
474 const Alloc *A = allocatePunnedJump(B, I, /*offset=*/0, I, T);
475 if (A == nullptr)
476 return nullptr;
477 Patch *P = new Patch(I, tactic, A);
478 patchJump(P, /*offset=*/0);
479 return P;
480}
481
482/*
483 * Tactic T1: replace the instruction with a prefixed punned jump.

Callers 5

tactic_T2Function · 0.85
tactic_T3bFunction · 0.85
tactic_T3Function · 0.85
tactic_T0Function · 0.85
patchFunction · 0.85

Calls 3

canPatchFunction · 0.85
allocatePunnedJumpFunction · 0.85
patchJumpFunction · 0.85

Tested by

no test coverage detected