In the last week I've attempted maybe 3 times to debug a game in DOSBox (Fallout 1 DOS version), and the game uses DOS/4G to extend itself to 32-bit protected mode. The program has a DOS stub which then calls DOS/4G with the game as parameter, which then goes directly for the Linear Executable (LE) header and starts the program there.
I can debug a program with no problems if DOS/4G is not used. Though, from the moment DOS/4G initiates the game, the addresses go nuts and I don't understand why it happens.
From what is on the header, the code segment should start at 0x44000
and have size DB000
(so going up to 0x11EFFF
). So far so good, except that on DOSBox Debugger, addresses go to 7 digits, and also happens on Oracle VM VirtualBox with actual MS-DOS 6.22 with OpenWatcom Debugger.
So, does anyone know if DOS/4G or DOS/32 change the relocation addresses? Wouldn't that break the program anyway because of references from different sections? (I'm kind of a beginner on RE)
I'd at least like to know where I am when debugging. If I'm on “random” addresses, I can't compare with IDA and see where I am and go to some address because I've got exactly no idea where the code I see on the debugger is. On OpenWatcom Debugger I don't see a hex dump, but on DOSBox Debugger I do. I've tried to search for the hex values and nothing came up on HxD --> ????? This is confusing, can't be that hard to debug a DOS/4G program.
Any help on understanding what's happening here is appreciated!