Patchit v2 - Cyber Agents, Inc.

advertisement
» Patchit v2.0
A binary file byte-patching program.
Copyright 2000 (c) by Foundstone, Inc.
http://www.foundstone.com
A file byte-patching utility. This is driven by a simple scripting language. It can patch sequences of bytes in any
file, search for byte patterns (with wildcards) and also extract and utilise DLL exported function addresses as
source positions in files to be patched.
The total command list is as follows:
MESSAGE <"message">
Displays a message during script execution.
DIR <"directory path">
Optional directory path to search for files. For compatibility it is advisable not to use specific drive names in the
path.
FILE <"filename"> [filesize]
Filename to patch. Optional filesize specifies the size that the file must match to be accepted.
FIND [<*>]...
Performs a search on the current file for the sequence of bytes that match ... up to max 256. Use the keyword *
to match any byte. If a match is found then the PATCH file position value is set to the file position at which the
found pattern begins.
FUNCTION <"funcname">
Sets the current patch position to the file position of the given exported function name (case sensitive). It is
assumed that the file being patched is a DLL.
PATCH [[POS ] | [OFFSET ]] ...
Patches the current file at optional file position/offset. Replaces orig_byte with new_byte. Fails if original byte
read from file is not orig_byte.
COPY <"orig_file"> <"new_file">
Copies "orig_file" to "new_file"
DELETE <"filename">
Deletes the specified file.
INIFILE <"filemame">
Specifies an INI file to be used in subsequent INI commands. This filename is relative to the last DIR directory
path.
INISECTION <"section">
Specifies an INI section name for use in subsequent INIWRITE commands
INIWRITE <"keyname"> <"value">
Writes the given string value to the INI keyname in the previously specfied INI file's section.
What can this program be used for? Well I sometimes liked to reverse engineer programs, purely for my own
benefit. I thought it would be useful to write a program that performed the dual tasks of altering an application's
behavior and at the same time kept a documented note of exactly what I had done to achieve the result in the
form of the commented script file.
Download