0

I have 32 bit MS-DOS app, run with dos4g.exe. I have package of dos4g and found d32.exe debugger in it. I run debugger with my app using bat file:

d32.exe myapp.exe

But after start d32.exe it stops not on main() of myapp.exe. d32.exe stops on code of dow4g.exe. How find main() in myapp.exe using d32.exe? I tried use this way: I open myapp.exe with IDA, and using info from IDA tried to find main() in myapp.exe in d32.exe. But as I understood, when d32.exe run with myapp.exe, myapp.exe dont exists in memory, not loaded yet by dos4g.exe. How find main() in myapp.exe when d32.exe starts?

black4
  • 333
  • 1
  • 6
  • 1
    I'm assuming your question is about looking for a good breakpoint after it's been loaded but before it transitions to 32-bit pmode. I haven't used DOS/4GW in decades so I don't recall the details, but it has to take a far branch from 16-bit before it actually executes your 32-bit code. Look for a far jmp, or a 48-bit iret (the ones that include the segment) which should transition you to 32-bit, then look somewhere after that to find where execution is handed off to your program. – Ali Rizvi-Santiago Dec 22 '23 at 05:38
  • Thanks a lot. At the same time, I looked at the code in IDA - I found the entry point of my app, then in IDA I looked at the address of the main function. When I run d32.exe, I subtract the entry point address (from IDA) from the start address of d32.exe, add the address of the main() function (from IDA) and go to main in d32. The formula is: start address d32.exe minus entry point (from IDA) plus main address (from IDA). But main in IDA has offset, need calculate absolute offset of main in IDA. – black4 Dec 23 '23 at 16:11
  • 1
    Write a python function. You could then call it whenever you need it or map it to a key. If you have questions about how to script that stuff in IDAPython, you should prolly create another question. – Ali Rizvi-Santiago Dec 23 '23 at 19:25

0 Answers0