Text File
The name:
DMPATCH.EXE
The purpose:
To allow simple, consistent ways to patch the DOOM executable.
The program:
This is a very simple patch program. It was written with DOOM in
mind, but should be able to be used with almost any file (with some
things in mind, see caveats). I wrote it to be flexible, and made
it allow easy patches to different versions of the executable.
This program takes either 1 or 2 command line arguments. If there
are two command line arguments, the first is the name of the file,
and the second is the offset in the file to make the modifications.
If there is only one argument, it is the offset into the file. In
this case, the file 'doom.exe' in the current directory is assumed
to be the file to edit.
After the program starts, and it does a few things, it will ask you
how many bytes you want to change. Enter the amount you desire.
Now the program will put you in a rather crude editing mode. The
current values at the requested address will be display, and a
"_" will be shown a couple of lines below. This represents the
current editing position. You may enter in the patch values you
want. If you make a mistake, the backspace should work; however,
I wouldn't count on it 100%. Try not to make mistakes, and don't
start without backing up the original.
After you have entered the correct number of bytes, the program will
display what you entered and ask if that is OK to patch. If you
say yes, the program will patch the addresses and drop you out on the
DOS command line. Otherwise, it will just drop you out in DOS that
much faster.
The good:
I am trying to get a consistent way to publish the many things I
have found about the executable in a way that will help most people.
I will organize this into some sort of table ASAP. I am always
welcome to new entries from anyone, and will also field requests
to figure out patches to do new things.
The bad:
This program will modify your executable. If you enter erroneous
information, you could DESTROY your executable. Please backup the
DOOM.EXE (or whatever other file you are patching) before beginning.
I have tried to make sure it is stable, but we all know how that
goes. If anyone catches anything I missed (bugs that is), I would
appreciate a line.
The ugly:
MY INTERFACE.
This program is crude. It is not user friendly. I did not spend a
lot of time on it. If you have suggestions for interface or other
modifications/additions, I would love to hear them (particularly if
they are not too complex to implement).
The example:
Say I want to change 4 bytes at hex offset 8ab48 in doom.exe (which is in
the current directory)
dmpatch 8ab48
Then enter 4 when it asks how many bytes to change, etc, etc.
Say I want to change 6 bytes at hex offset 12af9 in \games\doom\doom.exe
(which is NOT in the current directory)
dmpatch \games\doom\doom.exe 12af9
Then enter 6 when it asks how many bytes to change, etc, etc.
The caveats:
I wrote this for my own use. For this reason, I wrote it to be
most compatible with the disassembler I use. The disassembler that
I use does some weird segmenting stuff with the DOS4GW header, and
hence, subtracts 1dd0 (hex) from each address (ie: offset 5dd0 in the
file appears as 4000). So, the patch values that I supply will be
1dd0 (hex) less than their actual offset in the file. If you are
going to use this program on a file other than DOOM, keep this in mind.
The request:
I would love to have some help disassembling doom.exe. If anyone has
done any of this and would like to share it with me, I will add it
to what I have already (and of course give credit where due). I think
we could get a pretty decent list pretty quick with a few peoples
input.
The BS:
I wrote this program for my own use. I am releasing it into public
domain so that others can use it to. I make no guarantees express
or otherwise about its operation. If you can't deal with that, don't
use it. I will not accept responsibility for how this program is
used (particularly if it is illegal), or what it does to your
information if you use it wrong or there is a bug in it. The program
may be freely distributed.
ID software has no knowledge (to my knowledge) of this software and
is in no way affiliated with it. They cannot be held responsible for
it in any way.
Please any suggestions/observations/etc e-mail to me.
Steve Larsen
larsen@sunset.cs.utah.edu
larsen@unislc.slc.unisys.com