From b4df671222c7e17bb065a5459f9a88d96b372e06 Mon Sep 17 00:00:00 2001 From: "Mr. eXoDia" Date: Wed, 18 Jun 2014 21:23:52 +0200 Subject: [PATCH] DBG: fixed a potential bug with running a script and then exiting x64_dbg --- x64_dbg_dbg/simplescript.cpp | 4 ++++ x64_dbg_dbg/x64_dbg.cpp | 1 + 2 files changed, 5 insertions(+) diff --git a/x64_dbg_dbg/simplescript.cpp b/x64_dbg_dbg/simplescript.cpp index 52bd499d..9e18dab4 100644 --- a/x64_dbg_dbg/simplescript.cpp +++ b/x64_dbg_dbg/simplescript.cpp @@ -599,7 +599,11 @@ bool scriptcmdexec(const char* command) void scriptabort() { if(bIsRunning) + { bAbort=true; + while(bIsRunning) + Sleep(1); + } else //reset the script scriptsetip(0); } diff --git a/x64_dbg_dbg/x64_dbg.cpp b/x64_dbg_dbg/x64_dbg.cpp index ae75ca39..018246b1 100644 --- a/x64_dbg_dbg/x64_dbg.cpp +++ b/x64_dbg_dbg/x64_dbg.cpp @@ -253,6 +253,7 @@ extern "C" DLL_EXPORT const char* _dbg_dbginit() extern "C" DLL_EXPORT void _dbg_dbgexitsignal() { cbStopDebug(0, 0); + scriptabort(); wait(WAITID_STOP); //after this, debugging stopped pluginunload(); TerminateThread(hCommandLoopThread, 0);