Patch32

A Free Win32 Patching Utility
by Daniel Werner
Courtesy of fravia's pages of reverse engineering

Original (on 13 Sep 1998) at http://www.geocities.com/SiliconValley/Garage/2116


[ Introduction | Usage | File Format | Download ]

Introduction

Patch32 is a utility for applying patches to files. These patches could be cheats for games, cracks, or anything. Each patch is stored in a small .p32 file, which can be easily edited using Notepad. The program itself is quite small and can be downloaded off the internet very quickly. This utility may be distributed freely with no restriction as long as no fee is charged for it, except for things like shareware CD-ROMs.

Using Patch32

Run Patch32. A dialog box will appear and here you can choose which patch file and target you want. Click on the browse... button to choose a file. When you have selected a patch and a target you click patch to apply the patch. If you are unsure please make a backup of your target before patching it, as it is possible the patch could destroy it if there are version mismatches, etc. This is unlikely, though, as the patch files contain information used to check if the target is correct.

Patch File Format

The patch file format is very simple. It is just a text file with a .p32 extension. Each line of the file may be either blank or contain a command. Commands may span over several lines. There are four different commands, they must all be prefixed with the hash (#) character and in lower case. The commands are:-

	info	- description of the patch
	seek	- go to a position in the file
	chek	- check for existence of these bytes at this position
	repl	- replace bytes at this position with these bytes

Please note that there should only be one pair of chek / repl commands following each seek command. If more than one chek or repl command is specified only the second one will be used. The chek command will always be executed before the repl command. You do not have to use both commands after a seek command. At least one chek or repl should follow a seek otherwise it will do nothing. You do not have to include an info command, but I recommend that you do. Below is an example patch file which when applied to the shareware program mIRC32.exe version 5.41, it will remove the registration password check and enable you to register with a fake code.
#info mIRC v 5.41 Rego Crack. Allows you to register with any code.

#seek 0x02D9C6
#chek 0x0F 0x84 0x8B 0x00 0x00 0x00
#repl 0x90 0x90 0x90 0x90 0x90 0x90

#seek 0x07EFD1
#chek 0x74 0x49
#repl 0x90 0x90
Note that numbers above are in hexadecimal, not decimal. You may write numbers in decimal if you wish. Below is the same patch with decimal numbers.
#seek 186822
#chek 15  132 139 0   0   0
#repl 144 144 144 144 144 144

#seek 520145
#chek 116 73
#repl 144 144
Each value following a chek or repl command must be in the range 0-255, as each one represents a single 8 bit value (byte). Numbers can have any amount of white space between them. Up to a maximum of 32 values may follow any chek or repl command. As many seek commands followed by chek and repl commands can be used as memory will allow, and with virtual memory this should be a very high amount.

Download

If you are using Netscape, hold down shift when you click the link.

patch32.zip [21.9kb]