stormlib 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (624) hide show
  1. checksums.yaml +4 -4
  2. data/ext/stormlib/StormLib/CMakeFiles/3.22.1/CMakeCCompiler.cmake +72 -0
  3. data/ext/stormlib/StormLib/CMakeFiles/3.22.1/CMakeCXXCompiler.cmake +83 -0
  4. data/ext/stormlib/StormLib/CMakeFiles/3.22.1/CMakeDetermineCompilerABI_C.bin +0 -0
  5. data/ext/stormlib/StormLib/CMakeFiles/3.22.1/CMakeDetermineCompilerABI_CXX.bin +0 -0
  6. data/ext/stormlib/StormLib/CMakeFiles/3.22.1/CMakeSystem.cmake +15 -0
  7. data/ext/stormlib/StormLib/CMakeFiles/3.22.1/CompilerIdC/CMakeCCompilerId.c +803 -0
  8. data/ext/stormlib/StormLib/CMakeFiles/3.22.1/CompilerIdC/a.out +0 -0
  9. data/ext/stormlib/StormLib/CMakeFiles/3.22.1/CompilerIdCXX/CMakeCXXCompilerId.cpp +791 -0
  10. data/ext/stormlib/StormLib/CMakeFiles/3.22.1/CompilerIdCXX/a.out +0 -0
  11. data/ext/stormlib/StormLib/CMakeFiles/CMakeDirectoryInformation.cmake +16 -0
  12. data/ext/stormlib/StormLib/CMakeFiles/CMakeOutput.log +478 -0
  13. data/ext/stormlib/StormLib/CMakeFiles/Export/share/StormLib/StormLibConfig-noconfig.cmake +19 -0
  14. data/ext/stormlib/StormLib/CMakeFiles/Export/share/StormLib/StormLibConfig.cmake +99 -0
  15. data/ext/stormlib/StormLib/CMakeFiles/Makefile.cmake +61 -0
  16. data/ext/stormlib/StormLib/CMakeFiles/Makefile2 +112 -0
  17. data/ext/stormlib/StormLib/CMakeFiles/TargetDirectories.txt +9 -0
  18. data/ext/stormlib/StormLib/CMakeFiles/cmake.check_cache +1 -0
  19. data/ext/stormlib/StormLib/CMakeFiles/progress.marks +1 -0
  20. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/DependInfo.cmake +243 -0
  21. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/build.make +3695 -0
  22. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/cmake_clean.cmake +459 -0
  23. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/cmake_clean_target.cmake +3 -0
  24. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/compiler_depend.make +2 -0
  25. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/compiler_depend.ts +2 -0
  26. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/depend.make +2 -0
  27. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/flags.make +17 -0
  28. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/link.txt +2 -0
  29. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/progress.make +227 -0
  30. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/FileStream.cpp.o.d +160 -0
  31. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/SBaseCommon.cpp.o.d +159 -0
  32. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/SBaseDumpData.cpp.o.d +159 -0
  33. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/SBaseFileTable.cpp.o.d +159 -0
  34. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/SBaseSubTypes.cpp.o.d +159 -0
  35. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/SCompression.cpp.o.d +159 -0
  36. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/SFileAddFile.cpp.o.d +159 -0
  37. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/SFileAttributes.cpp.o.d +159 -0
  38. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/SFileCompactArchive.cpp.o.d +159 -0
  39. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/SFileCreateArchive.cpp.o.d +159 -0
  40. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/SFileExtractFile.cpp.o.d +159 -0
  41. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/SFileFindFile.cpp.o.d +159 -0
  42. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/SFileGetFileInfo.cpp.o.d +159 -0
  43. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/SFileListFile.cpp.o.d +159 -0
  44. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/SFileOpenArchive.cpp.o.d +159 -0
  45. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/SFileOpenFileEx.cpp.o.d +159 -0
  46. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/SFilePatchArchives.cpp.o.d +159 -0
  47. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/SFileReadFile.cpp.o.d +159 -0
  48. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/SFileVerify.cpp.o.d +159 -0
  49. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/adpcm/adpcm.cpp.o.d +12 -0
  50. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/huffman/huff.cpp.o.d +16 -0
  51. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/jenkins/lookup3.c.o.d +88 -0
  52. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/hashes/hash_memory.c.o.d +102 -0
  53. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/hashes/md5.c.o.d +102 -0
  54. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/hashes/sha1.c.o.d +102 -0
  55. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/hashes/sha256.c.o.d +102 -0
  56. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/math/ltm_desc.c.o.d +105 -0
  57. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/math/multi.c.o.d +102 -0
  58. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/math/rand_prime.c.o.d +102 -0
  59. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/misc/base64_decode.c.o.d +102 -0
  60. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/misc/crypt_argchk.c.o.d +102 -0
  61. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/misc/crypt_find_hash.c.o.d +102 -0
  62. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/misc/crypt_find_prng.c.o.d +102 -0
  63. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/misc/crypt_hash_descriptor.c.o.d +102 -0
  64. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/misc/crypt_hash_is_valid.c.o.d +102 -0
  65. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/misc/crypt_libc.c.o.d +102 -0
  66. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/misc/crypt_ltc_mp_descriptor.c.o.d +102 -0
  67. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/misc/crypt_prng_descriptor.c.o.d +102 -0
  68. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/misc/crypt_prng_is_valid.c.o.d +102 -0
  69. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/misc/crypt_register_hash.c.o.d +102 -0
  70. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/misc/crypt_register_prng.c.o.d +102 -0
  71. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/misc/zeromem.c.o.d +102 -0
  72. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/pk/asn1/der_decode_bit_string.c.o.d +102 -0
  73. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/pk/asn1/der_decode_boolean.c.o.d +102 -0
  74. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/pk/asn1/der_decode_choice.c.o.d +102 -0
  75. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/pk/asn1/der_decode_ia5_string.c.o.d +102 -0
  76. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/pk/asn1/der_decode_integer.c.o.d +102 -0
  77. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/pk/asn1/der_decode_object_identifier.c.o.d +102 -0
  78. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/pk/asn1/der_decode_octet_string.c.o.d +102 -0
  79. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/pk/asn1/der_decode_printable_string.c.o.d +102 -0
  80. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/pk/asn1/der_decode_sequence_ex.c.o.d +102 -0
  81. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/pk/asn1/der_decode_sequence_flexi.c.o.d +102 -0
  82. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/pk/asn1/der_decode_sequence_multi.c.o.d +102 -0
  83. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/pk/asn1/der_decode_short_integer.c.o.d +102 -0
  84. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/pk/asn1/der_decode_utctime.c.o.d +102 -0
  85. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/pk/asn1/der_decode_utf8_string.c.o.d +102 -0
  86. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/pk/asn1/der_encode_bit_string.c.o.d +102 -0
  87. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/pk/asn1/der_encode_boolean.c.o.d +102 -0
  88. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/pk/asn1/der_encode_ia5_string.c.o.d +102 -0
  89. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/pk/asn1/der_encode_integer.c.o.d +102 -0
  90. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/pk/asn1/der_encode_object_identifier.c.o.d +102 -0
  91. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/pk/asn1/der_encode_octet_string.c.o.d +102 -0
  92. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/pk/asn1/der_encode_printable_string.c.o.d +102 -0
  93. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/pk/asn1/der_encode_sequence_ex.c.o.d +102 -0
  94. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/pk/asn1/der_encode_sequence_multi.c.o.d +102 -0
  95. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/pk/asn1/der_encode_set.c.o.d +102 -0
  96. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/pk/asn1/der_encode_setof.c.o.d +102 -0
  97. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/pk/asn1/der_encode_short_integer.c.o.d +102 -0
  98. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/pk/asn1/der_encode_utctime.c.o.d +102 -0
  99. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/pk/asn1/der_encode_utf8_string.c.o.d +102 -0
  100. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/pk/asn1/der_length_bit_string.c.o.d +102 -0
  101. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/pk/asn1/der_length_boolean.c.o.d +102 -0
  102. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/pk/asn1/der_length_ia5_string.c.o.d +102 -0
  103. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/pk/asn1/der_length_integer.c.o.d +102 -0
  104. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/pk/asn1/der_length_object_identifier.c.o.d +102 -0
  105. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/pk/asn1/der_length_octet_string.c.o.d +102 -0
  106. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/pk/asn1/der_length_printable_string.c.o.d +102 -0
  107. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/pk/asn1/der_length_sequence.c.o.d +102 -0
  108. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/pk/asn1/der_length_short_integer.c.o.d +102 -0
  109. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/pk/asn1/der_length_utctime.c.o.d +102 -0
  110. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/pk/asn1/der_length_utf8_string.c.o.d +102 -0
  111. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/pk/asn1/der_sequence_free.c.o.d +102 -0
  112. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/pk/ecc/ltc_ecc_map.c.o.d +102 -0
  113. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/pk/ecc/ltc_ecc_mul2add.c.o.d +102 -0
  114. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/pk/ecc/ltc_ecc_mulmod.c.o.d +102 -0
  115. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/pk/ecc/ltc_ecc_points.c.o.d +102 -0
  116. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/pk/ecc/ltc_ecc_projective_add_point.c.o.d +102 -0
  117. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/pk/ecc/ltc_ecc_projective_dbl_point.c.o.d +102 -0
  118. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/pk/pkcs1/pkcs_1_mgf1.c.o.d +102 -0
  119. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/pk/pkcs1/pkcs_1_oaep_decode.c.o.d +102 -0
  120. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/pk/pkcs1/pkcs_1_pss_decode.c.o.d +102 -0
  121. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/pk/pkcs1/pkcs_1_pss_encode.c.o.d +102 -0
  122. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/pk/pkcs1/pkcs_1_v1_5_decode.c.o.d +102 -0
  123. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/pk/pkcs1/pkcs_1_v1_5_encode.c.o.d +102 -0
  124. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/pk/rsa/rsa_exptmod.c.o.d +102 -0
  125. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/pk/rsa/rsa_free.c.o.d +102 -0
  126. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/pk/rsa/rsa_import.c.o.d +102 -0
  127. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/pk/rsa/rsa_make_key.c.o.d +102 -0
  128. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/pk/rsa/rsa_sign_hash.c.o.d +102 -0
  129. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/pk/rsa/rsa_verify_hash.c.o.d +102 -0
  130. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/pk/rsa/rsa_verify_simple.c.o.d +102 -0
  131. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_fast_mp_invmod.c.o.d +65 -0
  132. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_fast_mp_montgomery_reduce.c.o.d +65 -0
  133. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_fast_s_mp_mul_digs.c.o.d +65 -0
  134. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_fast_s_mp_mul_high_digs.c.o.d +65 -0
  135. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_fast_s_mp_sqr.c.o.d +65 -0
  136. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_2expt.c.o.d +65 -0
  137. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_abs.c.o.d +65 -0
  138. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_add.c.o.d +65 -0
  139. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_add_d.c.o.d +65 -0
  140. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_addmod.c.o.d +65 -0
  141. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_and.c.o.d +65 -0
  142. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_clamp.c.o.d +65 -0
  143. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_clear.c.o.d +65 -0
  144. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_clear_multi.c.o.d +65 -0
  145. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_cmp.c.o.d +65 -0
  146. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_cmp_d.c.o.d +65 -0
  147. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_cmp_mag.c.o.d +65 -0
  148. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_cnt_lsb.c.o.d +65 -0
  149. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_copy.c.o.d +65 -0
  150. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_count_bits.c.o.d +65 -0
  151. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_div.c.o.d +65 -0
  152. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_div_2.c.o.d +65 -0
  153. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_div_2d.c.o.d +65 -0
  154. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_div_3.c.o.d +65 -0
  155. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_div_d.c.o.d +65 -0
  156. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_dr_is_modulus.c.o.d +65 -0
  157. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_dr_reduce.c.o.d +65 -0
  158. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_dr_setup.c.o.d +65 -0
  159. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_exch.c.o.d +65 -0
  160. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_expt_d.c.o.d +65 -0
  161. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_exptmod.c.o.d +65 -0
  162. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_exptmod_fast.c.o.d +65 -0
  163. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_exteuclid.c.o.d +65 -0
  164. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_fread.c.o.d +65 -0
  165. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_fwrite.c.o.d +65 -0
  166. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_gcd.c.o.d +65 -0
  167. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_get_int.c.o.d +65 -0
  168. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_grow.c.o.d +65 -0
  169. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_init.c.o.d +65 -0
  170. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_init_copy.c.o.d +65 -0
  171. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_init_multi.c.o.d +65 -0
  172. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_init_set.c.o.d +65 -0
  173. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_init_set_int.c.o.d +65 -0
  174. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_init_size.c.o.d +65 -0
  175. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_invmod.c.o.d +65 -0
  176. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_invmod_slow.c.o.d +65 -0
  177. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_is_square.c.o.d +65 -0
  178. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_jacobi.c.o.d +65 -0
  179. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_karatsuba_mul.c.o.d +65 -0
  180. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_karatsuba_sqr.c.o.d +65 -0
  181. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_lcm.c.o.d +65 -0
  182. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_lshd.c.o.d +65 -0
  183. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_mod.c.o.d +65 -0
  184. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_mod_2d.c.o.d +65 -0
  185. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_mod_d.c.o.d +65 -0
  186. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_montgomery_calc_normalization.c.o.d +65 -0
  187. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_montgomery_reduce.c.o.d +65 -0
  188. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_montgomery_setup.c.o.d +65 -0
  189. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_mul.c.o.d +65 -0
  190. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_mul_2.c.o.d +65 -0
  191. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_mul_2d.c.o.d +65 -0
  192. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_mul_d.c.o.d +65 -0
  193. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_mulmod.c.o.d +65 -0
  194. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_n_root.c.o.d +65 -0
  195. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_neg.c.o.d +65 -0
  196. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_or.c.o.d +65 -0
  197. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_prime_fermat.c.o.d +65 -0
  198. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_prime_is_divisible.c.o.d +65 -0
  199. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_prime_is_prime.c.o.d +65 -0
  200. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_prime_miller_rabin.c.o.d +65 -0
  201. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_prime_next_prime.c.o.d +65 -0
  202. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_prime_rabin_miller_trials.c.o.d +65 -0
  203. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_prime_random_ex.c.o.d +65 -0
  204. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_radix_size.c.o.d +65 -0
  205. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_radix_smap.c.o.d +65 -0
  206. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_rand.c.o.d +65 -0
  207. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_read_radix.c.o.d +65 -0
  208. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_read_signed_bin.c.o.d +65 -0
  209. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_read_unsigned_bin.c.o.d +65 -0
  210. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_reduce.c.o.d +65 -0
  211. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_reduce_2k.c.o.d +65 -0
  212. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_reduce_2k_l.c.o.d +65 -0
  213. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_reduce_2k_setup.c.o.d +65 -0
  214. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_reduce_2k_setup_l.c.o.d +65 -0
  215. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_reduce_is_2k.c.o.d +65 -0
  216. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_reduce_is_2k_l.c.o.d +65 -0
  217. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_reduce_setup.c.o.d +65 -0
  218. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_rshd.c.o.d +65 -0
  219. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_set.c.o.d +65 -0
  220. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_set_int.c.o.d +65 -0
  221. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_shrink.c.o.d +65 -0
  222. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_signed_bin_size.c.o.d +65 -0
  223. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_sqr.c.o.d +65 -0
  224. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_sqrmod.c.o.d +65 -0
  225. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_sqrt.c.o.d +65 -0
  226. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_sub.c.o.d +65 -0
  227. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_sub_d.c.o.d +65 -0
  228. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_submod.c.o.d +65 -0
  229. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_to_signed_bin.c.o.d +65 -0
  230. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_to_signed_bin_n.c.o.d +65 -0
  231. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_to_unsigned_bin.c.o.d +65 -0
  232. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_to_unsigned_bin_n.c.o.d +65 -0
  233. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_toom_mul.c.o.d +65 -0
  234. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_toom_sqr.c.o.d +65 -0
  235. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_toradix.c.o.d +65 -0
  236. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_toradix_n.c.o.d +65 -0
  237. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_unsigned_bin_size.c.o.d +65 -0
  238. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_xor.c.o.d +65 -0
  239. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_mp_zero.c.o.d +65 -0
  240. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_prime_tab.c.o.d +65 -0
  241. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_reverse.c.o.d +65 -0
  242. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_s_mp_add.c.o.d +65 -0
  243. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_s_mp_exptmod.c.o.d +65 -0
  244. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_s_mp_mul_digs.c.o.d +65 -0
  245. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_s_mp_mul_high_digs.c.o.d +65 -0
  246. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_s_mp_sqr.c.o.d +65 -0
  247. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bn_s_mp_sub.c.o.d +65 -0
  248. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/libtommath/bncore.c.o.d +65 -0
  249. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/lzma/C/LzFind.c.o.d +18 -0
  250. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/lzma/C/LzmaDec.c.o.d +17 -0
  251. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/lzma/C/LzmaEnc.c.o.d +18 -0
  252. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/pklib/explode.c.o.d +16 -0
  253. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/pklib/implode.c.o.d +23 -0
  254. data/ext/stormlib/StormLib/CMakeFiles/storm.dir/src/sparse/sparse.cpp.o.d +16 -0
  255. data/ext/stormlib/StormLib/CMakeLists.txt +418 -0
  256. data/ext/stormlib/StormLib/Info.plist +22 -0
  257. data/ext/stormlib/StormLib/LICENSE +21 -0
  258. data/ext/stormlib/StormLib/Premake5.lua +132 -0
  259. data/ext/stormlib/StormLib/README.md +39 -0
  260. data/ext/stormlib/StormLib/StormLib.sln +162 -0
  261. data/ext/stormlib/StormLib/StormLib.vcxproj +1024 -0
  262. data/ext/stormlib/StormLib/StormLib.vcxproj.filters +221 -0
  263. data/ext/stormlib/StormLib/StormLib.xcodeproj/project.pbxproj +2104 -0
  264. data/ext/stormlib/StormLib/StormLib_dll.vcxproj +348 -0
  265. data/ext/stormlib/StormLib/StormLib_dll.vcxproj.filters +229 -0
  266. data/ext/stormlib/StormLib/StormLib_test.vcxproj +360 -0
  267. data/ext/stormlib/StormLib/StormLib_test.vcxproj.filters +230 -0
  268. data/ext/stormlib/StormLib/StormLib_vs08.sln +139 -0
  269. data/ext/stormlib/StormLib/StormLib_vs08.vcproj +4205 -0
  270. data/ext/stormlib/StormLib/StormLib_vs08_dll.vcproj +1851 -0
  271. data/ext/stormlib/StormLib/StormLib_vs08_test.vcproj +1289 -0
  272. data/ext/stormlib/StormLib/doc/History.txt +78 -0
  273. data/ext/stormlib/StormLib/doc/The MoPaQ File Format 0.9.txt +318 -0
  274. data/ext/stormlib/StormLib/doc/The MoPaQ File Format 1.0.txt +433 -0
  275. data/ext/stormlib/StormLib/doc/d3-authenticationcode/d3-authenticationcode-deDE.txt +1 -0
  276. data/ext/stormlib/StormLib/doc/d3-authenticationcode/d3-authenticationcode-enGB.txt +1 -0
  277. data/ext/stormlib/StormLib/doc/d3-authenticationcode/d3-authenticationcode-enSG.txt +1 -0
  278. data/ext/stormlib/StormLib/doc/d3-authenticationcode/d3-authenticationcode-enUS.txt +1 -0
  279. data/ext/stormlib/StormLib/doc/d3-authenticationcode/d3-authenticationcode-esES.txt +1 -0
  280. data/ext/stormlib/StormLib/doc/d3-authenticationcode/d3-authenticationcode-esMX.txt +1 -0
  281. data/ext/stormlib/StormLib/doc/d3-authenticationcode/d3-authenticationcode-frFR.txt +1 -0
  282. data/ext/stormlib/StormLib/doc/d3-authenticationcode/d3-authenticationcode-itIT.txt +1 -0
  283. data/ext/stormlib/StormLib/doc/d3-authenticationcode/d3-authenticationcode-koKR.txt +1 -0
  284. data/ext/stormlib/StormLib/doc/d3-authenticationcode/d3-authenticationcode-plPL.txt +1 -0
  285. data/ext/stormlib/StormLib/doc/d3-authenticationcode/d3-authenticationcode-ptBR.txt +1 -0
  286. data/ext/stormlib/StormLib/doc/d3-authenticationcode/d3-authenticationcode-zhTW.txt +1 -0
  287. data/ext/stormlib/StormLib/doc/hots-authenticationcode/hots-authenticationcode-bgdl.txt +1 -0
  288. data/ext/stormlib/StormLib/doc/sc2-authenticationcode/sc2-authenticationcode-deDE.txt +1 -0
  289. data/ext/stormlib/StormLib/doc/sc2-authenticationcode/sc2-authenticationcode-enGB.txt +1 -0
  290. data/ext/stormlib/StormLib/doc/sc2-authenticationcode/sc2-authenticationcode-enUS.txt +1 -0
  291. data/ext/stormlib/StormLib/doc/sc2-authenticationcode/sc2-authenticationcode-esES.txt +1 -0
  292. data/ext/stormlib/StormLib/doc/sc2-authenticationcode/sc2-authenticationcode-esMX.txt +1 -0
  293. data/ext/stormlib/StormLib/doc/sc2-authenticationcode/sc2-authenticationcode-frFR.txt +1 -0
  294. data/ext/stormlib/StormLib/doc/sc2-authenticationcode/sc2-authenticationcode-itIT.txt +1 -0
  295. data/ext/stormlib/StormLib/doc/sc2-authenticationcode/sc2-authenticationcode-koKR.txt +1 -0
  296. data/ext/stormlib/StormLib/doc/sc2-authenticationcode/sc2-authenticationcode-plPL.txt +1 -0
  297. data/ext/stormlib/StormLib/doc/sc2-authenticationcode/sc2-authenticationcode-ptBR.txt +1 -0
  298. data/ext/stormlib/StormLib/doc/sc2-authenticationcode/sc2-authenticationcode-ruRU.txt +1 -0
  299. data/ext/stormlib/StormLib/doc/sc2-authenticationcode/sc2-authenticationcode-zhTW.txt +1 -0
  300. data/ext/stormlib/StormLib/make-msvc.bat +95 -0
  301. data/ext/stormlib/StormLib/make.bat +46 -0
  302. data/ext/stormlib/StormLib/sources +14 -0
  303. data/ext/stormlib/StormLib/src/DllMain.c +24 -0
  304. data/ext/stormlib/StormLib/src/DllMain.def +79 -0
  305. data/ext/stormlib/StormLib/src/DllMain.rc +110 -0
  306. data/ext/stormlib/StormLib/src/FileStream.cpp +2928 -0
  307. data/ext/stormlib/StormLib/src/FileStream.h +217 -0
  308. data/ext/stormlib/StormLib/src/LibTomCrypt.c +85 -0
  309. data/ext/stormlib/StormLib/src/LibTomMath.c +125 -0
  310. data/ext/stormlib/StormLib/src/LibTomMathDesc.c +4 -0
  311. data/ext/stormlib/StormLib/src/SBaseCommon.cpp +1970 -0
  312. data/ext/stormlib/StormLib/src/SBaseDumpData.cpp +183 -0
  313. data/ext/stormlib/StormLib/src/SBaseFileTable.cpp +3194 -0
  314. data/ext/stormlib/StormLib/src/SBaseSubTypes.cpp +688 -0
  315. data/ext/stormlib/StormLib/src/SCompression.cpp +1183 -0
  316. data/ext/stormlib/StormLib/src/SFileAddFile.cpp +1337 -0
  317. data/ext/stormlib/StormLib/src/SFileAttributes.cpp +573 -0
  318. data/ext/stormlib/StormLib/src/SFileCompactArchive.cpp +654 -0
  319. data/ext/stormlib/StormLib/src/SFileCreateArchive.cpp +285 -0
  320. data/ext/stormlib/StormLib/src/SFileExtractFile.cpp +64 -0
  321. data/ext/stormlib/StormLib/src/SFileFindFile.cpp +484 -0
  322. data/ext/stormlib/StormLib/src/SFileGetFileInfo.cpp +627 -0
  323. data/ext/stormlib/StormLib/src/SFileListFile.cpp +750 -0
  324. data/ext/stormlib/StormLib/src/SFileOpenArchive.cpp +723 -0
  325. data/ext/stormlib/StormLib/src/SFileOpenFileEx.cpp +423 -0
  326. data/ext/stormlib/StormLib/src/SFilePatchArchives.cpp +1175 -0
  327. data/ext/stormlib/StormLib/src/SFileReadFile.cpp +922 -0
  328. data/ext/stormlib/StormLib/src/SFileVerify.cpp +1059 -0
  329. data/ext/stormlib/StormLib/src/StormCommon.h +450 -0
  330. data/ext/stormlib/StormLib/src/StormLib.exp +74 -0
  331. data/ext/stormlib/StormLib/src/StormLib.h +1157 -0
  332. data/ext/stormlib/StormLib/src/StormPort.h +474 -0
  333. data/ext/stormlib/StormLib/src/adpcm/adpcm.cpp +539 -0
  334. data/ext/stormlib/StormLib/src/adpcm/adpcm.h +27 -0
  335. data/ext/stormlib/StormLib/src/bzip2/blocksort.c +1094 -0
  336. data/ext/stormlib/StormLib/src/bzip2/bzlib.c +1573 -0
  337. data/ext/stormlib/StormLib/src/bzip2/bzlib.h +282 -0
  338. data/ext/stormlib/StormLib/src/bzip2/bzlib_private.h +509 -0
  339. data/ext/stormlib/StormLib/src/bzip2/compress.c +672 -0
  340. data/ext/stormlib/StormLib/src/bzip2/crctable.c +104 -0
  341. data/ext/stormlib/StormLib/src/bzip2/decompress.c +626 -0
  342. data/ext/stormlib/StormLib/src/bzip2/huffman.c +205 -0
  343. data/ext/stormlib/StormLib/src/bzip2/randtable.c +84 -0
  344. data/ext/stormlib/StormLib/src/huffman/huff.cpp +915 -0
  345. data/ext/stormlib/StormLib/src/huffman/huff.h +143 -0
  346. data/ext/stormlib/StormLib/src/jenkins/lookup.h +24 -0
  347. data/ext/stormlib/StormLib/src/jenkins/lookup3.c +1003 -0
  348. data/ext/stormlib/StormLib/src/libtomcrypt/src/hashes/hash_memory.c +69 -0
  349. data/ext/stormlib/StormLib/src/libtomcrypt/src/hashes/md5.c +368 -0
  350. data/ext/stormlib/StormLib/src/libtomcrypt/src/hashes/sha1.c +288 -0
  351. data/ext/stormlib/StormLib/src/libtomcrypt/src/hashes/sha256.c +340 -0
  352. data/ext/stormlib/StormLib/src/libtomcrypt/src/headers/tomcrypt.h +91 -0
  353. data/ext/stormlib/StormLib/src/libtomcrypt/src/headers/tomcrypt_argchk.h +38 -0
  354. data/ext/stormlib/StormLib/src/libtomcrypt/src/headers/tomcrypt_cfg.h +144 -0
  355. data/ext/stormlib/StormLib/src/libtomcrypt/src/headers/tomcrypt_cipher.h +891 -0
  356. data/ext/stormlib/StormLib/src/libtomcrypt/src/headers/tomcrypt_custom.h +424 -0
  357. data/ext/stormlib/StormLib/src/libtomcrypt/src/headers/tomcrypt_hash.h +378 -0
  358. data/ext/stormlib/StormLib/src/libtomcrypt/src/headers/tomcrypt_mac.h +384 -0
  359. data/ext/stormlib/StormLib/src/libtomcrypt/src/headers/tomcrypt_macros.h +424 -0
  360. data/ext/stormlib/StormLib/src/libtomcrypt/src/headers/tomcrypt_math.h +500 -0
  361. data/ext/stormlib/StormLib/src/libtomcrypt/src/headers/tomcrypt_misc.h +23 -0
  362. data/ext/stormlib/StormLib/src/libtomcrypt/src/headers/tomcrypt_pk.h +558 -0
  363. data/ext/stormlib/StormLib/src/libtomcrypt/src/headers/tomcrypt_pkcs.h +89 -0
  364. data/ext/stormlib/StormLib/src/libtomcrypt/src/headers/tomcrypt_prng.h +199 -0
  365. data/ext/stormlib/StormLib/src/libtomcrypt/src/math/ltm_desc.c +483 -0
  366. data/ext/stormlib/StormLib/src/libtomcrypt/src/math/multi.c +61 -0
  367. data/ext/stormlib/StormLib/src/libtomcrypt/src/math/rand_prime.c +87 -0
  368. data/ext/stormlib/StormLib/src/libtomcrypt/src/misc/base64_decode.c +104 -0
  369. data/ext/stormlib/StormLib/src/libtomcrypt/src/misc/crypt_argchk.c +30 -0
  370. data/ext/stormlib/StormLib/src/libtomcrypt/src/misc/crypt_find_hash.c +40 -0
  371. data/ext/stormlib/StormLib/src/libtomcrypt/src/misc/crypt_find_prng.c +41 -0
  372. data/ext/stormlib/StormLib/src/libtomcrypt/src/misc/crypt_hash_descriptor.c +27 -0
  373. data/ext/stormlib/StormLib/src/libtomcrypt/src/misc/crypt_hash_is_valid.c +36 -0
  374. data/ext/stormlib/StormLib/src/libtomcrypt/src/misc/crypt_libc.c +43 -0
  375. data/ext/stormlib/StormLib/src/libtomcrypt/src/misc/crypt_ltc_mp_descriptor.c +13 -0
  376. data/ext/stormlib/StormLib/src/libtomcrypt/src/misc/crypt_prng_descriptor.c +26 -0
  377. data/ext/stormlib/StormLib/src/libtomcrypt/src/misc/crypt_prng_is_valid.c +36 -0
  378. data/ext/stormlib/StormLib/src/libtomcrypt/src/misc/crypt_register_hash.c +54 -0
  379. data/ext/stormlib/StormLib/src/libtomcrypt/src/misc/crypt_register_prng.c +54 -0
  380. data/ext/stormlib/StormLib/src/libtomcrypt/src/misc/zeromem.c +34 -0
  381. data/ext/stormlib/StormLib/src/libtomcrypt/src/pk/asn1/der_decode_bit_string.c +102 -0
  382. data/ext/stormlib/StormLib/src/libtomcrypt/src/pk/asn1/der_decode_boolean.c +47 -0
  383. data/ext/stormlib/StormLib/src/libtomcrypt/src/pk/asn1/der_decode_choice.c +182 -0
  384. data/ext/stormlib/StormLib/src/libtomcrypt/src/pk/asn1/der_decode_ia5_string.c +96 -0
  385. data/ext/stormlib/StormLib/src/libtomcrypt/src/pk/asn1/der_decode_integer.c +110 -0
  386. data/ext/stormlib/StormLib/src/libtomcrypt/src/pk/asn1/der_decode_object_identifier.c +99 -0
  387. data/ext/stormlib/StormLib/src/libtomcrypt/src/pk/asn1/der_decode_octet_string.c +91 -0
  388. data/ext/stormlib/StormLib/src/libtomcrypt/src/pk/asn1/der_decode_printable_string.c +96 -0
  389. data/ext/stormlib/StormLib/src/libtomcrypt/src/pk/asn1/der_decode_sequence_ex.c +287 -0
  390. data/ext/stormlib/StormLib/src/libtomcrypt/src/pk/asn1/der_decode_sequence_flexi.c +386 -0
  391. data/ext/stormlib/StormLib/src/libtomcrypt/src/pk/asn1/der_decode_sequence_multi.c +139 -0
  392. data/ext/stormlib/StormLib/src/libtomcrypt/src/pk/asn1/der_decode_short_integer.c +68 -0
  393. data/ext/stormlib/StormLib/src/libtomcrypt/src/pk/asn1/der_decode_utctime.c +127 -0
  394. data/ext/stormlib/StormLib/src/libtomcrypt/src/pk/asn1/der_decode_utf8_string.c +111 -0
  395. data/ext/stormlib/StormLib/src/libtomcrypt/src/pk/asn1/der_encode_bit_string.c +89 -0
  396. data/ext/stormlib/StormLib/src/libtomcrypt/src/pk/asn1/der_encode_boolean.c +51 -0
  397. data/ext/stormlib/StormLib/src/libtomcrypt/src/pk/asn1/der_encode_ia5_string.c +85 -0
  398. data/ext/stormlib/StormLib/src/libtomcrypt/src/pk/asn1/der_encode_integer.c +130 -0
  399. data/ext/stormlib/StormLib/src/libtomcrypt/src/pk/asn1/der_encode_object_identifier.c +111 -0
  400. data/ext/stormlib/StormLib/src/libtomcrypt/src/pk/asn1/der_encode_octet_string.c +86 -0
  401. data/ext/stormlib/StormLib/src/libtomcrypt/src/pk/asn1/der_encode_printable_string.c +85 -0
  402. data/ext/stormlib/StormLib/src/libtomcrypt/src/pk/asn1/der_encode_sequence_ex.c +335 -0
  403. data/ext/stormlib/StormLib/src/libtomcrypt/src/pk/asn1/der_encode_sequence_multi.c +138 -0
  404. data/ext/stormlib/StormLib/src/libtomcrypt/src/pk/asn1/der_encode_set.c +103 -0
  405. data/ext/stormlib/StormLib/src/libtomcrypt/src/pk/asn1/der_encode_setof.c +162 -0
  406. data/ext/stormlib/StormLib/src/libtomcrypt/src/pk/asn1/der_encode_short_integer.c +97 -0
  407. data/ext/stormlib/StormLib/src/libtomcrypt/src/pk/asn1/der_encode_utctime.c +83 -0
  408. data/ext/stormlib/StormLib/src/libtomcrypt/src/pk/asn1/der_encode_utf8_string.c +105 -0
  409. data/ext/stormlib/StormLib/src/libtomcrypt/src/pk/asn1/der_length_bit_string.c +54 -0
  410. data/ext/stormlib/StormLib/src/libtomcrypt/src/pk/asn1/der_length_boolean.c +35 -0
  411. data/ext/stormlib/StormLib/src/libtomcrypt/src/pk/asn1/der_length_ia5_string.c +194 -0
  412. data/ext/stormlib/StormLib/src/libtomcrypt/src/pk/asn1/der_length_integer.c +82 -0
  413. data/ext/stormlib/StormLib/src/libtomcrypt/src/pk/asn1/der_length_object_identifier.c +89 -0
  414. data/ext/stormlib/StormLib/src/libtomcrypt/src/pk/asn1/der_length_octet_string.c +53 -0
  415. data/ext/stormlib/StormLib/src/libtomcrypt/src/pk/asn1/der_length_printable_string.c +166 -0
  416. data/ext/stormlib/StormLib/src/libtomcrypt/src/pk/asn1/der_length_sequence.c +169 -0
  417. data/ext/stormlib/StormLib/src/libtomcrypt/src/pk/asn1/der_length_short_integer.c +70 -0
  418. data/ext/stormlib/StormLib/src/libtomcrypt/src/pk/asn1/der_length_utctime.c +46 -0
  419. data/ext/stormlib/StormLib/src/libtomcrypt/src/pk/asn1/der_length_utf8_string.c +83 -0
  420. data/ext/stormlib/StormLib/src/libtomcrypt/src/pk/asn1/der_sequence_free.c +65 -0
  421. data/ext/stormlib/StormLib/src/libtomcrypt/src/pk/ecc/ltc_ecc_map.c +76 -0
  422. data/ext/stormlib/StormLib/src/libtomcrypt/src/pk/ecc/ltc_ecc_mul2add.c +207 -0
  423. data/ext/stormlib/StormLib/src/libtomcrypt/src/pk/ecc/ltc_ecc_mulmod.c +222 -0
  424. data/ext/stormlib/StormLib/src/libtomcrypt/src/pk/ecc/ltc_ecc_points.c +60 -0
  425. data/ext/stormlib/StormLib/src/libtomcrypt/src/pk/ecc/ltc_ecc_projective_add_point.c +196 -0
  426. data/ext/stormlib/StormLib/src/libtomcrypt/src/pk/ecc/ltc_ecc_projective_dbl_point.c +147 -0
  427. data/ext/stormlib/StormLib/src/libtomcrypt/src/pk/pkcs1/pkcs_1_mgf1.c +108 -0
  428. data/ext/stormlib/StormLib/src/libtomcrypt/src/pk/pkcs1/pkcs_1_oaep_decode.c +189 -0
  429. data/ext/stormlib/StormLib/src/libtomcrypt/src/pk/pkcs1/pkcs_1_pss_decode.c +177 -0
  430. data/ext/stormlib/StormLib/src/libtomcrypt/src/pk/pkcs1/pkcs_1_pss_encode.c +175 -0
  431. data/ext/stormlib/StormLib/src/libtomcrypt/src/pk/pkcs1/pkcs_1_v1_5_decode.c +110 -0
  432. data/ext/stormlib/StormLib/src/libtomcrypt/src/pk/pkcs1/pkcs_1_v1_5_encode.c +111 -0
  433. data/ext/stormlib/StormLib/src/libtomcrypt/src/pk/rsa/rsa_exptmod.c +113 -0
  434. data/ext/stormlib/StormLib/src/libtomcrypt/src/pk/rsa/rsa_free.c +34 -0
  435. data/ext/stormlib/StormLib/src/libtomcrypt/src/pk/rsa/rsa_import.c +143 -0
  436. data/ext/stormlib/StormLib/src/libtomcrypt/src/pk/rsa/rsa_make_key.c +112 -0
  437. data/ext/stormlib/StormLib/src/libtomcrypt/src/pk/rsa/rsa_sign_hash.c +134 -0
  438. data/ext/stormlib/StormLib/src/libtomcrypt/src/pk/rsa/rsa_verify_hash.c +167 -0
  439. data/ext/stormlib/StormLib/src/libtomcrypt/src/pk/rsa/rsa_verify_simple.c +87 -0
  440. data/ext/stormlib/StormLib/src/libtommath/bn_fast_mp_invmod.c +148 -0
  441. data/ext/stormlib/StormLib/src/libtommath/bn_fast_mp_montgomery_reduce.c +172 -0
  442. data/ext/stormlib/StormLib/src/libtommath/bn_fast_s_mp_mul_digs.c +107 -0
  443. data/ext/stormlib/StormLib/src/libtommath/bn_fast_s_mp_mul_high_digs.c +98 -0
  444. data/ext/stormlib/StormLib/src/libtommath/bn_fast_s_mp_sqr.c +114 -0
  445. data/ext/stormlib/StormLib/src/libtommath/bn_mp_2expt.c +48 -0
  446. data/ext/stormlib/StormLib/src/libtommath/bn_mp_abs.c +43 -0
  447. data/ext/stormlib/StormLib/src/libtommath/bn_mp_add.c +53 -0
  448. data/ext/stormlib/StormLib/src/libtommath/bn_mp_add_d.c +112 -0
  449. data/ext/stormlib/StormLib/src/libtommath/bn_mp_addmod.c +41 -0
  450. data/ext/stormlib/StormLib/src/libtommath/bn_mp_and.c +57 -0
  451. data/ext/stormlib/StormLib/src/libtommath/bn_mp_clamp.c +44 -0
  452. data/ext/stormlib/StormLib/src/libtommath/bn_mp_clear.c +44 -0
  453. data/ext/stormlib/StormLib/src/libtommath/bn_mp_clear_multi.c +34 -0
  454. data/ext/stormlib/StormLib/src/libtommath/bn_mp_cmp.c +43 -0
  455. data/ext/stormlib/StormLib/src/libtommath/bn_mp_cmp_d.c +44 -0
  456. data/ext/stormlib/StormLib/src/libtommath/bn_mp_cmp_mag.c +55 -0
  457. data/ext/stormlib/StormLib/src/libtommath/bn_mp_cnt_lsb.c +53 -0
  458. data/ext/stormlib/StormLib/src/libtommath/bn_mp_copy.c +68 -0
  459. data/ext/stormlib/StormLib/src/libtommath/bn_mp_count_bits.c +45 -0
  460. data/ext/stormlib/StormLib/src/libtommath/bn_mp_div.c +292 -0
  461. data/ext/stormlib/StormLib/src/libtommath/bn_mp_div_2.c +68 -0
  462. data/ext/stormlib/StormLib/src/libtommath/bn_mp_div_2d.c +97 -0
  463. data/ext/stormlib/StormLib/src/libtommath/bn_mp_div_3.c +79 -0
  464. data/ext/stormlib/StormLib/src/libtommath/bn_mp_div_d.c +115 -0
  465. data/ext/stormlib/StormLib/src/libtommath/bn_mp_dr_is_modulus.c +43 -0
  466. data/ext/stormlib/StormLib/src/libtommath/bn_mp_dr_reduce.c +94 -0
  467. data/ext/stormlib/StormLib/src/libtommath/bn_mp_dr_setup.c +32 -0
  468. data/ext/stormlib/StormLib/src/libtommath/bn_mp_exch.c +34 -0
  469. data/ext/stormlib/StormLib/src/libtommath/bn_mp_expt_d.c +57 -0
  470. data/ext/stormlib/StormLib/src/libtommath/bn_mp_exptmod.c +112 -0
  471. data/ext/stormlib/StormLib/src/libtommath/bn_mp_exptmod_fast.c +321 -0
  472. data/ext/stormlib/StormLib/src/libtommath/bn_mp_exteuclid.c +82 -0
  473. data/ext/stormlib/StormLib/src/libtommath/bn_mp_fread.c +67 -0
  474. data/ext/stormlib/StormLib/src/libtommath/bn_mp_fwrite.c +52 -0
  475. data/ext/stormlib/StormLib/src/libtommath/bn_mp_gcd.c +105 -0
  476. data/ext/stormlib/StormLib/src/libtommath/bn_mp_get_int.c +45 -0
  477. data/ext/stormlib/StormLib/src/libtommath/bn_mp_grow.c +57 -0
  478. data/ext/stormlib/StormLib/src/libtommath/bn_mp_init.c +46 -0
  479. data/ext/stormlib/StormLib/src/libtommath/bn_mp_init_copy.c +32 -0
  480. data/ext/stormlib/StormLib/src/libtommath/bn_mp_init_multi.c +59 -0
  481. data/ext/stormlib/StormLib/src/libtommath/bn_mp_init_set.c +32 -0
  482. data/ext/stormlib/StormLib/src/libtommath/bn_mp_init_set_int.c +31 -0
  483. data/ext/stormlib/StormLib/src/libtommath/bn_mp_init_size.c +48 -0
  484. data/ext/stormlib/StormLib/src/libtommath/bn_mp_invmod.c +43 -0
  485. data/ext/stormlib/StormLib/src/libtommath/bn_mp_invmod_slow.c +175 -0
  486. data/ext/stormlib/StormLib/src/libtommath/bn_mp_is_square.c +109 -0
  487. data/ext/stormlib/StormLib/src/libtommath/bn_mp_jacobi.c +105 -0
  488. data/ext/stormlib/StormLib/src/libtommath/bn_mp_karatsuba_mul.c +167 -0
  489. data/ext/stormlib/StormLib/src/libtommath/bn_mp_karatsuba_sqr.c +121 -0
  490. data/ext/stormlib/StormLib/src/libtommath/bn_mp_lcm.c +60 -0
  491. data/ext/stormlib/StormLib/src/libtommath/bn_mp_lshd.c +67 -0
  492. data/ext/stormlib/StormLib/src/libtommath/bn_mp_mod.c +48 -0
  493. data/ext/stormlib/StormLib/src/libtommath/bn_mp_mod_2d.c +55 -0
  494. data/ext/stormlib/StormLib/src/libtommath/bn_mp_mod_d.c +27 -0
  495. data/ext/stormlib/StormLib/src/libtommath/bn_mp_montgomery_calc_normalization.c +59 -0
  496. data/ext/stormlib/StormLib/src/libtommath/bn_mp_montgomery_reduce.c +118 -0
  497. data/ext/stormlib/StormLib/src/libtommath/bn_mp_montgomery_setup.c +59 -0
  498. data/ext/stormlib/StormLib/src/libtommath/bn_mp_mul.c +66 -0
  499. data/ext/stormlib/StormLib/src/libtommath/bn_mp_mul_2.c +82 -0
  500. data/ext/stormlib/StormLib/src/libtommath/bn_mp_mul_2d.c +85 -0
  501. data/ext/stormlib/StormLib/src/libtommath/bn_mp_mul_d.c +79 -0
  502. data/ext/stormlib/StormLib/src/libtommath/bn_mp_mulmod.c +40 -0
  503. data/ext/stormlib/StormLib/src/libtommath/bn_mp_n_root.c +132 -0
  504. data/ext/stormlib/StormLib/src/libtommath/bn_mp_neg.c +40 -0
  505. data/ext/stormlib/StormLib/src/libtommath/bn_mp_or.c +50 -0
  506. data/ext/stormlib/StormLib/src/libtommath/bn_mp_prime_fermat.c +62 -0
  507. data/ext/stormlib/StormLib/src/libtommath/bn_mp_prime_is_divisible.c +50 -0
  508. data/ext/stormlib/StormLib/src/libtommath/bn_mp_prime_is_prime.c +83 -0
  509. data/ext/stormlib/StormLib/src/libtommath/bn_mp_prime_miller_rabin.c +103 -0
  510. data/ext/stormlib/StormLib/src/libtommath/bn_mp_prime_next_prime.c +170 -0
  511. data/ext/stormlib/StormLib/src/libtommath/bn_mp_prime_rabin_miller_trials.c +52 -0
  512. data/ext/stormlib/StormLib/src/libtommath/bn_mp_prime_random_ex.c +125 -0
  513. data/ext/stormlib/StormLib/src/libtommath/bn_mp_radix_size.c +78 -0
  514. data/ext/stormlib/StormLib/src/libtommath/bn_mp_radix_smap.c +24 -0
  515. data/ext/stormlib/StormLib/src/libtommath/bn_mp_rand.c +55 -0
  516. data/ext/stormlib/StormLib/src/libtommath/bn_mp_read_radix.c +85 -0
  517. data/ext/stormlib/StormLib/src/libtommath/bn_mp_read_signed_bin.c +41 -0
  518. data/ext/stormlib/StormLib/src/libtommath/bn_mp_read_unsigned_bin.c +55 -0
  519. data/ext/stormlib/StormLib/src/libtommath/bn_mp_reduce.c +100 -0
  520. data/ext/stormlib/StormLib/src/libtommath/bn_mp_reduce_2k.c +61 -0
  521. data/ext/stormlib/StormLib/src/libtommath/bn_mp_reduce_2k_l.c +62 -0
  522. data/ext/stormlib/StormLib/src/libtommath/bn_mp_reduce_2k_setup.c +47 -0
  523. data/ext/stormlib/StormLib/src/libtommath/bn_mp_reduce_2k_setup_l.c +44 -0
  524. data/ext/stormlib/StormLib/src/libtommath/bn_mp_reduce_is_2k.c +52 -0
  525. data/ext/stormlib/StormLib/src/libtommath/bn_mp_reduce_is_2k_l.c +44 -0
  526. data/ext/stormlib/StormLib/src/libtommath/bn_mp_reduce_setup.c +34 -0
  527. data/ext/stormlib/StormLib/src/libtommath/bn_mp_rshd.c +72 -0
  528. data/ext/stormlib/StormLib/src/libtommath/bn_mp_set.c +29 -0
  529. data/ext/stormlib/StormLib/src/libtommath/bn_mp_set_int.c +48 -0
  530. data/ext/stormlib/StormLib/src/libtommath/bn_mp_shrink.c +35 -0
  531. data/ext/stormlib/StormLib/src/libtommath/bn_mp_signed_bin_size.c +27 -0
  532. data/ext/stormlib/StormLib/src/libtommath/bn_mp_sqr.c +58 -0
  533. data/ext/stormlib/StormLib/src/libtommath/bn_mp_sqrmod.c +41 -0
  534. data/ext/stormlib/StormLib/src/libtommath/bn_mp_sqrt.c +81 -0
  535. data/ext/stormlib/StormLib/src/libtommath/bn_mp_sub.c +59 -0
  536. data/ext/stormlib/StormLib/src/libtommath/bn_mp_sub_d.c +93 -0
  537. data/ext/stormlib/StormLib/src/libtommath/bn_mp_submod.c +42 -0
  538. data/ext/stormlib/StormLib/src/libtommath/bn_mp_to_signed_bin.c +33 -0
  539. data/ext/stormlib/StormLib/src/libtommath/bn_mp_to_signed_bin_n.c +31 -0
  540. data/ext/stormlib/StormLib/src/libtommath/bn_mp_to_unsigned_bin.c +48 -0
  541. data/ext/stormlib/StormLib/src/libtommath/bn_mp_to_unsigned_bin_n.c +31 -0
  542. data/ext/stormlib/StormLib/src/libtommath/bn_mp_toom_mul.c +284 -0
  543. data/ext/stormlib/StormLib/src/libtommath/bn_mp_toom_sqr.c +226 -0
  544. data/ext/stormlib/StormLib/src/libtommath/bn_mp_toradix.c +75 -0
  545. data/ext/stormlib/StormLib/src/libtommath/bn_mp_toradix_n.c +88 -0
  546. data/ext/stormlib/StormLib/src/libtommath/bn_mp_unsigned_bin_size.c +28 -0
  547. data/ext/stormlib/StormLib/src/libtommath/bn_mp_xor.c +51 -0
  548. data/ext/stormlib/StormLib/src/libtommath/bn_mp_zero.c +36 -0
  549. data/ext/stormlib/StormLib/src/libtommath/bn_prime_tab.c +61 -0
  550. data/ext/stormlib/StormLib/src/libtommath/bn_reverse.c +39 -0
  551. data/ext/stormlib/StormLib/src/libtommath/bn_s_mp_add.c +109 -0
  552. data/ext/stormlib/StormLib/src/libtommath/bn_s_mp_exptmod.c +252 -0
  553. data/ext/stormlib/StormLib/src/libtommath/bn_s_mp_mul_digs.c +90 -0
  554. data/ext/stormlib/StormLib/src/libtommath/bn_s_mp_mul_high_digs.c +81 -0
  555. data/ext/stormlib/StormLib/src/libtommath/bn_s_mp_sqr.c +84 -0
  556. data/ext/stormlib/StormLib/src/libtommath/bn_s_mp_sub.c +89 -0
  557. data/ext/stormlib/StormLib/src/libtommath/bncore.c +36 -0
  558. data/ext/stormlib/StormLib/src/libtommath/tommath.h +584 -0
  559. data/ext/stormlib/StormLib/src/libtommath/tommath_class.h +999 -0
  560. data/ext/stormlib/StormLib/src/libtommath/tommath_superclass.h +76 -0
  561. data/ext/stormlib/StormLib/src/lzma/C/LzFind.c +761 -0
  562. data/ext/stormlib/StormLib/src/lzma/C/LzFind.h +115 -0
  563. data/ext/stormlib/StormLib/src/lzma/C/LzFindMt.c +793 -0
  564. data/ext/stormlib/StormLib/src/lzma/C/LzFindMt.h +105 -0
  565. data/ext/stormlib/StormLib/src/lzma/C/LzHash.h +54 -0
  566. data/ext/stormlib/StormLib/src/lzma/C/LzmaDec.c +999 -0
  567. data/ext/stormlib/StormLib/src/lzma/C/LzmaDec.h +231 -0
  568. data/ext/stormlib/StormLib/src/lzma/C/LzmaEnc.c +2268 -0
  569. data/ext/stormlib/StormLib/src/lzma/C/LzmaEnc.h +80 -0
  570. data/ext/stormlib/StormLib/src/lzma/C/Threads.c +84 -0
  571. data/ext/stormlib/StormLib/src/lzma/C/Threads.h +59 -0
  572. data/ext/stormlib/StormLib/src/lzma/C/Types.h +236 -0
  573. data/ext/stormlib/StormLib/src/lzma/info.txt +1 -0
  574. data/ext/stormlib/StormLib/src/pklib/crc32.c +66 -0
  575. data/ext/stormlib/StormLib/src/pklib/explode.c +521 -0
  576. data/ext/stormlib/StormLib/src/pklib/implode.c +674 -0
  577. data/ext/stormlib/StormLib/src/pklib/pklib.h +160 -0
  578. data/ext/stormlib/StormLib/src/resource.h +15 -0
  579. data/ext/stormlib/StormLib/src/sparse/sparse.cpp +287 -0
  580. data/ext/stormlib/StormLib/src/sparse/sparse.h +17 -0
  581. data/ext/stormlib/StormLib/src/wdk/sources-cpp.cpp +26 -0
  582. data/ext/stormlib/StormLib/src/wdk/sources-wdk-bzip2.c +13 -0
  583. data/ext/stormlib/StormLib/src/wdk/sources-wdk-ltc.c +4 -0
  584. data/ext/stormlib/StormLib/src/wdk/sources-wdk-lzma.c +8 -0
  585. data/ext/stormlib/StormLib/src/wdk/sources-wdk-misc.c +6 -0
  586. data/ext/stormlib/StormLib/src/wdk/sources-wdk-tomcrypt.c +82 -0
  587. data/ext/stormlib/StormLib/src/wdk/sources-wdk-tommath.c +123 -0
  588. data/ext/stormlib/StormLib/src/wdk/sources-wdk-zlib.c +21 -0
  589. data/ext/stormlib/StormLib/src/zlib/adler32.c +169 -0
  590. data/ext/stormlib/StormLib/src/zlib/compress.c +80 -0
  591. data/ext/stormlib/StormLib/src/zlib/compress_zlib.c +5 -0
  592. data/ext/stormlib/StormLib/src/zlib/crc32.c +442 -0
  593. data/ext/stormlib/StormLib/src/zlib/crc32.h +441 -0
  594. data/ext/stormlib/StormLib/src/zlib/deflate.c +1834 -0
  595. data/ext/stormlib/StormLib/src/zlib/deflate.h +342 -0
  596. data/ext/stormlib/StormLib/src/zlib/gzguts.h +218 -0
  597. data/ext/stormlib/StormLib/src/zlib/inffast.c +340 -0
  598. data/ext/stormlib/StormLib/src/zlib/inffast.h +11 -0
  599. data/ext/stormlib/StormLib/src/zlib/inffixed.h +94 -0
  600. data/ext/stormlib/StormLib/src/zlib/inflate.c +1480 -0
  601. data/ext/stormlib/StormLib/src/zlib/inflate.h +130 -0
  602. data/ext/stormlib/StormLib/src/zlib/inftrees.c +330 -0
  603. data/ext/stormlib/StormLib/src/zlib/inftrees.h +67 -0
  604. data/ext/stormlib/StormLib/src/zlib/trees.c +1244 -0
  605. data/ext/stormlib/StormLib/src/zlib/trees.h +128 -0
  606. data/ext/stormlib/StormLib/src/zlib/zconf.h +428 -0
  607. data/ext/stormlib/StormLib/src/zlib/zlib.h +1613 -0
  608. data/ext/stormlib/StormLib/src/zlib/zutil.c +318 -0
  609. data/ext/stormlib/StormLib/src/zlib/zutil.h +274 -0
  610. data/ext/stormlib/StormLib/storm_dll/storm.cpp +117 -0
  611. data/ext/stormlib/StormLib/storm_dll/storm.def +25 -0
  612. data/ext/stormlib/StormLib/storm_dll/storm.h +65 -0
  613. data/ext/stormlib/StormLib/storm_dll/storm.vcxproj +209 -0
  614. data/ext/stormlib/StormLib/storm_dll/storm.vcxproj.filters +28 -0
  615. data/ext/stormlib/StormLib/storm_dll/storm_test.cpp +182 -0
  616. data/ext/stormlib/StormLib/storm_dll/storm_test.vcxproj +202 -0
  617. data/ext/stormlib/StormLib/storm_dll/storm_test.vcxproj.filters +22 -0
  618. data/ext/stormlib/StormLib/test/StormTest.cpp +4393 -0
  619. data/ext/stormlib/StormLib/test/TLogHelper.cpp +567 -0
  620. data/ext/stormlib/StormLib/test/stormlib-test-001.txt +164 -0
  621. data/ext/stormlib/extconf.rb +0 -2
  622. data/lib/stormlib/version.rb +1 -1
  623. data/stormlib.gemspec +1 -1
  624. metadata +621 -2
