So, how exactly do software patches work. If there is a certain bug in the source code of a program, how is this source code changed when one installs a patch? After the patch has been installed how is the program 'automatically' rebuilt?

  • 2
    I would think that (generally) the entire binary to be "updated" is completely replaced by a binary that's downloaded and copied over the top of the old one.
    – John Lyon
    Sep 13, 2012 at 6:50

1 Answer 1


The whole program gets updated. In essence the operation could go as follows:

  • Request updates
  • Download updated files
  • Replace current files with the new downloaded files

Details how to manage this may vary, because for example it might not be possible to delete an executable file of a running process, so some form of a workaround is needed(run the updater as a separate program instead of the main application...). It could also be possible to simply just apply the actual changes between the old and the new file, rather than download the whole file. But again, these are just implementation details.

  • 3
    Unless you're working with huge files and using a binary patcher. If for some reason unbeknownst to god and man you are developing an application with a monolithic executable file, it may be prudent to use a binary patching scheme. In this case, you compute only the difference between two binary files and send only the differing data. A real example of when this is used is say a large map file for a video game. These files can be hundreds of megabytes and are usually formatted such that resources are stored with padding in fixed size containers. If you only need to update one texture, Sep 13, 2012 at 8:07
  • simply send the new texture and the offset at which to write that texture plus padding. Rather than sending 200mb you're sending only a few. Sep 13, 2012 at 8:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.