Is there a generic patching utility that can create deltas that don't contain source bits?

| | August 6, 2015

To support legally modding software, assuming I already have a way to legally extract the source code and/or embedded content, I need a way to patch the data without distributing any of the original content.

Is there a generic patching tool or system that supports the following?

Required:

  1. Deltas that don’t contain any of the original content (unlike unix-style textual patches).
  2. Support for both textual and binary deltas.
  3. Support for Windows.
  4. No-cost license for the tool.

Optional:

  1. Automated copy and rename of files. This is so you can effectively make a separate modded copy of content, rather than completely replacing it with the patched version.
  2. Dealing with compressed data (like png files). This might be difficult, as the diff and patch programs would be responsible for uncompressing and recompressing the data. This can be worked around with other tools (like png -> bmp converters).
  3. Smart detection of ideal block sizes for binary deltas.
  4. Support for some sort of checksum or one-way hashing so you can validate that the source data is correct before applying the patch, without distributing copies of that data.
  5. Support for combining multiple versions of deltas, so you can distribute one patch that will apply to multiple versions of the source software.
  6. Support for non-Windows OSs.
  7. Open source.

Background:

This seems like a common problem to solve for legal, but unsupported game modding. Before I create my own tools I’d like to see if there are existing ones. This is not for a game that has any modding tools available yet.

A combination of tools that I could string together with shell scripts/batch files would be perfectly acceptable, as long as I can get all the required features I’ve listed.

One Response to “Is there a generic patching utility that can create deltas that don't contain source bits?”

  1. Merlyn Morgan-Graham on November 30, -0001 @ 12:00 AM

    I found a tool that might (with a lot of extra work) get the job done from this q&a:

    http://superuser.com/questions/283008/binary-diff-patch-for-large-files-on-linux

    rdiff (which is open source and has a Windows port) seems to do the job, though it will require a lot of wrapping to automate its usage.

    It doesn’t seem to automatically detect an ideal block size to make a minimal diff, and it doesn’t automatically decompress the source file before taking the delta.

    Both of these features are necessary if you want to keep your patches small. More importantly, both are necessary to avoid accidents like creating deltas that can be applied to any file. Such a delta would violate the requirement that you don’t simply distribute a modified copy of the original content.

    A wrapper application or shell script could be used to detect whether files are compressed or not (simple extension filter) and potentially decompress the file, or refuse to work. It could also try different block sizes to figure out a value that makes a small delta, or have specific block sizes programmed in for specific types of files (ala a gzip file made with –rsync that takes rsync’s default 512b block size into account).

Leave a Reply