First post, by FabulousFurlough
I'm an old school DOS games cracker, and throughout my career one thing that I always heard was "But did you ever crack Pirates!"? And the answer was always "No". Well, the time has come. I have an image of the original boot disk (Booter as you guys call it), and it runs under DOSBox. So, I need to debug it. Being a booter like it is, that means that the boot sector is loaded into 0000:7C00, and jumped to. I would like to add an option to the BOOT command (-D maybe?), that would break at 0000:7C00. I've found the "boot.com" code in dos_programs.cpp, and I've found the debugger stuff in debug.cpp. I added a DEBUG_AddBreakpoint function:
void DEBUG_AddBreakpoint(Bit16u seg, Bit32u off, bool once)
{
CBreakpoint::AddBreakpoint(seg, off, once);
}
And I added a call to it from boot:
/* set up stack at a safe place */
SegSet16(ss, 0x7000);
reg_esp = 0x100;
reg_esi = 0;
reg_ecx = 1;
reg_ebp = 0;
reg_eax = 0;
reg_edx = 0; //Head 0 drive 0
reg_ebx= 0x7c00; //Real code probably uses bx to load the image
DEBUG_AddBreakpoint(0, 0x7C00, true);
But when I run the boot command, it doesn't stop. Is the debugger not initialized yet? Did I miss something stupid? (Like the breakpoint is added disabled?)
Thanks guys, and keep up the great work!