Advertisement

i was wondering how does a patch work and how is it done?

Started by February 14, 2002 08:32 AM
16 comments, last by mickey 22 years, 9 months ago
quote: Original post by mickey
hi, i hope am not expecting too much, but maybe if you could show me a very simple code on how is it done will give me a clue?
for example, i have file1.exe and file2.exe, when the user executes file1.exe, it prints "hello" on the screen, then, when the user executes file2.exe, it will patch the file1.exe, then the next time the user executes file1.exe, it will print "hello world", maybe if you guys could show me how this is done, i would have a clue? thanks!!!



Most people don''t actually know how to do this themselves. You usually just leave it up to your installer software to do it for you.
Here''s how I''d do it:

1: Read the two files byte by byte (in a program) and note what the differences are and where they go. Sort of pattern matching ,after all in your example your adding a small segment of code into the middle of the program (mind, it may not be the same when compiled).

2: Write a program to read in the file and write out the bytes with the patch data intergrated based on the data in (1).

,Jay
Advertisement
Just send a new exe. Unless you''re talking about megs worth of new material, the patch program is going to be roughly the same size as the binary you''re replacing.

Take care,
Bill
quote: Original post by Promit
The specific reason is because they keep redoing the WAD files. Even though they are compressed, the WADs are still massive.


More specifically, because they include all the previous updates so that new users can download one patch and have all the updates. They also include a couple complete mods in the patcher, which imo is totally unneccessary.

They usually release a smaller patch to update the previous version, and that usually equates to no more than a couple megs.

-----------------------
"When I have a problem on an Nvidia, I assume that it is my fault. With anyone else''s drivers, I assume it is their fault" - John Carmack
-----------------------"When I have a problem on an Nvidia, I assume that it is my fault. With anyone else's drivers, I assume it is their fault" - John Carmack
hmm... oh well, i''ll just remember what you all say as for now, maybe someday i''ll understand it eventually, thanks guys!!!
http://www.dualforcesolutions.comProfessional website designs and development, customized business systems, etc.,
Alright Mickey, heres how it goes:
THERE IS NO CODE TO PATCH IT (at least not on your end; if you knew how to, you could make a patcher).
What you do is compile both of the of the files, than you find a patcher. All a patcher does is looks at the little 1''s and 0''s in each file, and makes notes to itself about which little 1''s and 0''s are the same in both files, and which little 1''s and 0''s are different. Then it makes an .exe file to tell the computer which 1''s and 0''s are different, and what to change them to. Then, when you open it up on your computer, it take the file that you want to change, and change''s the 1''s and 0''s that are supposed to be changed.
Does that make sense now!?

"I''ve learned something today: It doesn''t matter if you''re white, or if you''re black...the only color that REALLY matters is green"
-Peter Griffin
"I've learned something today: It doesn't matter if you're white, or if you're black...the only color that really matters is green"-Peter Griffin
Advertisement
yes of course matrix, that''s also what krez and jason zelos said, i just needed a very little sample code that really does it, so i''ll have a brighter idea, anyway.. thank you soo much!
http://www.dualforcesolutions.comProfessional website designs and development, customized business systems, etc.,
Sorry if I was crabby I suppose that happens when your sober

"I''ve learned something today: It doesn''t matter if you''re white, or if you''re black...the only color that REALLY matters is green"
-Peter Griffin
"I've learned something today: It doesn't matter if you're white, or if you're black...the only color that really matters is green"-Peter Griffin

This topic is closed to new replies.

Advertisement