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,
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:
50 "This program must be run under Win32\xd\xa$"
d77b 90 90
da41 1 0
# 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.
knuckle_crackermay 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_crackerexecutable (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
knuckle_crackerare 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