?
Solved

Use debug.exe in MS-DOS 6.22

Posted on 1999-12-08
9
Medium Priority
?
1,046 Views
Last Modified: 2012-06-27
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 ...
0
Comment
Question by:witty
  • 3
  • 3
  • 2
  • +1
9 Comments
 
LVL 1

Expert Comment

by:DARKMOON
ID: 2271266
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
 
LVL 1

Author Comment

by:witty
ID: 2272431
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
 
LVL 1

Expert Comment

by:BrainMaster
ID: 2273476
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
Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

 
LVL 1

Expert Comment

by:BrainMaster
ID: 2273492
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
 

Expert Comment

by:demonknight01
ID: 2280456
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
 
LVL 1

Expert Comment

by:BrainMaster
ID: 2281845
yeah, also dos usually comes with qbasic and it would be easier to code and script run it.
0
 
LVL 1

Expert Comment

by:DARKMOON
ID: 2282409
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
 
LVL 1

Author Comment

by:witty
ID: 2283175
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
 
LVL 1

Accepted Solution

by:
DARKMOON earned 400 total points
ID: 2286024
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

Featured Post

Learn to develop an Android App

Want to increase your earning potential in 2018? Pad your resume with app building experience. Learn how with this hands-on course.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hello I read in a discussion about a person who configured a very simple mirror RAID with two hard drives; the system and data were on the same partition. He asked how to repair the system as it was not booting up anymore. In his case running …
Windows 10 is here and for most admins this means frustration and challenges getting that first working Windows 10 image. As in my previous sysprep articles, I've put together a simple help guide to get you through this process. The aim is to achiev…
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

601 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question