• Debugging 16 bit dos programs

    From Nelgin@VERT/EOTLBBS to All on Friday, July 21, 2023 05:17:38
    Hi all,

    I've been looking for a utility that will let me step through a dos program and look at the instructions while also being able to see what is displayed on the screen. I've not had much luck in finding anything that'll do the job and open to suggestions if anyone knows of something that'll do the job.

    Thanks,
    ---
    þ Synchronet þ End Of The Line BBS - endofthelinebbs.com
  • From Bencollver@VERT/EOTLBBS to Nelgin on Friday, July 21, 2023 08:54:48
    Re: Debugging 16 bit dos programs
    By: Nelgin to All on Fri Jul 21 2023 05:17:38

    I've been looking for a utility that will let me step through a dos
    program and look at the instructions while also being able to see what
    is displayed on the screen. I've not had much luck in finding anything that'll do the job and open to suggestions if anyone knows of something that'll do the job.

    Just brainstorming:

    1) Use a serial port connected to a terminal emulator

    DOS console:
    ctty com1

    Terminal emulator:
    debug.com prog.exe

    2) Dosbox debugger

    https://www.vogons.org/viewtopic.php?t=3944

    3) Bochs debugger

    https://wiki.osdev.org/Bochs#Bochs_debugging_facilities

    I have also seen utilities that support multi-headed PC configurations, commonly a combination of CGA and Hercules adapters. Unfortunately, i
    do not remember which debugger supports that.
    ---
    þ Synchronet þ End Of The Line BBS - endofthelinebbs.com
  • From Digital Man@VERT to Nelgin on Friday, July 21, 2023 12:27:46
    Re: Debugging 16 bit dos programs
    By: Nelgin to All on Fri Jul 21 2023 05:17 am

    Hi all,

    I've been looking for a utility that will let me step through a dos program and look at the instructions while also being able to see what is displayed on the screen. I've not had much luck in finding anything that'll do the job and open to suggestions if anyone knows of something that'll do the job.

    debug.exe is included with MS-DOS, isn't it?
    --
    digital man (rob)

    Rush quote #64:
    He's cleaning up his systems to keep his nature pure .. New World Man
    Norco, CA WX: 86.1øF, 50.0% humidity, 10 mph SSW wind, 0.00 inches rain/24hrs

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Nightfox@VERT/DIGDIST to Nelgin on Friday, July 21, 2023 13:16:33
    Re: Debugging 16 bit dos programs
    By: Nelgin to All on Fri Jul 21 2023 05:17 am

    I've been looking for a utility that will let me step through a dos program and look at the instructions while also being able to see what is displayed on the screen. I've not had much luck in finding anything that'll do the job and open to suggestions if anyone knows of something that'll do the job.

    If you do that, you'll be seeing assembly code, and it will be without any meaningful variable names, etc.. IMO it tends to be more challenging to debug that than with higher-level code.

    Nightfox

    ---
    þ Synchronet þ Digital Distortion: digitaldistortionbbs.com
  • From fusion@VERT/CFBBS to Bencollver on Friday, July 21, 2023 23:55:00
    On 21 Jul 2023, Bencollver said the following...

    2) Dosbox debugger

    https://www.vogons.org/viewtopic.php?t=3944

    i use this to crack stuff/generate keys for doors all the time lol

    on linux at least you just build the version with the debugger enabled:

    ./configure --enable-debug=heavy (i use slackware and just edited the slackbuild to include that param)

    launch it from an xterm with the window pretty big, and inside dosbox when you run the door you just do 'debug door.exe' like the other example. that'll load the program and then stop at the entry point. then you just press F10/F11 repeatedly for the rest of your life.

    as a really easy example, for arrowbridge 2 you can generate a custom key by stepping through until it shows the registered message from the free key, dumping the entire memory with MEMDUMPBIN 0:0 640000 and then searching for the free key in that file and writing down the addresses of each instance.

    then put in your bbs name and sysop name, a junk key, and then dump the memory again.. one of the locations you wrote down will now have the correct key to use for your sysop/bbs name.

    "Betrayal of the Obsidian Baboon" also worked out almost the same way.

    if you have the free version of IDA (linked somewhere on the dosbox website) it's also definitely helpful. for example if you find a place where an unregistered message shows, and it checks a variable to decide whether to show that message, you can search everywhere that variable is used in IDA and find where it's set. often it's something really easy like:

    if (reg key is good) then
    registered = true
    else
    registered = false

    .. you can change one byte in the .exe so both of those are 'true'

    congrats, you wasted potentially a lot of time ;)

    --- Mystic BBS v1.12 A47 2021/12/25 (Windows/32)
    * Origin: cold fusion - cfbbs.net - grand rapids, mi
  • From Dr. What@VERT/THEGATEB to Nightfox on Saturday, July 22, 2023 08:21:00
    Nightfox wrote to Nelgin <=-

    If you do that, you'll be seeing assembly code, and it will be without
    any meaningful variable names, etc.. IMO it tends to be more
    challenging to debug that than with higher-level code.

    Unless the program you are debugging was compiled in debug mode, there won't be any meaningful variables names anyway.


    ... Rudolph changed his nose to 500 watts. Blew a fuse.
    --- MultiMail/Linux v0.52
    þ Synchronet þ ** The Gate BBS - Shelby, NC - thegateb.synchro.net **
  • From Nightfox@VERT/DIGDIST to Dr. What on Saturday, July 22, 2023 08:11:49
    Re: Debugging 16 bit dos prog
    By: Dr. What to Nightfox on Sat Jul 22 2023 08:21 am

    If you do that, you'll be seeing assembly code, and it will be
    without any meaningful variable names, etc.. IMO it tends to be
    more challenging to debug that than with higher-level code.

    Unless the program you are debugging was compiled in debug mode, there won't be any meaningful variables names anyway.

    Yeah, but who releases a program built in debug mode? Normally, a debug build would only be used by developers while developing the program. When releasing it, a release build makes the most sense. A release build runs faster; also, many software companies wouldn't want people to easily reverse-engineer their binaries.

    Nightfox

    ---
    þ Synchronet þ Digital Distortion: digitaldistortionbbs.com
  • From Dr. What@VERT/THEGATEB to Nightfox on Sunday, July 23, 2023 08:11:00
    Nightfox wrote to Dr. What <=-

    Unless the program you are debugging was compiled in debug mode, there won't be any meaningful variables names anyway.

    Yeah, but who releases a program built in debug mode?

    Nobody, which was my point.

    If you want to step through someone else's software in a debugger, it will be in assembly language.


    ... Fools and their money become popular quickly.
    --- MultiMail/Linux v0.52
    þ Synchronet þ ** The Gate BBS - Shelby, NC - thegateb.synchro.net **
  • From Nelgin@VERT/EOTLBBS to Digital Man on Wednesday, August 09, 2023 23:33:39
    Re: Debugging 16 bit dos programs
    By: Digital Man to Nelgin on Fri Jul 21 2023 12:27:46

    I've been looking for a utility that will let me step through a dos program and look at the instructions while also being able to see what is displayed on the screen. I've not had much luck in finding anything that'll do the job and open to suggestions if anyone knows of something that'll do the job.

    debug.exe is included with MS-DOS, isn't it?

    I don't think that also shows you the program running in real time along with the debug lines.
    ---
    þ Synchronet þ End Of The Line BBS - endofthelinebbs.com
  • From Digital Man@VERT to Nelgin on Wednesday, August 09, 2023 22:36:17
    Re: Debugging 16 bit dos programs
    By: Nelgin to Digital Man on Wed Aug 09 2023 11:33 pm

    Re: Debugging 16 bit dos programs
    By: Digital Man to Nelgin on Fri Jul 21 2023 12:27:46

    I've been looking for a utility that will let me step through a dos program and look at the instructions while also being able to see what is displayed on the screen. I've not had much luck in finding anything that'll do the job and open to suggestions if anyone knows of something that'll do the job.

    debug.exe is included with MS-DOS, isn't it?

    I don't think that also shows you the program running in real time along with the debug lines.

    It lets you set break points, examine registers, memory, stack. Those are the pretty standard features of a debugger. "Debug lines" aren't really a standard thing, certainly MS-DOS had no such concept.
    --
    digital man (rob)

    Sling Blade quote #13:
    Karl: He lives inside of his own heart. That's an awful big place to live in. Norco, CA WX: 67.5øF, 91.0% humidity, 0 mph ESE wind, 0.00 inches rain/24hrs ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net