Ivan Gorinov, 2003
It reads and executes commands from .CRK text file. Such a file can be created using any text editor.
Features:
When ZPatch has no command line parameters, it creates a file selection dialog that lets the user to select CRK file. Browsing starts from current directory.
You can specify a CRK file name in the command line:
zpw File.crkIf no input file specified, ZPatch uses patch.crk in current directory.
wzzip mypatch1 zpw.exe xxx110.crk
winzipse mypatch1 -setup -auto -c zpw xxx110.crk
When you run "mypatch1.exe", it extracts the files to temporary folder and runs the patcher.
Program Description (Line 1)
Program Description (Line 2)
...
Program Description (Line N)
Patch description
Command 1
Command 2
...
Command N
path/filename
#FILE "path/filename" Flags
Open file for patching.
The path is relative to current directory.
This command can handle files with Read/Only attribute.
Current directory can be set by commands:
#SYSDIR,
#REGPATHVAL.
Example
bin/program.exe
#SIZE Size0 [Size1]
Check file size.
Example
#SIZE 65536 65536
#CRC CRC0 [CRC1]
#CRC32 CRC0 [CRC1]
Check file CRC-32 checksum.
Example
#CRC 2D56FC58 A4F9041C
See also: CRC16.
#CRC16 CRC0 [CRC1]
Check file CRC-16 checksum.
Example
#CRC16 56FC F904
See also: CRC.
#MD5 Sum0 [Sum1]
Check file MD5 checksum.
Example
#MD5 86b899b7f3f73a6b9f5a735f56ab4fdf 438922e0b7704a0bff98a85f16efc3d6
See also: CRC.
ZZZZZZZZ: yy,yy...yy
Write byte string Y at offset Z.
All values are hexadecimal.
Reverse patching is impossible with this command.
If the separator is space, the string must be quoted.
The file must be opened by FILE command before.
Example
00001045: 90,90,90,90
00001045: "90 90 90 90"
See also: Replace.
ZZZZZZZZ: xx,xx,...,xx yy,yy,...,yy
ZZZZZZZZ: "xx xx ... xx" "yy yy ... yy"
Replace binary string X by Y at offset Z.
If bytes at offset Z neither X nor Y, patching is aborted.
The file must be opened by FILE command before.
Example
00001015: 74,05 EB,05
00001015: "74 05" "EB 05"
Search the binary file for byte string X and replace by Y
#SEARCH xx,xx,...,xx yy,yy...,yy
#SEARCH "xx xx ... xx" "yy yy ... yy"
The file must be opened by FILE command before.
Example
#SEARCH 4D,5A 6D,7A
#SEARCH "4D 5A" "6D 7A"
Fills a block in the binary file with byte string Y
#FILL offset length yy,yy...yy
The file must be opened by FILE command before.
Example
#FILL 00001000 00000100 01,00,00,00
#FILL 00001000 00000100 "01 00 00 00"
Corrects PE (Win32 executable) file checksum.
#PECHKSUM
The file must be opened by FILE command before.
#REGKEY Root KeyName
| HKLM | HKEY_LOCAL_MACHINE |
|---|---|
| HKCU | HKEY_CURRENT_USER |
| HKCR | HKEY_CLASSES_ROOT |
#REGPATHVAL ValueName
Sets current directory to path from registry value. The registry key must be opened before by "#REGKEY" command.
Example
#REGKEY HKLM "Software\Super Soft\Very Useful Program"
#REGPATHVAL "InstallPath"
#REGCHECKVAL ValueName [String]
Check whether registry string value equal to String.
If no string specified - check if the value exists.
The registry key must be opened before by "#REGKEY" command.
Example
#REGKEY HKLM "Software\Super Soft\Very Useful Program"
#REGCHECKVAL "Version" "1.0"
#PATH [AbsolutePath]
Browse for program directory, starting in AbsolutePath. If no path specified, start directory is Program Files.
See also: #REGPATHVAL.
| Win9x | X:\WINDOWS\System |
|---|---|
| WinNT/2000 | X:\WINNT\System32 |
| WinXP | X:\WINDOWS\System32 |
Example
#SYSDIR
drivers/dongle.sys
...