You are reading an archived copy of my old blog. Please visit for fresh stuff!

Archive for November 22nd, 2008


bspatch c# port

Saturday, November 22nd, 2008

For osu! updates, I use an algorithm called bsdiff (bytewise subtraction) designed by Colin Percival.  Up until now it has been an external dependency that causes problems with Vista (UAC issues) and occasional instability in the process handling, so I got around to porting it over to .NET last night.  I thought for once I’d share this publicly because I think it may be helpful for others out there wanting to do a similar thing.

I only ported the bspatch part over, so you’ll need to create the diff files using the original code (also available as a native windows c++ port here. The sharpziplib library is used for bzip2 stream handling, and only minimal files are included.  This makes for a very small binary (19,968 bytes).

Binary available here (pruned to smallest possible size).
Source code here.

While I haven’t benchmarked performance seriously, it should be near-equal to the native code.  There is no unsafe code used (although it can be employed very easily for a performance boost).