0

What happens if you try to debug yourself ? I mean, does the process crash ? If it is possible, how would you implement it ?

I have tried launching x64dbg and I can't attach to my own x64dbg process.

Thank you!

2
  • Hi and welcome to RE.SE. It would likely end up in a deadlock situation, since the debugger loop - which could conceivably be in a separate thread - would inevitably break at some point, but there is no one to act on it. Is this out of curiosity? Otherwise, could you explain what it is you're trying to achieve rather than what you're doing?! – 0xC0000022L Dec 17 '20 at 8:06
  • Hello, thank you for answering! It is just for curiosity haha – beauthi Dec 17 '20 at 14:49
1

Usually it’s not possible because one process must control the other and most debugging commands (e.g. reading or writing registers) need the target process to be stopped.

A common approach is run a copy of itself as a separate process (can be done on Unix systems using fork()) and debug that. In theory you could implement a custom debug-like functionality using signal or exception handlers or low level APIs but this is definitely something that would require a lot of work and unlikely to be very robust.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.