VOGONS

Common searches


First post, by MiniMax

User metadata
Rank Moderator
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

Reply 2 of 11, by MiniMax

User metadata
Rank Moderator
Rank
Moderator

In what way would it be better? Enabling patches to with sligthly different version of the original game?

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

Reply 3 of 11, by Qbix

User metadata
Rank DOSBox Author
Rank
DOSBox Author

i think a 33 kb patch is quite acceptable
especially if it prompts on where to find the executable

Water flows down the stream
How to ask questions the smart way!

Reply 4 of 11, by HunterZ

User metadata
Rank l33t++
Rank
l33t++

It would be better because you'd just have to post a little patch file and a link to where to get the patch utility. Some patchers can even check to make sure you are patching the right version of the right file before applying it.

So it would be small, easy, fast, and safe.

Reply 5 of 11, by MiniMax

User metadata
Rank Moderator
Rank
Moderator

In case you (or anyone else) are interested in checking out BDIFF/BUPDATE, it can be downloaded here:

http://www.programmersheaven.com/zone16/cat913/3103.htm

The download is just 43 KB 😀 and there is a nice guide/manual page included.

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

Reply 6 of 11, by wd

User metadata
Rank DOSBox Author
Rank
DOSBox Author

Well you can put the patch into a simple TP program so you
get the whole thing in less than 4kb.
But i didn't bother as the packed executable was just below
100kb so who really needs it and doesn't have a hexeditor
at hand (there are pretty small and good ones out there btw.)
could download it easily.

Yet the info posted here looks interesting, and is more
universally applicable. So thanks go to MiniMax 😀