Skip to content

anthonyhfm/BIPA

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BIPA

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.

Why BIPA?

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.

Usage

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:

  1. Install Python Dependencies
python3 -m pip install -r requirements.txt
  1. Create a file patch
python3 bipa.py create --source=example_source.bin --target=example_target.bin

The 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.

  1. Applying a patch
python3 bipa.py patch --source=example_source.bin --patch=example_target.bipa

About

Binary Patching Toolkit and CLI Application

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages