Page 1 of 1

Making a patcher

Posted: Sat Jun 19, 2004 2:54 pm
by Moonshine
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 :)

Posted: Sat Jun 19, 2004 3:19 pm
by sec
Make main program is a bit dependency on frequently changed elements (orient to plugin , lib , ...)
devide to conquer

j2c

Posted: Sat Jun 19, 2004 3:29 pm
by Moonshine
I have no idea what you just said... :lol:

Posted: Sat Jun 19, 2004 3:33 pm
by Mortamer
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?

Posted: Sat Jun 19, 2004 3:40 pm
by sec
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?
yes that is "devide to conquer" (RC4 ??)
Moonshine: 8O

Posted: Sat Jun 19, 2004 11:33 pm
by Johan_Haegg
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.

..

Posted: Sun Jun 20, 2004 12:10 am
by NoahPhense
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