home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.wwiv.com
/
ftp.wwiv.com.zip
/
ftp.wwiv.com
/
pub
/
MISC
/
ARTFIX09.ZIP
/
PATCH
/
PATCH.DOC
next >
Wrap
Text File
|
1998-05-03
|
5KB
|
137 lines
PATCH v0.11 for OS/2 and DOS
(c) 1998 by Wilfried Brinkmann, Fido 2:2448/6001
──────────────────────────────────────────────────
Abbreviated Directions
Preface
───────
Patch(p).exe is used as a comfortable means of altering binary files
(EXEcutables).
The data to be changed are stored specifically defined format in an
ASCII file. The name of this file MUST always be identical to that of
the EXE file, and include the extender '.PSC'. For example, the file
ABC.PSC must reside in the Patch(p).exe directory (or in the startup-
directory) in order to patch the file ABC.EXE.
When Patch(p).exe is invoked, the name of the file to be patched can
be entered on the command line. If Patch(p).exe is invoked without
parameters, the name of the file to be patched can be entered into a
mask. In any case, the full file name including the path must be
specified.
Any errors that occur during operation of the program are displayed in
an information window, and must be acknowledged by pressing a key.
Commands in the patch script file (.PSC)
────────────────────────────────────────
This ASCII file contains all commands and parameters required to
perform the necessary changes. Blank lines and comments may be used.
Commends are prefixed with a semicolon (;). Everything following a
semicolon is ignored by Patch(p).
The following syntax applies to the description below:
<Parameter> - Required Parameter
[Optional] - Optional Parameter
The following commands are possible:
────────────────────────────────────
SIZE <Bytes>
─────────────
<Bytes> is the size of the file to be patched, expressed in decimal
notation. Patch(p) compares this value with the size of the EXE file.
Processing is only continued if the values agree.
COPY <[[Drive:][\]Path]Filename.Ext
────────────────────────────────────
After Patch(p) verifies the file to be changed, it copies the original
file. Either a complete path (with drive letter) or a relative path
(without drive letter) can be specified. A file name must always be
specified. If a relative path is specified, Patch(p) will create the
directory in which the original file resides. The path is automatically
generated if not already present.
REN <Filename.Ext>
───────────────────
After all modifications have been made, the original file is renamed as
indicated.
VER <Fileoffset> <Data[+]>
─────────────────────────────
The data of the original file at <Fileoffset> are compared to the
specified <Data>. Both <Fileoffset> and <Data> MUST be specified in
hexadecimal notation (0 .. 9, A .. F).
Two characters must be specified for each Byte in <Data>. NO blanks may
appear between the characters.
Example:
VER 48B8B 83E85030E4 - Checks 5 Bytes from offset 48B8B
An optional '+' (plus sign) may be appended to <Data>. This causes
multiple <Data> lines to be combined. The subsequent lines may not
include the "VER <Fileoffset>" command in this case, but ONLY the <Data>.
Do NEVER append a plus sign at the end of the last line!
Example:
VER 48B8B 83E850+
30E4 - Checks 5 Bytes from offset 48B8B
This method of breaking up lines enhances the comprehensibility and
legibility of the script files, as shown by the following example:
VER 38D61 53+ ; push ebx
51+ ; push ecx
52+ ; push edx
8B18+ ; mov ebx,[eax]
89D8 ; mov eax,ebx
CHA <[$][Fileoffset]> <Data[+]>
───────────────────────────────────
The specified <Data> are written to the file at <Fileoffset>. Both
<Fileoffset> and <Data> MUST be specified in hexadecimal notation
(also refer to VER).
The dollar sign ($) can optionally be specified for the file offset.
This causes the file offset of a preceding VER to be used. In this
case, the length of the data in VER and CHA are compared at the same
time. If these do not match, Patch(p) outputs an error message. If
possible, THIS method should be used for patching.
Example:
VER 38D0F 8B4014+ ; mov eax,[eax+14]
83E845 ; sub eax,45
;
CHA $ E85BDAFFFF+ ; call -000025A5
90 ; nop
@Marker <Data[+]>
──────────────────
If the first character in a line is an at-sign (@), all following
characters up to the next space are ignored. This may be used for
purposes such as to highlight labels. Such markers have no purpose in
the program. They only serve to improve legibility.
Example:
CHA $ 83E850+ ; sub eax,50
7703+ ; jnbe +03 (@3D3B3)
83C064+ ; add eax,64
@3D3B3: 30E4+ ; xor ah,ah
C3 ; ret
Conclusion
───────────
All typos are the intellectual property of the author, are copyrighted
and thus may not be used without permission ;-))
──────────────────────────────────────────────────────────────────────────────
Wilfried Brinkmann, FidoNet 2:2448/6001 Hattingen, in May 1998
──────────────────────────────────────────────────────────────────────────────