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

Function tactic_B0

src/e9patch/e9tactics.cpp:436–447  ·  view source on GitHub ↗

* Tactic B0: replace the instruction with an illegal instruction. */

Source from the content-addressed store, hash-verified

434 * Tactic B0: replace the instruction with an illegal instruction.
435 */
436static Patch *tactic_B0(Binary &B, Instr *I, const Trampoline *T)
437{
438 if (!option_tactic_B0)
439 return nullptr;
440 const Alloc *A = allocateTrap(B, I, T);
441 if (A == nullptr)
442 return nullptr;
443 Patch *P = new Patch(I, TACTIC_B0, A);
444 patchTrap(P);
445 patchUnused(P, /*offset=sizeof(illegal)=*/1);
446 return P;
447}
448
449/*
450 * Tactic B1: replace the instruction with a jump.

Callers 1

patchFunction · 0.85

Calls 3

allocateTrapFunction · 0.85
patchTrapFunction · 0.85
patchUnusedFunction · 0.85

Tested by

no test coverage detected