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

Function state_check

test/regtest/patch.cpp:461–489  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

459}
460
461void state_check(const void *addr, const void *state_0, intptr_t rsp,
462 intptr_t rax, intptr_t r15)
463{
464 const STATE *state = (const STATE *)state_0;
465 if (rsp != state->rsp)
466 {
467 fprintf(stderr, "%p: %%rsp mismatch (0x%lx vs 0x%lx)\n", addr, rsp,
468 state->rsp);
469 abort();
470 }
471 if ((intptr_t)addr != state->rip)
472 {
473 fprintf(stderr, "%p: %%rip mismatch (0x%p vs 0x%lx)\n", addr, addr,
474 state->rip);
475 abort();
476 }
477 if (rax != state->rax)
478 {
479 fprintf(stderr, "%p: %%rax mismatch (0x%lx vs 0x%lx)\n", addr, rax,
480 state->rax);
481 abort();
482 }
483 if (r15 != state->r15)
484 {
485 fprintf(stderr, "%p: %%r15 mismatch (0x%lx vs 0x%lx)\n", addr, r15,
486 state->r15);
487 abort();
488 }
489}
490
491struct NODE
492{

Callers

nothing calls this directly

Calls 2

abortFunction · 0.85
fprintfFunction · 0.50

Tested by

no test coverage detected