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,922 @@
|
|
|
1
|
+
/*****************************************************************************/
|
|
2
|
+
/* SFileReadFile.cpp Copyright (c) Ladislav Zezula 2003 */
|
|
3
|
+
/*---------------------------------------------------------------------------*/
|
|
4
|
+
/* Description : */
|
|
5
|
+
/*---------------------------------------------------------------------------*/
|
|
6
|
+
/* Date Ver Who Comment */
|
|
7
|
+
/* -------- ---- --- ------- */
|
|
8
|
+
/* xx.xx.99 1.00 Lad The first version of SFileReadFile.cpp */
|
|
9
|
+
/* 24.03.99 1.00 Lad Added the SFileGetFileInfo function */
|
|
10
|
+
/*****************************************************************************/
|
|
11
|
+
|
|
12
|
+
#define __STORMLIB_SELF__
|
|
13
|
+
#include "StormLib.h"
|
|
14
|
+
#include "StormCommon.h"
|
|
15
|
+
|
|
16
|
+
//-----------------------------------------------------------------------------
|
|
17
|
+
// External references (not public functions)
|
|
18
|
+
|
|
19
|
+
int WINAPI SCompDecompressX(TMPQArchive * ha, void * pvOutBuffer, int * pcbOutBuffer, void * pbInBuffer, int cbInBuffer);
|
|
20
|
+
|
|
21
|
+
//-----------------------------------------------------------------------------
|
|
22
|
+
// Local functions
|
|
23
|
+
|
|
24
|
+
// hf - MPQ File handle.
|
|
25
|
+
// pbBuffer - Pointer to target buffer to store sectors.
|
|
26
|
+
// dwByteOffset - Position of sector in the file (relative to file begin)
|
|
27
|
+
// dwBytesToRead - Number of bytes to read. Must be multiplier of sector size.
|
|
28
|
+
// pdwBytesRead - Stored number of bytes loaded
|
|
29
|
+
static DWORD ReadMpqSectors(TMPQFile * hf, LPBYTE pbBuffer, DWORD dwByteOffset, DWORD dwBytesToRead, LPDWORD pdwBytesRead)
|
|
30
|
+
{
|
|
31
|
+
ULONGLONG RawFilePos;
|
|
32
|
+
TMPQArchive * ha = hf->ha;
|
|
33
|
+
TFileEntry * pFileEntry = hf->pFileEntry;
|
|
34
|
+
LPBYTE pbRawSector = NULL;
|
|
35
|
+
LPBYTE pbOutSector = pbBuffer;
|
|
36
|
+
LPBYTE pbInSector = pbBuffer;
|
|
37
|
+
DWORD dwRawBytesToRead;
|
|
38
|
+
DWORD dwRawSectorOffset = dwByteOffset;
|
|
39
|
+
DWORD dwSectorsToRead = dwBytesToRead / ha->dwSectorSize;
|
|
40
|
+
DWORD dwSectorIndex = dwByteOffset / ha->dwSectorSize;
|
|
41
|
+
DWORD dwSectorsDone = 0;
|
|
42
|
+
DWORD dwBytesRead = 0;
|
|
43
|
+
DWORD dwErrCode = ERROR_SUCCESS;
|
|
44
|
+
|
|
45
|
+
// Note that dwByteOffset must be aligned to size of one sector
|
|
46
|
+
// Note that dwBytesToRead must be a multiplier of one sector size
|
|
47
|
+
// This is local function, so we won't check if that's true.
|
|
48
|
+
// Note that files stored in single units are processed by a separate function
|
|
49
|
+
|
|
50
|
+
// If there is not enough bytes remaining, cut dwBytesToRead
|
|
51
|
+
if((dwByteOffset + dwBytesToRead) > hf->dwDataSize)
|
|
52
|
+
dwBytesToRead = hf->dwDataSize - dwByteOffset;
|
|
53
|
+
dwRawBytesToRead = dwBytesToRead;
|
|
54
|
+
|
|
55
|
+
// Perform all necessary work to do with compressed files
|
|
56
|
+
if(pFileEntry->dwFlags & MPQ_FILE_COMPRESS_MASK)
|
|
57
|
+
{
|
|
58
|
+
// If the sector positions are not loaded yet, do it
|
|
59
|
+
if(hf->SectorOffsets == NULL)
|
|
60
|
+
{
|
|
61
|
+
dwErrCode = AllocateSectorOffsets(hf, true);
|
|
62
|
+
if(dwErrCode != ERROR_SUCCESS || hf->SectorOffsets == NULL)
|
|
63
|
+
return dwErrCode;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
// If the sector checksums are not loaded yet, load them now.
|
|
67
|
+
if(hf->SectorChksums == NULL && (pFileEntry->dwFlags & MPQ_FILE_SECTOR_CRC) && hf->bLoadedSectorCRCs == false)
|
|
68
|
+
{
|
|
69
|
+
//
|
|
70
|
+
// Sector CRCs is plain crap feature. It is almost never present,
|
|
71
|
+
// often it's empty, or the end offset of sector CRCs is zero.
|
|
72
|
+
// We only try to load sector CRCs once, and regardless if it fails
|
|
73
|
+
// or not, we won't try that again for the given file.
|
|
74
|
+
//
|
|
75
|
+
|
|
76
|
+
AllocateSectorChecksums(hf, true);
|
|
77
|
+
hf->bLoadedSectorCRCs = true;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
// TODO: If the raw data MD5s are not loaded yet, load them now
|
|
81
|
+
// Only do it if the MPQ is of format 4.0
|
|
82
|
+
// if(ha->pHeader->wFormatVersion >= MPQ_FORMAT_VERSION_4 && ha->pHeader->dwRawChunkSize != 0)
|
|
83
|
+
// {
|
|
84
|
+
// dwErrCode = AllocateRawMD5s(hf, true);
|
|
85
|
+
// if(dwErrCode != ERROR_SUCCESS)
|
|
86
|
+
// return dwErrCode;
|
|
87
|
+
// }
|
|
88
|
+
|
|
89
|
+
// Assign the temporary buffer as target for read operation
|
|
90
|
+
dwRawSectorOffset = hf->SectorOffsets[dwSectorIndex];
|
|
91
|
+
dwRawBytesToRead = hf->SectorOffsets[dwSectorIndex + dwSectorsToRead] - dwRawSectorOffset;
|
|
92
|
+
|
|
93
|
+
// If the file is compressed, also allocate secondary buffer
|
|
94
|
+
pbInSector = pbRawSector = STORM_ALLOC(BYTE, dwRawBytesToRead);
|
|
95
|
+
if(pbRawSector == NULL)
|
|
96
|
+
return ERROR_NOT_ENOUGH_MEMORY;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
// Calculate raw file offset where the sector(s) are stored.
|
|
100
|
+
RawFilePos = CalculateRawSectorOffset(hf, dwRawSectorOffset);
|
|
101
|
+
|
|
102
|
+
// Set file pointer and read all required sectors
|
|
103
|
+
if(FileStream_Read(ha->pStream, &RawFilePos, pbInSector, dwRawBytesToRead))
|
|
104
|
+
{
|
|
105
|
+
// Now we have to decrypt and decompress all file sectors that have been loaded
|
|
106
|
+
for(DWORD i = 0; i < dwSectorsToRead; i++)
|
|
107
|
+
{
|
|
108
|
+
DWORD dwRawBytesInThisSector = ha->dwSectorSize;
|
|
109
|
+
DWORD dwBytesInThisSector = ha->dwSectorSize;
|
|
110
|
+
DWORD dwIndex = dwSectorIndex + i;
|
|
111
|
+
|
|
112
|
+
// If there is not enough bytes in the last sector,
|
|
113
|
+
// cut the number of bytes in this sector
|
|
114
|
+
if(dwRawBytesInThisSector > dwBytesToRead)
|
|
115
|
+
dwRawBytesInThisSector = dwBytesToRead;
|
|
116
|
+
if(dwBytesInThisSector > dwBytesToRead)
|
|
117
|
+
dwBytesInThisSector = dwBytesToRead;
|
|
118
|
+
|
|
119
|
+
// If the file is compressed, we have to adjust the raw sector size
|
|
120
|
+
if(pFileEntry->dwFlags & MPQ_FILE_COMPRESS_MASK)
|
|
121
|
+
dwRawBytesInThisSector = hf->SectorOffsets[dwIndex + 1] - hf->SectorOffsets[dwIndex];
|
|
122
|
+
|
|
123
|
+
// If the file is encrypted, we have to decrypt the sector
|
|
124
|
+
if(pFileEntry->dwFlags & MPQ_FILE_ENCRYPTED)
|
|
125
|
+
{
|
|
126
|
+
BSWAP_ARRAY32_UNSIGNED(pbInSector, dwRawBytesInThisSector);
|
|
127
|
+
|
|
128
|
+
// If we don't know the key, try to detect it by file content
|
|
129
|
+
if(hf->dwFileKey == 0)
|
|
130
|
+
{
|
|
131
|
+
hf->dwFileKey = DetectFileKeyByContent(pbInSector, dwBytesInThisSector, hf->dwDataSize);
|
|
132
|
+
if(hf->dwFileKey == 0)
|
|
133
|
+
{
|
|
134
|
+
dwErrCode = ERROR_UNKNOWN_FILE_KEY;
|
|
135
|
+
break;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
DecryptMpqBlock(pbInSector, dwRawBytesInThisSector, hf->dwFileKey + dwIndex);
|
|
140
|
+
BSWAP_ARRAY32_UNSIGNED(pbInSector, dwRawBytesInThisSector);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
// If the file has sector CRC check turned on, perform it
|
|
144
|
+
if(hf->bCheckSectorCRCs && hf->SectorChksums != NULL)
|
|
145
|
+
{
|
|
146
|
+
DWORD dwAdlerExpected = hf->SectorChksums[dwIndex];
|
|
147
|
+
DWORD dwAdlerValue = 0;
|
|
148
|
+
|
|
149
|
+
// We can only check sector CRC when it's not zero
|
|
150
|
+
// Neither can we check it if it's 0xFFFFFFFF.
|
|
151
|
+
if(dwAdlerExpected != 0 && dwAdlerExpected != 0xFFFFFFFF)
|
|
152
|
+
{
|
|
153
|
+
dwAdlerValue = adler32(0, pbInSector, dwRawBytesInThisSector);
|
|
154
|
+
if(dwAdlerValue != dwAdlerExpected)
|
|
155
|
+
{
|
|
156
|
+
dwErrCode = ERROR_CHECKSUM_ERROR;
|
|
157
|
+
break;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
// If the sector is really compressed, decompress it.
|
|
163
|
+
// WARNING : Some sectors may not be compressed, it can be determined only
|
|
164
|
+
// by comparing uncompressed and compressed size !!!
|
|
165
|
+
if(dwRawBytesInThisSector < dwBytesInThisSector)
|
|
166
|
+
{
|
|
167
|
+
if(dwRawBytesInThisSector != 0)
|
|
168
|
+
{
|
|
169
|
+
int cbOutSector = dwBytesInThisSector;
|
|
170
|
+
int cbInSector = dwRawBytesInThisSector;
|
|
171
|
+
int nResult = 0;
|
|
172
|
+
|
|
173
|
+
// Is the file compressed by Blizzard's multiple compression ?
|
|
174
|
+
if(pFileEntry->dwFlags & MPQ_FILE_COMPRESS)
|
|
175
|
+
{
|
|
176
|
+
// Remember the last used compression
|
|
177
|
+
hf->dwCompression0 = pbInSector[0];
|
|
178
|
+
|
|
179
|
+
// Decompress the data. We need to perform MPQ-specific decompression,
|
|
180
|
+
// as multiple Blizzard games may have their own decompression tables
|
|
181
|
+
// and even decompression methods.
|
|
182
|
+
nResult = SCompDecompressX(ha, pbOutSector, &cbOutSector, pbInSector, cbInSector);
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
// Is the file compressed by PKWARE Data Compression Library ?
|
|
186
|
+
else if(pFileEntry->dwFlags & MPQ_FILE_IMPLODE)
|
|
187
|
+
{
|
|
188
|
+
nResult = SCompExplode(pbOutSector, &cbOutSector, pbInSector, cbInSector);
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
// Did the decompression fail ?
|
|
192
|
+
if(nResult == 0)
|
|
193
|
+
{
|
|
194
|
+
dwErrCode = ERROR_FILE_CORRUPT;
|
|
195
|
+
break;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
// Special case (MPQ_2024_v1_300TK2.09p.w3x, file File00010254.blp):
|
|
199
|
+
// Extracted less than required. Fill the rest with zeros
|
|
200
|
+
if((DWORD)(cbOutSector) < dwBytesInThisSector)
|
|
201
|
+
{
|
|
202
|
+
memset(pbOutSector + cbOutSector, 0, dwBytesInThisSector - cbOutSector);
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
else
|
|
206
|
+
{
|
|
207
|
+
memset(pbOutSector, 0, dwBytesInThisSector);
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
else
|
|
211
|
+
{
|
|
212
|
+
if(pbOutSector != pbInSector)
|
|
213
|
+
memcpy(pbOutSector, pbInSector, dwBytesInThisSector);
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
// Move pointers
|
|
217
|
+
dwBytesToRead -= dwBytesInThisSector;
|
|
218
|
+
dwByteOffset += dwBytesInThisSector;
|
|
219
|
+
dwBytesRead += dwBytesInThisSector;
|
|
220
|
+
pbOutSector += dwBytesInThisSector;
|
|
221
|
+
pbInSector += dwRawBytesInThisSector;
|
|
222
|
+
dwSectorsDone++;
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
else
|
|
226
|
+
{
|
|
227
|
+
dwErrCode = GetLastError();
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
// Free all used buffers
|
|
231
|
+
if(pbRawSector != NULL)
|
|
232
|
+
STORM_FREE(pbRawSector);
|
|
233
|
+
|
|
234
|
+
// Give the caller thenumber of bytes read
|
|
235
|
+
*pdwBytesRead = dwBytesRead;
|
|
236
|
+
return dwErrCode;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
static DWORD ReadMpqFileSingleUnit(TMPQFile * hf, void * pvBuffer, DWORD dwFilePos, DWORD dwToRead, LPDWORD pdwBytesRead)
|
|
240
|
+
{
|
|
241
|
+
ULONGLONG RawFilePos = hf->RawFilePos;
|
|
242
|
+
TMPQArchive * ha = hf->ha;
|
|
243
|
+
TFileEntry * pFileEntry = hf->pFileEntry;
|
|
244
|
+
LPBYTE pbCompressed = NULL;
|
|
245
|
+
LPBYTE pbRawData;
|
|
246
|
+
DWORD dwErrCode = ERROR_SUCCESS;
|
|
247
|
+
|
|
248
|
+
// If the file buffer is not allocated yet, do it.
|
|
249
|
+
if(hf->pbFileSector == NULL)
|
|
250
|
+
{
|
|
251
|
+
dwErrCode = AllocateSectorBuffer(hf);
|
|
252
|
+
if(dwErrCode != ERROR_SUCCESS || hf->pbFileSector == NULL)
|
|
253
|
+
return dwErrCode;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
// If the file is a patch file, adjust raw data offset
|
|
257
|
+
if(hf->pPatchInfo != NULL)
|
|
258
|
+
RawFilePos += hf->pPatchInfo->dwLength;
|
|
259
|
+
pbRawData = hf->pbFileSector;
|
|
260
|
+
|
|
261
|
+
// If the file sector is not loaded yet, do it
|
|
262
|
+
if(hf->dwSectorOffs != 0)
|
|
263
|
+
{
|
|
264
|
+
DWORD cbRawData = hf->dwDataSize;
|
|
265
|
+
|
|
266
|
+
// Is the file compressed?
|
|
267
|
+
if(pFileEntry->dwFlags & MPQ_FILE_COMPRESS_MASK)
|
|
268
|
+
{
|
|
269
|
+
// Allocate space for compressed data
|
|
270
|
+
pbCompressed = STORM_ALLOC(BYTE, pFileEntry->dwCmpSize);
|
|
271
|
+
if(pbCompressed == NULL)
|
|
272
|
+
return ERROR_NOT_ENOUGH_MEMORY;
|
|
273
|
+
|
|
274
|
+
// Redirect reading
|
|
275
|
+
pbRawData = pbCompressed;
|
|
276
|
+
cbRawData = pFileEntry->dwCmpSize;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
// Load the raw (compressed, encrypted) data
|
|
280
|
+
if(!FileStream_Read(ha->pStream, &RawFilePos, pbRawData, cbRawData))
|
|
281
|
+
{
|
|
282
|
+
STORM_FREE(pbCompressed);
|
|
283
|
+
return GetLastError();
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
// If the file is encrypted, we have to decrypt the data first
|
|
287
|
+
if(pFileEntry->dwFlags & MPQ_FILE_ENCRYPTED)
|
|
288
|
+
{
|
|
289
|
+
BSWAP_ARRAY32_UNSIGNED(pbRawData, pFileEntry->dwCmpSize);
|
|
290
|
+
DecryptMpqBlock(pbRawData, pFileEntry->dwCmpSize, hf->dwFileKey);
|
|
291
|
+
BSWAP_ARRAY32_UNSIGNED(pbRawData, pFileEntry->dwCmpSize);
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
// If the file is compressed, we have to decompress it now
|
|
295
|
+
if(pFileEntry->dwFlags & MPQ_FILE_COMPRESS_MASK)
|
|
296
|
+
{
|
|
297
|
+
int cbOutBuffer = (int)hf->dwDataSize;
|
|
298
|
+
int cbInBuffer = (int)pFileEntry->dwCmpSize;
|
|
299
|
+
int nResult = 0;
|
|
300
|
+
|
|
301
|
+
//
|
|
302
|
+
// If the file is an incremental patch, the size of compressed data
|
|
303
|
+
// is determined as pFileEntry->dwCmpSize - sizeof(TPatchInfo)
|
|
304
|
+
//
|
|
305
|
+
// In "wow-update-12694.MPQ" from Wow-Cataclysm BETA:
|
|
306
|
+
//
|
|
307
|
+
// File CmprSize DcmpSize DataSize Compressed?
|
|
308
|
+
// -------------------------------------- ---------- -------- -------- ---------------
|
|
309
|
+
// esES\DBFilesClient\LightSkyBox.dbc 0xBE->0xA2 0xBC 0xBC Yes
|
|
310
|
+
// deDE\DBFilesClient\MountCapability.dbc 0x93->0x77 0x77 0x77 No
|
|
311
|
+
//
|
|
312
|
+
|
|
313
|
+
if(pFileEntry->dwFlags & MPQ_FILE_PATCH_FILE)
|
|
314
|
+
cbInBuffer = cbInBuffer - sizeof(TPatchInfo);
|
|
315
|
+
|
|
316
|
+
// Is the file compressed by Blizzard's multiple compression ?
|
|
317
|
+
if(pFileEntry->dwFlags & MPQ_FILE_COMPRESS)
|
|
318
|
+
{
|
|
319
|
+
// Remember the last used compression
|
|
320
|
+
hf->dwCompression0 = pbRawData[0];
|
|
321
|
+
|
|
322
|
+
// Decompress the file
|
|
323
|
+
if(ha->pHeader->wFormatVersion >= MPQ_FORMAT_VERSION_2)
|
|
324
|
+
nResult = SCompDecompress2(hf->pbFileSector, &cbOutBuffer, pbRawData, cbInBuffer);
|
|
325
|
+
else
|
|
326
|
+
nResult = SCompDecompress(hf->pbFileSector, &cbOutBuffer, pbRawData, cbInBuffer);
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
// Is the file compressed by PKWARE Data Compression Library ?
|
|
330
|
+
// Note: Single unit files compressed with IMPLODE are not supported by Blizzard
|
|
331
|
+
else if(pFileEntry->dwFlags & MPQ_FILE_IMPLODE)
|
|
332
|
+
nResult = SCompExplode(hf->pbFileSector, &cbOutBuffer, pbRawData, cbInBuffer);
|
|
333
|
+
|
|
334
|
+
dwErrCode = (nResult != 0) ? ERROR_SUCCESS : ERROR_FILE_CORRUPT;
|
|
335
|
+
}
|
|
336
|
+
else
|
|
337
|
+
{
|
|
338
|
+
if(hf->pbFileSector != NULL && pbRawData != hf->pbFileSector)
|
|
339
|
+
memcpy(hf->pbFileSector, pbRawData, hf->dwDataSize);
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
// Free the decompression buffer.
|
|
343
|
+
if(pbCompressed != NULL)
|
|
344
|
+
STORM_FREE(pbCompressed);
|
|
345
|
+
|
|
346
|
+
// The file sector is now properly loaded
|
|
347
|
+
hf->dwSectorOffs = 0;
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
// At this moment, we have the file loaded into the file buffer.
|
|
351
|
+
// Copy as much as the caller wants
|
|
352
|
+
if(dwErrCode == ERROR_SUCCESS && hf->dwSectorOffs == 0)
|
|
353
|
+
{
|
|
354
|
+
// File position is greater or equal to file size ?
|
|
355
|
+
if(dwFilePos >= hf->dwDataSize)
|
|
356
|
+
{
|
|
357
|
+
*pdwBytesRead = 0;
|
|
358
|
+
return ERROR_SUCCESS;
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
// If not enough bytes remaining in the file, cut them
|
|
362
|
+
if((hf->dwDataSize - dwFilePos) < dwToRead)
|
|
363
|
+
dwToRead = (hf->dwDataSize - dwFilePos);
|
|
364
|
+
|
|
365
|
+
// Copy the bytes
|
|
366
|
+
memcpy(pvBuffer, hf->pbFileSector + dwFilePos, dwToRead);
|
|
367
|
+
|
|
368
|
+
// Give the number of bytes read
|
|
369
|
+
*pdwBytesRead = dwToRead;
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
// An error, sorry
|
|
373
|
+
return dwErrCode;
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
static DWORD ReadMpkFileSingleUnit(TMPQFile * hf, void * pvBuffer, DWORD dwFilePos, DWORD dwToRead, LPDWORD pdwBytesRead)
|
|
377
|
+
{
|
|
378
|
+
ULONGLONG RawFilePos = hf->RawFilePos + 0x0C; // For some reason, MPK files start at position (hf->RawFilePos + 0x0C)
|
|
379
|
+
TMPQArchive * ha = hf->ha;
|
|
380
|
+
TFileEntry * pFileEntry = hf->pFileEntry;
|
|
381
|
+
LPBYTE pbCompressed = NULL;
|
|
382
|
+
LPBYTE pbRawData = hf->pbFileSector;
|
|
383
|
+
DWORD dwErrCode = ERROR_SUCCESS;
|
|
384
|
+
|
|
385
|
+
// We do not support patch files in MPK archives
|
|
386
|
+
assert(hf->pPatchInfo == NULL);
|
|
387
|
+
|
|
388
|
+
// If the file buffer is not allocated yet, do it.
|
|
389
|
+
if(hf->pbFileSector == NULL)
|
|
390
|
+
{
|
|
391
|
+
dwErrCode = AllocateSectorBuffer(hf);
|
|
392
|
+
if(dwErrCode != ERROR_SUCCESS || hf->pbFileSector == NULL)
|
|
393
|
+
return dwErrCode;
|
|
394
|
+
pbRawData = hf->pbFileSector;
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
// If the file sector is not loaded yet, do it
|
|
398
|
+
if(hf->dwSectorOffs != 0)
|
|
399
|
+
{
|
|
400
|
+
// Is the file compressed?
|
|
401
|
+
if(pFileEntry->dwFlags & MPQ_FILE_COMPRESS_MASK)
|
|
402
|
+
{
|
|
403
|
+
// Allocate space for compressed data
|
|
404
|
+
pbCompressed = STORM_ALLOC(BYTE, pFileEntry->dwCmpSize);
|
|
405
|
+
if(pbCompressed == NULL)
|
|
406
|
+
return ERROR_NOT_ENOUGH_MEMORY;
|
|
407
|
+
pbRawData = pbCompressed;
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
// Load the raw (compressed, encrypted) data
|
|
411
|
+
if(!FileStream_Read(ha->pStream, &RawFilePos, pbRawData, pFileEntry->dwCmpSize))
|
|
412
|
+
{
|
|
413
|
+
STORM_FREE(pbCompressed);
|
|
414
|
+
return GetLastError();
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
// If the file is encrypted, we have to decrypt the data first
|
|
418
|
+
if(pFileEntry->dwFlags & MPQ_FILE_ENCRYPTED)
|
|
419
|
+
{
|
|
420
|
+
DecryptMpkTable(pbRawData, pFileEntry->dwCmpSize);
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
// If the file is compressed, we have to decompress it now on
|
|
424
|
+
if(pFileEntry->dwFlags & MPQ_FILE_COMPRESS_MASK)
|
|
425
|
+
{
|
|
426
|
+
int cbOutBuffer = (int)hf->dwDataSize;
|
|
427
|
+
|
|
428
|
+
hf->dwCompression0 = pbRawData[0];
|
|
429
|
+
if(!SCompDecompressMpk(hf->pbFileSector, &cbOutBuffer, pbRawData, (int)pFileEntry->dwCmpSize))
|
|
430
|
+
dwErrCode = ERROR_FILE_CORRUPT;
|
|
431
|
+
}
|
|
432
|
+
else
|
|
433
|
+
{
|
|
434
|
+
if(pbRawData != hf->pbFileSector)
|
|
435
|
+
memcpy(hf->pbFileSector, pbRawData, hf->dwDataSize);
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
// Free the decompression buffer.
|
|
439
|
+
if(pbCompressed != NULL)
|
|
440
|
+
STORM_FREE(pbCompressed);
|
|
441
|
+
|
|
442
|
+
// The file sector is now properly loaded
|
|
443
|
+
hf->dwSectorOffs = 0;
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
// At this moment, we have the file loaded into the file buffer.
|
|
447
|
+
// Copy as much as the caller wants
|
|
448
|
+
if(dwErrCode == ERROR_SUCCESS && hf->dwSectorOffs == 0)
|
|
449
|
+
{
|
|
450
|
+
// File position is greater or equal to file size ?
|
|
451
|
+
if(dwFilePos >= hf->dwDataSize)
|
|
452
|
+
{
|
|
453
|
+
*pdwBytesRead = 0;
|
|
454
|
+
return ERROR_SUCCESS;
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
// If not enough bytes remaining in the file, cut them
|
|
458
|
+
if((hf->dwDataSize - dwFilePos) < dwToRead)
|
|
459
|
+
dwToRead = (hf->dwDataSize - dwFilePos);
|
|
460
|
+
|
|
461
|
+
// Copy the bytes
|
|
462
|
+
memcpy(pvBuffer, hf->pbFileSector + dwFilePos, dwToRead);
|
|
463
|
+
|
|
464
|
+
// Give the number of bytes read
|
|
465
|
+
*pdwBytesRead = dwToRead;
|
|
466
|
+
return ERROR_SUCCESS;
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
// An error, sorry
|
|
470
|
+
return ERROR_CAN_NOT_COMPLETE;
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
|
|
474
|
+
static DWORD ReadMpqFileSectorFile(TMPQFile * hf, void * pvBuffer, DWORD dwFilePos, DWORD dwBytesToRead, LPDWORD pdwBytesRead)
|
|
475
|
+
{
|
|
476
|
+
TMPQArchive * ha = hf->ha;
|
|
477
|
+
LPBYTE pbBuffer = (BYTE *)pvBuffer;
|
|
478
|
+
DWORD dwTotalBytesRead = 0; // Total bytes read in all three parts
|
|
479
|
+
DWORD dwSectorSizeMask = ha->dwSectorSize - 1; // Mask for block size, usually 0x0FFF
|
|
480
|
+
DWORD dwFileSectorPos; // File offset of the loaded sector
|
|
481
|
+
DWORD dwBytesRead; // Number of bytes read (temporary variable)
|
|
482
|
+
DWORD dwErrCode;
|
|
483
|
+
|
|
484
|
+
// If the file position is at or beyond end of file, do nothing
|
|
485
|
+
if(dwFilePos >= hf->dwDataSize)
|
|
486
|
+
{
|
|
487
|
+
*pdwBytesRead = 0;
|
|
488
|
+
return ERROR_SUCCESS;
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
// If not enough bytes in the file remaining, cut them
|
|
492
|
+
if(dwBytesToRead > (hf->dwDataSize - dwFilePos))
|
|
493
|
+
dwBytesToRead = (hf->dwDataSize - dwFilePos);
|
|
494
|
+
|
|
495
|
+
// Compute sector position in the file
|
|
496
|
+
dwFileSectorPos = dwFilePos & ~dwSectorSizeMask; // Position in the block
|
|
497
|
+
|
|
498
|
+
// If the file sector buffer is not allocated yet, do it now
|
|
499
|
+
if(hf->pbFileSector == NULL)
|
|
500
|
+
{
|
|
501
|
+
dwErrCode = AllocateSectorBuffer(hf);
|
|
502
|
+
if(dwErrCode != ERROR_SUCCESS || hf->pbFileSector == NULL)
|
|
503
|
+
return dwErrCode;
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
// Load the first (incomplete) file sector
|
|
507
|
+
if(dwFilePos & dwSectorSizeMask)
|
|
508
|
+
{
|
|
509
|
+
DWORD dwBytesInSector = ha->dwSectorSize;
|
|
510
|
+
DWORD dwBufferOffs = dwFilePos & dwSectorSizeMask;
|
|
511
|
+
DWORD dwToCopy;
|
|
512
|
+
|
|
513
|
+
// Is the file sector already loaded ?
|
|
514
|
+
if(hf->dwSectorOffs != dwFileSectorPos)
|
|
515
|
+
{
|
|
516
|
+
// Load one MPQ sector into archive buffer
|
|
517
|
+
dwErrCode = ReadMpqSectors(hf, hf->pbFileSector, dwFileSectorPos, ha->dwSectorSize, &dwBytesInSector);
|
|
518
|
+
if(dwErrCode != ERROR_SUCCESS)
|
|
519
|
+
return dwErrCode;
|
|
520
|
+
|
|
521
|
+
// Remember that the data loaded to the sector have new file offset
|
|
522
|
+
hf->dwSectorOffs = dwFileSectorPos;
|
|
523
|
+
}
|
|
524
|
+
else
|
|
525
|
+
{
|
|
526
|
+
if((dwFileSectorPos + dwBytesInSector) > hf->dwDataSize)
|
|
527
|
+
dwBytesInSector = hf->dwDataSize - dwFileSectorPos;
|
|
528
|
+
}
|
|
529
|
+
|
|
530
|
+
// Copy the data from the offset in the loaded sector to the end of the sector
|
|
531
|
+
dwToCopy = dwBytesInSector - dwBufferOffs;
|
|
532
|
+
if(dwToCopy > dwBytesToRead)
|
|
533
|
+
dwToCopy = dwBytesToRead;
|
|
534
|
+
|
|
535
|
+
// Copy data from sector buffer into target buffer
|
|
536
|
+
memcpy(pbBuffer, hf->pbFileSector + dwBufferOffs, dwToCopy);
|
|
537
|
+
|
|
538
|
+
// Update pointers and byte counts
|
|
539
|
+
dwTotalBytesRead += dwToCopy;
|
|
540
|
+
dwFileSectorPos += dwBytesInSector;
|
|
541
|
+
pbBuffer += dwToCopy;
|
|
542
|
+
dwBytesToRead -= dwToCopy;
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
// Load the whole ("middle") sectors only if there is at least one full sector to be read
|
|
546
|
+
if(dwBytesToRead >= ha->dwSectorSize)
|
|
547
|
+
{
|
|
548
|
+
DWORD dwBlockBytes = dwBytesToRead & ~dwSectorSizeMask;
|
|
549
|
+
|
|
550
|
+
// Load all sectors to the output buffer
|
|
551
|
+
dwErrCode = ReadMpqSectors(hf, pbBuffer, dwFileSectorPos, dwBlockBytes, &dwBytesRead);
|
|
552
|
+
if(dwErrCode != ERROR_SUCCESS)
|
|
553
|
+
return dwErrCode;
|
|
554
|
+
|
|
555
|
+
// Update pointers
|
|
556
|
+
dwTotalBytesRead += dwBytesRead;
|
|
557
|
+
dwFileSectorPos += dwBytesRead;
|
|
558
|
+
pbBuffer += dwBytesRead;
|
|
559
|
+
dwBytesToRead -= dwBytesRead;
|
|
560
|
+
}
|
|
561
|
+
|
|
562
|
+
// Read the terminating sector
|
|
563
|
+
if(dwBytesToRead > 0)
|
|
564
|
+
{
|
|
565
|
+
DWORD dwToCopy = ha->dwSectorSize;
|
|
566
|
+
|
|
567
|
+
// Is the file sector already loaded ?
|
|
568
|
+
if(hf->dwSectorOffs != dwFileSectorPos)
|
|
569
|
+
{
|
|
570
|
+
// Load one MPQ sector into archive buffer
|
|
571
|
+
dwErrCode = ReadMpqSectors(hf, hf->pbFileSector, dwFileSectorPos, ha->dwSectorSize, &dwBytesRead);
|
|
572
|
+
if(dwErrCode != ERROR_SUCCESS)
|
|
573
|
+
return dwErrCode;
|
|
574
|
+
|
|
575
|
+
// Remember that the data loaded to the sector have new file offset
|
|
576
|
+
hf->dwSectorOffs = dwFileSectorPos;
|
|
577
|
+
}
|
|
578
|
+
|
|
579
|
+
// Check number of bytes read
|
|
580
|
+
if(dwToCopy > dwBytesToRead)
|
|
581
|
+
dwToCopy = dwBytesToRead;
|
|
582
|
+
|
|
583
|
+
// Copy the data from the cached last sector to the caller's buffer
|
|
584
|
+
memcpy(pbBuffer, hf->pbFileSector, dwToCopy);
|
|
585
|
+
|
|
586
|
+
// Update pointers
|
|
587
|
+
dwTotalBytesRead += dwToCopy;
|
|
588
|
+
}
|
|
589
|
+
|
|
590
|
+
// Store total number of bytes read to the caller
|
|
591
|
+
*pdwBytesRead = dwTotalBytesRead;
|
|
592
|
+
return ERROR_SUCCESS;
|
|
593
|
+
}
|
|
594
|
+
|
|
595
|
+
static DWORD ReadMpqFilePatchFile(TMPQFile * hf, void * pvBuffer, DWORD dwFilePos, DWORD dwToRead, LPDWORD pdwBytesRead)
|
|
596
|
+
{
|
|
597
|
+
TMPQPatcher Patcher;
|
|
598
|
+
DWORD dwBytesToRead = dwToRead;
|
|
599
|
+
DWORD dwBytesRead = 0;
|
|
600
|
+
DWORD dwErrCode = ERROR_SUCCESS;
|
|
601
|
+
|
|
602
|
+
// Make sure that the patch file is loaded completely
|
|
603
|
+
if(dwErrCode == ERROR_SUCCESS && hf->pbFileData == NULL)
|
|
604
|
+
{
|
|
605
|
+
// Initialize patching process and allocate data
|
|
606
|
+
dwErrCode = Patch_InitPatcher(&Patcher, hf);
|
|
607
|
+
if(dwErrCode != ERROR_SUCCESS)
|
|
608
|
+
return dwErrCode;
|
|
609
|
+
|
|
610
|
+
// Set the current data size
|
|
611
|
+
Patcher.cbFileData = hf->pFileEntry->dwFileSize;
|
|
612
|
+
|
|
613
|
+
// Initialize the patcher object with initial file data
|
|
614
|
+
if(hf->pFileEntry->dwFlags & MPQ_FILE_SINGLE_UNIT)
|
|
615
|
+
dwErrCode = ReadMpqFileSingleUnit(hf, Patcher.pbFileData1, 0, Patcher.cbFileData, &dwBytesRead);
|
|
616
|
+
else
|
|
617
|
+
dwErrCode = ReadMpqFileSectorFile(hf, Patcher.pbFileData1, 0, Patcher.cbFileData, &dwBytesRead);
|
|
618
|
+
|
|
619
|
+
// Perform the patching process
|
|
620
|
+
if(dwErrCode == ERROR_SUCCESS)
|
|
621
|
+
dwErrCode = Patch_Process(&Patcher, hf);
|
|
622
|
+
|
|
623
|
+
// Finalize the patcher structure
|
|
624
|
+
Patch_Finalize(&Patcher);
|
|
625
|
+
dwBytesRead = 0;
|
|
626
|
+
}
|
|
627
|
+
|
|
628
|
+
// If there is something to read, do it
|
|
629
|
+
if(dwErrCode == ERROR_SUCCESS)
|
|
630
|
+
{
|
|
631
|
+
if(dwFilePos < hf->cbFileData)
|
|
632
|
+
{
|
|
633
|
+
// Make sure we don't copy more than file size
|
|
634
|
+
if((dwFilePos + dwToRead) > hf->cbFileData)
|
|
635
|
+
dwToRead = hf->cbFileData - dwFilePos;
|
|
636
|
+
|
|
637
|
+
// Copy the appropriate amount of the file data to the caller's buffer
|
|
638
|
+
memcpy(pvBuffer, hf->pbFileData + dwFilePos, dwToRead);
|
|
639
|
+
dwBytesRead = dwToRead;
|
|
640
|
+
}
|
|
641
|
+
|
|
642
|
+
// Set the proper error code
|
|
643
|
+
dwErrCode = (dwBytesRead == dwBytesToRead) ? ERROR_SUCCESS : ERROR_HANDLE_EOF;
|
|
644
|
+
}
|
|
645
|
+
|
|
646
|
+
// Give the result to the caller
|
|
647
|
+
if(pdwBytesRead != NULL)
|
|
648
|
+
*pdwBytesRead = dwBytesRead;
|
|
649
|
+
return dwErrCode;
|
|
650
|
+
}
|
|
651
|
+
|
|
652
|
+
static DWORD ReadMpqFileLocalFile(TMPQFile * hf, void * pvBuffer, DWORD dwFilePos, DWORD dwToRead, LPDWORD pdwBytesRead)
|
|
653
|
+
{
|
|
654
|
+
ULONGLONG FilePosition1 = dwFilePos;
|
|
655
|
+
ULONGLONG FilePosition2;
|
|
656
|
+
DWORD dwBytesRead = 0;
|
|
657
|
+
DWORD dwErrCode = ERROR_SUCCESS;
|
|
658
|
+
|
|
659
|
+
assert(hf->pStream != NULL);
|
|
660
|
+
|
|
661
|
+
// Because stream I/O functions are designed to read
|
|
662
|
+
// "all or nothing", we compare file position before and after,
|
|
663
|
+
// and if they differ, we assume that number of bytes read
|
|
664
|
+
// is the difference between them
|
|
665
|
+
|
|
666
|
+
if(!FileStream_Read(hf->pStream, &FilePosition1, pvBuffer, dwToRead))
|
|
667
|
+
{
|
|
668
|
+
// If not all bytes have been read, then return the number of bytes read
|
|
669
|
+
if((dwErrCode = GetLastError()) == ERROR_HANDLE_EOF)
|
|
670
|
+
{
|
|
671
|
+
FileStream_GetPos(hf->pStream, &FilePosition2);
|
|
672
|
+
dwBytesRead = (DWORD)(FilePosition2 - FilePosition1);
|
|
673
|
+
}
|
|
674
|
+
}
|
|
675
|
+
else
|
|
676
|
+
{
|
|
677
|
+
dwBytesRead = dwToRead;
|
|
678
|
+
}
|
|
679
|
+
|
|
680
|
+
*pdwBytesRead = dwBytesRead;
|
|
681
|
+
return dwErrCode;
|
|
682
|
+
}
|
|
683
|
+
|
|
684
|
+
//-----------------------------------------------------------------------------
|
|
685
|
+
// SFileReadFile
|
|
686
|
+
|
|
687
|
+
bool WINAPI SFileReadFile(HANDLE hFile, void * pvBuffer, DWORD dwToRead, LPDWORD pdwRead, LPOVERLAPPED lpOverlapped)
|
|
688
|
+
{
|
|
689
|
+
TFileEntry * pFileEntry;
|
|
690
|
+
TMPQFile * hf;
|
|
691
|
+
DWORD dwBytesRead = 0; // Number of bytes read
|
|
692
|
+
DWORD dwErrCode = ERROR_SUCCESS;
|
|
693
|
+
|
|
694
|
+
// Always zero the result
|
|
695
|
+
if(pdwRead != NULL)
|
|
696
|
+
*pdwRead = 0;
|
|
697
|
+
lpOverlapped = lpOverlapped;
|
|
698
|
+
|
|
699
|
+
// Check valid parameters
|
|
700
|
+
if((hf = IsValidFileHandle(hFile)) == NULL)
|
|
701
|
+
{
|
|
702
|
+
SetLastError(ERROR_INVALID_HANDLE);
|
|
703
|
+
return false;
|
|
704
|
+
}
|
|
705
|
+
|
|
706
|
+
if(pvBuffer == NULL)
|
|
707
|
+
{
|
|
708
|
+
SetLastError(ERROR_INVALID_PARAMETER);
|
|
709
|
+
return false;
|
|
710
|
+
}
|
|
711
|
+
|
|
712
|
+
// If we didn't load the patch info yet, do it now
|
|
713
|
+
if(hf->pFileEntry != NULL && (hf->pFileEntry->dwFlags & MPQ_FILE_PATCH_FILE) && hf->pPatchInfo == NULL)
|
|
714
|
+
{
|
|
715
|
+
dwErrCode = AllocatePatchInfo(hf, true);
|
|
716
|
+
if(dwErrCode != ERROR_SUCCESS || hf->pPatchInfo == NULL)
|
|
717
|
+
{
|
|
718
|
+
SetLastError(dwErrCode);
|
|
719
|
+
return false;
|
|
720
|
+
}
|
|
721
|
+
}
|
|
722
|
+
|
|
723
|
+
// Clear the last used compression
|
|
724
|
+
pFileEntry = hf->pFileEntry;
|
|
725
|
+
hf->dwCompression0 = 0;
|
|
726
|
+
|
|
727
|
+
// If the file is local file, read the data directly from the stream
|
|
728
|
+
if(hf->pStream != NULL)
|
|
729
|
+
{
|
|
730
|
+
dwErrCode = ReadMpqFileLocalFile(hf, pvBuffer, hf->dwFilePos, dwToRead, &dwBytesRead);
|
|
731
|
+
}
|
|
732
|
+
|
|
733
|
+
// If the file is a patch file, we have to read it special way
|
|
734
|
+
else if(hf->hfPatch != NULL && (pFileEntry->dwFlags & MPQ_FILE_PATCH_FILE) == 0)
|
|
735
|
+
{
|
|
736
|
+
dwErrCode = ReadMpqFilePatchFile(hf, pvBuffer, hf->dwFilePos, dwToRead, &dwBytesRead);
|
|
737
|
+
}
|
|
738
|
+
|
|
739
|
+
// If the archive is a MPK archive, we need special way to read the file
|
|
740
|
+
else if(hf->ha->dwSubType == MPQ_SUBTYPE_MPK)
|
|
741
|
+
{
|
|
742
|
+
dwErrCode = ReadMpkFileSingleUnit(hf, pvBuffer, hf->dwFilePos, dwToRead, &dwBytesRead);
|
|
743
|
+
}
|
|
744
|
+
|
|
745
|
+
// If the file is single unit file, redirect it to read file
|
|
746
|
+
else if(pFileEntry->dwFlags & MPQ_FILE_SINGLE_UNIT)
|
|
747
|
+
{
|
|
748
|
+
dwErrCode = ReadMpqFileSingleUnit(hf, pvBuffer, hf->dwFilePos, dwToRead, &dwBytesRead);
|
|
749
|
+
}
|
|
750
|
+
|
|
751
|
+
// Otherwise read it as sector based MPQ file
|
|
752
|
+
else
|
|
753
|
+
{
|
|
754
|
+
dwErrCode = ReadMpqFileSectorFile(hf, pvBuffer, hf->dwFilePos, dwToRead, &dwBytesRead);
|
|
755
|
+
}
|
|
756
|
+
|
|
757
|
+
// Increment the file position
|
|
758
|
+
hf->dwFilePos += dwBytesRead;
|
|
759
|
+
|
|
760
|
+
// Give the caller the number of bytes read
|
|
761
|
+
if(pdwRead != NULL)
|
|
762
|
+
*pdwRead = dwBytesRead;
|
|
763
|
+
|
|
764
|
+
// If the read operation succeeded, but not full number of bytes was read,
|
|
765
|
+
// set the last error to ERROR_HANDLE_EOF
|
|
766
|
+
if(dwErrCode == ERROR_SUCCESS && (dwBytesRead < dwToRead))
|
|
767
|
+
dwErrCode = ERROR_HANDLE_EOF;
|
|
768
|
+
|
|
769
|
+
// If something failed, set the last error value
|
|
770
|
+
if(dwErrCode != ERROR_SUCCESS)
|
|
771
|
+
SetLastError(dwErrCode);
|
|
772
|
+
return (dwErrCode == ERROR_SUCCESS);
|
|
773
|
+
}
|
|
774
|
+
|
|
775
|
+
//-----------------------------------------------------------------------------
|
|
776
|
+
// SFileGetFileSize
|
|
777
|
+
|
|
778
|
+
DWORD WINAPI SFileGetFileSize(HANDLE hFile, LPDWORD pdwFileSizeHigh)
|
|
779
|
+
{
|
|
780
|
+
ULONGLONG FileSize;
|
|
781
|
+
TMPQFile * hf = (TMPQFile *)hFile;
|
|
782
|
+
|
|
783
|
+
// Validate the file handle before we go on
|
|
784
|
+
if(IsValidFileHandle(hFile))
|
|
785
|
+
{
|
|
786
|
+
// Make sure that the variable is initialized
|
|
787
|
+
FileSize = 0;
|
|
788
|
+
|
|
789
|
+
// If the file is patched file, we have to get the size of the last version
|
|
790
|
+
if(hf->hfPatch != NULL)
|
|
791
|
+
{
|
|
792
|
+
// Walk through the entire patch chain, take the last version
|
|
793
|
+
while(hf != NULL)
|
|
794
|
+
{
|
|
795
|
+
// Get the size of the currently pointed version
|
|
796
|
+
FileSize = hf->pFileEntry->dwFileSize;
|
|
797
|
+
|
|
798
|
+
// Move to the next patch file in the hierarchy
|
|
799
|
+
hf = hf->hfPatch;
|
|
800
|
+
}
|
|
801
|
+
}
|
|
802
|
+
else
|
|
803
|
+
{
|
|
804
|
+
// Is it a local file ?
|
|
805
|
+
if(hf->pStream != NULL)
|
|
806
|
+
{
|
|
807
|
+
FileStream_GetSize(hf->pStream, &FileSize);
|
|
808
|
+
}
|
|
809
|
+
else
|
|
810
|
+
{
|
|
811
|
+
FileSize = hf->dwDataSize;
|
|
812
|
+
}
|
|
813
|
+
}
|
|
814
|
+
|
|
815
|
+
// If opened from archive, return file size
|
|
816
|
+
if(pdwFileSizeHigh != NULL)
|
|
817
|
+
*pdwFileSizeHigh = (DWORD)(FileSize >> 32);
|
|
818
|
+
return (DWORD)FileSize;
|
|
819
|
+
}
|
|
820
|
+
|
|
821
|
+
SetLastError(ERROR_INVALID_HANDLE);
|
|
822
|
+
return SFILE_INVALID_SIZE;
|
|
823
|
+
}
|
|
824
|
+
|
|
825
|
+
DWORD WINAPI SFileSetFilePointer(HANDLE hFile, LONG lFilePos, LONG * plFilePosHigh, DWORD dwMoveMethod)
|
|
826
|
+
{
|
|
827
|
+
TMPQFile * hf = (TMPQFile *)hFile;
|
|
828
|
+
ULONGLONG OldPosition;
|
|
829
|
+
ULONGLONG NewPosition;
|
|
830
|
+
ULONGLONG FileSize;
|
|
831
|
+
ULONGLONG DeltaPos;
|
|
832
|
+
|
|
833
|
+
// If the hFile is not a valid file handle, return an error.
|
|
834
|
+
if(!IsValidFileHandle(hFile))
|
|
835
|
+
{
|
|
836
|
+
SetLastError(ERROR_INVALID_HANDLE);
|
|
837
|
+
return SFILE_INVALID_POS;
|
|
838
|
+
}
|
|
839
|
+
|
|
840
|
+
// Retrieve the file size for handling the limits
|
|
841
|
+
if(hf->pStream != NULL)
|
|
842
|
+
{
|
|
843
|
+
FileStream_GetSize(hf->pStream, &FileSize);
|
|
844
|
+
}
|
|
845
|
+
else
|
|
846
|
+
{
|
|
847
|
+
FileSize = SFileGetFileSize(hFile, NULL);
|
|
848
|
+
}
|
|
849
|
+
|
|
850
|
+
// Handle the NULL and non-NULL values of plFilePosHigh
|
|
851
|
+
// Non-NULL: The DeltaPos is combined from lFilePos and *lpFilePosHigh
|
|
852
|
+
// NULL: The DeltaPos is sign-extended value of lFilePos
|
|
853
|
+
DeltaPos = (plFilePosHigh != NULL) ? MAKE_OFFSET64(plFilePosHigh[0], lFilePos) : (ULONGLONG)(LONGLONG)lFilePos;
|
|
854
|
+
|
|
855
|
+
// Get the relative point where to move from
|
|
856
|
+
switch(dwMoveMethod)
|
|
857
|
+
{
|
|
858
|
+
case FILE_BEGIN:
|
|
859
|
+
|
|
860
|
+
// Move relative to the file begin.
|
|
861
|
+
OldPosition = 0;
|
|
862
|
+
break;
|
|
863
|
+
|
|
864
|
+
case FILE_CURRENT:
|
|
865
|
+
|
|
866
|
+
// Retrieve the current file position
|
|
867
|
+
if(hf->pStream != NULL)
|
|
868
|
+
{
|
|
869
|
+
FileStream_GetPos(hf->pStream, &OldPosition);
|
|
870
|
+
}
|
|
871
|
+
else
|
|
872
|
+
{
|
|
873
|
+
OldPosition = hf->dwFilePos;
|
|
874
|
+
}
|
|
875
|
+
break;
|
|
876
|
+
|
|
877
|
+
case FILE_END:
|
|
878
|
+
|
|
879
|
+
// Move relative to the end of the file
|
|
880
|
+
OldPosition = FileSize;
|
|
881
|
+
break;
|
|
882
|
+
|
|
883
|
+
default:
|
|
884
|
+
SetLastError(ERROR_INVALID_PARAMETER);
|
|
885
|
+
return SFILE_INVALID_POS;
|
|
886
|
+
}
|
|
887
|
+
|
|
888
|
+
// Calculate the new position
|
|
889
|
+
NewPosition = OldPosition + DeltaPos;
|
|
890
|
+
|
|
891
|
+
// If moving backward, don't allow the new position go negative
|
|
892
|
+
if((LONGLONG)DeltaPos < 0)
|
|
893
|
+
{
|
|
894
|
+
if(NewPosition > FileSize) // Position is negative
|
|
895
|
+
{
|
|
896
|
+
SetLastError(ERROR_NEGATIVE_SEEK);
|
|
897
|
+
return SFILE_INVALID_POS;
|
|
898
|
+
}
|
|
899
|
+
}
|
|
900
|
+
|
|
901
|
+
// If moving forward, don't allow the new position go past the end of the file
|
|
902
|
+
else
|
|
903
|
+
{
|
|
904
|
+
if(NewPosition > FileSize)
|
|
905
|
+
NewPosition = FileSize;
|
|
906
|
+
}
|
|
907
|
+
|
|
908
|
+
// Now apply the file pointer to the file
|
|
909
|
+
if(hf->pStream != NULL)
|
|
910
|
+
{
|
|
911
|
+
if(!FileStream_Read(hf->pStream, &NewPosition, NULL, 0))
|
|
912
|
+
return SFILE_INVALID_POS;
|
|
913
|
+
}
|
|
914
|
+
|
|
915
|
+
// Also, store the new file position to the TMPQFile struct
|
|
916
|
+
hf->dwFilePos = (DWORD)NewPosition;
|
|
917
|
+
|
|
918
|
+
// Return the new file position
|
|
919
|
+
if(plFilePosHigh != NULL)
|
|
920
|
+
*plFilePosHigh = (LONG)(NewPosition >> 32);
|
|
921
|
+
return (DWORD)NewPosition;
|
|
922
|
+
}
|