Binary Patch Workbench
Compare two local files by bytes and make a version 1 .tbp patch that reuses consecutive regions of the base file while storing changed bytes. Immediately apply the newly serialized patch to check that it reconstructs exactly the target bytes. Apply mode accepts a patch from another device and verifies both the base and resulting SHA-256 values. Unlike manual offset editing or line-based text diff, this tool produces a patch that can recreate a binary result.
Key features
- Create copy-from-base and add-new-bytes commands from two local files
- Embed base and target sizes, SHA-256 hashes and commands in the patch
- Check the base hash before applying and the target hash after reconstruction
- Reject truncated patches, unknown versions or commands, and out-of-range spans
- Fall back to literal target bytes when a difference patch would be larger
How to use
- In Create mode, choose base and target files up to 2 MiB each, or load the sample.
- Create the patch and review the automatic round-trip check, copy/add byte counts and both SHA-256 hashes.
- Download the .tbp patch and share it with someone who has the exact base file.
- In Apply mode, select that base file and the .tbp patch, then apply it.
- Download the restored file after both base and target integrity checks pass.
Use cases
- Share a small binary change with a team that already has a common base file
- Archive two test-fixture versions as a reproducible patch
- Check whether an incoming patch matches the local base by hash
- Detect when a damaged patch changes reconstructed bytes
Frequently asked questions
Can I apply a patch to any base file?
No. The base size and SHA-256 must exactly match the file used to create the patch. A different base is rejected before producing a result.
What is the .tbp format?
It is this site's TTBP version 1 binary format. An 84-byte header stores the version, sizes, operation count and two SHA-256 hashes, followed by copy-from-base and add-bytes commands. It is not compatible with bsdiff or xdelta files.
Is the patch always smaller than the original?
No. Many changes or a very small file can make the patch larger because of the header. When copying is not useful, the target bytes are stored literally to favor a correct round trip.
What are the file and operation limits?
Base and target files are each limited to 2 MiB, patches to 3 MiB and operations to 16,384. Processing uses browser memory rather than streaming large files.
Does SHA-256 verification prove the file is safe?
No. It verifies exact base and result bytes, but does not authenticate the patch author or establish that a file is safe to execute.
Privacy
Files are read and compared only in memory in this browser tab. File bytes are not sent to the site, ads or analytics, and source files are never overwritten. Patch and verified result downloads begin only when you request them.
Comments & questions