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

Function undo

src/e9patch/e9tactics.cpp:161–177  ·  view source on GitHub ↗

* Undo the application of a patch. */

Source from the content-addressed store, hash-verified

159 * Undo the application of a patch.
160 */
161static void undo(Binary &B, Patch *P)
162{
163 while (P != nullptr)
164 {
165 P->I->is_patched = P->original.is_patched;
166 P->I->is_evicted = false;
167 for (unsigned i = 0; i < PATCH_MAX; i++)
168 {
169 P->I->STATE[i] = P->original.state[i];
170 P->I->PATCH[i] = P->original.bytes[i];
171 }
172 deallocate(&B, P->A);
173 Patch *Q = P;
174 P = P->next;
175 delete Q;
176 }
177}
178
179/*
180 * Calculate trampoline bounds.

Callers 4

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

Calls 1

deallocateFunction · 0.85

Tested by

no test coverage detected