Making a patcher

Just starting out? Need help? Post your questions and find answers here.
Moonshine
Enthusiast
Enthusiast
Posts: 263
Joined: Tue May 25, 2004 12:13 am
Location: UK

Making a patcher

Post 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 :)
Mark my words, when you least expect it, your uppance will come...
sec
Enthusiast
Enthusiast
Posts: 792
Joined: Sat Aug 09, 2003 3:13 am
Location: 90-61-92 // EU or ASIA
Contact:

Post by sec »

Make main program is a bit dependency on frequently changed elements (orient to plugin , lib , ...)
devide to conquer

j2c
Moonshine
Enthusiast
Enthusiast
Posts: 263
Joined: Tue May 25, 2004 12:13 am
Location: UK

Post by Moonshine »

I have no idea what you just said... :lol:
Mark my words, when you least expect it, your uppance will come...
Mortamer
User
User
Posts: 36
Joined: Mon Dec 29, 2003 5:07 pm

Post 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?
sec
Enthusiast
Enthusiast
Posts: 792
Joined: Sat Aug 09, 2003 3:13 am
Location: 90-61-92 // EU or ASIA
Contact:

Post 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
Johan_Haegg
User
User
Posts: 60
Joined: Wed Apr 30, 2003 2:25 pm
Location: Västerås
Contact:

Post 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.
User avatar
NoahPhense
Addict
Addict
Posts: 1999
Joined: Thu Oct 16, 2003 8:30 pm
Location: North Florida

..

Post 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
Post Reply