Working with binaries this way in C# is tricky because of the runtime's tendency to treat literals as int32 (among others) and the different casting/type promotion rules in C++ and C#, so it's better to just use an existing library that's known to work rather than directly convert C++ bit-magic to C#. The CRC implementation is standard CRC-32 with standard polynomials, so any existing CRC32 lib will work. The reason my version is hand-rolled C++ is because all of the pure-C# CRC implementations I've tested were significantly slower, and the checksum calculation sometimes took ~40% of the total unpacking time.

This one would be a safe pure-C# choice:

The .LSB/.LSF files don't contain checksums, but the package itself (.PAK/.LSV) does.

Last edited by Norbyte; 29/05/19 05:27 PM.