Hi! :)
This is Patching Engine 1.1 by .+MaLaTTiA.
It's FREEWARE!!! :) This doesn't only mean you don't have to pay ANYTHING for
it, but also that the code is MINE, the glory is MINE, and you CAN'T make
money with it ;))
Well, you can take the glory if you like, but I don't think anyone will give
you money for this :) And the code remains mine :))

Ok, let's start with serious things:

** HOW DOES IT WORK? **********************************************************

Easy: PE takes two files OF THE SAME SIZE (maybe in the next version I'll add
the possibility to use files of different sizes) and checks for any difference
between them. It tells you what are these differences and... *ta-da!* makes up
a SOURCE FILE in C or ASM with the patch, ready to compile or modify as you
like!
This is what will appear if you run PE without parameters:

...//\Oo/\\ Patching Engine v1.1 by .+MaLaTTiA. //\oO/\\...

Syntax: pe s|c|a <original-file> <changed-file>
           s    just scans for the differences
           c    makes c source for the patch
           a    makes asm source for the patch

NOTE: the two files MUST be the same size!


Not so much, though... :)

** AN EXAMPLE *****************************************************************

Let's try to run it on two different versions of a file... uhmmm... let's try
to find something interesting... ah! WIN.COM!
My Windows 95 version is 4.00.950. I don't really know if this trick works
with other versions too, you'll just have to try :)
When you shut down your system, you have a beautiful (!) screen telling you
that you can turn off your computer... but, hey! I want to return to dos!!! I
don't want to reset! Where's old good (well, not so good) Win3.11? This patch
will let you exit from win95 and return to DOS (without all that $hit loaded
in memory). I hope it works :)

Ok, my win.com is 22999 bytes long. I have just nooped two jumps so the byte
changed are 4. WIN.COM is the name of the original file and WIN.CRK is the
name of the cra... erm... patched one :) Look here:

c:\windows>pe c win.com win.crk

...//\Oo/\\ Patching Engine by .MaLaTTiA. //\oO/\\...

Original file: win.com
Changed file: win.crk
File length: 22999 bytes
Scanning...
000000BE: 74 90
000000BF: 0C 90
000000E6: EB 90
000000E7: FD 90
Building the source file... Ok.
c:\windows>

Now the source file is ready: its name is PATCH.C and it is displayed below.

-------------------------------------------------------------------------------
/*
   ...//\Oo/\\ Patching Engine by .+MaLaTTiA. - v1.1 (oct 1997) //\oO/\\...

                   Patch source for the file: win.com
*/

#include <stdio.h>

int c,i;
FILE *f;
fpos_t pos;
int changes=4;

long offset[4]={0Xbe,0Xbf,0Xe6,0Xe7};
int old[4]={0X74,0X0c,0Xeb,0Xfd};
int new[4]={0X90,0X90,0X90,0X90};

void main (){
    printf ("\n...//\\Oo/\\\\  win.com  Crack by .MaLaTTiA. //\\oO/\\\\...\n\n");

/* Now let's check if the file exists */
    if ((f=fopen("win.com","r+b"))==NULL){
        printf ("File win.com is not here!\n");
        exit (1);
    }

/* Check the length of the file */
    fseek (f,0,2);
    fgetpos (f,&pos);
    if (pos!=22999){
        printf ("The length is wrong! Check the version!\n");
        exit (1);
    }

/* Ok... now LET'S PATCH!!! :)) First check the original bytes are ok: */
    for (i=0;i<changes;i++){
       fseek (f,offset[i],0);
       c=fgetc(f);
       if (c!=old[i]){
           printf ("The bytes are wrong! Check the version!\n");
           exit (1);
       }
    }

/* Now let's put the new bytes: */
    for (i=0;i<changes;i++){
       fseek (f,offset[i],0);
       fputc (new[i],f);
    }

    printf("The file has been successfully cracked!\n");
    fclose (f);
}
-------------------------------------------------------------------------------

Now you just have to compile it (maybe you would like to change the source
code to read your name instead of mine, well, you can do it! :)).

** LAST COMMENTS **************************************************************

Well, what else can I say? I hope you'll find this program useful, and that
you'll help me to make it better with your suggestions. Here is what I'd like
to add in the next version:

        - Code optimizing
	- Password (we don't want everyone to use our patches, uh?)
	- GUI (well, not really, just something better than the command line!)
	- Extended help (when there will be more functions, maybe :))
        - Building of .ZIP files with patch and file_id.diz
	- Possibility to add a signature to the patch from an external file
	- A lot of beautiful SECRET options!!! >:))

If you want to tell me something, you can mail me at malattia@usa.net.
It's time to go now!

byez,

    .+MaLaTTiA.
