5

DOSbox compiled with --enable-debug=heavy option becomes a powerful reversing tool. Anytime I feel like checking the disassembly and memory state I just hit Alt+Pause.

But, what if I want to see the very first instructions of the program ? How do I start the application so that it immediately enters debug mode before even starting execution ?

perror
  • 19,083
  • 29
  • 87
  • 150
ScumCoder
  • 609
  • 1
  • 7
  • 12
  • I can't find anything about the debug mode on the wiki page. The only place where I found any info was this post on VOGONS. – ScumCoder Aug 07 '14 at 15:30
  • 3
    DOSBox may be heavily documented and open source. But, i think "How do i accomplish (X) in (Y)", where (Y) is a reverse engineering tool, is a valid question even if (Y) is heavily documented and open source. – Guntram Blohm Aug 07 '14 at 15:43
  • 1
    @GuntramBlohm: Fair enough; I've retracted my close-vote and my previous comments. Thanks for presenting a reasonable argument. – Jason Geffner Aug 07 '14 at 16:54

1 Answers1

8

If you build with --enable-debug[=heavy] and run the program via debug.com, it automatically breaks on the first instruction. See the DOS_Execute function in src/dos/dos_execute.cpp and DEBUG_CheckExecuteBreakpoint in src/debug/debug.cpp.

broadway
  • 1,581
  • 8
  • 18
  • 1
    Whoa, thank you SO much. I didn't read your answer in time and out of despair made an ugly patch to the DOSbox source which does exactly the same. – ScumCoder Aug 10 '14 at 11:57