From 2588f7dc3e89ff4b5b26f3ec69f83bd51c13bc7f Mon Sep 17 00:00:00 2001 From: mrexodia Date: Tue, 27 Jun 2017 03:13:32 +0200 Subject: [PATCH] DBG: workaround for pausing certain applications that are stuck in NtUserGetMessage --- src/dbg/commands/cmd-debug-control.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/dbg/commands/cmd-debug-control.cpp b/src/dbg/commands/cmd-debug-control.cpp index f8dd7aba..7ad4bcce 100644 --- a/src/dbg/commands/cmd-debug-control.cpp +++ b/src/dbg/commands/cmd-debug-control.cpp @@ -11,6 +11,7 @@ #include "value.h" #include "TraceRecord.h" #include "handle.h" +#include "thread.h" static bool skipInt3Stepping(int argc, char* argv[]) { @@ -266,7 +267,10 @@ bool cbDebugPause(int argc, char* argv[]) } return false; } - dbgsetispausedbyuser(true); + //WORKAROUND: If a program is stuck in NtUserGetMessage (GetMessage was called), this + //will send a WM_NULL to stop the waiting. This only works if the message is not filtered. + //OllyDbg also does this in a similar way. + PostThreadMessageA(ThreadGetId(hActiveThread), WM_NULL, 0, 0); if(ResumeThread(hActiveThread) == -1) { dputs(QT_TRANSLATE_NOOP("DBG", "Error resuming thread"));