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

Function patchTrap

src/e9patch/e9tactics.cpp:390–397  ·  view source on GitHub ↗

* Patch in a trap (illegal) instruction. */

Source from the content-addressed store, hash-verified

388 * Patch in a trap (illegal) instruction.
389 */
390static void patchTrap(Patch *P)
391{
392 uint8_t *bytes = P->I->PATCH,
393 *state = P->I->STATE;
394 assert(*state == STATE_INSTRUCTION || *state == STATE_FREE);
395 bytes[0] = 0x27; // Invalid x86_64 opcode
396 state[0] = STATE_PATCHED;
397}
398
399/*
400 * Patch in unused memory.

Callers 1

tactic_B0Function · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected