Writing a patch utility
I''d like to write a patch utility.
Here''s my idea:
Look at the original exe.
Look at the new exe.
Figure out what new bytes got inserted, what bytes got deleted, and what bytes were modified.
Write a program that will open the original exe as a data file and make these modifications.
My question is:
Given two files, what is the algorithm that makes a log of the differences? When I see that two bytes in the same place are different, how do I tell whether an insertion, modification, or deletion occured?
I''d recommend looking at xdelta for Unix machines and seeing how they do it. You probably can''t do it as a ascii style patch, but xdelta is programmed to work on binaries.
Magnwa
Magnwa
There is a commercial product out there called RTPatch, by pocketsoft. It does exactly what your proposing, and we use it to upgrade our client code. www.pocketsoft.com
AFAIK, they are the only producers of this product. If you could come up with a comparable product you might be in business...
![](smile.gif)
-Z
Look at GNU Diff/Patch.
If you want to be really cheap you could just
system("patch --binary file file.patch"); // or whatever syntax it, patch, uses...
"This album was written, recorded and edited at Gröndal, Stockholm in the year of 2000. At this point in time money still ruled the world. Capitalistic thoughts were wide spread. From the sky filled with the fumes of a billionarie''s cigar to the deepest abyss drenched in nuclear waste. A rich kid was a happy kid, oh..dirty, filthy times. Let this be a reminder."
- Fireside, taken from back of the Elite album
If you want to be really cheap you could just
system("patch --binary file file.patch"); // or whatever syntax it, patch, uses...
![](smile.gif)
"This album was written, recorded and edited at Gröndal, Stockholm in the year of 2000. At this point in time money still ruled the world. Capitalistic thoughts were wide spread. From the sky filled with the fumes of a billionarie''s cigar to the deepest abyss drenched in nuclear waste. A rich kid was a happy kid, oh..dirty, filthy times. Let this be a reminder."
- Fireside, taken from back of the Elite album
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement