knuckle cracker
This project is a response to the urge to make small changes to the big binary files. For text files, there are diff/patch utilities; and for big changes, rsync
is perfect. Now, if you're sharing something like a game mod,
where you need to swap a single bit inside a huge data file (just like
in a Hot Coffee Mod for GTA San Andreas , you're frequently forced to share the entire file. By the other side, if you need to update some
firmware glitch, why should you rewrite the entire flash chip?! So, here's my proposal.
bin_diff utility will compare two binary files and output a human-readable (and writable
script file, just like this:
[bb35cc23dda6737d181a63ea3203f0ff engine.dll]
50 "This program must be run under Win32\xd\xa$"
d60a EB
d77b 90 90
da3f E9
da41 1 0
ea44 90
# Patch length: 0000007A
#).
Several files may be patched by a single patch-script. The last string
in the last line is a hex value of the patch data length. It is useful
to make self-applicable patches.Then,
knuckle_cracker may be used to parse the
patch-script and apply modifications to the files. It will check the
MD5 checksum for each file automatically (and will refuse to patch unmatched files). You can also make the
self-applicable patches, concatenating the patch-script directly at the
end of the knuckle_cracker executable (following example works on UN*X systems, for Windows box, use any hex editor, it works just the same):cat knuckle_cracker engine.bin_patch > engine_patcher
bin_diff & knuckle_cracker are very portable: I tested them on Linux, FreeBSD (gcc) & Win32 (Borland C/CYGWIN/MinGW/MSVC).
P.S. - all sources has DOS line endings (CRLF), use
"unzip -aa knuckle_cracker.zip" to extract on UN*X systems.
|
stas » April 19, 2006 » 02:42
14084 reads
|





