Page 2 of 2

Posted: Tue Aug 10, 2004 3:21 am
by NoahPhense
Patching is not important to me. My clients are much happier to receive a
full 'update' in the mail via CD.

But that will soon end. Once I have my server fully funcitonal, I will be
using an online updater. And for those that don't want to use the updater,
they can just login to the support forum anytime and download the latest
patch.

I find that clients don't mind downloading updates.. they rather look
forward to it, as we do with PB.. ;)

- np

I really couldn't patch my stuff anyhow, as it is encrypted.

Posted: Tue Aug 10, 2004 5:46 am
by deadmoap
If you're a good programmer that not only knows how to program, but also how programs work and how they're put together, you can make it so that the users only have to download the changed parts of the executable.

I'm not going to explain how programs are put together. It's very complicated and you're probably only going to learn the same way I did, by disassembling very small programs and compairing the machine code to the assembly. I don't know that much about it myself, but I know enough to get by.

First, you need to know where stuff is in your program. Whenever you add/remove/change any code, you add a label in your program to the place where you're going modify, download the new code, and then "insert" the code into the right place of the executable.

But this idea may not be completely bug free. It might mess up parts of the program that hold certain addresses of the program and if you insert code in the middle, then everything behind it is pushed back so static addresses may be wrong.

I don't know exactly how to do this or if it would even work... it was just an idea. I could be giving you the old banana in the tail-pipe. :P

Posted: Tue Aug 10, 2004 9:31 pm
by griz
You shouldn't need to worry about any of that, or even encryption. A byte level patcher doesn't care how you write your code, or if it is encrypted. It simply replaces the bytes in the file which have changed, and adds or removes bytes as required if the file sizes are different. You're essentially replacing one exe with another, byte by byte.

Although Pure Basic applications are small, I do like the idea of a tiny patcher for efficiency. If you had a 100KB patcher update versus a 500KB application update and there were a thousand downloads ... it would save you nearly 400 MB in bandwidth. As well, it can be written to update multiple files in a directory, including subdirectories. So you can distribute a single exe that brings everything up to date in a nice and tidy fashion.

Posted: Tue Aug 10, 2004 10:02 pm
by PB
> If you had a 100KB patcher update versus a 500KB application update and
> there were a thousand downloads ... it would save you nearly 400 MB in
> bandwidth.

A good point that I never considered.

Posted: Tue Aug 10, 2004 10:28 pm
by NoahPhense
PB wrote:> If you had a 100KB patcher update versus a 500KB application update and
> there were a thousand downloads ... it would save you nearly 400 MB in
> bandwidth.

A good point that I never considered.
Good thing I have unlimited bandwidth on an OC13c line (1000Mbits).

http://abetterhostingservice.com/network.htm

Posted: Tue Aug 10, 2004 10:52 pm
by LarsG
NoahPhense wrote:
PB wrote:> If you had a 100KB patcher update versus a 500KB application update and
> there were a thousand downloads ... it would save you nearly 400 MB in
> bandwidth.

A good point that I never considered.
Good thing I have unlimited bandwidth on an OC13c line (1000Mbits).

http://abetterhostingservice.com/network.htm
My host has some kind of similar net... They've got several fibre lines directly to the norwegian portal handling most (if not all) of the traffic abroad... :)

I asked them if they had some sort of restrictions on the download rate, and I got an answer saying it normally wouldn't be any problem, but if I was worried I would get *alot* of traffic (I'm guessing several Gigs a week), then I should contact them, and they'd setup a dedicated server deal for me.. :p

Posted: Tue Aug 10, 2004 11:50 pm
by NoahPhense
Yeah this I know the sole owner of this setup.. so if anyone is interested.
Let me know, and I'll put you in touch with him.

Don't get me wrong this guy has restrictions too. But if.. when ;) I
have a requirement for over 1 billion bytes, I'm sure I will be able to
afford the next level.

- np

Posted: Wed Aug 11, 2004 4:09 am
by CherokeeStalker
thefool wrote:@CherokeeStalker:

I have written a byte patcher for non-size changed files. I know its possible to make patchers that can work with changed filesizes, but how? Can you explain the concept? And btw, how lang are you converting it? :D
It's not one of my higher priorities at the moment BUT I can knock it up a notch or two in the list ! Look for me to post code here in 2 weeks or so. :D

Posted: Wed Aug 11, 2004 1:57 pm
by thefool
thanks :D

Re: Patching

Posted: Tue Apr 01, 2025 5:19 am
by Mohawk70
I know this is an extremely old post but the method goes like this ...
1: old file is smaller
A: compare the exes up to the size of the old file and save the byte offset, old byte value, and new byte value off bytes thst are different ( hex encoded
$PPPPPPPPOONN --> P = offset O=Old N=New )
B: for offsets beyond the old file size
$PPPPPPPPXXNN X=non-existant
C: patch the differences from A
D: append the bytes from C
Note: keep track of number of bytes from A & B

You can validats files using filesize and sha3-512 filehashes


To speed up comparison compare smaller chunks and only look for different byte values if the chunks aren't identical.

Reverse for new file is smaller


This method would allow patch undo also