Programming

The Patcher version 28.01.1999

The second generation patcher, with much more functions...
You can use it for patches with multiple strings in multiple files! User-friendly interacting, for example: If the victim file is not the size The Patcher expects, then it asks to continue with the possibility to answer: continue always! Only ~2900 bytes, with PkLite it's only ~2100 bytes!
It still only needs DOS 2+, 80386+, uses less then 64Kb memory, in pure Assembly and can patch files up to 4Gb.

Download and/or view the source of The Patcher HERE (22kb). With the example files 1 2 .

How-to use my Patcher for your cracks/patches
- Rename the downloaded file to patcher2.asm
- At least change the following lines/structures:

NUMBEROFFILES , a constant, this is the number of files you wish to patch
patchMsg , a '$'-terminated message string, which contains some info about the crack/patch (maker / target program / etc.).
patchFiles, this is the biggest thing you have to change, here are the file structures (NUMBEROFFILES times):

db 'directory\filename.ext',0 - null-terminated string, this is the name of a file you want to patch
dd 12345h - double word, this is the expected filesize
dw 2 - word, this is the number of strings you want to search & patch in this file
> now come the search & patch string structures (how much is in the previous line):

db 3 - byte, length of the string to search & patch (the old string and the new string have to same length)
db 13h, 14h, 15h - (byte) string, this is the old string where we have to search for
db 13h, 16h, 78h - (byte) string, this is the new string which The Patcher will replace with the old one
dd 123abch - double word, the expected offset where the old string can be found

... in the same way the remaining strings, in this case 2 strings ...

... in the same way the remaining files, in this case 1 file ...

- That was the biggest part! Phoozzzz !
- Find TASM on your harddisk somewhere. If you don't have it download the small version here.
- Type tasm patcher2 and after that tlink patcher2 /3
- You can rename the file to whatever you want.

Notes
- The filename has a maximum of 255 characters.
- There is no check on to much data etc., all information together should not be more then 20kb, that's fairly reasonable... ; )
- Be sure each information part is right, or the program can crash without warning !!!
- Each time The Patcher encounters differences between expected information and the found ones it asks to continue. The user can answer 'a' for continue always.
- The reason I use a date as version number, is that it gives the most wanted info. It is in the DD-MM-YY format.
- Please DON'T remove the beginMsg (in such a way it is not clearly visible to users), because it shows that I wrote the Patcher, and that You are not a lamer who just 'borrows' the code and gives himself the credits for making it.

To Do
- comments (almost finished)
- finish interface / readible output (almost finished)
- for each file add an array of approved filesizes
- for each string add an array of approved offsets
- print also filesizes if they don't match
- possibility for correcting date/attributes
- Thinking of the use of a textfile with the patch information... this would greatly simplify the work for crackers/patchers
- (longterm) CRC-32 correcting possibility

Mail me at anarchriz(at)hotmail(dot)com.