https://github.com/francisdb/jojodiff-rs
Rust library for working with JojoDiff files
https://github.com/francisdb/jojodiff-rs
jojo jojodiff patcher patching rust
Last synced: 3 months ago
JSON representation
Rust library for working with JojoDiff files
- Host: GitHub
- URL: https://github.com/francisdb/jojodiff-rs
- Owner: francisdb
- License: mit
- Created: 2024-11-06T23:03:40.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2024-11-08T15:08:54.000Z (6 months ago)
- Last Synced: 2025-01-10T01:52:18.297Z (4 months ago)
- Topics: jojo, jojodiff, patcher, patching, rust
- Language: Rust
- Homepage:
- Size: 21.5 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# jojodiff-rs
Rust library for working with JojoDiff files
The original Jojos Binary Diff tool can be found at https://jojodiff.sourceforge.net/
and https://sourceforge.net/projects/jojodiff/This library is a Rust implementation of the JojoDiff file format. It is intended to be used as a library for other Rust
projects that need to work with JojoDiff files.Currently, it only supports applying JojoDiff patch files to binary files.
## Usage
```
cargo add jojodiff
```* Check the docs at https://docs.rs/jojodiff
* Check the unit tests in src/lib.rs for examples.## Logging
This library uses the `log` crate for logging. See https://docs.rs/log/latest/log/ for more information on how to select
a logger implementation and configuring it.## Running tests
```sh
cargo test
```Running a single test with logging:
```sh
RUST_LOG=debug cargo test patch_copy_seq_3_times
```## JojoDiff patch file format
The JojoDiff patch file format is a binary stream containing operands that describe how to transform an original file
into a destination file.```
The stream consists of a series of
( || )
where
= (||||||||)
= ||
= any byte different fromor
yields one byte
```Where:
* `` (`0xA7`) escape: Indicates that the next byte is an operand.
* `` (`0xA6`) modify: Replaces bytes from the original file with bytes from the patch file.
* `` (`0xA5`) insert: Inserts bytes from the patch file into the destination file.
* `` (`0xA4`) delete: Skips bytes from the original file.
* `` (`0xA3`) equal: Copies bytes from the original file to the destination file.
* `` (`0xA2`) backtrack: Seeks backwards in the original file.