I'm trying to debug a game and it's closing under few circumstances:
- When debugging (solved by hooking IsDebuggerPresent to return false when called by the game)
- When setting a memory/hardware breakpoint to see what reads/writes
Testing with x64dbg and cheat engine, I'm getting the same results with both tools
I can debug some functions and put breakpoints in opcodes to see the program workflow (for example IsDebuggerPresent, I can set a breakpoint there and step in) but I'm not sure if I can do it everywhere
The final goal is learning to identify functions by checking what reads/writes on values
Here are all breakpoints I've checked without results, the game closes directly:
Should I trace who is closing the game to disable it? Or should I debug it differently? If I have to trace, how can I do that if it doesn't hit the breakpoints when closing?


RtlQueryPerformanceCounterthen some check, and thenExitProcess, which is a common anti-debugging technique. You are dealing with some anti-debugging features. If these anti-debugging attributes are of no interest to you, you can use a x64dbg plugins that try to bypass them. Have you tried hardware breakpoints?