Skip to content

Commit

Permalink
evalCall also restore registers on error
Browse files Browse the repository at this point in the history
  • Loading branch information
yuxiaomao committed Jun 13, 2024
1 parent 878f0f5 commit 99476d8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions hld/Eval.hx
Original file line number Diff line number Diff line change
Expand Up @@ -491,12 +491,12 @@ class Eval {
api.flush(eip, asmSize);
var ptr = api.readRegister(currentThread, Eax);
var nip = api.readRegister(currentThread, Eip).sub(eip);
var hasError = nip != asmSize;
if( hasError )
throw "Exception has occured";
api.writeRegister(currentThread, Eax, prevEax);
api.writeRegister(currentThread, Eip, eip);
api.writeRegister(currentThread, Esp, oldStack);
var hasError = nip != asmSize;
if( hasError )
throw "Exception has occured";
return convertVal(ptr, tret);
}

Expand Down

0 comments on commit 99476d8

Please sign in to comment.