Format of a Patch File

The first line contains a brief description of the patch, terminated by a single newline. The second line contains information on the author, terminated by a single newline. The third line and beyond are data lines. To end the patch file correctly, make a data line simply be a newline, and patcher will stop.

Format of the Data Lines

The first item is a number, which is the offset in bytes from the beginning of the file of where to put the patch. The number is in base 10 (decimal). A space follows.

The second item is a number, which is the byte which is to be replaced in the file. Patcher does a simple check to see if the bytes match before making the replacement to ensure that the file is only patched once and that the correct spot is being patched. The number is in base 16 and is two characters long, followed by a space.

The third item is a number, which defines the method. Any information after the method but before the newline is defined by the method.

Method 0: Unconditionally replace.
After the '0', there is a space, followed by two hexadecimal digits to define what the byte should be changed to. If a description is desired, a space followed by text should be found.
Method 1: Conditionally replace.
After the '1', there is a space, followed by two hexadecimal digits to define what the byte should be changed to. If a description is desired, a space followed by text should be found.
Method 2: User-Defined replace.
After the '2', there is a space, followed by a description of the change the user is about to make.
Method 3: Continuation of Previous Patch.
This method is for patches which require more than one byte to be altered. After the '3', there is a space, followed by two hexadecimal digits to define what the byte should be changed to.