I want to explore the internal of a certain DOS4GW bound executable file. So I want to place breakpoints on 32-bit code of DOS4GW bound EXE. But I can't find how to do it on DOSBox debugger.
As you know, DOS4GW bound EXE file consists of two parts: a 16-bit DOS stub that executes dos4gw.exe, and 32-bit LE(Linear Executable) that is loaded by the dos4gw.exe loader. Of course the LE part contains the application code!
It is possible and easy to place breakpoints on 16-bit DOS stub. But I don't know how to place breakpoints on 32-bit stub.
To try to solve this problem, I tried to use DOS32A instead of DOS4GW. As you know, DOS32A is complete alternative of DOS4GW. I expected that DOS32A helps me to how to do it. Because DOS32A is open source, so I can see DOS32A internal.
I used DOS32A ver.7.35. I made the EXE file, which I want to explore, to use DOS32A instead of DOS4GW. After then, I executed the EXE file on DOSBox debug mode using command 'debug <the EXE file>'.
On 'Code Overview' of DOSBox debug window, DOS32A code is shown. It is exactly same as dos32.asm file which is included in DOS32A source code. I was happy! So I clicked 'F10' key to run step-by-step. But at line no.222 of dos32.asm file(you can see assembly code 'call far ptr pm32_init' on dos32.asm file at line 222.), I clicked 'F10' key. After then, the status of DOSBox debugger is changed from 'debug mode' to 'Running mode'. And the 32-bit stub code was executed. So I never clicked 'F10' key again.
The following is some code of dos32.asm of DOS32A ver.7.35.
mov dx,offs critical_handler
call far ptr pm32_init ; enter Protected Mode
mov _sel_cs,cs ; save PM selectors
Whan debugger's cursor is on 'call far ptr pm32_init', I clicked 'F10' key. After then, I expetecd that the cursor was on 'jc report_error'. But the cursor remained on 'call far ptr pm32_init'. And the status of debugger changed to 'Running' automatically. In other words, the 32-bit code was executed.
Is there any way to place breakpoints on the 32-bit code?
Please help me.
Sorry for my ugly english.