Program run under x64dbg goes immediately to completion

2.8k Views Asked by At

I'm using the x64dbg debugger from SourceForge under Windows 10, and I've been having a problem with it that I think is probably due to my own stupidity somehow, but so far I can't pin it down.

I'm using the MASM assembler, and when I'm working on a problem I will typically write a program consisting of only a few instructions, and then trace it with debugger to see exactly what's happening in a simple context.

I've been using a program called temp1 for a few weeks, and now suddenly when I run this program with the debugger, the debug data flashes for a fraction of a second on the x64dbg screen, and then the program runs to completion, as if I had clicked Debug → Run with no breakpoints.

I tried adding more instructions to the program, but the result was still the same. So then I renamed the program to bozo, and assembled and linked it under that name, with only two instructions in it. When I run bozo.exe under x64dbg, it stops on the first instruction with no problem.

What could be going on here? How can just using a different program name change the way the debugger behaves?

2

There are 2 best solutions below

0
Alicia On

Go to Options → Preferences (Settings), and in the Events tab make sure to have entry breakpoint selected, so x64dbg breaks at the entry of your program, before it does anything.

0
MarianD On

x64dbg saves settings, breakpoints, comments, etc. on the debugee file name basis - in the so-called "database".

For example, if your debugee was bozo.exe 64-bit executable, its database is saved in the bozo.exe.dd64 file to keep your setting for future work with the same (bozo.exe) file.

The full path is something as

c:\Program Files\x64dbg\x64\db\bozo.exe.dd64

but it is not important as it is loaded automatically after opening / attaching the debugee bozo.exe.

It explains why the simple file-name change (which creates a new database with the default settings) may change the behavior of the debugger.

(The rest of the explanation is in the Alicia's answer.)