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,1059 @@
1
+ /*****************************************************************************/
2
+ /* SFileVerify.cpp Copyright (c) Ladislav Zezula 2010 */
3
+ /*---------------------------------------------------------------------------*/
4
+ /* MPQ files and MPQ archives verification. */
5
+ /* */
6
+ /* The MPQ signature verification has been written by Jean-Francois Roy */
7
+ /* <bahamut@macstorm.org> and Justin Olbrantz (Quantam). */
8
+ /* The MPQ public keys have been created by MPQKit, using OpenSSL library. */
9
+ /* */
10
+ /*---------------------------------------------------------------------------*/
11
+ /* Date Ver Who Comment */
12
+ /* -------- ---- --- ------- */
13
+ /* 04.05.10 1.00 Lad The first version of SFileVerify.cpp */
14
+ /*****************************************************************************/
15
+
16
+ #define __STORMLIB_SELF__
17
+ #include "StormLib.h"
18
+ #include "StormCommon.h"
19
+
20
+ //-----------------------------------------------------------------------------
21
+ // Local defines
22
+
23
+ #define MPQ_DIGEST_UNIT_SIZE 0x10000
24
+
25
+ //-----------------------------------------------------------------------------
26
+ // Known Blizzard public keys
27
+ // Created by Jean-Francois Roy using OpenSSL
28
+
29
+ static const char * szBlizzardWeakPrivateKey =
30
+ "-----BEGIN PRIVATE KEY-----"
31
+ "MIIBOQIBAAJBAJJidwS/uILMBSO5DLGsBFknIXWWjQJe2kfdfEk3G/j66w4KkhZ1"
32
+ "V61Rt4zLaMVCYpDun7FLwRjkMDSepO1q2DcCAwEAAQJANtiztVDMJh2hE1hjPDKy"
33
+ "UmEJ9U/aN3gomuKOjbQbQ/bWWcM/WfhSVHmPqtqh/bQI2UXFr0rnXngeteZHLr/b"
34
+ "8QIhAMuWriSKGMACw18/rVVfUrThs915odKBH1Alr3vMVVzZAiEAuBHPSQkgwcb6"
35
+ "L4MWaiKuOzq08mSyNqPeN8oSy18q848CIHeMn+3s+eOmu7su1UYQl6yH7OrdBd1q"
36
+ "3UxfFNEJiAbhAiAqxdCyOxHGlbM7aS3DOg3cq5ayoN2cvtV7h1R4t8OmVwIgF+5z"
37
+ "/6vkzBUsZhd8Nwyis+MeQYH0rpFpMKdTlqmPF2Q="
38
+ "-----END PRIVATE KEY-----";
39
+
40
+ static const char * szBlizzardWeakPublicKey =
41
+ "-----BEGIN PUBLIC KEY-----"
42
+ "MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAJJidwS/uILMBSO5DLGsBFknIXWWjQJe"
43
+ "2kfdfEk3G/j66w4KkhZ1V61Rt4zLaMVCYpDun7FLwRjkMDSepO1q2DcCAwEAAQ=="
44
+ "-----END PUBLIC KEY-----";
45
+
46
+ static const char * szBlizzardStrongPublicKey =
47
+ "-----BEGIN PUBLIC KEY-----"
48
+ "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAsQZ+ziT2h8h+J/iMQpgd"
49
+ "tH1HaJzOBE3agjU4yMPcrixaPOZoA4t8bwfey7qczfWywocYo3pleytFF+IuD4HD"
50
+ "Fl9OXN1SFyupSgMx1EGZlgbFAomnbq9MQJyMqQtMhRAjFgg4TndS7YNb+JMSAEKp"
51
+ "kXNqY28n/EVBHD5TsMuVCL579gIenbr61dI92DDEdy790IzIG0VKWLh/KOTcTJfm"
52
+ "Ds/7HQTkGouVW+WUsfekuqNQo7ND9DBnhLjLjptxeFE2AZqYcA1ao3S9LN3GL1tW"
53
+ "lVXFIX9c7fWqaVTQlZ2oNsI/ARVApOK3grNgqvwH6YoVYVXjNJEo5sQJsPsdV/hk"
54
+ "dwIDAQAB"
55
+ "-----END PUBLIC KEY-----";
56
+
57
+ static const char * szWarcraft3MapPublicKey =
58
+ "-----BEGIN PUBLIC KEY-----"
59
+ "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA1BwklUUQ3UvjizOBRoF5"
60
+ "yyOVc7KD+oGOQH5i6eUk1yfs0luCC70kNucNrfqhmviywVtahRse1JtXCPrx2bd3"
61
+ "iN8Dx91fbkxjYIOGTsjYoHKTp0BbaFkJih776fcHgnFSb+7mJcDuJVvJOXxEH6w0"
62
+ "1vo6VtujCqj1arqbyoal+xtAaczF3us5cOEp45sR1zAWTn1+7omN7VWV4QqJPaDS"
63
+ "gBSESc0l1grO0i1VUSumayk7yBKIkb+LBvcG6WnYZHCi7VdLmaxER5m8oZfER66b"
64
+ "heHoiSQIZf9PAY6Guw2DT5BTc54j/AaLQAKf2qcRSgQLVo5kQaddF3rCpsXoB/74"
65
+ "6QIDAQAB"
66
+ "-----END PUBLIC KEY-----";
67
+
68
+ static const char * szWowPatchPublicKey =
69
+ "-----BEGIN PUBLIC KEY-----"
70
+ "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAwOsMV0LagAWPEtEQM6b9"
71
+ "6FHFkUyGbbyda2/Dfc9dyl21E9QvX+Yw7qKRMAKPzA2TlQQLZKvXpnKXF/YIK5xa"
72
+ "5uwg9CEHCEAYolLG4xn0FUOE0E/0PuuytI0p0ICe6rk00PifZzTr8na2wI/l/GnQ"
73
+ "bvnIVF1ck6cslATpQJ5JJVMXzoFlUABS19WESw4MXuJAS3AbMhxNWdEhVv7eO51c"
74
+ "yGjRLy9QjogZODZTY0fSEksgBqQxNCoYVJYI/sF5K2flDsGqrIp0OdJ6teJlzg1Y"
75
+ "UjYnb6bKjlidXoHEXI2TgA/mD6O3XFIt08I9s3crOCTgICq7cgX35qrZiIVWZdRv"
76
+ "TwIDAQAB"
77
+ "-----END PUBLIC KEY-----";
78
+
79
+ static const char * szWowSurveyPublicKey =
80
+ "-----BEGIN PUBLIC KEY-----"
81
+ "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAnIt1DR6nRyyKsy2qahHe"
82
+ "MKLtacatn/KxieHcwH87wLBxKy+jZ0gycTmJ7SaTdBAEMDs/V5IPIXEtoqYnid2c"
83
+ "63TmfGDU92oc3Ph1PWUZ2PWxBhT06HYxRdbrgHw9/I29pNPi/607x+lzPORITOgU"
84
+ "BR6MR8au8HsQP4bn4vkJNgnSgojh48/XQOB/cAln7As1neP61NmVimoLR4Bwi3zt"
85
+ "zfgrZaUpyeNCUrOYJmH09YIjbBySTtXOUidoPHjFrMsCWpr6xs8xbETbs7MJFL6a"
86
+ "vcUfTT67qfIZ9RsuKfnXJTIrV0kwDSjjuNXiPTmWAehSsiHIsrUXX5RNcwsSjClr"
87
+ "nQIDAQAB"
88
+ "-----END PUBLIC KEY-----";
89
+
90
+ static const char * szStarcraft2MapPublicKey =
91
+ "-----BEGIN PUBLIC KEY-----"
92
+ "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAmk4GT8zb+ICC25a17KZB"
93
+ "q/ygKGJ2VSO6IT5PGHJlm1KfnHBA4B6SH3xMlJ4c6eG2k7QevZv+FOhjsAHubyWq"
94
+ "2VKqWbrIFKv2ILc2RfMn8J9EDVRxvcxh6slRrVL69D0w1tfVGjMiKq2Fym5yGoRT"
95
+ "E7CRgDqbAbXP9LBsCNWHiJLwfxMGzHbk8pIl9oia5pvM7ofZamSHchxlpy6xa4GJ"
96
+ "7xKN01YCNvklTL1D7uol3wkwcHc7vrF8QwuJizuA5bSg4poEGtH62BZOYi+UL/z0"
97
+ "31YK+k9CbQyM0X0pJoJoYz1TK+Y5J7vBnXCZtfcTYQ/ZzN6UcxTa57dJaiOlCh9z"
98
+ "nQIDAQAB"
99
+ "-----END PUBLIC KEY-----";
100
+
101
+ //-----------------------------------------------------------------------------
102
+ // Local functions
103
+
104
+ static void memrev(unsigned char *buf, size_t count)
105
+ {
106
+ unsigned char *r;
107
+
108
+ for (r = buf + count - 1; buf < r; buf++, r--)
109
+ {
110
+ *buf ^= *r;
111
+ *r ^= *buf;
112
+ *buf ^= *r;
113
+ }
114
+ }
115
+
116
+ static bool decode_base64_key(const char * szKeyBase64, rsa_key * key)
117
+ {
118
+ unsigned char decoded_key[0x200];
119
+ const char * szBase64Begin;
120
+ const char * szBase64End;
121
+ unsigned long decoded_length = sizeof(decoded_key);
122
+ unsigned long length;
123
+
124
+ // Find out the begin of the BASE64 data
125
+ szBase64Begin = szKeyBase64 + strlen("-----BEGIN PUBLIC KEY-----");
126
+ szBase64End = szBase64Begin + strlen(szBase64Begin) - strlen("-----END PUBLIC KEY-----");
127
+ if(szBase64End[0] != '-')
128
+ return false;
129
+
130
+ // decode the base64 string
131
+ length = (unsigned long)(szBase64End - szBase64Begin);
132
+ if(base64_decode((unsigned char *)szBase64Begin, length, decoded_key, &decoded_length) != CRYPT_OK)
133
+ return false;
134
+
135
+ // Create RSA key
136
+ if(rsa_import(decoded_key, decoded_length, key) != CRYPT_OK)
137
+ return false;
138
+
139
+ return true;
140
+ }
141
+
142
+ static void GetPlainAnsiFileName(
143
+ const TCHAR * szFileName,
144
+ char * szPlainName)
145
+ {
146
+ const TCHAR * szPlainNameT = GetPlainFileName(szFileName);
147
+
148
+ // Convert the plain name to ANSI
149
+ while(*szPlainNameT != 0)
150
+ *szPlainName++ = (char)*szPlainNameT++;
151
+ *szPlainName = 0;
152
+ }
153
+
154
+ // Calculate begin and end of the MPQ archive
155
+ static void CalculateArchiveRange(
156
+ TMPQArchive * ha,
157
+ PMPQ_SIGNATURE_INFO pSI)
158
+ {
159
+ ULONGLONG TempPos = 0;
160
+ char szMapHeader[0x200];
161
+
162
+ // Get the MPQ begin
163
+ pSI->BeginMpqData = ha->MpqPos;
164
+
165
+ // Warcraft III maps are signed from the map header to the end
166
+ if(FileStream_Read(ha->pStream, &TempPos, szMapHeader, sizeof(szMapHeader)))
167
+ {
168
+ // Is it a map header ?
169
+ if(szMapHeader[0] == 'H' && szMapHeader[1] == 'M' && szMapHeader[2] == '3' && szMapHeader[3] == 'W')
170
+ {
171
+ // We will have to hash since the map header
172
+ pSI->BeginMpqData = 0;
173
+ }
174
+ }
175
+
176
+ // Get the MPQ data end. This is stored in the MPQ header
177
+ pSI->EndMpqData = ha->MpqPos + ha->pHeader->ArchiveSize64;
178
+
179
+ // Get the size of the entire file
180
+ FileStream_GetSize(ha->pStream, &pSI->EndOfFile);
181
+ }
182
+
183
+ static bool CalculateMpqHashMd5(
184
+ TMPQArchive * ha,
185
+ PMPQ_SIGNATURE_INFO pSI,
186
+ LPBYTE pMd5Digest)
187
+ {
188
+ hash_state md5_state;
189
+ ULONGLONG BeginBuffer;
190
+ ULONGLONG EndBuffer;
191
+ LPBYTE pbDigestBuffer = NULL;
192
+
193
+ // Allocate buffer for creating the MPQ digest.
194
+ pbDigestBuffer = STORM_ALLOC(BYTE, MPQ_DIGEST_UNIT_SIZE);
195
+ if(pbDigestBuffer == NULL)
196
+ return false;
197
+
198
+ // Initialize the MD5 hash state
199
+ md5_init(&md5_state);
200
+
201
+ // Set the byte offset of begin of the data
202
+ BeginBuffer = pSI->BeginMpqData;
203
+
204
+ // Create the digest
205
+ for(;;)
206
+ {
207
+ ULONGLONG BytesRemaining;
208
+ LPBYTE pbSigBegin = NULL;
209
+ LPBYTE pbSigEnd = NULL;
210
+ DWORD dwToRead = MPQ_DIGEST_UNIT_SIZE;
211
+
212
+ // Check the number of bytes remaining
213
+ BytesRemaining = pSI->EndMpqData - BeginBuffer;
214
+ if(BytesRemaining < MPQ_DIGEST_UNIT_SIZE)
215
+ dwToRead = (DWORD)BytesRemaining;
216
+ if(dwToRead == 0)
217
+ break;
218
+
219
+ // Read the next chunk
220
+ if(!FileStream_Read(ha->pStream, &BeginBuffer, pbDigestBuffer, dwToRead))
221
+ {
222
+ STORM_FREE(pbDigestBuffer);
223
+ return false;
224
+ }
225
+
226
+ // Move the current byte offset
227
+ EndBuffer = BeginBuffer + dwToRead;
228
+
229
+ // Check if the signature is within the loaded digest
230
+ if(BeginBuffer <= pSI->BeginExclude && pSI->BeginExclude < EndBuffer)
231
+ pbSigBegin = pbDigestBuffer + (size_t)(pSI->BeginExclude - BeginBuffer);
232
+ if(BeginBuffer <= pSI->EndExclude && pSI->EndExclude < EndBuffer)
233
+ pbSigEnd = pbDigestBuffer + (size_t)(pSI->EndExclude - BeginBuffer);
234
+
235
+ // Zero the part that belongs to the signature
236
+ if(pbSigBegin != NULL || pbSigEnd != NULL)
237
+ {
238
+ if(pbSigBegin == NULL)
239
+ pbSigBegin = pbDigestBuffer;
240
+ if(pbSigEnd == NULL)
241
+ pbSigEnd = pbDigestBuffer + dwToRead;
242
+
243
+ memset(pbSigBegin, 0, (pbSigEnd - pbSigBegin));
244
+ }
245
+
246
+ // Pass the buffer to the hashing function
247
+ md5_process(&md5_state, pbDigestBuffer, dwToRead);
248
+
249
+ // Move pointers
250
+ BeginBuffer += dwToRead;
251
+ }
252
+
253
+ // Finalize the MD5 hash
254
+ md5_done(&md5_state, pMd5Digest);
255
+ STORM_FREE(pbDigestBuffer);
256
+ return true;
257
+ }
258
+
259
+ static void AddTailToSha1(
260
+ hash_state * psha1_state,
261
+ const char * szTail)
262
+ {
263
+ unsigned char * pbTail = (unsigned char *)szTail;
264
+ unsigned char szUpperCase[0x200];
265
+ unsigned long nLength = 0;
266
+
267
+ // Convert the tail to uppercase
268
+ // Note that we don't need to terminate the string with zero
269
+ while(*pbTail != 0)
270
+ {
271
+ szUpperCase[nLength++] = AsciiToUpperTable[*pbTail++];
272
+ }
273
+
274
+ // Append the tail to the SHA1
275
+ sha1_process(psha1_state, szUpperCase, nLength);
276
+ }
277
+
278
+ static bool CalculateMpqHashSha1(
279
+ TMPQArchive * ha,
280
+ PMPQ_SIGNATURE_INFO pSI,
281
+ unsigned char * sha1_tail0,
282
+ unsigned char * sha1_tail1,
283
+ unsigned char * sha1_tail2)
284
+ {
285
+ ULONGLONG BeginBuffer;
286
+ hash_state sha1_state_temp;
287
+ hash_state sha1_state;
288
+ LPBYTE pbDigestBuffer = NULL;
289
+ char szPlainName[MAX_PATH];
290
+
291
+ // Allocate buffer for creating the MPQ digest.
292
+ pbDigestBuffer = STORM_ALLOC(BYTE, MPQ_DIGEST_UNIT_SIZE);
293
+ if(pbDigestBuffer == NULL)
294
+ return false;
295
+
296
+ // Initialize SHA1 state structure
297
+ sha1_init(&sha1_state);
298
+
299
+ // Calculate begin of data to be hashed
300
+ BeginBuffer = pSI->BeginMpqData;
301
+
302
+ // Create the digest
303
+ for(;;)
304
+ {
305
+ ULONGLONG BytesRemaining;
306
+ DWORD dwToRead = MPQ_DIGEST_UNIT_SIZE;
307
+
308
+ // Check the number of bytes remaining
309
+ BytesRemaining = pSI->EndMpqData - BeginBuffer;
310
+ if(BytesRemaining < MPQ_DIGEST_UNIT_SIZE)
311
+ dwToRead = (DWORD)BytesRemaining;
312
+ if(dwToRead == 0)
313
+ break;
314
+
315
+ // Read the next chunk
316
+ if(!FileStream_Read(ha->pStream, &BeginBuffer, pbDigestBuffer, dwToRead))
317
+ {
318
+ STORM_FREE(pbDigestBuffer);
319
+ return false;
320
+ }
321
+
322
+ // Pass the buffer to the hashing function
323
+ sha1_process(&sha1_state, pbDigestBuffer, dwToRead);
324
+
325
+ // Move pointers
326
+ BeginBuffer += dwToRead;
327
+ }
328
+
329
+ // Add all three known tails and generate three hashes
330
+ memcpy(&sha1_state_temp, &sha1_state, sizeof(hash_state));
331
+ sha1_done(&sha1_state_temp, sha1_tail0);
332
+
333
+ memcpy(&sha1_state_temp, &sha1_state, sizeof(hash_state));
334
+ GetPlainAnsiFileName(FileStream_GetFileName(ha->pStream), szPlainName);
335
+ AddTailToSha1(&sha1_state_temp, szPlainName);
336
+ sha1_done(&sha1_state_temp, sha1_tail1);
337
+
338
+ memcpy(&sha1_state_temp, &sha1_state, sizeof(hash_state));
339
+ AddTailToSha1(&sha1_state_temp, "ARCHIVE");
340
+ sha1_done(&sha1_state_temp, sha1_tail2);
341
+
342
+ // Finalize the MD5 hash
343
+ STORM_FREE(pbDigestBuffer);
344
+ return true;
345
+ }
346
+
347
+ static DWORD VerifyRawMpqData(
348
+ TMPQArchive * ha,
349
+ ULONGLONG ByteOffset,
350
+ DWORD dwDataSize)
351
+ {
352
+ ULONGLONG DataOffset = ha->MpqPos + ByteOffset;
353
+ LPBYTE pbDataChunk;
354
+ LPBYTE pbMD5Array1; // Calculated MD5 array
355
+ LPBYTE pbMD5Array2; // MD5 array loaded from the MPQ
356
+ DWORD dwBytesInChunk;
357
+ DWORD dwChunkCount;
358
+ DWORD dwChunkSize = ha->pHeader->dwRawChunkSize;
359
+ DWORD dwMD5Size;
360
+ DWORD dwErrCode = ERROR_SUCCESS;
361
+
362
+ // Don't verify zero-sized blocks
363
+ if(dwDataSize == 0)
364
+ return ERROR_SUCCESS;
365
+
366
+ // Get the number of data chunks to calculate MD5
367
+ assert(dwChunkSize != 0);
368
+ dwChunkCount = ((dwDataSize - 1) / dwChunkSize) + 1;
369
+ dwMD5Size = dwChunkCount * MD5_DIGEST_SIZE;
370
+
371
+ // Allocate space for data chunk and for the MD5 array
372
+ pbDataChunk = STORM_ALLOC(BYTE, dwChunkSize);
373
+ if(pbDataChunk == NULL)
374
+ return ERROR_NOT_ENOUGH_MEMORY;
375
+
376
+ // Allocate space for MD5 array
377
+ pbMD5Array1 = STORM_ALLOC(BYTE, dwMD5Size);
378
+ pbMD5Array2 = STORM_ALLOC(BYTE, dwMD5Size);
379
+ if(pbMD5Array1 == NULL || pbMD5Array2 == NULL)
380
+ dwErrCode = ERROR_NOT_ENOUGH_MEMORY;
381
+
382
+ // Calculate MD5 of each data chunk
383
+ if(dwErrCode == ERROR_SUCCESS)
384
+ {
385
+ LPBYTE pbMD5 = pbMD5Array1;
386
+
387
+ for(DWORD i = 0; i < dwChunkCount; i++)
388
+ {
389
+ // Get the number of bytes in the chunk
390
+ dwBytesInChunk = STORMLIB_MIN(dwChunkSize, dwDataSize);
391
+
392
+ // Read the data chunk
393
+ if(!FileStream_Read(ha->pStream, &DataOffset, pbDataChunk, dwBytesInChunk))
394
+ {
395
+ dwErrCode = ERROR_FILE_CORRUPT;
396
+ break;
397
+ }
398
+
399
+ // Calculate MD5
400
+ CalculateDataBlockHash(pbDataChunk, dwBytesInChunk, pbMD5);
401
+
402
+ // Move pointers and offsets
403
+ DataOffset += dwBytesInChunk;
404
+ dwDataSize -= dwBytesInChunk;
405
+ pbMD5 += MD5_DIGEST_SIZE;
406
+ }
407
+ }
408
+
409
+ // Read the MD5 array
410
+ if(dwErrCode == ERROR_SUCCESS)
411
+ {
412
+ // Read the array of MD5
413
+ if(!FileStream_Read(ha->pStream, &DataOffset, pbMD5Array2, dwMD5Size))
414
+ dwErrCode = GetLastError();
415
+ }
416
+
417
+ // Compare the array of MD5
418
+ if(dwErrCode == ERROR_SUCCESS)
419
+ {
420
+ // Compare the MD5
421
+ if(memcmp(pbMD5Array1, pbMD5Array2, dwMD5Size))
422
+ dwErrCode = ERROR_FILE_CORRUPT;
423
+ }
424
+
425
+ // Free memory and return result
426
+ if(pbMD5Array2 != NULL)
427
+ STORM_FREE(pbMD5Array2);
428
+ if(pbMD5Array1 != NULL)
429
+ STORM_FREE(pbMD5Array1);
430
+ if(pbDataChunk != NULL)
431
+ STORM_FREE(pbDataChunk);
432
+ return dwErrCode;
433
+ }
434
+
435
+ static DWORD VerifyWeakSignature(
436
+ TMPQArchive * ha,
437
+ PMPQ_SIGNATURE_INFO pSI)
438
+ {
439
+ BYTE RevSignature[MPQ_WEAK_SIGNATURE_SIZE];
440
+ BYTE Md5Digest[MD5_DIGEST_SIZE];
441
+ rsa_key key;
442
+ int hash_idx = find_hash("md5");
443
+ int result = 0;
444
+
445
+ // The signature might be zeroed out. In that case, we ignore it
446
+ if(!IsValidSignature(pSI->Signature))
447
+ return ERROR_WEAK_SIGNATURE_OK;
448
+
449
+ // Calculate hash of the entire archive, skipping the (signature) file
450
+ if(!CalculateMpqHashMd5(ha, pSI, Md5Digest))
451
+ return ERROR_VERIFY_FAILED;
452
+
453
+ // Import the Blizzard key in OpenSSL format
454
+ if(!decode_base64_key(szBlizzardWeakPublicKey, &key))
455
+ return ERROR_VERIFY_FAILED;
456
+
457
+ // Verify the signature
458
+ memcpy(RevSignature, &pSI->Signature[8], MPQ_WEAK_SIGNATURE_SIZE);
459
+ memrev(RevSignature, MPQ_WEAK_SIGNATURE_SIZE);
460
+ rsa_verify_hash_ex(RevSignature, MPQ_WEAK_SIGNATURE_SIZE, Md5Digest, sizeof(Md5Digest), LTC_LTC_PKCS_1_V1_5, hash_idx, 0, &result, &key);
461
+ rsa_free(&key);
462
+
463
+ // Return the result
464
+ return result ? ERROR_WEAK_SIGNATURE_OK : ERROR_WEAK_SIGNATURE_ERROR;
465
+ }
466
+
467
+ static DWORD VerifyStrongSignatureWithKey(
468
+ unsigned char * reversed_signature,
469
+ unsigned char * padded_digest,
470
+ const char * szPublicKey)
471
+ {
472
+ rsa_key key;
473
+ int result = 0;
474
+
475
+ // Import the Blizzard key in OpenSSL format
476
+ if(!decode_base64_key(szPublicKey, &key))
477
+ {
478
+ assert(false);
479
+ return ERROR_VERIFY_FAILED;
480
+ }
481
+
482
+ // Verify the signature
483
+ if(rsa_verify_simple(reversed_signature, MPQ_STRONG_SIGNATURE_SIZE, padded_digest, MPQ_STRONG_SIGNATURE_SIZE, &result, &key) != CRYPT_OK)
484
+ return ERROR_VERIFY_FAILED;
485
+
486
+ // Free the key and return result
487
+ rsa_free(&key);
488
+ return result ? ERROR_STRONG_SIGNATURE_OK : ERROR_STRONG_SIGNATURE_ERROR;
489
+ }
490
+
491
+ static DWORD VerifyStrongSignature(
492
+ TMPQArchive * ha,
493
+ PMPQ_SIGNATURE_INFO pSI)
494
+ {
495
+ unsigned char reversed_signature[MPQ_STRONG_SIGNATURE_SIZE];
496
+ unsigned char Sha1Digest_tail0[SHA1_DIGEST_SIZE];
497
+ unsigned char Sha1Digest_tail1[SHA1_DIGEST_SIZE];
498
+ unsigned char Sha1Digest_tail2[SHA1_DIGEST_SIZE];
499
+ unsigned char padded_digest[MPQ_STRONG_SIGNATURE_SIZE];
500
+ DWORD dwResult;
501
+ size_t digest_offset;
502
+
503
+ // Calculate SHA1 hash of the archive
504
+ if(!CalculateMpqHashSha1(ha, pSI, Sha1Digest_tail0, Sha1Digest_tail1, Sha1Digest_tail2))
505
+ return ERROR_VERIFY_FAILED;
506
+
507
+ // Prepare the signature for decryption
508
+ memcpy(reversed_signature, &pSI->Signature[4], MPQ_STRONG_SIGNATURE_SIZE);
509
+ memrev(reversed_signature, MPQ_STRONG_SIGNATURE_SIZE);
510
+
511
+ // Prepare the padded digest for comparison
512
+ digest_offset = sizeof(padded_digest) - SHA1_DIGEST_SIZE;
513
+ memset(padded_digest, 0xbb, digest_offset);
514
+ padded_digest[0] = 0x0b;
515
+
516
+ // Try Blizzard Strong public key with no SHA1 tail
517
+ memcpy(padded_digest + digest_offset, Sha1Digest_tail0, SHA1_DIGEST_SIZE);
518
+ memrev(padded_digest + digest_offset, SHA1_DIGEST_SIZE);
519
+ dwResult = VerifyStrongSignatureWithKey(reversed_signature, padded_digest, szBlizzardStrongPublicKey);
520
+ if(dwResult == ERROR_STRONG_SIGNATURE_OK)
521
+ return dwResult;
522
+
523
+ // Try War 3 map public key with plain file name as SHA1 tail
524
+ memcpy(padded_digest + digest_offset, Sha1Digest_tail1, SHA1_DIGEST_SIZE);
525
+ memrev(padded_digest + digest_offset, SHA1_DIGEST_SIZE);
526
+ dwResult = VerifyStrongSignatureWithKey(reversed_signature, padded_digest, szWarcraft3MapPublicKey);
527
+ if(dwResult == ERROR_STRONG_SIGNATURE_OK)
528
+ return dwResult;
529
+
530
+ // Try WoW-TBC public key with "ARCHIVE" as SHA1 tail
531
+ memcpy(padded_digest + digest_offset, Sha1Digest_tail2, SHA1_DIGEST_SIZE);
532
+ memrev(padded_digest + digest_offset, SHA1_DIGEST_SIZE);
533
+ dwResult = VerifyStrongSignatureWithKey(reversed_signature, padded_digest, szWowPatchPublicKey);
534
+ if(dwResult == ERROR_STRONG_SIGNATURE_OK)
535
+ return dwResult;
536
+
537
+ // Try Survey public key with no SHA1 tail
538
+ memcpy(padded_digest + digest_offset, Sha1Digest_tail0, SHA1_DIGEST_SIZE);
539
+ memrev(padded_digest + digest_offset, SHA1_DIGEST_SIZE);
540
+ dwResult = VerifyStrongSignatureWithKey(reversed_signature, padded_digest, szWowSurveyPublicKey);
541
+ if(dwResult == ERROR_STRONG_SIGNATURE_OK)
542
+ return dwResult;
543
+
544
+ // Try Starcraft II public key with no SHA1 tail
545
+ memcpy(padded_digest + digest_offset, Sha1Digest_tail0, SHA1_DIGEST_SIZE);
546
+ memrev(padded_digest + digest_offset, SHA1_DIGEST_SIZE);
547
+ dwResult = VerifyStrongSignatureWithKey(reversed_signature, padded_digest, szStarcraft2MapPublicKey);
548
+ if(dwResult == ERROR_STRONG_SIGNATURE_OK)
549
+ return dwResult;
550
+
551
+ return ERROR_STRONG_SIGNATURE_ERROR;
552
+ }
553
+
554
+ static DWORD VerifyFile(
555
+ HANDLE hMpq,
556
+ const char * szFileName,
557
+ LPDWORD pdwCrc32,
558
+ char * pMD5,
559
+ DWORD dwFlags)
560
+ {
561
+ hash_state md5_state;
562
+ unsigned char * pFileMd5;
563
+ unsigned char md5[MD5_DIGEST_SIZE];
564
+ TFileEntry * pFileEntry;
565
+ TMPQFile * hf;
566
+ BYTE Buffer[0x1000];
567
+ HANDLE hFile = NULL;
568
+ DWORD dwVerifyResult = 0;
569
+ DWORD dwTotalBytes = 0;
570
+ DWORD dwCrc32 = 0;
571
+
572
+ //
573
+ // Note: When the MPQ is patched, it will
574
+ // automatically check the patched version of the file
575
+ //
576
+
577
+ // Make sure the md5 is initialized
578
+ memset(md5, 0, sizeof(md5));
579
+
580
+ // If we have to verify raw data MD5, do it before file open
581
+ if(dwFlags & SFILE_VERIFY_RAW_MD5)
582
+ {
583
+ TMPQArchive * ha = (TMPQArchive *)hMpq;
584
+
585
+ // Parse the base MPQ and all patches
586
+ while(ha != NULL)
587
+ {
588
+ // Does the archive have support for raw MD5?
589
+ if(ha->pHeader->dwRawChunkSize != 0)
590
+ {
591
+ // The file has raw MD5 if the archive supports it
592
+ dwVerifyResult |= VERIFY_FILE_HAS_RAW_MD5;
593
+
594
+ // Find file entry for the file
595
+ pFileEntry = GetFileEntryLocale(ha, szFileName, g_lcFileLocale);
596
+ if(pFileEntry != NULL)
597
+ {
598
+ // If the file's raw MD5 doesn't match, don't bother with more checks
599
+ if(VerifyRawMpqData(ha, pFileEntry->ByteOffset, pFileEntry->dwCmpSize) != ERROR_SUCCESS)
600
+ return dwVerifyResult | VERIFY_FILE_RAW_MD5_ERROR;
601
+ }
602
+ }
603
+
604
+ // Move to the next patch
605
+ ha = ha->haPatch;
606
+ }
607
+ }
608
+
609
+ // Attempt to open the file
610
+ if(SFileOpenFileEx(hMpq, szFileName, SFILE_OPEN_FROM_MPQ, &hFile))
611
+ {
612
+ // Get the file size
613
+ hf = (TMPQFile *)hFile;
614
+ pFileEntry = hf->pFileEntry;
615
+ dwTotalBytes = SFileGetFileSize(hFile, NULL);
616
+
617
+ // Initialize the CRC32 and MD5 contexts
618
+ md5_init(&md5_state);
619
+ dwCrc32 = crc32(0, Z_NULL, 0);
620
+
621
+ // Also turn on sector checksum verification
622
+ if(dwFlags & SFILE_VERIFY_SECTOR_CRC)
623
+ hf->bCheckSectorCRCs = true;
624
+
625
+ // Go through entire file and update both CRC32 and MD5
626
+ for(;;)
627
+ {
628
+ DWORD dwBytesRead = 0;
629
+
630
+ // Read data from file
631
+ SFileReadFile(hFile, Buffer, sizeof(Buffer), &dwBytesRead, NULL);
632
+ if(dwBytesRead == 0)
633
+ {
634
+ if(GetLastError() == ERROR_CHECKSUM_ERROR)
635
+ dwVerifyResult |= VERIFY_FILE_SECTOR_CRC_ERROR;
636
+ break;
637
+ }
638
+
639
+ // Update CRC32 value
640
+ if(dwFlags & SFILE_VERIFY_FILE_CRC)
641
+ dwCrc32 = crc32(dwCrc32, Buffer, dwBytesRead);
642
+
643
+ // Update MD5 value
644
+ if(dwFlags & SFILE_VERIFY_FILE_MD5)
645
+ md5_process(&md5_state, Buffer, dwBytesRead);
646
+
647
+ // Decrement the total size
648
+ dwTotalBytes -= dwBytesRead;
649
+ }
650
+
651
+ // If the file has sector checksums, indicate it in the flags
652
+ if(dwFlags & SFILE_VERIFY_SECTOR_CRC)
653
+ {
654
+ if((hf->pFileEntry->dwFlags & MPQ_FILE_SECTOR_CRC) && hf->SectorChksums != NULL && hf->SectorChksums[0] != 0)
655
+ dwVerifyResult |= VERIFY_FILE_HAS_SECTOR_CRC;
656
+ }
657
+
658
+ // Check if the entire file has been read
659
+ // No point in checking CRC32 and MD5 if not
660
+ // Skip checksum checks if the file has patches
661
+ if(dwTotalBytes == 0)
662
+ {
663
+ // Check CRC32 and MD5 only if there is no patches
664
+ if(hf->hfPatch == NULL)
665
+ {
666
+ // Check if the CRC32 matches.
667
+ if(dwFlags & SFILE_VERIFY_FILE_CRC)
668
+ {
669
+ // Only check the CRC32 if it is valid
670
+ if(pFileEntry->dwCrc32 != 0)
671
+ {
672
+ dwVerifyResult |= VERIFY_FILE_HAS_CHECKSUM;
673
+ if(dwCrc32 != pFileEntry->dwCrc32)
674
+ dwVerifyResult |= VERIFY_FILE_CHECKSUM_ERROR;
675
+ }
676
+ }
677
+
678
+ // Check if MD5 matches
679
+ if(dwFlags & SFILE_VERIFY_FILE_MD5)
680
+ {
681
+ // Patch files have their MD5 saved in the patch info
682
+ pFileMd5 = (hf->pPatchInfo != NULL) ? hf->pPatchInfo->md5 : pFileEntry->md5;
683
+ md5_done(&md5_state, md5);
684
+
685
+ // Only check the MD5 if it is valid
686
+ if(IsValidMD5(pFileMd5))
687
+ {
688
+ dwVerifyResult |= VERIFY_FILE_HAS_MD5;
689
+ if(memcmp(md5, pFileMd5, MD5_DIGEST_SIZE))
690
+ dwVerifyResult |= VERIFY_FILE_MD5_ERROR;
691
+ }
692
+ }
693
+ }
694
+ else
695
+ {
696
+ // Patched files are MD5-checked automatically
697
+ dwVerifyResult |= VERIFY_FILE_HAS_MD5;
698
+ }
699
+ }
700
+ else
701
+ {
702
+ dwVerifyResult |= VERIFY_READ_ERROR;
703
+ }
704
+
705
+ SFileCloseFile(hFile);
706
+ }
707
+ else
708
+ {
709
+ // Remember that the file couldn't be open
710
+ dwVerifyResult |= VERIFY_OPEN_ERROR;
711
+ }
712
+
713
+ // If the caller required CRC32 and/or MD5, give it to him
714
+ if(pdwCrc32 != NULL)
715
+ *pdwCrc32 = dwCrc32;
716
+ if(pMD5 != NULL)
717
+ memcpy(pMD5, md5, MD5_DIGEST_SIZE);
718
+
719
+ return dwVerifyResult;
720
+ }
721
+
722
+ // Used in SFileGetFileInfo
723
+ bool QueryMpqSignatureInfo(
724
+ TMPQArchive * ha,
725
+ PMPQ_SIGNATURE_INFO pSI)
726
+ {
727
+ TFileEntry * pFileEntry;
728
+ ULONGLONG ExtraBytes;
729
+ DWORD dwFileSize;
730
+
731
+ // Make sure it's all zeroed
732
+ memset(pSI, 0, sizeof(MPQ_SIGNATURE_INFO));
733
+
734
+ // Flush the archive, if it was modified
735
+ if(ha->dwFlags & MPQ_FLAG_CHANGED)
736
+ SFileFlushArchive((HANDLE)(ha));
737
+
738
+ // Calculate the range of the MPQ
739
+ CalculateArchiveRange(ha, pSI);
740
+
741
+ // If there is "(signature)" file in the MPQ, it has a weak signature
742
+ pFileEntry = GetFileEntryLocale(ha, SIGNATURE_NAME, LANG_NEUTRAL);
743
+ if(pFileEntry != NULL)
744
+ {
745
+ // Calculate the begin and end of the signature file itself
746
+ pSI->BeginExclude = ha->MpqPos + pFileEntry->ByteOffset;
747
+ pSI->EndExclude = pSI->BeginExclude + pFileEntry->dwCmpSize;
748
+ dwFileSize = (DWORD)(pSI->EndExclude - pSI->BeginExclude);
749
+
750
+ // Does the signature have proper size?
751
+ if(dwFileSize == MPQ_SIGNATURE_FILE_SIZE)
752
+ {
753
+ // Read the weak signature
754
+ if(!FileStream_Read(ha->pStream, &pSI->BeginExclude, pSI->Signature, dwFileSize))
755
+ return false;
756
+
757
+ pSI->SignatureTypes |= SIGNATURE_TYPE_WEAK;
758
+ pSI->cbSignatureSize = dwFileSize;
759
+ return true;
760
+ }
761
+ }
762
+
763
+ // If there is extra bytes beyond the end of the archive,
764
+ // it's the strong signature
765
+ ExtraBytes = pSI->EndOfFile - pSI->EndMpqData;
766
+ if(ExtraBytes >= (MPQ_STRONG_SIGNATURE_SIZE + 4))
767
+ {
768
+ // Read the strong signature
769
+ if(!FileStream_Read(ha->pStream, &pSI->EndMpqData, pSI->Signature, (MPQ_STRONG_SIGNATURE_SIZE + 4)))
770
+ return false;
771
+
772
+ // Check the signature header "NGIS"
773
+ if(pSI->Signature[0] != 'N' || pSI->Signature[1] != 'G' || pSI->Signature[2] != 'I' || pSI->Signature[3] != 'S')
774
+ return true; //Not a valid signature, but another filetype could've been appended so not always an error.
775
+
776
+ pSI->SignatureTypes |= SIGNATURE_TYPE_STRONG;
777
+ return true;
778
+ }
779
+
780
+ // Succeeded, but no known signature found
781
+ return true;
782
+ }
783
+
784
+ //-----------------------------------------------------------------------------
785
+ // Support for weak signature
786
+
787
+ DWORD SSignFileCreate(TMPQArchive * ha)
788
+ {
789
+ TMPQFile * hf = NULL;
790
+ BYTE EmptySignature[MPQ_SIGNATURE_FILE_SIZE];
791
+ DWORD dwErrCode = ERROR_SUCCESS;
792
+
793
+ // Only save the signature if we should do so
794
+ if(ha->dwFileFlags3 != 0)
795
+ {
796
+ // The (signature) file must be non-encrypted and non-compressed
797
+ assert(ha->dwFlags & MPQ_FLAG_SIGNATURE_NEW);
798
+ assert(ha->dwFileFlags3 == MPQ_FILE_EXISTS);
799
+ assert(ha->dwReservedFiles > 0);
800
+
801
+ // Create the (signature) file file in the MPQ
802
+ // Note that the file must not be compressed or encrypted
803
+ dwErrCode = SFileAddFile_Init(ha, SIGNATURE_NAME,
804
+ 0,
805
+ sizeof(EmptySignature),
806
+ LANG_NEUTRAL,
807
+ ha->dwFileFlags3 | MPQ_FILE_REPLACEEXISTING,
808
+ &hf);
809
+
810
+ // Write the empty signature file to the archive
811
+ if(dwErrCode == ERROR_SUCCESS)
812
+ {
813
+ // Write the empty zeroed file to the MPQ
814
+ memset(EmptySignature, 0, sizeof(EmptySignature));
815
+ dwErrCode = SFileAddFile_Write(hf, EmptySignature, (DWORD)sizeof(EmptySignature), 0);
816
+ }
817
+
818
+ // Finalize the signature
819
+ if(dwErrCode == ERROR_SUCCESS)
820
+ {
821
+ // Clear the CRC as it will not be valid
822
+ hf->pFileEntry->dwCrc32 = hf->dwCrc32 = 0;
823
+ SFileAddFile_Finish(hf);
824
+
825
+ // Clear the invalid mark
826
+ ha->dwFlags &= ~(MPQ_FLAG_SIGNATURE_NEW | MPQ_FLAG_SIGNATURE_NONE);
827
+ ha->dwReservedFiles--;
828
+ }
829
+ }
830
+
831
+ return dwErrCode;
832
+ }
833
+
834
+ DWORD SSignFileFinish(TMPQArchive * ha)
835
+ {
836
+ MPQ_SIGNATURE_INFO si = {0};
837
+ unsigned long signature_len = MPQ_WEAK_SIGNATURE_SIZE;
838
+ BYTE WeakSignature[MPQ_SIGNATURE_FILE_SIZE];
839
+ BYTE Md5Digest[MD5_DIGEST_SIZE];
840
+ rsa_key key;
841
+ int hash_idx = find_hash("md5");
842
+
843
+ // Sanity checks
844
+ assert((ha->dwFlags & MPQ_FLAG_CHANGED) == 0);
845
+ assert(ha->dwFileFlags3 == MPQ_FILE_EXISTS);
846
+
847
+ // Query the weak signature info
848
+ if(!QueryMpqSignatureInfo(ha, &si))
849
+ return ERROR_FILE_CORRUPT;
850
+
851
+ // There must be exactly one signature
852
+ if(si.SignatureTypes != SIGNATURE_TYPE_WEAK)
853
+ return ERROR_FILE_CORRUPT;
854
+
855
+ // Calculate MD5 of the entire archive
856
+ if(!CalculateMpqHashMd5(ha, &si, Md5Digest))
857
+ return ERROR_VERIFY_FAILED;
858
+
859
+ // Decode the private key
860
+ if(!decode_base64_key(szBlizzardWeakPrivateKey, &key))
861
+ return ERROR_VERIFY_FAILED;
862
+
863
+ // Sign the hash
864
+ memset(WeakSignature, 0, sizeof(WeakSignature));
865
+ rsa_sign_hash_ex(Md5Digest, sizeof(Md5Digest), WeakSignature + 8, &signature_len, LTC_LTC_PKCS_1_V1_5, 0, 0, hash_idx, 0, &key);
866
+ memrev(WeakSignature + 8, MPQ_WEAK_SIGNATURE_SIZE);
867
+ rsa_free(&key);
868
+
869
+ // Write the signature to the MPQ. Don't use SFile* functions, but write the hash directly
870
+ if(!FileStream_Write(ha->pStream, &si.BeginExclude, WeakSignature, MPQ_SIGNATURE_FILE_SIZE))
871
+ return GetLastError();
872
+
873
+ return ERROR_SUCCESS;
874
+ }
875
+
876
+ //-----------------------------------------------------------------------------
877
+ // Public (exported) functions
878
+
879
+ bool WINAPI SFileGetFileChecksums(HANDLE hMpq, const char * szFileName, LPDWORD pdwCrc32, char * pMD5)
880
+ {
881
+ DWORD dwVerifyResult;
882
+ DWORD dwVerifyFlags = 0;
883
+
884
+ if(pdwCrc32 != NULL)
885
+ dwVerifyFlags |= SFILE_VERIFY_FILE_CRC;
886
+ if(pMD5 != NULL)
887
+ dwVerifyFlags |= SFILE_VERIFY_FILE_MD5;
888
+
889
+ dwVerifyResult = VerifyFile(hMpq,
890
+ szFileName,
891
+ pdwCrc32,
892
+ pMD5,
893
+ dwVerifyFlags);
894
+
895
+ // If verification failed, return zero
896
+ if(dwVerifyResult & VERIFY_FILE_ERROR_MASK)
897
+ {
898
+ SetLastError(ERROR_FILE_CORRUPT);
899
+ return false;
900
+ }
901
+
902
+ return true;
903
+ }
904
+
905
+
906
+ DWORD WINAPI SFileVerifyFile(HANDLE hMpq, const char * szFileName, DWORD dwFlags)
907
+ {
908
+ return VerifyFile(hMpq,
909
+ szFileName,
910
+ NULL,
911
+ NULL,
912
+ dwFlags);
913
+ }
914
+
915
+ // Verifies raw data of the archive Only works for MPQs version 4 or newer
916
+ DWORD WINAPI SFileVerifyRawData(HANDLE hMpq, DWORD dwWhatToVerify, const char * szFileName)
917
+ {
918
+ TMPQArchive * ha = (TMPQArchive *)hMpq;
919
+ TFileEntry * pFileEntry;
920
+ TMPQHeader * pHeader;
921
+
922
+ // Verify input parameters
923
+ if(!IsValidMpqHandle(hMpq))
924
+ return ERROR_INVALID_PARAMETER;
925
+ pHeader = ha->pHeader;
926
+
927
+ // If the archive doesn't have raw data MD5, report it as OK
928
+ if(pHeader->dwRawChunkSize == 0)
929
+ return ERROR_SUCCESS;
930
+
931
+ // If we have to verify MPQ header, do it
932
+ switch(dwWhatToVerify)
933
+ {
934
+ case SFILE_VERIFY_MPQ_HEADER:
935
+
936
+ // Only if the header is of version 4 or newer
937
+ if(pHeader->dwHeaderSize >= (MPQ_HEADER_SIZE_V4 - MD5_DIGEST_SIZE))
938
+ return VerifyRawMpqData(ha, 0, MPQ_HEADER_SIZE_V4 - MD5_DIGEST_SIZE);
939
+ return ERROR_SUCCESS;
940
+
941
+ case SFILE_VERIFY_HET_TABLE:
942
+
943
+ // Only if we have HET table
944
+ if(pHeader->HetTablePos64 && pHeader->HetTableSize64)
945
+ return VerifyRawMpqData(ha, pHeader->HetTablePos64, (DWORD)pHeader->HetTableSize64);
946
+ return ERROR_SUCCESS;
947
+
948
+ case SFILE_VERIFY_BET_TABLE:
949
+
950
+ // Only if we have BET table
951
+ if(pHeader->BetTablePos64 && pHeader->BetTableSize64)
952
+ return VerifyRawMpqData(ha, pHeader->BetTablePos64, (DWORD)pHeader->BetTableSize64);
953
+ return ERROR_SUCCESS;
954
+
955
+ case SFILE_VERIFY_HASH_TABLE:
956
+
957
+ // Hash table is not protected by MD5
958
+ return ERROR_SUCCESS;
959
+
960
+ case SFILE_VERIFY_BLOCK_TABLE:
961
+
962
+ // Block table is not protected by MD5
963
+ return ERROR_SUCCESS;
964
+
965
+ case SFILE_VERIFY_HIBLOCK_TABLE:
966
+
967
+ // It is unknown if the hi-block table is protected my MD5 or not.
968
+ return ERROR_SUCCESS;
969
+
970
+ case SFILE_VERIFY_FILE:
971
+
972
+ // Verify parameters
973
+ if(szFileName == NULL || *szFileName == 0)
974
+ return ERROR_INVALID_PARAMETER;
975
+
976
+ // Get the offset of a file
977
+ pFileEntry = GetFileEntryLocale(ha, szFileName, g_lcFileLocale);
978
+ if(pFileEntry == NULL)
979
+ return ERROR_FILE_NOT_FOUND;
980
+
981
+ return VerifyRawMpqData(ha, pFileEntry->ByteOffset, pFileEntry->dwCmpSize);
982
+ }
983
+
984
+ return ERROR_INVALID_PARAMETER;
985
+ }
986
+
987
+
988
+ // Verifies the archive against the signature
989
+ DWORD WINAPI SFileVerifyArchive(HANDLE hMpq)
990
+ {
991
+ MPQ_SIGNATURE_INFO si = {0};
992
+ TMPQArchive * ha = (TMPQArchive *)hMpq;
993
+
994
+ // Verify input parameters
995
+ if(!IsValidMpqHandle(hMpq))
996
+ return ERROR_VERIFY_FAILED;
997
+
998
+ // Get the MPQ signature and signature type
999
+ if(!QueryMpqSignatureInfo(ha, &si))
1000
+ return ERROR_VERIFY_FAILED;
1001
+
1002
+ // If there is no signature
1003
+ if(si.SignatureTypes == 0)
1004
+ return ERROR_NO_SIGNATURE;
1005
+
1006
+ // We haven't seen a MPQ with both signatures
1007
+ assert(si.SignatureTypes == SIGNATURE_TYPE_WEAK || si.SignatureTypes == SIGNATURE_TYPE_STRONG);
1008
+
1009
+ // Verify the strong signature, if present
1010
+ if(si.SignatureTypes & SIGNATURE_TYPE_STRONG)
1011
+ return VerifyStrongSignature(ha, &si);
1012
+
1013
+ // Verify the weak signature, if present
1014
+ if(si.SignatureTypes & SIGNATURE_TYPE_WEAK)
1015
+ return VerifyWeakSignature(ha, &si);
1016
+
1017
+ return ERROR_NO_SIGNATURE;
1018
+ }
1019
+
1020
+ // Verifies the archive against the signature
1021
+ bool WINAPI SFileSignArchive(HANDLE hMpq, DWORD dwSignatureType)
1022
+ {
1023
+ TMPQArchive * ha;
1024
+
1025
+ // Verify the archive handle
1026
+ ha = IsValidMpqHandle(hMpq);
1027
+ if(ha == NULL)
1028
+ {
1029
+ SetLastError(ERROR_INVALID_PARAMETER);
1030
+ return false;
1031
+ }
1032
+
1033
+ // We only support weak signature, and only for MPQs version 1.0
1034
+ if(dwSignatureType != SIGNATURE_TYPE_WEAK)
1035
+ {
1036
+ SetLastError(ERROR_INVALID_PARAMETER);
1037
+ return false;
1038
+ }
1039
+
1040
+ // The archive must not be malformed and must not be read-only
1041
+ if(ha->dwFlags & (MPQ_FLAG_READ_ONLY | MPQ_FLAG_MALFORMED))
1042
+ {
1043
+ SetLastError(ERROR_ACCESS_DENIED);
1044
+ return false;
1045
+ }
1046
+
1047
+ // If the signature is not there yet
1048
+ if(ha->dwFileFlags3 == 0)
1049
+ {
1050
+ // Turn the signature on. The signature will
1051
+ // be applied when the archive is closed
1052
+ ha->dwFlags |= MPQ_FLAG_SIGNATURE_NEW | MPQ_FLAG_CHANGED;
1053
+ ha->dwFileFlags3 = MPQ_FILE_EXISTS;
1054
+ ha->dwReservedFiles++;
1055
+ }
1056
+
1057
+ return true;
1058
+ }
1059
+