Binary Patching Toolkit — a file format and toolkit for safely distributing binary patches.
BIPA generates a byte-level diff between a source file and a target file, then stores the resulting patch hunks (file offsets + replacement bytes) inside a compact, protobuf-based .bipa container.
The .bipa file can later be applied to the original source file to reproduce the target file — without redistributing the original binary.
When sharing modifications to binaries (firmware images, applications, game files, etc.), you often want to distribute only the changes rather than full files.
BIPA stores:
- A crc32 Checksum of the expected source file
- A list of patch hunks (offset + bytes)
- Format version
This allows patch application to fail fast if the source file does not match the expected input.
Note: Use BIPA only on files and systems you own or are authorized to modify.
BIPA is a CLI-first application. But its algorithm and data structure can be used anywhere.
If you want to use BIPA in your CLI, use the bipa.py script like this:
- Install Python Dependencies
python3 -m pip install -r requirements.txt- Create a file patch
python3 bipa.py create --source=example_source.bin --target=example_target.binThe file patch is now created as example_target.bipa. This file format now includes a crc32 checksum of the original file and a list of file offsets and byte differences.
- Applying a patch
python3 bipa.py patch --source=example_source.bin --patch=example_target.bipa