
Making a patcher
Making a patcher
Ive been thinking about making an app that can scan for the differences between two .exe's, then make a small file with the differences in that can be applied ro the lder exe to update it to the new one. Just thought it would be useful for patching software I make etc. Any ideas on how to get the differences between two binary exe's though? And actually putting it into the old one at the correct place? Cheers 

Mark my words, when you least expect it, your uppance will come...
If I were making a patcher, I would have a txt file on my website with the file name, and either a file size or an rc4 checksum of the file. I'd download the file and compare the checksums with that of the other programs (and make sure all of the listed programs are there). If one of them is missing, I'd download it from the site and replace the old one. Can anyone think of a better way?
-
- Enthusiast
- Posts: 792
- Joined: Sat Aug 09, 2003 3:13 am
- Location: 90-61-92 // EU or ASIA
- Contact:
yes that is "devide to conquer" (RC4 ??)Mortamer wrote:If I were making a patcher, I would have a txt file on my website with the file name, and either a file size or an rc4 checksum of the file. I'd download the file and compare the checksums with that of the other programs (and make sure all of the listed programs are there). If one of them is missing, I'd download it from the site and replace the old one. Can anyone think of a better way?
Moonshine: 8O
-
- User
- Posts: 60
- Joined: Wed Apr 30, 2003 2:25 pm
- Location: Västerås
- Contact:
well, a basic filechange patcher would only be able to patch a file of a specific version, and if there are any deleted stuff it would go nuts and build a huge database. Well, a patch-datafile could look something like this:
Position.l, BytesToPatch.l, Data(BytesToPatch.l).b
To create a patchfile: load both files in a memory array, peek a byte from each and compare, if they are same, continue, if they differ, record position, keep reading until they are the same again, write the length and then the data. Repeat until done
This is crude, unoptimized and pure lazy, but it will probably work. Hope you can figure out how to apply the patch yourself.
Position.l, BytesToPatch.l, Data(BytesToPatch.l).b
To create a patchfile: load both files in a memory array, peek a byte from each and compare, if they are same, continue, if they differ, record position, keep reading until they are the same again, write the length and then the data. Repeat until done
This is crude, unoptimized and pure lazy, but it will probably work. Hope you can figure out how to apply the patch yourself.
- NoahPhense
- Addict
- Posts: 1999
- Joined: Thu Oct 16, 2003 8:30 pm
- Location: North Florida
..
I have a few patching samples.. I even have one that patches itself. 
Part of a registration software I'm working on in the background.
Making a patcher is easy.. it's comparing that will get interesting. But not
interesting in the difficult sense. How do I mean? Well, if you are going
to have all the data for the new exe near by, for say, comparing, then
gosh(replace with fav. adj.), just crap it out over the old one.
Frankly I've been spending sometime utilizing the:
GetURL Lib
viewtopic.php?t=10679
I will keep a text file on the server with the latest version number and
app names. The 'autoupdater' will check over the versions, then download
what it needs.
If you're still interested in patching something. There are several patching
samples in these forums, as well, there are a few in the CodeArchiv which
btw currently has 1409 files.. awaiting the next release of that..
- np

Part of a registration software I'm working on in the background.
Making a patcher is easy.. it's comparing that will get interesting. But not
interesting in the difficult sense. How do I mean? Well, if you are going
to have all the data for the new exe near by, for say, comparing, then
gosh(replace with fav. adj.), just crap it out over the old one.
Frankly I've been spending sometime utilizing the:
GetURL Lib
viewtopic.php?t=10679
I will keep a text file on the server with the latest version number and
app names. The 'autoupdater' will check over the versions, then download
what it needs.
If you're still interested in patching something. There are several patching
samples in these forums, as well, there are a few in the CodeArchiv which
btw currently has 1409 files.. awaiting the next release of that..

- np