1
0
Fork 0

DBG: workaround for pausing certain applications that are stuck in NtUserGetMessage

This commit is contained in:
mrexodia 2017-06-27 03:13:32 +02:00
parent b8248630c2
commit 2588f7dc3e
No known key found for this signature in database
GPG Key ID: FC89E0AAA0C1AAD8
1 changed files with 5 additions and 1 deletions

View File

@ -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"));