Execute Till User Code doesn't work

2019-07-06 06:34发布

问题:

I'm trying to use OllyDbg's "Execute Till User Code" feature (which is essential for me) but it never works.

I first tried it on a program which called MessageBoxA. When it called it I paused the program in the debugger and issued OllyDbg to execute till user code, but the program was still paused and completely frozen. I couldn't even click the MessageBox's OK button, or even make it continue from OllyDbg. When I tried too hard to make it continue it just crashed.

So I decided to write an application in NASM (to have complete control) and tried it there. The MessageBoxA popped, I paused, executed till user code, I could press the OK button this time, but OllyDbg didn't pause the program once I did. The program just executed as if nothing happened.

Why doesn't it work and what can I do to solve it?

OllyDbg 1.10 (No Plugins)
Windows 7 Ultimate SP1 64-bit

Update:
I've tried to use OllyDbg 2.0 but the Execute till user code button is completely disabled for some reason.

回答1:

I ran into the same issue while following Lena's tutorial #4 and I think I've figured it out. When I press Alt+F9 to "Execute Until User Code," I notice that all but one thread in the Threads window (Alt+T) have the suspend flag set. Evidently, Alt+F9 only resumes one thread. Fortunately, OllyDbg has the ability to manually resume the other threads by right clicking on them and selecting "Resume" (or by using the + key). For me, this was sufficient both to unfreeze the dialog and to get OllyDbg to pause immediately after the call to MessageBoxA.