Commit graph

2 commits

Author SHA1 Message Date
Simon Tatham
4aa85aa621 Fix checksum calculation in CAB data records.
[MS-CAB] is pretty unclearly worded in this area. Turns out that if
the sequence of bytes being checksummed is not a multiple of 4 bytes,
you are supposed to _first_ reverse the order of the trailing (n % 4)
bytes, and _then_ append zero bytes to pad to a multiple of 4, before
you do the main checksum operation of XORing together all the 32-bit
words of the input.
2017-05-16 20:11:53 +01:00
Simon Tatham
f0cdcb370e My own CAB-maker, which compresses.
lcab produces uncompressed CAB files, which is a bit low-quality for
my taste - especially when it turns out CAB files have Deflate as one
of their compression options, so I can write a compressed CAB-builder
in only about 100 lines of Python using the zlib module! I'd expected
to have to faff about finding an implementation of LZX, but there's
really no need to bother.
2017-05-16 19:06:05 +01:00