Sign Up connects you to ROM Hackers around the world.

IPS Patch Format

IPS Patching Format

What is it?
For those that are not aware, an IPS (International Patching System) is a patching file format. A patch file is used to list the differences between two files, which a program can use to modify one to match the other. An IPS patch is a one-way patch in that it can only be applied to the original version to reach the modified version, and does not work the other way.

The Format
The format for an IPS patch is actually quite simple.

An IPS patch starts with a 5 character string reading "PATCH" and ends with a 3 character patch reading "EOF".
In between, it contains a series of "packets", either RLE compressed or not. Each packet begins with a 24-bit integer which gives the offset the packet's changes will start at. A 16-bit integer follows this. If it is greater than 0, it provides the length of data to copy from the patch to the ROM (uncompressed). If it is equal to zero, it is followed by a second 16-bit integer and a byte. The second integer will tell how many times to copy the byte to the ROM (compressed). These packets will continue until the "EOF".

Some various programs have implemented different features, but this is the basics.
  likes this.