Use debug.exe in MS-DOS 6.22

I have a binary configfile for a program. There is an additional program, to generate and alter the configfile - but this prog is *very* unhandy and not easy to understand!
I found out, which byte in this configfile is responsible for the setting I want - and so I can change it much faster with a diskeditor!!
So my question:
I think I can make "debug" doing this job as batch! - but I don't know how to use it to change specific bytes in a file!
Please give me an example, or an URL with examples ...
LVL 1
wittyAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

DARKMOONCommented:
Hello Witty!!

Actually I dont know any URL about using DEBUG.  But I have used this when I was in college.  All I can remember is that after running DEBUG, you can type the "?" next to the "-" which will show all possible commands.
If you  know the exact address of what you want to edit u can type L plus the address.  Im not sure if its L actually but I suggest u check on the help (?).

0
wittyAuthor Commented:
Yes - I know, there's the help, but I remember of something, that you have to add some offset to the adress you have to edit - therefore I need more info than the help I get with "?"!

thanks
witty
0
BrainMasterCommented:
What's the exact size of this file (in bytes)? And also you just want to *change* one byte and not delete and byte or add any bytes?
0
Cloud Class® Course: SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

BrainMasterCommented:
I didn't really get that much into assembly but throw in some info...

Looking at a book I have on assembly and debug I see that the L command is like this:
L <load segment> <drive> <sector> <# of sectors to read>

You would need to find the exact sector where this file is and it most likly would change on different computers. So you would need to look at the FAT tables themselves which at be at different locations depending on the kind of media it's on. This is beond what I know so perhaps there's a better way but it doesn't look it would be easy to do.

For writing back to disk seems easier:
N <filename> (not sure if you can chose a path)
you then set BX:CX to the length of the file.
then just type W to write it to disk.
0
demonknight01Commented:
if you know any c/c++ this problem can easily be addressed with just a few lines of code. i would post them now, but i dont have the time..

0
BrainMasterCommented:
yeah, also dos usually comes with qbasic and it would be easier to code and script run it.
0
DARKMOONCommented:
with regards to L, you can try L 100,n which would list segments starting from 100 and so on, from there u can reference the last segment listed and used it again to look to the segment address where the code u would want to edit.

Example:

-L 100
xxxx:0100 mov ah, bla bla
xxxx:0100
xxxx:0100
:
:
:
xxxx:0340
-L 0340 (to start from here)

Hope this helps


0
wittyAuthor Commented:
Tanks Darkmoon, this is excactly what I wanted!
Can you please tell me, how to load a file into debug (as parameter or at "-" in the program) and how to save it (under another name ...)!

If you write an answer, instead a comment, I will grade you ;-) !!!

thanks
witty
0
DARKMOONCommented:
well to load a file to debug, u can actually indicate the filename after debug, "debug x.com"

if u r saving, u can use N, like N c:\filename

hope this helps
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Operating Systems

From novice to tech pro — start learning today.