@@ -0,0 +1,1175 @@
1
+ /*****************************************************************************/
2
+ /* SFilePatchArchives.cpp Copyright (c) Ladislav Zezula 2010 */
3
+ /*---------------------------------------------------------------------------*/
4
+ /* Description: */
5
+ /*---------------------------------------------------------------------------*/
6
+ /* Date Ver Who Comment */
7
+ /* -------- ---- --- ------- */
8
+ /* 18.08.10 1.00 Lad The first version of SFilePatchArchives.cpp */
9
+ /*****************************************************************************/
10
+
11
+ #define __STORMLIB_SELF__
12
+ #include "StormLib.h"
13
+ #include "StormCommon.h"
14
+
15
+ //-----------------------------------------------------------------------------
16
+ // Local structures
17
+
18
+ #define MAX_SC2_PATCH_PREFIX 0x80
19
+
20
+ #define PATCH_SIGNATURE_HEADER 0x48435450
21
+ #define PATCH_SIGNATURE_MD5 0x5f35444d
22
+ #define PATCH_SIGNATURE_XFRM 0x4d524658
23
+
24
+ #define SIZE_OF_XFRM_HEADER 0x0C
25
+
26
+ // Header for incremental patch files
27
+ typedef struct _MPQ_PATCH_HEADER
28
+ {
29
+ //-- PATCH header -----------------------------------
30
+ DWORD dwSignature; // 'PTCH'
31
+ DWORD dwSizeOfPatchData; // Size of the entire patch (decompressed)
32
+ DWORD dwSizeBeforePatch; // Size of the file before patch
33
+ DWORD dwSizeAfterPatch; // Size of file after patch
34
+
35
+ //-- MD5 block --------------------------------------
36
+ DWORD dwMD5; // 'MD5_'
37
+ DWORD dwMd5BlockSize; // Size of the MD5 block, including the signature and size itself
38
+ BYTE md5_before_patch[0x10]; // MD5 of the original (unpached) file
39
+ BYTE md5_after_patch[0x10]; // MD5 of the patched file
40
+
41
+ //-- XFRM block -------------------------------------
42
+ DWORD dwXFRM; // 'XFRM'
43
+ DWORD dwXfrmBlockSize; // Size of the XFRM block, includes XFRM header and patch data
44
+ DWORD dwPatchType; // Type of patch ('BSD0' or 'COPY')
45
+
46
+ // Followed by the patch data
47
+ } MPQ_PATCH_HEADER, *PMPQ_PATCH_HEADER;
48
+
49
+ typedef struct _BLIZZARD_BSDIFF40_FILE
50
+ {
51
+ ULONGLONG Signature;
52
+ ULONGLONG CtrlBlockSize;
53
+ ULONGLONG DataBlockSize;
54
+ ULONGLONG NewFileSize;
55
+ } BLIZZARD_BSDIFF40_FILE, *PBLIZZARD_BSDIFF40_FILE;
56
+
57
+ typedef struct _BSDIFF_CTRL_BLOCK
58
+ {
59
+ DWORD dwAddDataLength;
60
+ DWORD dwMovDataLength;
61
+ DWORD dwOldMoveLength;
62
+
63
+ } BSDIFF_CTRL_BLOCK, *PBSDIFF_CTRL_BLOCK;
64
+
65
+ typedef struct _LOCALIZED_MPQ_INFO
66
+ {
67
+ const char * szNameTemplate; // Name template
68
+ size_t nLangOffset; // Offset of the language
69
+ size_t nLength; // Length of the name template
70
+ } LOCALIZED_MPQ_INFO, *PLOCALIZED_MPQ_INFO;
71
+
72
+ //-----------------------------------------------------------------------------
73
+ // Local variables
74
+
75
+ // 4-byte groups for all languages
76
+ static const char * LanguageList = "baseteenenUSenGBenCNenTWdeDEesESesMXfrFRitITkoKRptBRptPTruRUzhCNzhTW";
77
+
78
+ // List of localized MPQs for World of Warcraft
79
+ static LOCALIZED_MPQ_INFO LocaleMpqs_WoW[] =
80
+ {
81
+ {"expansion1-locale-####", 18, 22},
82
+ {"expansion1-speech-####", 18, 22},
83
+ {"expansion2-locale-####", 18, 22},
84
+ {"expansion2-speech-####", 18, 22},
85
+ {"expansion3-locale-####", 18, 22},
86
+ {"expansion3-speech-####", 18, 22},
87
+ {"locale-####", 7, 11},
88
+ {"speech-####", 7, 11},
89
+ {NULL, 0, 0}
90
+ };
91
+
92
+ //-----------------------------------------------------------------------------
93
+ // Local functions
94
+
95
+ static inline bool IsPatchMetadataFile(TFileEntry * pFileEntry)
96
+ {
97
+ // The file must ave a name
98
+ if(pFileEntry->szFileName != NULL && (pFileEntry->dwFlags & MPQ_FILE_PATCH_FILE) == 0)
99
+ {
100
+ // The file must be small
101
+ if(0 < pFileEntry->dwFileSize && pFileEntry->dwFileSize < 0x40)
102
+ {
103
+ // Compare the plain name
104
+ return (_stricmp(GetPlainFileName(pFileEntry->szFileName), PATCH_METADATA_NAME) == 0);
105
+ }
106
+ }
107
+
108
+ // Not a patch_metadata
109
+ return false;
110
+ }
111
+
112
+ static void Decompress_RLE(LPBYTE pbDecompressed, DWORD cbDecompressed, LPBYTE pbCompressed, DWORD cbCompressed)
113
+ {
114
+ LPBYTE pbDecompressedEnd = pbDecompressed + cbDecompressed;
115
+ LPBYTE pbCompressedEnd = pbCompressed + cbCompressed;
116
+ BYTE RepeatCount;
117
+ BYTE OneByte;
118
+
119
+ // Cut the initial DWORD from the compressed chunk
120
+ pbCompressed += sizeof(DWORD);
121
+
122
+ // Pre-fill decompressed buffer with zeros
123
+ memset(pbDecompressed, 0, cbDecompressed);
124
+
125
+ // Unpack
126
+ while(pbCompressed < pbCompressedEnd && pbDecompressed < pbDecompressedEnd)
127
+ {
128
+ OneByte = *pbCompressed++;
129
+
130
+ // Is it a repetition byte ?
131
+ if(OneByte & 0x80)
132
+ {
133
+ RepeatCount = (OneByte & 0x7F) + 1;
134
+ for(BYTE i = 0; i < RepeatCount; i++)
135
+ {
136
+ if(pbDecompressed == pbDecompressedEnd || pbCompressed == pbCompressedEnd)
137
+ break;
138
+
139
+ *pbDecompressed++ = *pbCompressed++;
140
+ }
141
+ }
142
+ else
143
+ {
144
+ pbDecompressed += (OneByte + 1);
145
+ }
146
+ }
147
+ }
148
+
149
+ static DWORD LoadFilePatch_COPY(TMPQFile * hf, PMPQ_PATCH_HEADER pFullPatch)
150
+ {
151
+ DWORD cbBytesToRead = pFullPatch->dwSizeOfPatchData - sizeof(MPQ_PATCH_HEADER);
152
+ DWORD cbBytesRead = 0;
153
+
154
+ // Simply load the rest of the patch
155
+ SFileReadFile((HANDLE)hf, (pFullPatch + 1), cbBytesToRead, &cbBytesRead, NULL);
156
+ return (cbBytesRead == cbBytesToRead) ? ERROR_SUCCESS : ERROR_FILE_CORRUPT;
157
+ }
158
+
159
+ static DWORD LoadFilePatch_BSD0(TMPQFile * hf, PMPQ_PATCH_HEADER pFullPatch)
160
+ {
161
+ LPBYTE pbDecompressed = (LPBYTE)(pFullPatch + 1);
162
+ LPBYTE pbCompressed = NULL;
163
+ DWORD cbDecompressed = 0;
164
+ DWORD cbCompressed = 0;
165
+ DWORD dwBytesRead = 0;
166
+ DWORD dwErrCode = ERROR_SUCCESS;
167
+
168
+ // Calculate the size of compressed data
169
+ cbDecompressed = pFullPatch->dwSizeOfPatchData - sizeof(MPQ_PATCH_HEADER);
170
+ cbCompressed = pFullPatch->dwXfrmBlockSize - SIZE_OF_XFRM_HEADER;
171
+
172
+ // Is that file compressed?
173
+ if(cbCompressed < cbDecompressed)
174
+ {
175
+ pbCompressed = STORM_ALLOC(BYTE, cbCompressed);
176
+ if(pbCompressed == NULL)
177
+ dwErrCode = ERROR_NOT_ENOUGH_MEMORY;
178
+
179
+ // Read the compressed patch data
180
+ if(dwErrCode == ERROR_SUCCESS)
181
+ {
182
+ SFileReadFile((HANDLE)hf, pbCompressed, cbCompressed, &dwBytesRead, NULL);
183
+ if(dwBytesRead != cbCompressed)
184
+ dwErrCode = ERROR_FILE_CORRUPT;
185
+ }
186
+
187
+ // Decompress the data
188
+ if(dwErrCode == ERROR_SUCCESS)
189
+ Decompress_RLE(pbDecompressed, cbDecompressed, pbCompressed, cbCompressed);
190
+
191
+ if(pbCompressed != NULL)
192
+ STORM_FREE(pbCompressed);
193
+ }
194
+ else
195
+ {
196
+ SFileReadFile((HANDLE)hf, pbDecompressed, cbDecompressed, &dwBytesRead, NULL);
197
+ if(dwBytesRead != cbDecompressed)
198
+ dwErrCode = ERROR_FILE_CORRUPT;
199
+ }
200
+
201
+ return dwErrCode;
202
+ }
203
+
204
+ static DWORD ApplyFilePatch_COPY(
205
+ TMPQPatcher * pPatcher,
206
+ PMPQ_PATCH_HEADER pFullPatch,
207
+ LPBYTE pbTarget,
208
+ LPBYTE pbSource)
209
+ {
210
+ // Sanity checks
211
+ assert(pPatcher->cbMaxFileData >= pPatcher->cbFileData);
212
+ pFullPatch = pFullPatch;
213
+
214
+ // Copy the patch data as-is
215
+ memcpy(pbTarget, pbSource, pPatcher->cbFileData);
216
+ return ERROR_SUCCESS;
217
+ }
218
+
219
+ static DWORD ApplyFilePatch_BSD0(
220
+ TMPQPatcher * pPatcher,
221
+ PMPQ_PATCH_HEADER pFullPatch,
222
+ LPBYTE pbTarget,
223
+ LPBYTE pbSource)
224
+ {
225
+ PBLIZZARD_BSDIFF40_FILE pBsdiff;
226
+ PBSDIFF_CTRL_BLOCK pCtrlBlock;
227
+ LPBYTE pbPatchData = (LPBYTE)(pFullPatch + 1);
228
+ LPBYTE pDataBlock;
229
+ LPBYTE pExtraBlock;
230
+ LPBYTE pbOldData = pbSource;
231
+ LPBYTE pbNewData = pbTarget;
232
+ DWORD dwCombineSize;
233
+ DWORD dwNewOffset = 0; // Current position to patch
234
+ DWORD dwOldOffset = 0; // Current source position
235
+ DWORD dwNewSize; // Patched file size
236
+ DWORD dwOldSize = pPatcher->cbFileData; // File size before patch
237
+
238
+ // Get pointer to the patch header
239
+ // Format of BSDIFF header corresponds to original BSDIFF, which is:
240
+ // 0000 8 bytes signature "BSDIFF40"
241
+ // 0008 8 bytes size of the control block
242
+ // 0010 8 bytes size of the data block
243
+ // 0018 8 bytes new size of the patched file
244
+ pBsdiff = (PBLIZZARD_BSDIFF40_FILE)pbPatchData;
245
+ pbPatchData += sizeof(BLIZZARD_BSDIFF40_FILE);
246
+
247
+ // Get pointer to the 32-bit BSDIFF control block
248
+ // The control block follows immediately after the BSDIFF header
249
+ // and consists of three 32-bit integers
250
+ // 0000 4 bytes Length to copy from the BSDIFF data block the new file
251
+ // 0004 4 bytes Length to copy from the BSDIFF extra block
252
+ // 0008 4 bytes Size to increment source file offset
253
+ pCtrlBlock = (PBSDIFF_CTRL_BLOCK)pbPatchData;
254
+ pbPatchData += (size_t)BSWAP_INT64_UNSIGNED(pBsdiff->CtrlBlockSize);
255
+
256
+ // Get the pointer to the data block
257
+ pDataBlock = (LPBYTE)pbPatchData;
258
+ pbPatchData += (size_t)BSWAP_INT64_UNSIGNED(pBsdiff->DataBlockSize);
259
+
260
+ // Get the pointer to the extra block
261
+ pExtraBlock = (LPBYTE)pbPatchData;
262
+ dwNewSize = (DWORD)BSWAP_INT64_UNSIGNED(pBsdiff->NewFileSize);
263
+
264
+ // Now patch the file
265
+ while(dwNewOffset < dwNewSize)
266
+ {
267
+ DWORD dwAddDataLength = BSWAP_INT32_UNSIGNED(pCtrlBlock->dwAddDataLength);
268
+ DWORD dwMovDataLength = BSWAP_INT32_UNSIGNED(pCtrlBlock->dwMovDataLength);
269
+ DWORD dwOldMoveLength = BSWAP_INT32_UNSIGNED(pCtrlBlock->dwOldMoveLength);
270
+ DWORD i;
271
+
272
+ // Sanity check
273
+ if((dwNewOffset + dwAddDataLength) > dwNewSize)
274
+ return ERROR_FILE_CORRUPT;
275
+
276
+ // Read the diff string to the target buffer
277
+ memcpy(pbNewData + dwNewOffset, pDataBlock, dwAddDataLength);
278
+ pDataBlock += dwAddDataLength;
279
+
280
+ // Get the longest block that we can combine
281
+ dwCombineSize = ((dwOldOffset + dwAddDataLength) >= dwOldSize) ? (dwOldSize - dwOldOffset) : dwAddDataLength;
282
+ if((dwNewOffset + dwCombineSize) > dwNewSize || (dwNewOffset + dwCombineSize) < dwNewOffset)
283
+ return ERROR_FILE_CORRUPT;
284
+
285
+ // Now combine the patch data with the original file
286
+ for(i = 0; i < dwCombineSize; i++)
287
+ pbNewData[dwNewOffset + i] = pbNewData[dwNewOffset + i] + pbOldData[dwOldOffset + i];
288
+
289
+ // Move the offsets
290
+ dwNewOffset += dwAddDataLength;
291
+ dwOldOffset += dwAddDataLength;
292
+
293
+ // Sanity check
294
+ if((dwNewOffset + dwMovDataLength) > dwNewSize)
295
+ return ERROR_FILE_CORRUPT;
296
+
297
+ // Copy the data from the extra block in BSDIFF patch
298
+ memcpy(pbNewData + dwNewOffset, pExtraBlock, dwMovDataLength);
299
+ pExtraBlock += dwMovDataLength;
300
+ dwNewOffset += dwMovDataLength;
301
+
302
+ // Move the old offset
303
+ if(dwOldMoveLength & 0x80000000)
304
+ dwOldMoveLength = 0x80000000 - dwOldMoveLength;
305
+ dwOldOffset += dwOldMoveLength;
306
+ pCtrlBlock++;
307
+ }
308
+
309
+ // The size after patch must match
310
+ if(dwNewOffset != pFullPatch->dwSizeAfterPatch)
311
+ return ERROR_FILE_CORRUPT;
312
+
313
+ // Update the new data size
314
+ pPatcher->cbFileData = dwNewOffset;
315
+ return ERROR_SUCCESS;
316
+ }
317
+
318
+ static PMPQ_PATCH_HEADER LoadFullFilePatch(TMPQFile * hf, MPQ_PATCH_HEADER & PatchHeader)
319
+ {
320
+ PMPQ_PATCH_HEADER pFullPatch;
321
+ DWORD dwErrCode = ERROR_SUCCESS;
322
+
323
+ // BSWAP the entire header, if needed
324
+ BSWAP_ARRAY32_UNSIGNED(&PatchHeader, sizeof(DWORD) * 6);
325
+ BSWAP_ARRAY32_UNSIGNED(&PatchHeader.dwXFRM, sizeof(DWORD) * 3);
326
+
327
+ // Verify the signatures in the patch header
328
+ if(PatchHeader.dwSignature != PATCH_SIGNATURE_HEADER || PatchHeader.dwMD5 != PATCH_SIGNATURE_MD5 || PatchHeader.dwXFRM != PATCH_SIGNATURE_XFRM)
329
+ return NULL;
330
+
331
+ // Allocate space for patch header and compressed data
332
+ pFullPatch = (PMPQ_PATCH_HEADER)STORM_ALLOC(BYTE, PatchHeader.dwSizeOfPatchData);
333
+ if(pFullPatch != NULL)
334
+ {
335
+ // Copy the patch header
336
+ memcpy(pFullPatch, &PatchHeader, sizeof(MPQ_PATCH_HEADER));
337
+
338
+ // Read the patch, depending on patch type
339
+ if(dwErrCode == ERROR_SUCCESS)
340
+ {
341
+ switch(PatchHeader.dwPatchType)
342
+ {
343
+ case 0x59504f43: // 'COPY'
344
+ dwErrCode = LoadFilePatch_COPY(hf, pFullPatch);
345
+ break;
346
+
347
+ case 0x30445342: // 'BSD0'
348
+ dwErrCode = LoadFilePatch_BSD0(hf, pFullPatch);
349
+ break;
350
+
351
+ default:
352
+ dwErrCode = ERROR_FILE_CORRUPT;
353
+ break;
354
+ }
355
+ }
356
+
357
+ // If something failed, free the patch buffer
358
+ if(dwErrCode != ERROR_SUCCESS)
359
+ {
360
+ STORM_FREE(pFullPatch);
361
+ pFullPatch = NULL;
362
+ }
363
+ }
364
+
365
+ // Give the result to the caller
366
+ return pFullPatch;
367
+ }
368
+
369
+ static DWORD ApplyFilePatch(
370
+ TMPQPatcher * pPatcher,
371
+ PMPQ_PATCH_HEADER pFullPatch)
372
+ {
373
+ LPBYTE pbSource = (pPatcher->nCounter & 0x1) ? pPatcher->pbFileData2 : pPatcher->pbFileData1;
374
+ LPBYTE pbTarget = (pPatcher->nCounter & 0x1) ? pPatcher->pbFileData1 : pPatcher->pbFileData2;
375
+ DWORD dwErrCode;
376
+
377
+ // Sanity checks
378
+ assert(pFullPatch->dwSizeAfterPatch <= pPatcher->cbMaxFileData);
379
+
380
+ // Apply the patch according to the type
381
+ switch(pFullPatch->dwPatchType)
382
+ {
383
+ case 0x59504f43: // 'COPY'
384
+ dwErrCode = ApplyFilePatch_COPY(pPatcher, pFullPatch, pbTarget, pbSource);
385
+ break;
386
+
387
+ case 0x30445342: // 'BSD0'
388
+ dwErrCode = ApplyFilePatch_BSD0(pPatcher, pFullPatch, pbTarget, pbSource);
389
+ break;
390
+
391
+ default:
392
+ dwErrCode = ERROR_FILE_CORRUPT;
393
+ break;
394
+ }
395
+
396
+ // Verify MD5 after patch
397
+ if(dwErrCode == ERROR_SUCCESS && pFullPatch->dwSizeAfterPatch != 0)
398
+ {
399
+ // Verify the patched file
400
+ if(!VerifyDataBlockHash(pbTarget, pFullPatch->dwSizeAfterPatch, pFullPatch->md5_after_patch))
401
+ dwErrCode = ERROR_FILE_CORRUPT;
402
+
403
+ // Copy the MD5 of the new block
404
+ memcpy(pPatcher->this_md5, pFullPatch->md5_after_patch, MD5_DIGEST_SIZE);
405
+ }
406
+
407
+ return dwErrCode;
408
+ }
409
+
410
+ //-----------------------------------------------------------------------------
411
+ // Local functions (patch prefix matching)
412
+
413
+ static bool CreatePatchPrefix(TMPQArchive * ha, const char * szFileName, size_t nLength)
414
+ {
415
+ TMPQNamePrefix * pNewPrefix;
416
+
417
+ // If the length of the patch prefix was not entered, find it
418
+ // Not that the patch prefix must always begin with backslash
419
+ if(szFileName != NULL && nLength == 0)
420
+ nLength = strlen(szFileName);
421
+
422
+ // Create the patch prefix
423
+ pNewPrefix = (TMPQNamePrefix *)STORM_ALLOC(BYTE, sizeof(TMPQNamePrefix) + nLength + 1);
424
+ if(pNewPrefix != NULL)
425
+ {
426
+ // Fill the name prefix. Also add the backslash
427
+ if(szFileName && nLength)
428
+ {
429
+ memcpy(pNewPrefix->szPatchPrefix, szFileName, nLength);
430
+ if(pNewPrefix->szPatchPrefix[nLength - 1] != '\\')
431
+ pNewPrefix->szPatchPrefix[nLength++] = '\\';
432
+ }
433
+
434
+ // Terminate the string and fill the length
435
+ pNewPrefix->szPatchPrefix[nLength] = 0;
436
+ pNewPrefix->nLength = nLength;
437
+ }
438
+
439
+ ha->pPatchPrefix = pNewPrefix;
440
+ return (pNewPrefix != NULL);
441
+ }
442
+
443
+ static bool CheckAndCreatePatchPrefix(TMPQArchive * ha, const char * szPatchPrefix, size_t nLength)
444
+ {
445
+ char szTempName[MAX_SC2_PATCH_PREFIX + 0x41];
446
+ bool bResult = false;
447
+
448
+ // Prepare the patch file name
449
+ if(nLength > MAX_SC2_PATCH_PREFIX)
450
+ return false;
451
+
452
+ // Prepare the patched file name
453
+ memcpy(szTempName, szPatchPrefix, nLength);
454
+ memcpy(&szTempName[nLength], "\\(patch_metadata)", 18);
455
+
456
+ // Verifywhether that file exists
457
+ if(GetFileEntryLocale(ha, szTempName, 0) != NULL)
458
+ bResult = CreatePatchPrefix(ha, szPatchPrefix, nLength);
459
+
460
+ return bResult;
461
+ }
462
+
463
+ static bool IsMatchingPatchFile(
464
+ TMPQArchive * ha,
465
+ const char * szFileName,
466
+ LPBYTE pbBaseFileMd5)
467
+ {
468
+ MPQ_PATCH_HEADER PatchHeader = {0};
469
+ HANDLE hFile = NULL;
470
+ DWORD dwTransferred = 0;
471
+ DWORD dwFlags = 0;
472
+ bool bResult = false;
473
+
474
+ // Open the file and load the patch header
475
+ if(SFileOpenFileEx((HANDLE)ha, szFileName, SFILE_OPEN_BASE_FILE, &hFile))
476
+ {
477
+ // Retrieve the flags. We need to know whether the file is a patch or not
478
+ SFileGetFileInfo(hFile, SFileInfoFlags, &dwFlags, sizeof(DWORD), &dwTransferred);
479
+ if(dwFlags & MPQ_FILE_PATCH_FILE)
480
+ {
481
+ // Load the patch header
482
+ SFileReadFile(hFile, &PatchHeader, sizeof(MPQ_PATCH_HEADER), &dwTransferred, NULL);
483
+ BSWAP_ARRAY32_UNSIGNED(&PatchHeader, sizeof(DWORD) * 6);
484
+
485
+ // If the file contains an incremental patch,
486
+ // compare the "MD5 before patching" with the base file MD5
487
+ if(dwTransferred == sizeof(MPQ_PATCH_HEADER) && PatchHeader.dwSignature == PATCH_SIGNATURE_HEADER)
488
+ bResult = (!memcmp(PatchHeader.md5_before_patch, pbBaseFileMd5, MD5_DIGEST_SIZE));
489
+ }
490
+ else
491
+ {
492
+ // TODO: How to match it if it's not an incremental patch?
493
+ // Example: StarCraft II\Updates\enGB\s2-update-enGB-23258.MPQ:
494
+ // Mods\Core.SC2Mod\enGB.SC2Assets\StreamingBuckets.txt"
495
+ bResult = false;
496
+ }
497
+
498
+ // Close the file
499
+ SFileCloseFile(hFile);
500
+ }
501
+
502
+ return bResult;
503
+ }
504
+
505
+ static const char * FindArchiveLanguage(TMPQArchive * ha, PLOCALIZED_MPQ_INFO pMpqInfo)
506
+ {
507
+ TFileEntry * pFileEntry;
508
+ const char * szLanguage = LanguageList;
509
+ char szFileName[0x40];
510
+
511
+ // Iterate through all localized languages
512
+ while(pMpqInfo->szNameTemplate != NULL)
513
+ {
514
+ // Iterate through all languages
515
+ for(szLanguage = LanguageList; szLanguage[0] != 0; szLanguage += 4)
516
+ {
517
+ // Construct the file name
518
+ memcpy(szFileName, pMpqInfo->szNameTemplate, pMpqInfo->nLength);
519
+ szFileName[pMpqInfo->nLangOffset + 0] = szLanguage[0];
520
+ szFileName[pMpqInfo->nLangOffset + 1] = szLanguage[1];
521
+ szFileName[pMpqInfo->nLangOffset + 2] = szLanguage[2];
522
+ szFileName[pMpqInfo->nLangOffset + 3] = szLanguage[3];
523
+
524
+ // Append the suffix
525
+ memcpy(szFileName + pMpqInfo->nLength, "-md5.lst", 9);
526
+
527
+ // Check whether the name exists
528
+ pFileEntry = GetFileEntryLocale(ha, szFileName, 0);
529
+ if(pFileEntry != NULL)
530
+ return szLanguage;
531
+ }
532
+
533
+ // Move to the next language name
534
+ pMpqInfo++;
535
+ }
536
+
537
+ // Not found
538
+ return NULL;
539
+ }
540
+
541
+ //-----------------------------------------------------------------------------
542
+ // Finding ratch prefix for an temporary build of WoW (Pre-Cataclysm)
543
+
544
+ static bool FindPatchPrefix_WoW_13164_13623(TMPQArchive * haBase, TMPQArchive * haPatch)
545
+ {
546
+ const char * szPatchPrefix;
547
+ char szNamePrefix[0x08];
548
+
549
+ // Try to find the language of the MPQ archive
550
+ szPatchPrefix = FindArchiveLanguage(haBase, LocaleMpqs_WoW);
551
+ if(szPatchPrefix == NULL)
552
+ szPatchPrefix = "Base";
553
+
554
+ // Format the patch prefix
555
+ szNamePrefix[0] = szPatchPrefix[0];
556
+ szNamePrefix[1] = szPatchPrefix[1];
557
+ szNamePrefix[2] = szPatchPrefix[2];
558
+ szNamePrefix[3] = szPatchPrefix[3];
559
+ szNamePrefix[4] = '\\';
560
+ szNamePrefix[5] = 0;
561
+ return CreatePatchPrefix(haPatch, szNamePrefix, 5);
562
+ }
563
+
564
+ //-----------------------------------------------------------------------------
565
+ // Finding patch prefix for Starcraft II (Pre-Legacy of the Void)
566
+
567
+ //
568
+ // This method tries to match the patch by placement of the archive (in the game subdirectory)
569
+ //
570
+ // Archive Path: %GAME_DIR%\Mods\SwarmMulti.SC2Mod\Base.SC2Data
571
+ // Patch Prefix: Mods\SwarmMulti.SC2Mod\Base.SC2Data
572
+ //
573
+ // Archive Path: %ANY_DIR%\MPQ_2013_v4_Mods#Liberty.SC2Mod#enGB.SC2Data
574
+ // Patch Prefix: Mods\Liberty.SC2Mod\enGB.SC2Data
575
+ //
576
+
577
+ static bool CheckPatchPrefix_SC2_ArchiveName(
578
+ TMPQArchive * haPatch,
579
+ const TCHAR * szPathPtr,
580
+ const TCHAR * szSeparator,
581
+ const TCHAR * szPathEnd,
582
+ const TCHAR * szExpectedString,
583
+ size_t cchExpectedString)
584
+ {
585
+ char szPatchPrefix[MAX_SC2_PATCH_PREFIX+0x41];
586
+ size_t nLength = 0;
587
+ bool bResult = false;
588
+
589
+ // Check whether the length is equal to the length of the expected string
590
+ if((size_t)(szSeparator - szPathPtr) == cchExpectedString)
591
+ {
592
+ // Now check the string itself
593
+ if(!_tcsnicmp(szPathPtr, szExpectedString, szSeparator - szPathPtr))
594
+ {
595
+ // Copy the name string
596
+ for(; szPathPtr < szPathEnd; szPathPtr++)
597
+ {
598
+ if(szPathPtr[0] != _T('/') && szPathPtr[0] != _T('#'))
599
+ szPatchPrefix[nLength++] = (char)szPathPtr[0];
600
+ else
601
+ szPatchPrefix[nLength++] = '\\';
602
+ }
603
+
604
+ // Check and create the patch prefix
605
+ bResult = CheckAndCreatePatchPrefix(haPatch, szPatchPrefix, nLength);
606
+ }
607
+ }
608
+
609
+ return bResult;
610
+ }
611
+
612
+ static bool FindPatchPrefix_SC2_ArchiveName(TMPQArchive * haBase, TMPQArchive * haPatch)
613
+ {
614
+ const TCHAR * szPathBegin = FileStream_GetFileName(haBase->pStream);
615
+ const TCHAR * szSeparator = NULL;
616
+ const TCHAR * szPathEnd = szPathBegin + _tcslen(szPathBegin);
617
+ const TCHAR * szPathPtr;
618
+ int nSlashCount = 0;
619
+ int nDotCount = 0;
620
+
621
+ // Skip the part where the patch prefix would be too long
622
+ if((szPathEnd - szPathBegin) > MAX_SC2_PATCH_PREFIX)
623
+ szPathBegin = szPathEnd - MAX_SC2_PATCH_PREFIX;
624
+
625
+ // Search for the file extension
626
+ for(szPathPtr = szPathEnd; szPathPtr > szPathBegin; szPathPtr--)
627
+ {
628
+ if(szPathPtr[0] == _T('.'))
629
+ {
630
+ nDotCount++;
631
+ break;
632
+ }
633
+ }
634
+
635
+ // Search for the possible begin of the prefix name
636
+ for(/* NOTHING */; szPathPtr > szPathBegin; szPathPtr--)
637
+ {
638
+ // Check the slashes, backslashes and hashes
639
+ if(szPathPtr[0] == _T('\\') || szPathPtr[0] == _T('/') || szPathPtr[0] == _T('#'))
640
+ {
641
+ if(nDotCount == 0)
642
+ return false;
643
+ szSeparator = szPathPtr;
644
+ nSlashCount++;
645
+ }
646
+
647
+ // Check the path parts
648
+ if(szSeparator != NULL && nSlashCount >= nDotCount)
649
+ {
650
+ if(CheckPatchPrefix_SC2_ArchiveName(haPatch, szPathPtr, szSeparator, szPathEnd, _T("Battle.net"), 10))
651
+ return true;
652
+ if(CheckPatchPrefix_SC2_ArchiveName(haPatch, szPathPtr, szSeparator, szPathEnd, _T("Campaigns"), 9))
653
+ return true;
654
+ if(CheckPatchPrefix_SC2_ArchiveName(haPatch, szPathPtr, szSeparator, szPathEnd, _T("Mods"), 4))
655
+ return true;
656
+ }
657
+ }
658
+
659
+ // Not matched, sorry
660
+ return false;
661
+ }
662
+
663
+ //
664
+ // This method tries to read the patch prefix from a helper file
665
+ //
666
+ // Example
667
+ // =========================================================
668
+ // MPQ File Name: MPQ_2013_v4_Base1.SC2Data
669
+ // Helper File : MPQ_2013_v4_Base1.SC2Data-PATCH
670
+ // File Contains: PatchPrefix=Mods\Core.SC2Mod\Base.SC2Data
671
+ // Patch Prefix : Mods\Core.SC2Mod\Base.SC2Data
672
+ //
673
+
674
+ static bool ExtractPatchPrefixFromFile(const TCHAR * szHelperFile, char * szPatchPrefix, size_t nMaxChars, size_t * PtrLength)
675
+ {
676
+ TFileStream * pStream;
677
+ ULONGLONG FileSize = 0;
678
+ size_t nLength;
679
+ char szFileData[MAX_PATH+1];
680
+ bool bResult = false;
681
+
682
+ pStream = FileStream_OpenFile(szHelperFile, STREAM_FLAG_READ_ONLY);
683
+ if(pStream != NULL)
684
+ {
685
+ // Retrieve and check the file size
686
+ FileStream_GetSize(pStream, &FileSize);
687
+ if(12 <= FileSize && FileSize < MAX_PATH)
688
+ {
689
+ // Read the entire file to memory
690
+ if(FileStream_Read(pStream, NULL, szFileData, (DWORD)FileSize))
691
+ {
692
+ // Terminate the buffer with zero
693
+ szFileData[(DWORD)FileSize] = 0;
694
+
695
+ // The file data must begin with the "PatchPrefix" variable
696
+ if(!_strnicmp(szFileData, "PatchPrefix", 11))
697
+ {
698
+ char * szLinePtr = szFileData + 11;
699
+ char * szLineEnd;
700
+
701
+ // Skip spaces or '='
702
+ while(szLinePtr[0] == ' ' || szLinePtr[0] == '=')
703
+ szLinePtr++;
704
+ szLineEnd = szLinePtr;
705
+
706
+ // Find the end
707
+ while(szLineEnd[0] != 0 && szLineEnd[0] != 0x0A && szLineEnd[0] != 0x0D)
708
+ szLineEnd++;
709
+ nLength = (size_t)(szLineEnd - szLinePtr);
710
+
711
+ // Copy the variable
712
+ if(szLineEnd > szLinePtr && nLength <= nMaxChars)
713
+ {
714
+ memcpy(szPatchPrefix, szLinePtr, nLength);
715
+ szPatchPrefix[nLength] = 0;
716
+ PtrLength[0] = nLength;
717
+ bResult = true;
718
+ }
719
+ }
720
+ }
721
+ }
722
+
723
+ // Close the stream
724
+ FileStream_Close(pStream);
725
+ }
726
+
727
+ return bResult;
728
+ }
729
+
730
+
731
+ static bool FindPatchPrefix_SC2_HelperFile(TMPQArchive * haBase, TMPQArchive * haPatch)
732
+ {
733
+ TCHAR szHelperFile[MAX_PATH+1];
734
+ char szPatchPrefix[MAX_SC2_PATCH_PREFIX+0x41];
735
+ size_t nLength = 0;
736
+ bool bResult = false;
737
+
738
+ // Create the name of the patch helper file
739
+ _tcscpy(szHelperFile, FileStream_GetFileName(haBase->pStream));
740
+ if(_tcslen(szHelperFile) + 6 > MAX_PATH)
741
+ return false;
742
+ _tcscat(szHelperFile, _T("-PATCH"));
743
+
744
+ // Open the patch helper file and read the line
745
+ if(ExtractPatchPrefixFromFile(szHelperFile, szPatchPrefix, MAX_SC2_PATCH_PREFIX, &nLength))
746
+ bResult = CheckAndCreatePatchPrefix(haPatch, szPatchPrefix, nLength);
747
+
748
+ return bResult;
749
+ }
750
+
751
+ //
752
+ // Find match in Starcraft II patch MPQs
753
+ // Match a LST file in the root directory if the MPQ with any of the file in subdirectories
754
+ //
755
+ // The problem:
756
+ // File in the base MPQ: enGB-md5.lst
757
+ // File in the patch MPQ: Campaigns\Liberty.SC2Campaign\enGB.SC2Assets\enGB-md5.lst
758
+ // Campaigns\Liberty.SC2Campaign\enGB.SC2Data\enGB-md5.lst
759
+ // Campaigns\LibertyStory.SC2Campaign\enGB.SC2Data\enGB-md5.lst
760
+ // Campaigns\LibertyStory.SC2Campaign\enGB.SC2Data\enGB-md5.lst Mods\Core.SC2Mod\enGB.SC2Assets\enGB-md5.lst
761
+ // Mods\Core.SC2Mod\enGB.SC2Data\enGB-md5.lst
762
+ // Mods\Liberty.SC2Mod\enGB.SC2Assets\enGB-md5.lst
763
+ // Mods\Liberty.SC2Mod\enGB.SC2Data\enGB-md5.lst
764
+ // Mods\LibertyMulti.SC2Mod\enGB.SC2Data\enGB-md5.lst
765
+ //
766
+ // Solution:
767
+ // We need to match the file by its MD5
768
+ //
769
+
770
+ static bool FindPatchPrefix_SC2_MatchFiles(TMPQArchive * haBase, TMPQArchive * haPatch, TFileEntry * pBaseEntry)
771
+ {
772
+ TMPQNamePrefix * pPatchPrefix;
773
+ char * szPatchFileName;
774
+ char * szPlainName;
775
+ size_t cchWorkBuffer = 0x400;
776
+ bool bResult = false;
777
+
778
+ // First-level patches: Find the same file within the patch archive
779
+ // and verify by MD5-before-patch
780
+ if(haBase->haPatch == NULL)
781
+ {
782
+ TFileEntry * pFileTableEnd = haPatch->pFileTable + haPatch->dwFileTableSize;
783
+ TFileEntry * pFileEntry;
784
+
785
+ // Allocate working buffer for merging LST file
786
+ szPatchFileName = STORM_ALLOC(char, cchWorkBuffer);
787
+ if(szPatchFileName != NULL)
788
+ {
789
+ // Parse the entire file table
790
+ for(pFileEntry = haPatch->pFileTable; pFileEntry < pFileTableEnd; pFileEntry++)
791
+ {
792
+ // Look for "patch_metadata" file
793
+ if(IsPatchMetadataFile(pFileEntry))
794
+ {
795
+ // Construct the name of the MD5 file
796
+ strcpy(szPatchFileName, pFileEntry->szFileName);
797
+ szPlainName = (char *)GetPlainFileName(szPatchFileName);
798
+ strcpy(szPlainName, pBaseEntry->szFileName);
799
+
800
+ // Check for matching MD5 file
801
+ if(IsMatchingPatchFile(haPatch, szPatchFileName, pBaseEntry->md5))
802
+ {
803
+ bResult = CreatePatchPrefix(haPatch, szPatchFileName, (size_t)(szPlainName - szPatchFileName));
804
+ break;
805
+ }
806
+ }
807
+ }
808
+
809
+ // Delete the merge buffer
810
+ STORM_FREE(szPatchFileName);
811
+ }
812
+ }
813
+
814
+ // For second-level patches, just take the patch prefix from the lower level patch
815
+ else
816
+ {
817
+ // There must be at least two patches in the chain
818
+ assert(haBase->haPatch->pPatchPrefix != NULL);
819
+ pPatchPrefix = haBase->haPatch->pPatchPrefix;
820
+
821
+ // Copy the patch prefix
822
+ bResult = CreatePatchPrefix(haPatch,
823
+ pPatchPrefix->szPatchPrefix,
824
+ pPatchPrefix->nLength);
825
+ }
826
+
827
+ return bResult;
828
+ }
829
+
830
+ // Note: pBaseEntry is the file entry of the base version of "StreamingBuckets.txt"
831
+ static bool FindPatchPrefix_SC2(TMPQArchive * haBase, TMPQArchive * haPatch, TFileEntry * pBaseEntry)
832
+ {
833
+ // Method 1: Try it by the placement of the archive.
834
+ // Works when someone is opening an archive in the game (sub)directory
835
+ if(FindPatchPrefix_SC2_ArchiveName(haBase, haPatch))
836
+ return true;
837
+
838
+ // Method 2: Try to locate the Name.Ext-PATCH file and read the patch prefix from it
839
+ if(FindPatchPrefix_SC2_HelperFile(haBase, haPatch))
840
+ return true;
841
+
842
+ // Method 3: Try to pair any version of "StreamingBuckets.txt" from the patch MPQ
843
+ // with the "StreamingBuckets.txt" in the base MPQ. Does not always work
844
+ if(FindPatchPrefix_SC2_MatchFiles(haBase, haPatch, pBaseEntry))
845
+ return true;
846
+
847
+ return false;
848
+ }
849
+
850
+ //
851
+ // Patch prefix is the path subdirectory where the patched files are within MPQ.
852
+ //
853
+ // Example 1:
854
+ // Main MPQ: locale-enGB.MPQ
855
+ // Patch MPQ: wow-update-12694.MPQ
856
+ // File in main MPQ: DBFilesClient\Achievement.dbc
857
+ // File in patch MPQ: enGB\DBFilesClient\Achievement.dbc
858
+ // Path prefix: enGB
859
+ //
860
+ // Example 2:
861
+ // Main MPQ: expansion1.MPQ
862
+ // Patch MPQ: wow-update-12694.MPQ
863
+ // File in main MPQ: DBFilesClient\Achievement.dbc
864
+ // File in patch MPQ: Base\DBFilesClient\Achievement.dbc
865
+ // Path prefix: Base
866
+ //
867
+ // Example 3:
868
+ // Main MPQ: %GAME%\Battle.net\Battle.net.MPQ
869
+ // Patch MPQ: s2-update-base-26147.MPQ
870
+ // File in main MPQ: Battle.net\i18n\deDE\String\CLIENT_ACHIEVEMENTS.xml
871
+ // File in patch MPQ: Battle.net\Battle.net.MPQ\Battle.net\i18n\deDE\String\CLIENT_ACHIEVEMENTS.xml
872
+ // Path prefix: Battle.net\Battle.net.MPQ
873
+ //
874
+ // Example 4:
875
+ // Main MPQ: %GAME%\Campaigns\Liberty.SC2Campaign\enGB.SC2Data
876
+ // *OR* %ANY_DIR%\%ANY_NAME%Campaigns#Liberty.SC2Campaign#enGB.SC2Data
877
+ // Patch MPQ: s2-update-enGB-23258.MPQ
878
+ // File in main MPQ: LocalizedData\GameHotkeys.txt
879
+ // File in patch MPQ: Campaigns\Liberty.SC2Campaign\enGB.SC2Data\LocalizedData\GameHotkeys.txt
880
+ // Patch Prefix: Campaigns\Liberty.SC2Campaign\enGB.SC2Data
881
+ //
882
+
883
+ static bool FindPatchPrefix(TMPQArchive * haBase, TMPQArchive * haPatch, const char * szPatchPathPrefix)
884
+ {
885
+ TFileEntry * pFileEntry;
886
+
887
+ // If the patch prefix was explicitly entered, we use that one
888
+ if(szPatchPathPrefix != NULL)
889
+ return CreatePatchPrefix(haPatch, szPatchPathPrefix, 0);
890
+
891
+ // Patches for World of Warcraft - they mostly do not use prefix.
892
+ // All patches that use patch prefix have the "base\\(patch_metadata) file present
893
+ if(GetFileEntryLocale(haPatch, "base\\" PATCH_METADATA_NAME, 0))
894
+ return FindPatchPrefix_WoW_13164_13623(haBase, haPatch);
895
+
896
+ // Updates for Starcraft II
897
+ // Match: LocalizedData\GameHotkeys.txt <==> Campaigns\Liberty.SC2Campaign\enGB.SC2Data\LocalizedData\GameHotkeys.txt
898
+ // All Starcraft II base archives seem to have the file "StreamingBuckets.txt" present
899
+ pFileEntry = GetFileEntryLocale(haBase, "StreamingBuckets.txt", 0);
900
+ if(pFileEntry != NULL)
901
+ return FindPatchPrefix_SC2(haBase, haPatch, pFileEntry);
902
+
903
+ // Diablo III patch MPQs don't use patch prefix
904
+ // Hearthstone MPQs don't use patch prefix
905
+ CreatePatchPrefix(haPatch, NULL, 0);
906
+ return true;
907
+ }
908
+
909
+ //-----------------------------------------------------------------------------
910
+ // Public functions (StormLib internals)
911
+
912
+ bool IsIncrementalPatchFile(const void * pvData, DWORD cbData, LPDWORD pdwPatchedFileSize)
913
+ {
914
+ PMPQ_PATCH_HEADER pPatchHeader = (PMPQ_PATCH_HEADER)pvData;
915
+ BLIZZARD_BSDIFF40_FILE DiffFile;
916
+ DWORD dwPatchType;
917
+
918
+ if(cbData >= sizeof(MPQ_PATCH_HEADER) + sizeof(BLIZZARD_BSDIFF40_FILE))
919
+ {
920
+ dwPatchType = BSWAP_INT32_UNSIGNED(pPatchHeader->dwPatchType);
921
+ if(dwPatchType == 0x30445342)
922
+ {
923
+ // Give the caller the patch file size
924
+ if(pdwPatchedFileSize != NULL)
925
+ {
926
+ Decompress_RLE((LPBYTE)&DiffFile, sizeof(BLIZZARD_BSDIFF40_FILE), (LPBYTE)(pPatchHeader + 1), sizeof(BLIZZARD_BSDIFF40_FILE));
927
+ DiffFile.NewFileSize = BSWAP_INT64_UNSIGNED(DiffFile.NewFileSize);
928
+ *pdwPatchedFileSize = (DWORD)DiffFile.NewFileSize;
929
+ return true;
930
+ }
931
+ }
932
+ }
933
+
934
+ return false;
935
+ }
936
+
937
+ DWORD Patch_InitPatcher(TMPQPatcher * pPatcher, TMPQFile * hf)
938
+ {
939
+ DWORD cbMaxFileData = 0;
940
+
941
+ // Overflow check
942
+ if((cbMaxFileData + (DWORD)sizeof(MPQ_PATCH_HEADER)) < cbMaxFileData)
943
+ return ERROR_NOT_ENOUGH_MEMORY;
944
+ if(hf->hfPatch == NULL)
945
+ return ERROR_INVALID_PARAMETER;
946
+
947
+ // Initialize the entire structure with zeros
948
+ memset(pPatcher, 0, sizeof(TMPQPatcher));
949
+
950
+ // Copy the MD5 of the current file
951
+ memcpy(pPatcher->this_md5, hf->pFileEntry->md5, MD5_DIGEST_SIZE);
952
+
953
+ // Find out the biggest data size needed during the patching process
954
+ while(hf != NULL)
955
+ {
956
+ if(hf->pFileEntry->dwFileSize > cbMaxFileData)
957
+ cbMaxFileData = hf->pFileEntry->dwFileSize;
958
+ hf = hf->hfPatch;
959
+ }
960
+
961
+ // Allocate primary and secondary buffer
962
+ pPatcher->pbFileData1 = STORM_ALLOC(BYTE, cbMaxFileData);
963
+ pPatcher->pbFileData2 = STORM_ALLOC(BYTE, cbMaxFileData);
964
+ if(!pPatcher->pbFileData1 || !pPatcher->pbFileData2)
965
+ return ERROR_NOT_ENOUGH_MEMORY;
966
+
967
+ pPatcher->cbMaxFileData = cbMaxFileData;
968
+ return ERROR_SUCCESS;
969
+ }
970
+
971
+ //
972
+ // Note: The patch may either be applied to the base file or to the previous version
973
+ // In Starcraft II, Mods\Core.SC2Mod\Base.SC2Data, file StreamingBuckets.txt:
974
+ //
975
+ // Base file MD5: 31376b0344b6df59ad009d4296125539
976
+ //
977
+ // s2-update-base-23258: from 31376b0344b6df59ad009d4296125539 to 941a82683452e54bf024a8d491501824
978
+ // s2-update-base-24540: from 31376b0344b6df59ad009d4296125539 to 941a82683452e54bf024a8d491501824
979
+ // s2-update-base-26147: from 31376b0344b6df59ad009d4296125539 to d5d5253c762fac6b9761240288a0771a
980
+ // s2-update-base-28522: from 31376b0344b6df59ad009d4296125539 to 5a76c4b356920aab7afd22e0e1913d7a
981
+ // s2-update-base-30508: from 31376b0344b6df59ad009d4296125539 to 8cb0d4799893fe801cc78ae4488a3671
982
+ // s2-update-base-32283: from 31376b0344b6df59ad009d4296125539 to 8cb0d4799893fe801cc78ae4488a3671
983
+ //
984
+ // We don't keep all intermediate versions in memory, as it would cause massive
985
+ // memory usage during patching process. A prime example is the file
986
+ // DBFilesClient\\Item-Sparse.db2 from locale-enGB.MPQ (WoW 16965), which has
987
+ // 9 patches in a row, each requiring 70 MB memory (35 MB patch data + 35 MB work buffer)
988
+ //
989
+
990
+ DWORD Patch_Process(TMPQPatcher * pPatcher, TMPQFile * hf)
991
+ {
992
+ PMPQ_PATCH_HEADER pFullPatch;
993
+ MPQ_PATCH_HEADER PatchHeader1;
994
+ MPQ_PATCH_HEADER PatchHeader2 = {0};
995
+ TMPQFile * hfBase = hf;
996
+ DWORD cbBytesRead = 0;
997
+ DWORD dwErrCode = ERROR_SUCCESS;
998
+
999
+ // Move to the first patch
1000
+ assert(hfBase->pbFileData == NULL);
1001
+ assert(hfBase->cbFileData == 0);
1002
+ hf = hf->hfPatch;
1003
+
1004
+ // Read the header of the current patch
1005
+ SFileReadFile((HANDLE)hf, &PatchHeader1, sizeof(MPQ_PATCH_HEADER), &cbBytesRead, NULL);
1006
+ if(cbBytesRead != sizeof(MPQ_PATCH_HEADER))
1007
+ return ERROR_FILE_CORRUPT;
1008
+
1009
+ // Perform the patching process
1010
+ while(dwErrCode == ERROR_SUCCESS && hf != NULL)
1011
+ {
1012
+ // Try to read the next patch header. If the md5_before_patch
1013
+ // still matches we go directly to the next one and repeat
1014
+ while(hf->hfPatch != NULL)
1015
+ {
1016
+ // Attempt to read the patch header
1017
+ SFileReadFile((HANDLE)hf->hfPatch, &PatchHeader2, sizeof(MPQ_PATCH_HEADER), &cbBytesRead, NULL);
1018
+ if(cbBytesRead != sizeof(MPQ_PATCH_HEADER))
1019
+ return ERROR_FILE_CORRUPT;
1020
+
1021
+ // Compare the md5_before_patch
1022
+ if(memcmp(PatchHeader2.md5_before_patch, pPatcher->this_md5, MD5_DIGEST_SIZE))
1023
+ break;
1024
+
1025
+ // Move one patch fuhrter
1026
+ PatchHeader1 = PatchHeader2;
1027
+ hf = hf->hfPatch;
1028
+ }
1029
+
1030
+ // Allocate memory for the patch data
1031
+ pFullPatch = LoadFullFilePatch(hf, PatchHeader1);
1032
+ if(pFullPatch != NULL)
1033
+ {
1034
+ // Apply the patch
1035
+ dwErrCode = ApplyFilePatch(pPatcher, pFullPatch);
1036
+ STORM_FREE(pFullPatch);
1037
+ }
1038
+ else
1039
+ {
1040
+ dwErrCode = ERROR_FILE_CORRUPT;
1041
+ }
1042
+
1043
+ // Move to the next patch
1044
+ PatchHeader1 = PatchHeader2;
1045
+ pPatcher->nCounter++;
1046
+ hf = hf->hfPatch;
1047
+ }
1048
+
1049
+ // Put the result data to the file structure
1050
+ if(dwErrCode == ERROR_SUCCESS)
1051
+ {
1052
+ // Swap the pointer to the file data structure
1053
+ if(pPatcher->nCounter & 0x01)
1054
+ {
1055
+ hfBase->pbFileData = pPatcher->pbFileData2;
1056
+ pPatcher->pbFileData2 = NULL;
1057
+ }
1058
+ else
1059
+ {
1060
+ hfBase->pbFileData = pPatcher->pbFileData1;
1061
+ pPatcher->pbFileData1 = NULL;
1062
+ }
1063
+
1064
+ // Also supply the data size
1065
+ hfBase->cbFileData = pPatcher->cbFileData;
1066
+ }
1067
+
1068
+ return ERROR_SUCCESS;
1069
+ }
1070
+
1071
+ void Patch_Finalize(TMPQPatcher * pPatcher)
1072
+ {
1073
+ if(pPatcher != NULL)
1074
+ {
1075
+ if(pPatcher->pbFileData1 != NULL)
1076
+ STORM_FREE(pPatcher->pbFileData1);
1077
+ if(pPatcher->pbFileData2 != NULL)
1078
+ STORM_FREE(pPatcher->pbFileData2);
1079
+
1080
+ memset(pPatcher, 0, sizeof(TMPQPatcher));
1081
+ }
1082
+ }
1083
+
1084
+ //-----------------------------------------------------------------------------
1085
+ // Public functions
1086
+
1087
+ bool WINAPI SFileOpenPatchArchive(
1088
+ HANDLE hMpq,
1089
+ const TCHAR * szPatchMpqName,
1090
+ const char * szPatchPathPrefix,
1091
+ DWORD dwFlags)
1092
+ {
1093
+ TMPQArchive * haPatch;
1094
+ TMPQArchive * ha = (TMPQArchive *)hMpq;
1095
+ HANDLE hPatchMpq = NULL;
1096
+ DWORD dwErrCode = ERROR_SUCCESS;
1097
+
1098
+ // Verify input parameters
1099
+ if(!IsValidMpqHandle(hMpq))
1100
+ dwErrCode = ERROR_INVALID_HANDLE;
1101
+ if(szPatchMpqName == NULL || *szPatchMpqName == 0)
1102
+ dwErrCode = ERROR_INVALID_PARAMETER;
1103
+
1104
+ //
1105
+ // We don't allow adding patches to archives that have been open for write
1106
+ //
1107
+ // Error scenario:
1108
+ //
1109
+ // 1) Open archive for writing
1110
+ // 2) Modify or replace a file
1111
+ // 3) Add patch archive to the opened MPQ
1112
+ // 4) Read patched file
1113
+ // 5) Now what?
1114
+ //
1115
+
1116
+ if(dwErrCode == ERROR_SUCCESS)
1117
+ {
1118
+ if(!(ha->dwFlags & MPQ_FLAG_READ_ONLY))
1119
+ dwErrCode = ERROR_ACCESS_DENIED;
1120
+ }
1121
+
1122
+ // Open the archive like it is normal archive
1123
+ if(dwErrCode == ERROR_SUCCESS)
1124
+ {
1125
+ // These flags will be propagated to SFileOpenArchive
1126
+ dwFlags = (dwFlags & MPQ_OPEN_NO_LISTFILE) | MPQ_OPEN_READ_ONLY | MPQ_OPEN_PATCH;
1127
+
1128
+ // Open the patch as MPQ
1129
+ if(SFileOpenArchive(szPatchMpqName, 0, dwFlags, &hPatchMpq))
1130
+ {
1131
+ // Cast the archive handle to structure pointer
1132
+ haPatch = (TMPQArchive *)hPatchMpq;
1133
+
1134
+ // We need to remember the proper patch prefix to match names of patched files
1135
+ if(FindPatchPrefix(ha, (TMPQArchive *)hPatchMpq, szPatchPathPrefix))
1136
+ {
1137
+ // Now add the patch archive to the list of patches to the original MPQ
1138
+ while(ha != NULL)
1139
+ {
1140
+ if(ha->haPatch == NULL)
1141
+ {
1142
+ haPatch->haBase = ha;
1143
+ ha->haPatch = haPatch;
1144
+ return true;
1145
+ }
1146
+
1147
+ // Move to the next archive
1148
+ ha = ha->haPatch;
1149
+ }
1150
+ }
1151
+
1152
+ // Close the archive
1153
+ SFileCloseArchive(hPatchMpq);
1154
+ dwErrCode = ERROR_CANT_FIND_PATCH_PREFIX;
1155
+ }
1156
+ else
1157
+ {
1158
+ dwErrCode = GetLastError();
1159
+ }
1160
+ }
1161
+
1162
+ SetLastError(dwErrCode);
1163
+ return false;
1164
+ }
1165
+
1166
+ bool WINAPI SFileIsPatchedArchive(HANDLE hMpq)
1167
+ {
1168
+ TMPQArchive * ha = (TMPQArchive *)hMpq;
1169
+
1170
+ // Verify input parameters
1171
+ if(!IsValidMpqHandle(hMpq))
1172
+ return false;
1173
+
1174
+ return (ha->haPatch != NULL);
1175
+ }