Update hyperlinks Use https whenever possible, and replace some outdated links.
compiler.h: remove _may_alias_attribute This abstraction layer serves no purpose. Just use __attribute__((may_alias)) directly.
Consistently use _WIN32 instead of __WIN32__ _WIN32 works with all compilers, while __WIN32__ is MinGW-specific. This project used __WIN32__ in files that only support MinGW, and _WIN32 in other files such as the library header and example programs. One place even used WIN32. Avoid this unnecessary complication by just always using _WIN32.
SHA-1 rework First, add new SHA-1 implementations that use the x86 and ARM SHA-1 intrinsics, so that these can be taken advantage of in Windows builds. Second, replace sha1-ssse3.asm with an easier-to-maintain implementation using intrinsics, and build a copy of it with AVX+BMI2 enabled. Finally, now that better SHA-1 implementations are included, support for OpenSSL's SHA-1 is no longer very useful, so remove it. I considered going in the other direction: removing all SHA-1 code and relying completely on external libraries. Some issues with that are: - Statically linking OpenSSL into libwim.dll on Windows increases the binary size by over 4x, even when using "no-autoalginit". - OpenSSL has deprecated its easy-to-use SHA-1 API in favor of the EVP API, which is harder to use (everything can fail) and slower. - Windows CryptoAPI is Windows-only (duh) and also has a complex, slow API where every function can fail, so that's not great either. - SHA-1 is considered insecure these days, so it may be unwise to count on its continued support in crypto libraries into the future. So, let's just do it ourselves...
Add and use SHA1_HASH_STRING_LEN constant
Remove some unnecessary configure options Remove support for the following options which aren't really useful and probably aren't being used by anyone: * --disable-assertions * --disable-error-messages * --disable-multithreaded-compression
Add support for a data recovery mode Add support for extracting file data even if it is corrupted (i.e. if its hash doesn't match or some of its chunks can't be decompressed). This isn't recommended for general use, but it could be useful for recovering data from a corrupted WIM archive.
Constify some data
resource: pass blob and offset to consume_chunk This makes it so that users don't need to keep track of the current blob and offset themselves.
bitops: rename bit scan functions Our bit scan functions use 0-based indices and do not allow zero inputs. Rename them to 'bsr' and 'bsf' to match the x86 instructions and avoid confusion with another common convention for 'fls' and 'ffs'.
Add experimental support for Windows VSS
resource.c: fix comment about 4 GiB cutoff
resource.c: fix bug in read_compressed_wim_resource() The number of chunk entries to read could be incorrectly computed as 1 rather than 0. This caused an on-stack array to be overflowed by 8 bytes.
Improved reporting of concurrent modifications and corruptions
file_io.c: set errno=EINVAL on unexpected end of file
New helper: wim_reshdr_to_desc_and_blob()
resource reading cleanups
Clean up pipable WIM extraction
Require size_in_wim == uncompressed_size for uncompressed resources It required quite a bit of extra code to handle this case, which really should just be considered invalid.
Make win32.h includable on non-Windows