BinPatch can work with both complete directories or simple files. However, the most basic use is to create a patch file that updates one file (start state) into another version (end state). Say you have two similar files "OLD.EXE" and "NEW.EXE" and the patch should transform "OLD.EXE" into "NEW.EXE". Then "OLD.EXE" is your start state and "NEW.EXE" your end state for the patch file. All you needed to supply GenPatch is the start state filename (may actually be more than one as you will learn in the multi-version section), the end state filename and finally select a name for your patch. Let's choose "OLD2NEW" for this purpose, then all you need to provide on the command line (assuming that GenPatch is in your system path) is:
> GenPatch OLD.EXE NEW.EXE OLD2NEW
and you have your patch file.
Normally the patch file will have the suffix ".utp" that indicates it is a plain patch file. A plain patch file must be applied using DoPatch (see below). Add one extra option to the command line for GenPatch to create an executable patch file. Choose "-s" for a command line interface and "-s=gui" for a nice looking (but still very small file size) windows interface for your patch file.
> GenPatch OLD.EXE NEW.EXE OLD2NEW -s=gui
and you have your executable patch file with windows interface. This time the patch file will have the ".exe" suffix and you may execute it by double-clicking or starting it from the command line.
To apply your patch file you have several options. If it's executable, simply start it and that's it. If it's a plain patch file you may choose from one of these example command lines, each achieving different results:
> DoPatch OLD2NEW.UTP OLD.EXE PATCHED.EXE > DoPatch OLD2NEW.UTP OLD.EXE > DoPatch OLD2NEW.UTP -auto
The first one creates a new file, "PATCHED.EXE," by applying the patch file to "OLD.EXE" which remains unchanged. The second applies the patch to "OLD.EXE" and replaces it in the process. "OLD.EXE" will now be identical to "NEW.EXE".
The last one is somewhat special, in that it enables the "Traditional Auto-find" mode of DoPatch. It means that DoPatch scans all your hard disks (except network drives and cd-roms) for the target file. It will present you with "apply (y/n)?" questions for all files that can be updated with the patch file. (Note that on Win32 there is a far better method called "Registry Auto-find" that requires no scan at all, but looks up the target using a registry key you specified.)