Binary patched by using various algorithm :

bsdiff:

To install : sudo apt-get install bsdiff
Create Patch : bsdiff old_version_file new_version_file delta_file.bsdiff
Apply Patch : bspatch old_version_fil newfile delta_file.bsdiff
Example by using text file :
bsdiff dog.txt hen.txt hd.diff
bspatch hen.txt dog1.txt hd.diff

xdelta:

To install : sudo apt-get install xdelta3
Create Patch : xdelta3 -9 -S lzma -e -f -s old_version_file new_version_file xdelta_file
Apply Patch : xdelta3 -dfs old_version_file xdelta_file newfile
Example by using text file :
xdelta3 -9 -S lzma -e -f -s dog.txt hen.txt hd.delta
xdelta3 -dfs dog.txt hd.delta dog.txt

How to verify the content after patch using kdiff3:
hexdump old_version_file > myfile1.hex
hexdump new_version_file delta > myfile2.hex
kdiff3 myfile1.hex myfile2.hex : Here we can see the difference
hexdump newfile > myfile3.hex
kdiff3 myfile2.hex myfile2.hex : Here we can see no difference

 

Note: Tried using Ubuntu OS.

Advertisements