Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


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


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
17 replies to this topic

#1 mickey   Members   -  Reputation: 100

Like
Likes
Like

Posted 14 February 2002 - 02:32 AM

thanks!

Sponsor:

#2 krez   GDNet+   -  Reputation: 443

Like
Likes
Like

Posted 14 February 2002 - 06:09 AM

basically, you fix some bugs and recompile the program. then, you run a [separate] program that scans both the old and new EXEs, and writes any differences it finds into a new file. this new file now has all the changes in it, but without any of the old stuff that is the same.
then when someone runs the patch program, it inserts the new code from this "patch file" into the EXE on a user''s computer, and BAM! they have the new EXE quickly and neatly.
sometimes the patch data file is put right into the patch EXE, just for [the users''] simplicity.


--- krez (krezisback@aol.com)

#3 Jason Zelos   Members   -  Reputation: 211

Like
Likes
Like

Posted 14 February 2002 - 08:14 AM

A lot of the games now just replace any dll''s and even the exe itself with a newer version, just keeping the level data, sound and graphics.

,Jay

#4 Anonymous Poster_Anonymous Poster_*   Guests   -  Reputation:

Likes

Posted 14 February 2002 - 08:26 AM

quote:
Original post by Jason Zelos
A lot of the games now just replace any dll''s and even the exe itself with a newer version, just keeping the level data, sound and graphics.

,Jay


And that''s what I call security.

#5 matrix2113   Members   -  Reputation: 122

Like
Likes
Like

Posted 14 February 2002 - 12:19 PM

Replacing the DLL''s (much of which will be exactly the same) and the .exe''s can make the file kinda big (bad if you''re planning for people to download it; although, why else would you make a patch?)
Not always, but sometimes (Half-life, every new patch is something like 50 mb)

"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

#6 mickey   Members   -  Reputation: 100

Like
Likes
Like

Posted 14 February 2002 - 02:42 PM

a-ha... sounds like by the time you know how to make a patch, you''re already very knowledgeable,

you said it scans inside the file? and replaces all the bad contents of it with the new ones? yikes!

#7 Anozireth   Members   -  Reputation: 122

Like
Likes
Like

Posted 14 February 2002 - 02:48 PM

quote:
Original post by matrix2113
Replacing the DLL''s (much of which will be exactly the same) and the .exe''s can make the file kinda big (bad if you''re planning for people to download it; although, why else would you make a patch?)
Not always, but sometimes (Half-life, every new patch is something like 50 mb)

"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


The reason HL patches and the like are 50 MB is not the exe or the dlls, all those together is maybe 1 or 2 MB. patches are 50 because they include new or updated art, levels, models, etc..

#8 matrix2113   Members   -  Reputation: 122

Like
Likes
Like

Posted 14 February 2002 - 03:56 PM

Ya w/e
You can find a free patcher/installer at
www.clickteam.com (I haven''t been there for a while, I hope the link still works)

"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

#9 mickey   Members   -  Reputation: 100

Like
Likes
Like

Posted 14 February 2002 - 11:20 PM

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!!!



#10 Promit   Moderators   -  Reputation: 7344

Like
Likes
Like

Posted 15 February 2002 - 07:55 AM

quote:
Original post by Anozireth
The reason HL patches and the like are 50 MB is not the exe or the dlls, all those together is maybe 1 or 2 MB. patches are 50 because they include new or updated art, levels, models, etc..


The specific reason is because they keep redoing the WAD files. Even though they are compressed, the WADs are still massive.

-----------------------------
The sad thing about artificial intelligence is that it lacks artifice and therefore intelligence.

#11 Anonymous Poster_Anonymous Poster_*   Guests   -  Reputation:

Likes

Posted 15 February 2002 - 08:18 AM

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.

#12 Jason Zelos   Members   -  Reputation: 211

Like
Likes
Like

Posted 15 February 2002 - 08:53 AM

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

#13 Siebharinn   Members   -  Reputation: 122

Like
Likes
Like

Posted 15 February 2002 - 03:46 PM

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

#14 Maximus   Members   -  Reputation: 124

Like
Likes
Like

Posted 16 February 2002 - 01:48 AM

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

#15 mickey   Members   -  Reputation: 100

Like
Likes
Like

Posted 16 February 2002 - 02:29 AM

hmm... oh well, i''ll just remember what you all say as for now, maybe someday i''ll understand it eventually, thanks guys!!!

#16 matrix2113   Members   -  Reputation: 122

Like
Likes
Like

Posted 16 February 2002 - 12:04 PM

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

#17 mickey   Members   -  Reputation: 100

Like
Likes
Like

Posted 16 February 2002 - 05:14 PM

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!

#18 matrix2113   Members   -  Reputation: 122

Like
Likes
Like

Posted 17 February 2002 - 01:44 PM

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




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS