First post, by MiniMax
- Rank
- Moderator
Yesterday wd came up with a little patch to get a game that required UMB's to work in DOSBox (link). The patch consisted of just 4 bytes that needed to be changed in the game EXE, but wd was faced with a little problem: How do you distribute/implement such a patch? wd settled for RAR-archivce of the EXE - much, much larger than the 4 bytes in the actual patch. The game is free to download, so there is no real harm done, but what about non-free games?
I had look-see to see if I could find a neat little program to apply such patches with. While there are many free binary/hex editors that works well in DOSBox, they are all interactive 🙁
I found a package (BDIFF123.ZIP by Toshiyuki Tanaka) that looked promising: BDIFF (to create binary patches), and BUPDATE (to apply the patch). It had a lot of nice features, but it created rather larger patches. The little 4-byte patch by 'wd' became a 33 KB bin-patch.
I also tried to use SAR.EXE, a little Search-And-Replace utility, put out by German PC magazine "c't". It supports a special notion for hex-numbers, but my test showed it could not handle 0x00 - the patched file was 4 bytes shorter than the original 🙁
BINSUB by Peter Enzerink looked promising - but it has an error whereby it skips 1 byte when it finds a partial match on the search string.
My search came to a lucky end, when I found an old version of GSAR - gsar107.zip. Unlike the newer v. 1.11, this one works with DOSBox. Using gsar, the little 4-byte UMB-patch by wd can be implemented using commands like these:
rem Options: -x32 : Show 32 bytes of hex dump context.
rem -b : Display byte offset in file of search values.
rem -o : Overwrite the input file.
gsar -s:x85:xc0:x74:x11 -r:xbb:x00:xe0:x90 -x32 -b -o TheClou.Exe
DOSBox 60 seconds guide | How to ask questions
_________________
Lenovo M58p | Core 2 Quad Q8400 @ 2.66 GHz | Radeon R7 240 | LG HL-DT-ST DVDRAM GH40N | Fedora 32