Jump to content

[Tool] xdelta binary patch generator / applier


hellyou

Recommended Posts

I've experimented a bit with xdelta lately, and made a small ui for it. For those who don't know, xDelta is a tool to take the difference between two binary files and make a patch for it.

 

What that means is that if there's a new release of a mod, let's say a big one, xdelta can compare the two versions and produce a small file of just the changes. I've tested it a bit on some mods, if the structure is the same you can get really small patches.

 

I've tried on SD+ v5.44 to 5.52, and while the file size is respectively 66mb and 74mb, the patch generated was 8.5mb 7zipped. I also tried Immersive Armor v7.2 and 8.0 - the mod itself almost 1gb 7zipped. Patch was under 500kb! So in some cases it's really impressive.

 

However, on a mod where the structure had changed completely the patch file was as big as the new version.

 

Pretty impressive, but xdelta is on a per-file basis, and it's command line. So I made a simple UI for it in Python (tested with python 2.7) which asks for three folders and have two buttons. Folders are "Old folder", "New folder" and "Patch folder", and buttons are "Create patch" and "Apply patch".

 

"Create patch" will compare old and new folder and create the patch in the "Patch" folder (which should be empty).

 

The way it works is this:

 * If file exists in both new and old folder, it will create a .xdelta file with the difference.

 * If a file is in new folder but not old, it will copy the whole file to the patch folder.

 * If the file exists in old folder but not new folder, it's ignored.

 

"Apply patch" will apply patch in "Patch" to "New" folder (which should be empty), and will either apply .xdelta patch to old file and write the new file in New folder, or copy file from Patch folder to New folder.

 

This only works on unzipped mods for now, since the compression will make everything different and it's near impossible to find small differences. I'm thinking of adding direct 7zip support, but want to see how well it works for people first, if it's worth tinkering more with.

 

UI and xdelta exe file : See post under this

Link to comment

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more information, see our Privacy Policy & Terms of Use