Dead simple IPS (24/32) patcher
Go to file
2024-07-07 04:34:32 -05:00
sample-patches Draw the rest of the owl 2024-07-07 03:04:41 -05:00
src Add (untested!!!) support for IPS32 2024-07-07 04:34:32 -05:00
.gitignore Create project 2024-07-07 03:00:49 -05:00
Cargo.lock Create project 2024-07-07 03:00:49 -05:00
Cargo.toml Create project 2024-07-07 03:00:49 -05:00
LICENSE Add MIT LICENSE 2024-07-07 03:06:49 -05:00
readme.md Draw the rest of the owl 2024-07-07 03:04:41 -05:00

Eyepiece: An IPS patcher

Usage

eyepiece patch.ips input.file output.file

Building

cargo build
cargo run -- patch.ips in_file out_file

Description

The IPS(24/16) patchfile format is one of the simplest possible patchfile formats. It contains no way to identify the correct target file, and cannot insert or remove bytes.

An IPS file starts with the magic number "PATCH"

0000:  50 41 54 43 48           |PATCH|

Patches are encoded linearly with no padding or alignment, and all numeric values are encoded big-endian. Patches cannot have a length of b"EOF", as "EOF" marks the end of the patchfile.

xxxx:  45 4f 46                 |EOF|

The patchfile matches the following pseudo-grammar

IPS     = "PATCH" Patch* "EOF"
Patch   = { offset: u24 != "EOF", data: Data }
Data    = { len: u16 != 0, data: [u8; len] }
        | { _:   u16 == 0, len: u16, byte: u8 }     // Run-length-encoded data