Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to compute differences between two binaries (i.e., two executables) in linux

In Linux is there any way to compute the differences between two binaries (i.e., two executables)?

Let me be more specific: I want to know how to compute the delta (delta difference) between two versions of an executable or application or software in Linux. For example if I have to download and install only the updated part (the delta difference between the latest version and the old version) of an existing application or binary how do I do that in Linux.

like image 955
ind79ra Avatar asked Nov 16 '12 10:11

ind79ra


1 Answers

You can use the tool bsdiff, and it's companion bspatch, for doing efficient diffs and patches of binary files.

If you want to get even smaller patches, you can take a look at Courgette, from Google Chrome. It's built on bsdiff, but they provide even more efficient diffs of executables by actually disassembling them before doing the diff. It's not distributed as a separate project, but you can get it from the Chromium source repository (how to check out the code).

There is also the xdelta tool, that has been around longer than bsdiff. According to the author of bsdiff, it is considerably less efficient; patches come out much bigger. It has the advantage that it supports the standard VCDIFF format (RFC 3284), which is supported by several other tools as well, so if you need to work with such other tools, it would be more useful.

like image 141
Brian Campbell Avatar answered Oct 09 '22 20:10

Brian Campbell