stormlib 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/ext/stormlib/StormLib/CMakeFiles/3.22.1/CMakeCCompiler.cmake +72 -0
- data/ext/stormlib/StormLib/CMakeFiles/3.22.1/CMakeCXXCompiler.cmake +83 -0
- data/ext/stormlib/StormLib/CMakeFiles/3.22.1/CMakeDetermineCompilerABI_C.bin +0 -0
- data/ext/stormlib/StormLib/CMakeFiles/3.22.1/CMakeDetermineCompilerABI_CXX.bin +0 -0
- data/ext/stormlib/StormLib/CMakeFiles/3.22.1/CMakeSystem.cmake +15 -0
- data/ext/stormlib/StormLib/CMakeFiles/3.22.1/CompilerIdC/CMakeCCompilerId.c +803 -0
- data/ext/stormlib/StormLib/CMakeFiles/3.22.1/CompilerIdC/a.out +0 -0
- data/ext/stormlib/StormLib/CMakeFiles/3.22.1/CompilerIdCXX/CMakeCXXCompilerId.cpp +791 -0
- data/ext/stormlib/StormLib/CMakeFiles/3.22.1/CompilerIdCXX/a.out +0 -0
- data/ext/stormlib/StormLib/CMakeFiles/CMakeDirectoryInformation.cmake +16 -0
- data/ext/stormlib/StormLib/CMakeFiles/CMakeOutput.log +478 -0
- data/ext/stormlib/StormLib/CMakeFiles/Export/share/StormLib/StormLibConfig-noconfig.cmake +19 -0
- data/ext/stormlib/StormLib/CMakeFiles/Export/share/StormLib/StormLibConfig.cmake +99 -0
- data/ext/stormlib/StormLib/CMakeFiles/Makefile.cmake +61 -0
- data/ext/stormlib/StormLib/CMakeFiles/Makefile2 +112 -0
- data/ext/stormlib/StormLib/CMakeFiles/TargetDirectories.txt +9 -0
- data/ext/stormlib/StormLib/CMakeFiles/cmake.check_cache +1 -0
- data/ext/stormlib/StormLib/CMakeFiles/progress.marks +1 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/DependInfo.cmake +243 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/build.make +3695 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/cmake_clean.cmake +459 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/cmake_clean_target.cmake +3 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/compiler_depend.make +2 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/compiler_depend.ts +2 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/depend.make +2 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/flags.make +17 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/link.txt +2 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/progress.make +227 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/FileStream.cpp.o.d +160 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/SBaseCommon.cpp.o.d +159 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/SBaseDumpData.cpp.o.d +159 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/SBaseFileTable.cpp.o.d +159 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/SBaseSubTypes.cpp.o.d +159 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/SCompression.cpp.o.d +159 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/SFileAddFile.cpp.o.d +159 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/SFileAttributes.cpp.o.d +159 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/SFileCompactArchive.cpp.o.d +159 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/SFileCreateArchive.cpp.o.d +159 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/SFileExtractFile.cpp.o.d +159 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/SFileFindFile.cpp.o.d +159 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/SFileGetFileInfo.cpp.o.d +159 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/SFileListFile.cpp.o.d +159 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/SFileOpenArchive.cpp.o.d +159 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/SFileOpenFileEx.cpp.o.d +159 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/SFilePatchArchives.cpp.o.d +159 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/SFileReadFile.cpp.o.d +159 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/SFileVerify.cpp.o.d +159 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/adpcm/adpcm.cpp.o.d +12 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/huffman/huff.cpp.o.d +16 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/jenkins/lookup3.c.o.d +88 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/hashes/hash_memory.c.o.d +102 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/hashes/md5.c.o.d +102 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/hashes/sha1.c.o.d +102 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/hashes/sha256.c.o.d +102 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/math/ltm_desc.c.o.d +105 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/math/multi.c.o.d +102 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/math/rand_prime.c.o.d +102 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/misc/base64_decode.c.o.d +102 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/misc/crypt_argchk.c.o.d +102 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/misc/crypt_find_hash.c.o.d +102 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/misc/crypt_find_prng.c.o.d +102 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/misc/crypt_hash_descriptor.c.o.d +102 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/misc/crypt_hash_is_valid.c.o.d +102 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/misc/crypt_libc.c.o.d +102 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/misc/crypt_ltc_mp_descriptor.c.o.d +102 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/misc/crypt_prng_descriptor.c.o.d +102 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/misc/crypt_prng_is_valid.c.o.d +102 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/misc/crypt_register_hash.c.o.d +102 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/misc/crypt_register_prng.c.o.d +102 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/misc/zeromem.c.o.d +102 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/pk/asn1/der_decode_bit_string.c.o.d +102 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/pk/asn1/der_decode_boolean.c.o.d +102 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/pk/asn1/der_decode_choice.c.o.d +102 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/pk/asn1/der_decode_ia5_string.c.o.d +102 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/pk/asn1/der_decode_integer.c.o.d +102 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/pk/asn1/der_decode_object_identifier.c.o.d +102 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/pk/asn1/der_decode_octet_string.c.o.d +102 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/pk/asn1/der_decode_printable_string.c.o.d +102 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/pk/asn1/der_decode_sequence_ex.c.o.d +102 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/pk/asn1/der_decode_sequence_flexi.c.o.d +102 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/pk/asn1/der_decode_sequence_multi.c.o.d +102 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/pk/asn1/der_decode_short_integer.c.o.d +102 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/pk/asn1/der_decode_utctime.c.o.d +102 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/pk/asn1/der_decode_utf8_string.c.o.d +102 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/pk/asn1/der_encode_bit_string.c.o.d +102 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/pk/asn1/der_encode_boolean.c.o.d +102 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/pk/asn1/der_encode_ia5_string.c.o.d +102 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/pk/asn1/der_encode_integer.c.o.d +102 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/pk/asn1/der_encode_object_identifier.c.o.d +102 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/pk/asn1/der_encode_octet_string.c.o.d +102 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/pk/asn1/der_encode_printable_string.c.o.d +102 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/pk/asn1/der_encode_sequence_ex.c.o.d +102 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/pk/asn1/der_encode_sequence_multi.c.o.d +102 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/pk/asn1/der_encode_set.c.o.d +102 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/pk/asn1/der_encode_setof.c.o.d +102 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/pk/asn1/der_encode_short_integer.c.o.d +102 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/pk/asn1/der_encode_utctime.c.o.d +102 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/pk/asn1/der_encode_utf8_string.c.o.d +102 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/pk/asn1/der_length_bit_string.c.o.d +102 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/pk/asn1/der_length_boolean.c.o.d +102 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/pk/asn1/der_length_ia5_string.c.o.d +102 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/pk/asn1/der_length_integer.c.o.d +102 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/pk/asn1/der_length_object_identifier.c.o.d +102 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/pk/asn1/der_length_octet_string.c.o.d +102 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/pk/asn1/der_length_printable_string.c.o.d +102 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/pk/asn1/der_length_sequence.c.o.d +102 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/pk/asn1/der_length_short_integer.c.o.d +102 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/pk/asn1/der_length_utctime.c.o.d +102 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/pk/asn1/der_length_utf8_string.c.o.d +102 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/pk/asn1/der_sequence_free.c.o.d +102 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/pk/ecc/ltc_ecc_map.c.o.d +102 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/pk/ecc/ltc_ecc_mul2add.c.o.d +102 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/pk/ecc/ltc_ecc_mulmod.c.o.d +102 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/pk/ecc/ltc_ecc_points.c.o.d +102 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/pk/ecc/ltc_ecc_projective_add_point.c.o.d +102 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/pk/ecc/ltc_ecc_projective_dbl_point.c.o.d +102 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/pk/pkcs1/pkcs_1_mgf1.c.o.d +102 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/pk/pkcs1/pkcs_1_oaep_decode.c.o.d +102 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/pk/pkcs1/pkcs_1_pss_decode.c.o.d +102 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/pk/pkcs1/pkcs_1_pss_encode.c.o.d +102 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/pk/pkcs1/pkcs_1_v1_5_decode.c.o.d +102 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/pk/pkcs1/pkcs_1_v1_5_encode.c.o.d +102 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/pk/rsa/rsa_exptmod.c.o.d +102 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/pk/rsa/rsa_free.c.o.d +102 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/pk/rsa/rsa_import.c.o.d +102 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/pk/rsa/rsa_make_key.c.o.d +102 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/pk/rsa/rsa_sign_hash.c.o.d +102 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/pk/rsa/rsa_verify_hash.c.o.d +102 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/pk/rsa/rsa_verify_simple.c.o.d +102 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_fast_mp_invmod.c.o.d +65 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_fast_mp_montgomery_reduce.c.o.d +65 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_fast_s_mp_mul_digs.c.o.d +65 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_fast_s_mp_mul_high_digs.c.o.d +65 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_fast_s_mp_sqr.c.o.d +65 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_2expt.c.o.d +65 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_abs.c.o.d +65 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_add.c.o.d +65 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_add_d.c.o.d +65 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_addmod.c.o.d +65 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_and.c.o.d +65 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_clamp.c.o.d +65 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_clear.c.o.d +65 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_clear_multi.c.o.d +65 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_cmp.c.o.d +65 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_cmp_d.c.o.d +65 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_cmp_mag.c.o.d +65 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_cnt_lsb.c.o.d +65 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_copy.c.o.d +65 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_count_bits.c.o.d +65 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_div.c.o.d +65 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_div_2.c.o.d +65 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_div_2d.c.o.d +65 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_div_3.c.o.d +65 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_div_d.c.o.d +65 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_dr_is_modulus.c.o.d +65 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_dr_reduce.c.o.d +65 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_dr_setup.c.o.d +65 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_exch.c.o.d +65 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_expt_d.c.o.d +65 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_exptmod.c.o.d +65 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_exptmod_fast.c.o.d +65 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_exteuclid.c.o.d +65 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_fread.c.o.d +65 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_fwrite.c.o.d +65 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_gcd.c.o.d +65 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_get_int.c.o.d +65 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_grow.c.o.d +65 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_init.c.o.d +65 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_init_copy.c.o.d +65 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_init_multi.c.o.d +65 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_init_set.c.o.d +65 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_init_set_int.c.o.d +65 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_init_size.c.o.d +65 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_invmod.c.o.d +65 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_invmod_slow.c.o.d +65 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_is_square.c.o.d +65 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_jacobi.c.o.d +65 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_karatsuba_mul.c.o.d +65 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_karatsuba_sqr.c.o.d +65 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_lcm.c.o.d +65 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_lshd.c.o.d +65 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_mod.c.o.d +65 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_mod_2d.c.o.d +65 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_mod_d.c.o.d +65 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_montgomery_calc_normalization.c.o.d +65 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_montgomery_reduce.c.o.d +65 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_montgomery_setup.c.o.d +65 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_mul.c.o.d +65 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_mul_2.c.o.d +65 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_mul_2d.c.o.d +65 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_mul_d.c.o.d +65 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_mulmod.c.o.d +65 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_n_root.c.o.d +65 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_neg.c.o.d +65 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_or.c.o.d +65 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_prime_fermat.c.o.d +65 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_prime_is_divisible.c.o.d +65 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_prime_is_prime.c.o.d +65 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_prime_miller_rabin.c.o.d +65 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_prime_next_prime.c.o.d +65 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_prime_rabin_miller_trials.c.o.d +65 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_prime_random_ex.c.o.d +65 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_radix_size.c.o.d +65 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_radix_smap.c.o.d +65 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_rand.c.o.d +65 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_read_radix.c.o.d +65 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_read_signed_bin.c.o.d +65 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_read_unsigned_bin.c.o.d +65 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_reduce.c.o.d +65 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_reduce_2k.c.o.d +65 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_reduce_2k_l.c.o.d +65 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_reduce_2k_setup.c.o.d +65 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_reduce_2k_setup_l.c.o.d +65 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_reduce_is_2k.c.o.d +65 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_reduce_is_2k_l.c.o.d +65 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_reduce_setup.c.o.d +65 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_rshd.c.o.d +65 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_set.c.o.d +65 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_set_int.c.o.d +65 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_shrink.c.o.d +65 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_signed_bin_size.c.o.d +65 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_sqr.c.o.d +65 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_sqrmod.c.o.d +65 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_sqrt.c.o.d +65 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_sub.c.o.d +65 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_sub_d.c.o.d +65 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_submod.c.o.d +65 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_to_signed_bin.c.o.d +65 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_to_signed_bin_n.c.o.d +65 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_to_unsigned_bin.c.o.d +65 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_to_unsigned_bin_n.c.o.d +65 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_toom_mul.c.o.d +65 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_toom_sqr.c.o.d +65 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_toradix.c.o.d +65 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_toradix_n.c.o.d +65 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_unsigned_bin_size.c.o.d +65 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_xor.c.o.d +65 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_zero.c.o.d +65 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_prime_tab.c.o.d +65 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_reverse.c.o.d +65 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_s_mp_add.c.o.d +65 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_s_mp_exptmod.c.o.d +65 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_s_mp_mul_digs.c.o.d +65 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_s_mp_mul_high_digs.c.o.d +65 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_s_mp_sqr.c.o.d +65 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_s_mp_sub.c.o.d +65 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bncore.c.o.d +65 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/lzma/C/LzFind.c.o.d +18 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/lzma/C/LzmaDec.c.o.d +17 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/lzma/C/LzmaEnc.c.o.d +18 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/pklib/explode.c.o.d +16 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/pklib/implode.c.o.d +23 -0
- data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/sparse/sparse.cpp.o.d +16 -0
- data/ext/stormlib/StormLib/CMakeLists.txt +418 -0
- data/ext/stormlib/StormLib/Info.plist +22 -0
- data/ext/stormlib/StormLib/LICENSE +21 -0
- data/ext/stormlib/StormLib/Premake5.lua +132 -0
- data/ext/stormlib/StormLib/README.md +39 -0
- data/ext/stormlib/StormLib/StormLib.sln +162 -0
- data/ext/stormlib/StormLib/StormLib.vcxproj +1024 -0
- data/ext/stormlib/StormLib/StormLib.vcxproj.filters +221 -0
- data/ext/stormlib/StormLib/StormLib.xcodeproj/project.pbxproj +2104 -0
- data/ext/stormlib/StormLib/StormLib_dll.vcxproj +348 -0
- data/ext/stormlib/StormLib/StormLib_dll.vcxproj.filters +229 -0
- data/ext/stormlib/StormLib/StormLib_test.vcxproj +360 -0
- data/ext/stormlib/StormLib/StormLib_test.vcxproj.filters +230 -0
- data/ext/stormlib/StormLib/StormLib_vs08.sln +139 -0
- data/ext/stormlib/StormLib/StormLib_vs08.vcproj +4205 -0
- data/ext/stormlib/StormLib/StormLib_vs08_dll.vcproj +1851 -0
- data/ext/stormlib/StormLib/StormLib_vs08_test.vcproj +1289 -0
- data/ext/stormlib/StormLib/doc/History.txt +78 -0
- data/ext/stormlib/StormLib/doc/The MoPaQ File Format 0.9.txt +318 -0
- data/ext/stormlib/StormLib/doc/The MoPaQ File Format 1.0.txt +433 -0
- data/ext/stormlib/StormLib/doc/d3-authenticationcode/d3-authenticationcode-deDE.txt +1 -0
- data/ext/stormlib/StormLib/doc/d3-authenticationcode/d3-authenticationcode-enGB.txt +1 -0
- data/ext/stormlib/StormLib/doc/d3-authenticationcode/d3-authenticationcode-enSG.txt +1 -0
- data/ext/stormlib/StormLib/doc/d3-authenticationcode/d3-authenticationcode-enUS.txt +1 -0
- data/ext/stormlib/StormLib/doc/d3-authenticationcode/d3-authenticationcode-esES.txt +1 -0
- data/ext/stormlib/StormLib/doc/d3-authenticationcode/d3-authenticationcode-esMX.txt +1 -0
- data/ext/stormlib/StormLib/doc/d3-authenticationcode/d3-authenticationcode-frFR.txt +1 -0
- data/ext/stormlib/StormLib/doc/d3-authenticationcode/d3-authenticationcode-itIT.txt +1 -0
- data/ext/stormlib/StormLib/doc/d3-authenticationcode/d3-authenticationcode-koKR.txt +1 -0
- data/ext/stormlib/StormLib/doc/d3-authenticationcode/d3-authenticationcode-plPL.txt +1 -0
- data/ext/stormlib/StormLib/doc/d3-authenticationcode/d3-authenticationcode-ptBR.txt +1 -0
- data/ext/stormlib/StormLib/doc/d3-authenticationcode/d3-authenticationcode-zhTW.txt +1 -0
- data/ext/stormlib/StormLib/doc/hots-authenticationcode/hots-authenticationcode-bgdl.txt +1 -0
- data/ext/stormlib/StormLib/doc/sc2-authenticationcode/sc2-authenticationcode-deDE.txt +1 -0
- data/ext/stormlib/StormLib/doc/sc2-authenticationcode/sc2-authenticationcode-enGB.txt +1 -0
- data/ext/stormlib/StormLib/doc/sc2-authenticationcode/sc2-authenticationcode-enUS.txt +1 -0
- data/ext/stormlib/StormLib/doc/sc2-authenticationcode/sc2-authenticationcode-esES.txt +1 -0
- data/ext/stormlib/StormLib/doc/sc2-authenticationcode/sc2-authenticationcode-esMX.txt +1 -0
- data/ext/stormlib/StormLib/doc/sc2-authenticationcode/sc2-authenticationcode-frFR.txt +1 -0
- data/ext/stormlib/StormLib/doc/sc2-authenticationcode/sc2-authenticationcode-itIT.txt +1 -0
- data/ext/stormlib/StormLib/doc/sc2-authenticationcode/sc2-authenticationcode-koKR.txt +1 -0
- data/ext/stormlib/StormLib/doc/sc2-authenticationcode/sc2-authenticationcode-plPL.txt +1 -0
- data/ext/stormlib/StormLib/doc/sc2-authenticationcode/sc2-authenticationcode-ptBR.txt +1 -0
- data/ext/stormlib/StormLib/doc/sc2-authenticationcode/sc2-authenticationcode-ruRU.txt +1 -0
- data/ext/stormlib/StormLib/doc/sc2-authenticationcode/sc2-authenticationcode-zhTW.txt +1 -0
- data/ext/stormlib/StormLib/make-msvc.bat +95 -0
- data/ext/stormlib/StormLib/make.bat +46 -0
- data/ext/stormlib/StormLib/sources +14 -0
- data/ext/stormlib/StormLib/src/DllMain.c +24 -0
- data/ext/stormlib/StormLib/src/DllMain.def +79 -0
- data/ext/stormlib/StormLib/src/DllMain.rc +110 -0
- data/ext/stormlib/StormLib/src/FileStream.cpp +2928 -0
- data/ext/stormlib/StormLib/src/FileStream.h +217 -0
- data/ext/stormlib/StormLib/src/LibTomCrypt.c +85 -0
- data/ext/stormlib/StormLib/src/LibTomMath.c +125 -0
- data/ext/stormlib/StormLib/src/LibTomMathDesc.c +4 -0
- data/ext/stormlib/StormLib/src/SBaseCommon.cpp +1970 -0
- data/ext/stormlib/StormLib/src/SBaseDumpData.cpp +183 -0
- data/ext/stormlib/StormLib/src/SBaseFileTable.cpp +3194 -0
- data/ext/stormlib/StormLib/src/SBaseSubTypes.cpp +688 -0
- data/ext/stormlib/StormLib/src/SCompression.cpp +1183 -0
- data/ext/stormlib/StormLib/src/SFileAddFile.cpp +1337 -0
- data/ext/stormlib/StormLib/src/SFileAttributes.cpp +573 -0
- data/ext/stormlib/StormLib/src/SFileCompactArchive.cpp +654 -0
- data/ext/stormlib/StormLib/src/SFileCreateArchive.cpp +285 -0
- data/ext/stormlib/StormLib/src/SFileExtractFile.cpp +64 -0
- data/ext/stormlib/StormLib/src/SFileFindFile.cpp +484 -0
- data/ext/stormlib/StormLib/src/SFileGetFileInfo.cpp +627 -0
- data/ext/stormlib/StormLib/src/SFileListFile.cpp +750 -0
- data/ext/stormlib/StormLib/src/SFileOpenArchive.cpp +723 -0
- data/ext/stormlib/StormLib/src/SFileOpenFileEx.cpp +423 -0
- data/ext/stormlib/StormLib/src/SFilePatchArchives.cpp +1175 -0
- data/ext/stormlib/StormLib/src/SFileReadFile.cpp +922 -0
- data/ext/stormlib/StormLib/src/SFileVerify.cpp +1059 -0
- data/ext/stormlib/StormLib/src/StormCommon.h +450 -0
- data/ext/stormlib/StormLib/src/StormLib.exp +74 -0
- data/ext/stormlib/StormLib/src/StormLib.h +1157 -0
- data/ext/stormlib/StormLib/src/StormPort.h +474 -0
- data/ext/stormlib/StormLib/src/adpcm/adpcm.cpp +539 -0
- data/ext/stormlib/StormLib/src/adpcm/adpcm.h +27 -0
- data/ext/stormlib/StormLib/src/bzip2/blocksort.c +1094 -0
- data/ext/stormlib/StormLib/src/bzip2/bzlib.c +1573 -0
- data/ext/stormlib/StormLib/src/bzip2/bzlib.h +282 -0
- data/ext/stormlib/StormLib/src/bzip2/bzlib_private.h +509 -0
- data/ext/stormlib/StormLib/src/bzip2/compress.c +672 -0
- data/ext/stormlib/StormLib/src/bzip2/crctable.c +104 -0
- data/ext/stormlib/StormLib/src/bzip2/decompress.c +626 -0
- data/ext/stormlib/StormLib/src/bzip2/huffman.c +205 -0
- data/ext/stormlib/StormLib/src/bzip2/randtable.c +84 -0
- data/ext/stormlib/StormLib/src/huffman/huff.cpp +915 -0
- data/ext/stormlib/StormLib/src/huffman/huff.h +143 -0
- data/ext/stormlib/StormLib/src/jenkins/lookup.h +24 -0
- data/ext/stormlib/StormLib/src/jenkins/lookup3.c +1003 -0
- data/ext/stormlib/StormLib/src/libtomcrypt/src/hashes/hash_memory.c +69 -0
- data/ext/stormlib/StormLib/src/libtomcrypt/src/hashes/md5.c +368 -0
- data/ext/stormlib/StormLib/src/libtomcrypt/src/hashes/sha1.c +288 -0
- data/ext/stormlib/StormLib/src/libtomcrypt/src/hashes/sha256.c +340 -0
- data/ext/stormlib/StormLib/src/libtomcrypt/src/headers/tomcrypt.h +91 -0
- data/ext/stormlib/StormLib/src/libtomcrypt/src/headers/tomcrypt_argchk.h +38 -0
- data/ext/stormlib/StormLib/src/libtomcrypt/src/headers/tomcrypt_cfg.h +144 -0
- data/ext/stormlib/StormLib/src/libtomcrypt/src/headers/tomcrypt_cipher.h +891 -0
- data/ext/stormlib/StormLib/src/libtomcrypt/src/headers/tomcrypt_custom.h +424 -0
- data/ext/stormlib/StormLib/src/libtomcrypt/src/headers/tomcrypt_hash.h +378 -0
- data/ext/stormlib/StormLib/src/libtomcrypt/src/headers/tomcrypt_mac.h +384 -0
- data/ext/stormlib/StormLib/src/libtomcrypt/src/headers/tomcrypt_macros.h +424 -0
- data/ext/stormlib/StormLib/src/libtomcrypt/src/headers/tomcrypt_math.h +500 -0
- data/ext/stormlib/StormLib/src/libtomcrypt/src/headers/tomcrypt_misc.h +23 -0
- data/ext/stormlib/StormLib/src/libtomcrypt/src/headers/tomcrypt_pk.h +558 -0
- data/ext/stormlib/StormLib/src/libtomcrypt/src/headers/tomcrypt_pkcs.h +89 -0
- data/ext/stormlib/StormLib/src/libtomcrypt/src/headers/tomcrypt_prng.h +199 -0
- data/ext/stormlib/StormLib/src/libtomcrypt/src/math/ltm_desc.c +483 -0
- data/ext/stormlib/StormLib/src/libtomcrypt/src/math/multi.c +61 -0
- data/ext/stormlib/StormLib/src/libtomcrypt/src/math/rand_prime.c +87 -0
- data/ext/stormlib/StormLib/src/libtomcrypt/src/misc/base64_decode.c +104 -0
- data/ext/stormlib/StormLib/src/libtomcrypt/src/misc/crypt_argchk.c +30 -0
- data/ext/stormlib/StormLib/src/libtomcrypt/src/misc/crypt_find_hash.c +40 -0
- data/ext/stormlib/StormLib/src/libtomcrypt/src/misc/crypt_find_prng.c +41 -0
- data/ext/stormlib/StormLib/src/libtomcrypt/src/misc/crypt_hash_descriptor.c +27 -0
- data/ext/stormlib/StormLib/src/libtomcrypt/src/misc/crypt_hash_is_valid.c +36 -0
- data/ext/stormlib/StormLib/src/libtomcrypt/src/misc/crypt_libc.c +43 -0
- data/ext/stormlib/StormLib/src/libtomcrypt/src/misc/crypt_ltc_mp_descriptor.c +13 -0
- data/ext/stormlib/StormLib/src/libtomcrypt/src/misc/crypt_prng_descriptor.c +26 -0
- data/ext/stormlib/StormLib/src/libtomcrypt/src/misc/crypt_prng_is_valid.c +36 -0
- data/ext/stormlib/StormLib/src/libtomcrypt/src/misc/crypt_register_hash.c +54 -0
- data/ext/stormlib/StormLib/src/libtomcrypt/src/misc/crypt_register_prng.c +54 -0
- data/ext/stormlib/StormLib/src/libtomcrypt/src/misc/zeromem.c +34 -0
- data/ext/stormlib/StormLib/src/libtomcrypt/src/pk/asn1/der_decode_bit_string.c +102 -0
- data/ext/stormlib/StormLib/src/libtomcrypt/src/pk/asn1/der_decode_boolean.c +47 -0
- data/ext/stormlib/StormLib/src/libtomcrypt/src/pk/asn1/der_decode_choice.c +182 -0
- data/ext/stormlib/StormLib/src/libtomcrypt/src/pk/asn1/der_decode_ia5_string.c +96 -0
- data/ext/stormlib/StormLib/src/libtomcrypt/src/pk/asn1/der_decode_integer.c +110 -0
- data/ext/stormlib/StormLib/src/libtomcrypt/src/pk/asn1/der_decode_object_identifier.c +99 -0
- data/ext/stormlib/StormLib/src/libtomcrypt/src/pk/asn1/der_decode_octet_string.c +91 -0
- data/ext/stormlib/StormLib/src/libtomcrypt/src/pk/asn1/der_decode_printable_string.c +96 -0
- data/ext/stormlib/StormLib/src/libtomcrypt/src/pk/asn1/der_decode_sequence_ex.c +287 -0
- data/ext/stormlib/StormLib/src/libtomcrypt/src/pk/asn1/der_decode_sequence_flexi.c +386 -0
- data/ext/stormlib/StormLib/src/libtomcrypt/src/pk/asn1/der_decode_sequence_multi.c +139 -0
- data/ext/stormlib/StormLib/src/libtomcrypt/src/pk/asn1/der_decode_short_integer.c +68 -0
- data/ext/stormlib/StormLib/src/libtomcrypt/src/pk/asn1/der_decode_utctime.c +127 -0
- data/ext/stormlib/StormLib/src/libtomcrypt/src/pk/asn1/der_decode_utf8_string.c +111 -0
- data/ext/stormlib/StormLib/src/libtomcrypt/src/pk/asn1/der_encode_bit_string.c +89 -0
- data/ext/stormlib/StormLib/src/libtomcrypt/src/pk/asn1/der_encode_boolean.c +51 -0
- data/ext/stormlib/StormLib/src/libtomcrypt/src/pk/asn1/der_encode_ia5_string.c +85 -0
- data/ext/stormlib/StormLib/src/libtomcrypt/src/pk/asn1/der_encode_integer.c +130 -0
- data/ext/stormlib/StormLib/src/libtomcrypt/src/pk/asn1/der_encode_object_identifier.c +111 -0
- data/ext/stormlib/StormLib/src/libtomcrypt/src/pk/asn1/der_encode_octet_string.c +86 -0
- data/ext/stormlib/StormLib/src/libtomcrypt/src/pk/asn1/der_encode_printable_string.c +85 -0
- data/ext/stormlib/StormLib/src/libtomcrypt/src/pk/asn1/der_encode_sequence_ex.c +335 -0
- data/ext/stormlib/StormLib/src/libtomcrypt/src/pk/asn1/der_encode_sequence_multi.c +138 -0
- data/ext/stormlib/StormLib/src/libtomcrypt/src/pk/asn1/der_encode_set.c +103 -0
- data/ext/stormlib/StormLib/src/libtomcrypt/src/pk/asn1/der_encode_setof.c +162 -0
- data/ext/stormlib/StormLib/src/libtomcrypt/src/pk/asn1/der_encode_short_integer.c +97 -0
- data/ext/stormlib/StormLib/src/libtomcrypt/src/pk/asn1/der_encode_utctime.c +83 -0
- data/ext/stormlib/StormLib/src/libtomcrypt/src/pk/asn1/der_encode_utf8_string.c +105 -0
- data/ext/stormlib/StormLib/src/libtomcrypt/src/pk/asn1/der_length_bit_string.c +54 -0
- data/ext/stormlib/StormLib/src/libtomcrypt/src/pk/asn1/der_length_boolean.c +35 -0
- data/ext/stormlib/StormLib/src/libtomcrypt/src/pk/asn1/der_length_ia5_string.c +194 -0
- data/ext/stormlib/StormLib/src/libtomcrypt/src/pk/asn1/der_length_integer.c +82 -0
- data/ext/stormlib/StormLib/src/libtomcrypt/src/pk/asn1/der_length_object_identifier.c +89 -0
- data/ext/stormlib/StormLib/src/libtomcrypt/src/pk/asn1/der_length_octet_string.c +53 -0
- data/ext/stormlib/StormLib/src/libtomcrypt/src/pk/asn1/der_length_printable_string.c +166 -0
- data/ext/stormlib/StormLib/src/libtomcrypt/src/pk/asn1/der_length_sequence.c +169 -0
- data/ext/stormlib/StormLib/src/libtomcrypt/src/pk/asn1/der_length_short_integer.c +70 -0
- data/ext/stormlib/StormLib/src/libtomcrypt/src/pk/asn1/der_length_utctime.c +46 -0
- data/ext/stormlib/StormLib/src/libtomcrypt/src/pk/asn1/der_length_utf8_string.c +83 -0
- data/ext/stormlib/StormLib/src/libtomcrypt/src/pk/asn1/der_sequence_free.c +65 -0
- data/ext/stormlib/StormLib/src/libtomcrypt/src/pk/ecc/ltc_ecc_map.c +76 -0
- data/ext/stormlib/StormLib/src/libtomcrypt/src/pk/ecc/ltc_ecc_mul2add.c +207 -0
- data/ext/stormlib/StormLib/src/libtomcrypt/src/pk/ecc/ltc_ecc_mulmod.c +222 -0
- data/ext/stormlib/StormLib/src/libtomcrypt/src/pk/ecc/ltc_ecc_points.c +60 -0
- data/ext/stormlib/StormLib/src/libtomcrypt/src/pk/ecc/ltc_ecc_projective_add_point.c +196 -0
- data/ext/stormlib/StormLib/src/libtomcrypt/src/pk/ecc/ltc_ecc_projective_dbl_point.c +147 -0
- data/ext/stormlib/StormLib/src/libtomcrypt/src/pk/pkcs1/pkcs_1_mgf1.c +108 -0
- data/ext/stormlib/StormLib/src/libtomcrypt/src/pk/pkcs1/pkcs_1_oaep_decode.c +189 -0
- data/ext/stormlib/StormLib/src/libtomcrypt/src/pk/pkcs1/pkcs_1_pss_decode.c +177 -0
- data/ext/stormlib/StormLib/src/libtomcrypt/src/pk/pkcs1/pkcs_1_pss_encode.c +175 -0
- data/ext/stormlib/StormLib/src/libtomcrypt/src/pk/pkcs1/pkcs_1_v1_5_decode.c +110 -0
- data/ext/stormlib/StormLib/src/libtomcrypt/src/pk/pkcs1/pkcs_1_v1_5_encode.c +111 -0
- data/ext/stormlib/StormLib/src/libtomcrypt/src/pk/rsa/rsa_exptmod.c +113 -0
- data/ext/stormlib/StormLib/src/libtomcrypt/src/pk/rsa/rsa_free.c +34 -0
- data/ext/stormlib/StormLib/src/libtomcrypt/src/pk/rsa/rsa_import.c +143 -0
- data/ext/stormlib/StormLib/src/libtomcrypt/src/pk/rsa/rsa_make_key.c +112 -0
- data/ext/stormlib/StormLib/src/libtomcrypt/src/pk/rsa/rsa_sign_hash.c +134 -0
- data/ext/stormlib/StormLib/src/libtomcrypt/src/pk/rsa/rsa_verify_hash.c +167 -0
- data/ext/stormlib/StormLib/src/libtomcrypt/src/pk/rsa/rsa_verify_simple.c +87 -0
- data/ext/stormlib/StormLib/src/libtommath/bn_fast_mp_invmod.c +148 -0
- data/ext/stormlib/StormLib/src/libtommath/bn_fast_mp_montgomery_reduce.c +172 -0
- data/ext/stormlib/StormLib/src/libtommath/bn_fast_s_mp_mul_digs.c +107 -0
- data/ext/stormlib/StormLib/src/libtommath/bn_fast_s_mp_mul_high_digs.c +98 -0
- data/ext/stormlib/StormLib/src/libtommath/bn_fast_s_mp_sqr.c +114 -0
- data/ext/stormlib/StormLib/src/libtommath/bn_mp_2expt.c +48 -0
- data/ext/stormlib/StormLib/src/libtommath/bn_mp_abs.c +43 -0
- data/ext/stormlib/StormLib/src/libtommath/bn_mp_add.c +53 -0
- data/ext/stormlib/StormLib/src/libtommath/bn_mp_add_d.c +112 -0
- data/ext/stormlib/StormLib/src/libtommath/bn_mp_addmod.c +41 -0
- data/ext/stormlib/StormLib/src/libtommath/bn_mp_and.c +57 -0
- data/ext/stormlib/StormLib/src/libtommath/bn_mp_clamp.c +44 -0
- data/ext/stormlib/StormLib/src/libtommath/bn_mp_clear.c +44 -0
- data/ext/stormlib/StormLib/src/libtommath/bn_mp_clear_multi.c +34 -0
- data/ext/stormlib/StormLib/src/libtommath/bn_mp_cmp.c +43 -0
- data/ext/stormlib/StormLib/src/libtommath/bn_mp_cmp_d.c +44 -0
- data/ext/stormlib/StormLib/src/libtommath/bn_mp_cmp_mag.c +55 -0
- data/ext/stormlib/StormLib/src/libtommath/bn_mp_cnt_lsb.c +53 -0
- data/ext/stormlib/StormLib/src/libtommath/bn_mp_copy.c +68 -0
- data/ext/stormlib/StormLib/src/libtommath/bn_mp_count_bits.c +45 -0
- data/ext/stormlib/StormLib/src/libtommath/bn_mp_div.c +292 -0
- data/ext/stormlib/StormLib/src/libtommath/bn_mp_div_2.c +68 -0
- data/ext/stormlib/StormLib/src/libtommath/bn_mp_div_2d.c +97 -0
- data/ext/stormlib/StormLib/src/libtommath/bn_mp_div_3.c +79 -0
- data/ext/stormlib/StormLib/src/libtommath/bn_mp_div_d.c +115 -0
- data/ext/stormlib/StormLib/src/libtommath/bn_mp_dr_is_modulus.c +43 -0
- data/ext/stormlib/StormLib/src/libtommath/bn_mp_dr_reduce.c +94 -0
- data/ext/stormlib/StormLib/src/libtommath/bn_mp_dr_setup.c +32 -0
- data/ext/stormlib/StormLib/src/libtommath/bn_mp_exch.c +34 -0
- data/ext/stormlib/StormLib/src/libtommath/bn_mp_expt_d.c +57 -0
- data/ext/stormlib/StormLib/src/libtommath/bn_mp_exptmod.c +112 -0
- data/ext/stormlib/StormLib/src/libtommath/bn_mp_exptmod_fast.c +321 -0
- data/ext/stormlib/StormLib/src/libtommath/bn_mp_exteuclid.c +82 -0
- data/ext/stormlib/StormLib/src/libtommath/bn_mp_fread.c +67 -0
- data/ext/stormlib/StormLib/src/libtommath/bn_mp_fwrite.c +52 -0
- data/ext/stormlib/StormLib/src/libtommath/bn_mp_gcd.c +105 -0
- data/ext/stormlib/StormLib/src/libtommath/bn_mp_get_int.c +45 -0
- data/ext/stormlib/StormLib/src/libtommath/bn_mp_grow.c +57 -0
- data/ext/stormlib/StormLib/src/libtommath/bn_mp_init.c +46 -0
- data/ext/stormlib/StormLib/src/libtommath/bn_mp_init_copy.c +32 -0
- data/ext/stormlib/StormLib/src/libtommath/bn_mp_init_multi.c +59 -0
- data/ext/stormlib/StormLib/src/libtommath/bn_mp_init_set.c +32 -0
- data/ext/stormlib/StormLib/src/libtommath/bn_mp_init_set_int.c +31 -0
- data/ext/stormlib/StormLib/src/libtommath/bn_mp_init_size.c +48 -0
- data/ext/stormlib/StormLib/src/libtommath/bn_mp_invmod.c +43 -0
- data/ext/stormlib/StormLib/src/libtommath/bn_mp_invmod_slow.c +175 -0
- data/ext/stormlib/StormLib/src/libtommath/bn_mp_is_square.c +109 -0
- data/ext/stormlib/StormLib/src/libtommath/bn_mp_jacobi.c +105 -0
- data/ext/stormlib/StormLib/src/libtommath/bn_mp_karatsuba_mul.c +167 -0
- data/ext/stormlib/StormLib/src/libtommath/bn_mp_karatsuba_sqr.c +121 -0
- data/ext/stormlib/StormLib/src/libtommath/bn_mp_lcm.c +60 -0
- data/ext/stormlib/StormLib/src/libtommath/bn_mp_lshd.c +67 -0
- data/ext/stormlib/StormLib/src/libtommath/bn_mp_mod.c +48 -0
- data/ext/stormlib/StormLib/src/libtommath/bn_mp_mod_2d.c +55 -0
- data/ext/stormlib/StormLib/src/libtommath/bn_mp_mod_d.c +27 -0
- data/ext/stormlib/StormLib/src/libtommath/bn_mp_montgomery_calc_normalization.c +59 -0
- data/ext/stormlib/StormLib/src/libtommath/bn_mp_montgomery_reduce.c +118 -0
- data/ext/stormlib/StormLib/src/libtommath/bn_mp_montgomery_setup.c +59 -0
- data/ext/stormlib/StormLib/src/libtommath/bn_mp_mul.c +66 -0
- data/ext/stormlib/StormLib/src/libtommath/bn_mp_mul_2.c +82 -0
- data/ext/stormlib/StormLib/src/libtommath/bn_mp_mul_2d.c +85 -0
- data/ext/stormlib/StormLib/src/libtommath/bn_mp_mul_d.c +79 -0
- data/ext/stormlib/StormLib/src/libtommath/bn_mp_mulmod.c +40 -0
- data/ext/stormlib/StormLib/src/libtommath/bn_mp_n_root.c +132 -0
- data/ext/stormlib/StormLib/src/libtommath/bn_mp_neg.c +40 -0
- data/ext/stormlib/StormLib/src/libtommath/bn_mp_or.c +50 -0
- data/ext/stormlib/StormLib/src/libtommath/bn_mp_prime_fermat.c +62 -0
- data/ext/stormlib/StormLib/src/libtommath/bn_mp_prime_is_divisible.c +50 -0
- data/ext/stormlib/StormLib/src/libtommath/bn_mp_prime_is_prime.c +83 -0
- data/ext/stormlib/StormLib/src/libtommath/bn_mp_prime_miller_rabin.c +103 -0
- data/ext/stormlib/StormLib/src/libtommath/bn_mp_prime_next_prime.c +170 -0
- data/ext/stormlib/StormLib/src/libtommath/bn_mp_prime_rabin_miller_trials.c +52 -0
- data/ext/stormlib/StormLib/src/libtommath/bn_mp_prime_random_ex.c +125 -0
- data/ext/stormlib/StormLib/src/libtommath/bn_mp_radix_size.c +78 -0
- data/ext/stormlib/StormLib/src/libtommath/bn_mp_radix_smap.c +24 -0
- data/ext/stormlib/StormLib/src/libtommath/bn_mp_rand.c +55 -0
- data/ext/stormlib/StormLib/src/libtommath/bn_mp_read_radix.c +85 -0
- data/ext/stormlib/StormLib/src/libtommath/bn_mp_read_signed_bin.c +41 -0
- data/ext/stormlib/StormLib/src/libtommath/bn_mp_read_unsigned_bin.c +55 -0
- data/ext/stormlib/StormLib/src/libtommath/bn_mp_reduce.c +100 -0
- data/ext/stormlib/StormLib/src/libtommath/bn_mp_reduce_2k.c +61 -0
- data/ext/stormlib/StormLib/src/libtommath/bn_mp_reduce_2k_l.c +62 -0
- data/ext/stormlib/StormLib/src/libtommath/bn_mp_reduce_2k_setup.c +47 -0
- data/ext/stormlib/StormLib/src/libtommath/bn_mp_reduce_2k_setup_l.c +44 -0
- data/ext/stormlib/StormLib/src/libtommath/bn_mp_reduce_is_2k.c +52 -0
- data/ext/stormlib/StormLib/src/libtommath/bn_mp_reduce_is_2k_l.c +44 -0
- data/ext/stormlib/StormLib/src/libtommath/bn_mp_reduce_setup.c +34 -0
- data/ext/stormlib/StormLib/src/libtommath/bn_mp_rshd.c +72 -0
- data/ext/stormlib/StormLib/src/libtommath/bn_mp_set.c +29 -0
- data/ext/stormlib/StormLib/src/libtommath/bn_mp_set_int.c +48 -0
- data/ext/stormlib/StormLib/src/libtommath/bn_mp_shrink.c +35 -0
- data/ext/stormlib/StormLib/src/libtommath/bn_mp_signed_bin_size.c +27 -0
- data/ext/stormlib/StormLib/src/libtommath/bn_mp_sqr.c +58 -0
- data/ext/stormlib/StormLib/src/libtommath/bn_mp_sqrmod.c +41 -0
- data/ext/stormlib/StormLib/src/libtommath/bn_mp_sqrt.c +81 -0
- data/ext/stormlib/StormLib/src/libtommath/bn_mp_sub.c +59 -0
- data/ext/stormlib/StormLib/src/libtommath/bn_mp_sub_d.c +93 -0
- data/ext/stormlib/StormLib/src/libtommath/bn_mp_submod.c +42 -0
- data/ext/stormlib/StormLib/src/libtommath/bn_mp_to_signed_bin.c +33 -0
- data/ext/stormlib/StormLib/src/libtommath/bn_mp_to_signed_bin_n.c +31 -0
- data/ext/stormlib/StormLib/src/libtommath/bn_mp_to_unsigned_bin.c +48 -0
- data/ext/stormlib/StormLib/src/libtommath/bn_mp_to_unsigned_bin_n.c +31 -0
- data/ext/stormlib/StormLib/src/libtommath/bn_mp_toom_mul.c +284 -0
- data/ext/stormlib/StormLib/src/libtommath/bn_mp_toom_sqr.c +226 -0
- data/ext/stormlib/StormLib/src/libtommath/bn_mp_toradix.c +75 -0
- data/ext/stormlib/StormLib/src/libtommath/bn_mp_toradix_n.c +88 -0
- data/ext/stormlib/StormLib/src/libtommath/bn_mp_unsigned_bin_size.c +28 -0
- data/ext/stormlib/StormLib/src/libtommath/bn_mp_xor.c +51 -0
- data/ext/stormlib/StormLib/src/libtommath/bn_mp_zero.c +36 -0
- data/ext/stormlib/StormLib/src/libtommath/bn_prime_tab.c +61 -0
- data/ext/stormlib/StormLib/src/libtommath/bn_reverse.c +39 -0
- data/ext/stormlib/StormLib/src/libtommath/bn_s_mp_add.c +109 -0
- data/ext/stormlib/StormLib/src/libtommath/bn_s_mp_exptmod.c +252 -0
- data/ext/stormlib/StormLib/src/libtommath/bn_s_mp_mul_digs.c +90 -0
- data/ext/stormlib/StormLib/src/libtommath/bn_s_mp_mul_high_digs.c +81 -0
- data/ext/stormlib/StormLib/src/libtommath/bn_s_mp_sqr.c +84 -0
- data/ext/stormlib/StormLib/src/libtommath/bn_s_mp_sub.c +89 -0
- data/ext/stormlib/StormLib/src/libtommath/bncore.c +36 -0
- data/ext/stormlib/StormLib/src/libtommath/tommath.h +584 -0
- data/ext/stormlib/StormLib/src/libtommath/tommath_class.h +999 -0
- data/ext/stormlib/StormLib/src/libtommath/tommath_superclass.h +76 -0
- data/ext/stormlib/StormLib/src/lzma/C/LzFind.c +761 -0
- data/ext/stormlib/StormLib/src/lzma/C/LzFind.h +115 -0
- data/ext/stormlib/StormLib/src/lzma/C/LzFindMt.c +793 -0
- data/ext/stormlib/StormLib/src/lzma/C/LzFindMt.h +105 -0
- data/ext/stormlib/StormLib/src/lzma/C/LzHash.h +54 -0
- data/ext/stormlib/StormLib/src/lzma/C/LzmaDec.c +999 -0
- data/ext/stormlib/StormLib/src/lzma/C/LzmaDec.h +231 -0
- data/ext/stormlib/StormLib/src/lzma/C/LzmaEnc.c +2268 -0
- data/ext/stormlib/StormLib/src/lzma/C/LzmaEnc.h +80 -0
- data/ext/stormlib/StormLib/src/lzma/C/Threads.c +84 -0
- data/ext/stormlib/StormLib/src/lzma/C/Threads.h +59 -0
- data/ext/stormlib/StormLib/src/lzma/C/Types.h +236 -0
- data/ext/stormlib/StormLib/src/lzma/info.txt +1 -0
- data/ext/stormlib/StormLib/src/pklib/crc32.c +66 -0
- data/ext/stormlib/StormLib/src/pklib/explode.c +521 -0
- data/ext/stormlib/StormLib/src/pklib/implode.c +674 -0
- data/ext/stormlib/StormLib/src/pklib/pklib.h +160 -0
- data/ext/stormlib/StormLib/src/resource.h +15 -0
- data/ext/stormlib/StormLib/src/sparse/sparse.cpp +287 -0
- data/ext/stormlib/StormLib/src/sparse/sparse.h +17 -0
- data/ext/stormlib/StormLib/src/wdk/sources-cpp.cpp +26 -0
- data/ext/stormlib/StormLib/src/wdk/sources-wdk-bzip2.c +13 -0
- data/ext/stormlib/StormLib/src/wdk/sources-wdk-ltc.c +4 -0
- data/ext/stormlib/StormLib/src/wdk/sources-wdk-lzma.c +8 -0
- data/ext/stormlib/StormLib/src/wdk/sources-wdk-misc.c +6 -0
- data/ext/stormlib/StormLib/src/wdk/sources-wdk-tomcrypt.c +82 -0
- data/ext/stormlib/StormLib/src/wdk/sources-wdk-tommath.c +123 -0
- data/ext/stormlib/StormLib/src/wdk/sources-wdk-zlib.c +21 -0
- data/ext/stormlib/StormLib/src/zlib/adler32.c +169 -0
- data/ext/stormlib/StormLib/src/zlib/compress.c +80 -0
- data/ext/stormlib/StormLib/src/zlib/compress_zlib.c +5 -0
- data/ext/stormlib/StormLib/src/zlib/crc32.c +442 -0
- data/ext/stormlib/StormLib/src/zlib/crc32.h +441 -0
- data/ext/stormlib/StormLib/src/zlib/deflate.c +1834 -0
- data/ext/stormlib/StormLib/src/zlib/deflate.h +342 -0
- data/ext/stormlib/StormLib/src/zlib/gzguts.h +218 -0
- data/ext/stormlib/StormLib/src/zlib/inffast.c +340 -0
- data/ext/stormlib/StormLib/src/zlib/inffast.h +11 -0
- data/ext/stormlib/StormLib/src/zlib/inffixed.h +94 -0
- data/ext/stormlib/StormLib/src/zlib/inflate.c +1480 -0
- data/ext/stormlib/StormLib/src/zlib/inflate.h +130 -0
- data/ext/stormlib/StormLib/src/zlib/inftrees.c +330 -0
- data/ext/stormlib/StormLib/src/zlib/inftrees.h +67 -0
- data/ext/stormlib/StormLib/src/zlib/trees.c +1244 -0
- data/ext/stormlib/StormLib/src/zlib/trees.h +128 -0
- data/ext/stormlib/StormLib/src/zlib/zconf.h +428 -0
- data/ext/stormlib/StormLib/src/zlib/zlib.h +1613 -0
- data/ext/stormlib/StormLib/src/zlib/zutil.c +318 -0
- data/ext/stormlib/StormLib/src/zlib/zutil.h +274 -0
- data/ext/stormlib/StormLib/storm_dll/storm.cpp +117 -0
- data/ext/stormlib/StormLib/storm_dll/storm.def +25 -0
- data/ext/stormlib/StormLib/storm_dll/storm.h +65 -0
- data/ext/stormlib/StormLib/storm_dll/storm.vcxproj +209 -0
- data/ext/stormlib/StormLib/storm_dll/storm.vcxproj.filters +28 -0
- data/ext/stormlib/StormLib/storm_dll/storm_test.cpp +182 -0
- data/ext/stormlib/StormLib/storm_dll/storm_test.vcxproj +202 -0
- data/ext/stormlib/StormLib/storm_dll/storm_test.vcxproj.filters +22 -0
- data/ext/stormlib/StormLib/test/StormTest.cpp +4393 -0
- data/ext/stormlib/StormLib/test/TLogHelper.cpp +567 -0
- data/ext/stormlib/StormLib/test/stormlib-test-001.txt +164 -0
- data/ext/stormlib/extconf.rb +0 -2
- data/lib/stormlib/version.rb +1 -1
- data/stormlib.gemspec +1 -1
- metadata +621 -2
|
@@ -0,0 +1,1183 @@
|
|
|
1
|
+
/*****************************************************************************/
|
|
2
|
+
/* SCompression.cpp Copyright (c) Ladislav Zezula 2003 */
|
|
3
|
+
/*---------------------------------------------------------------------------*/
|
|
4
|
+
/* This module serves as a bridge between StormLib code and (de)compression */
|
|
5
|
+
/* functions. All (de)compression calls go (and should only go) through this */
|
|
6
|
+
/* module. No system headers should be included in this module to prevent */
|
|
7
|
+
/* compile-time problems. */
|
|
8
|
+
/*---------------------------------------------------------------------------*/
|
|
9
|
+
/* Date Ver Who Comment */
|
|
10
|
+
/* -------- ---- --- ------- */
|
|
11
|
+
/* 01.04.03 1.00 Lad The first version of SCompression.cpp */
|
|
12
|
+
/* 19.11.03 1.01 Dan Big endian handling */
|
|
13
|
+
/*****************************************************************************/
|
|
14
|
+
|
|
15
|
+
#define __STORMLIB_SELF__
|
|
16
|
+
#include "StormLib.h"
|
|
17
|
+
#include "StormCommon.h"
|
|
18
|
+
|
|
19
|
+
//-----------------------------------------------------------------------------
|
|
20
|
+
// Local structures
|
|
21
|
+
|
|
22
|
+
// Information about the input and output buffers for pklib
|
|
23
|
+
typedef struct
|
|
24
|
+
{
|
|
25
|
+
unsigned char * pbInBuff; // Pointer to input data buffer
|
|
26
|
+
unsigned char * pbInBuffEnd; // End of the input buffer
|
|
27
|
+
unsigned char * pbOutBuff; // Pointer to output data buffer
|
|
28
|
+
unsigned char * pbOutBuffEnd; // Pointer to output data buffer
|
|
29
|
+
} TDataInfo;
|
|
30
|
+
|
|
31
|
+
// Prototype of the compression function
|
|
32
|
+
// Function doesn't return an error. A success means that the size of compressed buffer
|
|
33
|
+
// is lower than size of uncompressed buffer.
|
|
34
|
+
typedef void (*COMPRESS)(
|
|
35
|
+
void * pvOutBuffer, // [out] Pointer to the buffer where the compressed data will be stored
|
|
36
|
+
int * pcbOutBuffer, // [in] Pointer to length of the buffer pointed by pvOutBuffer
|
|
37
|
+
void * pvInBuffer, // [in] Pointer to the buffer with data to compress
|
|
38
|
+
int cbInBuffer, // [in] Length of the buffer pointer by pvInBuffer
|
|
39
|
+
int * pCmpType, // [in] Compression-method specific value. ADPCM Setups this for the following Huffman compression
|
|
40
|
+
int nCmpLevel); // [in] Compression specific value. ADPCM uses this. Should be set to zero.
|
|
41
|
+
|
|
42
|
+
// Prototype of the decompression function
|
|
43
|
+
// Returns 1 if success, 0 if failure
|
|
44
|
+
typedef int (*DECOMPRESS)(
|
|
45
|
+
void * pvOutBuffer, // [out] Pointer to the buffer where to store decompressed data
|
|
46
|
+
int * pcbOutBuffer, // [in] Pointer to total size of the buffer pointed by pvOutBuffer
|
|
47
|
+
// [out] Contains length of the decompressed data
|
|
48
|
+
void * pvInBuffer, // [in] Pointer to data to be decompressed
|
|
49
|
+
int cbInBuffer); // [in] Length of the data to be decompressed
|
|
50
|
+
|
|
51
|
+
// Table of compression functions
|
|
52
|
+
typedef struct
|
|
53
|
+
{
|
|
54
|
+
unsigned long uMask; // Compression mask
|
|
55
|
+
COMPRESS Compress; // Compression function
|
|
56
|
+
} TCompressTable;
|
|
57
|
+
|
|
58
|
+
// Table of decompression functions
|
|
59
|
+
typedef struct
|
|
60
|
+
{
|
|
61
|
+
unsigned long uMask; // Decompression bit
|
|
62
|
+
DECOMPRESS Decompress; // Decompression function
|
|
63
|
+
} TDecompressTable;
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
/*****************************************************************************/
|
|
67
|
+
/* */
|
|
68
|
+
/* Support for Huffman compression (0x01) */
|
|
69
|
+
/* */
|
|
70
|
+
/*****************************************************************************/
|
|
71
|
+
|
|
72
|
+
void Compress_huff(void * pvOutBuffer, int * pcbOutBuffer, void * pvInBuffer, int cbInBuffer, int * pCmpType, int nCmpLevel)
|
|
73
|
+
{
|
|
74
|
+
THuffmannTree ht(true);
|
|
75
|
+
TOutputStream os(pvOutBuffer, *pcbOutBuffer);
|
|
76
|
+
|
|
77
|
+
STORMLIB_UNUSED(nCmpLevel);
|
|
78
|
+
*pcbOutBuffer = ht.Compress(&os, pvInBuffer, cbInBuffer, *pCmpType);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
int Decompress_huff(void * pvOutBuffer, int * pcbOutBuffer, void * pvInBuffer, int cbInBuffer)
|
|
82
|
+
{
|
|
83
|
+
THuffmannTree ht(false);
|
|
84
|
+
TInputStream is(pvInBuffer, cbInBuffer);
|
|
85
|
+
|
|
86
|
+
*pcbOutBuffer = ht.Decompress(pvOutBuffer, *pcbOutBuffer, &is);
|
|
87
|
+
return (*pcbOutBuffer == 0) ? 0 : 1;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/******************************************************************************/
|
|
91
|
+
/* */
|
|
92
|
+
/* Support for ZLIB compression (0x02) */
|
|
93
|
+
/* */
|
|
94
|
+
/******************************************************************************/
|
|
95
|
+
|
|
96
|
+
void Compress_ZLIB(void * pvOutBuffer, int * pcbOutBuffer, void * pvInBuffer, int cbInBuffer, int * pCmpType, int nCmpLevel)
|
|
97
|
+
{
|
|
98
|
+
z_stream z; // Stream information for zlib
|
|
99
|
+
int windowBits;
|
|
100
|
+
int nResult;
|
|
101
|
+
|
|
102
|
+
// Keep compilers happy
|
|
103
|
+
STORMLIB_UNUSED(pCmpType);
|
|
104
|
+
STORMLIB_UNUSED(nCmpLevel);
|
|
105
|
+
|
|
106
|
+
// Fill the stream structure for zlib
|
|
107
|
+
z.next_in = (Bytef *)pvInBuffer;
|
|
108
|
+
z.avail_in = (uInt)cbInBuffer;
|
|
109
|
+
z.total_in = cbInBuffer;
|
|
110
|
+
z.next_out = (Bytef *)pvOutBuffer;
|
|
111
|
+
z.avail_out = *pcbOutBuffer;
|
|
112
|
+
z.total_out = 0;
|
|
113
|
+
z.zalloc = NULL;
|
|
114
|
+
z.zfree = NULL;
|
|
115
|
+
|
|
116
|
+
// Determine the proper window bits (WoW.exe build 12694)
|
|
117
|
+
if(cbInBuffer <= 0x100)
|
|
118
|
+
windowBits = 8;
|
|
119
|
+
else if(cbInBuffer <= 0x200)
|
|
120
|
+
windowBits = 9;
|
|
121
|
+
else if(cbInBuffer <= 0x400)
|
|
122
|
+
windowBits = 10;
|
|
123
|
+
else if(cbInBuffer <= 0x800)
|
|
124
|
+
windowBits = 11;
|
|
125
|
+
else if(cbInBuffer <= 0x1000)
|
|
126
|
+
windowBits = 12;
|
|
127
|
+
else if(cbInBuffer <= 0x2000)
|
|
128
|
+
windowBits = 13;
|
|
129
|
+
else if(cbInBuffer <= 0x4000)
|
|
130
|
+
windowBits = 14;
|
|
131
|
+
else
|
|
132
|
+
windowBits = 15;
|
|
133
|
+
|
|
134
|
+
// Initialize the compression.
|
|
135
|
+
// Storm.dll uses zlib version 1.1.3
|
|
136
|
+
// Wow.exe uses zlib version 1.2.3
|
|
137
|
+
nResult = deflateInit2(&z,
|
|
138
|
+
6, // Compression level used by WoW MPQs
|
|
139
|
+
Z_DEFLATED,
|
|
140
|
+
windowBits,
|
|
141
|
+
8,
|
|
142
|
+
Z_DEFAULT_STRATEGY);
|
|
143
|
+
if(nResult == Z_OK)
|
|
144
|
+
{
|
|
145
|
+
// Call zlib to compress the data
|
|
146
|
+
nResult = deflate(&z, Z_FINISH);
|
|
147
|
+
|
|
148
|
+
if(nResult == Z_OK || nResult == Z_STREAM_END)
|
|
149
|
+
*pcbOutBuffer = z.total_out;
|
|
150
|
+
|
|
151
|
+
deflateEnd(&z);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
int Decompress_ZLIB(void * pvOutBuffer, int * pcbOutBuffer, void * pvInBuffer, int cbInBuffer)
|
|
156
|
+
{
|
|
157
|
+
z_stream z; // Stream information for zlib
|
|
158
|
+
int nResult;
|
|
159
|
+
|
|
160
|
+
// Fill the stream structure for zlib
|
|
161
|
+
z.next_in = (Bytef *)pvInBuffer;
|
|
162
|
+
z.avail_in = (uInt)cbInBuffer;
|
|
163
|
+
z.total_in = cbInBuffer;
|
|
164
|
+
z.next_out = (Bytef *)pvOutBuffer;
|
|
165
|
+
z.avail_out = *pcbOutBuffer;
|
|
166
|
+
z.total_out = 0;
|
|
167
|
+
z.zalloc = NULL;
|
|
168
|
+
z.zfree = NULL;
|
|
169
|
+
|
|
170
|
+
// Initialize the decompression structure. Storm.dll uses zlib version 1.1.3
|
|
171
|
+
if((nResult = inflateInit(&z)) == Z_OK)
|
|
172
|
+
{
|
|
173
|
+
// Call zlib to decompress the data
|
|
174
|
+
nResult = inflate(&z, Z_FINISH);
|
|
175
|
+
*pcbOutBuffer = z.total_out;
|
|
176
|
+
inflateEnd(&z);
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
return (nResult >= Z_OK);
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
/******************************************************************************/
|
|
183
|
+
/* */
|
|
184
|
+
/* Support functions for PKWARE Data Compression Library compression (0x08) */
|
|
185
|
+
/* */
|
|
186
|
+
/******************************************************************************/
|
|
187
|
+
|
|
188
|
+
// Function loads data from the input buffer. Used by Pklib's "implode"
|
|
189
|
+
// and "explode" function as user-defined callback
|
|
190
|
+
// Returns number of bytes loaded
|
|
191
|
+
//
|
|
192
|
+
// char * buf - Pointer to a buffer where to store loaded data
|
|
193
|
+
// unsigned int * size - Max. number of bytes to read
|
|
194
|
+
// void * param - Custom pointer, parameter of implode/explode
|
|
195
|
+
|
|
196
|
+
static unsigned int ReadInputData(char * buf, unsigned int * size, void * param)
|
|
197
|
+
{
|
|
198
|
+
TDataInfo * pInfo = (TDataInfo *)param;
|
|
199
|
+
unsigned int nMaxAvail = (unsigned int)(pInfo->pbInBuffEnd - pInfo->pbInBuff);
|
|
200
|
+
unsigned int nToRead = *size;
|
|
201
|
+
|
|
202
|
+
// Check the case when not enough data available
|
|
203
|
+
if(nToRead > nMaxAvail)
|
|
204
|
+
nToRead = nMaxAvail;
|
|
205
|
+
|
|
206
|
+
// Load data and increment offsets
|
|
207
|
+
memcpy(buf, pInfo->pbInBuff, nToRead);
|
|
208
|
+
pInfo->pbInBuff += nToRead;
|
|
209
|
+
assert(pInfo->pbInBuff <= pInfo->pbInBuffEnd);
|
|
210
|
+
return nToRead;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
// Function for store output data. Used by Pklib's "implode" and "explode"
|
|
214
|
+
// as user-defined callback
|
|
215
|
+
//
|
|
216
|
+
// char * buf - Pointer to data to be written
|
|
217
|
+
// unsigned int * size - Number of bytes to write
|
|
218
|
+
// void * param - Custom pointer, parameter of implode/explode
|
|
219
|
+
|
|
220
|
+
static void WriteOutputData(char * buf, unsigned int * size, void * param)
|
|
221
|
+
{
|
|
222
|
+
TDataInfo * pInfo = (TDataInfo *)param;
|
|
223
|
+
unsigned int nMaxWrite = (unsigned int)(pInfo->pbOutBuffEnd - pInfo->pbOutBuff);
|
|
224
|
+
unsigned int nToWrite = *size;
|
|
225
|
+
|
|
226
|
+
// Check the case when not enough space in the output buffer
|
|
227
|
+
if(nToWrite > nMaxWrite)
|
|
228
|
+
nToWrite = nMaxWrite;
|
|
229
|
+
|
|
230
|
+
// Write output data and increments offsets
|
|
231
|
+
memcpy(pInfo->pbOutBuff, buf, nToWrite);
|
|
232
|
+
pInfo->pbOutBuff += nToWrite;
|
|
233
|
+
assert(pInfo->pbOutBuff <= pInfo->pbOutBuffEnd);
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
static void Compress_PKLIB(void * pvOutBuffer, int * pcbOutBuffer, void * pvInBuffer, int cbInBuffer, int * pCmpType, int nCmpLevel)
|
|
237
|
+
{
|
|
238
|
+
TDataInfo Info; // Data information
|
|
239
|
+
char * work_buf = STORM_ALLOC(char, CMP_BUFFER_SIZE);// Pklib's work buffer
|
|
240
|
+
unsigned int dict_size; // Dictionary size
|
|
241
|
+
unsigned int ctype = CMP_BINARY; // Compression type
|
|
242
|
+
|
|
243
|
+
// Keep compilers happy
|
|
244
|
+
STORMLIB_UNUSED(pCmpType);
|
|
245
|
+
STORMLIB_UNUSED(nCmpLevel);
|
|
246
|
+
|
|
247
|
+
// Handle no-memory condition
|
|
248
|
+
if(work_buf != NULL)
|
|
249
|
+
{
|
|
250
|
+
// Fill data information structure
|
|
251
|
+
memset(work_buf, 0, CMP_BUFFER_SIZE);
|
|
252
|
+
Info.pbInBuff = (unsigned char *)pvInBuffer;
|
|
253
|
+
Info.pbInBuffEnd = (unsigned char *)pvInBuffer + cbInBuffer;
|
|
254
|
+
Info.pbOutBuff = (unsigned char *)pvOutBuffer;
|
|
255
|
+
Info.pbOutBuffEnd = (unsigned char *)pvOutBuffer + *pcbOutBuffer;
|
|
256
|
+
|
|
257
|
+
//
|
|
258
|
+
// Set the dictionary size
|
|
259
|
+
//
|
|
260
|
+
// Diablo I uses fixed dictionary size of CMP_IMPLODE_DICT_SIZE3
|
|
261
|
+
// Starcraft I uses the variable dictionary size based on algorithm below
|
|
262
|
+
//
|
|
263
|
+
|
|
264
|
+
if (cbInBuffer < 0x600)
|
|
265
|
+
dict_size = CMP_IMPLODE_DICT_SIZE1;
|
|
266
|
+
else if(0x600 <= cbInBuffer && cbInBuffer < 0xC00)
|
|
267
|
+
dict_size = CMP_IMPLODE_DICT_SIZE2;
|
|
268
|
+
else
|
|
269
|
+
dict_size = CMP_IMPLODE_DICT_SIZE3;
|
|
270
|
+
|
|
271
|
+
// Do the compression
|
|
272
|
+
if(implode(ReadInputData, WriteOutputData, work_buf, &Info, &ctype, &dict_size) == CMP_NO_ERROR)
|
|
273
|
+
*pcbOutBuffer = (int)(Info.pbOutBuff - (unsigned char *)pvOutBuffer);
|
|
274
|
+
|
|
275
|
+
STORM_FREE(work_buf);
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
static int Decompress_PKLIB(void * pvOutBuffer, int * pcbOutBuffer, void * pvInBuffer, int cbInBuffer)
|
|
280
|
+
{
|
|
281
|
+
TDataInfo Info; // Data information
|
|
282
|
+
char * work_buf;
|
|
283
|
+
int nResult = 0;
|
|
284
|
+
|
|
285
|
+
// Allocate Pklib's work buffer
|
|
286
|
+
if((work_buf = STORM_ALLOC(char, EXP_BUFFER_SIZE)) != NULL)
|
|
287
|
+
{
|
|
288
|
+
// Fill data information structure
|
|
289
|
+
memset(work_buf, 0, EXP_BUFFER_SIZE);
|
|
290
|
+
Info.pbInBuff = (unsigned char *)pvInBuffer;
|
|
291
|
+
Info.pbInBuffEnd = (unsigned char *)pvInBuffer + cbInBuffer;
|
|
292
|
+
Info.pbOutBuff = (unsigned char *)pvOutBuffer;
|
|
293
|
+
Info.pbOutBuffEnd = (unsigned char *)pvOutBuffer + *pcbOutBuffer;
|
|
294
|
+
|
|
295
|
+
// Do the decompression
|
|
296
|
+
if(explode(ReadInputData, WriteOutputData, work_buf, &Info) == CMP_NO_ERROR)
|
|
297
|
+
nResult = 1;
|
|
298
|
+
|
|
299
|
+
// Give away the number of decompressed bytes
|
|
300
|
+
*pcbOutBuffer = (int)(Info.pbOutBuff - (unsigned char *)pvOutBuffer);
|
|
301
|
+
STORM_FREE(work_buf);
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
return nResult;
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
/******************************************************************************/
|
|
308
|
+
/* */
|
|
309
|
+
/* Support for Bzip2 compression (0x10) */
|
|
310
|
+
/* */
|
|
311
|
+
/******************************************************************************/
|
|
312
|
+
|
|
313
|
+
static void Compress_BZIP2(void * pvOutBuffer, int * pcbOutBuffer, void * pvInBuffer, int cbInBuffer, int * pCmpType, int nCmpLevel)
|
|
314
|
+
{
|
|
315
|
+
bz_stream strm;
|
|
316
|
+
int blockSize100k = 9;
|
|
317
|
+
int workFactor = 30;
|
|
318
|
+
int bzError;
|
|
319
|
+
|
|
320
|
+
// Keep compilers happy
|
|
321
|
+
STORMLIB_UNUSED(pCmpType);
|
|
322
|
+
STORMLIB_UNUSED(nCmpLevel);
|
|
323
|
+
|
|
324
|
+
// Initialize the BZIP2 compression
|
|
325
|
+
strm.bzalloc = NULL;
|
|
326
|
+
strm.bzfree = NULL;
|
|
327
|
+
strm.opaque = NULL;
|
|
328
|
+
|
|
329
|
+
// Blizzard uses 9 as blockSize100k, (0x30 as workFactor)
|
|
330
|
+
// Last checked on Starcraft II
|
|
331
|
+
if(BZ2_bzCompressInit(&strm, blockSize100k, 0, workFactor) == BZ_OK)
|
|
332
|
+
{
|
|
333
|
+
strm.next_in = (char *)pvInBuffer;
|
|
334
|
+
strm.avail_in = cbInBuffer;
|
|
335
|
+
strm.next_out = (char *)pvOutBuffer;
|
|
336
|
+
strm.avail_out = *pcbOutBuffer;
|
|
337
|
+
|
|
338
|
+
// Perform the compression
|
|
339
|
+
for(;;)
|
|
340
|
+
{
|
|
341
|
+
bzError = BZ2_bzCompress(&strm, (strm.avail_in != 0) ? BZ_RUN : BZ_FINISH);
|
|
342
|
+
if(bzError == BZ_STREAM_END || bzError < 0)
|
|
343
|
+
break;
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
// Put the stream into idle state
|
|
347
|
+
BZ2_bzCompressEnd(&strm);
|
|
348
|
+
|
|
349
|
+
if(bzError > 0)
|
|
350
|
+
*pcbOutBuffer = strm.total_out_lo32;
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
static int Decompress_BZIP2(void * pvOutBuffer, int * pcbOutBuffer, void * pvInBuffer, int cbInBuffer)
|
|
355
|
+
{
|
|
356
|
+
bz_stream strm;
|
|
357
|
+
int nResult;
|
|
358
|
+
|
|
359
|
+
// Initialize the BZIP2 decompression
|
|
360
|
+
strm.next_in = (char *)pvInBuffer;
|
|
361
|
+
strm.avail_in = cbInBuffer;
|
|
362
|
+
strm.next_out = (char *)pvOutBuffer;
|
|
363
|
+
strm.avail_out = *pcbOutBuffer;
|
|
364
|
+
strm.bzalloc = NULL;
|
|
365
|
+
strm.bzfree = NULL;
|
|
366
|
+
strm.opaque = NULL;
|
|
367
|
+
|
|
368
|
+
// Initialize decompression
|
|
369
|
+
if((nResult = BZ2_bzDecompressInit(&strm, 0, 0)) == BZ_OK)
|
|
370
|
+
{
|
|
371
|
+
// Perform the decompression
|
|
372
|
+
nResult = BZ2_bzDecompress(&strm);
|
|
373
|
+
*pcbOutBuffer = strm.total_out_lo32;
|
|
374
|
+
BZ2_bzDecompressEnd(&strm);
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
return (nResult >= BZ_OK);
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
/******************************************************************************/
|
|
381
|
+
/* */
|
|
382
|
+
/* Support functions for LZMA compression (0x12) */
|
|
383
|
+
/* */
|
|
384
|
+
/******************************************************************************/
|
|
385
|
+
|
|
386
|
+
#define LZMA_HEADER_SIZE (1 + LZMA_PROPS_SIZE + 8)
|
|
387
|
+
|
|
388
|
+
static SRes LZMA_Callback_Progress(void * /* p */, UInt64 /* inSize */, UInt64 /* outSize */)
|
|
389
|
+
{
|
|
390
|
+
return SZ_OK;
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
static void * LZMA_Callback_Alloc(void *p, size_t size)
|
|
394
|
+
{
|
|
395
|
+
p = p;
|
|
396
|
+
return STORM_ALLOC(BYTE, size);
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
/* address can be 0 */
|
|
400
|
+
static void LZMA_Callback_Free(void *p, void *address)
|
|
401
|
+
{
|
|
402
|
+
p = p;
|
|
403
|
+
if(address != NULL)
|
|
404
|
+
STORM_FREE(address);
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
//
|
|
408
|
+
// Note: So far, I haven't seen any files compressed by LZMA.
|
|
409
|
+
// This code haven't been verified against code ripped from Starcraft II Beta,
|
|
410
|
+
// but we know that Starcraft LZMA decompression code is able to decompress
|
|
411
|
+
// the data compressed by StormLib.
|
|
412
|
+
//
|
|
413
|
+
|
|
414
|
+
static void Compress_LZMA(void * pvOutBuffer, int * pcbOutBuffer, void * pvInBuffer, int cbInBuffer, int * pCmpType, int nCmpLevel)
|
|
415
|
+
{
|
|
416
|
+
ICompressProgress Progress;
|
|
417
|
+
CLzmaEncProps props;
|
|
418
|
+
ISzAlloc SzAlloc;
|
|
419
|
+
Byte * pbOutBuffer = (Byte *)pvOutBuffer;
|
|
420
|
+
Byte * destBuffer;
|
|
421
|
+
SizeT destLen = *pcbOutBuffer;
|
|
422
|
+
SizeT srcLen = cbInBuffer;
|
|
423
|
+
Byte encodedProps[LZMA_PROPS_SIZE];
|
|
424
|
+
size_t encodedPropsSize = LZMA_PROPS_SIZE;
|
|
425
|
+
SRes nResult;
|
|
426
|
+
|
|
427
|
+
// Keep compilers happy
|
|
428
|
+
STORMLIB_UNUSED(pCmpType);
|
|
429
|
+
STORMLIB_UNUSED(nCmpLevel);
|
|
430
|
+
|
|
431
|
+
// Fill the callbacks in structures
|
|
432
|
+
Progress.Progress = LZMA_Callback_Progress;
|
|
433
|
+
SzAlloc.Alloc = LZMA_Callback_Alloc;
|
|
434
|
+
SzAlloc.Free = LZMA_Callback_Free;
|
|
435
|
+
|
|
436
|
+
// Initialize properties
|
|
437
|
+
LzmaEncProps_Init(&props);
|
|
438
|
+
|
|
439
|
+
// Perform compression
|
|
440
|
+
destBuffer = (Byte *)pvOutBuffer + LZMA_HEADER_SIZE;
|
|
441
|
+
destLen = *pcbOutBuffer - LZMA_HEADER_SIZE;
|
|
442
|
+
nResult = LzmaEncode(destBuffer,
|
|
443
|
+
&destLen,
|
|
444
|
+
(Byte *)pvInBuffer,
|
|
445
|
+
srcLen,
|
|
446
|
+
&props,
|
|
447
|
+
encodedProps,
|
|
448
|
+
&encodedPropsSize,
|
|
449
|
+
0,
|
|
450
|
+
&Progress,
|
|
451
|
+
&SzAlloc,
|
|
452
|
+
&SzAlloc);
|
|
453
|
+
if(nResult != SZ_OK)
|
|
454
|
+
return;
|
|
455
|
+
|
|
456
|
+
// If we failed to compress the data
|
|
457
|
+
if(destLen >= (SizeT)(*pcbOutBuffer - LZMA_HEADER_SIZE))
|
|
458
|
+
return;
|
|
459
|
+
|
|
460
|
+
// Write "useFilter" variable. Blizzard MPQ must not use filter.
|
|
461
|
+
*pbOutBuffer++ = 0;
|
|
462
|
+
|
|
463
|
+
// Copy the encoded properties to the output buffer
|
|
464
|
+
memcpy(pbOutBuffer, encodedProps, encodedPropsSize);
|
|
465
|
+
pbOutBuffer += encodedPropsSize;
|
|
466
|
+
|
|
467
|
+
// Copy the size of the data
|
|
468
|
+
*pbOutBuffer++ = (unsigned char)(srcLen >> 0x00);
|
|
469
|
+
*pbOutBuffer++ = (unsigned char)(srcLen >> 0x08);
|
|
470
|
+
*pbOutBuffer++ = (unsigned char)(srcLen >> 0x10);
|
|
471
|
+
*pbOutBuffer++ = (unsigned char)(srcLen >> 0x18);
|
|
472
|
+
*pbOutBuffer++ = 0;
|
|
473
|
+
*pbOutBuffer++ = 0;
|
|
474
|
+
*pbOutBuffer++ = 0;
|
|
475
|
+
*pbOutBuffer++ = 0;
|
|
476
|
+
|
|
477
|
+
// Give the size of the data to the caller
|
|
478
|
+
*pcbOutBuffer = (unsigned int)(destLen + LZMA_HEADER_SIZE);
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
static int Decompress_LZMA(void * pvOutBuffer, int * pcbOutBuffer, void * pvInBuffer, int cbInBuffer)
|
|
482
|
+
{
|
|
483
|
+
ELzmaStatus LzmaStatus;
|
|
484
|
+
ISzAlloc SzAlloc;
|
|
485
|
+
Byte * destBuffer = (Byte *)pvOutBuffer;
|
|
486
|
+
Byte * srcBuffer = (Byte *)pvInBuffer;
|
|
487
|
+
SizeT destLen = *pcbOutBuffer;
|
|
488
|
+
SizeT srcLen = cbInBuffer;
|
|
489
|
+
SRes nResult;
|
|
490
|
+
|
|
491
|
+
// There must be at least 0x0E bytes in the buffer
|
|
492
|
+
if(srcLen <= LZMA_HEADER_SIZE)
|
|
493
|
+
return 0;
|
|
494
|
+
|
|
495
|
+
// We only accept blocks that have no filter used
|
|
496
|
+
if(*srcBuffer != 0)
|
|
497
|
+
return 0;
|
|
498
|
+
|
|
499
|
+
// Fill the callbacks in structures
|
|
500
|
+
SzAlloc.Alloc = LZMA_Callback_Alloc;
|
|
501
|
+
SzAlloc.Free = LZMA_Callback_Free;
|
|
502
|
+
|
|
503
|
+
// Perform compression
|
|
504
|
+
srcLen = cbInBuffer - LZMA_HEADER_SIZE;
|
|
505
|
+
nResult = LzmaDecode(destBuffer,
|
|
506
|
+
&destLen,
|
|
507
|
+
srcBuffer + LZMA_HEADER_SIZE,
|
|
508
|
+
&srcLen,
|
|
509
|
+
srcBuffer + 1,
|
|
510
|
+
LZMA_PROPS_SIZE,
|
|
511
|
+
LZMA_FINISH_END,
|
|
512
|
+
&LzmaStatus,
|
|
513
|
+
&SzAlloc);
|
|
514
|
+
if(nResult != SZ_OK)
|
|
515
|
+
return 0;
|
|
516
|
+
|
|
517
|
+
*pcbOutBuffer = (unsigned int)destLen;
|
|
518
|
+
return 1;
|
|
519
|
+
}
|
|
520
|
+
|
|
521
|
+
static int Decompress_LZMA_MPK(void * pvOutBuffer, int * pcbOutBuffer, void * pvInBuffer, int cbInBuffer)
|
|
522
|
+
{
|
|
523
|
+
ELzmaStatus LzmaStatus;
|
|
524
|
+
ISzAlloc SzAlloc;
|
|
525
|
+
Byte * destBuffer = (Byte *)pvOutBuffer;
|
|
526
|
+
Byte * srcBuffer = (Byte *)pvInBuffer;
|
|
527
|
+
SizeT destLen = *pcbOutBuffer;
|
|
528
|
+
SizeT srcLen = cbInBuffer;
|
|
529
|
+
SRes nResult;
|
|
530
|
+
BYTE LZMA_Props[] = {0x5D, 0x00, 0x00, 0x00, 0x01};
|
|
531
|
+
|
|
532
|
+
// There must be at least 0x0E bytes in the buffer
|
|
533
|
+
if(srcLen <= sizeof(LZMA_Props))
|
|
534
|
+
return 0;
|
|
535
|
+
|
|
536
|
+
// Verify the props header
|
|
537
|
+
if(memcmp(pvInBuffer, LZMA_Props, sizeof(LZMA_Props)))
|
|
538
|
+
return 0;
|
|
539
|
+
|
|
540
|
+
// Fill the callbacks in structures
|
|
541
|
+
SzAlloc.Alloc = LZMA_Callback_Alloc;
|
|
542
|
+
SzAlloc.Free = LZMA_Callback_Free;
|
|
543
|
+
|
|
544
|
+
// Perform compression
|
|
545
|
+
srcLen = cbInBuffer - sizeof(LZMA_Props);
|
|
546
|
+
nResult = LzmaDecode(destBuffer,
|
|
547
|
+
&destLen,
|
|
548
|
+
srcBuffer + sizeof(LZMA_Props),
|
|
549
|
+
&srcLen,
|
|
550
|
+
srcBuffer,
|
|
551
|
+
sizeof(LZMA_Props),
|
|
552
|
+
LZMA_FINISH_END,
|
|
553
|
+
&LzmaStatus,
|
|
554
|
+
&SzAlloc);
|
|
555
|
+
if(nResult != SZ_OK)
|
|
556
|
+
return 0;
|
|
557
|
+
|
|
558
|
+
*pcbOutBuffer = (unsigned int)destLen;
|
|
559
|
+
return 1;
|
|
560
|
+
}
|
|
561
|
+
|
|
562
|
+
/******************************************************************************/
|
|
563
|
+
/* */
|
|
564
|
+
/* Support functions for SPARSE compression (0x20) */
|
|
565
|
+
/* */
|
|
566
|
+
/******************************************************************************/
|
|
567
|
+
|
|
568
|
+
void Compress_SPARSE(void * pvOutBuffer, int * pcbOutBuffer, void * pvInBuffer, int cbInBuffer, int * pCmpType, int nCmpLevel)
|
|
569
|
+
{
|
|
570
|
+
// Keep compilers happy
|
|
571
|
+
STORMLIB_UNUSED(pCmpType);
|
|
572
|
+
STORMLIB_UNUSED(nCmpLevel);
|
|
573
|
+
|
|
574
|
+
CompressSparse(pvOutBuffer, pcbOutBuffer, pvInBuffer, cbInBuffer);
|
|
575
|
+
}
|
|
576
|
+
|
|
577
|
+
int Decompress_SPARSE(void * pvOutBuffer, int * pcbOutBuffer, void * pvInBuffer, int cbInBuffer)
|
|
578
|
+
{
|
|
579
|
+
return DecompressSparse(pvOutBuffer, pcbOutBuffer, pvInBuffer, cbInBuffer);
|
|
580
|
+
}
|
|
581
|
+
|
|
582
|
+
/******************************************************************************/
|
|
583
|
+
/* */
|
|
584
|
+
/* Support for ADPCM mono compression (0x40) */
|
|
585
|
+
/* */
|
|
586
|
+
/******************************************************************************/
|
|
587
|
+
|
|
588
|
+
static void Compress_ADPCM_mono(void * pvOutBuffer, int * pcbOutBuffer, void * pvInBuffer, int cbInBuffer, int * pCmpType, int nCmpLevel)
|
|
589
|
+
{
|
|
590
|
+
// Prepare the compression level for Huffmann compression,
|
|
591
|
+
// which will be called as next step
|
|
592
|
+
if(0 < nCmpLevel && nCmpLevel <= 2)
|
|
593
|
+
{
|
|
594
|
+
nCmpLevel = 4;
|
|
595
|
+
*pCmpType = 6;
|
|
596
|
+
}
|
|
597
|
+
else if(nCmpLevel == 3)
|
|
598
|
+
{
|
|
599
|
+
nCmpLevel = 6;
|
|
600
|
+
*pCmpType = 8;
|
|
601
|
+
}
|
|
602
|
+
else
|
|
603
|
+
{
|
|
604
|
+
nCmpLevel = 5;
|
|
605
|
+
*pCmpType = 7;
|
|
606
|
+
}
|
|
607
|
+
*pcbOutBuffer = CompressADPCM(pvOutBuffer, *pcbOutBuffer, pvInBuffer, cbInBuffer, 1, nCmpLevel);
|
|
608
|
+
}
|
|
609
|
+
|
|
610
|
+
static int Decompress_ADPCM_mono(void * pvOutBuffer, int * pcbOutBuffer, void * pvInBuffer, int cbInBuffer)
|
|
611
|
+
{
|
|
612
|
+
*pcbOutBuffer = DecompressADPCM(pvOutBuffer, *pcbOutBuffer, pvInBuffer, cbInBuffer, 1);
|
|
613
|
+
return 1;
|
|
614
|
+
}
|
|
615
|
+
|
|
616
|
+
/******************************************************************************/
|
|
617
|
+
/* */
|
|
618
|
+
/* Support for ADPCM stereo compression (0x80) */
|
|
619
|
+
/* */
|
|
620
|
+
/******************************************************************************/
|
|
621
|
+
|
|
622
|
+
static void Compress_ADPCM_stereo(void * pvOutBuffer, int * pcbOutBuffer, void * pvInBuffer, int cbInBuffer, int * pCmpType, int nCmpLevel)
|
|
623
|
+
{
|
|
624
|
+
// Prepare the compression level for Huffmann compression,
|
|
625
|
+
// which will be called as next step
|
|
626
|
+
if(0 < nCmpLevel && nCmpLevel <= 2)
|
|
627
|
+
{
|
|
628
|
+
nCmpLevel = 4;
|
|
629
|
+
*pCmpType = 6;
|
|
630
|
+
}
|
|
631
|
+
else if(nCmpLevel == 3)
|
|
632
|
+
{
|
|
633
|
+
nCmpLevel = 6;
|
|
634
|
+
*pCmpType = 8;
|
|
635
|
+
}
|
|
636
|
+
else
|
|
637
|
+
{
|
|
638
|
+
nCmpLevel = 5;
|
|
639
|
+
*pCmpType = 7;
|
|
640
|
+
}
|
|
641
|
+
*pcbOutBuffer = CompressADPCM(pvOutBuffer, *pcbOutBuffer, pvInBuffer, cbInBuffer, 2, nCmpLevel);
|
|
642
|
+
}
|
|
643
|
+
|
|
644
|
+
static int Decompress_ADPCM_stereo(void * pvOutBuffer, int * pcbOutBuffer, void * pvInBuffer, int cbInBuffer)
|
|
645
|
+
{
|
|
646
|
+
*pcbOutBuffer = DecompressADPCM(pvOutBuffer, *pcbOutBuffer, pvInBuffer, cbInBuffer, 2);
|
|
647
|
+
return 1;
|
|
648
|
+
}
|
|
649
|
+
|
|
650
|
+
/******************************************************************************/
|
|
651
|
+
/* */
|
|
652
|
+
/* Support for ADPCM mono & stereo (Starcraft I BETA - like) */
|
|
653
|
+
/* */
|
|
654
|
+
/******************************************************************************/
|
|
655
|
+
|
|
656
|
+
static int Decompress_ADPCM1_sc1b(void * pvOutBuffer, int * pcbOutBuffer, void * pvInBuffer, int cbInBuffer)
|
|
657
|
+
{
|
|
658
|
+
*pcbOutBuffer = DecompressADPCM_SC1B(pvOutBuffer, *pcbOutBuffer, pvInBuffer, cbInBuffer, 1);
|
|
659
|
+
return 1;
|
|
660
|
+
}
|
|
661
|
+
|
|
662
|
+
static int Decompress_ADPCM2_sc1b(void * pvOutBuffer, int * pcbOutBuffer, void * pvInBuffer, int cbInBuffer)
|
|
663
|
+
{
|
|
664
|
+
*pcbOutBuffer = DecompressADPCM_SC1B(pvOutBuffer, *pcbOutBuffer, pvInBuffer, cbInBuffer, 2);
|
|
665
|
+
return 1;
|
|
666
|
+
}
|
|
667
|
+
|
|
668
|
+
/*****************************************************************************/
|
|
669
|
+
/* */
|
|
670
|
+
/* SCompImplode */
|
|
671
|
+
/* */
|
|
672
|
+
/*****************************************************************************/
|
|
673
|
+
|
|
674
|
+
int WINAPI SCompImplode(void * pvOutBuffer, int * pcbOutBuffer, void * pvInBuffer, int cbInBuffer)
|
|
675
|
+
{
|
|
676
|
+
int cbOutBuffer;
|
|
677
|
+
|
|
678
|
+
// Check for valid parameters
|
|
679
|
+
if(!pcbOutBuffer || *pcbOutBuffer < cbInBuffer || !pvOutBuffer || !pvInBuffer)
|
|
680
|
+
{
|
|
681
|
+
SetLastError(ERROR_INVALID_PARAMETER);
|
|
682
|
+
return 0;
|
|
683
|
+
}
|
|
684
|
+
|
|
685
|
+
// Perform the compression
|
|
686
|
+
cbOutBuffer = *pcbOutBuffer;
|
|
687
|
+
Compress_PKLIB(pvOutBuffer, &cbOutBuffer, pvInBuffer, cbInBuffer, NULL, 0);
|
|
688
|
+
|
|
689
|
+
// If the compression was unsuccessful, copy the data as-is
|
|
690
|
+
if(cbOutBuffer >= *pcbOutBuffer)
|
|
691
|
+
{
|
|
692
|
+
memcpy(pvOutBuffer, pvInBuffer, cbInBuffer);
|
|
693
|
+
cbOutBuffer = *pcbOutBuffer;
|
|
694
|
+
}
|
|
695
|
+
|
|
696
|
+
*pcbOutBuffer = cbOutBuffer;
|
|
697
|
+
return 1;
|
|
698
|
+
}
|
|
699
|
+
|
|
700
|
+
/*****************************************************************************/
|
|
701
|
+
/* */
|
|
702
|
+
/* SCompExplode */
|
|
703
|
+
/* */
|
|
704
|
+
/*****************************************************************************/
|
|
705
|
+
|
|
706
|
+
int WINAPI SCompExplode(void * pvOutBuffer, int * pcbOutBuffer, void * pvInBuffer, int cbInBuffer)
|
|
707
|
+
{
|
|
708
|
+
int cbOutBuffer;
|
|
709
|
+
|
|
710
|
+
// Check for valid parameters
|
|
711
|
+
if(!pcbOutBuffer || *pcbOutBuffer < cbInBuffer || !pvOutBuffer || !pvInBuffer)
|
|
712
|
+
{
|
|
713
|
+
SetLastError(ERROR_INVALID_PARAMETER);
|
|
714
|
+
return 0;
|
|
715
|
+
}
|
|
716
|
+
|
|
717
|
+
// If the input length is the same as output length, do nothing.
|
|
718
|
+
cbOutBuffer = *pcbOutBuffer;
|
|
719
|
+
if(cbInBuffer == cbOutBuffer)
|
|
720
|
+
{
|
|
721
|
+
// If the buffers are equal, don't copy anything.
|
|
722
|
+
if(pvInBuffer == pvOutBuffer)
|
|
723
|
+
return 1;
|
|
724
|
+
|
|
725
|
+
memcpy(pvOutBuffer, pvInBuffer, cbInBuffer);
|
|
726
|
+
return 1;
|
|
727
|
+
}
|
|
728
|
+
|
|
729
|
+
// Perform decompression
|
|
730
|
+
if(!Decompress_PKLIB(pvOutBuffer, &cbOutBuffer, pvInBuffer, cbInBuffer))
|
|
731
|
+
{
|
|
732
|
+
SetLastError(ERROR_FILE_CORRUPT);
|
|
733
|
+
return 0;
|
|
734
|
+
}
|
|
735
|
+
|
|
736
|
+
*pcbOutBuffer = cbOutBuffer;
|
|
737
|
+
return 1;
|
|
738
|
+
}
|
|
739
|
+
|
|
740
|
+
/*****************************************************************************/
|
|
741
|
+
/* */
|
|
742
|
+
/* SCompCompress */
|
|
743
|
+
/* */
|
|
744
|
+
/*****************************************************************************/
|
|
745
|
+
|
|
746
|
+
// This table contains compress functions which can be applied to
|
|
747
|
+
// uncompressed data. Each bit means the corresponding
|
|
748
|
+
// compression method/function must be applied.
|
|
749
|
+
//
|
|
750
|
+
// WAVes compression Data compression
|
|
751
|
+
// ------------------ -------------------
|
|
752
|
+
// 1st sector - 0x08 0x08 (D, HF, W2, SC, D2)
|
|
753
|
+
// Next sectors - 0x81 0x02 (W3)
|
|
754
|
+
|
|
755
|
+
static TCompressTable cmp_table[] =
|
|
756
|
+
{
|
|
757
|
+
{MPQ_COMPRESSION_SPARSE, Compress_SPARSE}, // Sparse compression
|
|
758
|
+
{MPQ_COMPRESSION_ADPCM_MONO, Compress_ADPCM_mono}, // IMA ADPCM mono compression
|
|
759
|
+
{MPQ_COMPRESSION_ADPCM_STEREO, Compress_ADPCM_stereo}, // IMA ADPCM stereo compression
|
|
760
|
+
{MPQ_COMPRESSION_HUFFMANN, Compress_huff}, // Huffmann compression
|
|
761
|
+
{MPQ_COMPRESSION_ZLIB, Compress_ZLIB}, // Compression with the "zlib" library
|
|
762
|
+
{MPQ_COMPRESSION_PKWARE, Compress_PKLIB}, // Compression with Pkware DCL
|
|
763
|
+
{MPQ_COMPRESSION_BZIP2, Compress_BZIP2} // Compression Bzip2 library
|
|
764
|
+
};
|
|
765
|
+
|
|
766
|
+
int WINAPI SCompCompress(void * pvOutBuffer, int * pcbOutBuffer, void * pvInBuffer, int cbInBuffer, unsigned uCompressionMask, int nCmpType, int nCmpLevel)
|
|
767
|
+
{
|
|
768
|
+
COMPRESS CompressFuncArray[0x10]; // Array of compression functions, applied sequentially
|
|
769
|
+
unsigned char CompressByte[0x10]; // CompressByte for each method in the CompressFuncArray array
|
|
770
|
+
unsigned char * pbWorkBuffer = NULL; // Temporary storage for decompressed data
|
|
771
|
+
unsigned char * pbOutBuffer = (unsigned char *)pvOutBuffer;
|
|
772
|
+
unsigned char * pbOutput = (unsigned char *)pvOutBuffer;// Current output buffer
|
|
773
|
+
unsigned char * pbInput = (unsigned char *)pvInBuffer; // Current input buffer
|
|
774
|
+
int nCompressCount = 0;
|
|
775
|
+
int nCompressIndex = 0;
|
|
776
|
+
int nAtLeastOneCompressionDone = 0;
|
|
777
|
+
int cbOutBuffer = 0;
|
|
778
|
+
int cbInLength = cbInBuffer;
|
|
779
|
+
int nResult = 1;
|
|
780
|
+
|
|
781
|
+
// Check for valid parameters
|
|
782
|
+
if(!pcbOutBuffer || *pcbOutBuffer < cbInBuffer || !pvOutBuffer || !pvInBuffer)
|
|
783
|
+
{
|
|
784
|
+
SetLastError(ERROR_INVALID_PARAMETER);
|
|
785
|
+
return 0;
|
|
786
|
+
}
|
|
787
|
+
|
|
788
|
+
// Zero input length brings zero output length
|
|
789
|
+
if(cbInBuffer == 0)
|
|
790
|
+
{
|
|
791
|
+
*pcbOutBuffer = 0;
|
|
792
|
+
return true;
|
|
793
|
+
}
|
|
794
|
+
|
|
795
|
+
// Setup the compression function array
|
|
796
|
+
if(uCompressionMask == MPQ_COMPRESSION_LZMA)
|
|
797
|
+
{
|
|
798
|
+
CompressFuncArray[0] = Compress_LZMA;
|
|
799
|
+
CompressByte[0] = (char)uCompressionMask;
|
|
800
|
+
nCompressCount = 1;
|
|
801
|
+
}
|
|
802
|
+
else
|
|
803
|
+
{
|
|
804
|
+
// Fill the compressions array
|
|
805
|
+
for(size_t i = 0; i < _countof(cmp_table); i++)
|
|
806
|
+
{
|
|
807
|
+
// If the mask agrees, insert the compression function to the array
|
|
808
|
+
if(uCompressionMask & cmp_table[i].uMask)
|
|
809
|
+
{
|
|
810
|
+
CompressFuncArray[nCompressCount] = cmp_table[i].Compress;
|
|
811
|
+
CompressByte[nCompressCount] = (unsigned char)cmp_table[i].uMask;
|
|
812
|
+
uCompressionMask &= ~cmp_table[i].uMask;
|
|
813
|
+
nCompressCount++;
|
|
814
|
+
}
|
|
815
|
+
}
|
|
816
|
+
|
|
817
|
+
// If at least one of the compressions remaing unknown, return an error
|
|
818
|
+
if(uCompressionMask != 0)
|
|
819
|
+
{
|
|
820
|
+
SetLastError(ERROR_NOT_SUPPORTED);
|
|
821
|
+
return 0;
|
|
822
|
+
}
|
|
823
|
+
}
|
|
824
|
+
|
|
825
|
+
// If there is at least one compression, do it
|
|
826
|
+
if(nCompressCount > 0)
|
|
827
|
+
{
|
|
828
|
+
// If we need to do more than 1 compression, allocate intermediate buffer
|
|
829
|
+
if(nCompressCount > 1)
|
|
830
|
+
{
|
|
831
|
+
pbWorkBuffer = STORM_ALLOC(unsigned char, *pcbOutBuffer);
|
|
832
|
+
if(pbWorkBuffer == NULL)
|
|
833
|
+
{
|
|
834
|
+
SetLastError(ERROR_NOT_ENOUGH_MEMORY);
|
|
835
|
+
return 0;
|
|
836
|
+
}
|
|
837
|
+
}
|
|
838
|
+
|
|
839
|
+
// Get the current compression index
|
|
840
|
+
nCompressIndex = nCompressCount - 1;
|
|
841
|
+
|
|
842
|
+
// Perform all compressions in the array
|
|
843
|
+
for(int i = 0; i < nCompressCount; i++)
|
|
844
|
+
{
|
|
845
|
+
// Choose the proper output buffer
|
|
846
|
+
pbOutput = (nCompressIndex & 1) ? pbWorkBuffer : pbOutBuffer;
|
|
847
|
+
nCompressIndex--;
|
|
848
|
+
|
|
849
|
+
// Perform the (next) compression
|
|
850
|
+
// Note that if the compression method is unable to compress the input data block
|
|
851
|
+
// by at least 2 bytes, we consider it as failure and will use source data instead
|
|
852
|
+
cbOutBuffer = *pcbOutBuffer - 1;
|
|
853
|
+
CompressFuncArray[i](pbOutput + 1, &cbOutBuffer, pbInput, cbInLength, &nCmpType, nCmpLevel);
|
|
854
|
+
|
|
855
|
+
// If the compression failed, we copy the input buffer as-is.
|
|
856
|
+
// Note that there is one extra byte at the end of the intermediate buffer, so it should be OK
|
|
857
|
+
if(cbOutBuffer > (cbInLength - 2))
|
|
858
|
+
{
|
|
859
|
+
memcpy(pbOutput + nAtLeastOneCompressionDone, pbInput, cbInLength);
|
|
860
|
+
cbOutBuffer = cbInLength;
|
|
861
|
+
}
|
|
862
|
+
else
|
|
863
|
+
{
|
|
864
|
+
// Remember that we have done at least one compression
|
|
865
|
+
nAtLeastOneCompressionDone = 1;
|
|
866
|
+
uCompressionMask |= CompressByte[i];
|
|
867
|
+
}
|
|
868
|
+
|
|
869
|
+
// Now point input buffer to the output buffer
|
|
870
|
+
pbInput = pbOutput + nAtLeastOneCompressionDone;
|
|
871
|
+
cbInLength = cbOutBuffer;
|
|
872
|
+
}
|
|
873
|
+
|
|
874
|
+
// If at least one compression succeeded, put the compression
|
|
875
|
+
// mask to the begin of the output buffer
|
|
876
|
+
if(nAtLeastOneCompressionDone)
|
|
877
|
+
*pbOutBuffer = (unsigned char)uCompressionMask;
|
|
878
|
+
*pcbOutBuffer = cbOutBuffer + nAtLeastOneCompressionDone;
|
|
879
|
+
}
|
|
880
|
+
else
|
|
881
|
+
{
|
|
882
|
+
memcpy(pvOutBuffer, pvInBuffer, cbInBuffer);
|
|
883
|
+
*pcbOutBuffer = cbInBuffer;
|
|
884
|
+
}
|
|
885
|
+
|
|
886
|
+
// Cleanup and return
|
|
887
|
+
if(pbWorkBuffer != NULL)
|
|
888
|
+
STORM_FREE(pbWorkBuffer);
|
|
889
|
+
return nResult;
|
|
890
|
+
}
|
|
891
|
+
|
|
892
|
+
/*****************************************************************************/
|
|
893
|
+
/* */
|
|
894
|
+
/* SCompDecompress */
|
|
895
|
+
/* */
|
|
896
|
+
/*****************************************************************************/
|
|
897
|
+
|
|
898
|
+
// Decompression table specific for Starcraft I BETA
|
|
899
|
+
// WAVE files are compressed by different ADPCM compression
|
|
900
|
+
static TDecompressTable dcmp_table_sc_beta[] =
|
|
901
|
+
{
|
|
902
|
+
{MPQ_COMPRESSION_PKWARE, Decompress_PKLIB}, // Decompression with Pkware Data Compression Library
|
|
903
|
+
{MPQ_COMPRESSION_HUFFMANN, Decompress_huff}, // Huffmann decompression
|
|
904
|
+
{0x10, Decompress_ADPCM1_sc1b}, // IMA ADPCM mono decompression
|
|
905
|
+
{0x20, Decompress_ADPCM2_sc1b}, // IMA ADPCM stereo decompression
|
|
906
|
+
};
|
|
907
|
+
|
|
908
|
+
// This table contains decompress functions which can be applied to
|
|
909
|
+
// uncompressed data. The compression mask is stored in the first byte
|
|
910
|
+
// of compressed data
|
|
911
|
+
static TDecompressTable dcmp_table[] =
|
|
912
|
+
{
|
|
913
|
+
{MPQ_COMPRESSION_BZIP2, Decompress_BZIP2}, // Decompression with Bzip2 library
|
|
914
|
+
{MPQ_COMPRESSION_PKWARE, Decompress_PKLIB}, // Decompression with Pkware Data Compression Library
|
|
915
|
+
{MPQ_COMPRESSION_ZLIB, Decompress_ZLIB}, // Decompression with the "zlib" library
|
|
916
|
+
{MPQ_COMPRESSION_HUFFMANN, Decompress_huff}, // Huffmann decompression
|
|
917
|
+
{MPQ_COMPRESSION_ADPCM_STEREO, Decompress_ADPCM_stereo}, // IMA ADPCM stereo decompression
|
|
918
|
+
{MPQ_COMPRESSION_ADPCM_MONO, Decompress_ADPCM_mono}, // IMA ADPCM mono decompression
|
|
919
|
+
{MPQ_COMPRESSION_SPARSE, Decompress_SPARSE} // Sparse decompression
|
|
920
|
+
};
|
|
921
|
+
|
|
922
|
+
static int SCompDecompressInternal(
|
|
923
|
+
TDecompressTable * table,
|
|
924
|
+
size_t table_length,
|
|
925
|
+
void * pvOutBuffer,
|
|
926
|
+
int * pcbOutBuffer,
|
|
927
|
+
void * pvInBuffer,
|
|
928
|
+
int cbInBuffer,
|
|
929
|
+
unsigned uValidMask = 0xFF)
|
|
930
|
+
{
|
|
931
|
+
unsigned char * pbWorkBuffer = NULL;
|
|
932
|
+
unsigned char * pbOutBuffer = (unsigned char *)pvOutBuffer;
|
|
933
|
+
unsigned char * pbInBuffer = (unsigned char *)pvInBuffer;
|
|
934
|
+
unsigned char * pbOutput = (unsigned char *)pvOutBuffer;
|
|
935
|
+
unsigned char * pbInput;
|
|
936
|
+
unsigned uCompressionMask1; // Decompressions applied to the data
|
|
937
|
+
unsigned uCompressionMask2; // Decompressions applied to the data
|
|
938
|
+
int cbOutBuffer = *pcbOutBuffer; // Current size of the output buffer
|
|
939
|
+
int cbInLength; // Current size of the input buffer
|
|
940
|
+
int nCompressCount = 0; // Number of compressions to be applied
|
|
941
|
+
int nCompressIndex = 0;
|
|
942
|
+
int nResult = 1;
|
|
943
|
+
|
|
944
|
+
// Verify buffer sizes
|
|
945
|
+
if(cbOutBuffer < cbInBuffer || cbInBuffer < 1)
|
|
946
|
+
return 0;
|
|
947
|
+
|
|
948
|
+
// If the input length is the same as output length, do nothing.
|
|
949
|
+
if(cbOutBuffer == cbInBuffer)
|
|
950
|
+
{
|
|
951
|
+
// If the buffers are equal, don't copy anything.
|
|
952
|
+
if(pvInBuffer != pvOutBuffer)
|
|
953
|
+
memcpy(pvOutBuffer, pvInBuffer, cbInBuffer);
|
|
954
|
+
return 1;
|
|
955
|
+
}
|
|
956
|
+
|
|
957
|
+
// Get applied compression types and decrement data length
|
|
958
|
+
uCompressionMask1 = ((unsigned char)(*pbInBuffer++) & (uValidMask));
|
|
959
|
+
uCompressionMask2 = uCompressionMask1;
|
|
960
|
+
cbInBuffer--;
|
|
961
|
+
|
|
962
|
+
// Get current compressed data and length of it
|
|
963
|
+
pbInput = pbInBuffer;
|
|
964
|
+
cbInLength = cbInBuffer;
|
|
965
|
+
|
|
966
|
+
// This compression function doesn't support LZMA
|
|
967
|
+
assert(uCompressionMask1 != MPQ_COMPRESSION_LZMA);
|
|
968
|
+
|
|
969
|
+
// Parse the compression mask
|
|
970
|
+
for(size_t i = 0; i < table_length; i++)
|
|
971
|
+
{
|
|
972
|
+
// If the mask agrees, insert the compression function to the array
|
|
973
|
+
if(uCompressionMask1 & table[i].uMask)
|
|
974
|
+
{
|
|
975
|
+
uCompressionMask2 &= ~table[i].uMask;
|
|
976
|
+
nCompressCount++;
|
|
977
|
+
}
|
|
978
|
+
}
|
|
979
|
+
|
|
980
|
+
// If at least one of the compressions remaing unknown, return an error
|
|
981
|
+
if(nCompressCount == 0 || uCompressionMask2 != 0)
|
|
982
|
+
{
|
|
983
|
+
SetLastError(ERROR_NOT_SUPPORTED);
|
|
984
|
+
return 0;
|
|
985
|
+
}
|
|
986
|
+
|
|
987
|
+
// If there is more than one compression, we have to allocate extra buffer
|
|
988
|
+
if(nCompressCount > 1)
|
|
989
|
+
{
|
|
990
|
+
pbWorkBuffer = STORM_ALLOC(unsigned char, cbOutBuffer);
|
|
991
|
+
if(pbWorkBuffer == NULL)
|
|
992
|
+
{
|
|
993
|
+
SetLastError(ERROR_NOT_ENOUGH_MEMORY);
|
|
994
|
+
return 0;
|
|
995
|
+
}
|
|
996
|
+
}
|
|
997
|
+
|
|
998
|
+
// Get the current compression index
|
|
999
|
+
nCompressIndex = nCompressCount - 1;
|
|
1000
|
+
|
|
1001
|
+
// Apply all decompressions
|
|
1002
|
+
for(size_t i = 0; i < table_length; i++)
|
|
1003
|
+
{
|
|
1004
|
+
// Perform the (next) decompression
|
|
1005
|
+
if(uCompressionMask1 & table[i].uMask)
|
|
1006
|
+
{
|
|
1007
|
+
// Get the correct output buffer
|
|
1008
|
+
pbOutput = (nCompressIndex & 1) ? pbWorkBuffer : pbOutBuffer;
|
|
1009
|
+
nCompressIndex--;
|
|
1010
|
+
|
|
1011
|
+
// Perform the decompression
|
|
1012
|
+
cbOutBuffer = *pcbOutBuffer;
|
|
1013
|
+
nResult = table[i].Decompress(pbOutput, &cbOutBuffer, pbInput, cbInLength);
|
|
1014
|
+
if(nResult == 0 || cbOutBuffer == 0)
|
|
1015
|
+
{
|
|
1016
|
+
SetLastError(ERROR_FILE_CORRUPT);
|
|
1017
|
+
nResult = 0;
|
|
1018
|
+
break;
|
|
1019
|
+
}
|
|
1020
|
+
|
|
1021
|
+
// Switch buffers
|
|
1022
|
+
cbInLength = cbOutBuffer;
|
|
1023
|
+
pbInput = pbOutput;
|
|
1024
|
+
}
|
|
1025
|
+
}
|
|
1026
|
+
|
|
1027
|
+
// Put the length of the decompressed data to the output buffer
|
|
1028
|
+
*pcbOutBuffer = cbOutBuffer;
|
|
1029
|
+
|
|
1030
|
+
// Cleanup and return
|
|
1031
|
+
if(pbWorkBuffer != NULL)
|
|
1032
|
+
STORM_FREE(pbWorkBuffer);
|
|
1033
|
+
return nResult;
|
|
1034
|
+
}
|
|
1035
|
+
|
|
1036
|
+
int WINAPI SCompDecompress(void * pvOutBuffer, int * pcbOutBuffer, void * pvInBuffer, int cbInBuffer)
|
|
1037
|
+
{
|
|
1038
|
+
return SCompDecompressInternal(dcmp_table, _countof(dcmp_table), pvOutBuffer, pcbOutBuffer, pvInBuffer, cbInBuffer);
|
|
1039
|
+
}
|
|
1040
|
+
|
|
1041
|
+
int WINAPI SCompDecompress2(void * pvOutBuffer, int * pcbOutBuffer, void * pvInBuffer, int cbInBuffer)
|
|
1042
|
+
{
|
|
1043
|
+
DECOMPRESS pfnDecompress1 = NULL;
|
|
1044
|
+
DECOMPRESS pfnDecompress2 = NULL;
|
|
1045
|
+
unsigned char * pbWorkBuffer = (unsigned char *)pvOutBuffer;
|
|
1046
|
+
unsigned char * pbInBuffer = (unsigned char *)pvInBuffer;
|
|
1047
|
+
int cbWorkBuffer = *pcbOutBuffer;
|
|
1048
|
+
int nResult;
|
|
1049
|
+
char CompressionMethod;
|
|
1050
|
+
|
|
1051
|
+
// Verify buffer sizes
|
|
1052
|
+
if(*pcbOutBuffer < cbInBuffer || cbInBuffer < 1)
|
|
1053
|
+
return 0;
|
|
1054
|
+
|
|
1055
|
+
// If the outputbuffer is as big as input buffer, just copy the block
|
|
1056
|
+
if(*pcbOutBuffer == cbInBuffer)
|
|
1057
|
+
{
|
|
1058
|
+
if(pvOutBuffer != pvInBuffer)
|
|
1059
|
+
memcpy(pvOutBuffer, pvInBuffer, cbInBuffer);
|
|
1060
|
+
return 1;
|
|
1061
|
+
}
|
|
1062
|
+
|
|
1063
|
+
// Get the compression methods
|
|
1064
|
+
CompressionMethod = *pbInBuffer++;
|
|
1065
|
+
cbInBuffer--;
|
|
1066
|
+
|
|
1067
|
+
// We only recognize a fixed set of compression methods
|
|
1068
|
+
switch((unsigned char)CompressionMethod)
|
|
1069
|
+
{
|
|
1070
|
+
case MPQ_COMPRESSION_ZLIB:
|
|
1071
|
+
pfnDecompress1 = Decompress_ZLIB;
|
|
1072
|
+
break;
|
|
1073
|
+
|
|
1074
|
+
case MPQ_COMPRESSION_PKWARE:
|
|
1075
|
+
pfnDecompress1 = Decompress_PKLIB;
|
|
1076
|
+
break;
|
|
1077
|
+
|
|
1078
|
+
case MPQ_COMPRESSION_BZIP2:
|
|
1079
|
+
pfnDecompress1 = Decompress_BZIP2;
|
|
1080
|
+
break;
|
|
1081
|
+
|
|
1082
|
+
case MPQ_COMPRESSION_LZMA:
|
|
1083
|
+
pfnDecompress1 = Decompress_LZMA;
|
|
1084
|
+
break;
|
|
1085
|
+
|
|
1086
|
+
case MPQ_COMPRESSION_SPARSE:
|
|
1087
|
+
pfnDecompress1 = Decompress_SPARSE;
|
|
1088
|
+
break;
|
|
1089
|
+
|
|
1090
|
+
case (MPQ_COMPRESSION_SPARSE | MPQ_COMPRESSION_ZLIB):
|
|
1091
|
+
pfnDecompress1 = Decompress_ZLIB;
|
|
1092
|
+
pfnDecompress2 = Decompress_SPARSE;
|
|
1093
|
+
break;
|
|
1094
|
+
|
|
1095
|
+
case (MPQ_COMPRESSION_SPARSE | MPQ_COMPRESSION_BZIP2):
|
|
1096
|
+
pfnDecompress1 = Decompress_BZIP2;
|
|
1097
|
+
pfnDecompress2 = Decompress_SPARSE;
|
|
1098
|
+
break;
|
|
1099
|
+
|
|
1100
|
+
//
|
|
1101
|
+
// Note: Any combination including MPQ_COMPRESSION_ADPCM_MONO,
|
|
1102
|
+
// MPQ_COMPRESSION_ADPCM_STEREO or MPQ_COMPRESSION_HUFFMANN
|
|
1103
|
+
// is not supported by newer MPQs.
|
|
1104
|
+
//
|
|
1105
|
+
|
|
1106
|
+
case (MPQ_COMPRESSION_ADPCM_MONO | MPQ_COMPRESSION_HUFFMANN):
|
|
1107
|
+
pfnDecompress1 = Decompress_huff;
|
|
1108
|
+
pfnDecompress2 = Decompress_ADPCM_mono;
|
|
1109
|
+
break;
|
|
1110
|
+
|
|
1111
|
+
case (MPQ_COMPRESSION_ADPCM_STEREO | MPQ_COMPRESSION_HUFFMANN):
|
|
1112
|
+
pfnDecompress1 = Decompress_huff;
|
|
1113
|
+
pfnDecompress2 = Decompress_ADPCM_stereo;
|
|
1114
|
+
break;
|
|
1115
|
+
|
|
1116
|
+
default:
|
|
1117
|
+
SetLastError(ERROR_FILE_CORRUPT);
|
|
1118
|
+
return 0;
|
|
1119
|
+
}
|
|
1120
|
+
|
|
1121
|
+
// If we have to use two decompressions, allocate temporary buffer
|
|
1122
|
+
if(pfnDecompress2 != NULL)
|
|
1123
|
+
{
|
|
1124
|
+
pbWorkBuffer = STORM_ALLOC(unsigned char, *pcbOutBuffer);
|
|
1125
|
+
if(pbWorkBuffer == NULL)
|
|
1126
|
+
{
|
|
1127
|
+
SetLastError(ERROR_NOT_ENOUGH_MEMORY);
|
|
1128
|
+
return 0;
|
|
1129
|
+
}
|
|
1130
|
+
}
|
|
1131
|
+
|
|
1132
|
+
// Apply the first decompression method
|
|
1133
|
+
nResult = pfnDecompress1(pbWorkBuffer, &cbWorkBuffer, pbInBuffer, cbInBuffer);
|
|
1134
|
+
|
|
1135
|
+
// Apply the second decompression method, if any
|
|
1136
|
+
if(pfnDecompress2 != NULL && nResult != 0)
|
|
1137
|
+
{
|
|
1138
|
+
cbInBuffer = cbWorkBuffer;
|
|
1139
|
+
cbWorkBuffer = *pcbOutBuffer;
|
|
1140
|
+
nResult = pfnDecompress2(pvOutBuffer, &cbWorkBuffer, pbWorkBuffer, cbInBuffer);
|
|
1141
|
+
}
|
|
1142
|
+
|
|
1143
|
+
// Supply the output buffer size
|
|
1144
|
+
*pcbOutBuffer = cbWorkBuffer;
|
|
1145
|
+
|
|
1146
|
+
// Free temporary buffer
|
|
1147
|
+
if(pbWorkBuffer != pvOutBuffer)
|
|
1148
|
+
STORM_FREE(pbWorkBuffer);
|
|
1149
|
+
|
|
1150
|
+
if(nResult == 0)
|
|
1151
|
+
SetLastError(ERROR_FILE_CORRUPT);
|
|
1152
|
+
return nResult;
|
|
1153
|
+
}
|
|
1154
|
+
|
|
1155
|
+
int WINAPI SCompDecompressX(TMPQArchive * ha, void * pvOutBuffer, int * pcbOutBuffer, void * pvInBuffer, int cbInBuffer)
|
|
1156
|
+
{
|
|
1157
|
+
// MPQs version 2 use their own fixed list of compression flags.
|
|
1158
|
+
if(ha->pHeader->wFormatVersion >= MPQ_FORMAT_VERSION_2)
|
|
1159
|
+
{
|
|
1160
|
+
return SCompDecompress2(pvOutBuffer, pcbOutBuffer, pvInBuffer, cbInBuffer);
|
|
1161
|
+
}
|
|
1162
|
+
|
|
1163
|
+
// Starcraft BETA has specific decompression table.
|
|
1164
|
+
if(ha->dwFlags & MPQ_FLAG_STARCRAFT_BETA)
|
|
1165
|
+
{
|
|
1166
|
+
return SCompDecompressInternal(dcmp_table_sc_beta, _countof(dcmp_table_sc_beta), pvOutBuffer, pcbOutBuffer, pvInBuffer, cbInBuffer);
|
|
1167
|
+
}
|
|
1168
|
+
|
|
1169
|
+
// Default: Use the common MPQ v1 decompression routine
|
|
1170
|
+
return SCompDecompressInternal(dcmp_table, _countof(dcmp_table), pvOutBuffer, pcbOutBuffer, pvInBuffer, cbInBuffer);
|
|
1171
|
+
}
|
|
1172
|
+
|
|
1173
|
+
/*****************************************************************************/
|
|
1174
|
+
/* */
|
|
1175
|
+
/* File decompression for MPK archives */
|
|
1176
|
+
/* */
|
|
1177
|
+
/*****************************************************************************/
|
|
1178
|
+
|
|
1179
|
+
int SCompDecompressMpk(void * pvOutBuffer, int * pcbOutBuffer, void * pvInBuffer, int cbInBuffer)
|
|
1180
|
+
{
|
|
1181
|
+
return Decompress_LZMA_MPK(pvOutBuffer, pcbOutBuffer, pvInBuffer, cbInBuffer);
|
|
1182
|
+
}
|
|
1183
|
+
|