diff --git a/src/Client/CMakeLists.txt b/src/Client/CMakeLists.txt
index ad65c2f..21650b4 100644
--- a/src/Client/CMakeLists.txt
+++ b/src/Client/CMakeLists.txt
@@ -1,7 +1,7 @@
include_directories (${PROJECT_SOURCE_DIR}/src/dep/include ${PROJECT_SOURCE_DIR}/src/shared ${PROJECT_SOURCE_DIR}/src/Client)
set(PSEUWOW_LIBS
-PseuGUI DefScript IrrKlang irrlicht shared zthread StormLib zlib ${OPENSSL_LIBRARIES} ${OPENSSL_EXTRA_LIBRARIES}
+PseuGUI DefScript IrrKlang irrlicht shared zthread StormLib_static zlib ${OPENSSL_LIBRARIES} ${OPENSSL_EXTRA_LIBRARIES}
)
link_directories (${CMAKE_INSTALL_PREFIX})
@@ -19,7 +19,7 @@ add_subdirectory (GUI)
-add_executable (pseuwow
+add_executable (pseuwow
Realm/RealmSession.cpp
Realm/RealmSocket.cpp
@@ -57,6 +57,6 @@ SCPDatabase.cpp
# Link the executable to the libraries.
-target_link_libraries (pseuwow ${PSEUWOW_LIBS})
+target_link_libraries (pseuwow ${PSEUWOW_LIBS})
install(TARGETS pseuwow DESTINATION ${CMAKE_INSTALL_PREFIX})
diff --git a/src/dep/src/StormLib/CMakeLists.txt b/src/dep/src/StormLib/CMakeLists.txt
index 3e3fc87..3e8861b 100644
--- a/src/dep/src/StormLib/CMakeLists.txt
+++ b/src/dep/src/StormLib/CMakeLists.txt
@@ -1,44 +1,294 @@
-include_directories (${PROJECT_SOURCE_DIR}/src/dep/include)
-
-set(STORMLIB_SOURCES huffman/huff.cpp
- wave/wave.cpp
- SAttrFile.cpp
- SCommon.cpp
- SCompression.cpp
- SFileCompactArchive.cpp
- SFileCreateArchiveEx.cpp
- SFileExtractFile.cpp
- SFileFindFile.cpp
- SFileOpenArchive.cpp
- SFileOpenFileEx.cpp
- SFileReadFile.cpp
- SListFile.cpp
- pklib/crc32_pk.c
- pklib/explode.c
- pklib/implode.c
- misc/crc32.cpp
- misc/md5.cpp)
-
-if(UNIX)
- set(STORMLIB_SOURCES ${STORMLIB_SOURCES} StormPortLinux.cpp)
-endif()
-
-if(WIN32)
- set(STORMLIB_SOURCES ${STORMLIB_SOURCES}
- bzip2/blocksort.c
- bzip2/bzip2.c
- bzip2/bzip2recover.c
- bzip2/bzlib.c
- bzip2/compress.c
- bzip2/crctable.c
- bzip2/decompress.c
- bzip2/dlltest.c
- bzip2/huffman.c
- bzip2/mk251.c
- bzip2/randtable.c
- bzip2/spewG.c
- bzip2/unzcrash.c
-)
-endif()
-
-add_library(StormLib ${STORMLIB_SOURCES})
\ No newline at end of file
+project(StormLib)
+cmake_minimum_required(VERSION 2.6)
+
+set(SRC_FILES
+ src/adpcm/adpcm.cpp
+ src/huffman/huff.cpp
+ src/jenkins/lookup3.c
+ src/lzma/C/LzFind.c
+ src/lzma/C/LzmaDec.c
+ src/lzma/C/LzmaEnc.c
+ src/pklib/explode.c
+ src/pklib/implode.c
+ src/sparse/sparse.cpp
+ src/FileStream.cpp
+ src/SBaseCommon.cpp
+ src/SBaseFileTable.cpp
+ src/SCompression.cpp
+ src/SFileAddFile.cpp
+ src/SFileAttributes.cpp
+ src/SFileCompactArchive.cpp
+ src/SFileCreateArchive.cpp
+ src/SFileExtractFile.cpp
+ src/SFileFindFile.cpp
+ src/SFileListFile.cpp
+ src/SFileOpenArchive.cpp
+ src/SFileOpenFileEx.cpp
+ src/SFilePatchArchives.cpp
+ src/SFileReadFile.cpp
+ src/SFileVerify.cpp
+)
+
+set(TOMCRYPT_FILES
+ src/libtomcrypt/src/hashes/hash_memory.c
+ src/libtomcrypt/src/hashes/md5.c
+ src/libtomcrypt/src/hashes/sha1.c
+ src/libtomcrypt/src/math/ltm_desc.c
+ src/libtomcrypt/src/math/multi.c
+ src/libtomcrypt/src/math/rand_prime.c
+ src/libtomcrypt/src/misc/base64_decode.c
+ src/libtomcrypt/src/misc/crypt_argchk.c
+ src/libtomcrypt/src/misc/crypt_find_hash.c
+ src/libtomcrypt/src/misc/crypt_find_prng.c
+ src/libtomcrypt/src/misc/crypt_hash_descriptor.c
+ src/libtomcrypt/src/misc/crypt_hash_is_valid.c
+ src/libtomcrypt/src/misc/crypt_libc.c
+ src/libtomcrypt/src/misc/crypt_ltc_mp_descriptor.c
+ src/libtomcrypt/src/misc/crypt_prng_descriptor.c
+ src/libtomcrypt/src/misc/crypt_prng_is_valid.c
+ src/libtomcrypt/src/misc/crypt_register_hash.c
+ src/libtomcrypt/src/misc/crypt_register_prng.c
+ src/libtomcrypt/src/misc/zeromem.c
+ src/libtomcrypt/src/pk/asn1/der_decode_bit_string.c
+ src/libtomcrypt/src/pk/asn1/der_decode_boolean.c
+ src/libtomcrypt/src/pk/asn1/der_decode_choice.c
+ src/libtomcrypt/src/pk/asn1/der_decode_ia5_string.c
+ src/libtomcrypt/src/pk/asn1/der_decode_integer.c
+ src/libtomcrypt/src/pk/asn1/der_decode_object_identifier.c
+ src/libtomcrypt/src/pk/asn1/der_decode_octet_string.c
+ src/libtomcrypt/src/pk/asn1/der_decode_printable_string.c
+ src/libtomcrypt/src/pk/asn1/der_decode_sequence_ex.c
+ src/libtomcrypt/src/pk/asn1/der_decode_sequence_flexi.c
+ src/libtomcrypt/src/pk/asn1/der_decode_sequence_multi.c
+ src/libtomcrypt/src/pk/asn1/der_decode_short_integer.c
+ src/libtomcrypt/src/pk/asn1/der_decode_utctime.c
+ src/libtomcrypt/src/pk/asn1/der_decode_utf8_string.c
+ src/libtomcrypt/src/pk/asn1/der_length_bit_string.c
+ src/libtomcrypt/src/pk/asn1/der_length_boolean.c
+ src/libtomcrypt/src/pk/asn1/der_length_ia5_string.c
+ src/libtomcrypt/src/pk/asn1/der_length_integer.c
+ src/libtomcrypt/src/pk/asn1/der_length_object_identifier.c
+ src/libtomcrypt/src/pk/asn1/der_length_octet_string.c
+ src/libtomcrypt/src/pk/asn1/der_length_printable_string.c
+ src/libtomcrypt/src/pk/asn1/der_length_sequence.c
+ src/libtomcrypt/src/pk/asn1/der_length_utctime.c
+ src/libtomcrypt/src/pk/asn1/der_sequence_free.c
+ src/libtomcrypt/src/pk/asn1/der_length_utf8_string.c
+ src/libtomcrypt/src/pk/asn1/der_length_short_integer.c
+ src/libtomcrypt/src/pk/ecc/ltc_ecc_map.c
+ src/libtomcrypt/src/pk/ecc/ltc_ecc_mul2add.c
+ src/libtomcrypt/src/pk/ecc/ltc_ecc_mulmod.c
+ src/libtomcrypt/src/pk/ecc/ltc_ecc_points.c
+ src/libtomcrypt/src/pk/ecc/ltc_ecc_projective_add_point.c
+ src/libtomcrypt/src/pk/ecc/ltc_ecc_projective_dbl_point.c
+ src/libtomcrypt/src/pk/pkcs1/pkcs_1_mgf1.c
+ src/libtomcrypt/src/pk/pkcs1/pkcs_1_oaep_decode.c
+ src/libtomcrypt/src/pk/pkcs1/pkcs_1_pss_decode.c
+ src/libtomcrypt/src/pk/pkcs1/pkcs_1_v1_5_decode.c
+ src/libtomcrypt/src/pk/rsa/rsa_exptmod.c
+ src/libtomcrypt/src/pk/rsa/rsa_free.c
+ src/libtomcrypt/src/pk/rsa/rsa_import.c
+ src/libtomcrypt/src/pk/rsa/rsa_make_key.c
+ src/libtomcrypt/src/pk/rsa/rsa_verify_hash.c
+ src/libtomcrypt/src/pk/rsa/rsa_verify_simple.c
+)
+
+set(TOMMATH_FILES
+ src/libtommath/bncore.c
+ src/libtommath/bn_fast_mp_invmod.c
+ src/libtommath/bn_fast_mp_montgomery_reduce.c
+ src/libtommath/bn_fast_s_mp_mul_digs.c
+ src/libtommath/bn_fast_s_mp_mul_high_digs.c
+ src/libtommath/bn_fast_s_mp_sqr.c
+ src/libtommath/bn_mp_2expt.c
+ src/libtommath/bn_mp_abs.c
+ src/libtommath/bn_mp_add.c
+ src/libtommath/bn_mp_addmod.c
+ src/libtommath/bn_mp_add_d.c
+ src/libtommath/bn_mp_and.c
+ src/libtommath/bn_mp_clamp.c
+ src/libtommath/bn_mp_clear.c
+ src/libtommath/bn_mp_clear_multi.c
+ src/libtommath/bn_mp_cmp.c
+ src/libtommath/bn_mp_cmp_d.c
+ src/libtommath/bn_mp_cmp_mag.c
+ src/libtommath/bn_mp_cnt_lsb.c
+ src/libtommath/bn_mp_copy.c
+ src/libtommath/bn_mp_count_bits.c
+ src/libtommath/bn_mp_div.c
+ src/libtommath/bn_mp_div_2.c
+ src/libtommath/bn_mp_div_2d.c
+ src/libtommath/bn_mp_div_3.c
+ src/libtommath/bn_mp_div_d.c
+ src/libtommath/bn_mp_dr_is_modulus.c
+ src/libtommath/bn_mp_dr_reduce.c
+ src/libtommath/bn_mp_dr_setup.c
+ src/libtommath/bn_mp_exch.c
+ src/libtommath/bn_mp_exptmod.c
+ src/libtommath/bn_mp_exptmod_fast.c
+ src/libtommath/bn_mp_expt_d.c
+ src/libtommath/bn_mp_exteuclid.c
+ src/libtommath/bn_mp_fread.c
+ src/libtommath/bn_mp_fwrite.c
+ src/libtommath/bn_mp_gcd.c
+ src/libtommath/bn_mp_get_int.c
+ src/libtommath/bn_mp_grow.c
+ src/libtommath/bn_mp_init.c
+ src/libtommath/bn_mp_init_copy.c
+ src/libtommath/bn_mp_init_multi.c
+ src/libtommath/bn_mp_init_set.c
+ src/libtommath/bn_mp_init_set_int.c
+ src/libtommath/bn_mp_init_size.c
+ src/libtommath/bn_mp_invmod.c
+ src/libtommath/bn_mp_invmod_slow.c
+ src/libtommath/bn_mp_is_square.c
+ src/libtommath/bn_mp_jacobi.c
+ src/libtommath/bn_mp_karatsuba_mul.c
+ src/libtommath/bn_mp_karatsuba_sqr.c
+ src/libtommath/bn_mp_lcm.c
+ src/libtommath/bn_mp_lshd.c
+ src/libtommath/bn_mp_mod.c
+ src/libtommath/bn_mp_mod_2d.c
+ src/libtommath/bn_mp_mod_d.c
+ src/libtommath/bn_mp_montgomery_calc_normalization.c
+ src/libtommath/bn_mp_montgomery_reduce.c
+ src/libtommath/bn_mp_montgomery_setup.c
+ src/libtommath/bn_mp_mul.c
+ src/libtommath/bn_mp_mulmod.c
+ src/libtommath/bn_mp_mul_2.c
+ src/libtommath/bn_mp_mul_2d.c
+ src/libtommath/bn_mp_mul_d.c
+ src/libtommath/bn_mp_neg.c
+ src/libtommath/bn_mp_n_root.c
+ src/libtommath/bn_mp_or.c
+ src/libtommath/bn_mp_prime_fermat.c
+ src/libtommath/bn_mp_prime_is_divisible.c
+ src/libtommath/bn_mp_prime_is_prime.c
+ src/libtommath/bn_mp_prime_miller_rabin.c
+ src/libtommath/bn_mp_prime_next_prime.c
+ src/libtommath/bn_mp_prime_rabin_miller_trials.c
+ src/libtommath/bn_mp_prime_random_ex.c
+ src/libtommath/bn_mp_radix_size.c
+ src/libtommath/bn_mp_radix_smap.c
+ src/libtommath/bn_mp_rand.c
+ src/libtommath/bn_mp_read_radix.c
+ src/libtommath/bn_mp_read_signed_bin.c
+ src/libtommath/bn_mp_read_unsigned_bin.c
+ src/libtommath/bn_mp_reduce.c
+ src/libtommath/bn_mp_reduce_2k.c
+ src/libtommath/bn_mp_reduce_2k_l.c
+ src/libtommath/bn_mp_reduce_2k_setup.c
+ src/libtommath/bn_mp_reduce_2k_setup_l.c
+ src/libtommath/bn_mp_reduce_is_2k.c
+ src/libtommath/bn_mp_reduce_is_2k_l.c
+ src/libtommath/bn_mp_reduce_setup.c
+ src/libtommath/bn_mp_rshd.c
+ src/libtommath/bn_mp_set.c
+ src/libtommath/bn_mp_set_int.c
+ src/libtommath/bn_mp_shrink.c
+ src/libtommath/bn_mp_signed_bin_size.c
+ src/libtommath/bn_mp_sqr.c
+ src/libtommath/bn_mp_sqrmod.c
+ src/libtommath/bn_mp_sqrt.c
+ src/libtommath/bn_mp_sub.c
+ src/libtommath/bn_mp_submod.c
+ src/libtommath/bn_mp_sub_d.c
+ src/libtommath/bn_mp_toom_mul.c
+ src/libtommath/bn_mp_toom_sqr.c
+ src/libtommath/bn_mp_toradix.c
+ src/libtommath/bn_mp_toradix_n.c
+ src/libtommath/bn_mp_to_signed_bin.c
+ src/libtommath/bn_mp_to_signed_bin_n.c
+ src/libtommath/bn_mp_to_unsigned_bin.c
+ src/libtommath/bn_mp_to_unsigned_bin_n.c
+ src/libtommath/bn_mp_unsigned_bin_size.c
+ src/libtommath/bn_mp_xor.c
+ src/libtommath/bn_mp_zero.c
+ src/libtommath/bn_prime_tab.c
+ src/libtommath/bn_reverse.c
+ src/libtommath/bn_s_mp_add.c
+ src/libtommath/bn_s_mp_exptmod.c
+ src/libtommath/bn_s_mp_mul_digs.c
+ src/libtommath/bn_s_mp_mul_high_digs.c
+ src/libtommath/bn_s_mp_sqr.c
+ src/libtommath/bn_s_mp_sub.c
+)
+
+set(ZLIB_BZIP2_FILES
+ src/bzip2/blocksort.c
+ src/bzip2/bzlib.c
+ src/bzip2/compress.c
+ src/bzip2/crctable.c
+ src/bzip2/decompress.c
+ src/bzip2/huffman.c
+ src/bzip2/randtable.c
+ src/zlib/adler32.c
+ src/zlib/compress2.c
+ src/zlib/crc32.c
+ src/zlib/deflate.c
+ src/zlib/inffast.c
+ src/zlib/inflate.c
+ src/zlib/inftrees.c
+ src/zlib/trees.c
+ src/zlib/zutil.c
+)
+
+set(TEST_SRC_FILES
+ test/Test.cpp
+)
+
+add_definitions(-D_7ZIP_ST -DBZ_STRICT_ANSI)
+
+if(WIN32)
+ if(MSVC)
+ message(STATUS "Using MSVC")
+ add_definitions(-D_7ZIP_ST -DWIN32)
+ else()
+ message(STATUS "Using mingw")
+ endif()
+ set(SRC_ADDITIONAL_FILES ${ZLIB_BZIP2_FILES} ${TOMCRYPT_FILES} ${TOMMATH_FILES})
+endif()
+
+if(APPLE)
+ message(STATUS "Using Mac OS X port")
+ set(LINK_LIBS z bz2)
+ set(SRC_ADDITIONAL_FILES ${TOMCRYPT_FILES} ${TOMMATH_FILES})
+endif()
+
+if (${CMAKE_SYSTEM_NAME} STREQUAL Linux)
+ message(STATUS "Using Linux port")
+ option(WITH_LIBTOMCRYPT "Use system LibTomCrypt library" OFF)
+ if(WITH_LIBTOMCRYPT)
+ set(LINK_LIBS z bz2 tomcrypt)
+ else()
+ set(LINK_LIBS z bz2)
+ set(SRC_ADDITIONAL_FILES ${TOMCRYPT_FILES} ${TOMMATH_FILES})
+ endif()
+endif()
+
+add_library(StormLib SHARED ${SRC_FILES} ${SRC_ADDITIONAL_FILES})
+target_link_libraries(StormLib ${LINK_LIBS})
+
+add_library(StormLib_static STATIC ${SRC_FILES} ${SRC_ADDITIONAL_FILES})
+target_link_libraries(StormLib_static ${LINK_LIBS})
+set_target_properties(StormLib_static PROPERTIES OUTPUT_NAME StormLib)
+
+option(WITH_TEST "Compile Test application" OFF)
+if(WITH_TEST)
+ add_executable(StormLib_test ${TEST_SRC_FILES})
+ target_link_libraries(StormLib_test StormLib_static)
+endif()
+
+if(APPLE)
+ set_target_properties(StormLib PROPERTIES FRAMEWORK true)
+ set_target_properties(StormLib PROPERTIES PUBLIC_HEADER "src/StormLib.h src/StormPort.h")
+ set_target_properties(StormLib PROPERTIES LINK_FLAGS "-framework Carbon")
+endif()
+
+if(UNIX)
+ set_target_properties(StormLib PROPERTIES SOVERSION 0)
+endif()
+
+# install(TARGETS StormLib StormLib_static RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib)
+# install(FILES src/StormLib.h src/StormPort.h DESTINATION include)
+
diff --git a/src/dep/src/StormLib/Info.plist b/src/dep/src/StormLib/Info.plist
new file mode 100644
index 0000000..0e1ae01
--- /dev/null
+++ b/src/dep/src/StormLib/Info.plist
@@ -0,0 +1,22 @@
+
+
+
+
+ CFBundleDevelopmentRegion
+ English
+ CFBundleExecutable
+ ${EXECUTABLE_NAME}
+ CFBundleIdentifier
+ net.zezula.${PRODUCT_NAME:rfc1034Identifier}
+ CFBundleName
+ ${PRODUCT_NAME}
+ CFBundleInfoDictionaryVersion
+ 6.0
+ CFBundlePackageType
+ FMWK
+ CFBundleSignature
+ ????
+ CFBundleVersion
+ 8.01
+
+
diff --git a/src/dep/src/StormLib/Makefile.linux b/src/dep/src/StormLib/Makefile.linux
new file mode 100644
index 0000000..95f87ac
--- /dev/null
+++ b/src/dep/src/StormLib/Makefile.linux
@@ -0,0 +1,275 @@
+#####################################################################
+###
+#
+# Makefile for compiling StormLib under linux
+#
+# Author: Marko Friedemann
+# Created at: Mon Jan 29 18:26:01 CEST 2001
+# Computer: whiplash.flachland-chemnitz.de
+# System: Linux 2.4.0 on i686
+#
+# Copyright (c) 2001 BMX-Chemnitz.DE All rights reserved.
+#
+#####################################################################
+###
+
+##############################################################
+# updated on Monday 3, 2010 by Christopher Chedeau aka vjeux #
+# updated on April 24, 2010 by Ivan Komissarov aka Nevermore #
+##############################################################
+
+C++ = g++
+CC = gcc
+AR = ar
+DFLAGS = -D__SYS_ZLIB
+OFLAGS =
+LFLAGS = -lbz2 -lz
+CFLAGS = -fPIC -D_7ZIP_ST
+CFLAGS += $(OFLAGS) $(DFLAGS)
+
+OBJS = src/adpcm/adpcm.o \
+ src/FileStream.o \
+ src/huffman/huff.o \
+ src/SBaseCommon.o \
+ src/SBaseFileTable.o \
+ src/SCompression.o \
+ src/SFileAddFile.o \
+ src/SFileAttributes.o \
+ src/SFileCompactArchive.o \
+ src/SFileCreateArchive.o \
+ src/SFileExtractFile.o \
+ src/SFileFindFile.o \
+ src/SFileListFile.o \
+ src/SFileOpenArchive.o \
+ src/SFileOpenFileEx.o \
+ src/SFilePatchArchives.o \
+ src/SFileReadFile.o \
+ src/SFileVerify.o \
+ src/sparse/sparse.o
+
+COBJS = src/libtomcrypt/src/hashes/sha1.o \
+ src/libtomcrypt/src/hashes/hash_memory.o \
+ src/libtomcrypt/src/hashes/md5.o \
+ src/libtomcrypt/src/misc/crypt_hash_is_valid.o \
+ src/libtomcrypt/src/misc/crypt_prng_descriptor.o \
+ src/libtomcrypt/src/misc/crypt_register_prng.o \
+ src/libtomcrypt/src/misc/crypt_ltc_mp_descriptor.o \
+ src/libtomcrypt/src/misc/crypt_find_hash.o \
+ src/libtomcrypt/src/misc/zeromem.o \
+ src/libtomcrypt/src/misc/base64_decode.o \
+ src/libtomcrypt/src/misc/crypt_register_hash.o \
+ src/libtomcrypt/src/misc/crypt_find_prng.o \
+ src/libtomcrypt/src/misc/crypt_prng_is_valid.o \
+ src/libtomcrypt/src/misc/crypt_hash_descriptor.o \
+ src/libtomcrypt/src/misc/crypt_libc.o \
+ src/libtomcrypt/src/misc/crypt_argchk.o \
+ src/libtomcrypt/src/math/multi.o \
+ src/libtomcrypt/src/math/ltm_desc.o \
+ src/libtomcrypt/src/math/rand_prime.o \
+ src/libtomcrypt/src/pk/asn1/der_length_ia5_string.o \
+ src/libtomcrypt/src/pk/asn1/der_decode_utctime.o \
+ src/libtomcrypt/src/pk/asn1/der_length_boolean.o \
+ src/libtomcrypt/src/pk/asn1/der_decode_object_identifier.o \
+ src/libtomcrypt/src/pk/asn1/der_decode_sequence_multi.o \
+ src/libtomcrypt/src/pk/asn1/der_decode_octet_string.o \
+ src/libtomcrypt/src/pk/asn1/der_length_object_identifier.o \
+ src/libtomcrypt/src/pk/asn1/der_length_bit_string.o \
+ src/libtomcrypt/src/pk/asn1/der_decode_ia5_string.o \
+ src/libtomcrypt/src/pk/asn1/der_length_integer.o \
+ src/libtomcrypt/src/pk/asn1/der_length_sequence.o \
+ src/libtomcrypt/src/pk/asn1/der_decode_choice.o \
+ src/libtomcrypt/src/pk/asn1/der_length_octet_string.o \
+ src/libtomcrypt/src/pk/asn1/der_decode_sequence_flexi.o \
+ src/libtomcrypt/src/pk/asn1/der_decode_printable_string.o \
+ src/libtomcrypt/src/pk/asn1/der_decode_bit_string.o \
+ src/libtomcrypt/src/pk/asn1/der_decode_short_integer.o \
+ src/libtomcrypt/src/pk/asn1/der_length_utctime.o \
+ src/libtomcrypt/src/pk/asn1/der_decode_utf8_string.o \
+ src/libtomcrypt/src/pk/asn1/der_decode_integer.o \
+ src/libtomcrypt/src/pk/asn1/der_decode_boolean.o \
+ src/libtomcrypt/src/pk/asn1/der_sequence_free.o \
+ src/libtomcrypt/src/pk/asn1/der_decode_sequence_ex.o \
+ src/libtomcrypt/src/pk/asn1/der_length_short_integer.o \
+ src/libtomcrypt/src/pk/asn1/der_length_printable_string.o \
+ src/libtomcrypt/src/pk/asn1/der_length_utf8_string.o \
+ src/libtomcrypt/src/pk/rsa/rsa_make_key.o \
+ src/libtomcrypt/src/pk/rsa/rsa_free.o \
+ src/libtomcrypt/src/pk/rsa/rsa_verify_simple.o \
+ src/libtomcrypt/src/pk/rsa/rsa_import.o \
+ src/libtomcrypt/src/pk/rsa/rsa_verify_hash.o \
+ src/libtomcrypt/src/pk/rsa/rsa_exptmod.o \
+ src/libtomcrypt/src/pk/pkcs1/pkcs_1_v1_5_decode.o \
+ src/libtomcrypt/src/pk/pkcs1/pkcs_1_pss_decode.o \
+ src/libtomcrypt/src/pk/pkcs1/pkcs_1_mgf1.o \
+ src/libtomcrypt/src/pk/pkcs1/pkcs_1_oaep_decode.o \
+ src/libtomcrypt/src/pk/ecc/ltc_ecc_projective_dbl_point.o \
+ src/libtomcrypt/src/pk/ecc/ltc_ecc_mulmod.o \
+ src/libtomcrypt/src/pk/ecc/ltc_ecc_projective_add_point.o \
+ src/libtomcrypt/src/pk/ecc/ltc_ecc_map.o \
+ src/libtomcrypt/src/pk/ecc/ltc_ecc_points.o \
+ src/libtomcrypt/src/pk/ecc/ltc_ecc_mul2add.o \
+ src/libtommath/bn_mp_exptmod_fast.o \
+ src/libtommath/bn_mp_jacobi.o \
+ src/libtommath/bn_mp_mod.o \
+ src/libtommath/bn_mp_signed_bin_size.o \
+ src/libtommath/bn_mp_invmod.o \
+ src/libtommath/bn_mp_is_square.o \
+ src/libtommath/bn_mp_neg.o \
+ src/libtommath/bn_mp_reduce_2k.o \
+ src/libtommath/bn_mp_xor.o \
+ src/libtommath/bn_mp_karatsuba_mul.o \
+ src/libtommath/bn_mp_dr_setup.o \
+ src/libtommath/bn_mp_mul.o \
+ src/libtommath/bn_mp_init_multi.o \
+ src/libtommath/bn_mp_clear.o \
+ src/libtommath/bn_s_mp_sqr.o \
+ src/libtommath/bn_mp_rshd.o \
+ src/libtommath/bn_s_mp_sub.o \
+ src/libtommath/bn_mp_sub.o \
+ src/libtommath/bn_mp_toradix.o \
+ src/libtommath/bn_mp_reduce.o \
+ src/libtommath/bn_mp_prime_is_prime.o \
+ src/libtommath/bn_mp_prime_next_prime.o \
+ src/libtommath/bn_mp_exptmod.o \
+ src/libtommath/bn_mp_mod_2d.o \
+ src/libtommath/bn_reverse.o \
+ src/libtommath/bn_mp_init.o \
+ src/libtommath/bn_fast_s_mp_sqr.o \
+ src/libtommath/bn_mp_sqr.o \
+ src/libtommath/bn_mp_cnt_lsb.o \
+ src/libtommath/bn_mp_clear_multi.o \
+ src/libtommath/bn_mp_exch.o \
+ src/libtommath/bn_fast_s_mp_mul_digs.o \
+ src/libtommath/bn_mp_grow.o \
+ src/libtommath/bn_mp_read_radix.o \
+ src/libtommath/bn_mp_mul_2.o \
+ src/libtommath/bn_mp_shrink.o \
+ src/libtommath/bn_mp_div_2.o \
+ src/libtommath/bn_fast_mp_invmod.o \
+ src/libtommath/bn_mp_prime_miller_rabin.o \
+ src/libtommath/bn_mp_to_unsigned_bin.o \
+ src/libtommath/bn_mp_prime_rabin_miller_trials.o \
+ src/libtommath/bn_mp_2expt.o \
+ src/libtommath/bn_mp_cmp_mag.o \
+ src/libtommath/bn_mp_to_signed_bin.o \
+ src/libtommath/bn_mp_get_int.o \
+ src/libtommath/bn_mp_montgomery_reduce.o \
+ src/libtommath/bn_mp_dr_reduce.o \
+ src/libtommath/bn_mp_fwrite.o \
+ src/libtommath/bn_mp_and.o \
+ src/libtommath/bn_mp_exteuclid.o \
+ src/libtommath/bn_fast_mp_montgomery_reduce.o \
+ src/libtommath/bn_s_mp_mul_high_digs.o \
+ src/libtommath/bn_mp_reduce_setup.o \
+ src/libtommath/bn_mp_lcm.o \
+ src/libtommath/bn_mp_abs.o \
+ src/libtommath/bn_mp_cmp.o \
+ src/libtommath/bn_mp_submod.o \
+ src/libtommath/bn_mp_div_d.o \
+ src/libtommath/bn_s_mp_mul_digs.o \
+ src/libtommath/bn_mp_mul_d.o \
+ src/libtommath/bn_mp_to_unsigned_bin_n.o \
+ src/libtommath/bn_mp_prime_random_ex.o \
+ src/libtommath/bn_mp_rand.o \
+ src/libtommath/bn_mp_div_2d.o \
+ src/libtommath/bn_mp_addmod.o \
+ src/libtommath/bn_mp_init_copy.o \
+ src/libtommath/bn_mp_read_unsigned_bin.o \
+ src/libtommath/bn_mp_toradix_n.o \
+ src/libtommath/bn_fast_s_mp_mul_high_digs.o \
+ src/libtommath/bn_mp_toom_sqr.o \
+ src/libtommath/bn_mp_to_signed_bin_n.o \
+ src/libtommath/bn_mp_reduce_2k_setup_l.o \
+ src/libtommath/bn_mp_div.o \
+ src/libtommath/bn_prime_tab.o \
+ src/libtommath/bn_mp_karatsuba_sqr.o \
+ src/libtommath/bn_mp_gcd.o \
+ src/libtommath/bn_mp_prime_is_divisible.o \
+ src/libtommath/bn_mp_set_int.o \
+ src/libtommath/bn_mp_prime_fermat.o \
+ src/libtommath/bn_mp_cmp_d.o \
+ src/libtommath/bn_mp_add.o \
+ src/libtommath/bn_mp_sub_d.o \
+ src/libtommath/bn_s_mp_exptmod.o \
+ src/libtommath/bn_mp_init_size.o \
+ src/libtommath/bncore.o \
+ src/libtommath/bn_mp_radix_smap.o \
+ src/libtommath/bn_mp_reduce_2k_l.o \
+ src/libtommath/bn_mp_montgomery_calc_normalization.o \
+ src/libtommath/bn_mp_mod_d.o \
+ src/libtommath/bn_mp_set.o \
+ src/libtommath/bn_mp_or.o \
+ src/libtommath/bn_mp_sqrt.o \
+ src/libtommath/bn_mp_invmod_slow.o \
+ src/libtommath/bn_mp_count_bits.o \
+ src/libtommath/bn_mp_read_signed_bin.o \
+ src/libtommath/bn_mp_div_3.o \
+ src/libtommath/bn_mp_unsigned_bin_size.o \
+ src/libtommath/bn_mp_mulmod.o \
+ src/libtommath/bn_mp_clamp.o \
+ src/libtommath/bn_mp_reduce_2k_setup.o \
+ src/libtommath/bn_mp_toom_mul.o \
+ src/libtommath/bn_mp_montgomery_setup.o \
+ src/libtommath/bn_mp_expt_d.o \
+ src/libtommath/bn_mp_copy.o \
+ src/libtommath/bn_mp_dr_is_modulus.o \
+ src/libtommath/bn_mp_sqrmod.o \
+ src/libtommath/bn_mp_reduce_is_2k_l.o \
+ src/libtommath/bn_mp_mul_2d.o \
+ src/libtommath/bn_mp_fread.o \
+ src/libtommath/bn_mp_init_set.o \
+ src/libtommath/bn_mp_add_d.o \
+ src/libtommath/bn_mp_zero.o \
+ src/libtommath/bn_s_mp_add.o \
+ src/libtommath/bn_mp_radix_size.o \
+ src/libtommath/bn_mp_init_set_int.o \
+ src/libtommath/bn_mp_n_root.o \
+ src/libtommath/bn_mp_lshd.o \
+ src/libtommath/bn_mp_reduce_is_2k.o \
+ src/pklib/implode.o \
+ src/pklib/crc32.o \
+ src/pklib/explode.o \
+ src/zlib/crc32.o \
+ src/zlib/trees.o \
+ src/zlib/compress2.o \
+ src/zlib/adler32.o \
+ src/zlib/inftrees.o \
+ src/zlib/inffast.o \
+ src/zlib/deflate.o \
+ src/zlib/inflate.o \
+ src/zlib/zutil.o \
+ src/lzma/C/LzFind.o \
+ src/lzma/C/LzmaEnc.o \
+ src/lzma/C/LzmaDec.o \
+ src/jenkins/lookup3.o
+
+LIB = libStorm.so
+SLIB = libStorm.a
+
+all: $(OBJS) $(COBJS) $(LIB) $(SLIB)
+
+$(LIB): $(OBJS) $(COBJS)
+ $(C++) $(ARCH) -shared -o $(LIB) $(OBJS) $(COBJS) $(LFLAGS)
+
+$(SLIB): $(OBJS) $(COBJS)
+ $(AR) rcs $(SLIB) $(OBJS) $(COBJS)
+
+clean:
+ rm -f $(OBJS) $(COBJS) $(LIB)
+
+$(OBJS): %.o: %.cpp
+ $(C++) -o $@ $(CFLAGS) -c $<
+
+$(COBJS): %.o: %.c
+ $(CC) -o $@ $(CFLAGS) -c $<
+
+$(LIB): $(OBJS) $(COBJS)
+
+all: $(LIB)
+
+install: $(LIB)
+ install $(LIB) /usr/local/lib
+ mkdir -p /usr/local/include/StormLib
+ cp src/StormLib.h /usr/local/include/StormLib
+ cp src/StormPort.h /usr/local/include/StormLib
+ ldconfig
diff --git a/src/dep/src/StormLib/Makefile.mac b/src/dep/src/StormLib/Makefile.mac
new file mode 100644
index 0000000..174c477
--- /dev/null
+++ b/src/dep/src/StormLib/Makefile.mac
@@ -0,0 +1,253 @@
+#####################################################################
+#
+# Makefile for compiling StormLib with g++ on Mac
+#
+# Author: Ladislav Zezula
+# Created: Mon May 10 14:13:00 CEST 2010
+# System: Mac OS X (64bit)
+#
+#####################################################################
+
+CPP = g++
+CC = gcc
+CFLAGS = -Wall
+LFLAGS = -lbz2 -lz -framework Carbon
+ARCH = -arch x86_64
+DFLAGS = -D__SYS_BZLIB -D__SYS_ZLIB -D_7ZIP_ST
+AR = ar
+ARFLAGS= rcs
+
+LIBRARY = libStorm.dylib
+
+OBJS_CPP = src/adpcm/adpcm.obj \
+ src/huffman/huff.obj \
+ src/sparse/sparse.obj \
+ src/FileStream.obj \
+ src/SBaseCommon.o \
+ src/SBaseFileTable.o \
+ src/SCompression.obj \
+ src/SFileAddFile.obj \
+ src/SFileAttributes.obj \
+ src/SFileCompactArchive.obj \
+ src/SFileCreateArchive.obj \
+ src/SFileExtractFile.obj \
+ src/SFileFindFile.obj \
+ src/SFileListFile.obj \
+ src/SFileOpenArchive.obj \
+ src/SFileOpenFileEx.obj \
+ src/SFilePatchArchives.obj \
+ src/SFileReadFile.obj \
+ src/SFileVerify.obj
+
+
+OBJS_C = src/jenkins/lookup3.o \
+ src/libtomcrypt/src/hashes/hash_memory.obj \
+ src/libtomcrypt/src/hashes/md5.obj \
+ src/libtomcrypt/src/hashes/sha1.obj\
+ src/libtomcrypt/src/math/ltm_desc.obj \
+ src/libtomcrypt/src/math/multi.obj \
+ src/libtomcrypt/src/math/rand_prime.obj \
+ src/libtomcrypt/src/misc/base64_decode.obj \
+ src/libtomcrypt/src/misc/crypt_argchk.obj \
+ src/libtomcrypt/src/misc/crypt_find_hash.obj \
+ src/libtomcrypt/src/misc/crypt_find_prng.obj \
+ src/libtomcrypt/src/misc/crypt_hash_descriptor.obj \
+ src/libtomcrypt/src/misc/crypt_hash_is_valid.obj \
+ src/libtomcrypt/src/misc/crypt_libc.obj \
+ src/libtomcrypt/src/misc/crypt_ltc_mp_descriptor.obj \
+ src/libtomcrypt/src/misc/crypt_prng_descriptor.obj \
+ src/libtomcrypt/src/misc/crypt_prng_is_valid.obj \
+ src/libtomcrypt/src/misc/crypt_register_hash.obj \
+ src/libtomcrypt/src/misc/crypt_register_prng.obj \
+ src/libtomcrypt/src/misc/zeromem.obj \
+ src/libtomcrypt/src/pk/asn1/der_decode_bit_string.obj \
+ src/libtomcrypt/src/pk/asn1/der_decode_boolean.obj \
+ src/libtomcrypt/src/pk/asn1/der_decode_choice.obj \
+ src/libtomcrypt/src/pk/asn1/der_decode_ia5_string.obj \
+ src/libtomcrypt/src/pk/asn1/der_decode_integer.obj \
+ src/libtomcrypt/src/pk/asn1/der_decode_object_identifier.obj \
+ src/libtomcrypt/src/pk/asn1/der_decode_octet_string.obj \
+ src/libtomcrypt/src/pk/asn1/der_decode_printable_string.obj \
+ src/libtomcrypt/src/pk/asn1/der_decode_sequence_ex.obj \
+ src/libtomcrypt/src/pk/asn1/der_decode_sequence_flexi.obj \
+ src/libtomcrypt/src/pk/asn1/der_decode_sequence_multi.obj \
+ src/libtomcrypt/src/pk/asn1/der_decode_short_integer.obj \
+ src/libtomcrypt/src/pk/asn1/der_decode_utctime.obj \
+ src/libtomcrypt/src/pk/asn1/der_decode_utf8_string.obj \
+ src/libtomcrypt/src/pk/asn1/der_length_bit_string.obj \
+ src/libtomcrypt/src/pk/asn1/der_length_boolean.obj \
+ src/libtomcrypt/src/pk/asn1/der_length_ia5_string.obj \
+ src/libtomcrypt/src/pk/asn1/der_length_integer.obj \
+ src/libtomcrypt/src/pk/asn1/der_length_object_identifier.obj \
+ src/libtomcrypt/src/pk/asn1/der_length_octet_string.obj \
+ src/libtomcrypt/src/pk/asn1/der_length_printable_string.obj \
+ src/libtomcrypt/src/pk/asn1/der_length_sequence.obj \
+ src/libtomcrypt/src/pk/asn1/der_length_short_integer.obj \
+
+ src/libtomcrypt/src/pk/asn1/der_length_utctime.obj \
+
+ src/libtomcrypt/src/pk/asn1/der_length_utf8_string.obj \
+
+ src/libtomcrypt/src/pk/asn1/der_sequence_free.obj \
+
+ src/libtomcrypt/src/pk/ecc/ltc_ecc_map.obj \
+ src/libtomcrypt/src/pk/ecc/ltc_ecc_mul2add.obj \
+ src/libtomcrypt/src/pk/ecc/ltc_ecc_mulmod.obj \
+ src/libtomcrypt/src/pk/ecc/ltc_ecc_points.obj \
+ src/libtomcrypt/src/pk/ecc/ltc_ecc_projective_add_point.obj \
+ src/libtomcrypt/src/pk/ecc/ltc_ecc_projective_dbl_point.obj \
+ src/libtomcrypt/src/pk/pkcs1/pkcs_1_mgf1.obj \
+ src/libtomcrypt/src/pk/pkcs1/pkcs_1_oaep_decode.obj \
+ src/libtomcrypt/src/pk/pkcs1/pkcs_1_pss_decode.obj \
+ src/libtomcrypt/src/pk/pkcs1/pkcs_1_v1_5_decode.obj \
+ src/libtomcrypt/src/pk/rsa/rsa_exptmod.obj \
+ src/libtomcrypt/src/pk/rsa/rsa_free.obj \
+ src/libtomcrypt/src/pk/rsa/rsa_import.obj \
+ src/libtomcrypt/src/pk/rsa/rsa_make_key.obj \
+ src/libtomcrypt/src/pk/rsa/rsa_verify_hash.obj \
+ src/libtomcrypt/src/pk/rsa/rsa_verify_simple.obj \
+ src/libtommath/bncore.obj \
+ src/libtommath/bn_fast_mp_invmod.obj \
+ src/libtommath/bn_fast_mp_montgomery_reduce.obj \
+ src/libtommath/bn_fast_s_mp_mul_digs.obj \
+ src/libtommath/bn_fast_s_mp_mul_high_digs.obj \
+ src/libtommath/bn_fast_s_mp_sqr.obj \
+ src/libtommath/bn_mp_2expt.obj \
+ src/libtommath/bn_mp_abs.obj \
+ src/libtommath/bn_mp_add.obj \
+ src/libtommath/bn_mp_addmod.obj \
+ src/libtommath/bn_mp_add_d.obj \
+ src/libtommath/bn_mp_and.obj \
+ src/libtommath/bn_mp_clamp.obj \
+ src/libtommath/bn_mp_clear.obj \
+ src/libtommath/bn_mp_clear_multi.obj \
+ src/libtommath/bn_mp_cmp.obj \
+ src/libtommath/bn_mp_cmp_d.obj \
+ src/libtommath/bn_mp_cmp_mag.obj \
+ src/libtommath/bn_mp_cnt_lsb.obj \
+ src/libtommath/bn_mp_copy.obj \
+ src/libtommath/bn_mp_count_bits.obj \
+ src/libtommath/bn_mp_div.obj \
+ src/libtommath/bn_mp_div_2.obj \
+ src/libtommath/bn_mp_div_2d.obj \
+ src/libtommath/bn_mp_div_3.obj \
+ src/libtommath/bn_mp_div_d.obj \
+ src/libtommath/bn_mp_dr_is_modulus.obj \
+ src/libtommath/bn_mp_dr_reduce.obj \
+ src/libtommath/bn_mp_dr_setup.obj \
+ src/libtommath/bn_mp_exch.obj \
+ src/libtommath/bn_mp_exptmod.obj \
+ src/libtommath/bn_mp_exptmod_fast.obj \
+ src/libtommath/bn_mp_expt_d.obj \
+ src/libtommath/bn_mp_exteuclid.obj \
+ src/libtommath/bn_mp_fread.obj \
+ src/libtommath/bn_mp_fwrite.obj \
+ src/libtommath/bn_mp_gcd.obj \
+ src/libtommath/bn_mp_get_int.obj \
+ src/libtommath/bn_mp_grow.obj \
+ src/libtommath/bn_mp_init.obj \
+ src/libtommath/bn_mp_init_copy.obj \
+ src/libtommath/bn_mp_init_multi.obj \
+ src/libtommath/bn_mp_init_set.obj \
+ src/libtommath/bn_mp_init_set_int.obj \
+ src/libtommath/bn_mp_init_size.obj \
+ src/libtommath/bn_mp_invmod.obj \
+ src/libtommath/bn_mp_invmod_slow.obj \
+ src/libtommath/bn_mp_is_square.obj \
+ src/libtommath/bn_mp_jacobi.obj \
+ src/libtommath/bn_mp_karatsuba_mul.obj \
+ src/libtommath/bn_mp_karatsuba_sqr.obj \
+ src/libtommath/bn_mp_lcm.obj \
+ src/libtommath/bn_mp_lshd.obj \
+ src/libtommath/bn_mp_mod.obj \
+ src/libtommath/bn_mp_mod_2d.obj \
+ src/libtommath/bn_mp_mod_d.obj \
+ src/libtommath/bn_mp_montgomery_calc_normalization.obj \
+ src/libtommath/bn_mp_montgomery_reduce.obj \
+ src/libtommath/bn_mp_montgomery_setup.obj \
+ src/libtommath/bn_mp_mul.obj \
+ src/libtommath/bn_mp_mulmod.obj \
+ src/libtommath/bn_mp_mul_2.obj \
+ src/libtommath/bn_mp_mul_2d.obj \
+ src/libtommath/bn_mp_mul_d.obj \
+ src/libtommath/bn_mp_neg.obj \
+ src/libtommath/bn_mp_n_root.obj \
+ src/libtommath/bn_mp_or.obj \
+ src/libtommath/bn_mp_prime_fermat.obj \
+ src/libtommath/bn_mp_prime_is_divisible.obj \
+ src/libtommath/bn_mp_prime_is_prime.obj \
+ src/libtommath/bn_mp_prime_miller_rabin.obj \
+ src/libtommath/bn_mp_prime_next_prime.obj \
+ src/libtommath/bn_mp_prime_rabin_miller_trials.obj \
+ src/libtommath/bn_mp_prime_random_ex.obj \
+ src/libtommath/bn_mp_radix_size.obj \
+ src/libtommath/bn_mp_radix_smap.obj \
+ src/libtommath/bn_mp_rand.obj \
+ src/libtommath/bn_mp_read_radix.obj \
+ src/libtommath/bn_mp_read_signed_bin.obj \
+ src/libtommath/bn_mp_read_unsigned_bin.obj \
+ src/libtommath/bn_mp_reduce.obj \
+ src/libtommath/bn_mp_reduce_2k.obj \
+ src/libtommath/bn_mp_reduce_2k_l.obj \
+ src/libtommath/bn_mp_reduce_2k_setup.obj \
+ src/libtommath/bn_mp_reduce_2k_setup_l.obj \
+ src/libtommath/bn_mp_reduce_is_2k.obj \
+ src/libtommath/bn_mp_reduce_is_2k_l.obj \
+ src/libtommath/bn_mp_reduce_setup.obj \
+ src/libtommath/bn_mp_rshd.obj \
+ src/libtommath/bn_mp_set.obj \
+ src/libtommath/bn_mp_set_int.obj \
+ src/libtommath/bn_mp_shrink.obj \
+ src/libtommath/bn_mp_signed_bin_size.obj \
+ src/libtommath/bn_mp_sqr.obj \
+ src/libtommath/bn_mp_sqrmod.obj \
+ src/libtommath/bn_mp_sqrt.obj \
+ src/libtommath/bn_mp_sub.obj \
+ src/libtommath/bn_mp_submod.obj \
+ src/libtommath/bn_mp_sub_d.obj \
+ src/libtommath/bn_mp_toom_mul.obj \
+ src/libtommath/bn_mp_toom_sqr.obj \
+ src/libtommath/bn_mp_toradix.obj \
+ src/libtommath/bn_mp_toradix_n.obj \
+ src/libtommath/bn_mp_to_signed_bin.obj \
+ src/libtommath/bn_mp_to_signed_bin_n.obj \
+ src/libtommath/bn_mp_to_unsigned_bin.obj \
+ src/libtommath/bn_mp_to_unsigned_bin_n.obj \
+ src/libtommath/bn_mp_unsigned_bin_size.obj \
+ src/libtommath/bn_mp_xor.obj \
+ src/libtommath/bn_mp_zero.obj \
+ src/libtommath/bn_prime_tab.obj \
+ src/libtommath/bn_reverse.obj \
+ src/libtommath/bn_s_mp_add.obj \
+ src/libtommath/bn_s_mp_exptmod.obj \
+ src/libtommath/bn_s_mp_mul_digs.obj \
+ src/libtommath/bn_s_mp_mul_high_digs.obj \
+ src/libtommath/bn_s_mp_sqr.obj \
+ src/libtommath/bn_s_mp_sub.obj \
+ src/lzma/C/LzFind.obj \
+ src/lzma/C/LzmaDec.obj \
+ src/lzma/C/LzmaEnc.obj \
+ src/pklib/explode.obj \
+ src/pklib/implode.obj
+
+all: $(LIBRARY)
+
+#clean:
+# rm -f $(OBJS) $(LIBRARY)
+
+#install: $(LIBRARY)
+# install $(LIBRARY) /usr/local/lib
+# mkdir -p /usr/local/include/StormLib
+# cp StormLib.h /usr/local/include/StormLib
+# cp StormPort.h /usr/local/include/StormLib
+
+$(LIBRARY): $(OBJS_C) $(OBJS_CPP)
+ $(CPP) $(CFLAGS) $(DFLAGS) $(ARCH) $(LFLAGS) -shared -o $(LIBRARY) $(OBJS_C) $(OBJS_CPP)
+# $(AR) $(ARFLAGS) $(LIBRARY) $(OBJS_C) $(OBJS_CPP)
+
+$(OBJS_C): %.obj: %.c
+ $(CC) -o $@ $(CFLAGS) $(DFLAGS) -c $<
+
+$(OBJS_CPP): %.obj: %.cpp
+ $(CC) -o $@ $(CFLAGS) $(DFLAGS) -c $<
+
diff --git a/src/dep/src/StormLib/Publish.bat b/src/dep/src/StormLib/Publish.bat
new file mode 100644
index 0000000..1777c1a
--- /dev/null
+++ b/src/dep/src/StormLib/Publish.bat
@@ -0,0 +1,23 @@
+@echo off
+rem This BAT file updates the ZIP file that is to be uploaded to web
+rem Only use when both 32-bit and 64-bit are properly compiled
+
+echo Creating stormlib.zip ...
+cd \Ladik\Appdir
+zip.exe -ur9 ..\WWW\web\download\stormlib.zip StormLib\doc\*
+zip.exe -ur9 ..\WWW\web\download\stormlib.zip StormLib\src\*
+zip.exe -ur9 ..\WWW\web\download\stormlib.zip StormLib\storm_dll\*
+zip.exe -ur9 ..\WWW\web\download\stormlib.zip StormLib\StormLib.xcodeproj\*
+zip.exe -ur9 ..\WWW\web\download\stormlib.zip StormLib\stormlib_dll\*
+zip.exe -ur9 ..\WWW\web\download\stormlib.zip StormLib\test\*
+zip.exe -u9 ..\WWW\web\download\stormlib.zip StormLib\makefile*
+zip.exe -u9 ..\WWW\web\download\stormlib.zip StormLib\*.bat
+zip.exe -u9 ..\WWW\web\download\stormlib.zip StormLib\*.sln
+zip.exe -u9 ..\WWW\web\download\stormlib.zip StormLib\*.vcproj
+zip.exe -u9 ..\WWW\web\download\stormlib.zip StormLib\*.plist
+zip.exe -u9 ..\WWW\web\download\stormlib.zip StormLib\*.txt
+zip.exe -u9 ..\WWW\web\download\stormlib.zip StormLib\*.kdev4
+echo.
+
+echo Press any key to exit ...
+pause >nul
diff --git a/src/dep/src/StormLib/Publish_beta.bat b/src/dep/src/StormLib/Publish_beta.bat
new file mode 100644
index 0000000..3a4ca3e
--- /dev/null
+++ b/src/dep/src/StormLib/Publish_beta.bat
@@ -0,0 +1,23 @@
+@echo off
+rem This BAT file updates the ZIP file that is to be uploaded to web
+rem Only use when both 32-bit and 64-bit are properly compiled
+
+echo Creating stormlib_beta.zip ...
+cd \Ladik\Appdir
+zip.exe -ur9 ..\WWW\web\download\stormlib_beta.zip StormLib\doc\*
+zip.exe -ur9 ..\WWW\web\download\stormlib_beta.zip StormLib\src\*
+zip.exe -ur9 ..\WWW\web\download\stormlib_beta.zip StormLib\storm_dll\*
+zip.exe -ur9 ..\WWW\web\download\stormlib_beta.zip StormLib\StormLib.xcodeproj\*
+zip.exe -ur9 ..\WWW\web\download\stormlib_beta.zip StormLib\stormlib_dll\*
+zip.exe -ur9 ..\WWW\web\download\stormlib_beta.zip StormLib\test\*
+zip.exe -u9 ..\WWW\web\download\stormlib_beta.zip StormLib\makefile*
+zip.exe -u9 ..\WWW\web\download\stormlib_beta.zip StormLib\*.bat
+zip.exe -u9 ..\WWW\web\download\stormlib_beta.zip StormLib\*.sln
+zip.exe -u9 ..\WWW\web\download\stormlib_beta.zip StormLib\*.vcproj
+zip.exe -u9 ..\WWW\web\download\stormlib_beta.zip StormLib\*.plist
+zip.exe -u9 ..\WWW\web\download\stormlib_beta.zip StormLib\*.txt
+zip.exe -u9 ..\WWW\web\download\stormlib_beta.zip StormLib\*.kdev4
+echo.
+
+echo Press any key to exit ...
+pause >nul
diff --git a/src/dep/src/StormLib/SAttrFile.cpp b/src/dep/src/StormLib/SAttrFile.cpp
deleted file mode 100644
index d7b1cb7..0000000
--- a/src/dep/src/StormLib/SAttrFile.cpp
+++ /dev/null
@@ -1,354 +0,0 @@
-/*****************************************************************************/
-/* SAttrFile.cpp Copyright (c) Ladislav Zezula 2007 */
-/*---------------------------------------------------------------------------*/
-/* Description: */
-/*---------------------------------------------------------------------------*/
-/* Date Ver Who Comment */
-/* -------- ---- --- ------- */
-/* 12.06.04 1.00 Lad The first version of SAttrFile.cpp */
-/*****************************************************************************/
-
-#define __STORMLIB_SELF__
-#include "StormLib.h"
-#include "SCommon.h"
-#include
-
-#include "misc/crc32.h"
-#include "misc/md5.h"
-
-//-----------------------------------------------------------------------------
-// Local functions
-
-// This function creates the name for the listfile.
-// the file will be created under unique name in the temporary directory
-static void GetAttributesFileName(TMPQArchive * /* ha */, char * szAttrFile)
-{
- char szTemp[MAX_PATH];
-
- // Create temporary file name int TEMP directory
- GetTempPath(sizeof(szTemp)-1, szTemp);
- GetTempFileName(szTemp, ATTRIBUTES_NAME, 0, szAttrFile);
-}
-
-//-----------------------------------------------------------------------------
-// Public functions (internal use by StormLib)
-
-int SAttrFileCreate(TMPQArchive * ha)
-{
- TMPQAttr * pNewAttr;
- int nError = ERROR_SUCCESS;
-
- // There should NOW be any attributes
- assert(ha->pAttributes == NULL);
-
- pNewAttr = ALLOCMEM(TMPQAttr, 1);
- if(pNewAttr != NULL)
- {
- // Pre-set the structure
- pNewAttr->dwVersion = MPQ_ATTRIBUTES_V1;
- pNewAttr->dwFlags = 0;
-
- // Allocate array for CRC32
- pNewAttr->pCrc32 = ALLOCMEM(TMPQCRC32, ha->pHeader->dwHashTableSize);
- if(pNewAttr->pCrc32 != NULL)
- {
- pNewAttr->dwFlags |= MPQ_ATTRIBUTE_CRC32;
- memset(pNewAttr->pCrc32, 0, sizeof(TMPQCRC32) * ha->pHeader->dwHashTableSize);
- }
- else
- nError = ERROR_NOT_ENOUGH_MEMORY;
-
- // Allocate array for FILETIME
- pNewAttr->pFileTime = ALLOCMEM(TMPQFileTime, ha->pHeader->dwHashTableSize);
- if(pNewAttr->pFileTime != NULL)
- {
- pNewAttr->dwFlags |= MPQ_ATTRIBUTE_FILETIME;
- memset(pNewAttr->pFileTime, 0, sizeof(TMPQFileTime) * ha->pHeader->dwHashTableSize);
- }
- else
- nError = ERROR_NOT_ENOUGH_MEMORY;
-
- // Allocate array for MD5
- pNewAttr->pMd5 = ALLOCMEM(TMPQMD5, ha->pHeader->dwHashTableSize);
- if(pNewAttr->pMd5 != NULL)
- {
- pNewAttr->dwFlags |= MPQ_ATTRIBUTE_MD5;
- memset(pNewAttr->pMd5, 0, sizeof(TMPQMD5) * ha->pHeader->dwHashTableSize);
- }
- else
- nError = ERROR_NOT_ENOUGH_MEMORY;
- }
-
- // If something failed, then free the attributes structure
- if(nError != ERROR_SUCCESS)
- {
- FreeMPQAttributes(pNewAttr);
- pNewAttr = NULL;
- }
-
- ha->pAttributes = pNewAttr;
- return nError;
-}
-
-
-int SAttrFileLoad(TMPQArchive * ha)
-{
- TMPQAttr * pAttr = NULL;
- HANDLE hFile = NULL;
- DWORD dwBytesRead;
- DWORD dwToRead;
- int nError = ERROR_SUCCESS;
-
- // Initially, set the attrobutes to NULL
- ha->pAttributes = NULL;
-
- // Attempt to open the "(attributes)" file.
- // If it's not there, we don't support attributes
- if(!SFileOpenFileEx((HANDLE)ha, ATTRIBUTES_NAME, 0, &hFile))
- nError = GetLastError();
-
- // Allocate space for the TMPQAttributes
- if(nError == ERROR_SUCCESS)
- {
- pAttr = ALLOCMEM(TMPQAttr, 1);
- if(pAttr == NULL)
- nError = ERROR_NOT_ENOUGH_MEMORY;
- }
-
- // Load the content of the attributes file
- if(nError == ERROR_SUCCESS)
- {
- memset(pAttr, 0, sizeof(TMPQAttr));
-
- dwToRead = sizeof(DWORD) + sizeof(DWORD);
- SFileReadFile(hFile, pAttr, dwToRead, &dwBytesRead, NULL);
- if(dwBytesRead != dwToRead)
- nError = ERROR_FILE_CORRUPT;
- }
-
- // Verify format of the attributes
- if(nError == ERROR_SUCCESS)
- {
- if(pAttr->dwVersion > MPQ_ATTRIBUTES_V1)
- nError = ERROR_BAD_FORMAT;
- }
-
- // Load the CRC32 (if any)
- if(nError == ERROR_SUCCESS && (pAttr->dwFlags & MPQ_ATTRIBUTE_CRC32))
- {
- pAttr->pCrc32 = ALLOCMEM(TMPQCRC32, ha->pHeader->dwHashTableSize);
- if(pAttr->pCrc32 != NULL)
- {
- memset(pAttr->pCrc32, 0, sizeof(TMPQCRC32) * ha->pHeader->dwHashTableSize);
- dwToRead = sizeof(TMPQCRC32) * ha->pHeader->dwBlockTableSize;
- SFileReadFile(hFile, pAttr->pCrc32, dwToRead, &dwBytesRead, NULL);
- if(dwBytesRead != dwToRead)
- nError = ERROR_FILE_CORRUPT;
- }
- else
- {
- nError = ERROR_NOT_ENOUGH_MEMORY;
- }
- }
-
- // Read the FILETIMEs (if any)
- if(nError == ERROR_SUCCESS && (pAttr->dwFlags & MPQ_ATTRIBUTE_FILETIME))
- {
- pAttr->pFileTime = ALLOCMEM(TMPQFileTime, ha->pHeader->dwHashTableSize);
- if(pAttr->pFileTime != NULL)
- {
- memset(pAttr->pFileTime, 0, sizeof(TMPQFileTime) * ha->pHeader->dwHashTableSize);
- dwToRead = sizeof(TMPQFileTime) * ha->pHeader->dwBlockTableSize;
- SFileReadFile(hFile, pAttr->pFileTime, dwToRead, &dwBytesRead, NULL);
- if(dwBytesRead != dwToRead)
- nError = ERROR_FILE_CORRUPT;
- }
- else
- {
- nError = ERROR_NOT_ENOUGH_MEMORY;
- }
- }
-
- // Read the MD5 (if any)
- if(nError == ERROR_SUCCESS && (pAttr->dwFlags & MPQ_ATTRIBUTE_MD5))
- {
- pAttr->pMd5 = ALLOCMEM(TMPQMD5, ha->pHeader->dwHashTableSize);
- if(pAttr->pMd5 != NULL)
- {
- memset(pAttr->pMd5, 0, sizeof(TMPQMD5) * ha->pHeader->dwHashTableSize);
- dwToRead = sizeof(TMPQMD5) * ha->pHeader->dwBlockTableSize;
- SFileReadFile(hFile, pAttr->pMd5, dwToRead, &dwBytesRead, NULL);
- if(dwBytesRead != dwToRead)
- nError = ERROR_FILE_CORRUPT;
- }
- else
- {
- nError = ERROR_NOT_ENOUGH_MEMORY;
- }
- }
-
- // Set the attributes into the MPQ archive
- if(nError == ERROR_SUCCESS)
- {
- ha->pAttributes = pAttr;
- pAttr = NULL;
- }
-
- // Cleanup & exit
- FreeMPQAttributes(pAttr);
- SFileCloseFile(hFile);
- return nError;
-}
-
-int SAttrFileSaveToMpq(TMPQArchive * ha)
-{
- HANDLE hFile = INVALID_HANDLE_VALUE;
- DWORD dwToWrite;
- DWORD dwWritten;
- LCID lcSave = lcLocale;
- char szAttrFile[MAX_PATH];
- int nError = ERROR_SUCCESS;
-
- // If there are no attributes, do nothing
- if(ha->pAttributes == NULL)
- return ERROR_SUCCESS;
-
- // Create the local attributes file
- if(nError == ERROR_SUCCESS)
- {
- GetAttributesFileName(ha, szAttrFile);
- hFile = CreateFile(szAttrFile, GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, NULL);
- if(hFile == INVALID_HANDLE_VALUE)
- nError = GetLastError();
- }
-
- // Write the content of the attributes to the file
- if(nError == ERROR_SUCCESS)
- {
- // Write the header of the attributes file
- dwToWrite = sizeof(DWORD) + sizeof(DWORD);
- WriteFile(hFile, ha->pAttributes, dwToWrite, &dwWritten, NULL);
- if(dwWritten != dwToWrite)
- nError = ERROR_DISK_FULL;
- }
-
- // Write the array of CRC32
- if(nError == ERROR_SUCCESS && ha->pAttributes->pCrc32 != NULL)
- {
- dwToWrite = sizeof(TMPQCRC32) * ha->pHeader->dwBlockTableSize;
- WriteFile(hFile, ha->pAttributes->pCrc32, dwToWrite, &dwWritten, NULL);
- if(dwWritten != dwToWrite)
- nError = ERROR_DISK_FULL;
- }
-
- // Write the array of FILETIMEs
- if(nError == ERROR_SUCCESS && ha->pAttributes->pFileTime != NULL)
- {
- dwToWrite = sizeof(TMPQFileTime) * ha->pHeader->dwBlockTableSize;
- WriteFile(hFile, ha->pAttributes->pFileTime, dwToWrite, &dwWritten, NULL);
- if(dwWritten != dwToWrite)
- nError = ERROR_DISK_FULL;
- }
-
- // Write the array of MD5s
- if(nError == ERROR_SUCCESS && ha->pAttributes->pMd5 != NULL)
- {
- dwToWrite = sizeof(TMPQMD5) * ha->pHeader->dwBlockTableSize;
- WriteFile(hFile, ha->pAttributes->pMd5, dwToWrite, &dwWritten, NULL);
- if(dwWritten != dwToWrite)
- nError = ERROR_DISK_FULL;
- }
-
- // Add the attributes into MPQ
- if(nError == ERROR_SUCCESS)
- {
- SFileSetLocale(LANG_NEUTRAL);
- nError = AddFileToArchive(ha, hFile, ATTRIBUTES_NAME, MPQ_FILE_COMPRESS | MPQ_FILE_REPLACEEXISTING, 0, SFILE_TYPE_DATA, NULL);
- lcLocale = lcSave;
- }
-
- // Close the temporary file and delete it.
- // There is no FILE_FLAG_DELETE_ON_CLOSE on LINUX.
- if(hFile != INVALID_HANDLE_VALUE)
- CloseHandle(hFile);
- DeleteFile(szAttrFile);
-
- return nError;
-}
-
-void FreeMPQAttributes(TMPQAttr * pAttr)
-{
- if(pAttr != NULL)
- {
- if(pAttr->pCrc32 != NULL)
- FREEMEM(pAttr->pCrc32);
- if(pAttr->pFileTime != NULL)
- FREEMEM(pAttr->pFileTime);
- if(pAttr->pMd5 != NULL)
- FREEMEM(pAttr->pMd5);
-
- FREEMEM(pAttr);
- }
-}
-
-//-----------------------------------------------------------------------------
-// Public (exported) functions
-
-BOOL WINAPI SFileVerifyFile(HANDLE hMpq, const char * szFileName, DWORD dwFlags)
-{
- crc32_context crc32_ctx;
- md5_context md5_ctx;
- TMPQFile * hf;
- TMPQCRC32 Crc32;
- TMPQMD5 Md5;
- BYTE Buffer[0x1000];
- HANDLE hFile = NULL;
- DWORD dwBytesRead;
- BOOL bResult = TRUE;
-
- // Attempt to open the file
- if(SFileOpenFileEx(hMpq, szFileName, 0, &hFile))
- {
- // Initialize the CRC32 and MD5 counters
- CRC32_Init(&crc32_ctx);
- MD5_Init(&md5_ctx);
- hf = (TMPQFile *)hFile;
-
- // Go through entire file and update both CRC32 and MD5
- for(;;)
- {
- // Read data from file
- SFileReadFile(hFile, Buffer, sizeof(Buffer), &dwBytesRead, NULL);
- if(dwBytesRead == 0)
- break;
-
- // Update CRC32 value
- if(dwFlags & MPQ_ATTRIBUTE_CRC32)
- CRC32_Update(&crc32_ctx, Buffer, (int)dwBytesRead);
-
- // Update MD5 value
- if(dwFlags & MPQ_ATTRIBUTE_MD5)
- MD5_Update(&md5_ctx, Buffer, (int)dwBytesRead);
- }
-
- // Check if the CRC32 matches
- if((dwFlags & MPQ_ATTRIBUTE_CRC32) && hf->pCrc32 != NULL)
- {
- CRC32_Finish(&crc32_ctx, (unsigned long *)&Crc32.dwValue);
- if(Crc32.dwValue != hf->pCrc32->dwValue)
- bResult = FALSE;
- }
-
- // Check if MD5 matches
- if((dwFlags & MPQ_ATTRIBUTE_MD5) && hf->pMd5 != NULL)
- {
- MD5_Finish(&md5_ctx, Md5.Value);
- if(memcmp(Md5.Value, hf->pMd5->Value, sizeof(TMPQMD5)))
- bResult = FALSE;
- }
-
- SFileCloseFile(hFile);
- }
-
- return bResult;
-}
diff --git a/src/dep/src/StormLib/SCommon.cpp b/src/dep/src/StormLib/SCommon.cpp
deleted file mode 100644
index 45e3321..0000000
--- a/src/dep/src/StormLib/SCommon.cpp
+++ /dev/null
@@ -1,1187 +0,0 @@
-/*****************************************************************************/
-/* SCommon.cpp Copyright (c) Ladislav Zezula 2003 */
-/*---------------------------------------------------------------------------*/
-/* Common functions for StormLib, used by all SFile*** modules */
-/*---------------------------------------------------------------------------*/
-/* Date Ver Who Comment */
-/* -------- ---- --- ------- */
-/* 24.03.03 1.00 Lad The first version of SFileCommon.cpp */
-/* 19.11.03 1.01 Dan Big endian handling */
-/* 12.06.04 1.01 Lad Renamed to SCommon.cpp */
-/*****************************************************************************/
-
-#define __STORMLIB_SELF__
-#include "StormLib.h"
-#include "SCommon.h"
-
-#include "misc/crc32.h"
-#include "misc/md5.h"
-
-char StormLibCopyright[] = "StormLib v 4.50 Copyright Ladislav Zezula 1998-2003";
-
-//-----------------------------------------------------------------------------
-// The buffer for decryption engine.
-
-TMPQArchive * pFirstOpen = NULL; // The first member of MPQ archives chain
-LCID lcLocale = LANG_NEUTRAL; // File locale
-USHORT wPlatform = 0; // File platform
-
-//-----------------------------------------------------------------------------
-// Compression types
-
-//
-// Data compressions
-//
-// Can be combination of MPQ_COMPRESSION_PKWARE, MPQ_COMPRESSION_BZIP2
-// and MPQ_COMPRESSION_ZLIB. Some newer compressions are not supported
-// by older games. The table of supported compressions is here:
-//
-// MPQ_COMPRESSION_PKWARE - All games since Diablo I
-// MPQ_COMPRESSION_ZLIB - Games since Starcraft
-// MPQ_COMPRESSION_BZIP2 - Games since World of Warcraft
-//
-
-static int nDataCmp = MPQ_COMPRESSION_ZLIB;
-
-//
-// WAVE compressions by quality level
-//
-
-static int uWaveCmpLevel[] = {-1, 4, 2};
-static int uWaveCmpType[] = {MPQ_COMPRESSION_PKWARE, 0x81, 0x81};
-
-//-----------------------------------------------------------------------------
-// Storm buffer functions
-
-// Buffer for the decryption engine
-#define STORM_BUFFER_SIZE 0x500
-static DWORD StormBuffer[STORM_BUFFER_SIZE];
-static BOOL bStormBufferCreated = FALSE;
-
-int PrepareStormBuffer()
-{
- DWORD dwSeed = 0x00100001;
- DWORD index1 = 0;
- DWORD index2 = 0;
- int i;
-
- // Initialize the decryption buffer.
- // Do nothing if already done.
- if(bStormBufferCreated == FALSE)
- {
- for(index1 = 0; index1 < 0x100; index1++)
- {
- for(index2 = index1, i = 0; i < 5; i++, index2 += 0x100)
- {
- DWORD temp1, temp2;
-
- dwSeed = (dwSeed * 125 + 3) % 0x2AAAAB;
- temp1 = (dwSeed & 0xFFFF) << 0x10;
-
- dwSeed = (dwSeed * 125 + 3) % 0x2AAAAB;
- temp2 = (dwSeed & 0xFFFF);
-
- StormBuffer[index2] = (temp1 | temp2);
- }
- }
- bStormBufferCreated = TRUE;
- }
- return ERROR_SUCCESS;
-}
-
-//-----------------------------------------------------------------------------
-// Encrypting and decrypting hash table
-
-void EncryptHashTable(DWORD * pdwTable, BYTE * pbKey, DWORD dwLength)
-{
- DWORD dwSeed1 = 0x7FED7FED;
- DWORD dwSeed2 = 0xEEEEEEEE;
- DWORD ch; // One key character
-
- // Prepare seeds
- while(*pbKey != 0)
- {
- ch = toupper(*pbKey++);
-
- dwSeed1 = StormBuffer[0x300 + ch] ^ (dwSeed1 + dwSeed2);
- dwSeed2 = ch + dwSeed1 + dwSeed2 + (dwSeed2 << 5) + 3;
- }
-
- // Encrypt it
- dwSeed2 = 0xEEEEEEEE;
- while(dwLength-- > 0)
- {
- dwSeed2 += StormBuffer[0x400 + (dwSeed1 & 0xFF)];
- ch = *pdwTable;
- *pdwTable++ = ch ^ (dwSeed1 + dwSeed2);
-
- dwSeed1 = ((~dwSeed1 << 0x15) + 0x11111111) | (dwSeed1 >> 0x0B);
- dwSeed2 = ch + dwSeed2 + (dwSeed2 << 5) + 3;
- }
-}
-
-void DecryptHashTable(DWORD * pdwTable, BYTE * pbKey, DWORD dwLength)
-{
- DWORD dwSeed1 = 0x7FED7FED;
- DWORD dwSeed2 = 0xEEEEEEEE;
- DWORD ch; // One key character
-
- // Prepare seeds
- while(*pbKey != 0)
- {
- ch = toupper(*pbKey++);
-
- dwSeed1 = StormBuffer[0x300 + ch] ^ (dwSeed1 + dwSeed2);
- dwSeed2 = ch + dwSeed1 + dwSeed2 + (dwSeed2 << 5) + 3;
- }
-
- // Decrypt it
- dwSeed2 = 0xEEEEEEEE;
- while(dwLength-- > 0)
- {
- dwSeed2 += StormBuffer[0x400 + (dwSeed1 & 0xFF)];
- ch = *pdwTable ^ (dwSeed1 + dwSeed2);
-
- dwSeed1 = ((~dwSeed1 << 0x15) + 0x11111111) | (dwSeed1 >> 0x0B);
- dwSeed2 = ch + dwSeed2 + (dwSeed2 << 5) + 3;
- *pdwTable++ = ch;
- }
-}
-
-//-----------------------------------------------------------------------------
-// Encrypting and decrypting block table
-
-void EncryptBlockTable(DWORD * pdwTable, BYTE * pbKey, DWORD dwLength)
-{
- DWORD dwSeed1 = 0x7FED7FED;
- DWORD dwSeed2 = 0xEEEEEEEE;
- DWORD ch; // One key character
-
- // Prepare seeds
- while(*pbKey != 0)
- {
- ch = toupper(*pbKey++);
-
- dwSeed1 = StormBuffer[0x300 + ch] ^ (dwSeed1 + dwSeed2);
- dwSeed2 = ch + dwSeed1 + dwSeed2 + (dwSeed2 << 5) + 3;
- }
-
- // Decrypt it
- dwSeed2 = 0xEEEEEEEE;
- while(dwLength-- > 0)
- {
- dwSeed2 += StormBuffer[0x400 + (dwSeed1 & 0xFF)];
- ch = *pdwTable;
- *pdwTable++ = ch ^ (dwSeed1 + dwSeed2);
-
- dwSeed1 = ((~dwSeed1 << 0x15) + 0x11111111) | (dwSeed1 >> 0x0B);
- dwSeed2 = ch + dwSeed2 + (dwSeed2 << 5) + 3;
- }
-}
-
-void DecryptBlockTable(DWORD * pdwTable, BYTE * pbKey, DWORD dwLength)
-{
- DWORD dwSeed1 = 0x7FED7FED;
- DWORD dwSeed2 = 0xEEEEEEEE;
- DWORD ch; // One key character
-
- // Prepare seeds
- while(*pbKey != 0)
- {
- ch = toupper(*pbKey++);
-
- dwSeed1 = StormBuffer[0x300 + ch] ^ (dwSeed1 + dwSeed2);
- dwSeed2 = ch + dwSeed1 + dwSeed2 + (dwSeed2 << 5) + 3;
- }
-
- // Encrypt it
- dwSeed2 = 0xEEEEEEEE;
- while(dwLength-- > 0)
- {
- dwSeed2 += StormBuffer[0x400 + (dwSeed1 & 0xFF)];
- ch = *pdwTable ^ (dwSeed1 + dwSeed2);
-
- dwSeed1 = ((~dwSeed1 << 0x15) + 0x11111111) | (dwSeed1 >> 0x0B);
- dwSeed2 = ch + dwSeed2 + (dwSeed2 << 5) + 3;
- *pdwTable++ = ch;
- }
-}
-
-//-----------------------------------------------------------------------------
-// Functions tries to get file decryption key. The trick comes from block
-// positions which are stored at the begin of each compressed file. We know the
-// file size, that means we know number of blocks that means we know the first
-// DWORD value in block position. And if we know encrypted and decrypted value,
-// we can find the decryption key !!!
-//
-// hf - MPQ file handle
-// block - DWORD array of block positions
-// ch - Decrypted value of the first block pos
-
-DWORD DetectFileSeed(DWORD * block, DWORD decrypted)
-{
- DWORD saveSeed1;
- DWORD temp = *block ^ decrypted; // temp = seed1 + seed2
- temp -= 0xEEEEEEEE; // temp = seed1 + StormBuffer[0x400 + (seed1 & 0xFF)]
-
- for(int i = 0; i < 0x100; i++) // Try all 255 possibilities
- {
- DWORD seed1;
- DWORD seed2 = 0xEEEEEEEE;
- DWORD ch;
-
- // Try the first DWORD (We exactly know the value)
- seed1 = temp - StormBuffer[0x400 + i];
- seed2 += StormBuffer[0x400 + (seed1 & 0xFF)];
- ch = block[0] ^ (seed1 + seed2);
-
- if(ch != decrypted)
- continue;
-
- // Add 1 because we are decrypting block positions
- saveSeed1 = seed1 + 1;
-
- // If OK, continue and test the second value. We don't know exactly the value,
- // but we know that the second one has lower 16 bits set to zero
- // (no compressed block is larger than 0xFFFF bytes)
- seed1 = ((~seed1 << 0x15) + 0x11111111) | (seed1 >> 0x0B);
- seed2 = ch + seed2 + (seed2 << 5) + 3;
-
- seed2 += StormBuffer[0x400 + (seed1 & 0xFF)];
- ch = block[1] ^ (seed1 + seed2);
-
- if((ch & 0xFFFF0000) == 0)
- return saveSeed1;
- }
- return 0;
-}
-
-// Function tries to detect file seed. It expectes at least two uncompressed bytes
-DWORD DetectFileSeed2(DWORD * pdwBlock, UINT nDwords, ...)
-{
- va_list argList;
- DWORD dwDecrypted[0x10];
- DWORD saveSeed1;
- DWORD dwTemp;
- DWORD i, j;
-
- // We need at least two DWORDS to detect the seed
- if(nDwords < 0x02 || nDwords > 0x10)
- return 0;
-
- va_start(argList, nDwords);
- for(i = 0; i < nDwords; i++)
- dwDecrypted[i] = va_arg(argList, DWORD);
- va_end(argList);
-
- dwTemp = (*pdwBlock ^ dwDecrypted[0]) - 0xEEEEEEEE;
- for(i = 0; i < 0x100; i++) // Try all 255 possibilities
- {
- DWORD seed1;
- DWORD seed2 = 0xEEEEEEEE;
- DWORD ch;
-
- // Try the first DWORD
- seed1 = dwTemp - StormBuffer[0x400 + i];
- seed2 += StormBuffer[0x400 + (seed1 & 0xFF)];
- ch = pdwBlock[0] ^ (seed1 + seed2);
-
- if(ch != dwDecrypted[0])
- continue;
-
- saveSeed1 = seed1;
-
- // If OK, continue and test all bytes.
- for(j = 1; j < nDwords; j++)
- {
- seed1 = ((~seed1 << 0x15) + 0x11111111) | (seed1 >> 0x0B);
- seed2 = ch + seed2 + (seed2 << 5) + 3;
-
- seed2 += StormBuffer[0x400 + (seed1 & 0xFF)];
- ch = pdwBlock[j] ^ (seed1 + seed2);
-
- if(ch == dwDecrypted[j] && j == nDwords - 1)
- return saveSeed1;
- }
- }
- return 0;
-}
-
-
-//-----------------------------------------------------------------------------
-// Encrypting and decrypting MPQ blocks
-
-void EncryptMPQBlock(DWORD * block, DWORD dwLength, DWORD dwSeed1)
-{
- DWORD dwSeed2 = 0xEEEEEEEE;
- DWORD ch;
-
- // Round to DWORDs
- dwLength >>= 2;
-
- while(dwLength-- > 0)
- {
- dwSeed2 += StormBuffer[0x400 + (dwSeed1 & 0xFF)];
- ch = *block;
- *block++ = ch ^ (dwSeed1 + dwSeed2);
-
- dwSeed1 = ((~dwSeed1 << 0x15) + 0x11111111) | (dwSeed1 >> 0x0B);
- dwSeed2 = ch + dwSeed2 + (dwSeed2 << 5) + 3;
- }
-}
-
-void DecryptMPQBlock(DWORD * block, DWORD dwLength, DWORD dwSeed1)
-{
- DWORD dwSeed2 = 0xEEEEEEEE;
- DWORD ch;
-
- // Round to DWORDs
- dwLength >>= 2;
-
- while(dwLength-- > 0)
- {
- dwSeed2 += StormBuffer[0x400 + (dwSeed1 & 0xFF)];
- ch = *block ^ (dwSeed1 + dwSeed2);
-
- dwSeed1 = ((~dwSeed1 << 0x15) + 0x11111111) | (dwSeed1 >> 0x0B);
- dwSeed2 = ch + dwSeed2 + (dwSeed2 << 5) + 3;
- *block++ = ch;
- }
-}
-
-
-DWORD DecryptHashIndex(TMPQArchive * ha, const char * szFileName)
-{
- BYTE * pbKey = (BYTE *)szFileName;
- DWORD dwSeed1 = 0x7FED7FED;
- DWORD dwSeed2 = 0xEEEEEEEE;
- DWORD ch;
-
- while(*pbKey != 0)
- {
- ch = toupper(*pbKey++);
-
- dwSeed1 = StormBuffer[0x000 + ch] ^ (dwSeed1 + dwSeed2);
- dwSeed2 = ch + dwSeed1 + dwSeed2 + (dwSeed2 << 5) + 3;
- }
- return (dwSeed1 & (ha->pHeader->dwHashTableSize - 1));
-}
-
-DWORD DecryptName1(const char * szFileName)
-{
- BYTE * pbKey = (BYTE *)szFileName;
- DWORD dwSeed1 = 0x7FED7FED;
- DWORD dwSeed2 = 0xEEEEEEEE;
- DWORD ch;
-
- while(*pbKey != 0)
- {
- ch = toupper(*pbKey++);
-
- dwSeed1 = StormBuffer[0x100 + ch] ^ (dwSeed1 + dwSeed2);
- dwSeed2 = ch + dwSeed1 + dwSeed2 + (dwSeed2 << 5) + 3;
- }
- return dwSeed1;
-}
-
-DWORD DecryptName2(const char * szFileName)
-{
- BYTE * pbKey = (BYTE *)szFileName;
- DWORD dwSeed1 = 0x7FED7FED;
- DWORD dwSeed2 = 0xEEEEEEEE;
- int ch;
-
- while(*pbKey != 0)
- {
- ch = toupper(*pbKey++);
-
- dwSeed1 = StormBuffer[0x200 + ch] ^ (dwSeed1 + dwSeed2);
- dwSeed2 = ch + dwSeed1 + dwSeed2 + (dwSeed2 << 5) + 3;
- }
- return dwSeed1;
-}
-
-DWORD DecryptFileSeed(const char * szFileName)
-{
- BYTE * pbKey = (BYTE *)szFileName;
- DWORD dwSeed1 = 0x7FED7FED; // EBX
- DWORD dwSeed2 = 0xEEEEEEEE; // ESI
- DWORD ch;
-
- while(*pbKey != 0)
- {
- ch = toupper(*pbKey++); // ECX
-
- dwSeed1 = StormBuffer[0x300 + ch] ^ (dwSeed1 + dwSeed2);
- dwSeed2 = ch + dwSeed1 + dwSeed2 + (dwSeed2 << 5) + 3;
- }
- return dwSeed1;
-}
-
-TMPQHash * GetHashEntry(TMPQArchive * ha, const char * szFileName)
-{
- TMPQHash * pHashEnd = ha->pHashTable + ha->pHeader->dwHashTableSize;
- TMPQHash * pHash0; // File hash entry (start)
- TMPQHash * pHash; // File hash entry (current)
- DWORD dwIndex = (DWORD)(DWORD_PTR)szFileName;
- DWORD dwName1;
- DWORD dwName2;
-
- // If filename is given by index, we have to search all hash entries for the right index.
- if(dwIndex <= ha->pHeader->dwBlockTableSize)
- {
- // Pass all the hash entries and find the one with proper block index
- for(pHash = ha->pHashTable; pHash < pHashEnd; pHash++)
- {
- if(pHash->dwBlockIndex == dwIndex)
- return pHash;
- }
- return NULL;
- }
-
- // Decrypt name and block index
- dwIndex = DecryptHashIndex(ha, szFileName);
- dwName1 = DecryptName1(szFileName);
- dwName2 = DecryptName2(szFileName);
- pHash = pHash0 = ha->pHashTable + dwIndex;
-
- // Look for hash index
- while(pHash->dwBlockIndex != HASH_ENTRY_FREE)
- {
- if(pHash->dwName1 == dwName1 && pHash->dwName2 == dwName2 && pHash->dwBlockIndex != HASH_ENTRY_DELETED)
- return pHash;
-
- // Move to the next hash entry
- if(++pHash >= pHashEnd)
- pHash = ha->pHashTable;
- if(pHash == pHash0)
- break;
- }
-
- // File was not found
- return NULL;
-}
-
-// Retrieves the locale-specific hash entry
-TMPQHash * GetHashEntryEx(TMPQArchive * ha, const char * szFileName, LCID lcLocale)
-{
- TMPQHash * pHashNeutral = NULL; // Language-neutral hash entry
- TMPQHash * pHashExact = NULL; // Exact hash entry
- TMPQHash * pHashEnd = ha->pHashTable + ha->pHeader->dwHashTableSize;
- TMPQHash * pHash = GetHashEntry(ha, szFileName);
-
- if(pHash != NULL)
- {
- TMPQHash * pHashStart = pHash;
- DWORD dwName1 = pHash->dwName1;
- DWORD dwName2 = pHash->dwName2;
-
- // Parse the entire block of equal files (differing by language ID only)
- while(pHash->dwBlockIndex != HASH_ENTRY_FREE)
- {
- // There may be an entry deleted amongst various language versions
- if(pHash->dwName1 == dwName1 && pHash->dwName2 == dwName2 && pHash->dwBlockIndex != HASH_ENTRY_DELETED)
- {
- // Remember hash entry for neutral file and for lag-exact file
- if(pHash->lcLocale == LANG_NEUTRAL)
- pHashNeutral = pHash;
- if(pHash->lcLocale == lcLocale)
- pHashExact = pHash;
- }
-
- // Move to th next hash
- if(++pHash >= pHashEnd)
- pHash = ha->pHashTable;
- if(pHash == pHashStart)
- break;
- }
-
- // If we found language-exact hash, return that one
- // If not, return language neutral hash
- if(pHashExact != NULL)
- return pHashExact;
- }
-
- // Not found
- return pHashNeutral;
-}
-
-// Finds the nearest free hash entry for a file
-TMPQHash * FindFreeHashEntry(TMPQArchive * ha, const char * szFileName)
-{
- TMPQHash * pHashEnd = ha->pHashTable + ha->pHeader->dwHashTableSize;
- TMPQHash * pHash0; // File hash entry (search start)
- TMPQHash * pHash; // File hash entry
- DWORD dwIndex = DecryptHashIndex(ha, szFileName);
- DWORD dwName1 = DecryptName1(szFileName);
- DWORD dwName2 = DecryptName2(szFileName);
- DWORD dwBlockIndex = 0xFFFFFFFF;
-
- // Save the starting hash position
- pHash = pHash0 = ha->pHashTable + dwIndex;
-
- // Look for the first free or deleted hash entry.
- while(pHash->dwBlockIndex < HASH_ENTRY_DELETED)
- {
- if(++pHash >= pHashEnd)
- pHash = ha->pHashTable;
- if(pHash == pHash0)
- return NULL;
- }
-
- // Fill the hash entry with the informations about the file name
- pHash->dwName1 = dwName1;
- pHash->dwName2 = dwName2;
- pHash->lcLocale = (USHORT)lcLocale;
- pHash->wPlatform = wPlatform;
-
- // Now we have to find a free block entry
- for(dwIndex = 0; dwIndex < ha->pHeader->dwBlockTableSize; dwIndex++)
- {
- TMPQBlock * pBlock = ha->pBlockTable + dwIndex;
-
- if((pBlock->dwFlags & MPQ_FILE_EXISTS) == 0)
- {
- dwBlockIndex = dwIndex;
- break;
- }
- }
-
- // If no free block entry found, we have to use the index
- // at the end of the current block table
- if(dwBlockIndex == 0xFFFFFFFF)
- dwBlockIndex = ha->pHeader->dwBlockTableSize;
- pHash->dwBlockIndex = dwBlockIndex;
- return pHash;
-}
-
-//-----------------------------------------------------------------------------
-// Checking for valid archive handle and valid file handle
-
-BOOL IsValidMpqHandle(TMPQArchive * ha)
-{
- if(ha == NULL || IsBadReadPtr(ha, sizeof(TMPQArchive)))
- return FALSE;
- if(ha->pHeader == NULL || IsBadReadPtr(ha->pHeader, sizeof(TMPQHeader)))
- return FALSE;
-
- return (ha->pHeader->dwID == ID_MPQ);
-}
-
-BOOL IsValidFileHandle(TMPQFile * hf)
-{
- if(hf == NULL || IsBadReadPtr(hf, sizeof(TMPQFile)))
- return FALSE;
-
- if(hf->hFile != INVALID_HANDLE_VALUE)
- return TRUE;
-
- return IsValidMpqHandle(hf->ha);
-}
-
-int AddInternalFile(TMPQArchive * ha, const char * szFileName)
-{
- TMPQBlockEx * pBlockEx;
- TMPQBlock * pBlockEnd;
- TMPQBlock * pBlock;
- TMPQHash * pHash;
- BOOL bFoundFreeEntry = FALSE;
- int nError = ERROR_SUCCESS;
-
- // Check if the file already exists in the archive
- pHash = GetHashEntryEx(ha, szFileName, LANG_NEUTRAL);
- if(pHash == NULL)
- {
- pHash = FindFreeHashEntry(ha, szFileName);
- if(pHash != NULL)
- {
- // Reset the locale ID to neutral, to be independent on current
- // locale set by the user.
- pHash->lcLocale = LANG_NEUTRAL;
-
- // Fill the block table
- pBlockEnd = ha->pBlockTable + ha->pHeader->dwBlockTableSize;
- pBlockEx = ha->pExtBlockTable;
- for(pBlock = ha->pBlockTable; pBlock < pBlockEnd; pBlock++, pBlockEx++)
- {
- if((pBlock->dwFlags & MPQ_FILE_EXISTS) == 0)
- {
- bFoundFreeEntry = TRUE;
- break;
- }
- }
-
- // If the block is out of the available entries, return error
- if(pBlock >= (ha->pBlockTable + ha->pHeader->dwHashTableSize))
- return ERROR_DISK_FULL;
-
- // If we had to add the file at the end, increment the block table
- if(bFoundFreeEntry == FALSE)
- ha->pHeader->dwBlockTableSize++;
-
- // Fill the block entry
- pBlockEx->wFilePosHigh = (USHORT)ha->HashTablePos.HighPart;
- pBlock->dwFilePos = ha->HashTablePos.LowPart;
- pBlock->dwFSize = 0;
- pBlock->dwCSize = 0;
- pBlock->dwFlags = MPQ_FILE_EXISTS;
-
- // Add the node for the file name
- return SListFileCreateNode(ha, szFileName, LANG_NEUTRAL);
- }
- else
- {
- nError = ERROR_HANDLE_DISK_FULL;
- }
- }
-
- return nError;
-}
-
-// This function writes a local file into the MPQ archive.
-// Returns 0 if OK, otherwise error code.
-int AddFileToArchive(
- TMPQArchive * ha,
- HANDLE hFile,
- const char * szArchivedName,
- DWORD dwFlags,
- DWORD dwQuality,
- int nFileType,
- BOOL * pbReplaced)
-{
- LARGE_INTEGER TempPos; // For various file offset calculations
- TMPQBlock * pBlockEnd; // Pointer to end of the block table
- TMPQFile * hf = NULL; // File structure for newly added file
- BYTE * pbCompressed = NULL; // Compressed (target) data
- BYTE * pbToWrite = NULL; // Data to write to the file
- DWORD dwBlockPosLen = 0; // Length of the file block offset (in bytes)
- DWORD dwTransferred = 0; // Number of bytes read or written
- DWORD dwFileSizeHigh = 0; // High 32 bits of the file size
- DWORD dwFileSize = 0; // Low 32-bits of the file size
- BOOL bReplaced = FALSE; // TRUE if replaced, FALSE if added
- int nCmpFirst = nDataCmp; // Compression for the first data block
- int nCmpNext = nDataCmp; // Compression for the next data blocks
- int nCmp = nDataCmp; // Current compression
- int nCmpLevel = -1; // Compression level
- int nError = ERROR_SUCCESS;
-
- // Set the correct compression types
- if(dwFlags & MPQ_FILE_IMPLODE)
- nCmpFirst = nCmpNext = MPQ_COMPRESSION_PKWARE;
- pBlockEnd = ha->pBlockTable + ha->pHeader->dwBlockTableSize;
-
- if(dwFlags & MPQ_FILE_COMPRESS)
- {
- if(nFileType == SFILE_TYPE_DATA)
- nCmpFirst = nCmpNext = nDataCmp;
-
- if(nFileType == SFILE_TYPE_WAVE)
- {
- nCmpNext = uWaveCmpType[dwQuality];
- nCmpLevel = uWaveCmpLevel[dwQuality];
- }
- }
-
- // Get the size of the file to be added
- if(nError == ERROR_SUCCESS)
- {
- dwFileSize = GetFileSize(hFile, &dwFileSizeHigh);
-
- // Adjust file flags for too-small files
- if(dwFileSize < 0x04)
- dwFlags &= ~(MPQ_FILE_ENCRYPTED | MPQ_FILE_FIXSEED);
- if(dwFileSize < 0x20)
- dwFlags &= ~MPQ_FILE_COMPRESSED;
-
- // File in MPQ cannot be greater than 4GB
- if(dwFileSizeHigh != 0)
- nError = ERROR_PARAMETER_QUOTA_EXCEEDED;
- }
-
- // Allocate the TMPQFile entry for newly added file
- if(nError == ERROR_SUCCESS)
- {
- hf = (TMPQFile *)ALLOCMEM(BYTE, sizeof(TMPQFile) + strlen(szArchivedName));
- if(hf == NULL)
- nError = ERROR_NOT_ENOUGH_MEMORY;
- }
-
- // Reset the TMPQFile structure
- if(nError == ERROR_SUCCESS)
- {
- memset(hf, 0, sizeof(TMPQFile));
- strcpy(hf->szFileName, szArchivedName);
- hf->hFile = INVALID_HANDLE_VALUE;
- hf->ha = ha;
-
- // Check if the file already exists in the archive
- if((hf->pHash = GetHashEntryEx(ha, szArchivedName, lcLocale)) != NULL)
- {
- if(hf->pHash->lcLocale == lcLocale)
- {
- if((dwFlags & MPQ_FILE_REPLACEEXISTING) == 0)
- {
- nError = ERROR_ALREADY_EXISTS;
- hf->pHash = NULL;
- }
- else
- {
- hf->pBlockEx = ha->pExtBlockTable + hf->pHash->dwBlockIndex;
- hf->pBlock = ha->pBlockTable + hf->pHash->dwBlockIndex;
- bReplaced = TRUE;
- }
- }
- else
- hf->pHash = NULL;
- }
-
- if(nError == ERROR_SUCCESS && hf->pHash == NULL)
- {
- hf->pHash = FindFreeHashEntry(ha, szArchivedName);
- if(hf->pHash == NULL)
- nError = ERROR_HANDLE_DISK_FULL;
- }
-
- // Set the hash index
- hf->dwHashIndex = (DWORD)(hf->pHash - ha->pHashTable);
- }
-
- // Find a block table entry for the file
- if(nError == ERROR_SUCCESS)
- {
- TMPQBlockEx * pBlockEx = NULL; // Entry in the extended block table
- TMPQBlock * pBlock = NULL; // Entry in the block table
-
- // Get the position of the first file
- hf->MpqFilePos.QuadPart = ha->pHeader->dwHeaderSize;
-
- // Search the entire block table and find a free block.
- // Also find MPQ offset at which the file data will be stored
- pBlockEx = ha->pExtBlockTable;
- for(pBlock = ha->pBlockTable; pBlock < pBlockEnd; pBlock++, pBlockEx++)
- {
- if(pBlock->dwFlags & MPQ_FILE_EXISTS)
- {
- TempPos.HighPart = pBlockEx->wFilePosHigh;
- TempPos.LowPart = pBlock->dwFilePos;
- TempPos.QuadPart += pBlock->dwCSize;
-
- if(TempPos.QuadPart > hf->MpqFilePos.QuadPart)
- hf->MpqFilePos = TempPos;
- }
- else
- {
- if(hf->pBlock == NULL)
- {
- hf->pBlockEx = pBlockEx;
- hf->pBlock = pBlock;
- }
- }
- }
-
- // Calculate the raw file offset
- hf->RawFilePos.QuadPart = hf->MpqFilePos.QuadPart + ha->MpqPos.QuadPart;
-
- // If no free block in the middle of the block table,
- // use the one after last used block
- if(hf->pBlock == NULL)
- {
- hf->pBlockEx = pBlockEx;
- hf->pBlock = pBlock;
- }
-
- // When format V1, we cannot exceed 4 GB
- if(ha->pHeader->wFormatVersion == MPQ_FORMAT_VERSION_1)
- {
- TempPos.QuadPart = hf->RawFilePos.QuadPart + dwFileSize;
- TempPos.QuadPart += ha->pHeader->dwHashTableSize * sizeof(TMPQHash);
- TempPos.QuadPart += ha->pHeader->dwBlockTableSize * sizeof(TMPQBlock);
-
- if(TempPos.HighPart != 0)
- nError = ERROR_DISK_FULL;
- }
-
- // If the block offset exceeds number of hash entries,
- // we cannot add new file to the MPQ
- hf->dwBlockIndex = (DWORD)(hf->pBlock - ha->pBlockTable);
- if(hf->dwBlockIndex >= ha->pHeader->dwHashTableSize)
- nError = ERROR_HANDLE_DISK_FULL;
- }
-
- // Create seed1 for file encryption
- if(nError == ERROR_SUCCESS && (dwFlags & MPQ_FILE_ENCRYPTED))
- {
- const char * szTemp = strrchr(szArchivedName, '\\');
-
- // Create seed1 for file encryption
- if(szTemp != NULL)
- szArchivedName = szTemp + 1;
-
- hf->dwSeed1 = DecryptFileSeed(szArchivedName);
- if(dwFlags & MPQ_FILE_FIXSEED)
- hf->dwSeed1 = (hf->dwSeed1 + hf->MpqFilePos.LowPart) ^ dwFileSize;
- }
-
- // Resolve CRC32 and MD5 entry for the file
- // Only do it when the MPQ archive has attributes
- if(nError == ERROR_SUCCESS && ha->pAttributes != NULL)
- {
- if(ha->pAttributes->pCrc32 != NULL)
- hf->pCrc32 = ha->pAttributes->pCrc32 + hf->dwBlockIndex;
- if(ha->pAttributes->pFileTime != NULL)
- hf->pFileTime = ha->pAttributes->pFileTime + hf->dwBlockIndex;
- if(ha->pAttributes->pMd5 != NULL)
- hf->pMd5 = ha->pAttributes->pMd5 + hf->dwBlockIndex;
- }
-
- // Allocate buffers for the compressed data
- if(nError == ERROR_SUCCESS)
- {
- hf->nBlocks = (dwFileSize / ha->dwBlockSize) + 1;
- if(dwFileSize % ha->dwBlockSize)
- hf->nBlocks++;
-
- if((hf->pbFileBuffer = ALLOCMEM(BYTE, ha->dwBlockSize)) == NULL)
- nError = ERROR_NOT_ENOUGH_MEMORY;
- pbToWrite = hf->pbFileBuffer;
- }
-
- // For compressed files, allocate buffer for block positions and for the compressed data
- if(nError == ERROR_SUCCESS && (dwFlags & MPQ_FILE_COMPRESSED))
- {
- hf->pdwBlockPos = ALLOCMEM(DWORD, hf->nBlocks + 1);
- pbCompressed = ALLOCMEM(BYTE, ha->dwBlockSize * 2);
- if(hf->pdwBlockPos == NULL || pbCompressed == NULL)
- nError = ERROR_NOT_ENOUGH_MEMORY;
- pbToWrite = pbCompressed;
- }
-
- // Set the file position to the point where the file will be stored
- if(nError == ERROR_SUCCESS)
- {
- // Set the file pointer to file data position
- SetFilePointer(ha->hFile, hf->RawFilePos.LowPart, &hf->RawFilePos.HighPart, FILE_BEGIN);
-
- // Initialize the hash entry for the file
- hf->pHash->dwBlockIndex = hf->dwBlockIndex;
-
- // Initialize the block table entry for the file
- hf->pBlockEx->wFilePosHigh = (USHORT)hf->MpqFilePos.HighPart;
- hf->pBlock->dwFilePos = hf->MpqFilePos.LowPart;
- hf->pBlock->dwFSize = dwFileSize;
- hf->pBlock->dwCSize = 0;
- hf->pBlock->dwFlags = dwFlags | MPQ_FILE_EXISTS;
- }
-
- // Write block positions (if the file will be compressed)
- if(nError == ERROR_SUCCESS && (dwFlags & MPQ_FILE_COMPRESSED))
- {
- dwBlockPosLen = hf->nBlocks * sizeof(DWORD);
- if(dwFlags & MPQ_FILE_HAS_EXTRA)
- dwBlockPosLen += sizeof(DWORD);
-
- memset(hf->pdwBlockPos, 0, dwBlockPosLen);
- hf->pdwBlockPos[0] = dwBlockPosLen;
-
- // Write the block positions. Only swap the first item, rest is zeros.
- BSWAP_ARRAY32_UNSIGNED(hf->pdwBlockPos, 1);
- WriteFile(ha->hFile, hf->pdwBlockPos, dwBlockPosLen, &dwTransferred, NULL);
- BSWAP_ARRAY32_UNSIGNED(hf->pdwBlockPos, 1);
-
- if(dwTransferred == dwBlockPosLen)
- hf->pBlock->dwCSize += dwBlockPosLen;
- else
- nError = GetLastError();
- }
-
- // Write all file blocks
- if(nError == ERROR_SUCCESS)
- {
- crc32_context crc32_ctx;
- md5_context md5_ctx;
- DWORD nBlock;
-
- // Initialize CRC32 and MD5 processing
- CRC32_Init(&crc32_ctx);
- MD5_Init(&md5_ctx);
- nCmp = nCmpFirst;
-
- // Move the file pointer to the begin of the file
- SetFilePointer(hFile, 0, NULL, FILE_BEGIN);
- for(nBlock = 0; nBlock < hf->nBlocks-1; nBlock++)
- {
- DWORD dwInLength = ha->dwBlockSize;
- DWORD dwOutLength = ha->dwBlockSize;
-
- // Load the block from the file
- ReadFile(hFile, hf->pbFileBuffer, ha->dwBlockSize, &dwInLength, NULL);
- if(dwInLength == 0)
- break;
-
- // Update CRC32 and MD5 for the file
- if(hf->pCrc32 != NULL)
- CRC32_Update(&crc32_ctx, hf->pbFileBuffer, dwInLength);
- if(hf->pMd5 != NULL)
- MD5_Update(&md5_ctx, hf->pbFileBuffer, dwInLength);
-
- // Compress the block, if necessary
- dwOutLength = dwInLength;
- if(hf->pBlock->dwFlags & MPQ_FILE_COMPRESSED)
- {
- // Should be enough for compression
- int nOutLength = ha->dwBlockSize * 2;
- int nCmpType = 0;
-
- if(hf->pBlock->dwFlags & MPQ_FILE_IMPLODE)
- Compress_pklib((char *)pbCompressed, &nOutLength, (char *)hf->pbFileBuffer, dwInLength, &nCmpType, 0);
-
- if(hf->pBlock->dwFlags & MPQ_FILE_COMPRESS)
- SCompCompress((char *)pbCompressed, &nOutLength, (char *)hf->pbFileBuffer, dwInLength, nCmp, 0, nCmpLevel);
-
- // The compressed block size must NOT be the same or greater like
- // the original block size. If yes, do not compress the block
- // and store the data as-is.
- if(nOutLength >= (int)dwInLength)
- {
- memcpy(pbCompressed, hf->pbFileBuffer, dwInLength);
- nOutLength = dwInLength;
- }
-
- // Update block positions
- dwOutLength = nOutLength;
- hf->pdwBlockPos[nBlock+1] = hf->pdwBlockPos[nBlock] + dwOutLength;
- nCmp = nCmpNext;
- }
-
- // Encrypt the block, if necessary
- if(hf->pBlock->dwFlags & MPQ_FILE_ENCRYPTED)
- {
- BSWAP_ARRAY32_UNSIGNED((DWORD *)pbToWrite, dwOutLength / sizeof(DWORD));
- EncryptMPQBlock((DWORD *)pbToWrite, dwOutLength, hf->dwSeed1 + nBlock);
- BSWAP_ARRAY32_UNSIGNED((DWORD *)pbToWrite, dwOutLength / sizeof(DWORD));
- }
-
- // Write the block
- WriteFile(ha->hFile, pbToWrite, dwOutLength, &dwTransferred, NULL);
- if(dwTransferred != dwOutLength)
- {
- nError = ERROR_DISK_FULL;
- break;
- }
-
- // Update the hash table position and the compressed file size
- hf->pBlock->dwCSize += dwTransferred;
- }
-
- // Finish calculating of CRC32 and MD5
- if(hf->pCrc32 != NULL)
- CRC32_Finish(&crc32_ctx, (unsigned long *)&hf->pCrc32->dwValue);
- if(hf->pMd5 != NULL)
- MD5_Finish(&md5_ctx, hf->pMd5->Value);
- }
-
- // Now save the block positions
- if(nError == ERROR_SUCCESS && (hf->pBlock->dwFlags & MPQ_FILE_COMPRESSED))
- {
- if(dwFlags & MPQ_FILE_HAS_EXTRA)
- hf->pdwBlockPos[hf->nBlocks] = hf->pdwBlockPos[hf->nBlocks-1];
-
- // If file is encrypted, block positions are also encrypted
- if(dwFlags & MPQ_FILE_ENCRYPTED)
- EncryptMPQBlock(hf->pdwBlockPos, dwBlockPosLen, hf->dwSeed1 - 1);
-
- // Set the position back to the block table
- SetFilePointer(ha->hFile, hf->RawFilePos.LowPart, &hf->RawFilePos.HighPart, FILE_BEGIN);
-
- // Write block positions to the archive
- BSWAP_ARRAY32_UNSIGNED(hf->pdwBlockPos, hf->nBlocks);
- WriteFile(ha->hFile, hf->pdwBlockPos, dwBlockPosLen, &dwTransferred, NULL);
- if(dwTransferred != dwBlockPosLen)
- nError = ERROR_DISK_FULL;
- }
-
- // If success, we have to change the settings
- // in MPQ header. If failed, we have to clean hash entry
- if(nError == ERROR_SUCCESS)
- {
- DWORD dwTableSize;
-
- ha->pLastFile = NULL;
- ha->dwBlockPos = 0;
- ha->dwBuffPos = 0;
-
- // Add new entry to the block table (if needed)
- if(hf->dwBlockIndex >= ha->pHeader->dwBlockTableSize)
- ha->pHeader->dwBlockTableSize++;
-
- // Calculate positions of all tables
- ha->HashTablePos.QuadPart = hf->RawFilePos.QuadPart + hf->pBlock->dwCSize;
- TempPos.QuadPart = hf->MpqFilePos.QuadPart + hf->pBlock->dwCSize;
-
- // Set the position of hash table of the archive
- ha->pHeader->dwHashTablePos = TempPos.LowPart;
- ha->pHeader->wHashTablePosHigh = (USHORT)TempPos.HighPart;
- dwTableSize = ha->pHeader->dwHashTableSize * sizeof(TMPQHash);
-
- // Update block table pos
- TempPos.QuadPart += dwTableSize;
- ha->BlockTablePos.QuadPart = ha->HashTablePos.QuadPart + dwTableSize;
- ha->pHeader->wBlockTablePosHigh = (USHORT)TempPos.HighPart;
- ha->pHeader->dwBlockTablePos = TempPos.LowPart;
- dwTableSize = ha->pHeader->dwBlockTableSize * sizeof(TMPQBlock);
-
- // If the archive size exceeded 4GB, we have to use extended block table
- TempPos.QuadPart += dwTableSize;
- if(TempPos.HighPart != 0 || ha->pHeader->ExtBlockTablePos.QuadPart != 0)
- {
- ha->ExtBlockTablePos.QuadPart = ha->BlockTablePos.QuadPart + dwTableSize;
- ha->pHeader->ExtBlockTablePos = TempPos;
- TempPos.QuadPart += ha->pHeader->dwBlockTableSize * sizeof(TMPQBlockEx);
- }
-
- // Update archive size (only valid for version V1)
- ha->MpqSize = TempPos;
- ha->pHeader->dwArchiveSize = TempPos.LowPart;
- ha->dwFlags |= MPQ_FLAG_CHANGED;
- }
- else
- {
- // Clear the hash table entry
- if(hf != NULL && hf->pHash != NULL)
- memset(hf->pHash, 0xFF, sizeof(TMPQHash));
- }
-
- // Cleanup
- if(pbCompressed != NULL)
- FREEMEM(pbCompressed);
- if(pbReplaced != NULL)
- *pbReplaced = bReplaced;
- FreeMPQFile(hf);
- return nError;
-}
-
-int SetDataCompression(int nDataCompression)
-{
- nDataCmp = nDataCompression;
- return 0;
-}
-
-// This method saves MPQ header, hash table and block table.
-int SaveMPQTables(TMPQArchive * ha)
-{
- BYTE * pbBuffer = NULL;
- DWORD dwBytes;
- DWORD dwWritten;
- DWORD dwBuffSize = STORMLIB_MAX(ha->pHeader->dwHashTableSize, ha->pHeader->dwBlockTableSize);
- int nError = ERROR_SUCCESS;
-
- // Allocate buffer for encrypted tables
- if(nError == ERROR_SUCCESS)
- {
- // Allocate temporary buffer for tables encryption
- pbBuffer = ALLOCMEM(BYTE, sizeof(TMPQHash) * dwBuffSize);
- if(pbBuffer == NULL)
- nError = ERROR_NOT_ENOUGH_MEMORY;
- }
-
- // Write the MPQ Header
- if(nError == ERROR_SUCCESS)
- {
- DWORD dwHeaderSize = ha->pHeader->dwHeaderSize;
-
- // Write the MPQ header
- SetFilePointer(ha->hFile, ha->MpqPos.LowPart, &ha->MpqPos.HighPart, FILE_BEGIN);
-
- // Convert to little endian for file save
- BSWAP_TMPQHEADER(ha->pHeader);
- WriteFile(ha->hFile, ha->pHeader, dwHeaderSize, &dwWritten, NULL);
- BSWAP_TMPQHEADER(ha->pHeader);
-
- if(dwWritten != ha->pHeader->dwHeaderSize)
- nError = ERROR_DISK_FULL;
- }
-
- // Write the hash table
- if(nError == ERROR_SUCCESS)
- {
- // Copy the hash table to temporary buffer
- dwBytes = ha->pHeader->dwHashTableSize * sizeof(TMPQHash);
- memcpy(pbBuffer, ha->pHashTable, dwBytes);
-
- // Convert to little endian for file save
- EncryptHashTable((DWORD *)pbBuffer, (BYTE *)"(hash table)", dwBytes >> 2);
- BSWAP_ARRAY32_UNSIGNED((DWORD *)pbBuffer, dwBytes / sizeof(DWORD));
-
- // Set the file pointer to the offset of the hash table and write it
- SetFilePointer(ha->hFile, ha->HashTablePos.LowPart, (PLONG)&ha->HashTablePos.HighPart, FILE_BEGIN);
- WriteFile(ha->hFile, pbBuffer, dwBytes, &dwWritten, NULL);
- if(dwWritten != dwBytes)
- nError = ERROR_DISK_FULL;
- }
-
- // Write the block table
- if(nError == ERROR_SUCCESS)
- {
- // Copy the block table to temporary buffer
- dwBytes = ha->pHeader->dwBlockTableSize * sizeof(TMPQBlock);
- memcpy(pbBuffer, ha->pBlockTable, dwBytes);
-
- // Encrypt the block table and write it to the file
- EncryptBlockTable((DWORD *)pbBuffer, (BYTE *)"(block table)", dwBytes >> 2);
-
- // Convert to little endian for file save
- BSWAP_ARRAY32_UNSIGNED((DWORD *)pbBuffer, dwBytes / sizeof(DWORD));
- WriteFile(ha->hFile, pbBuffer, dwBytes, &dwWritten, NULL);
- if(dwWritten != dwBytes)
- nError = ERROR_DISK_FULL;
- }
-
- // Write the extended block table
- if(nError == ERROR_SUCCESS && ha->pHeader->ExtBlockTablePos.QuadPart != 0)
- {
- // We expect format V2 or newer in this case
- assert(ha->pHeader->wFormatVersion >= MPQ_FORMAT_VERSION_2);
-
- // Copy the block table to temporary buffer
- dwBytes = ha->pHeader->dwBlockTableSize * sizeof(TMPQBlockEx);
- memcpy(pbBuffer, ha->pExtBlockTable, dwBytes);
-
- // Convert to little endian for file save
- BSWAP_ARRAY16_UNSIGNED((USHORT *)pbBuffer, dwBytes / sizeof(USHORT));
- WriteFile(ha->hFile, pbBuffer, dwBytes, &dwWritten, NULL);
- if(dwWritten != dwBytes)
- nError = ERROR_DISK_FULL;
- }
-
- // Set end of file here
- if(nError == ERROR_SUCCESS)
- {
- SetEndOfFile(ha->hFile);
- }
-
- // Cleanup and exit
- if(pbBuffer != NULL)
- FREEMEM(pbBuffer);
- return nError;
-}
-
-// Frees the MPQ archive
-void FreeMPQArchive(TMPQArchive *& ha)
-{
- if(ha != NULL)
- {
- FREEMEM(ha->pbBlockBuffer);
- FREEMEM(ha->pBlockTable);
- FREEMEM(ha->pExtBlockTable);
- FREEMEM(ha->pHashTable);
- if(ha->pListFile != NULL)
- SListFileFreeListFile(ha);
- if(ha->pAttributes != NULL)
- FreeMPQAttributes(ha->pAttributes);
-
- if(ha->hFile != INVALID_HANDLE_VALUE)
- CloseHandle(ha->hFile);
- FREEMEM(ha);
- ha = NULL;
- }
-}
diff --git a/src/dep/src/StormLib/SCommon.h b/src/dep/src/StormLib/SCommon.h
deleted file mode 100644
index 56a18ba..0000000
--- a/src/dep/src/StormLib/SCommon.h
+++ /dev/null
@@ -1,105 +0,0 @@
-/*****************************************************************************/
-/* SCommon.h Copyright (c) Ladislav Zezula 2003 */
-/*---------------------------------------------------------------------------*/
-/* Common functions for encryption/decryption from Storm.dll. Included by */
-/* SFile*** functions, do not include and do not use this file directly */
-/*---------------------------------------------------------------------------*/
-/* Date Ver Who Comment */
-/* -------- ---- --- ------- */
-/* 24.03.03 1.00 Lad The first version of SFileCommon.h */
-/* 12.06.04 1.00 Lad Renamed to SCommon.h */
-/*****************************************************************************/
-
-#ifndef __SCOMMON_H__
-#define __SCOMMON_H__
-
-//-----------------------------------------------------------------------------
-// StormLib private defines
-
-#define SFILE_TYPE_DATA 0 // Process the file as data file
-#define SFILE_TYPE_WAVE 1 // Process the file as WAVe file
-
-#define LISTFILE_ENTRY_DELETED (DWORD_PTR)(-2)
-#define LISTFILE_ENTRY_FREE (DWORD_PTR)(-1)
-
-// Prevent problems with CRT "min" and "max" functions,
-// as they are not defined on all platforms
-#define STORMLIB_MIN(a, b) ((a < b) ? a : b)
-#define STORMLIB_MAX(a, b) ((a > b) ? a : b)
-
-//-----------------------------------------------------------------------------
-// External variables
-
-extern TMPQArchive * pFirstOpen;
-extern LCID lcLocale;
-
-//-----------------------------------------------------------------------------
-// Encryption and decryption functions
-
-int PrepareStormBuffer();
-
-void EncryptHashTable(DWORD * pdwTable, BYTE * pbKey, DWORD dwLength);
-void DecryptHashTable(DWORD * pdwTable, BYTE * pbKey, DWORD dwLength);
-TMPQHash * FindFreeHashEntry(TMPQArchive * ha, const char * szFileName);
-
-void EncryptBlockTable(DWORD * pdwTable, BYTE * pbKey, DWORD dwLength);
-void DecryptBlockTable(DWORD * pdwTable, BYTE * pbKey, DWORD dwLength);
-
-DWORD DetectFileSeed(DWORD * block, DWORD decrypted);
-DWORD DetectFileSeed2(DWORD * block, UINT nDwords, ...);
-void EncryptMPQBlock(DWORD * pdwBlock, DWORD dwLength, DWORD dwSeed1);
-void DecryptMPQBlock(DWORD * pdwBlock, DWORD dwLength, DWORD dwSeed1);
-
-DWORD DecryptHashIndex(TMPQArchive * ha, const char * szFileName);
-DWORD DecryptName1 (const char * szFileName);
-DWORD DecryptName2 (const char * szFileName);
-DWORD DecryptFileSeed (const char * szFileName);
-
-TMPQHash * GetHashEntry (TMPQArchive * ha, const char * szFileName);
-TMPQHash * GetHashEntryEx(TMPQArchive * ha, const char * szFileName, LCID lcLocale);
-
-//-----------------------------------------------------------------------------
-// Compression and decompression functions
-
-int Compress_pklib (char * pbOutBuffer, int * pdwOutLength, char * pbInBuffer, int dwInLength, int * pCmpType, int nCmpLevel);
-int Decompress_pklib(char * pbOutBuffer, int * pdwOutLength, char * pbInBuffer, int dwInLength);
-
-//-----------------------------------------------------------------------------
-// Checking functions
-
-BOOL IsValidMpqHandle(TMPQArchive * ha);
-BOOL IsValidFileHandle(TMPQFile * hf);
-
-//-----------------------------------------------------------------------------
-// Other functions
-
-BOOL SFileOpenArchiveEx(const char * szMpqName, DWORD dwPriority, DWORD dwFlags, HANDLE * phMPQ, DWORD dwAccessMode = GENERIC_READ);
-int AddInternalFile(TMPQArchive * ha, const char * szFileName);
-int AddFileToArchive(TMPQArchive * ha, HANDLE hFile, const char * szArchivedName, DWORD dwFlags, DWORD dwQuality, int nFileType, BOOL * pbReplaced);
-int SetDataCompression(int nDataCompression);
-int SaveMPQTables(TMPQArchive * ha);
-void FreeMPQArchive(TMPQArchive *& ha);
-void FreeMPQFile(TMPQFile *& hf);
-
-BOOL CheckWildCard(const char * szString, const char * szWildCard);
-
-//-----------------------------------------------------------------------------
-// Attributes support
-
-int SAttrFileCreate(TMPQArchive * ha);
-int SAttrFileLoad(TMPQArchive * ha);
-int SAttrFileSaveToMpq(TMPQArchive * ha);
-void FreeMPQAttributes(TMPQAttr * pAttr);
-
-//-----------------------------------------------------------------------------
-// Listfile functions
-
-int SListFileCreateListFile(TMPQArchive * ha);
-int SListFileCreateNode(TMPQArchive * ha, const char * szFileName, LCID lcLocale);
-int SListFileRemoveNode(TMPQArchive * ha, const char * szFileName, LCID lcLocale);
-void SListFileFreeListFile(TMPQArchive * ha);
-
-int SListFileSaveToMpq(TMPQArchive * ha);
-
-#endif // __SCOMMON_H__
-
diff --git a/src/dep/src/StormLib/SCompression.cpp b/src/dep/src/StormLib/SCompression.cpp
deleted file mode 100644
index ca1253f..0000000
--- a/src/dep/src/StormLib/SCompression.cpp
+++ /dev/null
@@ -1,724 +0,0 @@
-/*****************************************************************************/
-/* SCompression.cpp Copyright (c) Ladislav Zezula 2003 */
-/*---------------------------------------------------------------------------*/
-/* This module serves as a bridge between StormLib code and (de)compression */
-/* functions. All (de)compression calls go (and should only go) through this */
-/* module. No system headers should be included in this module to prevent */
-/* compile-time problems. */
-/*---------------------------------------------------------------------------*/
-/* Date Ver Who Comment */
-/* -------- ---- --- ------- */
-/* 01.04.03 1.00 Lad The first version of SCompression.cpp */
-/* 19.11.03 1.01 Dan Big endian handling */
-/*****************************************************************************/
-
-#define __STORMLIB_SELF__
-#include "StormLib.h"
-#include "SCommon.h"
-
-#include
-
-// Include functions from Pkware Data Compression Library
-#include "pklib/pklib.h"
-
-// Include functions from zlib
-#ifndef __SYS_ZLIB
-#include "zlib/zlib.h" // Include functions from zlib
-#else
-#include // If zlib is available on system, use this instead
-#endif
-
-// Include functions from Huffmann compression
-#include "huffman/huff.h"
-
-// Include functions from WAVe compression
-#include "wave/wave.h"
-
-// Include functions from BZip2 compression library
-#ifndef __SYS_BZLIB
-#include "bzip2/bzlib.h" // Include functions from bzlib
-#else
-#include // If bzlib is available on system, use this instead
-#endif
-
-//-----------------------------------------------------------------------------
-// Local structures
-
-// Information about the input and output buffers for pklib
-typedef struct
-{
- char * pInBuff; // Pointer to input data buffer
- int nInPos; // Current offset in input data buffer
- int nInBytes; // Number of bytes in the input buffer
- char * pOutBuff; // Pointer to output data buffer
- int nOutPos; // Position in the output buffer
- int nMaxOut; // Maximum number of bytes in the output buffer
-} TDataInfo;
-
-// Table of compression functions
-typedef int (*COMPRESS)(char *, int *, char *, int, int *, int);
-typedef struct
-{
- unsigned long dwMask; // Compression mask
- COMPRESS Compress; // Compression function
-} TCompressTable;
-
-// Table of decompression functions
-typedef int (*DECOMPRESS)(char *, int *, char *, int);
-typedef struct
-{
- unsigned long dwMask; // Decompression bit
- DECOMPRESS Decompress; // Decompression function
-} TDecompressTable;
-
-
-/*****************************************************************************/
-/* */
-/* Support functions for Pkware Data Compression Library */
-/* */
-/*****************************************************************************/
-
-// Function loads data from the input buffer. Used by Pklib's "implode"
-// and "explode" function as user-defined callback
-// Returns number of bytes loaded
-//
-// char * buf - Pointer to a buffer where to store loaded data
-// unsigned int * size - Max. number of bytes to read
-// void * param - Custom pointer, parameter of implode/explode
-
-static unsigned int ReadInputData(char * buf, unsigned int * size, void * param)
-{
- TDataInfo * pInfo = (TDataInfo *)param;
- unsigned int nMaxAvail = (pInfo->nInBytes - pInfo->nInPos);
- unsigned int nToRead = *size;
-
- // Check the case when not enough data available
- if(nToRead > nMaxAvail)
- nToRead = nMaxAvail;
-
- // Load data and increment offsets
- memcpy(buf, pInfo->pInBuff + pInfo->nInPos, nToRead);
- pInfo->nInPos += nToRead;
-
- return nToRead;
-}
-
-// Function for store output data. Used by Pklib's "implode" and "explode"
-// as user-defined callback
-//
-// char * buf - Pointer to data to be written
-// unsigned int * size - Number of bytes to write
-// void * param - Custom pointer, parameter of implode/explode
-
-static void WriteOutputData(char * buf, unsigned int * size, void * param)
-{
- TDataInfo * pInfo = (TDataInfo *)param;
- unsigned int nMaxWrite = (pInfo->nMaxOut - pInfo->nOutPos);
- unsigned int nToWrite = *size;
-
- // Check the case when not enough space in the output buffer
- if(nToWrite > nMaxWrite)
- nToWrite = nMaxWrite;
-
- // Write output data and increments offsets
- memcpy(pInfo->pOutBuff + pInfo->nOutPos, buf, nToWrite);
- pInfo->nOutPos += nToWrite;
-}
-
-/*****************************************************************************/
-/* */
-/* "80" is IMA ADPCM stereo (de)compression */
-/* "40" is IMA ADPCM mono (de)compression */
-/* */
-/*****************************************************************************/
-
-int Compress_wave_mono(char * pbOutBuffer, int * pdwOutLength, char * pbInBuffer, int dwInLength, int * pCmpType, int nCmpLevel)
-{
- // Prepare the compression level for the next compression
- // (After us, the Huffmann compression will be called)
- if(0 < nCmpLevel && nCmpLevel <= 2)
- {
- nCmpLevel = 4;
- *pCmpType = 6;
- }
- else if(nCmpLevel == 3)
- {
- nCmpLevel = 6;
- *pCmpType = 8;
- }
- else
- {
- nCmpLevel = 5;
- *pCmpType = 7;
- }
- *pdwOutLength = CompressWave((unsigned char *)pbOutBuffer, *pdwOutLength, (short *)pbInBuffer, dwInLength, 1, nCmpLevel);
- return 0;
-}
-
-int Decompress_wave_mono(char * pbOutBuffer, int * pdwOutLength, char * pbInBuffer, int dwInLength)
-{
- *pdwOutLength = DecompressWave((unsigned char *)pbOutBuffer, *pdwOutLength, (unsigned char *)pbInBuffer, dwInLength, 1);
- return 1;
-}
-
-int Compress_wave_stereo(char * pbOutBuffer, int * pdwOutLength, char * pbInBuffer, int dwInLength, int * pCmpType, int nCmpLevel)
-{
- // Prepare the compression type for the next compression
- // (After us, the Huffmann compression will be called)
- if(0 < nCmpLevel && nCmpLevel <= 2)
- {
- nCmpLevel = 4;
- *pCmpType = 6;
- }
- else if(nCmpLevel == 3)
- {
- nCmpLevel = 6;
- *pCmpType = 8;
- }
- else
- {
- nCmpLevel = 5;
- *pCmpType = 7;
- }
- *pdwOutLength = CompressWave((unsigned char *)pbOutBuffer, *pdwOutLength, (short *)pbInBuffer, dwInLength, 2, nCmpLevel);
- return 0;
-}
-
-int Decompress_wave_stereo(char * pbOutBuffer, int * pdwOutLength, char * pbInBuffer, int dwInLength)
-{
- *pdwOutLength = DecompressWave((unsigned char *)pbOutBuffer, *pdwOutLength, (unsigned char *)pbInBuffer, dwInLength, 2);
- return 1;
-}
-
-/*****************************************************************************/
-/* */
-/* The "01" (de)compression is the Huffman (de)compression */
-/* */
-/*****************************************************************************/
-
-// 1500F4C0
-int Compress_huff(char * pbOutBuffer, int * pdwOutLength, char * pbInBuffer, int dwInLength, int * pCmpType, int /* nCmpLevel */)
-{
- THuffmannTree ht; // Huffmann tree for compression
- TOutputStream os; // Output stream
-
- // Initialize output stream
- os.pbOutBuffer = (unsigned char *)pbOutBuffer;
- os.dwOutSize = *pdwOutLength;
- os.pbOutPos = (unsigned char *)pbOutBuffer;
- os.dwBitBuff = 0;
- os.nBits = 0;
-
- // Initialize the Huffmann tree for compression
- ht.InitTree(true);
-
- *pdwOutLength = ht.DoCompression(&os, (unsigned char *)pbInBuffer, dwInLength, *pCmpType);
-
- // The following code is not necessary to run, because it has no
- // effect on the output data. It only clears the huffmann tree, but when
- // the tree is on the stack, who cares ?
-// ht.UninitTree();
- return 0;
-}
-
-// 1500F5F0
-int Decompress_huff(char * pbOutBuffer, int * pdwOutLength, char * pbInBuffer, int /* dwInLength */)
-{
- THuffmannTree ht;
- TInputStream is;
-
- // Initialize input stream
- is.pbInBuffer = (unsigned char *)pbInBuffer;
- is.BitBuffer = 0;
- is.BitCount = 0;
-
- // Initialize the Huffmann tree for compression
- ht.InitTree(false);
- *pdwOutLength = ht.DoDecompression((unsigned char *)pbOutBuffer, *pdwOutLength, &is);
-
- // The following code is not necessary to run, because it has no
- // effect on the output data. It only clears the huffmann tree, but when
- // the tree is on the stack, who cares ?
-// ht.UninitTree();
- return 0;
-}
-
-/*****************************************************************************/
-/* */
-/* The "02" (de)compression is the ZLIB (de)compression */
-/* */
-/*****************************************************************************/
-
-int Compress_zlib(char * pbOutBuffer, int * pdwOutLength, char * pbInBuffer, int dwInLength, int * /* pCmpType */, int /* nCmpLevel */)
-{
- z_stream z; // Stream information for zlib
- int nResult;
-
- // Fill the stream structure for zlib
- z.next_in = (Bytef *)pbInBuffer;
- z.avail_in = (uInt)dwInLength;
- z.total_in = dwInLength;
- z.next_out = (Bytef *)pbOutBuffer;
- z.avail_out = *pdwOutLength;
- z.total_out = 0;
- z.zalloc = NULL;
- z.zfree = NULL;
-
- // Initialize the compression structure. Storm.dll uses zlib version 1.1.3
- *pdwOutLength = 0;
- if((nResult = deflateInit(&z, Z_DEFAULT_COMPRESSION)) == 0)
- {
- // Call zlib to compress the data
- nResult = deflate(&z, Z_FINISH);
-
- if(nResult == Z_OK || nResult == Z_STREAM_END)
- *pdwOutLength = z.total_out;
-
- deflateEnd(&z);
- }
- return nResult;
-}
-
-int Decompress_zlib(char * pbOutBuffer, int * pdwOutLength, char * pbInBuffer, int dwInLength)
-{
- z_stream z; // Stream information for zlib
- int nResult;
-
- // Fill the stream structure for zlib
- z.next_in = (Bytef *)pbInBuffer;
- z.avail_in = (uInt)dwInLength;
- z.total_in = dwInLength;
- z.next_out = (Bytef *)pbOutBuffer;
- z.avail_out = *pdwOutLength;
- z.total_out = 0;
- z.zalloc = NULL;
- z.zfree = NULL;
-
- // Initialize the decompression structure. Storm.dll uses zlib version 1.1.3
- if((nResult = inflateInit(&z)) == 0)
- {
- // Call zlib to decompress the data
- nResult = inflate(&z, Z_FINISH);
- *pdwOutLength = z.total_out;
- inflateEnd(&z);
- }
- return nResult;
-}
-
-/*****************************************************************************/
-/* */
-/* The "08" (de)compression is the Pkware DCL (de)compression */
-/* */
-/*****************************************************************************/
-
-int Compress_pklib(char * pbOutBuffer, int * pdwOutLength, char * pbInBuffer, int dwInLength, int * pCmpType, int /* nCmpLevel */)
-{
- TDataInfo Info; // Data information
- char * work_buf = ALLOCMEM(char, CMP_BUFFER_SIZE);// Pklib's work buffer
- unsigned int dict_size; // Dictionary size
- unsigned int ctype; // Compression type
-
- // Fill data information structure
- Info.pInBuff = pbInBuffer;
- Info.nInPos = 0;
- Info.nInBytes = dwInLength;
- Info.pOutBuff = pbOutBuffer;
- Info.nOutPos = 0;
- Info.nMaxOut = *pdwOutLength;
-
- // Set the compression type and dictionary size
- ctype = (*pCmpType == 2) ? CMP_ASCII : CMP_BINARY;
- if (dwInLength < 0x600)
- dict_size = 0x400;
- else if(0x600 <= dwInLength && dwInLength < 0xC00)
- dict_size = 0x800;
- else
- dict_size = 0x1000;
-
- // Do the compression
- implode(ReadInputData, WriteOutputData, work_buf, &Info, &ctype, &dict_size);
- *pdwOutLength = Info.nOutPos;
- FREEMEM(work_buf);
- return 0;
-}
-
-int Decompress_pklib(char * pbOutBuffer, int * pdwOutLength, char * pbInBuffer, int dwInLength)
-{
- TDataInfo Info; // Data information
- char * work_buf = ALLOCMEM(char, EXP_BUFFER_SIZE);// Pklib's work buffer
-
- // Fill data information structure
- Info.pInBuff = pbInBuffer;
- Info.nInPos = 0;
- Info.nInBytes = dwInLength;
- Info.pOutBuff = pbOutBuffer;
- Info.nOutPos = 0;
- Info.nMaxOut = *pdwOutLength;
-
- // Do the decompression
- explode(ReadInputData, WriteOutputData, work_buf, &Info);
-
- // Fix: If PKLIB is unable to decompress the data, they are uncompressed
- if(Info.nOutPos == 0)
- {
- Info.nOutPos = STORMLIB_MIN(*pdwOutLength, dwInLength);
- memcpy(pbOutBuffer, pbInBuffer, Info.nOutPos);
- }
-
- *pdwOutLength = Info.nOutPos;
- FREEMEM(work_buf);
- return 0;
-}
-
-/*****************************************************************************/
-/* */
-/* The "10" (de)compression is the Bzip2 (de)compression */
-/* */
-/*****************************************************************************/
-
-int Compress_bzip2(char * pbOutBuffer, int * pdwOutLength, char * pbInBuffer, int dwInLength, int * pCmpType, int nCmpLevel)
-{
- bz_stream strm;
- int blockSize100k;
- int workFactor = 30;
-
- // Keep compiler happy
- nCmpLevel = nCmpLevel;
-
- // Initialize the BZLIB compression
- strm.bzalloc = NULL;
- strm.bzfree = NULL;
-
- // Adjust the block size
- blockSize100k = *pCmpType;
- if(blockSize100k < 1 || blockSize100k > 9)
- blockSize100k = 9;
-
- // Blizzard uses 9 as blockSize100k, (0 as workFactor)
- if(BZ2_bzCompressInit(&strm, blockSize100k, 0, workFactor) == 0)
- {
- strm.next_in = pbInBuffer;
- strm.avail_in = dwInLength;
- strm.next_out = pbOutBuffer;
- strm.avail_out = *pdwOutLength;
-
- // Perform the compression
- while(BZ2_bzCompress(&strm, (strm.avail_in != 0) ? BZ_RUN : BZ_FINISH) != BZ_STREAM_END);
-
- // Put the stream into idle state
- BZ2_bzCompressEnd(&strm);
- *pdwOutLength = strm.total_out_lo32;
- }
- else
- {
- *pdwOutLength = 0;
- }
-
- return 0;
-}
-
-int Decompress_bzip2(char * pbOutBuffer, int * pdwOutLength, char * pbInBuffer, int dwInLength)
-{
- bz_stream strm;
- int nResult = BZ_OK;
-
- // Initialize the BZLIB decompression
- strm.bzalloc = NULL;
- strm.bzfree = NULL;
- if(BZ2_bzDecompressInit(&strm, 0, 0) == BZ_OK)
- {
- strm.next_in = pbInBuffer;
- strm.avail_in = dwInLength;
- strm.next_out = pbOutBuffer;
- strm.avail_out = *pdwOutLength;
-
- // Perform the decompression
- while(nResult != BZ_STREAM_END)
- {
- nResult = BZ2_bzDecompress(&strm);
-
- // If any error there, break the loop
- if(nResult < BZ_OK)
- break;
- }
-
- // Put the stream into idle state
- BZ2_bzDecompressEnd(&strm);
-
- // If all succeeded, set the number of output bytes
- if(nResult >= BZ_OK)
- {
- *pdwOutLength = strm.total_out_lo32;
- return 1;
- }
- }
-
- // Something failed, so set number of output bytes to zero
- *pdwOutLength = 0;
- return 0;
-}
-
-/*****************************************************************************/
-/* */
-/* SCompCompress */
-/* */
-/*****************************************************************************/
-
-// This table contains compress functions which can be applied to
-// uncompressed blocks. Each bit set means the corresponding
-// compression method/function must be applied.
-//
-// WAVes compression Data compression
-// ------------------ -------------------
-// 1st block - 0x08 0x08 (D, HF, W2, SC, D2)
-// Rest blocks - 0x81 0x02 (W3)
-
-static TCompressTable cmp_table[] =
-{
- {MPQ_COMPRESSION_WAVE_MONO, Compress_wave_mono}, // IMA ADPCM mono compression
- {MPQ_COMPRESSION_WAVE_STEREO, Compress_wave_stereo}, // IMA ADPCM stereo compression
- {MPQ_COMPRESSION_HUFFMANN, Compress_huff}, // Huffmann compression
- {MPQ_COMPRESSION_ZLIB, Compress_zlib}, // Compression with the "zlib" library
- {MPQ_COMPRESSION_PKWARE, Compress_pklib}, // Compression with Pkware DCL
- {MPQ_COMPRESSION_BZIP2, Compress_bzip2} // Compression Bzip2 library
-};
-
-int WINAPI SCompCompress(char * pbCompressed, int * pdwOutLength, char * pbUncompressed, int dwInLength,
- int uCompressions, int nCmpType, int nCmpLevel)
-{
- char * pbTempBuff = NULL; // Temporary storage for decompressed data
- char * pbOutput = pbCompressed; // Current output buffer
- char * pbInput; // Current input buffer
- int uCompressions2;
- int dwCompressCount = 0;
- int dwDoneCount = 0;
- int dwOutSize = 0;
- int dwInSize = dwInLength;
- int dwEntries = (sizeof(cmp_table) / sizeof(TCompressTable));
- int nResult = 1;
- int i;
-
- // Check for valid parameters
- if(!pdwOutLength || *pdwOutLength < dwInLength || !pbCompressed || !pbUncompressed)
- {
- SetLastError(ERROR_INVALID_PARAMETER);
- return 0;
- }
-
- // Count the compressions
- for(i = 0, uCompressions2 = uCompressions; i < dwEntries; i++)
- {
- if(uCompressions & cmp_table[i].dwMask)
- dwCompressCount++;
-
- uCompressions2 &= ~cmp_table[i].dwMask;
- }
-
- // If a compression remains, do nothing
- if(uCompressions2 != 0)
- {
- SetLastError(ERROR_INVALID_PARAMETER);
- return 0;
- }
-
- // If more that one compression, allocate intermediate buffer
- if(dwCompressCount >= 2)
- pbTempBuff = ALLOCMEM(char, *pdwOutLength + 1);
-
- // Perform the compressions
- pbInput = pbUncompressed;
- dwInSize = dwInLength;
- for(i = 0, uCompressions2 = uCompressions; i < dwEntries; i++)
- {
- if(uCompressions2 & cmp_table[i].dwMask)
- {
- // Set the right output buffer
- dwCompressCount--;
- pbOutput = (dwCompressCount & 1) ? pbTempBuff : pbCompressed;
-
- // Perform the partial compression
- dwOutSize = *pdwOutLength - 1;
-
- cmp_table[i].Compress(pbOutput + 1, &dwOutSize, pbInput, dwInSize, &nCmpType, nCmpLevel);
- if(dwOutSize == 0)
- {
- SetLastError(ERROR_GEN_FAILURE);
- *pdwOutLength = 0;
- nResult = 0;
- break;
- }
-
- // If the compression failed, copy the block instead
- if(dwOutSize >= dwInSize - 1)
- {
- if(dwDoneCount > 0)
- pbOutput++;
-
- memcpy(pbOutput, pbInput, dwInSize);
- pbInput = pbOutput;
- uCompressions &= ~cmp_table[i].dwMask;
- dwOutSize = dwInSize;
- }
- else
- {
- pbInput = pbOutput + 1;
- dwInSize = dwOutSize;
- dwDoneCount++;
- }
- }
- }
-
- // Copy the compressed data to the correct output buffer
- if(nResult != 0)
- {
- if(uCompressions && (dwInSize + 1) < *pdwOutLength)
- {
- if(pbOutput != pbCompressed && pbOutput != pbCompressed + 1)
- memcpy(pbCompressed, pbOutput, dwInSize);
- *pbCompressed = (char)uCompressions;
- *pdwOutLength = dwInSize + 1;
- }
- else
- {
- memmove(pbCompressed, pbUncompressed, dwInSize);
- *pdwOutLength = dwInSize;
- }
- }
-
- // Cleanup and return
- if(pbTempBuff != NULL)
- FREEMEM(pbTempBuff);
- return nResult;
-}
-
-/*****************************************************************************/
-/* */
-/* SCompDecompress */
-/* */
-/*****************************************************************************/
-
-// This table contains decompress functions which can be applied to
-// uncompressed blocks. The compression mask is stored in the first byte
-// of compressed block
-static TDecompressTable dcmp_table[] =
-{
- {MPQ_COMPRESSION_BZIP2, Decompress_bzip2}, // Decompression with Bzip2 library
- {MPQ_COMPRESSION_PKWARE, Decompress_pklib}, // Decompression with Pkware Data Compression Library
- {MPQ_COMPRESSION_ZLIB, Decompress_zlib}, // Decompression with the "zlib" library
- {MPQ_COMPRESSION_HUFFMANN, Decompress_huff}, // Huffmann decompression
- {MPQ_COMPRESSION_WAVE_STEREO, Decompress_wave_stereo}, // IMA ADPCM stereo decompression
- {MPQ_COMPRESSION_WAVE_MONO, Decompress_wave_mono} // IMA ADPCM mono decompression
-};
-
-int WINAPI SCompDecompress(char * pbOutBuffer, int * pdwOutLength, char * pbInBuffer, int dwInLength)
-{
- char * pbTempBuff = NULL; // Temporary storage for decompressed data
- char * pbWorkBuff = NULL; // Where to store decompressed data
- int dwOutLength = *pdwOutLength; // For storage number of output bytes
- unsigned fDecompressions1; // Decompressions applied to the block
- unsigned fDecompressions2; // Just another copy of decompressions applied to the block
- int dwCount = 0; // Counter for every use
- int dwEntries = (sizeof(dcmp_table) / sizeof(TDecompressTable));
- int nResult = 1;
- int i;
-
- // If the input length is the same as output, do nothing.
- if(dwInLength == dwOutLength)
- {
- if(pbInBuffer == pbOutBuffer)
- return 1;
-
- memcpy(pbOutBuffer, pbInBuffer, dwInLength);
- *pdwOutLength = dwInLength;
- return 1;
- }
-
- // Get applied compression types and decrement data length
- fDecompressions1 = fDecompressions2 = (unsigned char)*pbInBuffer++;
- dwInLength--;
-
- // Search decompression table type and get all types of compression
- for(i = 0; i < dwEntries; i++)
- {
- // We have to apply this decompression ?
- if(fDecompressions1 & dcmp_table[i].dwMask)
- dwCount++;
-
- // Clear this flag from temporary variable.
- fDecompressions2 &= ~dcmp_table[i].dwMask;
- }
-
- // Check if there is some method unhandled
- // (E.g. compressed by future versions)
- if(fDecompressions2 != 0)
- {
- SetLastError(ERROR_INVALID_PARAMETER);
- return 0;
- }
-
- // If there is more than only one compression, we have to allocate extra buffer
- if(dwCount >= 2)
- pbTempBuff = ALLOCMEM(char, dwOutLength);
-
- // Apply all decompressions
- for(i = 0, dwCount = 0; i < dwEntries; i++)
- {
- // If not used this kind of compression, skip the loop
- if(fDecompressions1 & dcmp_table[i].dwMask)
- {
- // If odd case, use target buffer for output, otherwise use allocated tempbuffer
- pbWorkBuff = (dwCount++ & 1) ? pbTempBuff : pbOutBuffer;
- dwOutLength = *pdwOutLength;
-
- // Decompress buffer using corresponding function
- dcmp_table[i].Decompress(pbWorkBuff, &dwOutLength, pbInBuffer, dwInLength);
- if(dwOutLength == 0)
- {
- SetLastError(ERROR_GEN_FAILURE);
- nResult = 0;
- break;
- }
-
- // Move output length to src length for next compression
- dwInLength = dwOutLength;
- pbInBuffer = pbWorkBuff;
- }
- }
-
- // If output buffer is not the same like target buffer, we have to copy data
- if(nResult != 0)
- {
- if(pbWorkBuff != pbOutBuffer)
- memcpy(pbOutBuffer, pbInBuffer, dwOutLength);
-
- }
-
- // Delete temporary buffer, if necessary
- if(pbTempBuff != NULL)
- FREEMEM(pbTempBuff);
-
- *pdwOutLength = dwOutLength;
- return nResult;
-}
-
-/*****************************************************************************/
-/* */
-/* SCompSetDataCompression */
-/* */
-/*****************************************************************************/
-
-int WINAPI SCompSetDataCompression(int nDataCompression)
-{
- int nValidMask = (MPQ_COMPRESSION_ZLIB | MPQ_COMPRESSION_PKWARE | MPQ_COMPRESSION_BZIP2);
-
- if((nDataCompression & nValidMask) != nDataCompression)
- {
- SetLastError(ERROR_INVALID_PARAMETER);
- return FALSE;
- }
-
- SetDataCompression(nDataCompression);
- return TRUE;
-}
-
-
diff --git a/src/dep/src/StormLib/SFileCompactArchive.cpp b/src/dep/src/StormLib/SFileCompactArchive.cpp
deleted file mode 100644
index 7589ff8..0000000
--- a/src/dep/src/StormLib/SFileCompactArchive.cpp
+++ /dev/null
@@ -1,686 +0,0 @@
-/*****************************************************************************/
-/* SFileCompactArchive.cpp Copyright (c) Ladislav Zezula 2003 */
-/*---------------------------------------------------------------------------*/
-/* Archive compacting function */
-/*---------------------------------------------------------------------------*/
-/* Date Ver Who Comment */
-/* -------- ---- --- ------- */
-/* 14.04.03 1.00 Lad Splitted from SFileCreateArchiveEx.cpp */
-/* 19.11.03 1.01 Dan Big endian handling */
-/*****************************************************************************/
-
-#define __STORMLIB_SELF__
-#include "StormLib.h"
-#include "SCommon.h"
-
-/*****************************************************************************/
-/* Local structures */
-/*****************************************************************************/
-
-/*****************************************************************************/
-/* Local variables */
-/*****************************************************************************/
-
-static COMPACTCB CompactCB = NULL;
-static void * lpUserData = NULL;
-
-/*****************************************************************************/
-/* Local functions */
-/*****************************************************************************/
-
-// Creates a copy of hash table
-static TMPQHash * CopyHashTable(TMPQArchive * ha)
-{
- TMPQHash * pHashTableCopy = ALLOCMEM(TMPQHash, ha->pHeader->dwHashTableSize);
-
- if(pHashTableCopy != NULL)
- memcpy(pHashTableCopy, ha->pHashTable, sizeof(TMPQHash) * ha->pHeader->dwHashTableSize);
-
- return pHashTableCopy;
-}
-
-static int CheckIfAllFilesKnown(TMPQArchive * ha, const char * szListFile, DWORD * pFileSeeds)
-{
- TMPQHash * pHashTableCopy = NULL; // Copy of the hash table
- TMPQHash * pHash;
- TMPQHash * pHashEnd = NULL; // End of the hash table
- DWORD dwFileCount = 0;
- int nError = ERROR_SUCCESS;
-
- // First of all, create a copy of hash table
- if(nError == ERROR_SUCCESS)
- {
- if((pHashTableCopy = CopyHashTable(ha)) == NULL)
- nError = ERROR_NOT_ENOUGH_MEMORY;
- pHashEnd = pHashTableCopy + ha->pHeader->dwHashTableSize;
-
- // Notify the user
- if(CompactCB != NULL)
- CompactCB(lpUserData, CCB_CHECKING_FILES, 0, ha->pHeader->dwBlockTableSize);
- }
-
- // Now check all the files from the filelist
- if(nError == ERROR_SUCCESS)
- {
- SFILE_FIND_DATA wf;
- HANDLE hFind = SFileFindFirstFile((HANDLE)ha, "*", &wf, szListFile);
- BOOL bResult = TRUE;
-
- // Do while some files have been found
- while(hFind != NULL && bResult)
- {
- TMPQHash * pHash = GetHashEntry(ha, wf.cFileName);
-
- // If the hash table entry has been found, find it's position
- // in the hash table copy
- if(pHash != NULL)
- {
- pHash = pHashTableCopy + (pHash - ha->pHashTable);
- if(pHash->dwName1 != (DWORD)-1 && pHash->dwName2 != (DWORD)-1)
- {
- TMPQBlock * pBlock = ha->pBlockTable + pHash->dwBlockIndex;
- DWORD dwSeed = 0;
-
- // Resolve the file seed. Use plain file name for it
- if(pBlock->dwFlags & MPQ_FILE_ENCRYPTED)
- {
- char * szFileName = strrchr(wf.cFileName, '\\');
-
- if(szFileName == NULL)
- szFileName = wf.cFileName;
- else
- szFileName++;
-
- dwSeed = DecryptFileSeed(szFileName);
- if(pBlock->dwFlags & MPQ_FILE_FIXSEED)
- dwSeed = (dwSeed + pBlock->dwFilePos) ^ pBlock->dwFSize;
- }
- pFileSeeds[pHash->dwBlockIndex] = dwSeed;
-
- pHash->dwName1 = 0xFFFFFFFF;
- pHash->dwName2 = 0xFFFFFFFF;
- pHash->lcLocale = 0xFFFF;
- pHash->wPlatform = 0xFFFF;
- pHash->dwBlockIndex = 0xFFFFFFFF;
- }
- }
- // Notify the user
- if(CompactCB != NULL)
- CompactCB(lpUserData, CCB_CHECKING_FILES, ++dwFileCount, ha->pHeader->dwBlockTableSize);
-
- // Find the next file in the archive
- bResult = SFileFindNextFile(hFind, &wf);
- }
-
- if(hFind != NULL)
- SFileFindClose(hFind);
- }
-
- // When the filelist checking is complete, parse the hash table copy and find the
- if(nError == ERROR_SUCCESS)
- {
- // Notify the user about checking hash table
- dwFileCount = 0;
- if(CompactCB != NULL)
- CompactCB(lpUserData, CCB_CHECKING_HASH_TABLE, dwFileCount, ha->pHeader->dwBlockTableSize);
-
- for(pHash = pHashTableCopy; pHash < pHashEnd; pHash++)
- {
- // If there is an unresolved entry, try to detect its seed. If it fails,
- // we cannot complete the work
- if(pHash->dwBlockIndex < ha->pHeader->dwBlockTableSize)
- {
- HANDLE hFile = NULL;
- DWORD dwFlags = 0;
- DWORD dwSeed = 0;
-
- if(SFileOpenFileEx((HANDLE)ha, (char *)(DWORD_PTR)pHash->dwBlockIndex, SFILE_OPEN_BY_INDEX, &hFile))
- {
- TMPQFile * hf = (TMPQFile *)hFile;
- dwFlags = hf->pBlock->dwFlags;
- dwSeed = hf->dwSeed1;
- SFileCloseFile(hFile);
- }
-
- // If the file is encrypted, we have to check
- // If we can apply the file decryption seed
- if(dwFlags & MPQ_FILE_ENCRYPTED && dwSeed == 0)
- {
- nError = ERROR_CAN_NOT_COMPLETE;
- break;
- }
-
- // Remember the seed
- pFileSeeds[pHash->dwBlockIndex] = dwSeed;
-
- // Notify the user
- if(CompactCB != NULL)
- CompactCB(lpUserData, CCB_CHECKING_HASH_TABLE, ++dwFileCount, ha->pHeader->dwBlockTableSize);
- }
- }
- }
-
- // Delete the copy of hash table
- if(pHashTableCopy != NULL)
- FREEMEM(pHashTableCopy);
- return nError;
-}
-
-// Copies all file blocks into another archive.
-static int CopyMpqFileBlocks(
- HANDLE hFile,
- TMPQArchive * ha,
- TMPQBlockEx * pBlockEx,
- TMPQBlock * pBlock,
- DWORD dwSeed)
-{
- LARGE_INTEGER FilePos = {0};
- DWORD * pdwBlockPos2 = NULL; // File block positions to be written to target file
- DWORD * pdwBlockPos = NULL; // File block positions (unencrypted)
- BYTE * pbBlock = NULL; // Buffer for the file block
- DWORD dwTransferred; // Number of bytes transferred
- DWORD dwCSize = 0; // Compressed file size
- DWORD dwBytes = 0; // Number of bytes
- DWORD dwSeed1 = 0; // File seed used for decryption
- DWORD dwSeed2 = 0; // File seed used for encryption
- DWORD nBlocks = 0; // Number of file blocks
- DWORD nBlock = 0; // Currently processed file block
- int nError = ERROR_SUCCESS;
-
- // When file length is zero, do nothing
- if(pBlock->dwFSize == 0)
- return ERROR_SUCCESS;
-
- // Calculate number of blocks in the file
- if(nError == ERROR_SUCCESS)
- {
- nBlocks = pBlock->dwFSize / ha->dwBlockSize;
- if(pBlock->dwFSize % ha->dwBlockSize)
- nBlocks++;
- pbBlock = ALLOCMEM(BYTE, ha->dwBlockSize);
- if(pbBlock == NULL)
- nError = ERROR_NOT_ENOUGH_MEMORY;
- }
-
- // Set the position to the begin of the file within archive
- if(nError == ERROR_SUCCESS)
- {
- FilePos.HighPart = pBlockEx->wFilePosHigh;
- FilePos.LowPart = pBlock->dwFilePos;
- FilePos.QuadPart += ha->MpqPos.QuadPart;
- if(SetFilePointer(ha->hFile, FilePos.LowPart, &FilePos.HighPart, FILE_BEGIN) != FilePos.LowPart)
- nError = GetLastError();
- }
-
- // Remember the position in the destination file
- if(nError == ERROR_SUCCESS)
- {
- FilePos.HighPart = 0;
- FilePos.LowPart = SetFilePointer(hFile, 0, &FilePos.HighPart, FILE_CURRENT);
- }
-
- // Resolve decryption seeds. The 'dwSeed' parameter is the decryption
- // seed for the file.
- if(nError == ERROR_SUCCESS && (pBlock->dwFlags & MPQ_FILE_ENCRYPTED))
- {
- dwSeed1 = dwSeed;
- if(pBlock->dwFlags & MPQ_FILE_FIXSEED)
- dwSeed = (dwSeed1 ^ pBlock->dwFSize) - pBlock->dwFilePos;
-
- dwSeed2 = dwSeed;
- if(pBlock->dwFlags & MPQ_FILE_FIXSEED)
- dwSeed2 = (dwSeed + (DWORD)(FilePos.QuadPart - ha->MpqPos.QuadPart)) ^ pBlock->dwFSize;
- }
-
- // Load the file positions from the archive and save it to the target file
- // (only if the file is compressed)
- if(pBlock->dwFlags & MPQ_FILE_COMPRESSED)
- {
- // Allocate buffers
- if(nError == ERROR_SUCCESS)
- {
- pdwBlockPos = ALLOCMEM(DWORD, nBlocks + 2);
- pdwBlockPos2 = ALLOCMEM(DWORD, nBlocks + 2);
-
- if(pdwBlockPos == NULL || pdwBlockPos2 == NULL)
- nError = ERROR_NOT_ENOUGH_MEMORY;
- }
-
- // Load the block positions
- if(nError == ERROR_SUCCESS)
- {
- dwBytes = (nBlocks + 1) * sizeof(DWORD);
- if(pBlock->dwFlags & MPQ_FILE_HAS_EXTRA)
- dwBytes += sizeof(DWORD);
-
- ReadFile(ha->hFile, pdwBlockPos, dwBytes, &dwTransferred, NULL);
- if(dwTransferred != dwBytes)
- nError = ERROR_FILE_CORRUPT;
- }
-
- // Re-encrypt the block table positions
- if(nError == ERROR_SUCCESS)
- {
- BSWAP_ARRAY32_UNSIGNED(pdwBlockPos, dwBytes / sizeof(DWORD));
- if(pBlock->dwFlags & MPQ_FILE_ENCRYPTED)
- {
- DecryptMPQBlock(pdwBlockPos, dwBytes, dwSeed1 - 1);
- if(pdwBlockPos[0] != dwBytes)
- nError = ERROR_FILE_CORRUPT;
-
- memcpy(pdwBlockPos2, pdwBlockPos, dwBytes);
- EncryptMPQBlock(pdwBlockPos2, dwBytes, dwSeed2 - 1);
- }
- else
- {
- memcpy(pdwBlockPos2, pdwBlockPos, dwBytes);
- }
- BSWAP_ARRAY32_UNSIGNED(pdwBlockPos2, dwBytes / sizeof(DWORD));
- }
-
- // Write to the target file
- if(nError == ERROR_SUCCESS)
- {
- WriteFile(hFile, pdwBlockPos2, dwBytes, &dwTransferred, NULL);
- dwCSize += dwTransferred;
- if(dwTransferred != dwBytes)
- nError = ERROR_DISK_FULL;
- }
- }
-
- // Now we have to copy all file blocks. We will do it without
- // recompression, because re-compression is not necessary in this case
- if(nError == ERROR_SUCCESS)
- {
- for(nBlock = 0; nBlock < nBlocks; nBlock++)
- {
- // Fix: The last block must not be exactly the size of one block.
- dwBytes = ha->dwBlockSize;
- if(nBlock == nBlocks - 1)
- {
- dwBytes = pBlock->dwFSize - (ha->dwBlockSize * (nBlocks - 1));
- }
-
- if(pBlock->dwFlags & MPQ_FILE_COMPRESSED)
- dwBytes = pdwBlockPos[nBlock+1] - pdwBlockPos[nBlock];
-
- // Read the file block
- ReadFile(ha->hFile, pbBlock, dwBytes, &dwTransferred, NULL);
- if(dwTransferred != dwBytes)
- {
- nError = ERROR_FILE_CORRUPT;
- break;
- }
-
- // If necessary, re-encrypt the block
- // Note: Recompression is not necessary here. Unlike encryption,
- // the compression does not depend on the position of the file in MPQ.
- if((pBlock->dwFlags & MPQ_FILE_ENCRYPTED) && dwSeed1 != dwSeed2)
- {
- BSWAP_ARRAY32_UNSIGNED((DWORD *)pbBlock, dwBytes/sizeof(DWORD));
- DecryptMPQBlock((DWORD *)pbBlock, dwBytes, dwSeed1 + nBlock);
- EncryptMPQBlock((DWORD *)pbBlock, dwBytes, dwSeed2 + nBlock);
- BSWAP_ARRAY32_UNSIGNED((DWORD *)pbBlock, dwBytes/sizeof(DWORD));
- }
-
- // Now write the block back to the file
- WriteFile(hFile, pbBlock, dwBytes, &dwTransferred, NULL);
- dwCSize += dwTransferred;
- if(dwTransferred != dwBytes)
- {
- nError = ERROR_DISK_FULL;
- break;
- }
- }
- }
-
- // Copy the file extras, if any
- // These extras does not seem to be encrypted, and their purpose is unknown
- if(nError == ERROR_SUCCESS && (pBlock->dwFlags & MPQ_FILE_HAS_EXTRA))
- {
- dwBytes = pdwBlockPos[nBlocks + 1] - pdwBlockPos[nBlocks];
- if(dwBytes != 0)
- {
- ReadFile(ha->hFile, pbBlock, dwBytes, &dwTransferred, NULL);
- if(dwTransferred == dwBytes)
- {
- WriteFile(hFile, pbBlock, dwBytes, &dwTransferred, NULL);
- dwCSize += dwTransferred;
- if(dwTransferred != dwBytes)
- nError = ERROR_DISK_FULL;
- }
- else
- {
- nError = ERROR_FILE_CORRUPT;
- }
- }
- }
-
- // Update file position in the block table
- if(nError == ERROR_SUCCESS)
- {
- // At this point, number of bytes written should be exactly
- // the same like the compressed file size. If it isn't, there's something wrong
- // (maybe new archive version ?)
- assert(dwCSize == pBlock->dwCSize);
-
- // Update file pos in the block table
- FilePos.QuadPart -= ha->MpqPos.QuadPart;
- pBlockEx->wFilePosHigh = (USHORT)FilePos.HighPart;
- pBlock->dwFilePos = FilePos.LowPart;
- }
-
- // Cleanup and return
- if(pdwBlockPos2 != NULL)
- FREEMEM(pdwBlockPos2);
- if(pdwBlockPos != NULL)
- FREEMEM(pdwBlockPos);
- if(pbBlock != NULL)
- FREEMEM(pbBlock);
- return nError;
-}
-
-
-static int CopyNonMpqData(
- HANDLE hSrcFile,
- HANDLE hTrgFile,
- LARGE_INTEGER & DataSizeToCopy)
-{
- LARGE_INTEGER DataSize = DataSizeToCopy;
- DWORD dwTransferred;
- DWORD dwToRead;
- char DataBuffer[0x1000];
- int nError = ERROR_SUCCESS;
-
- while(DataSize.QuadPart > 0)
- {
- // Get the proper size of data
- dwToRead = sizeof(DataBuffer);
- if(DataSize.HighPart == 0 && DataSize.LowPart < dwToRead)
- dwToRead = DataSize.LowPart;
-
- // Read the source file
- ReadFile(hSrcFile, DataBuffer, dwToRead, &dwTransferred, NULL);
- if(dwTransferred != dwToRead)
- {
- nError = ERROR_CAN_NOT_COMPLETE;
- break;
- }
-
- // Write to the target file
- WriteFile(hTrgFile, DataBuffer, dwToRead, &dwTransferred, NULL);
- if(dwTransferred != dwToRead)
- {
- nError = ERROR_DISK_FULL;
- break;
- }
-
- // Decrement the number of data to be copied
- DataSize.QuadPart -= dwTransferred;
- }
-
- return ERROR_SUCCESS;
-}
-
-static int CopyMpqFiles(HANDLE hFile, TMPQArchive * ha, DWORD * pFileSeeds)
-{
- TMPQBlockEx * pBlockEx;
- TMPQBlock * pBlock;
- DWORD dwSeed1;
- DWORD dwIndex;
- int nError = ERROR_SUCCESS;
-
- // Walk through all files and write them to the destination MPQ archive
- for(dwIndex = 0; dwIndex < ha->pHeader->dwBlockTableSize; dwIndex++)
- {
- pBlockEx = ha->pExtBlockTable + dwIndex;
- pBlock = ha->pBlockTable + dwIndex;
- dwSeed1 = pFileSeeds[dwIndex];
-
- // Notify the caller about work
- if(CompactCB != NULL)
- CompactCB(lpUserData, CCB_COMPACTING_FILES, dwIndex, ha->pHeader->dwBlockTableSize);
-
- // Copy all the file blocks
- // Debug: Break at (dwIndex == 5973)
- if(pBlock->dwFlags & MPQ_FILE_EXISTS)
- {
- nError = CopyMpqFileBlocks(hFile, ha, pBlockEx, pBlock, dwSeed1);
- if(nError != ERROR_SUCCESS)
- break;
- }
- }
-
- // Cleanup and exit
- return nError;
-}
-
-
-/*****************************************************************************/
-/* Public functions */
-/*****************************************************************************/
-
-BOOL WINAPI SFileSetCompactCallback(HANDLE /* hMPQ */, COMPACTCB aCompactCB, void * lpData)
-{
- CompactCB = aCompactCB;
- lpUserData = lpData;
- return TRUE;
-}
-
-//-----------------------------------------------------------------------------
-// Archive compacting (incomplete)
-
-BOOL WINAPI SFileCompactArchive(HANDLE hMPQ, const char * szListFile, BOOL /* bReserved */)
-{
- TMPQArchive * ha = (TMPQArchive *)hMPQ;
- HANDLE hFile = INVALID_HANDLE_VALUE;
- DWORD * pFileSeeds = NULL;
- char szTempFile[MAX_PATH] = "";
- char * szTemp = NULL;
- DWORD dwTransferred;
- int nError = ERROR_SUCCESS;
-
- // Test the valid parameters
- if(!IsValidMpqHandle(ha))
- nError = ERROR_INVALID_PARAMETER;
-
- // Create the table with file seeds
- if(nError == ERROR_SUCCESS)
- {
- if((pFileSeeds = ALLOCMEM(DWORD, ha->pHeader->dwBlockTableSize)) != NULL)
- memset(pFileSeeds, 0, sizeof(DWORD) * ha->pHeader->dwBlockTableSize);
- else
- nError = ERROR_NOT_ENOUGH_MEMORY;
- }
-
- // First of all, we have to check of we are able to decrypt all files.
- // If not, sorry, but the archive cannot be compacted.
- if(nError == ERROR_SUCCESS)
- nError = CheckIfAllFilesKnown(ha, szListFile, pFileSeeds);
-
- // Get the temporary file name and create it
- if(nError == ERROR_SUCCESS)
- {
- if(CompactCB != NULL)
- CompactCB(lpUserData, CCB_COPYING_NON_MPQ_DATA, 0, 0);
-
- strcpy(szTempFile, ha->szFileName);
- if((szTemp = strrchr(szTempFile, '.')) != NULL)
- strcpy(szTemp + 1, "mp_");
- else
- strcat(szTempFile, "_");
-
- hFile = CreateFile(szTempFile, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ, NULL, CREATE_ALWAYS, 0, NULL);
- if(hFile == INVALID_HANDLE_VALUE)
- nError = GetLastError();
- }
-
- // Write the data before MPQ header (if any)
- if(nError == ERROR_SUCCESS && ha->MpqPos.QuadPart > 0)
- {
- SetFilePointer(ha->hFile, 0, NULL, FILE_BEGIN);
- if(ha->pShunt != NULL)
- nError = CopyNonMpqData(ha->hFile, hFile, ha->ShuntPos);
- else
- nError = CopyNonMpqData(ha->hFile, hFile, ha->MpqPos);
- }
-
- // Write the MPQ shunt (if any)
- if(nError == ERROR_SUCCESS && ha->pShunt != NULL)
- {
- BSWAP_TMPQSHUNT(ha->pShunt);
- WriteFile(hFile, ha->pShunt, sizeof(TMPQShunt), &dwTransferred, NULL);
- BSWAP_TMPQSHUNT(ha->pShunt);
-
- if(dwTransferred != sizeof(TMPQShunt))
- nError = ERROR_DISK_FULL;
- }
-
- // Write the data between MPQ shunt and the MPQ header (if any)
- if(nError == ERROR_SUCCESS && ha->pShunt != NULL)
- {
- LARGE_INTEGER BytesToCopy;
-
- BytesToCopy.QuadPart = ha->MpqPos.QuadPart - (ha->ShuntPos.QuadPart + sizeof(TMPQShunt));
- nError = CopyNonMpqData(ha->hFile, hFile, BytesToCopy);
- }
-
- // Write the MPQ header
- if(nError == ERROR_SUCCESS)
- {
- BSWAP_TMPQHEADER(ha->pHeader);
- WriteFile(hFile, ha->pHeader, ha->pHeader->dwHeaderSize, &dwTransferred, NULL);
- BSWAP_TMPQHEADER(ha->pHeader);
- if(dwTransferred != ha->pHeader->dwHeaderSize)
- nError = ERROR_DISK_FULL;
- }
-
- // Write the data between the header and between the first file
- // For this, we have to determine where the first file begins
- // Ladik: While this seems to be useful at first sight,
- // it makes SFileCompactArchive useless, when there's just one file
- // in a MPQ that has been rewritten.
-/*
- if(nError == ERROR_SUCCESS)
- {
- LARGE_INTEGER FirstFilePos;
- LARGE_INTEGER TempPos;
- TMPQBlockEx * pBlockEx = ha->pExtBlockTable;
- TMPQBlock * pBlockEnd = ha->pBlockTable + ha->pHeader->dwBlockTableSize;
- TMPQBlock * pBlock = ha->pBlockTable;
-
- // Maximum file position
- FirstFilePos.HighPart = 0x7FFFFFFF;
- FirstFilePos.LowPart = 0xFFFFFFFF;
-
- // Find the block with the least position in the MPQ
- while(pBlock < pBlockEnd)
- {
- TempPos.HighPart = pBlockEx->wFilePosHigh;
- TempPos.LowPart = pBlock->dwFilePos;
- if(TempPos.QuadPart < FirstFilePos.QuadPart)
- FirstFilePos = TempPos;
-
- pBlockEx++;
- pBlock++;
- }
-
- // Set the position in the source file right after the file header
- TempPos.QuadPart = ha->MpqPos.QuadPart + ha->pHeader->dwHeaderSize;
- SetFilePointer(ha->hFile, TempPos.LowPart, &TempPos.HighPart, FILE_BEGIN);
-
- // Get the number of bytes to copy
- FirstFilePos.QuadPart -= ha->pHeader->dwHeaderSize;
- nError = CopyNonMpqData(ha->hFile, hFile, FirstFilePos);
- }
-*/
- // Now write all file blocks.
- if(nError == ERROR_SUCCESS)
- nError = CopyMpqFiles(hFile, ha, pFileSeeds);
-
- // Now we need to update the tables positions
- // (but only if the tables are at the end of the file)
- if(nError == ERROR_SUCCESS)
- {
- LARGE_INTEGER RelativePos;
- LARGE_INTEGER FilePos = {0};
-
- // Set the hash table position
- FilePos.LowPart = SetFilePointer(hFile, 0, &FilePos.HighPart, FILE_CURRENT);
- RelativePos.QuadPart = FilePos.QuadPart - ha->MpqPos.QuadPart;
- ha->pHeader->wHashTablePosHigh = (USHORT)RelativePos.HighPart;
- ha->pHeader->dwHashTablePos = RelativePos.LowPart;
- ha->HashTablePos = FilePos;
-
- // Set the block table position
- RelativePos.QuadPart += ha->pHeader->dwHashTableSize * sizeof(TMPQHash);
- FilePos.QuadPart += ha->pHeader->dwHashTableSize * sizeof(TMPQHash);
- ha->pHeader->wBlockTablePosHigh = (USHORT)RelativePos.HighPart;
- ha->pHeader->dwBlockTablePos = RelativePos.LowPart;
- ha->BlockTablePos = FilePos;
-
- // Set the extended block table position
- RelativePos.QuadPart += ha->pHeader->dwBlockTableSize * sizeof(TMPQBlock);
- FilePos.QuadPart += ha->pHeader->dwBlockTableSize * sizeof(TMPQBlock);
- if(ha->ExtBlockTablePos.QuadPart != 0)
- {
- ha->pHeader->ExtBlockTablePos = RelativePos;
- ha->ExtBlockTablePos = FilePos;
-
- RelativePos.QuadPart += ha->pHeader->dwBlockTableSize * sizeof(TMPQBlockEx);
- FilePos.QuadPart += ha->pHeader->dwBlockTableSize * sizeof(TMPQBlockEx);
- }
-
- // Set the archive size
- ha->pHeader->dwArchiveSize = RelativePos.LowPart;
- ha->MpqSize = RelativePos;
- }
-
- // If succeeded, update the tables in the file
- if(nError == ERROR_SUCCESS)
- {
- CloseHandle(ha->hFile);
- ha->hFile = hFile;
- hFile = INVALID_HANDLE_VALUE;
- nError = SaveMPQTables(ha);
- }
-
- // If all succeeded, switch the archives
- if(nError == ERROR_SUCCESS)
- {
- if(CompactCB != NULL)
- CompactCB(lpUserData, CCB_CLOSING_ARCHIVE, 0, 0);
-
- if(!DeleteFile(ha->szFileName) || // Delete the old archive
- !CloseHandle(ha->hFile) || // Close the new archive
- !MoveFile(szTempFile, ha->szFileName)) // Rename the temporary archive
- nError = GetLastError();
- }
-
- // Now open the freshly renamed archive file
- if(nError == ERROR_SUCCESS)
- {
- ha->hFile = CreateFile(ha->szFileName, GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL);
- if(ha->hFile == INVALID_HANDLE_VALUE)
- nError = GetLastError();
- }
-
- // Invalidate the positions of the archive
- if(nError == ERROR_SUCCESS)
- {
- ha->pLastFile = NULL;
- ha->dwBlockPos = 0;
- ha->dwBuffPos = 0;
- }
-
- // Cleanup and return
- if(hFile != INVALID_HANDLE_VALUE)
- CloseHandle(hFile);
- if(pFileSeeds != NULL)
- FREEMEM(pFileSeeds);
- if(nError != ERROR_SUCCESS)
- SetLastError(nError);
- DeleteFile(szTempFile);
- CompactCB = NULL;
- return (nError == ERROR_SUCCESS);
-}
diff --git a/src/dep/src/StormLib/SFileCreateArchiveEx.cpp b/src/dep/src/StormLib/SFileCreateArchiveEx.cpp
deleted file mode 100644
index 7cae6e8..0000000
--- a/src/dep/src/StormLib/SFileCreateArchiveEx.cpp
+++ /dev/null
@@ -1,746 +0,0 @@
-/*****************************************************************************/
-/* SFileCreateArchiveEx.cpp Copyright (c) Ladislav Zezula 2003 */
-/*---------------------------------------------------------------------------*/
-/* MPQ Editing functions */
-/*---------------------------------------------------------------------------*/
-/* Date Ver Who Comment */
-/* -------- ---- --- ------- */
-/* 24.03.03 1.00 Lad Splitted from SFileOpenArchive.cpp */
-/*****************************************************************************/
-
-#define __STORMLIB_SELF__
-#include "StormLib.h"
-#include "SCommon.h"
-
-//-----------------------------------------------------------------------------
-// Defines
-
-#define DEFAULT_BLOCK_SIZE 3 // Default size of the block
-
-//-----------------------------------------------------------------------------
-// Local tables
-
-static DWORD PowersOfTwo[] =
-{
- 0x0000002, 0x0000004, 0x0000008,
- 0x0000010, 0x0000020, 0x0000040, 0x0000080,
- 0x0000100, 0x0000200, 0x0000400, 0x0000800,
- 0x0001000, 0x0002000, 0x0004000, 0x0008000,
- 0x0010000, 0x0020000, 0x0040000, 0x0080000,
- 0x0000000
-};
-
-//-----------------------------------------------------------------------------
-// Local functions
-
-static int RecryptFileData(
- TMPQArchive * ha,
- DWORD dwSaveBlockIndex,
- const char * szFileName,
- const char * szNewFileName)
-{
- LARGE_INTEGER BlockFilePos;
- LARGE_INTEGER MpqFilePos;
- TMPQBlockEx * pBlockEx = ha->pExtBlockTable + dwSaveBlockIndex;
- TMPQBlock * pBlock = ha->pBlockTable + dwSaveBlockIndex;
- const char * szPlainName;
- LPDWORD pdwBlockPos1 = NULL;
- LPDWORD pdwBlockPos2 = NULL;
- LPBYTE pbFileBlock = NULL;
- DWORD dwTransferred;
- DWORD dwOldSeed;
- DWORD dwNewSeed;
- DWORD dwToRead;
- int nBlocks;
- int nError = ERROR_SUCCESS;
-
- // The file must be encrypted
- assert(pBlock->dwFlags & MPQ_FILE_ENCRYPTED);
-
- // File decryption seed is calculated from the plain name
- szPlainName = strrchr(szFileName, '\\');
- if(szPlainName != NULL)
- szFileName = szPlainName + 1;
- szPlainName = strrchr(szNewFileName, '\\');
- if(szPlainName != NULL)
- szNewFileName = szPlainName + 1;
-
- // Calculate both file seeds
- dwOldSeed = DecryptFileSeed(szFileName);
- dwNewSeed = DecryptFileSeed(szNewFileName);
- if(pBlock->dwFlags & MPQ_FILE_FIXSEED)
- {
- dwOldSeed = (dwOldSeed + pBlock->dwFilePos) ^ pBlock->dwFSize;
- dwNewSeed = (dwNewSeed + pBlock->dwFilePos) ^ pBlock->dwFSize;
- }
-
- // Incase the seeds are equal, don't recrypt the file
- if(dwNewSeed == dwOldSeed)
- return ERROR_SUCCESS;
-
- // Calculate the file position of the archived file
- MpqFilePos.LowPart = pBlock->dwFilePos;
- MpqFilePos.HighPart = pBlockEx->wFilePosHigh;
- MpqFilePos.QuadPart += ha->MpqPos.QuadPart;
-
- // Calculate the number of file blocks
- nBlocks = pBlock->dwFSize / ha->dwBlockSize;
- if(pBlock->dwFSize % ha->dwBlockSize)
- nBlocks++;
-
- // If the file is stored as single unit, we recrypt one block only
- if(pBlock->dwFlags & MPQ_FILE_SINGLE_UNIT)
- {
- // Allocate the block
- pbFileBlock = ALLOCMEM(BYTE, pBlock->dwCSize);
- if(pbFileBlock == NULL)
- return ERROR_NOT_ENOUGH_MEMORY;
-
- SetFilePointer(ha->hFile, MpqFilePos.LowPart, &MpqFilePos.HighPart, FILE_BEGIN);
- ReadFile(ha->hFile, pbFileBlock, pBlock->dwCSize, &dwTransferred, NULL);
- if(dwTransferred == pBlock->dwCSize)
- nError = ERROR_FILE_CORRUPT;
-
- if(nError == ERROR_SUCCESS)
- {
- // Recrypt the block
- DecryptMPQBlock((DWORD *)pbFileBlock, pBlock->dwCSize, dwOldSeed);
- EncryptMPQBlock((DWORD *)pbFileBlock, pBlock->dwCSize, dwNewSeed);
-
- // Write it back
- SetFilePointer(ha->hFile, MpqFilePos.LowPart, &MpqFilePos.HighPart, FILE_BEGIN);
- WriteFile(ha->hFile, pbFileBlock, pBlock->dwCSize, &dwTransferred, NULL);
- if(dwTransferred != pBlock->dwCSize)
- nError = ERROR_WRITE_FAULT;
- }
- FREEMEM(pbFileBlock);
- return nError;
- }
-
- // If the file is compressed, we have to re-crypt block table first,
- // then all file blocks
- if(pBlock->dwFlags & MPQ_FILE_COMPRESSED)
- {
- // Allocate buffer for both blocks
- pdwBlockPos1 = ALLOCMEM(DWORD, nBlocks + 2);
- pdwBlockPos2 = ALLOCMEM(DWORD, nBlocks + 2);
- if(pdwBlockPos1 == NULL || pdwBlockPos2 == NULL)
- return ERROR_NOT_ENOUGH_MEMORY;
-
- // Calculate number of bytes to be read
- dwToRead = (nBlocks + 1) * sizeof(DWORD);
- if(pBlock->dwFlags & MPQ_FILE_HAS_EXTRA)
- dwToRead += sizeof(DWORD);
-
- // Read the block positions
- SetFilePointer(ha->hFile, MpqFilePos.LowPart, &MpqFilePos.HighPart, FILE_BEGIN);
- ReadFile(ha->hFile, pdwBlockPos1, dwToRead, &dwTransferred, NULL);
- if(dwTransferred != dwToRead)
- nError = ERROR_FILE_CORRUPT;
-
- // Recrypt the block table
- if(nError == ERROR_SUCCESS)
- {
- BSWAP_ARRAY32_UNSIGNED(pdwBlockPos1, dwToRead / sizeof(DWORD));
- DecryptMPQBlock(pdwBlockPos1, dwToRead, dwOldSeed - 1);
- if(pdwBlockPos1[0] != dwToRead)
- nError = ERROR_FILE_CORRUPT;
-
- memcpy(pdwBlockPos2, pdwBlockPos1, dwToRead);
- EncryptMPQBlock(pdwBlockPos2, dwToRead, dwNewSeed - 1);
- BSWAP_ARRAY32_UNSIGNED(pdwBlockPos2, dwToRead / sizeof(DWORD));
- }
-
- // Write the recrypted block table back
- if(nError == ERROR_SUCCESS)
- {
- SetFilePointer(ha->hFile, MpqFilePos.LowPart, &MpqFilePos.HighPart, FILE_BEGIN);
- WriteFile(ha->hFile, pdwBlockPos2, dwToRead, &dwTransferred, NULL);
- if(dwTransferred != dwToRead)
- nError = ERROR_WRITE_FAULT;
- }
- }
-
- // Allocate the transfer buffer
- if(nError == ERROR_SUCCESS)
- {
- pbFileBlock = ALLOCMEM(BYTE, ha->dwBlockSize);
- if(pbFileBlock == NULL)
- nError = ERROR_NOT_ENOUGH_MEMORY;
- }
-
- // Now we have to recrypt all file blocks
- if(nError == ERROR_SUCCESS)
- {
- for(int nBlock = 0; nBlock < nBlocks; nBlock++)
- {
- // Calc position and length for uncompressed file
- BlockFilePos.QuadPart = MpqFilePos.QuadPart + (ha->dwBlockSize * nBlock);
- dwToRead = ha->dwBlockSize;
- if(nBlock == nBlocks - 1)
- dwToRead = pBlock->dwFSize - (ha->dwBlockSize * (nBlocks - 1));
-
- // Fix position and length for compressed file
- if(pBlock->dwFlags & MPQ_FILE_COMPRESS)
- {
- BlockFilePos.QuadPart = MpqFilePos.QuadPart + pdwBlockPos1[nBlock];
- dwToRead = pdwBlockPos1[nBlock+1] - pdwBlockPos1[nBlock];
- }
-
- // Read the file block
- SetFilePointer(ha->hFile, BlockFilePos.LowPart, &BlockFilePos.HighPart, FILE_BEGIN);
- ReadFile(ha->hFile, pbFileBlock, dwToRead, &dwTransferred, NULL);
- if(dwTransferred != dwToRead)
- nError = ERROR_FILE_CORRUPT;
-
- // Recrypt the file block
- BSWAP_ARRAY32_UNSIGNED((DWORD *)pbFileBlock, dwToRead/sizeof(DWORD));
- DecryptMPQBlock((DWORD *)pbFileBlock, dwToRead, dwOldSeed + nBlock);
- EncryptMPQBlock((DWORD *)pbFileBlock, dwToRead, dwNewSeed + nBlock);
- BSWAP_ARRAY32_UNSIGNED((DWORD *)pbFileBlock, dwToRead/sizeof(DWORD));
-
- // Write the block back
- SetFilePointer(ha->hFile, BlockFilePos.LowPart, &BlockFilePos.HighPart, FILE_BEGIN);
- WriteFile(ha->hFile, pbFileBlock, dwToRead, &dwTransferred, NULL);
- if(dwTransferred != dwToRead)
- nError = ERROR_WRITE_FAULT;
- }
- }
-
- // Free buffers and exit
- if(pbFileBlock != NULL)
- FREEMEM(pbFileBlock);
- if(pdwBlockPos2 != NULL)
- FREEMEM(pdwBlockPos2);
- if(pdwBlockPos1 != NULL)
- FREEMEM(pdwBlockPos1);
- return nError;
-}
-
-/*****************************************************************************/
-/* Public functions */
-/*****************************************************************************/
-
-//-----------------------------------------------------------------------------
-// Opens or creates a (new) MPQ archive.
-//
-// szMpqName - Name of the archive to be created.
-//
-// dwCreationDisposition:
-//
-// Value Archive exists Archive doesn't exist
-// ---------- --------------------- ---------------------
-// CREATE_NEW Fails Creates new archive
-// CREATE_ALWAYS Overwrites existing Creates new archive
-// OPEN_EXISTING Opens the archive Fails
-// OPEN_ALWAYS Opens the archive Creates new archive
-//
-// The above mentioned values can be combined with the following flags:
-//
-// MPQ_CREATE_ARCHIVE_V1 - Creates MPQ archive version 1
-// MPQ_CREATE_ARCHIVE_V2 - Creates MPQ archive version 2
-// MPQ_CREATE_ATTRIBUTES - Will also add (attributes) file with the CRCs
-//
-// dwHashTableSize - Size of the hash table (only if creating a new archive).
-// Must be between 2^4 (= 16) and 2^18 (= 262 144)
-//
-// phMpq - Receives handle to the archive
-//
-
-BOOL WINAPI SFileCreateArchiveEx(const char * szMpqName, DWORD dwCreationDisposition, DWORD dwHashTableSize, HANDLE * phMPQ)
-{
- LARGE_INTEGER MpqPos = {0}; // Position of MPQ header in the file
- TMPQArchive * ha = NULL; // MPQ archive handle
- HANDLE hFile = INVALID_HANDLE_VALUE; // File handle
- DWORD dwTransferred = 0; // Number of bytes written into the archive
- USHORT wFormatVersion;
- BOOL bCreateAttributes = FALSE;
- BOOL bFileExists = FALSE;
- int nIndex = 0;
- int nError = ERROR_SUCCESS;
-
- // Pre-initialize the result value
- if(phMPQ != NULL)
- *phMPQ = NULL;
-
- // Check the parameters, if they are valid
- if(szMpqName == NULL || *szMpqName == 0 || phMPQ == NULL)
- {
- SetLastError(ERROR_INVALID_PARAMETER);
- return FALSE;
- }
-
- // Check the value of dwCreationDisposition against file existence
- bFileExists = (GetFileAttributes(szMpqName) != 0xFFFFFFFF);
-
- // Extract format version from the "dwCreationDisposition"
- bCreateAttributes = (dwCreationDisposition & MPQ_CREATE_ATTRIBUTES);
- wFormatVersion = (USHORT)((dwCreationDisposition >> 0x10) & 0x0000000F);
- dwCreationDisposition &= 0x0000FFFF;
-
- // If the file exists and open required, do it.
- if(bFileExists && (dwCreationDisposition == OPEN_EXISTING || dwCreationDisposition == OPEN_ALWAYS))
- {
- // Try to open the archive normal way. If it fails, it means that
- // the file exist, but it is not a MPQ archive.
- if(SFileOpenArchiveEx(szMpqName, 0, 0, phMPQ, GENERIC_READ | GENERIC_WRITE))
- return TRUE;
-
- // If the caller required to open the existing archive,
- // and the file is not MPQ archive, return error
- if(dwCreationDisposition == OPEN_EXISTING)
- return FALSE;
- }
-
- // Two error cases
- if(dwCreationDisposition == CREATE_NEW && bFileExists)
- {
- SetLastError(ERROR_ALREADY_EXISTS);
- return FALSE;
- }
- if(dwCreationDisposition == OPEN_EXISTING && bFileExists == FALSE)
- {
- SetLastError(ERROR_FILE_NOT_FOUND);
- return FALSE;
- }
-
- // At this point, we have to create the archive. If the file exists,
- // we will convert it to MPQ archive.
- // Check the value of hash table size. It has to be a power of two
- // and must be between HASH_TABLE_SIZE_MIN and HASH_TABLE_SIZE_MAX
- if(dwHashTableSize < HASH_TABLE_SIZE_MIN)
- dwHashTableSize = HASH_TABLE_SIZE_MIN;
- if(dwHashTableSize > HASH_TABLE_SIZE_MAX)
- dwHashTableSize = HASH_TABLE_SIZE_MAX;
-
- // Round the hash table size up to the nearest power of two
- for(nIndex = 0; PowersOfTwo[nIndex] != 0; nIndex++)
- {
- if(dwHashTableSize <= PowersOfTwo[nIndex])
- {
- dwHashTableSize = PowersOfTwo[nIndex];
- break;
- }
- }
-
- // Prepare the buffer for decryption engine
- if(nError == ERROR_SUCCESS)
- nError = PrepareStormBuffer();
-
- // Get the position where the MPQ header will begin.
- if(nError == ERROR_SUCCESS)
- {
- hFile = CreateFile(szMpqName,
- GENERIC_READ | GENERIC_WRITE,
- FILE_SHARE_READ,
- NULL,
- dwCreationDisposition,
- 0,
- NULL);
- if(hFile == INVALID_HANDLE_VALUE)
- nError = GetLastError();
- }
-
- // Retrieve the file size and round it up to 0x200 bytes
- if(nError == ERROR_SUCCESS)
- {
- MpqPos.LowPart = GetFileSize(hFile, (LPDWORD)&MpqPos.HighPart);
- MpqPos.QuadPart += 0x1FF;
- MpqPos.LowPart &= 0xFFFFFE00;
-
- if(wFormatVersion == MPQ_FORMAT_VERSION_1 && MpqPos.HighPart != 0)
- nError = ERROR_DISK_FULL;
- if(wFormatVersion == MPQ_FORMAT_VERSION_2 && MpqPos.HighPart > 0x0000FFFF)
- nError = ERROR_DISK_FULL;
- }
-
- // Move to the end of the file (i.e. begin of the MPQ)
- if(nError == ERROR_SUCCESS)
- {
- if(SetFilePointer(hFile, MpqPos.LowPart, &MpqPos.HighPart, FILE_BEGIN) == 0xFFFFFFFF)
- nError = GetLastError();
- }
-
- // Set the new end of the file to the MPQ header position
- if(nError == ERROR_SUCCESS)
- {
- if(!SetEndOfFile(hFile))
- nError = GetLastError();
- }
-
- // Create the archive handle
- if(nError == ERROR_SUCCESS)
- {
- if((ha = ALLOCMEM(TMPQArchive, 1)) == NULL)
- nError = ERROR_NOT_ENOUGH_MEMORY;
- }
-
- // Fill the MPQ archive handle structure and create the header,
- // block buffer, hash table and block table
- if(nError == ERROR_SUCCESS)
- {
- memset(ha, 0, sizeof(TMPQArchive));
- strcpy(ha->szFileName, szMpqName);
- ha->hFile = hFile;
- ha->dwBlockSize = 0x200 << DEFAULT_BLOCK_SIZE;
- ha->MpqPos = MpqPos;
- ha->pHeader = &ha->Header;
- ha->pHashTable = ALLOCMEM(TMPQHash, dwHashTableSize);
- ha->pBlockTable = ALLOCMEM(TMPQBlock, dwHashTableSize);
- ha->pExtBlockTable = ALLOCMEM(TMPQBlockEx, dwHashTableSize);
- ha->pbBlockBuffer = ALLOCMEM(BYTE, ha->dwBlockSize);
- ha->pListFile = NULL;
- ha->dwFlags |= MPQ_FLAG_CHANGED;
-
- if(!ha->pHashTable || !ha->pBlockTable || !ha->pExtBlockTable || !ha->pbBlockBuffer)
- nError = GetLastError();
- hFile = INVALID_HANDLE_VALUE;
- }
-
- // Fill the MPQ header and all buffers
- if(nError == ERROR_SUCCESS)
- {
- LARGE_INTEGER TempPos;
- TMPQHeader2 * pHeader = ha->pHeader;
- DWORD dwHeaderSize = (wFormatVersion == MPQ_FORMAT_VERSION_2) ? sizeof(TMPQHeader2) : sizeof(TMPQHeader);
-
- memset(pHeader, 0, sizeof(TMPQHeader2));
- pHeader->dwID = ID_MPQ;
- pHeader->dwHeaderSize = dwHeaderSize;
- pHeader->dwArchiveSize = pHeader->dwHeaderSize + dwHashTableSize * sizeof(TMPQHash);
- pHeader->wFormatVersion = wFormatVersion;
- pHeader->wBlockSize = 3; // 0x1000 bytes per block
- pHeader->dwHashTableSize = dwHashTableSize;
-
- // Set proper hash table positions
- ha->HashTablePos.QuadPart = ha->MpqPos.QuadPart + pHeader->dwHeaderSize;
- ha->pHeader->dwHashTablePos = pHeader->dwHeaderSize;
- ha->pHeader->wHashTablePosHigh = 0;
-
- // Set proper block table positions
- ha->BlockTablePos.QuadPart = ha->HashTablePos.QuadPart +
- (ha->pHeader->dwHashTableSize * sizeof(TMPQHash));
- TempPos.QuadPart = ha->BlockTablePos.QuadPart - ha->MpqPos.QuadPart;
- ha->pHeader->dwBlockTablePos = TempPos.LowPart;
- ha->pHeader->wBlockTablePosHigh = (USHORT)TempPos.HighPart;
-
- // For now, we set extended block table positioon top zero unless we add enough
- // files to cause the archive size exceed 4 GB
- ha->ExtBlockTablePos.QuadPart = 0;
-
- // Clear all tables
- memset(ha->pBlockTable, 0, sizeof(TMPQBlock) * dwHashTableSize);
- memset(ha->pExtBlockTable, 0, sizeof(TMPQBlockEx) * dwHashTableSize);
- memset(ha->pHashTable, 0xFF, sizeof(TMPQHash) * dwHashTableSize);
- }
-
- // Write the MPQ header to the file
- if(nError == ERROR_SUCCESS)
- {
- DWORD dwHeaderSize = ha->pHeader->dwHeaderSize;
-
- BSWAP_TMPQHEADER(ha->pHeader);
- WriteFile(ha->hFile, ha->pHeader, dwHeaderSize, &dwTransferred, NULL);
- BSWAP_TMPQHEADER(ha->pHeader);
-
- if(dwTransferred != ha->pHeader->dwHeaderSize)
- nError = ERROR_DISK_FULL;
-
- ha->MpqSize.QuadPart += dwTransferred;
- }
-
- // Create the internal listfile
- if(nError == ERROR_SUCCESS)
- nError = SListFileCreateListFile(ha);
-
- // Try to add the internal listfile, attributes.
- // Also add internal listfile to the search lists
- if(nError == ERROR_SUCCESS)
- {
- if(SFileAddListFile((HANDLE)ha, NULL) != ERROR_SUCCESS)
- AddInternalFile(ha, LISTFILE_NAME);
- }
-
- // Create the file attributes
- if(nError == ERROR_SUCCESS && bCreateAttributes)
- {
- if(SAttrFileCreate(ha) == ERROR_SUCCESS)
- AddInternalFile(ha, ATTRIBUTES_NAME);
- }
-
- // Cleanup : If an error, delete all buffers and return
- if(nError != ERROR_SUCCESS)
- {
- FreeMPQArchive(ha);
- if(hFile != INVALID_HANDLE_VALUE)
- CloseHandle(hFile);
- SetLastError(nError);
- ha = NULL;
- }
-
- // Return the values
- *phMPQ = (HANDLE)ha;
- return (nError == ERROR_SUCCESS);
-}
-
-//-----------------------------------------------------------------------------
-// Changes locale ID of a file
-
-BOOL WINAPI SFileSetFileLocale(HANDLE hFile, LCID lcNewLocale)
-{
- TMPQFile * hf = (TMPQFile *)hFile;
-
- // Invalid handle => do nothing
- if(IsValidFileHandle(hf) == FALSE || IsValidMpqHandle(hf->ha) == FALSE)
- {
- SetLastError(ERROR_INVALID_PARAMETER);
- return FALSE;
- }
-
- // If the file has not been open for writing, do nothing.
- if(hf->ha->pListFile == NULL)
- return ERROR_ACCESS_DENIED;
-
- hf->pHash->lcLocale = (USHORT)lcNewLocale;
- hf->ha->dwFlags |= MPQ_FLAG_CHANGED;
- return TRUE;
-}
-
-//-----------------------------------------------------------------------------
-// Adds a file into the archive
-
-BOOL WINAPI SFileAddFileEx(HANDLE hMPQ, const char * szFileName, const char * szArchivedName, DWORD dwFlags, DWORD dwQuality, int nFileType)
-{
- TMPQArchive * ha = (TMPQArchive *)hMPQ;
- HANDLE hFile = INVALID_HANDLE_VALUE;
- BOOL bReplaced = FALSE; // TRUE if replacing file in the archive
- int nError = ERROR_SUCCESS;
-
- if(nError == ERROR_SUCCESS)
- {
- // Check valid parameters
- if(IsValidMpqHandle(ha) == FALSE || szFileName == NULL || *szFileName == 0 || szArchivedName == NULL || *szArchivedName == 0)
- nError = ERROR_INVALID_PARAMETER;
-
- // Check the values of dwFlags
- if((dwFlags & MPQ_FILE_IMPLODE) && (dwFlags & MPQ_FILE_COMPRESS))
- nError = ERROR_INVALID_PARAMETER;
- }
-
- // If anyone is trying to add listfile, and the archive already has a listfile,
- // deny the operation, but return success.
- if(nError == ERROR_SUCCESS)
- {
- if(ha->pListFile != NULL && !_stricmp(szFileName, LISTFILE_NAME))
- return ERROR_SUCCESS;
- }
-
- // Open added file
- if(nError == ERROR_SUCCESS)
- {
- hFile = CreateFile(szFileName, GENERIC_READ, FILE_SHARE_READ, 0, OPEN_EXISTING, 0, NULL);
- if(hFile == INVALID_HANDLE_VALUE)
- nError = GetLastError();
- }
-
- if(nError == ERROR_SUCCESS)
- nError = AddFileToArchive(ha, hFile, szArchivedName, dwFlags, dwQuality, nFileType, &bReplaced);
-
- // Add the file into listfile also
- if(nError == ERROR_SUCCESS && bReplaced == FALSE)
- nError = SListFileCreateNode(ha, szArchivedName, lcLocale);
-
- // Cleanup and exit
- if(hFile != INVALID_HANDLE_VALUE)
- CloseHandle(hFile);
- if(nError != ERROR_SUCCESS)
- SetLastError(nError);
- return (nError == ERROR_SUCCESS);
-}
-
-// Adds a data file into the archive
-BOOL WINAPI SFileAddFile(HANDLE hMPQ, const char * szFileName, const char * szArchivedName, DWORD dwFlags)
-{
- return SFileAddFileEx(hMPQ, szFileName, szArchivedName, dwFlags, 0, SFILE_TYPE_DATA);
-}
-
-// Adds a WAVE file into the archive
-BOOL WINAPI SFileAddWave(HANDLE hMPQ, const char * szFileName, const char * szArchivedName, DWORD dwFlags, DWORD dwQuality)
-{
- return SFileAddFileEx(hMPQ, szFileName, szArchivedName, dwFlags, dwQuality, SFILE_TYPE_WAVE);
-}
-
-//-----------------------------------------------------------------------------
-// BOOL SFileRemoveFile(HANDLE hMPQ, char * szFileName)
-//
-// This function removes a file from the archive. The file content
-// remains there, only the entries in the hash table and in the block
-// table are updated.
-
-BOOL WINAPI SFileRemoveFile(HANDLE hMPQ, const char * szFileName, DWORD dwSearchScope)
-{
- TMPQArchive * ha = (TMPQArchive *)hMPQ;
- TMPQBlockEx * pBlockEx = NULL; // Block entry of deleted file
- TMPQBlock * pBlock = NULL; // Block entry of deleted file
- TMPQHash * pHash = NULL; // Hash entry of deleted file
- DWORD dwBlockIndex = 0;
- int nError = ERROR_SUCCESS;
-
- // Check the parameters
- if(nError == ERROR_SUCCESS)
- {
- if(IsValidMpqHandle(ha) == FALSE)
- nError = ERROR_INVALID_PARAMETER;
- if(dwSearchScope != SFILE_OPEN_BY_INDEX && *szFileName == 0)
- nError = ERROR_INVALID_PARAMETER;
- }
-
- // Do not allow to remove listfile
- if(nError == ERROR_SUCCESS)
- {
- if(dwSearchScope != SFILE_OPEN_BY_INDEX && !_stricmp(szFileName, LISTFILE_NAME))
- nError = ERROR_ACCESS_DENIED;
- }
-
- // Remove the file from the list file
- if(nError == ERROR_SUCCESS)
- nError = SListFileRemoveNode(ha, szFileName, lcLocale);
-
- // Get hash entry belonging to this file
- if(nError == ERROR_SUCCESS)
- {
- if((pHash = GetHashEntryEx(ha, (char *)szFileName, lcLocale)) == NULL)
- nError = ERROR_FILE_NOT_FOUND;
- }
-
- // If index was not found, or is greater than number of files, exit.
- if(nError == ERROR_SUCCESS)
- {
- if((dwBlockIndex = pHash->dwBlockIndex) > ha->pHeader->dwBlockTableSize)
- nError = ERROR_FILE_NOT_FOUND;
- }
-
- // Get block and test if the file is not already deleted
- if(nError == ERROR_SUCCESS)
- {
- pBlockEx = ha->pExtBlockTable + dwBlockIndex;
- pBlock = ha->pBlockTable + dwBlockIndex;
- if((pBlock->dwFlags & MPQ_FILE_EXISTS) == 0)
- nError = ERROR_FILE_NOT_FOUND;
- }
-
- // Now invalidate the block entry and the hash entry. Do not make any
- // relocations and file copying, use SFileCompactArchive for it.
- if(nError == ERROR_SUCCESS)
- {
- pBlockEx->wFilePosHigh = 0;
- pBlock->dwFilePos = 0;
- pBlock->dwFSize = 0;
- pBlock->dwCSize = 0;
- pBlock->dwFlags = 0;
- pHash->dwName1 = 0xFFFFFFFF;
- pHash->dwName2 = 0xFFFFFFFF;
- pHash->lcLocale = 0xFFFF;
- pHash->wPlatform = 0xFFFF;
- pHash->dwBlockIndex = HASH_ENTRY_DELETED;
-
- // Update MPQ archive
- ha->dwFlags |= MPQ_FLAG_CHANGED;
- }
-
- // Resolve error and exit
- if(nError != ERROR_SUCCESS)
- SetLastError(nError);
- return (nError == ERROR_SUCCESS);
-}
-
-// Renames the file within the archive.
-BOOL WINAPI SFileRenameFile(HANDLE hMPQ, const char * szFileName, const char * szNewFileName)
-{
- TMPQArchive * ha = (TMPQArchive *)hMPQ;
- TMPQBlock * pBlock;
- TMPQHash * pOldHash = NULL; // Hash entry for the original file
- TMPQHash * pNewHash = NULL; // Hash entry for the renamed file
- DWORD dwSaveBlockIndex = 0;
- LCID lcSaveLocale = 0;
- int nError = ERROR_SUCCESS;
-
- // Test the valid parameters
- if(nError == ERROR_SUCCESS)
- {
- if(hMPQ == NULL || szNewFileName == NULL || *szNewFileName == 0)
- nError = ERROR_INVALID_PARAMETER;
- if(szFileName == NULL || *szFileName == 0)
- nError = ERROR_INVALID_PARAMETER;
- }
-
- // Do not allow to rename listfile
- if(nError == ERROR_SUCCESS)
- {
- if(!_stricmp(szFileName, LISTFILE_NAME))
- nError = ERROR_ACCESS_DENIED;
- }
-
- // Get the hash table entry for the original file
- if(nError == ERROR_SUCCESS)
- {
- if((pOldHash = GetHashEntryEx(ha, szFileName, lcLocale)) == NULL)
- nError = ERROR_FILE_NOT_FOUND;
- }
-
- // Test if the file already exists in the archive
- if(nError == ERROR_SUCCESS)
- {
- if((pNewHash = GetHashEntryEx(ha, szNewFileName, pOldHash->lcLocale)) != NULL)
- nError = ERROR_ALREADY_EXISTS;
- }
-
- // We have to know the decryption seed, otherwise we cannot re-crypt
- // the file after renaming
- if(nError == ERROR_SUCCESS)
- {
- // Save block table index and remove the hash table entry
- dwSaveBlockIndex = pOldHash->dwBlockIndex;
- lcSaveLocale = pOldHash->lcLocale;
- pBlock = ha->pBlockTable + dwSaveBlockIndex;
-
- // If the file is encrypted, we have to re-crypt the file content
- // with the new decryption seed
- if(pBlock->dwFlags & MPQ_FILE_ENCRYPTED)
- {
- nError = RecryptFileData(ha, dwSaveBlockIndex, szFileName, szNewFileName);
- }
- }
-
- // Get the hash table entry for the renamed file
- if(nError == ERROR_SUCCESS)
- {
- SListFileRemoveNode(ha, szFileName, lcSaveLocale);
- pOldHash->dwName1 = 0xFFFFFFFF;
- pOldHash->dwName2 = 0xFFFFFFFF;
- pOldHash->lcLocale = 0xFFFF;
- pOldHash->wPlatform = 0xFFFF;
- pOldHash->dwBlockIndex = HASH_ENTRY_DELETED;
-
- if((pNewHash = FindFreeHashEntry(ha, szNewFileName)) == NULL)
- nError = ERROR_CAN_NOT_COMPLETE;
- }
-
- // Save the block index and clear the hash entry
- if(nError == ERROR_SUCCESS)
- {
- // Copy the block table index
- pNewHash->dwBlockIndex = dwSaveBlockIndex;
- pNewHash->lcLocale = (USHORT)lcSaveLocale;
- ha->dwFlags |= MPQ_FLAG_CHANGED;
-
- // Create new name node for the listfile
- nError = SListFileCreateNode(ha, szNewFileName, lcSaveLocale);
- }
-
- // Resolve error and return
- if(nError != ERROR_SUCCESS)
- SetLastError(nError);
- return (nError == ERROR_SUCCESS);
-}
-
diff --git a/src/dep/src/StormLib/SFileFindFile.cpp b/src/dep/src/StormLib/SFileFindFile.cpp
deleted file mode 100644
index 320b0af..0000000
--- a/src/dep/src/StormLib/SFileFindFile.cpp
+++ /dev/null
@@ -1,316 +0,0 @@
-/*****************************************************************************/
-/* SFileFindFile.cpp Copyright (c) Ladislav Zezula 2003 */
-/*---------------------------------------------------------------------------*/
-/* A module for file searching within MPQs */
-/*---------------------------------------------------------------------------*/
-/* Date Ver Who Comment */
-/* -------- ---- --- ------- */
-/* 25.03.03 1.00 Lad The first version of SFileFindFile.cpp */
-/*****************************************************************************/
-
-#define __STORMLIB_SELF__
-#include "StormLib.h"
-#include "SCommon.h"
-
-//-----------------------------------------------------------------------------
-// Defines
-
-#define LISTFILE_CACHE_SIZE 0x1000
-
-//-----------------------------------------------------------------------------
-// Local functions
-
-static BOOL IsValidSearchHandle(TMPQSearch * hs)
-{
- if(hs == NULL || IsBadReadPtr(hs, sizeof(TMPQSearch)))
- return FALSE;
-
- if(!IsValidMpqHandle(hs->ha))
- return FALSE;
-
- return TRUE;
-}
-
-// This function compares a string with a wildcard search string.
-// returns TRUE, when the string matches with the wildcard.
-BOOL CheckWildCard(const char * szString, const char * szWildCard)
-{
- char * szTemp; // Temporary helper pointer
- int nResult = 0; // For memcmp return values
- int nMustNotMatch = 0; // Number of following chars int szString,
- // which must not match with szWildCard
- int nMustMatch = 0; // Number of the following characters,
- // which must match
-
- // When the string is empty, it does not match with every wildcard
- if(*szString == 0)
- return FALSE;
-
- // When the mask is empty, it matches to every wildcard
- if(szWildCard == NULL || *szWildCard == 0)
- return FALSE;
-
- // Do normal test
- for(;;)
- {
- switch(*szWildCard)
- {
- case '*': // Means "every number of characters"
- // Skip all asterisks
- while(*szWildCard == '*')
- szWildCard++;
-
- // When no more characters in wildcard, it means that the strings match
- if(*szWildCard == 0)
- return TRUE;
-
- // The next N characters must not agree
- nMustNotMatch |= 0x70000000;
- break;
-
- case '?': // Means "One or no character"
- while(*szWildCard == '?')
- {
- nMustNotMatch++;
- szWildCard++;
- }
- break;
-
- default:
- // If the two characters match
- if(toupper(*szString) == toupper(*szWildCard))
- {
- // When end of string, they agree
- if(*szString == 0)
- return TRUE;
-
- nMustNotMatch = 0;
- szWildCard++;
- szString++;
- break;
- }
-
- // If the next character must match, the string does not match
- if(nMustNotMatch == 0)
- return FALSE;
-
- // Count the characters which must match after characters
- // that must not match
- szTemp = (char *)szWildCard;
- nMustMatch = 0;
- while(*szTemp != 0 && *szTemp != '*' && *szTemp != '?')
- {
- nMustMatch++;
- szTemp++;
- }
-
- // Now skip characters from szString up to number of chars
- // that must not match
- nResult = -1;
- while(nMustNotMatch > 0 && *szString != 0)
- {
- if((nResult = _strnicmp(szString, szWildCard, nMustMatch)) == 0)
- break;
-
- szString++;
- nMustNotMatch--;
- }
-
- // Make one more comparison
- if(nMustNotMatch == 0)
- nResult = _strnicmp(szString, szWildCard, nMustMatch);
-
- // If a match has been found, continue the search
- if(nResult == 0)
- {
- nMustNotMatch = 0;
- szWildCard += nMustMatch;
- szString += nMustMatch;
- break;
- }
- return FALSE;
- }
- }
-}
-
-// Performs one MPQ search
-static int DoMPQSearch(TMPQSearch * hs, SFILE_FIND_DATA * lpFindFileData)
-{
- TMPQArchive * ha = hs->ha;
- TFileNode * pNode = NULL;
- TMPQBlock * pBlock;
- TMPQHash * pFoundHash = NULL;
- TMPQHash * pHashEnd = ha->pHashTable + ha->pHeader->dwHashTableSize;
- TMPQHash * pHash = ha->pHashTable + hs->dwNextIndex;
- DWORD dwIndex = hs->dwNextIndex;
-
- // Do until a file is found or no more files
- while(pHash < pHashEnd)
- {
- pNode = ha->pListFile[dwIndex++];
-
- // Is this entry occupied ?
- if(pHash->dwBlockIndex < HASH_ENTRY_DELETED && (DWORD_PTR)pNode < LISTFILE_ENTRY_DELETED)
- {
- // Check the file name.
- if(CheckWildCard(pNode->szFileName, hs->szSearchMask))
- {
- pFoundHash = pHash;
- pHash++;
- break;
- }
- }
-
- // Move to the next hash
- pHash++;
- }
-
- // In case there will be more equal entries in the hash table
- if(pFoundHash != NULL)
- {
- while(pHash < pHashEnd)
- {
- if(pHash->dwName1 != pFoundHash->dwName1 ||
- pHash->dwName2 != pFoundHash->dwName2 ||
- pHash->lcLocale != pFoundHash->lcLocale ||
- pHash->wPlatform != pFoundHash->wPlatform)
- {
- break;
- }
-
- // Move to the next hash
- pFoundHash = pHash;
- pHash++;
- }
-
- // Fill the found entry
- pBlock = ha->pBlockTable + pFoundHash->dwBlockIndex;
- lpFindFileData->lcLocale = pFoundHash->lcLocale;
- lpFindFileData->dwFileSize = pBlock->dwFSize;
- lpFindFileData->dwFileFlags = pBlock->dwFlags;
- lpFindFileData->dwBlockIndex = pFoundHash->dwBlockIndex;
- lpFindFileData->dwCompSize = pBlock->dwCSize;
-
- // Fill the file name and plain file name
- strcpy(lpFindFileData->cFileName, pNode->szFileName);
- lpFindFileData->szPlainName = strrchr(lpFindFileData->cFileName, '\\');
- if(lpFindFileData->szPlainName == NULL)
- lpFindFileData->szPlainName = lpFindFileData->cFileName;
- else
- lpFindFileData->szPlainName++;
-
- // Adjust the next hash index to search
- hs->dwNextIndex = (DWORD)(pFoundHash - ha->pHashTable) + 1;
-
- // Fill the next entry
- return ERROR_SUCCESS;
- }
-
- // No more files found, return error
- return ERROR_NO_MORE_FILES;
-}
-
-static void FreeMPQSearch(TMPQSearch *& hs)
-{
- if(hs != NULL)
- {
- FREEMEM(hs);
- hs = NULL;
- }
-}
-
-//-----------------------------------------------------------------------------
-// Public functions
-
-HANDLE WINAPI SFileFindFirstFile(HANDLE hMPQ, const char * szMask, SFILE_FIND_DATA * lpFindFileData, const char * szListFile)
-{
- TMPQArchive * ha = (TMPQArchive *)hMPQ;
- TMPQSearch * hs = NULL; // Search object handle
- size_t nSize = 0;
- int nError = ERROR_SUCCESS;
-
- // Check for the valid parameters
- if(nError == ERROR_SUCCESS)
- {
- if(!IsValidMpqHandle(ha))
- nError = ERROR_INVALID_PARAMETER;
-
- if(szMask == NULL || lpFindFileData == NULL)
- nError = ERROR_INVALID_PARAMETER;
-
- if(szListFile == NULL && !IsValidMpqHandle(ha))
- nError = ERROR_INVALID_PARAMETER;
- }
-
- // Include the listfile into the MPQ's internal listfile
- // Note that if the listfile name is NULL, do nothing because the
- // internal listfile is always included.
- if(nError == ERROR_SUCCESS && szListFile != NULL && *szListFile != 0)
- nError = SFileAddListFile((HANDLE)ha, szListFile);
-
- // Allocate the structure for MPQ search
- if(nError == ERROR_SUCCESS)
- {
- nSize = sizeof(TMPQSearch) + strlen(szMask) + 1;
- if((hs = (TMPQSearch *)ALLOCMEM(char, nSize)) == NULL)
- nError = ERROR_NOT_ENOUGH_MEMORY;
- }
-
- // Perform the first search
- if(nError == ERROR_SUCCESS)
- {
- memset(hs, 0, sizeof(TMPQSearch));
- hs->ha = ha;
- hs->dwNextIndex = 0;
- strcpy(hs->szSearchMask, szMask);
- nError = DoMPQSearch(hs, lpFindFileData);
- }
-
- // Cleanup
- if(nError != ERROR_SUCCESS)
- {
- FreeMPQSearch(hs);
- SetLastError(nError);
- }
-
- // Return the result value
- return (HANDLE)hs;
-}
-
-BOOL WINAPI SFileFindNextFile(HANDLE hFind, SFILE_FIND_DATA * lpFindFileData)
-{
- TMPQSearch * hs = (TMPQSearch *)hFind;
- int nError = ERROR_SUCCESS;
-
- // Check the parameters
- if(nError == ERROR_SUCCESS)
- {
- if(!IsValidSearchHandle(hs) || lpFindFileData == NULL)
- nError = ERROR_INVALID_PARAMETER;
- }
-
- if(nError == ERROR_SUCCESS)
- nError = DoMPQSearch(hs, lpFindFileData);
-
- if(nError != ERROR_SUCCESS)
- {
- SetLastError(nError);
- return FALSE;
- }
- return TRUE;
-}
-
-BOOL WINAPI SFileFindClose(HANDLE hFind)
-{
- TMPQSearch * hs = (TMPQSearch *)hFind;
-
- // Check the parameters
- if(!IsValidSearchHandle(hs))
- {
- SetLastError(ERROR_INVALID_PARAMETER);
- return FALSE;
- }
-
- FreeMPQSearch(hs);
- return TRUE;
-}
diff --git a/src/dep/src/StormLib/SFileOpenArchive.cpp b/src/dep/src/StormLib/SFileOpenArchive.cpp
deleted file mode 100644
index 0c6f3b3..0000000
--- a/src/dep/src/StormLib/SFileOpenArchive.cpp
+++ /dev/null
@@ -1,543 +0,0 @@
-/*****************************************************************************/
-/* SFileOpenArchive.cpp Copyright Ladislav Zezula 1999 */
-/* */
-/* Author : Ladislav Zezula */
-/* E-mail : ladik@zezula.net */
-/* WWW : www.zezula.net */
-/*---------------------------------------------------------------------------*/
-/* Archive functions of Storm.dll */
-/*---------------------------------------------------------------------------*/
-/* Date Ver Who Comment */
-/* -------- ---- --- ------- */
-/* xx.xx.xx 1.00 Lad The first version of SFileOpenArchive.cpp */
-/* 19.11.03 1.01 Dan Big endian handling */
-/*****************************************************************************/
-
-#define __STORMLIB_SELF__
-#include "StormLib.h"
-#include "SCommon.h"
-
-/*****************************************************************************/
-/* Local functions */
-/*****************************************************************************/
-
-static BOOL IsAviFile(TMPQHeader * pHeader)
-{
- DWORD * AviHdr = (DWORD *)pHeader;
-
- // Test for 'RIFF', 'AVI ' or 'LIST'
- return (AviHdr[0] == 'FFIR' && AviHdr[2] == ' IVA' && AviHdr[3] == 'TSIL');
-}
-
-// This function gets the right positions of the hash table and the block table.
-static int RelocateMpqTablePositions(TMPQArchive * ha)
-{
- TMPQHeader2 * pHeader = ha->pHeader;
- LARGE_INTEGER FileSize;
- LARGE_INTEGER TempSize;
-
- // Get the size of the file
- FileSize.LowPart = GetFileSize(ha->hFile, (LPDWORD)&FileSize.HighPart);
-
- // Set the proper hash table position
- ha->HashTablePos.HighPart = pHeader->wHashTablePosHigh;
- ha->HashTablePos.LowPart = pHeader->dwHashTablePos;
- ha->HashTablePos.QuadPart += ha->MpqPos.QuadPart;
- if(ha->HashTablePos.QuadPart > FileSize.QuadPart)
- return ERROR_BAD_FORMAT;
-
- // Set the proper block table position
- ha->BlockTablePos.HighPart = pHeader->wBlockTablePosHigh;
- ha->BlockTablePos.LowPart = pHeader->dwBlockTablePos;
- ha->BlockTablePos.QuadPart += ha->MpqPos.QuadPart;
- if(ha->BlockTablePos.QuadPart > FileSize.QuadPart)
- return ERROR_BAD_FORMAT;
-
- // Set the proper position of the extended block table
- if(pHeader->ExtBlockTablePos.QuadPart != 0)
- {
- ha->ExtBlockTablePos = pHeader->ExtBlockTablePos;
- ha->ExtBlockTablePos.QuadPart += ha->MpqPos.QuadPart;
- if(ha->ExtBlockTablePos.QuadPart > FileSize.QuadPart)
- return ERROR_BAD_FORMAT;
- }
-
- // Size of MPQ archive is computed as the biggest of
- // (EndOfBlockTable, EndOfHashTable, EndOfExtBlockTable)
- TempSize.QuadPart = ha->HashTablePos.QuadPart + (pHeader->dwHashTableSize * sizeof(TMPQHash));
- if(TempSize.QuadPart > ha->MpqSize.QuadPart)
- ha->MpqSize = TempSize;
- TempSize.QuadPart = ha->BlockTablePos.QuadPart + (pHeader->dwBlockTableSize * sizeof(TMPQBlock));
- if(TempSize.QuadPart > ha->MpqSize.QuadPart)
- ha->MpqSize = TempSize;
- TempSize.QuadPart = ha->ExtBlockTablePos.QuadPart + (pHeader->dwBlockTableSize * sizeof(TMPQBlockEx));
- if(TempSize.QuadPart > ha->MpqSize.QuadPart)
- ha->MpqSize = TempSize;
-
- // MPQ size does not include the bytes before MPQ header
- ha->MpqSize.QuadPart -= ha->MpqPos.QuadPart;
- return ERROR_SUCCESS;
-}
-
-
-/*****************************************************************************/
-/* Public functions */
-/*****************************************************************************/
-
-//-----------------------------------------------------------------------------
-// SFileGetLocale and SFileSetLocale
-// Set the locale for all neewly opened archives and files
-
-LCID WINAPI SFileGetLocale()
-{
- return lcLocale;
-}
-
-LCID WINAPI SFileSetLocale(LCID lcNewLocale)
-{
- lcLocale = lcNewLocale;
- return lcLocale;
-}
-
-//-----------------------------------------------------------------------------
-// SFileOpenArchiveEx (not a public function !!!)
-//
-// szFileName - MPQ archive file name to open
-// dwPriority - When SFileOpenFileEx called, this contains the search priority for searched archives
-// dwFlags - If contains MPQ_OPEN_NO_LISTFILE, then the internal list file will not be used.
-// phMPQ - Pointer to store open archive handle
-
-BOOL SFileOpenArchiveEx(
- const char * szMpqName,
- DWORD dwPriority,
- DWORD dwFlags,
- HANDLE * phMPQ,
- DWORD dwAccessMode)
-{
- LARGE_INTEGER TempPos;
- TMPQArchive * ha = NULL; // Archive handle
- HANDLE hFile = INVALID_HANDLE_VALUE;// Opened archive file handle
- DWORD dwMaxBlockIndex = 0; // Maximum value of block entry
- DWORD dwBlockTableSize = 0; // Block table size.
- DWORD dwTransferred; // Number of bytes read
- DWORD dwBytes = 0; // Number of bytes to read
- int nError = ERROR_SUCCESS;
-
- // Check the right parameters
- if(nError == ERROR_SUCCESS)
- {
- if(szMpqName == NULL || *szMpqName == 0 || phMPQ == NULL)
- nError = ERROR_INVALID_PARAMETER;
- }
-
- // Ensure that StormBuffer is allocated
- if(nError == ERROR_SUCCESS)
- nError = PrepareStormBuffer();
-
- // Open the MPQ archive file
- if(nError == ERROR_SUCCESS)
- {
- hFile = CreateFile(szMpqName, dwAccessMode, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL);
- if(hFile == INVALID_HANDLE_VALUE)
- nError = GetLastError();
- }
-
- // Allocate the MPQhandle
- if(nError == ERROR_SUCCESS)
- {
- if((ha = ALLOCMEM(TMPQArchive, 1)) == NULL)
- nError = ERROR_NOT_ENOUGH_MEMORY;
- }
-
- // Initialize handle structure and allocate structure for MPQ header
- if(nError == ERROR_SUCCESS)
- {
- memset(ha, 0, sizeof(TMPQArchive));
- strncpy(ha->szFileName, szMpqName, strlen(szMpqName));
- ha->hFile = hFile;
- ha->dwPriority = dwPriority;
- ha->pHeader = &ha->Header;
- ha->pListFile = NULL;
- hFile = INVALID_HANDLE_VALUE;
- }
-
- // Find the offset of MPQ header within the file
- if(nError == ERROR_SUCCESS)
- {
- LARGE_INTEGER SearchPos = {0};
- LARGE_INTEGER MpqPos = {0};
- DWORD dwHeaderID;
-
- for(;;)
- {
- // Invalidate the MPQ ID and read the eventual header
- SetFilePointer(ha->hFile, MpqPos.LowPart, &MpqPos.HighPart, FILE_BEGIN);
- ReadFile(ha->hFile, ha->pHeader, sizeof(TMPQHeader2), &dwTransferred, NULL);
- dwHeaderID = BSWAP_INT32_UNSIGNED(ha->pHeader->dwID);
-
- // Special check : Some MPQs are actually AVI files, only with
- // changed extension.
- if(MpqPos.QuadPart == 0 && IsAviFile(ha->pHeader))
- {
- nError = ERROR_AVI_FILE;
- break;
- }
-
- // If different number of bytes read, break the loop
- if(dwTransferred != sizeof(TMPQHeader2))
- {
- nError = ERROR_BAD_FORMAT;
- break;
- }
-
- // If there is the MPQ shunt signature, process it
- if(dwHeaderID == ID_MPQ_SHUNT && ha->pShunt == NULL)
- {
- // Ignore the MPQ shunt completely if the caller wants to open the MPQ as V1.0
- if((dwFlags & MPQ_OPEN_FORCE_MPQ_V1) == 0)
- {
- // Fill the shunt header
- ha->ShuntPos = MpqPos;
- ha->pShunt = &ha->Shunt;
- memcpy(ha->pShunt, ha->pHeader, sizeof(TMPQShunt));
- BSWAP_TMPQSHUNT(ha->pShunt);
-
- // Set the MPQ pos and repeat the search
- MpqPos.QuadPart = SearchPos.QuadPart + ha->pShunt->dwHeaderPos;
- continue;
- }
- }
-
- // There must be MPQ header signature
- if(dwHeaderID == ID_MPQ)
- {
- BSWAP_TMPQHEADER(ha->pHeader);
-
- // Save the position where the MPQ header has been found
- ha->MpqPos = MpqPos;
-
- // If valid signature has been found, break the loop
- if(ha->pHeader->wFormatVersion == MPQ_FORMAT_VERSION_1)
- {
- // W3M Map Protectors set some garbage value into the "dwHeaderSize"
- // field of MPQ header. This value is apparently ignored by Storm.dll
- if(ha->pHeader->dwHeaderSize != sizeof(TMPQHeader))
- {
- ha->dwFlags |= MPQ_FLAG_PROTECTED;
- ha->pHeader->dwHeaderSize = sizeof(TMPQHeader);
- }
- break;
- }
-
- if(ha->pHeader->wFormatVersion == MPQ_FORMAT_VERSION_2)
- {
- // W3M Map Protectors set some garbage value into the "dwHeaderSize"
- // field of MPQ header. This value is apparently ignored by Storm.dll
- if(ha->pHeader->dwHeaderSize != sizeof(TMPQHeader2))
- {
- ha->dwFlags |= MPQ_FLAG_PROTECTED;
- ha->pHeader->dwHeaderSize = sizeof(TMPQHeader2);
- }
- break;
- }
-
- //
- // Note: the "dwArchiveSize" member in the MPQ header is ignored by Storm.dll
- // and can contain garbage value ("w3xmaster" protector)
- //
-
- nError = ERROR_NOT_SUPPORTED;
- break;
- }
-
- // Move to the next possible offset
- SearchPos.QuadPart += 0x200;
- MpqPos = SearchPos;
- }
- }
-
- // Relocate tables position
- if(nError == ERROR_SUCCESS)
- {
- // W3x Map Protectors use the fact that War3's StormLib ignores the file shunt,
- // and probably ignores the MPQ format version as well. The trick is to
- // fake MPQ format 2, with an improper hi-word position of hash table and block table
- // We can overcome such protectors by forcing opening the archive as MPQ v 1.0
- if(dwFlags & MPQ_OPEN_FORCE_MPQ_V1)
- {
- ha->pHeader->wFormatVersion = MPQ_FORMAT_VERSION_1;
- ha->pHeader->dwHeaderSize = sizeof(TMPQHeader);
- ha->pShunt = NULL;
- }
-
- // Clear the fields not supported in older formats
- if(ha->pHeader->wFormatVersion < MPQ_FORMAT_VERSION_2)
- {
- ha->pHeader->ExtBlockTablePos.QuadPart = 0;
- ha->pHeader->wBlockTablePosHigh = 0;
- ha->pHeader->wHashTablePosHigh = 0;
- }
-
- ha->dwBlockSize = (0x200 << ha->pHeader->wBlockSize);
- nError = RelocateMpqTablePositions(ha);
- }
-
- // Allocate buffers
- if(nError == ERROR_SUCCESS)
- {
- //
- // Note that the block table should be as large as the hash table
- // (For later file additions).
- //
- // I have found a MPQ which has the block table larger than
- // the hash table. We should avoid buffer overruns caused by that.
- //
-
- if(ha->pHeader->dwBlockTableSize > ha->pHeader->dwHashTableSize)
- ha->pHeader->dwBlockTableSize = ha->pHeader->dwHashTableSize;
- dwBlockTableSize = ha->pHeader->dwHashTableSize;
-
- ha->pHashTable = ALLOCMEM(TMPQHash, ha->pHeader->dwHashTableSize);
- ha->pBlockTable = ALLOCMEM(TMPQBlock, dwBlockTableSize);
- ha->pExtBlockTable = ALLOCMEM(TMPQBlockEx, dwBlockTableSize);
- ha->pbBlockBuffer = ALLOCMEM(BYTE, ha->dwBlockSize);
-
- if(!ha->pHashTable || !ha->pBlockTable || !ha->pExtBlockTable || !ha->pbBlockBuffer)
- nError = ERROR_NOT_ENOUGH_MEMORY;
- }
-
- // Read the hash table into memory
- if(nError == ERROR_SUCCESS)
- {
- dwBytes = ha->pHeader->dwHashTableSize * sizeof(TMPQHash);
- SetFilePointer(ha->hFile, ha->HashTablePos.LowPart, &ha->HashTablePos.HighPart, FILE_BEGIN);
- ReadFile(ha->hFile, ha->pHashTable, dwBytes, &dwTransferred, NULL);
-
- if(dwTransferred != dwBytes)
- nError = ERROR_FILE_CORRUPT;
- }
-
- // Decrypt hash table and check if it is correctly decrypted
- if(nError == ERROR_SUCCESS)
- {
-// TMPQHash * pHashEnd = ha->pHashTable + ha->pHeader->dwHashTableSize;
-// TMPQHash * pHash;
-
- // We have to convert the hash table from LittleEndian
- BSWAP_ARRAY32_UNSIGNED((DWORD *)ha->pHashTable, (dwBytes / sizeof(DWORD)));
- DecryptHashTable((DWORD *)ha->pHashTable, (BYTE *)"(hash table)", (ha->pHeader->dwHashTableSize * 4));
-
- //
- // Check hash table if is correctly decrypted
- //
- // Ladik: Some MPQ protectors corrupt the hash table by rewriting part of it.
- // To be able to open these, we will not check the entire hash table,
- // but will check it at the moment of file opening.
- //
- }
-
- // Now, read the block table
- if(nError == ERROR_SUCCESS)
- {
- memset(ha->pBlockTable, 0, dwBlockTableSize * sizeof(TMPQBlock));
-
- // Carefully check the block table size
- dwBytes = ha->pHeader->dwBlockTableSize * sizeof(TMPQBlock);
- SetFilePointer(ha->hFile, ha->BlockTablePos.LowPart, &ha->BlockTablePos.HighPart, FILE_BEGIN);
- ReadFile(ha->hFile, ha->pBlockTable, dwBytes, &dwTransferred, NULL);
-
- // I have found a MPQ which claimed 0x200 entries in the block table,
- // but the file was cut and there was only 0x1A0 entries.
- // We will handle this case properly, even if that means
- // omiting another integrity check of the MPQ
- if(dwTransferred < dwBytes)
- dwBytes = dwTransferred;
- BSWAP_ARRAY32_UNSIGNED((DWORD *)ha->pBlockTable, dwBytes / sizeof(DWORD));
-
- // If nothing was read, we assume the file is corrupt.
- if(dwTransferred == 0)
- nError = ERROR_FILE_CORRUPT;
- }
-
- // Decrypt block table.
- // Some MPQs don't have the block table decrypted, e.g. cracked Diablo version
- // We have to check if block table is really encrypted
- if(nError == ERROR_SUCCESS)
- {
- TMPQBlock * pBlockEnd = ha->pBlockTable + (dwBytes / sizeof(TMPQBlock));
- TMPQBlock * pBlock = ha->pBlockTable;
- BOOL bBlockTableEncrypted = FALSE;
-
- // Verify all blocks entries in the table
- // The loop usually stops at the first entry
- while(pBlock < pBlockEnd)
- {
- // The lower 8 bits of the MPQ flags are always zero.
- // Note that this may change in next MPQ versions
- if(pBlock->dwFlags & 0x000000FF)
- {
- bBlockTableEncrypted = TRUE;
- break;
- }
-
- // Move to the next block table entry
- pBlock++;
- }
-
- if(bBlockTableEncrypted)
- {
- DecryptBlockTable((DWORD *)ha->pBlockTable,
- (BYTE *)"(block table)",
- (dwBytes / sizeof(DWORD)));
- }
- }
-
- // Now, read the extended block table.
- // For V1 archives, we still will maintain the extended block table
- // (it will be filled with zeros)
- if(nError == ERROR_SUCCESS)
- {
- memset(ha->pExtBlockTable, 0, dwBlockTableSize * sizeof(TMPQBlockEx));
-
- if(ha->pHeader->ExtBlockTablePos.QuadPart != 0)
- {
- dwBytes = ha->pHeader->dwBlockTableSize * sizeof(TMPQBlockEx);
- SetFilePointer(ha->hFile,
- ha->ExtBlockTablePos.LowPart,
- &ha->ExtBlockTablePos.HighPart,
- FILE_BEGIN);
- ReadFile(ha->hFile, ha->pExtBlockTable, dwBytes, &dwTransferred, NULL);
-
- // We have to convert every DWORD in ha->block from LittleEndian
- BSWAP_ARRAY16_UNSIGNED((USHORT *)ha->pExtBlockTable, dwBytes / sizeof(USHORT));
-
- // The extended block table is not encrypted (so far)
- if(dwTransferred != dwBytes)
- nError = ERROR_FILE_CORRUPT;
- }
- }
-
- // Verify both block tables (If the MPQ file is not protected)
- if(nError == ERROR_SUCCESS && (ha->dwFlags & MPQ_FLAG_PROTECTED) == 0)
- {
- TMPQBlockEx * pBlockEx = ha->pExtBlockTable;
- TMPQBlock * pBlockEnd = ha->pBlockTable + dwMaxBlockIndex + 1;
- TMPQBlock * pBlock = ha->pBlockTable;
-
- // If the MPQ file is not protected,
- // we will check if all sizes in the block table is correct.
- // Note that we will not relocate the block table (change from previous versions)
- for(; pBlock < pBlockEnd; pBlock++, pBlockEx++)
- {
- if(pBlock->dwFlags & MPQ_FILE_EXISTS)
- {
- // Get the 64-bit file position
- TempPos.HighPart = pBlockEx->wFilePosHigh;
- TempPos.LowPart = pBlock->dwFilePos;
-
- if(TempPos.QuadPart > ha->MpqSize.QuadPart || pBlock->dwCSize > ha->MpqSize.QuadPart)
- {
- nError = ERROR_BAD_FORMAT;
- break;
- }
- }
- }
- }
-
- // If the caller didn't specified otherwise,
- // include the internal listfile to the TMPQArchive structure
- if(nError == ERROR_SUCCESS)
- {
- if((dwFlags & MPQ_OPEN_NO_LISTFILE) == 0)
- {
- if(nError == ERROR_SUCCESS)
- SListFileCreateListFile(ha);
-
- // Add the internal listfile
- if(nError == ERROR_SUCCESS)
- SFileAddListFile((HANDLE)ha, NULL);
- }
- }
-
- // If the caller didn't specified otherwise,
- // load the "(attributes)" file
- if(nError == ERROR_SUCCESS && (dwFlags & MPQ_OPEN_NO_ATTRIBUTES) == 0)
- {
- // Ignore the result here. Attrobutes are not necessary,
- // if they are not there, we will just ignore them
- SAttrFileLoad(ha);
- }
-
- // Cleanup and exit
- if(nError != ERROR_SUCCESS)
- {
- FreeMPQArchive(ha);
- if(hFile != INVALID_HANDLE_VALUE)
- CloseHandle(hFile);
- SetLastError(nError);
- ha = NULL;
- }
- else
- {
- if(pFirstOpen == NULL)
- pFirstOpen = ha;
- }
- *phMPQ = ha;
- return (nError == ERROR_SUCCESS);
-}
-
-BOOL WINAPI SFileOpenArchive(const char * szMpqName, DWORD dwPriority, DWORD dwFlags, HANDLE * phMPQ)
-{
- return SFileOpenArchiveEx(szMpqName, dwPriority, dwFlags, phMPQ, GENERIC_READ);
-}
-
-//-----------------------------------------------------------------------------
-// BOOL SFileFlushArchive(HANDLE hMpq)
-//
-// Saves all dirty data into MPQ archive.
-// Has similar effect like SFileCLoseArchive, but the archive is not closed.
-// Use on clients who keep MPQ archive open even for write operations,
-// and terminating without calling SFileCloseArchive might corrupt the archive.
-//
-
-BOOL WINAPI SFileFlushArchive(HANDLE hMpq)
-{
- TMPQArchive * ha = (TMPQArchive *)hMpq;
-
- // Do nothing if 'hMpq' is bad parameter
- if(!IsValidMpqHandle(ha))
- {
- SetLastError(ERROR_INVALID_PARAMETER);
- return FALSE;
- }
-
- // If the archive has been changed, update the changes
- // on the disk drive.
- if(ha->dwFlags & MPQ_FLAG_CHANGED)
- {
- SListFileSaveToMpq(ha);
- SAttrFileSaveToMpq(ha);
- SaveMPQTables(ha);
- ha->dwFlags &= ~MPQ_FLAG_CHANGED;
- }
-
- return TRUE;
-}
-
-//-----------------------------------------------------------------------------
-// BOOL SFileCloseArchive(HANDLE hMPQ);
-//
-
-BOOL WINAPI SFileCloseArchive(HANDLE hMPQ)
-{
- TMPQArchive * ha = (TMPQArchive *)hMPQ;
-
- // Flush all unsaved data to the storage
- if(!SFileFlushArchive(hMPQ))
- return FALSE;
-
- // Free all memory used by MPQ archive
- FreeMPQArchive(ha);
- return TRUE;
-}
-
diff --git a/src/dep/src/StormLib/SFileOpenFileEx.cpp b/src/dep/src/StormLib/SFileOpenFileEx.cpp
deleted file mode 100644
index 0c99189..0000000
--- a/src/dep/src/StormLib/SFileOpenFileEx.cpp
+++ /dev/null
@@ -1,453 +0,0 @@
-/*****************************************************************************/
-/* SFileOpenFileEx.cpp Copyright (c) Ladislav Zezula 2003 */
-/*---------------------------------------------------------------------------*/
-/* Description : */
-/*---------------------------------------------------------------------------*/
-/* Date Ver Who Comment */
-/* -------- ---- --- ------- */
-/* xx.xx.99 1.00 Lad The first version of SFileOpenFileEx.cpp */
-/*****************************************************************************/
-
-#define __STORMLIB_SELF__
-#include "StormLib.h"
-#include "SCommon.h"
-
-/*****************************************************************************/
-/* Local functions */
-/*****************************************************************************/
-
-static BOOL OpenLocalFile(const char * szFileName, HANDLE * phFile)
-{
- TMPQFile * hf = NULL;
- HANDLE hFile = CreateFile(szFileName, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL);
-
- if(hFile != INVALID_HANDLE_VALUE)
- {
- // Allocate and initialize file handle
- size_t nHandleSize = sizeof(TMPQFile) + strlen(szFileName);
- if((hf = (TMPQFile *)ALLOCMEM(char, nHandleSize)) != NULL)
- {
- memset(hf, 0, nHandleSize);
- strcpy(hf->szFileName, szFileName);
- hf->hFile = hFile;
- *phFile = hf;
- return TRUE;
- }
- else
- SetLastError(ERROR_NOT_ENOUGH_MEMORY);
- }
- *phFile = NULL;
- return FALSE;
-}
-
-void FreeMPQFile(TMPQFile *& hf)
-{
- if(hf != NULL)
- {
- if(hf->hFile != INVALID_HANDLE_VALUE)
- CloseHandle(hf->hFile);
- if(hf->pdwBlockPos != NULL)
- FREEMEM(hf->pdwBlockPos);
- if(hf->pbFileBuffer != NULL)
- FREEMEM(hf->pbFileBuffer);
- FREEMEM(hf);
- hf = NULL;
- }
-}
-
-/*****************************************************************************/
-/* Public functions */
-/*****************************************************************************/
-
-//-----------------------------------------------------------------------------
-// SFileEnumLocales enums all locale versions within MPQ.
-// Functions fills all available language identifiers on a file into the buffer
-// pointed by plcLocales. There must be enough entries to copy the localed,
-// otherwise the function returns ERROR_INSUFFICIENT_BUFFER.
-
-int WINAPI SFileEnumLocales(
- HANDLE hMPQ,
- const char * szFileName,
- LCID * plcLocales,
- DWORD * pdwMaxLocales,
- DWORD dwSearchScope)
-{
- TMPQArchive * ha = (TMPQArchive *)hMPQ;
- TMPQHash * pHash = NULL;
- TMPQHash * pHashEnd = NULL;
- DWORD dwLocales = 0;
- int nError = ERROR_SUCCESS;
-
- // Test the parameters
- if(nError == ERROR_SUCCESS)
- {
- if(!IsValidMpqHandle(ha) || pdwMaxLocales == NULL)
- nError = ERROR_INVALID_PARAMETER;
- if(dwSearchScope == SFILE_OPEN_BY_INDEX && (DWORD_PTR)szFileName > ha->pHeader->dwBlockTableSize)
- nError = ERROR_INVALID_PARAMETER;
- if(dwSearchScope != SFILE_OPEN_BY_INDEX && *szFileName == 0)
- nError = ERROR_INVALID_PARAMETER;
- }
-
- // Retrieve the hash entry for the required file
- if(nError == ERROR_SUCCESS)
- {
- pHashEnd = ha->pHashTable + ha->pHeader->dwHashTableSize;
-
- if(dwSearchScope == SFILE_OPEN_BY_INDEX)
- {
- for(pHash = ha->pHashTable; pHash < pHashEnd; pHash++)
- {
- if(pHash->dwBlockIndex == (DWORD_PTR)szFileName)
- break;
- }
- if(pHash == pHashEnd)
- pHash = NULL;
- }
- else
- pHash = GetHashEntry(ha, szFileName);
-
- // If the file was not found, sorry
- if(pHash == NULL)
- nError = ERROR_FILE_NOT_FOUND;
- }
-
- // Count the entries which correspond to the same file name
- if(nError == ERROR_SUCCESS)
- {
- TMPQHash * pStartHash = pHash;
- TMPQHash * pSaveHash = pHash;
- DWORD dwName1 = pHash->dwName1;
- DWORD dwName2 = pHash->dwName2;
- LCID PrevLocale = 0xFFFFFFFF;
-
- if(dwSearchScope != SFILE_OPEN_BY_INDEX)
- {
- while(pHash->dwBlockIndex != HASH_ENTRY_FREE)
- {
- if(pHash->dwName1 == dwName1 && pHash->dwName2 == dwName2 && pHash->dwBlockIndex != HASH_ENTRY_DELETED)
- {
- // If the locale is different from previous one, count it.
- if(pHash->lcLocale != PrevLocale)
- {
- PrevLocale = pHash->lcLocale;
- dwLocales++;
- }
- }
-
- // Move to the next hash
- if(++pHash >= pHashEnd)
- pHash = ha->pHashTable;
- if(pHash == pStartHash)
- break;
- }
- }
- else
- {
- // For nameless access, return 1 locale always
- dwLocales++;
- }
-
- // Restore the has pointer
- pHash = pSaveHash;
- }
-
- // Test if there is enough space to copy the locales
- if(nError == ERROR_SUCCESS)
- {
- DWORD dwMaxLocales = *pdwMaxLocales;
-
- *pdwMaxLocales = dwLocales;
- if(dwMaxLocales < dwLocales)
- nError = ERROR_INSUFFICIENT_BUFFER;
- }
-
- // Fill all present locales
- if(nError == ERROR_SUCCESS)
- {
- TMPQHash * pStartHash = pHash;
- DWORD dwName1 = pHash->dwName1;
- DWORD dwName2 = pHash->dwName2;
- LCID PrevLocale = 0xFFFFFFFF;
-
- if(dwSearchScope != SFILE_OPEN_BY_INDEX)
- {
- while(pHash->dwBlockIndex != HASH_ENTRY_FREE)
- {
- if(pHash->dwName1 == dwName1 && pHash->dwName2 == dwName2 && pHash->dwBlockIndex != HASH_ENTRY_DELETED)
- {
- // If the locale is different from previous one, count it.
- if(pHash->lcLocale != PrevLocale)
- {
- *plcLocales++ = (LCID)pHash->lcLocale;
- PrevLocale = pHash->lcLocale;
- }
- }
-
- // Move to the next hash
- if(++pHash >= pHashEnd)
- pHash = ha->pHashTable;
- if(pHash == pStartHash)
- break;
- }
- }
- else
- {
- // For nameless access, return 1 locale always
- *plcLocales++ = (LCID)pHash->lcLocale;
- }
- }
- return nError;
-}
-
-//-----------------------------------------------------------------------------
-// SFileHasFile
-//
-// hMPQ - Handle of opened MPQ archive
-// szFileName - Name of file to look for
-
-BOOL WINAPI SFileHasFile(HANDLE hMPQ, const char * szFileName)
-{
- TMPQArchive * ha = (TMPQArchive *)hMPQ;
- int nError = ERROR_SUCCESS;
-
- if(nError == ERROR_SUCCESS)
- {
- if(ha == NULL)
- nError = ERROR_INVALID_PARAMETER;
- if(*szFileName == 0)
- nError = ERROR_INVALID_PARAMETER;
- }
-
- // Prepare the file opening
- if(nError == ERROR_SUCCESS)
- {
- if(GetHashEntryEx(ha, szFileName, lcLocale) == NULL)
- {
- nError = ERROR_FILE_NOT_FOUND;
- }
- }
-
- // Cleanup
- if(nError != ERROR_SUCCESS)
- {
- SetLastError(nError);
- }
-
- return (nError == ERROR_SUCCESS);
-}
-
-
-//-----------------------------------------------------------------------------
-// SFileOpenFileEx
-//
-// hMPQ - Handle of opened MPQ archive
-// szFileName - Name of file to open
-// dwSearchScope - Where to search
-// phFile - Pointer to store opened file handle
-
-BOOL WINAPI SFileOpenFileEx(HANDLE hMPQ, const char * szFileName, DWORD dwSearchScope, HANDLE * phFile)
-{
- LARGE_INTEGER FilePos;
- TMPQArchive * ha = (TMPQArchive *)hMPQ;
- TMPQFile * hf = NULL;
- TMPQHash * pHash = NULL; // Hash table index
- TMPQBlock * pBlock = NULL; // File block
- TMPQBlockEx * pBlockEx = NULL;
- DWORD dwHashIndex = 0; // Hash table index
- DWORD dwBlockIndex = (DWORD)-1; // Found table index
- size_t nHandleSize = 0; // Memory space necessary to allocate TMPQHandle
- int nError = ERROR_SUCCESS;
-
-#ifdef _DEBUG
- // Due to increasing numbers of files in MPQs, I had to change the behavior
- // of opening by file index. Now, the SFILE_OPEN_BY_INDEX value of dwSearchScope
- // must be entered. This check will allow to find code places that are incompatible
- // with the new behavior.
- if(dwSearchScope != SFILE_OPEN_BY_INDEX && szFileName != NULL)
- {
- assert((DWORD_PTR)szFileName > 0x10000);
- }
-#endif
-
- if(nError == ERROR_SUCCESS)
- {
- if(ha == NULL && dwSearchScope == SFILE_OPEN_FROM_MPQ)
- nError = ERROR_INVALID_PARAMETER;
- if(phFile == NULL)
- nError = ERROR_INVALID_PARAMETER;
- if(dwSearchScope == SFILE_OPEN_BY_INDEX && (DWORD_PTR)szFileName > ha->pHeader->dwBlockTableSize)
- nError = ERROR_INVALID_PARAMETER;
- if(dwSearchScope != SFILE_OPEN_BY_INDEX && (szFileName == NULL || *szFileName == 0))
- nError = ERROR_INVALID_PARAMETER;
- }
-
- // Prepare the file opening
- if(nError == ERROR_SUCCESS)
- {
- // When the file is given by number, ...
- if(dwSearchScope == SFILE_OPEN_BY_INDEX)
- {
- TMPQHash * pHashEnd = ha->pHashTable + ha->pHeader->dwHashTableSize;
-
- // Set handle size to be sizeof(TMPQFile) + length of FileXXXXXXXX.xxx
- nHandleSize = sizeof(TMPQFile) + 20;
- for(pHash = ha->pHashTable; pHash < pHashEnd; pHash++)
- {
- if((DWORD_PTR)szFileName == pHash->dwBlockIndex)
- {
- dwHashIndex = (DWORD)(pHash - ha->pHashTable);
- dwBlockIndex = pHash->dwBlockIndex;
- break;
- }
- }
- }
- else
- {
- // If we have to open a disk file
- if(dwSearchScope == SFILE_OPEN_LOCAL_FILE)
- return OpenLocalFile(szFileName, phFile);
-
- nHandleSize = sizeof(TMPQFile) + strlen(szFileName);
- if((pHash = GetHashEntryEx(ha, szFileName, lcLocale)) != NULL)
- {
- dwHashIndex = (DWORD)(pHash - ha->pHashTable);
- dwBlockIndex = pHash->dwBlockIndex;
- }
- }
- }
-
- // Get block index from file name and test it
- if(nError == ERROR_SUCCESS)
- {
- // If index was not found, or is greater than number of files, exit.
- // This also covers the deleted files and free entries
- if(dwBlockIndex > ha->pHeader->dwBlockTableSize)
- nError = ERROR_FILE_NOT_FOUND;
- }
-
- // Get block and test if the file was not already deleted.
- if(nError == ERROR_SUCCESS)
- {
- // Get both block tables and file position
- pBlockEx = ha->pExtBlockTable + dwBlockIndex;
- pBlock = ha->pBlockTable + dwBlockIndex;
- FilePos.HighPart = pBlockEx->wFilePosHigh;
- FilePos.LowPart = pBlock->dwFilePos;
-
- if(FilePos.QuadPart > ha->MpqSize.QuadPart ||
- pBlock->dwCSize > ha->MpqSize.QuadPart)
- nError = ERROR_FILE_CORRUPT;
- if((pBlock->dwFlags & MPQ_FILE_EXISTS) == 0)
- nError = ERROR_FILE_NOT_FOUND;
- if(pBlock->dwFlags & ~MPQ_FILE_VALID_FLAGS)
- nError = ERROR_NOT_SUPPORTED;
- }
-
- // Allocate file handle
- if(nError == ERROR_SUCCESS)
- {
- if((hf = (TMPQFile *)ALLOCMEM(char, nHandleSize)) == NULL)
- nError = ERROR_NOT_ENOUGH_MEMORY;
- }
-
- // Initialize file handle
- if(nError == ERROR_SUCCESS)
- {
- memset(hf, 0, nHandleSize);
- hf->hFile = INVALID_HANDLE_VALUE;
- hf->ha = ha;
- hf->pBlockEx = pBlockEx;
- hf->pBlock = pBlock;
- hf->nBlocks = (hf->pBlock->dwFSize + ha->dwBlockSize - 1) / ha->dwBlockSize;
- hf->pHash = pHash;
-
- hf->MpqFilePos.HighPart = pBlockEx->wFilePosHigh;
- hf->MpqFilePos.LowPart = pBlock->dwFilePos;
- hf->RawFilePos.QuadPart = hf->MpqFilePos.QuadPart + ha->MpqPos.QuadPart;
-
- hf->dwHashIndex = dwHashIndex;
- hf->dwBlockIndex = dwBlockIndex;
-
- // Allocate buffers for decompression.
- if(hf->pBlock->dwFlags & MPQ_FILE_COMPRESSED)
- {
- // Allocate buffer for block positions. At the begin of file are stored
- // DWORDs holding positions of each block relative from begin of file in the archive
- // As for newer MPQs, there may be one additional entry in the block table
- // (if the MPQ_FILE_HAS_EXTRA flag is set).
- // Allocate the buffer to include this DWORD as well
-
- if((hf->pdwBlockPos = ALLOCMEM(DWORD, hf->nBlocks + 2)) == NULL)
- nError = ERROR_NOT_ENOUGH_MEMORY;
- }
-
- // Decrypt file seed. Cannot be used if the file is given by index
- if(dwSearchScope != SFILE_OPEN_BY_INDEX)
- {
- if(hf->pBlock->dwFlags & MPQ_FILE_ENCRYPTED)
- {
- const char * szTemp = strrchr(szFileName, '\\');
-
- strcpy(hf->szFileName, szFileName);
- if(szTemp != NULL)
- szFileName = szTemp + 1;
-
- hf->dwSeed1 = DecryptFileSeed((char *)szFileName);
- if(hf->pBlock->dwFlags & MPQ_FILE_FIXSEED)
- {
- hf->dwSeed1 = (hf->dwSeed1 + hf->pBlock->dwFilePos) ^ hf->pBlock->dwFSize;
- }
- }
- }
- else
- {
- // If the file is encrypted and not compressed, we cannot detect the file seed
- if(SFileGetFileName(hf, hf->szFileName) == FALSE)
- nError = GetLastError();
- }
- }
-
- // Resolve pointers to file's attributes
- if(nError == ERROR_SUCCESS && ha->pAttributes != NULL)
- {
- if(ha->pAttributes->pCrc32 != NULL)
- hf->pCrc32 = ha->pAttributes->pCrc32 + dwBlockIndex;
- if(ha->pAttributes->pFileTime != NULL)
- hf->pFileTime = ha->pAttributes->pFileTime + dwBlockIndex;
- if(ha->pAttributes->pMd5 != NULL)
- hf->pMd5 = ha->pAttributes->pMd5 + dwBlockIndex;
- }
-
- // Cleanup
- if(nError != ERROR_SUCCESS)
- {
- FreeMPQFile(hf);
- SetLastError(nError);
- }
-
- *phFile = hf;
- return (nError == ERROR_SUCCESS);
-}
-
-//-----------------------------------------------------------------------------
-// BOOL WINAPI SFileCloseFile(HANDLE hFile);
-
-BOOL WINAPI SFileCloseFile(HANDLE hFile)
-{
- TMPQFile * hf = (TMPQFile *)hFile;
-
- if(!IsValidFileHandle(hf))
- {
- SetLastError(ERROR_INVALID_PARAMETER);
- return FALSE;
- }
-
- // Set the last accessed file in the archive
- if(hf->ha != NULL)
- hf->ha->pLastFile = NULL;
-
- // Free the structure
- FreeMPQFile(hf);
- return TRUE;
-}
diff --git a/src/dep/src/StormLib/SFileReadFile.cpp b/src/dep/src/StormLib/SFileReadFile.cpp
deleted file mode 100644
index d77469c..0000000
--- a/src/dep/src/StormLib/SFileReadFile.cpp
+++ /dev/null
@@ -1,843 +0,0 @@
-/*****************************************************************************/
-/* SFileReadFile.cpp Copyright (c) Ladislav Zezula 2003 */
-/*---------------------------------------------------------------------------*/
-/* Description : */
-/*---------------------------------------------------------------------------*/
-/* Date Ver Who Comment */
-/* -------- ---- --- ------- */
-/* xx.xx.99 1.00 Lad The first version of SFileReadFile.cpp */
-/* 24.03.99 1.00 Lad Added the SFileGetFileInfo function */
-/*****************************************************************************/
-
-#define __STORMLIB_SELF__
-#include "StormLib.h"
-#include "SCommon.h"
-
-//-----------------------------------------------------------------------------
-// Defines
-
-#define ID_WAVE 0x46464952 // Signature of WAVes for name breaking
-#define ID_EXE 0x00005A4D // Signature of executable files
-
-//-----------------------------------------------------------------------------
-// Local structures
-
-struct TID2Ext
-{
- DWORD dwID;
- char * szExt;
-};
-
-//-----------------------------------------------------------------------------
-// ReadMPQBlock
-//
-// hf - MPQ File handle.
-// dwBlockPos - Position of block in the file (relative to file begin)
-// buffer - Pointer to target buffer to store blocks.
-// dwBlockSize - Number of bytes to read. Must be multiplier of block size.
-//
-// Returns number of bytes read.
-
-static DWORD WINAPI ReadMPQBlocks(TMPQFile * hf, DWORD dwBlockPos, BYTE * buffer, DWORD blockBytes)
-{
- LARGE_INTEGER FilePos;
- TMPQArchive * ha = hf->ha; // Archive handle
- BYTE * tempBuffer = NULL; // Buffer for reading compressed data from the file
- DWORD dwFilePos = dwBlockPos; // Reading position from the file
- DWORD dwToRead; // Number of bytes to read
- DWORD blockNum; // Block number (needed for decrypt)
- DWORD dwBytesRead = 0; // Total number of bytes read
- DWORD bytesRemain = 0; // Number of data bytes remaining up to the end of the file
- DWORD nBlocks; // Number of blocks to load
- DWORD i;
-
- // Test parameters. Block position and block size must be block-aligned, block size nonzero
- if((dwBlockPos & (ha->dwBlockSize - 1)) || blockBytes == 0)
- return 0;
-
- // Check the end of file
- if((dwBlockPos + blockBytes) > hf->pBlock->dwFSize)
- blockBytes = hf->pBlock->dwFSize - dwBlockPos;
-
- bytesRemain = hf->pBlock->dwFSize - dwBlockPos;
- blockNum = dwBlockPos / ha->dwBlockSize;
- nBlocks = blockBytes / ha->dwBlockSize;
- if(blockBytes % ha->dwBlockSize)
- nBlocks++;
-
- // If file has variable block positions, we have to load them
- if((hf->pBlock->dwFlags & MPQ_FILE_COMPRESSED) && hf->bBlockPosLoaded == FALSE)
- {
- // Move file pointer to the begin of the file in the MPQ
- SetFilePointer(ha->hFile, hf->RawFilePos.LowPart, &hf->RawFilePos.HighPart, FILE_BEGIN);
-
- // Read block positions from begin of file.
- dwToRead = (hf->nBlocks+1) * sizeof(DWORD);
- if(hf->pBlock->dwFlags & MPQ_FILE_HAS_EXTRA)
- dwToRead += sizeof(DWORD);
-
- // Read the block pos table and convert the buffer to little endian
- ReadFile(ha->hFile, hf->pdwBlockPos, dwToRead, &dwBytesRead, NULL);
- BSWAP_ARRAY32_UNSIGNED(hf->pdwBlockPos, (hf->nBlocks+1));
-
- //
- // If the archive if protected some way, perform additional check
- // Sometimes, the file appears not to be encrypted, but it is.
- //
- // Note: In WoW 1.10+, there's a new flag. With this flag present,
- // there's one additional entry in the block table.
- //
-
- if(hf->pdwBlockPos[0] != dwBytesRead)
- hf->pBlock->dwFlags |= MPQ_FILE_ENCRYPTED;
-
- // Decrypt loaded block positions if necessary
- if(hf->pBlock->dwFlags & MPQ_FILE_ENCRYPTED)
- {
- // If we don't know the file seed, try to find it.
- if(hf->dwSeed1 == 0)
- hf->dwSeed1 = DetectFileSeed(hf->pdwBlockPos, dwBytesRead);
-
- // If we don't know the file seed, sorry but we cannot extract the file.
- if(hf->dwSeed1 == 0)
- return 0;
-
- // Decrypt block positions
- DecryptMPQBlock(hf->pdwBlockPos, dwBytesRead, hf->dwSeed1 - 1);
-
- //
- // Check if the block positions are correctly decrypted
- // Previous versions of StormLib (up to 6.20) had bug in SFileRenameFile.
- // Incase the file name changed, Stormlib didn't re-crypt the file with changed seed,
- // so the file remained corrupt after the name change.
- //
- // I saw a protector who puts negative offset into the block table.
- // Because there are always at least 2 block positions, we can check their difference
- //
-
- if((hf->pdwBlockPos[1] - hf->pdwBlockPos[0]) > ha->dwBlockSize)
- {
- // Try once again to detect file seed and decrypt the blocks
- SetFilePointer(ha->hFile, hf->RawFilePos.LowPart, &hf->RawFilePos.HighPart, FILE_BEGIN);
- ReadFile(ha->hFile, hf->pdwBlockPos, dwToRead, &dwBytesRead, NULL);
-
- BSWAP_ARRAY32_UNSIGNED(hf->pdwBlockPos, (hf->nBlocks+1));
- hf->dwSeed1 = DetectFileSeed(hf->pdwBlockPos, dwBytesRead);
- DecryptMPQBlock(hf->pdwBlockPos, dwBytesRead, hf->dwSeed1 - 1);
-
- // Check if the block positions are correctly decrypted
- if(hf->pdwBlockPos[0] != dwBytesRead)
- return 0;
- }
- }
-
- // Update hf's variables
- hf->bBlockPosLoaded = TRUE;
- }
-
- // Get file position and number of bytes to read
- dwFilePos = dwBlockPos;
- dwToRead = blockBytes;
- if(hf->pBlock->dwFlags & MPQ_FILE_COMPRESSED)
- {
- dwFilePos = hf->pdwBlockPos[blockNum];
- dwToRead = hf->pdwBlockPos[blockNum + nBlocks] - dwFilePos;
- }
-
- // Warning: dwFilePos, obtained from the block table, might be negative.
- // Incase of format V1, we have to ignore the overflow.
- FilePos.QuadPart = hf->RawFilePos.QuadPart + dwFilePos;
- if((dwFilePos & 0x80000000) && ha->Header.wFormatVersion == MPQ_FORMAT_VERSION_1)
- FilePos.HighPart = 0;
-
- // Get work buffer for store read data
- tempBuffer = buffer;
- if(hf->pBlock->dwFlags & MPQ_FILE_COMPRESSED)
- {
- if((tempBuffer = ALLOCMEM(BYTE, dwToRead)) == NULL)
- {
- SetLastError(ERROR_NOT_ENOUGH_MEMORY);
- return 0;
- }
- }
-
- // Set file pointer, if necessary and read all required blocks
- SetFilePointer(ha->hFile, FilePos.LowPart, &FilePos.HighPart, FILE_BEGIN);
- ReadFile(ha->hFile, tempBuffer, dwToRead, &dwBytesRead, NULL);
-
- // Block processing part.
- DWORD blockStart = 0; // Index of block start in work buffer
- DWORD blockSize = STORMLIB_MIN(blockBytes, ha->dwBlockSize);
- DWORD index = blockNum; // Current block index
-
- dwBytesRead = 0; // Clear read byte counter
-
- // Walk through all blocks
- for(i = 0; i < nBlocks; i++, index++)
- {
- BYTE * inputBuffer = tempBuffer + blockStart;
- int outLength = ha->dwBlockSize;
-
- if(bytesRemain < (DWORD)outLength)
- outLength = bytesRemain;
-
- // Get current block length
- if(hf->pBlock->dwFlags & MPQ_FILE_COMPRESSED)
- blockSize = hf->pdwBlockPos[index+1] - hf->pdwBlockPos[index];
-
- // If block is encrypted, we have to decrypt it.
- if(hf->pBlock->dwFlags & MPQ_FILE_ENCRYPTED)
- {
- BSWAP_ARRAY32_UNSIGNED((DWORD *)inputBuffer, blockSize / sizeof(DWORD));
-
- // If we don't know the seed, try to decode it as WAVE file
- if(hf->dwSeed1 == 0)
- hf->dwSeed1 = DetectFileSeed2((DWORD *)inputBuffer, 3, ID_WAVE, hf->pBlock->dwFSize - 8, 0x45564157);
-
- // Let's try MSVC's standard EXE or header
- if(hf->dwSeed1 == 0)
- hf->dwSeed1 = DetectFileSeed2((DWORD *)inputBuffer, 2, 0x00905A4D, 0x00000003);
-
- if(hf->dwSeed1 == 0)
- {
- dwBytesRead = 0;
- break;
- }
-
- DecryptMPQBlock((DWORD *)inputBuffer, blockSize, hf->dwSeed1 + index);
- BSWAP_ARRAY32_UNSIGNED((DWORD *)inputBuffer, blockSize / sizeof(DWORD));
- }
-
- // If the block is really compressed, decompress it.
- // WARNING : Some block may not be compressed, it can be determined only
- // by comparing uncompressed and compressed size !!!
- if(blockSize < (DWORD)outLength)
- {
- // Is the file compressed with PKWARE Data Compression Library ?
- if(hf->pBlock->dwFlags & MPQ_FILE_IMPLODE)
- Decompress_pklib((char *)buffer, &outLength, (char *)inputBuffer, (int)blockSize);
-
- // Is it a file compressed by Blizzard's multiple compression ?
- // Note that Storm.dll v 1.0.9 distributed with Warcraft III
- // passes the full path name of the opened archive as the new last parameter
- if(hf->pBlock->dwFlags & MPQ_FILE_COMPRESS)
- {
- if(!SCompDecompress((char *)buffer, &outLength, (char *)inputBuffer, (int)blockSize))
- {
- dwBytesRead = 0;
- break;
- }
- }
-
- dwBytesRead += outLength;
- buffer += outLength;
- }
- else
- {
- if(buffer != inputBuffer)
- memcpy(buffer, inputBuffer, blockSize);
-
- dwBytesRead += blockSize;
- buffer += blockSize;
- }
- blockStart += blockSize;
- bytesRemain -= outLength;
- }
-
- // Delete input buffer, if necessary
- if(hf->pBlock->dwFlags & MPQ_FILE_COMPRESSED)
- FREEMEM(tempBuffer);
-
- return dwBytesRead;
-}
-
-// When this function is called, it is already ensured that the parameters are valid
-// (e.g. the "dwToRead + dwFilePos" is not greater than the file size)
-static DWORD WINAPI ReadMPQFileSingleUnit(TMPQFile * hf, DWORD dwFilePos, BYTE * pbBuffer, DWORD dwToRead)
-{
- TMPQArchive * ha = hf->ha;
- DWORD dwBytesRead = 0;
-
- // If the file is really compressed, decompress it.
- // Otherwise, read the data as-is to the caller.
- if(hf->pBlock->dwCSize < hf->pBlock->dwFSize)
- {
- if(hf->pbFileBuffer == NULL)
- {
- BYTE * inputBuffer = NULL;
- int outputBufferSize = (int)hf->pBlock->dwFSize;
- int inputBufferSize = (int)hf->pBlock->dwCSize;
-
- // Allocate buffer in the hf
- hf->pbFileBuffer = ALLOCMEM(BYTE, outputBufferSize);
- if(hf->pbFileBuffer == NULL)
- return (DWORD)-1;
-
- // Allocate temporary buffer for reading the file
- inputBuffer = ALLOCMEM(BYTE, inputBufferSize);
- if(inputBuffer != NULL)
- {
- // Move file pointer to the begin of the file, move to inner, modified by PeakGao,2008.10.28
- SetFilePointer(ha->hFile, hf->RawFilePos.LowPart, &hf->RawFilePos.HighPart, FILE_BEGIN);
-
- // Read the compressed file data
- ReadFile(ha->hFile, inputBuffer, inputBufferSize, &dwBytesRead, NULL);
-
- // Is the file compressed with PKWARE Data Compression Library ?
- if(hf->pBlock->dwFlags & MPQ_FILE_IMPLODE)
- Decompress_pklib((char *)hf->pbFileBuffer, &outputBufferSize, (char *)inputBuffer, (int)inputBufferSize);
-
- // Is it a file compressed by Blizzard's multiple compression ?
- // Note that Storm.dll v 1.0.9 distributed with Warcraft III
- // passes the full path name of the opened archive as the new last parameter
- if(hf->pBlock->dwFlags & MPQ_FILE_COMPRESS)
- SCompDecompress((char *)hf->pbFileBuffer, &outputBufferSize, (char *)inputBuffer, (int)inputBufferSize);
-
- // Free the temporary input buffer
- FREEMEM(inputBuffer);
-
- // If the decompression failed, don't continue
- if(outputBufferSize == 0)
- {
- FREEMEM(hf->pbFileBuffer);
- hf->pbFileBuffer = NULL;
- return (DWORD)-1;
- }
- }
- }
-
- // Copy the file data, if any there
- if(hf->pbFileBuffer != NULL)
- {
- memcpy(pbBuffer, hf->pbFileBuffer + dwFilePos, dwToRead);
- dwBytesRead = dwToRead;
- }
- }
- else
- {
- LARGE_INTEGER RawFilePos = hf->RawFilePos;
-
- // Move file pointer to the dwFilePos of the file, added by PeakGao, 2008.10.28
- RawFilePos.QuadPart += dwFilePos;
- SetFilePointer(ha->hFile, RawFilePos.LowPart, &RawFilePos.HighPart, FILE_BEGIN);
-
- // Read the uncompressed file data
- ReadFile(ha->hFile, pbBuffer, dwToRead, &dwBytesRead, NULL);
- }
-
- return dwBytesRead;
-}
-
-
-//-----------------------------------------------------------------------------
-// ReadMPQFile
-
-static DWORD WINAPI ReadMPQFile(TMPQFile * hf, DWORD dwFilePos, BYTE * pbBuffer, DWORD dwToRead)
-{
- TMPQArchive * ha = hf->ha;
- TMPQBlock * pBlock = hf->pBlock; // Pointer to file block
- DWORD dwBytesRead = 0; // Number of bytes read from the file
- DWORD dwBlockPos; // Position in the file aligned to the whole blocks
- DWORD dwLoaded;
-
- // File position is greater or equal to file size ?
- if(dwFilePos >= pBlock->dwFSize)
- return dwBytesRead;
-
- // If too few bytes in the file remaining, cut them
- if((pBlock->dwFSize - dwFilePos) < dwToRead)
- dwToRead = (pBlock->dwFSize - dwFilePos);
-
- // If the file is stored as single unit, handle it separately
- if(pBlock->dwFlags & MPQ_FILE_SINGLE_UNIT)
- return ReadMPQFileSingleUnit(hf, dwFilePos, pbBuffer, dwToRead);
-
- // Block position in the file
- dwBlockPos = dwFilePos & ~(ha->dwBlockSize - 1); // Position in the block
-
- // Load the first block, if incomplete. It may be loaded in the cache buffer.
- // We have to check if this block is loaded. If not, load it.
- if((dwFilePos % ha->dwBlockSize) != 0)
- {
- // Number of bytes remaining in the buffer
- DWORD dwToCopy;
- DWORD dwLoaded = ha->dwBlockSize;
-
- // Check if data are loaded in the cache
- if(hf != ha->pLastFile || dwBlockPos != ha->dwBlockPos)
- {
- // Load one MPQ block into archive buffer
- dwLoaded = ReadMPQBlocks(hf, dwBlockPos, ha->pbBlockBuffer, ha->dwBlockSize);
- if(dwLoaded == 0)
- return (DWORD)-1;
-
- // Save lastly accessed file and block position for later use
- ha->pLastFile = hf;
- ha->dwBlockPos = dwBlockPos;
- ha->dwBuffPos = dwFilePos % ha->dwBlockSize;
- }
- dwToCopy = dwLoaded - ha->dwBuffPos;
- if(dwToCopy > dwToRead)
- dwToCopy = dwToRead;
-
- // Copy data from block buffer into target buffer
- memcpy(pbBuffer, ha->pbBlockBuffer + ha->dwBuffPos, dwToCopy);
-
- // Update pointers
- dwToRead -= dwToCopy;
- dwBytesRead += dwToCopy;
- pbBuffer += dwToCopy;
- dwBlockPos += ha->dwBlockSize;
- ha->dwBuffPos += dwToCopy;
-
- // If all, return.
- if(dwToRead == 0)
- return dwBytesRead;
- }
-
- // Load the whole ("middle") blocks only if there are more or equal one block
- if(dwToRead > ha->dwBlockSize)
- {
- DWORD dwBlockBytes = dwToRead & ~(ha->dwBlockSize - 1);
-
- dwLoaded = ReadMPQBlocks(hf, dwBlockPos, pbBuffer, dwBlockBytes);
- if(dwLoaded == 0)
- return (DWORD)-1;
-
- // Update pointers
- dwToRead -= dwLoaded;
- dwBytesRead += dwLoaded;
- pbBuffer += dwLoaded;
- dwBlockPos += dwLoaded;
-
- // If all, return.
- if(dwToRead == 0)
- return dwBytesRead;
- }
-
- // Load the terminating block
- if(dwToRead > 0)
- {
- DWORD dwToCopy = ha->dwBlockSize;
-
- // Check if data are loaded in the cache
- if(hf != ha->pLastFile || dwBlockPos != ha->dwBlockPos)
- {
- // Load one MPQ block into archive buffer
- dwToCopy = ReadMPQBlocks(hf, dwBlockPos, ha->pbBlockBuffer, ha->dwBlockSize);
- if(dwToCopy == 0)
- return (DWORD)-1;
-
- // Save lastly accessed file and block position for later use
- ha->pLastFile = hf;
- ha->dwBlockPos = dwBlockPos;
- }
- ha->dwBuffPos = 0;
-
- // Check number of bytes read
- if(dwToCopy > dwToRead)
- dwToCopy = dwToRead;
-
- memcpy(pbBuffer, ha->pbBlockBuffer, dwToCopy);
- dwBytesRead += dwToCopy;
- ha->dwBuffPos = dwToCopy;
- }
-
- // Return what we've read
- return dwBytesRead;
-}
-
-//-----------------------------------------------------------------------------
-// SFileReadFile
-
-BOOL WINAPI SFileReadFile(HANDLE hFile, VOID * lpBuffer, DWORD dwToRead, DWORD * pdwRead, LPOVERLAPPED lpOverlapped)
-{
- TMPQFile * hf = (TMPQFile *)hFile;
- DWORD dwBytes = 0; // Number of bytes (for everything)
- int nError = ERROR_SUCCESS;
-
- // Zero the number of bytes read
- if(pdwRead != NULL)
- *pdwRead = 0;
-
- // Check valid parameters
- if(nError == ERROR_SUCCESS)
- {
- if(hf == NULL || lpBuffer == NULL)
- nError = ERROR_INVALID_PARAMETER;
- }
-
- // If direct access to the file, use Win32 for reading
- if(nError == ERROR_SUCCESS && hf->hFile != INVALID_HANDLE_VALUE)
- {
- DWORD dwTransferred;
-
- ReadFile(hf->hFile, lpBuffer, dwToRead, &dwTransferred, lpOverlapped);
- if(dwTransferred < dwToRead)
- {
- SetLastError(ERROR_HANDLE_EOF);
- return FALSE;
- }
-
- if(pdwRead != NULL)
- *pdwRead = dwTransferred;
- return TRUE;
- }
-
- // Read all the bytes available in the buffer (If any)
- if(nError == ERROR_SUCCESS)
- {
- if(dwToRead > 0)
- {
- dwBytes = ReadMPQFile(hf, hf->dwFilePos, (BYTE *)lpBuffer, dwToRead);
- if(dwBytes == (DWORD)-1)
- {
- SetLastError(ERROR_CAN_NOT_COMPLETE);
- return FALSE;
- }
- hf->ha->pLastFile = hf;
- hf->dwFilePos += dwBytes;
- }
- if(pdwRead != NULL)
- *pdwRead = dwBytes;
- }
-
- // Check number of bytes read. If not OK, return FALSE.
- if(dwBytes < dwToRead)
- {
- SetLastError(ERROR_HANDLE_EOF);
- return FALSE;
- }
- return TRUE;
-}
-
-//-----------------------------------------------------------------------------
-// SFileGetFilePos
-//
-// Returns position of archive file in the archive (relative to begin of file)
-
-DWORD WINAPI SFileGetFilePos(HANDLE hFile, DWORD * pdwFilePosHigh)
-{
- TMPQFile * hf = (TMPQFile *)hFile;
-
- if(pdwFilePosHigh != NULL)
- *pdwFilePosHigh = 0;
-
- if(hf == NULL)
- {
- SetLastError(ERROR_INVALID_PARAMETER);
- return (DWORD)-1;
- }
-
- // If opened as plain file, ...
- if(hf->hFile != INVALID_HANDLE_VALUE)
- return 0;
-
- // If opened from archive, return file size
- if(pdwFilePosHigh != NULL)
- *pdwFilePosHigh = hf->RawFilePos.HighPart;
- return hf->RawFilePos.LowPart;
-}
-
-//-----------------------------------------------------------------------------
-// SFileGetFileSize
-
-DWORD WINAPI SFileGetFileSize(HANDLE hFile, DWORD * pdwFileSizeHigh)
-{
- TMPQFile * hf = (TMPQFile *)hFile;
-
- if(pdwFileSizeHigh != NULL)
- *pdwFileSizeHigh = 0;
-
- if(hf == NULL)
- {
- SetLastError(ERROR_INVALID_PARAMETER);
- return (DWORD)-1;
- }
-
- // If opened as plain file, ...
- if(hf->hFile != INVALID_HANDLE_VALUE)
- return GetFileSize(hf->hFile, pdwFileSizeHigh);
-
- // If opened from archive, return file size
- return hf->pBlock->dwFSize;
-}
-
-DWORD WINAPI SFileSetFilePointer(HANDLE hFile, LONG lFilePos, LONG * pdwFilePosHigh, DWORD dwMethod)
-{
- TMPQArchive * ha;
- TMPQFile * hf = (TMPQFile *)hFile;
-
- if(hf == NULL || (pdwFilePosHigh != NULL && *pdwFilePosHigh != 0))
- {
- SetLastError(ERROR_INVALID_PARAMETER);
- return (DWORD)-1;
- }
-
- // If opened as plain file, call Win32 API
- if(hf->hFile != INVALID_HANDLE_VALUE)
- return SetFilePointer(hf->hFile, lFilePos, pdwFilePosHigh, dwMethod);
- ha = hf->ha;
-
- switch(dwMethod)
- {
- case FILE_BEGIN:
- // Cannot set pointer before begin of file
- if(-lFilePos > (LONG)hf->dwFilePos)
- hf->dwFilePos = 0;
- else
- hf->dwFilePos = lFilePos;
- break;
-
- case FILE_CURRENT:
- // Cannot set pointer before begin of file
- if(-lFilePos > (LONG)hf->dwFilePos)
- hf->dwFilePos = 0;
- else
- hf->dwFilePos += lFilePos;
- break;
-
- case FILE_END:
- // Cannot set file position before begin of file
- if(-lFilePos >= (LONG)hf->pBlock->dwFSize)
- hf->dwFilePos = 0;
- else
- hf->dwFilePos = hf->pBlock->dwFSize + lFilePos;
- break;
-
- default:
- return ERROR_INVALID_PARAMETER;
- }
-
- if(hf == ha->pLastFile && (hf->dwFilePos & ~(ha->dwBlockSize - 1)) == ha->dwBlockPos)
- ha->dwBuffPos = hf->dwFilePos & (ha->dwBlockSize - 1);
- else
- {
- ha->pLastFile = NULL;
- ha->dwBuffPos = 0;
- }
-
- return hf->dwFilePos;
-}
-
-//-----------------------------------------------------------------------------
-// Tries to retrieve the file name
-
-static TID2Ext id2ext[] =
-{
- {0x1A51504D, "mpq"}, // MPQ archive header ID ('MPQ\x1A')
- {0x46464952, "wav"}, // WAVE header 'RIFF'
- {0x324B4D53, "smk"}, // Old "Smacker Video" files 'SMK2'
- {0x694B4942, "bik"}, // Bink video files (new)
- {0x0801050A, "pcx"}, // PCX images used in Diablo I
- {0x544E4F46, "fnt"}, // Font files used in Diablo II
- {0x6D74683C, "html"}, // HTML 'szFileName != 0)
- {
- if(szFileName != hf->szFileName)
- strcpy(szFileName, hf->szFileName);
- return TRUE;
- }
-
- if(nError == ERROR_SUCCESS)
- {
- if(hf->dwBlockIndex == (DWORD)-1)
- nError = ERROR_CAN_NOT_COMPLETE;
- }
-
- // Read the first 8 bytes from the file
- if(nError == ERROR_SUCCESS)
- {
- dwFirstBytes[0] = dwFirstBytes[1] = 0;
- dwFilePos = SFileSetFilePointer(hf, 0, NULL, FILE_CURRENT);
- SFileReadFile(hFile, &dwFirstBytes, sizeof(dwFirstBytes), NULL);
- BSWAP_ARRAY32_UNSIGNED(dwFirstBytes, sizeof(dwFirstBytes) / sizeof(DWORD));
- SFileSetFilePointer(hf, dwFilePos, NULL, FILE_BEGIN);
- }
-
- if(nError == ERROR_SUCCESS)
- {
- if((dwFirstBytes[0] & 0x0000FFFF) == ID_EXE)
- szExt = "exe";
- else if(dwFirstBytes[0] == 0x00000006 && dwFirstBytes[1] == 0x00000001)
- szExt = "dc6";
- else
- {
- for(i = 0; id2ext[i].szExt != NULL; i++)
- {
- if(id2ext[i].dwID == dwFirstBytes[0])
- {
- szExt = id2ext[i].szExt;
- break;
- }
- }
- }
-
- // Create the file name
- sprintf(hf->szFileName, "File%08lu.%s", hf->dwBlockIndex, szExt);
- if(szFileName != hf->szFileName)
- strcpy(szFileName, hf->szFileName);
- }
- return (nError == ERROR_SUCCESS);
-}
-
-//-----------------------------------------------------------------------------
-// Retrieves an information about an archive or about a file within the archive
-//
-// hMpqOrFile - Handle to an MPQ archive or to a file
-// dwInfoType - Information to obtain
-
-DWORD_PTR WINAPI SFileGetFileInfo(HANDLE hMpqOrFile, DWORD dwInfoType)
-{
- TMPQArchive * ha = (TMPQArchive *)hMpqOrFile;
- TMPQFile * hf = (TMPQFile *)hMpqOrFile;
- TMPQBlock * pBlockEnd;
- TMPQBlock * pBlock;
- DWORD dwFileCount = 0;
- DWORD dwSeed;
-
- switch(dwInfoType)
- {
- case SFILE_INFO_ARCHIVE_SIZE:
- if(IsValidMpqHandle(ha))
- return ha->pHeader->dwArchiveSize;
- break;
-
- case SFILE_INFO_HASH_TABLE_SIZE: // Size of the hash table
- if(IsValidMpqHandle(ha))
- return ha->pHeader->dwHashTableSize;
- break;
-
- case SFILE_INFO_BLOCK_TABLE_SIZE: // Size of the hash table
- if(IsValidMpqHandle(ha))
- return ha->pHeader->dwBlockTableSize;
- break;
-
- case SFILE_INFO_BLOCK_SIZE:
- if(IsValidMpqHandle(ha))
- return ha->dwBlockSize;
- break;
-
- case SFILE_INFO_HASH_TABLE:
- if(IsValidMpqHandle(ha))
- return (DWORD_PTR)ha->pHashTable;
- break;
-
- case SFILE_INFO_BLOCK_TABLE:
- if(IsValidMpqHandle(ha))
- return (DWORD_PTR)ha->pBlockTable;
- break;
-
- case SFILE_INFO_NUM_FILES:
- if(IsValidMpqHandle(ha))
- {
- pBlockEnd = ha->pBlockTable + ha->pHeader->dwBlockTableSize;
- for(pBlock = ha->pBlockTable; pBlock < pBlockEnd; pBlock++)
- {
- if(pBlock->dwFlags & MPQ_FILE_EXISTS)
- dwFileCount++;
- }
- return dwFileCount;
- }
- break;
-
- case SFILE_INFO_HASH_INDEX:
- if(IsValidFileHandle(hf))
- return hf->dwHashIndex;
- break;
-
- case SFILE_INFO_CODENAME1:
- if(IsValidFileHandle(hf))
- return hf->pHash->dwName1;
- break;
-
- case SFILE_INFO_CODENAME2:
- if(IsValidFileHandle(hf))
- return hf->pHash->dwName2;
- break;
-
- case SFILE_INFO_LOCALEID:
- if(IsValidFileHandle(hf))
- return hf->pHash->lcLocale;
- break;
-
- case SFILE_INFO_BLOCKINDEX:
- if(IsValidFileHandle(hf))
- return hf->dwBlockIndex;
- break;
-
- case SFILE_INFO_FILE_SIZE:
- if(IsValidFileHandle(hf))
- return hf->pBlock->dwFSize;
- break;
-
- case SFILE_INFO_COMPRESSED_SIZE:
- if(IsValidFileHandle(hf))
- return hf->pBlock->dwCSize;
- break;
-
- case SFILE_INFO_FLAGS:
- if(IsValidFileHandle(hf))
- return hf->pBlock->dwFlags;
- break;
-
- case SFILE_INFO_POSITION:
- if(IsValidFileHandle(hf))
- return hf->pBlock->dwFilePos;
- break;
-
- case SFILE_INFO_SEED:
- if(IsValidFileHandle(hf))
- return hf->dwSeed1;
- break;
-
- case SFILE_INFO_SEED_UNFIXED:
- if(IsValidFileHandle(hf))
- {
- dwSeed = hf->dwSeed1;
- if(hf->pBlock->dwFlags & MPQ_FILE_FIXSEED)
- dwSeed = (dwSeed ^ hf->pBlock->dwFSize) - hf->MpqFilePos.LowPart;
- return dwSeed;
- }
- break;
- }
-
- // Unknown parameter or invalid handle
- SetLastError(ERROR_INVALID_PARAMETER);
- return 0xFFFFFFFF;
-}
diff --git a/src/dep/src/StormLib/SListFile.cpp b/src/dep/src/StormLib/SListFile.cpp
deleted file mode 100644
index 3341ccd..0000000
--- a/src/dep/src/StormLib/SListFile.cpp
+++ /dev/null
@@ -1,612 +0,0 @@
-/*****************************************************************************/
-/* SListFile.cpp Copyright (c) Ladislav Zezula 2004 */
-/*---------------------------------------------------------------------------*/
-/* Description: */
-/*---------------------------------------------------------------------------*/
-/* Date Ver Who Comment */
-/* -------- ---- --- ------- */
-/* 12.06.04 1.00 Lad The first version of SListFile.cpp */
-/*****************************************************************************/
-
-#define __STORMLIB_SELF__
-#include "StormLib.h"
-#include "SCommon.h"
-#include
-
-//-----------------------------------------------------------------------------
-// Listfile entry structure
-
-#define LISTFILE_CACHE_SIZE 0x1000 // Size of one cache element
-#define NO_MORE_CHARACTERS 256
-#define HASH_TABLE_SIZE 31 // Initial hash table size (should be a prime number)
-
-struct TListFileCache
-{
- HANDLE hFile; // Stormlib file handle
- char * szMask; // File mask
- DWORD dwFileSize; // Total size of the cached file
- DWORD dwBuffSize; // File of the cache
- DWORD dwFilePos; // Position of the cache in the file
- BYTE * pBegin; // The begin of the listfile cache
- BYTE * pPos;
- BYTE * pEnd; // The last character in the file cache
-
- BYTE Buffer[1]; // Listfile cache itself
-};
-
-//-----------------------------------------------------------------------------
-// Local functions (cache)
-
-// Reloads the cache. Returns number of characters
-// that has been loaded into the cache.
-static int ReloadCache(TListFileCache * pCache)
-{
- // Check if there is enough characters in the cache
- // If not, we have to reload the next block
- if(pCache->pPos >= pCache->pEnd)
- {
- // If the cache is already at the end, do nothing more
- if((pCache->dwFilePos + pCache->dwBuffSize) >= pCache->dwFileSize)
- return 0;
-
- pCache->dwFilePos += pCache->dwBuffSize;
- SFileReadFile(pCache->hFile, pCache->Buffer, pCache->dwBuffSize, &pCache->dwBuffSize, NULL);
- if(pCache->dwBuffSize == 0)
- return 0;
-
- // Set the buffer pointers
- pCache->pBegin =
- pCache->pPos = &pCache->Buffer[0];
- pCache->pEnd = pCache->pBegin + pCache->dwBuffSize;
- }
-
- return pCache->dwBuffSize;
-}
-
-static size_t ReadLine(TListFileCache * pCache, char * szLine, int nMaxChars)
-{
- char * szLineBegin = szLine;
- char * szLineEnd = szLine + nMaxChars - 1;
-
-__BeginLoading:
-
- // Skip newlines, spaces, tabs and another non-printable stuff
- while(pCache->pPos < pCache->pEnd && *pCache->pPos <= 0x20)
- pCache->pPos++;
-
- // Copy the remaining characters
- while(pCache->pPos < pCache->pEnd && szLine < szLineEnd)
- {
- // If we have found a newline, stop loading
- if(*pCache->pPos == 0x0D || *pCache->pPos == 0x0A)
- break;
-
- *szLine++ = *pCache->pPos++;
- }
-
- // If we now need to reload the cache, do it
- if(pCache->pPos == pCache->pEnd)
- {
- if(ReloadCache(pCache) > 0)
- goto __BeginLoading;
- }
-
- *szLine = 0;
- return (szLine - szLineBegin);
-}
-
-//-----------------------------------------------------------------------------
-// Local functions (listfile nodes)
-
-// This function creates the name for the listfile.
-// the file will be created under unique name in the temporary directory
-static void GetListFileName(TMPQArchive * /* ha */, char * szListFile)
-{
- char szTemp[MAX_PATH];
-
- // Create temporary file name int TEMP directory
- GetTempPath(sizeof(szTemp)-1, szTemp);
- GetTempFileName(szTemp, LISTFILE_NAME, 0, szListFile);
-}
-
-// Creates new listfile. The listfile is an array of TListFileNode
-// structures. The size of the array is the same like the hash table size,
-// the ordering is the same too (listfile item index is the same like
-// the index in the MPQ hash table)
-
-int SListFileCreateListFile(TMPQArchive * ha)
-{
- DWORD dwItems = ha->pHeader->dwHashTableSize;
-
- // The listfile should be NULL now
- assert(ha->pListFile == NULL);
-
- ha->pListFile = ALLOCMEM(TFileNode *, dwItems);
- if(ha->pListFile == NULL)
- return ERROR_NOT_ENOUGH_MEMORY;
-
- memset(ha->pListFile, 0xFF, dwItems * sizeof(TFileNode *));
- return ERROR_SUCCESS;
-}
-
-// Adds a name into the list of all names. For each locale in the MPQ,
-// one entry will be created
-// If the file name is already there, does nothing.
-int SListFileCreateNodeForAllLocales(TMPQArchive * ha, const char * szFileName)
-{
- TFileNode * pNode = NULL;
- TMPQHash * pHashEnd = ha->pHashTable + ha->pHeader->dwHashTableSize;
- TMPQHash * pHash0 = GetHashEntry(ha, szFileName);
- TMPQHash * pHash = pHash0;
- DWORD dwHashIndex = 0;
- size_t nLength; // File name lentgth
- DWORD dwName1;
- DWORD dwName2;
-
- // If the file does not exist within the MPQ, do nothing
- if(pHash == NULL)
- return ERROR_SUCCESS;
-
- // Remember the name
- dwName1 = pHash->dwName1;
- dwName2 = pHash->dwName2;
-
- // Pass all entries in the hash table
- while(pHash->dwBlockIndex != HASH_ENTRY_FREE)
- {
- // There may be an entry deleted amongst various language versions
- if(pHash->dwBlockIndex != HASH_ENTRY_DELETED)
- {
- if(pHash->dwName1 == dwName1 && pHash->dwName2 == dwName2)
- {
- // Compute the hash index
- dwHashIndex = (DWORD)(pHash - ha->pHashTable);
-
- // Create the lang version, if none
- if((DWORD_PTR)ha->pListFile[dwHashIndex] >= LISTFILE_ENTRY_DELETED)
- {
- // Create the listfile node, if doesn't exist yet
- if(pNode == NULL)
- {
- nLength = strlen(szFileName);
- pNode = (TFileNode *)ALLOCMEM(char, sizeof(TFileNode) + nLength);
- pNode->dwRefCount = 0;
- pNode->nLength = nLength;
- strcpy(pNode->szFileName, szFileName);
- }
-
- // Insert the node to the listfile table
- ha->pListFile[dwHashIndex] = pNode;
- pNode->dwRefCount++;
- }
- }
- }
- else
- {
- dwHashIndex = (DWORD)(pHash - ha->pHashTable);
- ha->pListFile[dwHashIndex] = (TFileNode *)LISTFILE_ENTRY_DELETED;
- }
-
- // Move to the next hash entry
- if(++pHash >= pHashEnd)
- pHash = ha->pHashTable;
- if(pHash == pHash0)
- break;
- }
- return ERROR_SUCCESS;
-}
-
-// Adds a filename into the listfile. If the file name is already there,
-// does nothing.
-int SListFileCreateNode(TMPQArchive * ha, const char * szFileName, LCID lcLocale)
-{
- TFileNode * pNode = NULL;
- TMPQHash * pHash0 = GetHashEntry(ha, szFileName);
- TMPQHash * pHash1 = GetHashEntryEx(ha, szFileName, lcLocale);
- DWORD dwHashIndex0 = 0;
- DWORD dwHashIndex1 = 0;
- size_t nLength; // File name lentgth
-
- // If the file does not exist within the MPQ, do nothing
- if(pHash1 == NULL || pHash1->dwBlockIndex >= HASH_ENTRY_DELETED)
- return ERROR_SUCCESS;
-
- // If the locale-cpecific listfile entry already exists, do nothing
- dwHashIndex0 = (DWORD)(pHash0 - ha->pHashTable);
- dwHashIndex1 = (DWORD)(pHash1 - ha->pHashTable);
- if((DWORD_PTR)ha->pListFile[dwHashIndex1] < LISTFILE_ENTRY_DELETED)
- return ERROR_SUCCESS;
-
- // Does the neutral table entry exist ?
- if((DWORD_PTR)ha->pListFile[dwHashIndex0] < LISTFILE_ENTRY_DELETED)
- pNode = ha->pListFile[dwHashIndex0];
-
- // If no node yet, we have to create new one
- if(pNode == NULL)
- {
- nLength = strlen(szFileName);
- pNode = (TFileNode *)ALLOCMEM(char, sizeof(TFileNode) + nLength);
- pNode->dwRefCount = 1;
- pNode->nLength = nLength;
- strcpy(pNode->szFileName, szFileName);
- ha->pListFile[dwHashIndex0] = pNode;
- }
-
- // Also insert the node in the locale-specific entry
- if(dwHashIndex1 != dwHashIndex0)
- {
- pNode->dwRefCount++;
- ha->pListFile[dwHashIndex1] = pNode;
- }
-
- return ERROR_SUCCESS;
-}
-
-// Removes a filename from the listfile.
-// If the name is not there, does nothing
-int SListFileRemoveNode(TMPQArchive * ha, const char * szFileName, LCID lcLocale)
-{
- TFileNode * pNode = NULL;
- TMPQHash * pHash = GetHashEntryEx(ha, szFileName, lcLocale);
- size_t nHashIndex = 0;
-
- if(pHash != NULL)
- {
- nHashIndex = pHash - ha->pHashTable;
- pNode = ha->pListFile[nHashIndex];
- ha->pListFile[nHashIndex] = (TFileNode *)LISTFILE_ENTRY_DELETED;
-
- // Free the node
- pNode->dwRefCount--;
- if(pNode->dwRefCount == 0)
- FREEMEM(pNode);
- }
- return ERROR_SUCCESS;
-}
-
-void SListFileFreeListFile(TMPQArchive * ha)
-{
- if(ha->pListFile != NULL)
- {
- for(DWORD i = 0; i < ha->pHeader->dwHashTableSize; i++)
- {
- TFileNode * pNode = ha->pListFile[i];
-
- if((DWORD_PTR)pNode < LISTFILE_ENTRY_DELETED)
- {
- ha->pListFile[i] = (TFileNode *)LISTFILE_ENTRY_FREE;
- pNode->dwRefCount--;
-
- if(pNode->dwRefCount == 0)
- FREEMEM(pNode);
- }
- }
-
- FREEMEM(ha->pListFile);
- ha->pListFile = NULL;
- }
-}
-
-// Saves the whole listfile into the MPQ.
-int SListFileSaveToMpq(TMPQArchive * ha)
-{
- TFileNode * pNode = NULL;
- TMPQHash * pHashEnd = NULL;
- TMPQHash * pHash0 = NULL;
- TMPQHash * pHash = NULL;
- HANDLE hFile = INVALID_HANDLE_VALUE;
- char szListFile[MAX_PATH];
- char szBuffer[MAX_PATH+4];
- DWORD dwTransferred;
- size_t nLength = 0;
- DWORD dwName1 = 0;
- DWORD dwName2 = 0;
- LCID lcSave = lcLocale;
- int nError = ERROR_SUCCESS;
-
- // If no listfile, do nothing
- if(ha->pListFile == NULL)
- return ERROR_SUCCESS;
-
- // Create the local listfile
- if(nError == ERROR_SUCCESS)
- {
- GetListFileName(ha, szListFile);
- hFile = CreateFile(szListFile, GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, NULL);
- if(hFile == INVALID_HANDLE_VALUE)
- nError = GetLastError();
- }
-
- // Find the hash entry corresponding to listfile
- pHashEnd = ha->pHashTable + ha->pHeader->dwHashTableSize;
- pHash0 = pHash = GetHashEntry(ha, 0);
- if(pHash == NULL)
- pHash0 = pHash = ha->pHashTable;
-
- // Save the file
- if(nError == ERROR_SUCCESS)
- {
- for(;;)
- {
- if(pHash->dwName1 != dwName1 && pHash->dwName2 != dwName2 && pHash->dwBlockIndex < HASH_ENTRY_DELETED)
- {
- dwName1 = pHash->dwName1;
- dwName2 = pHash->dwName2;
- pNode = ha->pListFile[pHash - ha->pHashTable];
-
- if((DWORD_PTR)pNode < LISTFILE_ENTRY_DELETED)
- {
- memcpy(szBuffer, pNode->szFileName, pNode->nLength);
- szBuffer[pNode->nLength + 0] = 0x0D;
- szBuffer[pNode->nLength + 1] = 0x0A;
- WriteFile(hFile, szBuffer, (DWORD)(pNode->nLength + 2), &dwTransferred, NULL);
- }
- }
-
- if(++pHash >= pHashEnd)
- pHash = ha->pHashTable;
- if(pHash == pHash0)
- break;
- }
-
- // Write the listfile name (if not already there)
- if(GetHashEntry(ha, LISTFILE_NAME) == NULL)
- {
- nLength = strlen(LISTFILE_NAME);
- memcpy(szBuffer, LISTFILE_NAME, nLength);
- szBuffer[nLength + 0] = 0x0D;
- szBuffer[nLength + 1] = 0x0A;
- WriteFile(hFile, szBuffer, (DWORD)(nLength + 2), &dwTransferred, NULL);
- }
-
- // Add the listfile into the archive.
- SFileSetLocale(LANG_NEUTRAL);
- nError = AddFileToArchive(ha,
- hFile,
- LISTFILE_NAME,
- MPQ_FILE_ENCRYPTED | MPQ_FILE_COMPRESS | MPQ_FILE_REPLACEEXISTING,
- 0,
- SFILE_TYPE_DATA,
- NULL);
- lcLocale = lcSave;
- }
-
- // Close the temporary file and delete it.
- // There is no FILE_FLAG_DELETE_ON_CLOSE on LINUX.
- if(hFile != INVALID_HANDLE_VALUE)
- CloseHandle(hFile);
- DeleteFile(szListFile);
-
- return nError;
-}
-
-//-----------------------------------------------------------------------------
-// File functions
-
-// Adds a listfile into the MPQ archive.
-// Note that the function does not remove the
-int WINAPI SFileAddListFile(HANDLE hMpq, const char * szListFile)
-{
- TListFileCache * pCache = NULL;
- TMPQArchive * ha = (TMPQArchive *)hMpq;
- HANDLE hListFile = NULL;
- char szFileName[MAX_PATH + 1];
- DWORD dwSearchScope = SFILE_OPEN_LOCAL_FILE;
- DWORD dwCacheSize = 0;
- DWORD dwFileSize = 0;
- size_t nLength = 0;
- int nError = ERROR_SUCCESS;
-
- // If the szListFile is NULL, it means we have to open internal listfile
- if(szListFile == NULL)
- {
- szListFile = LISTFILE_NAME;
- dwSearchScope = SFILE_OPEN_FROM_MPQ;
- }
-
- // Open the local/internal listfile
- if(nError == ERROR_SUCCESS)
- {
- if(!SFileOpenFileEx((HANDLE)ha, szListFile, dwSearchScope, &hListFile))
- nError = GetLastError();
- }
-
- if(nError == ERROR_SUCCESS)
- {
- dwCacheSize =
- dwFileSize = SFileGetFileSize(hListFile, NULL);
-
- // Try to allocate memory for the complete file. If it fails,
- // load the part of the file
- pCache = (TListFileCache *)ALLOCMEM(char, (sizeof(TListFileCache) + dwCacheSize));
- if(pCache == NULL)
- {
- dwCacheSize = LISTFILE_CACHE_SIZE;
- pCache = (TListFileCache *)ALLOCMEM(char, sizeof(TListFileCache) + dwCacheSize);
- }
-
- if(pCache == NULL)
- nError = ERROR_NOT_ENOUGH_MEMORY;
- }
-
- if(nError == ERROR_SUCCESS)
- {
- // Initialize the file cache
- memset(pCache, 0, sizeof(TListFileCache));
- pCache->hFile = hListFile;
- pCache->dwFileSize = dwFileSize;
- pCache->dwBuffSize = dwCacheSize;
- pCache->dwFilePos = 0;
-
- // Fill the cache
- SFileReadFile(hListFile, pCache->Buffer, pCache->dwBuffSize, &pCache->dwBuffSize, NULL);
-
- // Initialize the pointers
- pCache->pBegin =
- pCache->pPos = &pCache->Buffer[0];
- pCache->pEnd = pCache->pBegin + pCache->dwBuffSize;
-
- // Load the node list. Add the node for every locale in the archive
- while((nLength = ReadLine(pCache, szFileName, sizeof(szFileName) - 1)) > 0)
- SListFileCreateNodeForAllLocales(ha, szFileName);
-
- // Also, add three special files to the listfile:
- // (listfile) itself, (attributes) and (signature)
- SListFileCreateNodeForAllLocales(ha, LISTFILE_NAME);
- SListFileCreateNodeForAllLocales(ha, SIGNATURE_NAME);
- SListFileCreateNodeForAllLocales(ha, ATTRIBUTES_NAME);
- }
-
- // Cleanup & exit
- if(pCache != NULL)
- SListFileFindClose((HANDLE)pCache);
- return nError;
-}
-
-//-----------------------------------------------------------------------------
-// Passing through the listfile
-
-HANDLE SListFileFindFirstFile(HANDLE hMpq, const char * szListFile, const char * szMask, SFILE_FIND_DATA * lpFindFileData)
-{
- TListFileCache * pCache = NULL;
- TMPQArchive * ha = (TMPQArchive *)hMpq;
- HANDLE hListFile = NULL;
- DWORD dwSearchScope = SFILE_OPEN_LOCAL_FILE;
- DWORD dwCacheSize = 0;
- DWORD dwFileSize = 0;
- size_t nLength = 0;
- int nError = ERROR_SUCCESS;
-
- // Initialize the structure with zeros
- memset(lpFindFileData, 0, sizeof(SFILE_FIND_DATA));
-
- // If the szListFile is NULL, it means we have to open internal listfile
- if(szListFile == NULL)
- {
- szListFile = LISTFILE_NAME;
- dwSearchScope = SFILE_OPEN_FROM_MPQ;
- }
-
- // Open the local/internal listfile
- if(nError == ERROR_SUCCESS)
- {
- if(!SFileOpenFileEx((HANDLE)ha, szListFile, dwSearchScope, &hListFile))
- nError = GetLastError();
- }
-
- if(nError == ERROR_SUCCESS)
- {
- dwCacheSize =
- dwFileSize = SFileGetFileSize(hListFile, NULL);
-
- // Try to allocate memory for the complete file. If it fails,
- // load the part of the file
- pCache = (TListFileCache *)ALLOCMEM(char, sizeof(TListFileCache) + dwCacheSize);
- if(pCache == NULL)
- {
- dwCacheSize = LISTFILE_CACHE_SIZE;
- pCache = (TListFileCache *)ALLOCMEM(char, sizeof(TListFileCache) + dwCacheSize);
- }
-
- if(pCache == NULL)
- nError = ERROR_NOT_ENOUGH_MEMORY;
- }
-
- if(nError == ERROR_SUCCESS)
- {
- // Initialize the file cache
- memset(pCache, 0, sizeof(TListFileCache));
- pCache->hFile = hListFile;
- pCache->dwFileSize = dwFileSize;
- pCache->dwBuffSize = dwCacheSize;
- pCache->dwFilePos = 0;
- if(szMask != NULL)
- {
- pCache->szMask = ALLOCMEM(char, strlen(szMask) + 1);
- strcpy(pCache->szMask, szMask);
- }
-
- // Fill the cache
- SFileReadFile(hListFile, pCache->Buffer, pCache->dwBuffSize, &pCache->dwBuffSize, NULL);
-
- // Initialize the pointers
- pCache->pBegin =
- pCache->pPos = &pCache->Buffer[0];
- pCache->pEnd = pCache->pBegin + pCache->dwBuffSize;
-
- for(;;)
- {
- // Read the (next) line
- nLength = ReadLine(pCache, lpFindFileData->cFileName, sizeof(lpFindFileData->cFileName));
- if(nLength == 0)
- {
- nError = ERROR_NO_MORE_FILES;
- break;
- }
-
- // If some mask entered, check it
- if(CheckWildCard(lpFindFileData->cFileName, pCache->szMask))
- break;
- }
- }
-
- // Cleanup & exit
- if(nError != ERROR_SUCCESS)
- {
- memset(lpFindFileData, 0, sizeof(SFILE_FIND_DATA));
- SListFileFindClose((HANDLE)pCache);
- pCache = NULL;
-
- SetLastError(nError);
- }
- return (HANDLE)pCache;
-}
-
-BOOL SListFileFindNextFile(HANDLE hFind, SFILE_FIND_DATA * lpFindFileData)
-{
- TListFileCache * pCache = (TListFileCache *)hFind;
- size_t nLength;
- BOOL bResult = FALSE;
- int nError = ERROR_SUCCESS;
-
- for(;;)
- {
- // Read the (next) line
- nLength = ReadLine(pCache, lpFindFileData->cFileName, sizeof(lpFindFileData->cFileName));
- if(nLength == 0)
- {
- nError = ERROR_NO_MORE_FILES;
- break;
- }
-
- // If some mask entered, check it
- if(CheckWildCard(lpFindFileData->cFileName, pCache->szMask))
- {
- bResult = TRUE;
- break;
- }
- }
-
- if(nError != ERROR_SUCCESS)
- SetLastError(nError);
- return bResult;
-}
-
-BOOL SListFileFindClose(HANDLE hFind)
-{
- TListFileCache * pCache = (TListFileCache *)hFind;
-
- if(pCache != NULL)
- {
- if(pCache->hFile != NULL)
- SFileCloseFile(pCache->hFile);
- if(pCache->szMask != NULL)
- FREEMEM(pCache->szMask);
-
- FREEMEM(pCache);
- return TRUE;
- }
-
- return FALSE;
-}
-
diff --git a/src/dep/src/StormLib/StormLib.bat b/src/dep/src/StormLib/StormLib.bat
new file mode 100644
index 0000000..5948e69
--- /dev/null
+++ b/src/dep/src/StormLib/StormLib.bat
@@ -0,0 +1,22 @@
+@echo off
+rem Post-build batch for StormLib project
+rem Called as StormLib.bat $(PlatformName) $(ConfigurationName)
+rem Example: StormLib.bat x64 Debug
+
+copy src\StormPort.h ..\aaa\inc
+copy src\StormLib.h ..\aaa\inc
+
+if x%1 == xWin32 goto PlatformWin32
+if x%1 == xx64 goto PlatformWin64
+goto exit
+
+:PlatformWin32
+copy .\bin\Stormlib\%1\%2\*.lib ..\aaa\lib32
+goto exit
+
+:PlatformWin64
+copy .\bin\Stormlib\%1\%2\*.lib ..\aaa\lib64
+goto exit
+
+:exit
+
diff --git a/src/dep/src/StormLib/StormLib.h b/src/dep/src/StormLib/StormLib.h
deleted file mode 100644
index 9b70bce..0000000
--- a/src/dep/src/StormLib/StormLib.h
+++ /dev/null
@@ -1,644 +0,0 @@
-/*****************************************************************************/
-/* StormLib.h Copyright (c) Ladislav Zezula 1999-2005 */
-/*---------------------------------------------------------------------------*/
-/* StormLib library v 5.00 */
-/* */
-/* Author : Ladislav Zezula */
-/* E-mail : ladik@zezula.net */
-/* WWW : http://www.zezula.net */
-/*---------------------------------------------------------------------------*/
-/* Date Ver Who Comment */
-/* -------- ---- --- ------- */
-/* xx.xx.99 1.00 Lad Created */
-/* 24.03.03 2.50 Lad Version 2.50 */
-/* 02.04.03 3.00 Lad Version 3.00 with compression */
-/* 11.04.03 3.01 Lad Renamed to StormLib.h for compatibility with */
-/* original headers for Storm.dll */
-/* 10.05.03 3.02 Lad Added Pkware DCL compression */
-/* 26.05.03 4.00 Lad Completed all compressions */
-/* 18.06.03 4.01 Lad Added SFileSetFileLocale */
-/* Added SFileExtractFile */
-/* 26.07.03 4.02 Lad Implemented nameless rename and delete */
-/* 26.07.03 4.03 Lad Added support for protected MPQs */
-/* 28.08.03 4.10 Lad Fixed bugs that caused StormLib incorrectly work */
-/* with Diablo I savegames and with files having full */
-/* hash table */
-/* 08.12.03 4.11 DCH Fixed bug in reading file block larger than 0x1000 */
-/* on certain files. */
-/* Fixed bug in AddFile with MPQ_FILE_REPLACE_EXISTING */
-/* (Thanx Daniel Chiamarello, dchiamarello@madvawes.com)*/
-/* 21.12.03 4.50 Lad Completed port for Mac */
-/* Fixed bug in compacting (if fsize is mul of 0x1000) */
-/* Fixed bug in SCompCompress */
-/* 27.05.04 4.51 Lad Changed memory management from new/delete to our */
-/* own macros */
-/* 22.06.04 4.60 Lad Optimized search. Support for multiple listfiles. */
-/* 30.09.04 4.61 Lad Fixed some bugs (Aaargh !!!) */
-/* Correctly works if HashTableSize > BlockTableSize */
-/* 29.12.04 4.70 Lad Fixed compatibility problem with MPQs from WoW */
-/* 14.07.05 5.00 Lad Added the BZLIB compression support */
-/* Added suport of files stored as single unit */
-/* 17.04.06 5.01 Lad Converted to MS Visual Studio 8.0 */
-/* Fixed issue with protected Warcraft 3 protected maps */
-/* 15.05.06 5.02 Lad Fixed issue with WoW 1.10+ */
-/* 07.09.06 5.10 Lad Fixed processing files longer than 2GB */
-/* 22.11.06 6.00 Lad Support for MPQ archives V2 */
-/* 12.06.07 6.10 Lad Support for extended file attributes */
-/* 10.09.07 6.12 Lad Support for MPQs protected by corrupting hash table */
-/* 03.12.07 6.13 Lad Support for MPQs with hash tbl size > block tbl size */
-/* 07.04.08 6.20 Lad Added SFileFlushArchive */
-/* 09.04.08 Lad Removed FilePointer variable from TMPQArchive, as */
-/* it caused more problems than benefits */
-/* 12.05.08 6.22 Lad Support for w3xMaster map protector */
-/* 05.10.08 6.23 Lad Support for protectors who set negative values in */
-/* the table of file blocks */
-/* 26.05.09 6.24 Lad Fixed search for multiple lang files with deleted */
-/* entries */
-/* 03.09.09 6.25 Lad Fixed decompression bug in huffmann decompression */
-/*****************************************************************************/
-
-#ifndef __STORMLIB_H_
-#define __STORMLIB_H_
-
-#include "StormPort.h"
-
-//-----------------------------------------------------------------------------
-// Use the apropriate library
-//
-// The library type is encoded in the library name as the following
-// StormLibXYZ.lib
-//
-// X - D for Debug version, R for Release version
-// Y - A for ANSI version, U for Unicode version (Unicode version does not exist yet)
-// Z - S for static C library, D for multithreaded DLL C-library
-//
-
-// #if defined(_MSC_VER) && !defined (__STORMLIB_SELF__)
-// #ifdef _DEBUG // DEBUG VERSIONS
-// #ifdef _DLL
-// #pragma comment(lib, "StormLibDAD.lib") // Debug Ansi Dynamic version
-// #else
-// #pragma comment(lib, "StormLibDAS.lib") // Debug Ansi Static version
-// #endif
-// #else // RELEASE VERSIONS
-// #ifdef _DLL
-// #pragma comment(lib, "StormLibRAD.lib") // Release Ansi Dynamic version
-// #else
-// #pragma comment(lib, "StormLibRAS.lib") // Release Ansi Static version
-// #endif
-// #endif
-// #endif
-
-//-----------------------------------------------------------------------------
-// Defines
-
-#define ID_MPQ 0x1A51504D // MPQ archive header ID ('MPQ\x1A')
-#define ID_MPQ_SHUNT 0x1B51504D // MPQ shunt entry ('MPQ\x1B')
-
-#define ERROR_AVI_FILE 10000 // No MPQ file, but AVI file.
-
-// Values for SFileCreateArchiveEx
-#define HASH_TABLE_SIZE_MIN 0x00004
-#define HASH_TABLE_SIZE_MAX 0x40000
-
-#define HASH_ENTRY_DELETED 0xFFFFFFFE // Block index for deleted hash entry
-#define HASH_ENTRY_FREE 0xFFFFFFFF // Block index for free hash entry
-
-// Values for SFileOpenArchive
-#define SFILE_OPEN_HARD_DISK_FILE 2 // Open the archive on HDD
-#define SFILE_OPEN_CDROM_FILE 3 // Open the archive only if it is on CDROM
-
-// Values for SFileOpenFile
-#define SFILE_OPEN_FROM_MPQ 0 // Open the file from the MPQ archive
-#define SFILE_OPEN_BY_INDEX 1 // The 'szFileName' parameter is actually the file index
-#define SFILE_OPEN_LOCAL_FILE (DWORD)-1 // Open the file from the MPQ archive
-
-// Flags for TMPQArchive::dwFlags
-#define MPQ_FLAG_CHANGED 0x00000001 // If set, the MPQ has been changed
-#define MPQ_FLAG_PROTECTED 0x00000002 // Set on protected MPQs (like W3M maps)
-
-// Flags for SFileAddFile
-// Note: MPQ_FILE_COMPRESS_PKWARE has been replaced by MPQ_FILE_IMPLODE
-// Note: MPQ_FILE_COMPRESS_MULTI has been replaced by MPQ_FILE_COMPRESS
-#define MPQ_FILE_IMPLODE 0x00000100 // Implode method (By PKWARE Data Compression Library)
-#define MPQ_FILE_COMPRESS 0x00000200 // Compress methods (My various methods)
-#define MPQ_FILE_COMPRESSED 0x0000FF00 // File is compressed
-#define MPQ_FILE_ENCRYPTED 0x00010000 // Indicates whether file is encrypted
-#define MPQ_FILE_FIXSEED 0x00020000 // File decrypt seed has to be fixed
-#define MPQ_FILE_SINGLE_UNIT 0x01000000 // File is stored as a single unit, rather than split into sectors (Thx, Quantam)
-#define MPQ_FILE_DUMMY_FILE 0x02000000 // The file is only 1 byte long and its name is a hash
-#define MPQ_FILE_HAS_EXTRA 0x04000000 // The file has extra data appended after regular data.
- // Must be with compressed files only
-#define MPQ_FILE_EXISTS 0x80000000 // Set if file exists, reset when the file was deleted
-#define MPQ_FILE_REPLACEEXISTING 0x80000000 // Replace when the file exist (SFileAddFile)
-
-#define MPQ_FILE_VALID_FLAGS (MPQ_FILE_IMPLODE | \
- MPQ_FILE_COMPRESS | \
- MPQ_FILE_ENCRYPTED | \
- MPQ_FILE_FIXSEED | \
- MPQ_FILE_SINGLE_UNIT | \
- MPQ_FILE_DUMMY_FILE | \
- MPQ_FILE_HAS_EXTRA | \
- MPQ_FILE_EXISTS)
-
-// Compression types for multilpe compressions
-#define MPQ_COMPRESSION_HUFFMANN 0x01 // Huffmann compression (used on WAVE files only)
-#define MPQ_COMPRESSION_ZLIB 0x02 // ZLIB compression
-#define MPQ_COMPRESSION_PKWARE 0x08 // PKWARE DCL compression
-#define MPQ_COMPRESSION_BZIP2 0x10 // BZIP2 compression
-#define MPQ_COMPRESSION_WAVE_MONO 0x40 //
-#define MPQ_COMPRESSION_WAVE_STEREO 0x80 //
-
-
-// Constants for SFileAddWave
-#define MPQ_WAVE_QUALITY_HIGH 0 // Best quality, the worst compression
-#define MPQ_WAVE_QUALITY_MEDIUM 1 // Medium quality, medium compression
-#define MPQ_WAVE_QUALITY_LOW 2 // Low quality, the best compression
-
-// Constants for SFileGetFileInfo
-#define SFILE_INFO_ARCHIVE_SIZE 1 // MPQ size (value from header)
-#define SFILE_INFO_HASH_TABLE_SIZE 2 // Size of hash table, in entries
-#define SFILE_INFO_BLOCK_TABLE_SIZE 3 // Number of entries in the block table
-#define SFILE_INFO_BLOCK_SIZE 4 // Size of file block (in bytes)
-#define SFILE_INFO_HASH_TABLE 5 // Pointer to Hash table (TMPQHash *)
-#define SFILE_INFO_BLOCK_TABLE 6 // Pointer to Block Table (TMPQBlock *)
-#define SFILE_INFO_NUM_FILES 7 // Real number of files within archive
-//------
-#define SFILE_INFO_HASH_INDEX 8 // Hash index of file in MPQ
-#define SFILE_INFO_CODENAME1 9 // The first codename of the file
-#define SFILE_INFO_CODENAME2 10 // The second codename of the file
-#define SFILE_INFO_LOCALEID 11 // Locale ID of file in MPQ
-#define SFILE_INFO_BLOCKINDEX 12 // Index to Block Table
-#define SFILE_INFO_FILE_SIZE 13 // Original file size
-#define SFILE_INFO_COMPRESSED_SIZE 14 // Compressed file size
-#define SFILE_INFO_FLAGS 15 // File flags
-#define SFILE_INFO_POSITION 16 // File position within archive
-#define SFILE_INFO_SEED 17 // File decryption seed
-#define SFILE_INFO_SEED_UNFIXED 18 // Decryption seed not fixed to file pos and size
-
-// Values for compact callback
-#define CCB_CHECKING_FILES 1 // Checking archive (dwParam1 = current, dwParam2 = total)
-#define CCB_CHECKING_HASH_TABLE 2 // Checking hash table (dwParam1 = current, dwParam2 = total)
-#define CCB_COPYING_NON_MPQ_DATA 3 // Copying non-MPQ data: No params used
-#define CCB_COMPACTING_FILES 4 // Compacting archive (dwParam1 = current, dwParam2 = total)
-#define CCB_CLOSING_ARCHIVE 5 // Closing archive: No params used
-
-#define LISTFILE_NAME "(listfile)" // Name of internal listfile
-#define SIGNATURE_NAME "(signature)" // Name of internal signature
-#define ATTRIBUTES_NAME "(attributes)" // Name of internal attributes file
-
-#define STORMLIB_VERSION (0x0619) // Current version of StormLib
-
-#define MPQ_FORMAT_VERSION_1 0 // Up to The Burning Crusade
-#define MPQ_FORMAT_VERSION_2 1 // The Burning Crusade and newer
-
-// Flags for SFileOpenArchiveEx
-#define MPQ_OPEN_NO_LISTFILE 0x00000001 // Don't add the internal listfile
-#define MPQ_OPEN_NO_ATTRIBUTES 0x00000002 // Don't open the attributes
-#define MPQ_OPEN_FORCE_MPQ_V1 0x00000004 // Always open the archive as MPQ v 1.00, ignore the "wFormatVersion" variable in the header
-
-// Flags for MPQ attributes
-#define MPQ_ATTRIBUTE_CRC32 0x00000001 // The "(attributes)" contain array of CRC32s
-#define MPQ_ATTRIBUTE_FILETIME 0x00000002 // The "(attributes)" contain array of FILETIMEs
-#define MPQ_ATTRIBUTE_MD5 0x00000004 // The "(attributes)" contain array of MD5s
-
-// Supports archives with size > 4 GB
-// Additional flags for SFileCreateArchiveEx
-#define MPQ_CREATE_ARCHIVE_V1 0x00000000 // Creates archive with size up to 4GB
-#define MPQ_CREATE_ARCHIVE_V2 0x00010000 // Creates archive larger than 4 GB
-#define MPQ_CREATE_ATTRIBUTES 0x00100000 // Also add the (attributes) file
-
-// Formats of (attributes) file
-#define MPQ_ATTRIBUTES_V1 100 // FOrmat version 1.00
-
-//-----------------------------------------------------------------------------
-// Structures
-
-#if (defined(WIN32) || defined(WIN64))
-#include
-#else
-#pragma pack(push,1)
-#endif
-
-struct TMPQFile;
-
-struct TMPQShunt
-{
- // The ID_MPQ_SHUNT ('MPQ\x1B') signature
- DWORD dwID;
-
- DWORD dwUnknown;
-
- // Position of the MPQ header, relative to the begin of the shunt
- DWORD dwHeaderPos;
-};
-
-
-// MPQ file header
-struct TMPQHeader
-{
- // The ID_MPQ ('MPQ\x1A') signature
- DWORD dwID;
-
- // Size of the archive header
- DWORD dwHeaderSize;
-
- // Size of MPQ archive
- // This field is deprecated in the Burning Crusade MoPaQ format, and the size of the archive
- // is calculated as the size from the beginning of the archive to the end of the hash table,
- // block table, or extended block table (whichever is largest).
- DWORD dwArchiveSize;
-
- // 0 = Original format
- // 1 = Extended format (The Burning Crusade and newer)
- USHORT wFormatVersion;
-
- // Power of two exponent specifying the number of 512-byte disk sectors in each logical sector
- // in the archive. The size of each logical sector in the archive is 512 * 2^SectorSizeShift.
- // Bugs in the Storm library dictate that this should always be 3 (4096 byte sectors).
- USHORT wBlockSize;
-
- // Offset to the beginning of the hash table, relative to the beginning of the archive.
- DWORD dwHashTablePos;
-
- // Offset to the beginning of the block table, relative to the beginning of the archive.
- DWORD dwBlockTablePos;
-
- // Number of entries in the hash table. Must be a power of two, and must be less than 2^16 for
- // the original MoPaQ format, or less than 2^20 for the Burning Crusade format.
- DWORD dwHashTableSize;
-
- // Number of entries in the block table
- DWORD dwBlockTableSize;
-};
-
-
-// Extended MPQ file header. Valid only if wFormatVersion is 1 or higher
-struct TMPQHeader2 : public TMPQHeader
-{
- // Offset to the beginning of the extended block table, relative to the beginning of the archive.
- LARGE_INTEGER ExtBlockTablePos;
-
- // High 16 bits of the hash table offset for large archives.
- USHORT wHashTablePosHigh;
-
- // High 16 bits of the block table offset for large archives.
- USHORT wBlockTablePosHigh;
-};
-
-
-// Hash entry. All files in the archive are searched by their hashes.
-struct TMPQHash
-{
- // The hash of the file path, using method A.
- DWORD dwName1;
-
- // The hash of the file path, using method B.
- DWORD dwName2;
-
-#if PLATFORM_LITTLE_ENDIAN
-
- // The language of the file. This is a Windows LANGID data type, and uses the same values.
- // 0 indicates the default language (American English), or that the file is language-neutral.
- USHORT lcLocale;
-
- // The platform the file is used for. 0 indicates the default platform.
- // No other values have been observed.
- USHORT wPlatform;
-
-#else
-
- USHORT wPlatform;
- USHORT lcLocale;
-
-#endif
-
- // If the hash table entry is valid, this is the index into the block table of the file.
- // Otherwise, one of the following two values:
- // - FFFFFFFFh: Hash table entry is empty, and has always been empty.
- // Terminates searches for a given file.
- // - FFFFFFFEh: Hash table entry is empty, but was valid at some point (a deleted file).
- // Does not terminate searches for a given file.
- DWORD dwBlockIndex;
-};
-
-
-// File description block contains informations about the file
-struct TMPQBlock
-{
- // Offset of the beginning of the block, relative to the beginning of the archive.
- DWORD dwFilePos;
-
- // Compressed file size
- DWORD dwCSize;
-
- // Only valid if the block is a file; otherwise meaningless, and should be 0.
- // If the file is compressed, this is the size of the uncompressed file data.
- DWORD dwFSize;
-
- // Flags for the file. See MPQ_FILE_XXXX constants
- DWORD dwFlags;
-};
-
-
-// The extended block table was added to support archives larger than 4 gigabytes (2^32 bytes).
-// The table contains the upper bits of the archive offsets for each block in the block table.
-// It is simply an array of int16s, which become bits 32-47 of the archive offsets for each block,
-// with bits 48-63 being zero. Individual blocks in the archive are still limited to 4 gigabytes
-// in size. This table is only present in Burning Crusade format archives that exceed 4 gigabytes size.
-struct TMPQBlockEx
-{
- USHORT wFilePosHigh;
-};
-
-
-struct TFileNode
-{
- DWORD dwRefCount; // Number of references
- // There can be more files that have the same name.
- // (e.g. multiple language files). We don't want to
- // have an entry for each of them, so the entries will be referenced.
- // When a number of node references reaches zero,
- // the node will be deleted
-
- size_t nLength; // File name length
- char szFileName[1]; // File name, variable length
-};
-
-
-// CRC32 present in the (attributes) file
-struct TMPQCRC32
-{
- DWORD dwValue; // Value of CRC32 for each block
-};
-
-
-// FILETIME present in the (attributes) file
-struct TMPQFileTime
-{
- DWORD dwFileTimeLow; // Low DWORD of the FILETIME
- DWORD dwFileTimeHigh; // High DWORD of the FILETIME
-};
-
-
-// MD5 presetn in the (attributes) file
-struct TMPQMD5
-{
- BYTE Value[0x10]; // 16 bytes of MD5
-};
-
-
-// Data from (attributes) file
-struct TMPQAttr
-{
- DWORD dwVersion; // Version of the (attributes) file. Must be 100 (0x64)
- DWORD dwFlags; // See MPQ_ATTRIBUTE_XXXX
- TMPQCRC32 * pCrc32; // Array of CRC32 (NULL if none)
- TMPQFileTime * pFileTime; // Array of FILETIME (NULL if not present)
- TMPQMD5 * pMd5; // Array of MD5 (NULL if none)
-};
-
-
-#if (defined(WIN32) || defined(WIN64))
-#include
-#else
-#pragma pack(pop)
-#endif
-
-// Archive handle structure
-struct TMPQArchive
-{
-// TMPQArchive * pNext; // Next archive (used by Storm.dll only)
-// TMPQArchive * pPrev; // Previous archive (used by Storm.dll only)
- char szFileName[MAX_PATH]; // Opened archive file name
- HANDLE hFile; // File handle
- DWORD dwPriority; // Priority of the archive
- LARGE_INTEGER ShuntPos; // MPQShunt offset (only valid if a shunt is present)
- LARGE_INTEGER MpqPos; // File header offset (relative to the begin of the file)
- LARGE_INTEGER HashTablePos; // Hash table offset (relative to the begin of the file)
- LARGE_INTEGER BlockTablePos; // Block table offset (relative to the begin of the file)
- LARGE_INTEGER ExtBlockTablePos; // Ext. block table offset (relative to the begin of the file)
- LARGE_INTEGER MpqSize; // Size of MPQ archive
-
- TMPQFile * pLastFile; // Recently read file
- DWORD dwBlockPos; // Position of loaded block in the file
- DWORD dwBlockSize; // Size of file block
- BYTE * pbBlockBuffer; // Buffer (cache) for file block
- DWORD dwBuffPos; // Position in block buffer
- TMPQShunt * pShunt; // MPQ shunt (NULL if not present in the file)
- TMPQHeader2 * pHeader; // MPQ file header
- TMPQHash * pHashTable; // Hash table
- TMPQBlock * pBlockTable; // Block table
- TMPQBlockEx * pExtBlockTable; // Extended block table
-
- TMPQShunt Shunt; // MPQ shunt. Valid only when ID_MPQ_SHUNT has been found
- TMPQHeader2 Header; // MPQ header
-
- TMPQAttr * pAttributes; // MPQ attributes from "(attributes)" file (NULL if none)
- TFileNode ** pListFile; // File name array
- DWORD dwFlags; // See MPQ_FLAG_XXXXX
-};
-
-
-// File handle structure
-struct TMPQFile
-{
- HANDLE hFile; // File handle
- TMPQArchive * ha; // Archive handle
- TMPQHash * pHash; // Hash table entry
- TMPQBlockEx * pBlockEx; // Pointer to extended file block entry
- TMPQBlock * pBlock; // File block pointer
- DWORD dwSeed1; // Seed used for file decrypt
- DWORD dwFilePos; // Current file position
- LARGE_INTEGER RawFilePos; // Offset in MPQ archive (relative to file begin)
- LARGE_INTEGER MpqFilePos; // Offset in MPQ archive (relative to MPQ header)
-
- DWORD * pdwBlockPos; // Position of each file block (only for compressed files)
- DWORD nBlocks; // Number of blocks in the file (incl. the last incomplete one)
- BOOL bBlockPosLoaded; // TRUE if block positions loaded
- BYTE * pbFileBuffer; // Decompressed file (for single unit files, size is the uncompressed file size)
-
- TMPQCRC32 * pCrc32; // Pointer to CRC32 (NULL if none)
- TMPQFileTime * pFileTime; // Pointer to file's FILETIME (NULL if none)
- TMPQMD5 * pMd5; // Pointer to file's MD5 (NULL if none)
-
- DWORD dwHashIndex; // Index to Hash table
- DWORD dwBlockIndex; // Index to Block table
- char szFileName[1]; // File name (variable length)
-};
-
-// Used by searching in MPQ archives
-struct TMPQSearch
-{
- TMPQArchive * ha; // Handle to MPQ, where the search runs
- DWORD dwNextIndex; // Next hash index to be checked
- DWORD dwName1; // Lastly found Name1
- DWORD dwName2; // Lastly found Name2
- char szSearchMask[1]; // Search mask (variable length)
-};
-
-
-struct SFILE_FIND_DATA
-{
- char cFileName[MAX_PATH]; // Full name of the found file
- char * szPlainName; // Pointer to file part
- LCID lcLocale; // Locale version
- DWORD dwFileSize; // File size in bytes
- DWORD dwFileFlags; // File flags (compressed or encrypted)
- DWORD dwBlockIndex; // Block index for the file
- DWORD dwCompSize; // Compressed file size
-};
-
-//-----------------------------------------------------------------------------
-// Memory management
-//
-// We use our own macros for allocating/freeing memory. If you want
-// to redefine them, please keep the following rules
-//
-// - The memory allocation must return NULL if not enough memory
-// (i.e not to throw exception)
-// - It is not necessary to fill the allocated block with zeros
-// - Memory freeing function must not test the pointer to NULL.
-//
-
-
-__inline void * DebugMalloc(char * szFile, int nLine, int nSize)
-{
- void * ptr = malloc(nSize + 100);
- char * plain;
-
- plain = strrchr(szFile, '\\');
- if(plain == NULL)
- plain = strrchr(szFile, '/');
- if(plain == NULL)
- plain = szFile;
-
-#if _MSC_VER > 1300
- sprintf_s((char *)ptr, nSize+100, "%s(%u)", plain, nLine);
-#else
- sprintf((char *)ptr, "%s(%u)", plain, nLine);
-#endif
-
- return (char *)ptr + 100;
-}
-
-
-__inline void DebugFree(void * ptr)
-{
- free((char *)ptr - 100);
-}
-
-
-#ifndef ALLOCMEM
- #define ALLOCMEM(type, nitems) (type *)malloc((nitems) * sizeof(type))
- #define FREEMEM(ptr) free(ptr)
-#endif
-
-//#define ALLOCMEM(type, nitems) (type *)DebugMalloc(__FILE__, __LINE__, (nitems) * sizeof(type))
-//#define FREEMEM(ptr) DebugFree(ptr)
-
-//-----------------------------------------------------------------------------
-// Functions in StormLib - compatible with Storm.dll
-
-// Typedefs for functions exported by Storm.dll
-typedef LCID (WINAPI * SFILESETLOCALE)(LCID);
-typedef BOOL (WINAPI * SFILEOPENARCHIVE)(const char *, DWORD, DWORD, HANDLE *);
-typedef BOOL (WINAPI * SFILECLOSEARCHIVE)(HANDLE);
-typedef BOOL (WINAPI * SFILEOPENFILEEX)(HANDLE, const char *, DWORD, HANDLE *);
-typedef BOOL (WINAPI * SFILECLOSEFILE)(HANDLE);
-typedef DWORD (WINAPI * SFILEGETFILESIZE)(HANDLE, DWORD *);
-typedef DWORD (WINAPI * SFILESETFILEPOINTER)(HANDLE, LONG, LONG *, DWORD);
-typedef BOOL (WINAPI * SFILEREADFILE)(HANDLE, VOID *, DWORD, DWORD *, LPOVERLAPPED);
-
-// Archive opening/closing
-LCID WINAPI SFileSetLocale(LCID lcNewLocale);
-LCID WINAPI SFileGetLocale();
-BOOL WINAPI SFileOpenArchive(const char * szMpqName, DWORD dwPriority, DWORD dwFlags, HANDLE * phMpq);
-BOOL WINAPI SFileFlushArchive(HANDLE hMpq);
-BOOL WINAPI SFileCloseArchive(HANDLE hMpq);
-
-// File opening/closing
-BOOL WINAPI SFileOpenFileEx(HANDLE hMpq, const char * szFileName, DWORD dwSearchScope, HANDLE * phFile);
-BOOL WINAPI SFileCloseFile(HANDLE hFile);
-
-// File I/O
-DWORD WINAPI SFileGetFilePos(HANDLE hFile, DWORD * pdwFilePosHigh = NULL);
-DWORD WINAPI SFileGetFileSize(HANDLE hFile, DWORD * pdwFileSizeHigh = NULL);
-DWORD WINAPI SFileSetFilePointer(HANDLE hFile, LONG lFilePos, LONG * pdwFilePosHigh, DWORD dwMethod);
-BOOL WINAPI SFileReadFile(HANDLE hFile, VOID * lpBuffer, DWORD dwToRead, DWORD * pdwRead = NULL, LPOVERLAPPED lpOverlapped = NULL);
-
-// Adds another listfile into MPQ. The currently added listfile(s) remain,
-// so you can use this API to combining more listfiles.
-// Note that this function is internally called by SFileFindFirstFile
-int WINAPI SFileAddListFile(HANDLE hMpq, const char * szListFile);
-
-//-----------------------------------------------------------------------------
-// Functions in StormLib - not implemented in Storm.dll
-
-// Archive creating and editing
-BOOL WINAPI SFileCreateArchiveEx(const char * szMpqName, DWORD dwCreationDisposition, DWORD dwHashTableSize, HANDLE * phMpq);
-BOOL WINAPI SFileAddFile(HANDLE hMpq, const char * szFileName, const char * szArchivedName, DWORD dwFlags);
-BOOL WINAPI SFileAddWave(HANDLE hMpq, const char * szFileName, const char * szArchivedName, DWORD dwFlags, DWORD dwQuality);
-BOOL WINAPI SFileRemoveFile(HANDLE hMpq, const char * szFileName, DWORD dwSearchScope = SFILE_OPEN_BY_INDEX);
-BOOL WINAPI SFileRenameFile(HANDLE hMpq, const char * szOldFileName, const char * szNewFileName);
-BOOL WINAPI SFileSetFileLocale(HANDLE hFile, LCID lcNewLocale);
-
-// Retrieving info about the file
-BOOL WINAPI SFileHasFile(HANDLE hMpq, const char * szFileName);
-BOOL WINAPI SFileGetFileName(HANDLE hFile, char * szFileName);
-DWORD_PTR WINAPI SFileGetFileInfo(HANDLE hMpqOrFile, DWORD dwInfoType);
-
-// File search
-// Note that the SFileFindFirstFileEx has been removed. Use SListFileFindFirst/Next
-HANDLE WINAPI SFileFindFirstFile(HANDLE hMpq, const char * szMask, SFILE_FIND_DATA * lpFindFileData, const char * szListFile);
-BOOL WINAPI SFileFindNextFile(HANDLE hFind, SFILE_FIND_DATA * lpFindFileData);
-BOOL WINAPI SFileFindClose(HANDLE hFind);
-
-// Listfile search
-HANDLE SListFileFindFirstFile(HANDLE hMpq, const char * szListFile, const char * szMask, SFILE_FIND_DATA * lpFindFileData);
-BOOL SListFileFindNextFile(HANDLE hFind, SFILE_FIND_DATA * lpFindFileData);
-BOOL SListFileFindClose(HANDLE hFind);
-
-// Archive compacting
-typedef void (WINAPI * COMPACTCB)(void * lpUserData, DWORD dwWorkType, DWORD dwParam1, DWORD dwParam2);
-BOOL WINAPI SFileSetCompactCallback(HANDLE hMpq, COMPACTCB CompactCB, void * lpData);
-BOOL WINAPI SFileCompactArchive(HANDLE hMpq, const char * szListFile = NULL, BOOL bReserved = 0);
-
-// Locale support
-int WINAPI SFileEnumLocales(HANDLE hMpq, const char * szFileName, LCID * plcLocales, DWORD * pdwMaxLocales, DWORD dwSearchScope);
-
-// (De)compression
-int WINAPI SCompCompress (char * pbOutBuffer, int * pdwOutLength, char * pbInBuffer, int dwInLength, int uCompressions, int nCmpType, int nCmpLevel);
-int WINAPI SCompDecompress (char * pbOutBuffer, int * pdwOutLength, char * pbInBuffer, int dwInLength);
-
-// Sets the default data compression for files added to MPQ,
-// if MPQ_FILE_COMPRESS_MULTI has been specified in call to SFileAddFile
-// Use one of the MPQ_COMPRESSION_XXX values
-int WINAPI SCompSetDataCompression(int nDataCompression);
-
-// Verifies file against its extended attributes (depending on dwFlags).
-// For dwFlags, use one or more of MPQ_ATTRIBUTE_MD5
-BOOL WINAPI SFileVerifyFile(HANDLE hMpq, const char * szFileName, DWORD dwFlags);
-
-// High-level extract function
-BOOL WINAPI SFileExtractFile(HANDLE hMpq, const char * szToExtract, const char * szExtracted);
-
-//-----------------------------------------------------------------------------
-// Functions from Storm.dll. They use slightly different names for keeping
-// possibility to use them together with StormLib (StormXXX instead of SFileXXX)
-
-#ifdef __LINK_STORM_DLL__
- #define STORM_ALTERNATE_NAMES // Force Storm.h to use alternate fnc names
- #include "StormDll.h"
-#endif // __LINK_STORM_DLL__
-
-//-----------------------------------------------------------------------------
-// GFX decode functions. See GfxDecode.cpp for details and description
-
-USHORT WINAPI celGetFrameCount(BYTE * fileBuf);
-BYTE * WINAPI celGetFrameData(BYTE *fileBuf, BYTE *palette, USHORT xsize, USHORT frame, USHORT *ysize, USHORT *maxX=NULL);
-USHORT WINAPI cl2GetFrameCount(BYTE *fileBuf);
-BYTE ** WINAPI cl2GetDirData(BYTE *fileBuf, BYTE *palette, USHORT xsize, USHORT dir, USHORT *ysize);
-BYTE * WINAPI pcxGetData(BYTE *filebuf, DWORD filesize, BYTE transcol, USHORT *xsize, USHORT *ysize);
-
-#endif // __STORMLIB_H_
diff --git a/src/dep/src/StormLib/StormLib.sln b/src/dep/src/StormLib/StormLib.sln
new file mode 100644
index 0000000..1989bf3
--- /dev/null
+++ b/src/dep/src/StormLib/StormLib.sln
@@ -0,0 +1,170 @@
+
+Microsoft Visual Studio Solution File, Format Version 10.00
+# Visual Studio 2008
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "StormLib_dll", "StormLib_dll.vcproj", "{CB385198-50B1-4CF4-883B-11F042DED6AA}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "StormLib_test", "StormLib_test.vcproj", "{AA561A7B-26EA-49AF-90E8-C53C1FA2965D}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Storm_dll", "Storm_dll.vcproj", "{BD600973-C6FA-4CE3-8821-67F6418B7F9C}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "StormLib", "StormLib.vcproj", "{78424708-1F6E-4D4B-920C-FB6D26847055}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Win32 = Debug|Win32
+ Debug|x64 = Debug|x64
+ DebugAD|Win32 = DebugAD|Win32
+ DebugAD|x64 = DebugAD|x64
+ DebugAS|Win32 = DebugAS|Win32
+ DebugAS|x64 = DebugAS|x64
+ DebugUD|Win32 = DebugUD|Win32
+ DebugUD|x64 = DebugUD|x64
+ DebugUS|Win32 = DebugUS|Win32
+ DebugUS|x64 = DebugUS|x64
+ Release|Win32 = Release|Win32
+ Release|x64 = Release|x64
+ ReleaseAD|Win32 = ReleaseAD|Win32
+ ReleaseAD|x64 = ReleaseAD|x64
+ ReleaseAS|Win32 = ReleaseAS|Win32
+ ReleaseAS|x64 = ReleaseAS|x64
+ ReleaseUD|Win32 = ReleaseUD|Win32
+ ReleaseUD|x64 = ReleaseUD|x64
+ ReleaseUS|Win32 = ReleaseUS|Win32
+ ReleaseUS|x64 = ReleaseUS|x64
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {CB385198-50B1-4CF4-883B-11F042DED6AA}.Debug|Win32.ActiveCfg = Debug|Win32
+ {CB385198-50B1-4CF4-883B-11F042DED6AA}.Debug|Win32.Build.0 = Debug|Win32
+ {CB385198-50B1-4CF4-883B-11F042DED6AA}.Debug|x64.ActiveCfg = Debug|x64
+ {CB385198-50B1-4CF4-883B-11F042DED6AA}.Debug|x64.Build.0 = Debug|x64
+ {CB385198-50B1-4CF4-883B-11F042DED6AA}.DebugAD|Win32.ActiveCfg = Debug|x64
+ {CB385198-50B1-4CF4-883B-11F042DED6AA}.DebugAD|x64.ActiveCfg = Debug|x64
+ {CB385198-50B1-4CF4-883B-11F042DED6AA}.DebugAD|x64.Build.0 = Debug|x64
+ {CB385198-50B1-4CF4-883B-11F042DED6AA}.DebugAS|Win32.ActiveCfg = Debug|x64
+ {CB385198-50B1-4CF4-883B-11F042DED6AA}.DebugAS|x64.ActiveCfg = Debug|x64
+ {CB385198-50B1-4CF4-883B-11F042DED6AA}.DebugAS|x64.Build.0 = Debug|x64
+ {CB385198-50B1-4CF4-883B-11F042DED6AA}.DebugUD|Win32.ActiveCfg = Debug|x64
+ {CB385198-50B1-4CF4-883B-11F042DED6AA}.DebugUD|x64.ActiveCfg = Debug|x64
+ {CB385198-50B1-4CF4-883B-11F042DED6AA}.DebugUD|x64.Build.0 = Debug|x64
+ {CB385198-50B1-4CF4-883B-11F042DED6AA}.DebugUS|Win32.ActiveCfg = Debug|x64
+ {CB385198-50B1-4CF4-883B-11F042DED6AA}.DebugUS|x64.ActiveCfg = Debug|x64
+ {CB385198-50B1-4CF4-883B-11F042DED6AA}.DebugUS|x64.Build.0 = Debug|x64
+ {CB385198-50B1-4CF4-883B-11F042DED6AA}.Release|Win32.ActiveCfg = Release|Win32
+ {CB385198-50B1-4CF4-883B-11F042DED6AA}.Release|Win32.Build.0 = Release|Win32
+ {CB385198-50B1-4CF4-883B-11F042DED6AA}.Release|x64.ActiveCfg = Release|x64
+ {CB385198-50B1-4CF4-883B-11F042DED6AA}.Release|x64.Build.0 = Release|x64
+ {CB385198-50B1-4CF4-883B-11F042DED6AA}.ReleaseAD|Win32.ActiveCfg = Release|x64
+ {CB385198-50B1-4CF4-883B-11F042DED6AA}.ReleaseAD|x64.ActiveCfg = Release|x64
+ {CB385198-50B1-4CF4-883B-11F042DED6AA}.ReleaseAD|x64.Build.0 = Release|x64
+ {CB385198-50B1-4CF4-883B-11F042DED6AA}.ReleaseAS|Win32.ActiveCfg = Release|x64
+ {CB385198-50B1-4CF4-883B-11F042DED6AA}.ReleaseAS|x64.ActiveCfg = Release|x64
+ {CB385198-50B1-4CF4-883B-11F042DED6AA}.ReleaseAS|x64.Build.0 = Release|x64
+ {CB385198-50B1-4CF4-883B-11F042DED6AA}.ReleaseUD|Win32.ActiveCfg = Release|x64
+ {CB385198-50B1-4CF4-883B-11F042DED6AA}.ReleaseUD|x64.ActiveCfg = Release|x64
+ {CB385198-50B1-4CF4-883B-11F042DED6AA}.ReleaseUD|x64.Build.0 = Release|x64
+ {CB385198-50B1-4CF4-883B-11F042DED6AA}.ReleaseUS|Win32.ActiveCfg = Release|x64
+ {CB385198-50B1-4CF4-883B-11F042DED6AA}.ReleaseUS|x64.ActiveCfg = Release|x64
+ {CB385198-50B1-4CF4-883B-11F042DED6AA}.ReleaseUS|x64.Build.0 = Release|x64
+ {AA561A7B-26EA-49AF-90E8-C53C1FA2965D}.Debug|Win32.ActiveCfg = Debug|Win32
+ {AA561A7B-26EA-49AF-90E8-C53C1FA2965D}.Debug|Win32.Build.0 = Debug|Win32
+ {AA561A7B-26EA-49AF-90E8-C53C1FA2965D}.Debug|x64.ActiveCfg = Debug|Win32
+ {AA561A7B-26EA-49AF-90E8-C53C1FA2965D}.DebugAD|Win32.ActiveCfg = Debug|Win32
+ {AA561A7B-26EA-49AF-90E8-C53C1FA2965D}.DebugAD|Win32.Build.0 = Debug|Win32
+ {AA561A7B-26EA-49AF-90E8-C53C1FA2965D}.DebugAD|x64.ActiveCfg = Debug|Win32
+ {AA561A7B-26EA-49AF-90E8-C53C1FA2965D}.DebugAS|Win32.ActiveCfg = Debug|Win32
+ {AA561A7B-26EA-49AF-90E8-C53C1FA2965D}.DebugAS|Win32.Build.0 = Debug|Win32
+ {AA561A7B-26EA-49AF-90E8-C53C1FA2965D}.DebugAS|x64.ActiveCfg = Debug|Win32
+ {AA561A7B-26EA-49AF-90E8-C53C1FA2965D}.DebugUD|Win32.ActiveCfg = Debug|Win32
+ {AA561A7B-26EA-49AF-90E8-C53C1FA2965D}.DebugUD|Win32.Build.0 = Debug|Win32
+ {AA561A7B-26EA-49AF-90E8-C53C1FA2965D}.DebugUD|x64.ActiveCfg = Debug|Win32
+ {AA561A7B-26EA-49AF-90E8-C53C1FA2965D}.DebugUS|Win32.ActiveCfg = Debug|Win32
+ {AA561A7B-26EA-49AF-90E8-C53C1FA2965D}.DebugUS|Win32.Build.0 = Debug|Win32
+ {AA561A7B-26EA-49AF-90E8-C53C1FA2965D}.DebugUS|x64.ActiveCfg = Debug|Win32
+ {AA561A7B-26EA-49AF-90E8-C53C1FA2965D}.Release|Win32.ActiveCfg = Release|Win32
+ {AA561A7B-26EA-49AF-90E8-C53C1FA2965D}.Release|Win32.Build.0 = Release|Win32
+ {AA561A7B-26EA-49AF-90E8-C53C1FA2965D}.Release|x64.ActiveCfg = Release|Win32
+ {AA561A7B-26EA-49AF-90E8-C53C1FA2965D}.ReleaseAD|Win32.ActiveCfg = Release|Win32
+ {AA561A7B-26EA-49AF-90E8-C53C1FA2965D}.ReleaseAD|Win32.Build.0 = Release|Win32
+ {AA561A7B-26EA-49AF-90E8-C53C1FA2965D}.ReleaseAD|x64.ActiveCfg = Release|Win32
+ {AA561A7B-26EA-49AF-90E8-C53C1FA2965D}.ReleaseAS|Win32.ActiveCfg = Release|Win32
+ {AA561A7B-26EA-49AF-90E8-C53C1FA2965D}.ReleaseAS|Win32.Build.0 = Release|Win32
+ {AA561A7B-26EA-49AF-90E8-C53C1FA2965D}.ReleaseAS|x64.ActiveCfg = Release|Win32
+ {AA561A7B-26EA-49AF-90E8-C53C1FA2965D}.ReleaseUD|Win32.ActiveCfg = Release|Win32
+ {AA561A7B-26EA-49AF-90E8-C53C1FA2965D}.ReleaseUD|Win32.Build.0 = Release|Win32
+ {AA561A7B-26EA-49AF-90E8-C53C1FA2965D}.ReleaseUD|x64.ActiveCfg = Release|Win32
+ {AA561A7B-26EA-49AF-90E8-C53C1FA2965D}.ReleaseUS|Win32.ActiveCfg = Release|Win32
+ {AA561A7B-26EA-49AF-90E8-C53C1FA2965D}.ReleaseUS|Win32.Build.0 = Release|Win32
+ {AA561A7B-26EA-49AF-90E8-C53C1FA2965D}.ReleaseUS|x64.ActiveCfg = Release|Win32
+ {BD600973-C6FA-4CE3-8821-67F6418B7F9C}.Debug|Win32.ActiveCfg = Debug|Win32
+ {BD600973-C6FA-4CE3-8821-67F6418B7F9C}.Debug|Win32.Build.0 = Debug|Win32
+ {BD600973-C6FA-4CE3-8821-67F6418B7F9C}.Debug|x64.ActiveCfg = Debug|Win32
+ {BD600973-C6FA-4CE3-8821-67F6418B7F9C}.DebugAD|Win32.ActiveCfg = Debug|Win32
+ {BD600973-C6FA-4CE3-8821-67F6418B7F9C}.DebugAD|Win32.Build.0 = Debug|Win32
+ {BD600973-C6FA-4CE3-8821-67F6418B7F9C}.DebugAD|x64.ActiveCfg = Debug|Win32
+ {BD600973-C6FA-4CE3-8821-67F6418B7F9C}.DebugAS|Win32.ActiveCfg = Debug|Win32
+ {BD600973-C6FA-4CE3-8821-67F6418B7F9C}.DebugAS|Win32.Build.0 = Debug|Win32
+ {BD600973-C6FA-4CE3-8821-67F6418B7F9C}.DebugAS|x64.ActiveCfg = Debug|Win32
+ {BD600973-C6FA-4CE3-8821-67F6418B7F9C}.DebugUD|Win32.ActiveCfg = Debug|Win32
+ {BD600973-C6FA-4CE3-8821-67F6418B7F9C}.DebugUD|Win32.Build.0 = Debug|Win32
+ {BD600973-C6FA-4CE3-8821-67F6418B7F9C}.DebugUD|x64.ActiveCfg = Debug|Win32
+ {BD600973-C6FA-4CE3-8821-67F6418B7F9C}.DebugUS|Win32.ActiveCfg = Debug|Win32
+ {BD600973-C6FA-4CE3-8821-67F6418B7F9C}.DebugUS|Win32.Build.0 = Debug|Win32
+ {BD600973-C6FA-4CE3-8821-67F6418B7F9C}.DebugUS|x64.ActiveCfg = Debug|Win32
+ {BD600973-C6FA-4CE3-8821-67F6418B7F9C}.Release|Win32.ActiveCfg = Release|Win32
+ {BD600973-C6FA-4CE3-8821-67F6418B7F9C}.Release|Win32.Build.0 = Release|Win32
+ {BD600973-C6FA-4CE3-8821-67F6418B7F9C}.Release|x64.ActiveCfg = Release|Win32
+ {BD600973-C6FA-4CE3-8821-67F6418B7F9C}.ReleaseAD|Win32.ActiveCfg = Release|Win32
+ {BD600973-C6FA-4CE3-8821-67F6418B7F9C}.ReleaseAD|Win32.Build.0 = Release|Win32
+ {BD600973-C6FA-4CE3-8821-67F6418B7F9C}.ReleaseAD|x64.ActiveCfg = Release|Win32
+ {BD600973-C6FA-4CE3-8821-67F6418B7F9C}.ReleaseAS|Win32.ActiveCfg = Release|Win32
+ {BD600973-C6FA-4CE3-8821-67F6418B7F9C}.ReleaseAS|Win32.Build.0 = Release|Win32
+ {BD600973-C6FA-4CE3-8821-67F6418B7F9C}.ReleaseAS|x64.ActiveCfg = Release|Win32
+ {BD600973-C6FA-4CE3-8821-67F6418B7F9C}.ReleaseUD|Win32.ActiveCfg = Release|Win32
+ {BD600973-C6FA-4CE3-8821-67F6418B7F9C}.ReleaseUD|Win32.Build.0 = Release|Win32
+ {BD600973-C6FA-4CE3-8821-67F6418B7F9C}.ReleaseUD|x64.ActiveCfg = Release|Win32
+ {BD600973-C6FA-4CE3-8821-67F6418B7F9C}.ReleaseUS|Win32.ActiveCfg = Release|Win32
+ {BD600973-C6FA-4CE3-8821-67F6418B7F9C}.ReleaseUS|Win32.Build.0 = Release|Win32
+ {BD600973-C6FA-4CE3-8821-67F6418B7F9C}.ReleaseUS|x64.ActiveCfg = Release|Win32
+ {78424708-1F6E-4D4B-920C-FB6D26847055}.Debug|Win32.ActiveCfg = DebugAS|x64
+ {78424708-1F6E-4D4B-920C-FB6D26847055}.Debug|x64.ActiveCfg = DebugAS|x64
+ {78424708-1F6E-4D4B-920C-FB6D26847055}.Debug|x64.Build.0 = DebugAS|x64
+ {78424708-1F6E-4D4B-920C-FB6D26847055}.DebugAD|Win32.ActiveCfg = DebugAD|Win32
+ {78424708-1F6E-4D4B-920C-FB6D26847055}.DebugAD|Win32.Build.0 = DebugAD|Win32
+ {78424708-1F6E-4D4B-920C-FB6D26847055}.DebugAD|x64.ActiveCfg = DebugAD|x64
+ {78424708-1F6E-4D4B-920C-FB6D26847055}.DebugAD|x64.Build.0 = DebugAD|x64
+ {78424708-1F6E-4D4B-920C-FB6D26847055}.DebugAS|Win32.ActiveCfg = DebugAS|Win32
+ {78424708-1F6E-4D4B-920C-FB6D26847055}.DebugAS|Win32.Build.0 = DebugAS|Win32
+ {78424708-1F6E-4D4B-920C-FB6D26847055}.DebugAS|x64.ActiveCfg = DebugAS|x64
+ {78424708-1F6E-4D4B-920C-FB6D26847055}.DebugAS|x64.Build.0 = DebugAS|x64
+ {78424708-1F6E-4D4B-920C-FB6D26847055}.DebugUD|Win32.ActiveCfg = DebugUD|Win32
+ {78424708-1F6E-4D4B-920C-FB6D26847055}.DebugUD|Win32.Build.0 = DebugUD|Win32
+ {78424708-1F6E-4D4B-920C-FB6D26847055}.DebugUD|x64.ActiveCfg = DebugUD|x64
+ {78424708-1F6E-4D4B-920C-FB6D26847055}.DebugUD|x64.Build.0 = DebugUD|x64
+ {78424708-1F6E-4D4B-920C-FB6D26847055}.DebugUS|Win32.ActiveCfg = DebugUS|Win32
+ {78424708-1F6E-4D4B-920C-FB6D26847055}.DebugUS|Win32.Build.0 = DebugUS|Win32
+ {78424708-1F6E-4D4B-920C-FB6D26847055}.DebugUS|x64.ActiveCfg = DebugUS|x64
+ {78424708-1F6E-4D4B-920C-FB6D26847055}.DebugUS|x64.Build.0 = DebugUS|x64
+ {78424708-1F6E-4D4B-920C-FB6D26847055}.Release|Win32.ActiveCfg = ReleaseAS|x64
+ {78424708-1F6E-4D4B-920C-FB6D26847055}.Release|x64.ActiveCfg = ReleaseAS|x64
+ {78424708-1F6E-4D4B-920C-FB6D26847055}.Release|x64.Build.0 = ReleaseAS|x64
+ {78424708-1F6E-4D4B-920C-FB6D26847055}.ReleaseAD|Win32.ActiveCfg = ReleaseAD|Win32
+ {78424708-1F6E-4D4B-920C-FB6D26847055}.ReleaseAD|Win32.Build.0 = ReleaseAD|Win32
+ {78424708-1F6E-4D4B-920C-FB6D26847055}.ReleaseAD|x64.ActiveCfg = ReleaseAD|x64
+ {78424708-1F6E-4D4B-920C-FB6D26847055}.ReleaseAD|x64.Build.0 = ReleaseAD|x64
+ {78424708-1F6E-4D4B-920C-FB6D26847055}.ReleaseAS|Win32.ActiveCfg = ReleaseAS|Win32
+ {78424708-1F6E-4D4B-920C-FB6D26847055}.ReleaseAS|Win32.Build.0 = ReleaseAS|Win32
+ {78424708-1F6E-4D4B-920C-FB6D26847055}.ReleaseAS|x64.ActiveCfg = ReleaseAS|x64
+ {78424708-1F6E-4D4B-920C-FB6D26847055}.ReleaseAS|x64.Build.0 = ReleaseAS|x64
+ {78424708-1F6E-4D4B-920C-FB6D26847055}.ReleaseUD|Win32.ActiveCfg = ReleaseUD|Win32
+ {78424708-1F6E-4D4B-920C-FB6D26847055}.ReleaseUD|Win32.Build.0 = ReleaseUD|Win32
+ {78424708-1F6E-4D4B-920C-FB6D26847055}.ReleaseUD|x64.ActiveCfg = ReleaseUD|x64
+ {78424708-1F6E-4D4B-920C-FB6D26847055}.ReleaseUD|x64.Build.0 = ReleaseUD|x64
+ {78424708-1F6E-4D4B-920C-FB6D26847055}.ReleaseUS|Win32.ActiveCfg = ReleaseUS|Win32
+ {78424708-1F6E-4D4B-920C-FB6D26847055}.ReleaseUS|Win32.Build.0 = ReleaseUS|Win32
+ {78424708-1F6E-4D4B-920C-FB6D26847055}.ReleaseUS|x64.ActiveCfg = ReleaseUS|x64
+ {78424708-1F6E-4D4B-920C-FB6D26847055}.ReleaseUS|x64.Build.0 = ReleaseUS|x64
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff --git a/src/dep/src/StormLib/StormLib.vcproj b/src/dep/src/StormLib/StormLib.vcproj
new file mode 100644
index 0000000..f1f158d
--- /dev/null
+++ b/src/dep/src/StormLib/StormLib.vcproj
@@ -0,0 +1,21605 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/dep/src/StormLib/StormLib.xcodeproj/project.pbxproj b/src/dep/src/StormLib/StormLib.xcodeproj/project.pbxproj
new file mode 100644
index 0000000..c7ada22
--- /dev/null
+++ b/src/dep/src/StormLib/StormLib.xcodeproj/project.pbxproj
@@ -0,0 +1,1996 @@
+// !$*UTF8*$!
+{
+ archiveVersion = 1;
+ classes = {
+ };
+ objectVersion = 42;
+ objects = {
+
+/* Begin PBXBuildFile section */
+ 221F6A741168529C0026C852 /* LzmaDec.h in Headers */ = {isa = PBXBuildFile; fileRef = 221F6A721168529C0026C852 /* LzmaDec.h */; };
+ 221F6A751168529C0026C852 /* LzmaEnc.h in Headers */ = {isa = PBXBuildFile; fileRef = 221F6A731168529C0026C852 /* LzmaEnc.h */; };
+ 221F6A761168529C0026C852 /* LzmaDec.h in Headers */ = {isa = PBXBuildFile; fileRef = 221F6A721168529C0026C852 /* LzmaDec.h */; };
+ 221F6A771168529C0026C852 /* LzmaEnc.h in Headers */ = {isa = PBXBuildFile; fileRef = 221F6A731168529C0026C852 /* LzmaEnc.h */; };
+ 221F6A7B116852AA0026C852 /* LzmaEnc.c in Sources */ = {isa = PBXBuildFile; fileRef = 221F6A7A116852AA0026C852 /* LzmaEnc.c */; };
+ 221F6A7C116852AA0026C852 /* LzmaEnc.c in Sources */ = {isa = PBXBuildFile; fileRef = 221F6A7A116852AA0026C852 /* LzmaEnc.c */; };
+ 221F6A7E116852B20026C852 /* LzmaDec.c in Sources */ = {isa = PBXBuildFile; fileRef = 221F6A7D116852B20026C852 /* LzmaDec.c */; };
+ 221F6A7F116852B20026C852 /* LzmaDec.c in Sources */ = {isa = PBXBuildFile; fileRef = 221F6A7D116852B20026C852 /* LzmaDec.c */; };
+ 221F6AB51168545B0026C852 /* LzFind.c in Sources */ = {isa = PBXBuildFile; fileRef = 221F6AB31168545B0026C852 /* LzFind.c */; };
+ 221F6AB61168545B0026C852 /* LzFind.h in Headers */ = {isa = PBXBuildFile; fileRef = 221F6AB41168545B0026C852 /* LzFind.h */; };
+ 221F6AB71168545B0026C852 /* LzFind.c in Sources */ = {isa = PBXBuildFile; fileRef = 221F6AB31168545B0026C852 /* LzFind.c */; };
+ 221F6AB81168545B0026C852 /* LzFind.h in Headers */ = {isa = PBXBuildFile; fileRef = 221F6AB41168545B0026C852 /* LzFind.h */; };
+ 221F6ABA116854730026C852 /* LzHash.h in Headers */ = {isa = PBXBuildFile; fileRef = 221F6AB9116854730026C852 /* LzHash.h */; };
+ 221F6ABB116854730026C852 /* LzHash.h in Headers */ = {isa = PBXBuildFile; fileRef = 221F6AB9116854730026C852 /* LzHash.h */; };
+ 221F6ABD116854870026C852 /* Types.h in Headers */ = {isa = PBXBuildFile; fileRef = 221F6ABC116854870026C852 /* Types.h */; };
+ 221F6ABE116854870026C852 /* Types.h in Headers */ = {isa = PBXBuildFile; fileRef = 221F6ABC116854870026C852 /* Types.h */; };
+ 22549055119489060044424D /* libgcc_s.1.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 22549054119489060044424D /* libgcc_s.1.dylib */; };
+ 2254917B11948CE70044424D /* crypt_ltc_mp_descriptor.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9184811933FCF0083AC69 /* crypt_ltc_mp_descriptor.c */; settings = {COMPILER_FLAGS = "-fno-common"; }; };
+ 225530DB1056BC7900FA646A /* huff.h in Headers */ = {isa = PBXBuildFile; fileRef = 32ED009D0D03542A00AB0B4E /* huff.h */; };
+ 225530DE1056BC7900FA646A /* pklib.h in Headers */ = {isa = PBXBuildFile; fileRef = 32ED00A80D03542A00AB0B4E /* pklib.h */; };
+ 225530DF1056BC7900FA646A /* StormCommon.h in Headers */ = {isa = PBXBuildFile; fileRef = 32ED00AB0D03542A00AB0B4E /* StormCommon.h */; };
+ 225530E01056BC7900FA646A /* StormLib.h in Headers */ = {isa = PBXBuildFile; fileRef = 32ED00B60D03542A00AB0B4E /* StormLib.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 225530E11056BC7900FA646A /* StormPort.h in Headers */ = {isa = PBXBuildFile; fileRef = 32ED00B70D03542A00AB0B4E /* StormPort.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 225530E31056BC8700FA646A /* huff.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 32ED009C0D03542A00AB0B4E /* huff.cpp */; };
+ 225530E61056BC8700FA646A /* explode.c in Sources */ = {isa = PBXBuildFile; fileRef = 32ED00A60D03542A00AB0B4E /* explode.c */; };
+ 225530E71056BC8700FA646A /* implode.c in Sources */ = {isa = PBXBuildFile; fileRef = 32ED00A70D03542A00AB0B4E /* implode.c */; };
+ 225530E81056BC8700FA646A /* SFileAttributes.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 32ED00A90D03542A00AB0B4E /* SFileAttributes.cpp */; };
+ 225530E91056BC8700FA646A /* SBaseCommon.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 32ED00AA0D03542A00AB0B4E /* SBaseCommon.cpp */; };
+ 225530EA1056BC8700FA646A /* SCompression.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 32ED00AC0D03542A00AB0B4E /* SCompression.cpp */; };
+ 225530EB1056BC8700FA646A /* SFileCompactArchive.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 32ED00AD0D03542A00AB0B4E /* SFileCompactArchive.cpp */; };
+ 225530EC1056BC8700FA646A /* SFileCreateArchive.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 32ED00AE0D03542A00AB0B4E /* SFileCreateArchive.cpp */; };
+ 225530ED1056BC8700FA646A /* SFileExtractFile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 32ED00AF0D03542A00AB0B4E /* SFileExtractFile.cpp */; };
+ 225530EE1056BC8700FA646A /* SFileFindFile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 32ED00B00D03542A00AB0B4E /* SFileFindFile.cpp */; };
+ 225530EF1056BC8700FA646A /* SFileOpenArchive.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 32ED00B10D03542A00AB0B4E /* SFileOpenArchive.cpp */; };
+ 225530F01056BC8700FA646A /* SFileOpenFileEx.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 32ED00B20D03542A00AB0B4E /* SFileOpenFileEx.cpp */; };
+ 225530F11056BC8700FA646A /* SFileReadFile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 32ED00B30D03542A00AB0B4E /* SFileReadFile.cpp */; };
+ 225530F21056BC8700FA646A /* SFileListFile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 32ED00B40D03542A00AB0B4E /* SFileListFile.cpp */; };
+ 225C734D1257CCC70009E8DA /* lookup.h in Headers */ = {isa = PBXBuildFile; fileRef = 225C734B1257CCC70009E8DA /* lookup.h */; };
+ 225C734F1257CCC70009E8DA /* lookup.h in Headers */ = {isa = PBXBuildFile; fileRef = 225C734B1257CCC70009E8DA /* lookup.h */; };
+ 225C73501257CCC70009E8DA /* lookup3.c in Sources */ = {isa = PBXBuildFile; fileRef = 225C734C1257CCC70009E8DA /* lookup3.c */; };
+ 225C73541257CD0C0009E8DA /* SBaseFileTable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 225C73531257CD0C0009E8DA /* SBaseFileTable.cpp */; };
+ 225C73551257CD0C0009E8DA /* SBaseFileTable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 225C73531257CD0C0009E8DA /* SBaseFileTable.cpp */; };
+ 225C735A1257CD1F0009E8DA /* lookup3.c in Sources */ = {isa = PBXBuildFile; fileRef = 225C734C1257CCC70009E8DA /* lookup3.c */; };
+ 225FAC9C0E53BAA100DA2CAE /* huff.h in Headers */ = {isa = PBXBuildFile; fileRef = 32ED009D0D03542A00AB0B4E /* huff.h */; };
+ 225FAC9F0E53BAA100DA2CAE /* pklib.h in Headers */ = {isa = PBXBuildFile; fileRef = 32ED00A80D03542A00AB0B4E /* pklib.h */; };
+ 225FACA00E53BAA100DA2CAE /* StormCommon.h in Headers */ = {isa = PBXBuildFile; fileRef = 32ED00AB0D03542A00AB0B4E /* StormCommon.h */; };
+ 225FACA10E53BAA100DA2CAE /* StormLib.h in Headers */ = {isa = PBXBuildFile; fileRef = 32ED00B60D03542A00AB0B4E /* StormLib.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 225FACA20E53BAA100DA2CAE /* StormPort.h in Headers */ = {isa = PBXBuildFile; fileRef = 32ED00B70D03542A00AB0B4E /* StormPort.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 225FACA50E53BAB400DA2CAE /* huff.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 32ED009C0D03542A00AB0B4E /* huff.cpp */; };
+ 225FACA90E53BAB400DA2CAE /* explode.c in Sources */ = {isa = PBXBuildFile; fileRef = 32ED00A60D03542A00AB0B4E /* explode.c */; };
+ 225FACAA0E53BAB400DA2CAE /* implode.c in Sources */ = {isa = PBXBuildFile; fileRef = 32ED00A70D03542A00AB0B4E /* implode.c */; };
+ 225FACAB0E53BAB400DA2CAE /* SFileAttributes.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 32ED00A90D03542A00AB0B4E /* SFileAttributes.cpp */; };
+ 225FACAC0E53BAB400DA2CAE /* SBaseCommon.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 32ED00AA0D03542A00AB0B4E /* SBaseCommon.cpp */; };
+ 225FACAD0E53BAB400DA2CAE /* SCompression.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 32ED00AC0D03542A00AB0B4E /* SCompression.cpp */; };
+ 225FACAE0E53BAB400DA2CAE /* SFileCompactArchive.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 32ED00AD0D03542A00AB0B4E /* SFileCompactArchive.cpp */; };
+ 225FACAF0E53BAB400DA2CAE /* SFileCreateArchive.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 32ED00AE0D03542A00AB0B4E /* SFileCreateArchive.cpp */; };
+ 225FACB00E53BAB400DA2CAE /* SFileExtractFile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 32ED00AF0D03542A00AB0B4E /* SFileExtractFile.cpp */; };
+ 225FACB10E53BAB400DA2CAE /* SFileFindFile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 32ED00B00D03542A00AB0B4E /* SFileFindFile.cpp */; };
+ 225FACB20E53BAB400DA2CAE /* SFileOpenArchive.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 32ED00B10D03542A00AB0B4E /* SFileOpenArchive.cpp */; };
+ 225FACB30E53BAB400DA2CAE /* SFileOpenFileEx.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 32ED00B20D03542A00AB0B4E /* SFileOpenFileEx.cpp */; };
+ 225FACB40E53BAB400DA2CAE /* SFileReadFile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 32ED00B30D03542A00AB0B4E /* SFileReadFile.cpp */; };
+ 225FACB50E53BAB400DA2CAE /* SFileListFile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 32ED00B40D03542A00AB0B4E /* SFileListFile.cpp */; };
+ 225FADD40E53C06600DA2CAE /* libbz2.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 32D20A8A0CF3902D00230E7A /* libbz2.dylib */; settings = {ATTRIBUTES = (Required, ); }; };
+ 225FADD50E53C06600DA2CAE /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 32D20A8B0CF3902D00230E7A /* libz.dylib */; settings = {ATTRIBUTES = (Required, ); }; };
+ 228B538411BF7D0D001A58DA /* FileStream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 228B538311BF7D0D001A58DA /* FileStream.cpp */; };
+ 228B538511BF7D0D001A58DA /* FileStream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 228B538311BF7D0D001A58DA /* FileStream.cpp */; };
+ 22954AD211D463AB0064B264 /* Test.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2295488911D45A820064B264 /* Test.cpp */; };
+ 22954AD311D463B50064B264 /* libStormLib.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 225530D41056BAC800FA646A /* libStormLib.a */; };
+ 22954AD611D463BE0064B264 /* libbz2.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 32D20A8A0CF3902D00230E7A /* libbz2.dylib */; };
+ 22954AD711D463BE0064B264 /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 32D20A8B0CF3902D00230E7A /* libz.dylib */; };
+ 22954AD811D463BE0064B264 /* libgcc_s.1.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 22549054119489060044424D /* libgcc_s.1.dylib */; };
+ 2299D9D71167EFA8005C19BF /* adpcm.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2299D9D51167EFA8005C19BF /* adpcm.cpp */; };
+ 2299D9D81167EFA8005C19BF /* adpcm.h in Headers */ = {isa = PBXBuildFile; fileRef = 2299D9D61167EFA8005C19BF /* adpcm.h */; };
+ 2299D9D91167EFA8005C19BF /* adpcm.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2299D9D51167EFA8005C19BF /* adpcm.cpp */; };
+ 2299D9DA1167EFA8005C19BF /* adpcm.h in Headers */ = {isa = PBXBuildFile; fileRef = 2299D9D61167EFA8005C19BF /* adpcm.h */; };
+ 2299D9DE1167EFC6005C19BF /* sparse.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2299D9DC1167EFC6005C19BF /* sparse.cpp */; };
+ 2299D9DF1167EFC6005C19BF /* sparse.h in Headers */ = {isa = PBXBuildFile; fileRef = 2299D9DD1167EFC6005C19BF /* sparse.h */; };
+ 2299D9E01167EFC6005C19BF /* sparse.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2299D9DC1167EFC6005C19BF /* sparse.cpp */; };
+ 2299D9E11167EFC6005C19BF /* sparse.h in Headers */ = {isa = PBXBuildFile; fileRef = 2299D9DD1167EFC6005C19BF /* sparse.h */; };
+ 2299DA4E1167FD16005C19BF /* SFileAddFile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2299DA4D1167FD16005C19BF /* SFileAddFile.cpp */; };
+ 2299DA4F1167FD16005C19BF /* SFileAddFile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2299DA4D1167FD16005C19BF /* SFileAddFile.cpp */; };
+ 22AEA122123125D800359B16 /* SFilePatchArchives.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 22AEA121123125D800359B16 /* SFilePatchArchives.cpp */; };
+ 22AEA123123125D800359B16 /* SFilePatchArchives.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 22AEA121123125D800359B16 /* SFilePatchArchives.cpp */; };
+ 22B2515E12F234FF0059A0E8 /* SBaseDumpData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 22B2515D12F234FF0059A0E8 /* SBaseDumpData.cpp */; };
+ 22B2515F12F234FF0059A0E8 /* SBaseDumpData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 22B2515D12F234FF0059A0E8 /* SBaseDumpData.cpp */; };
+ 22C9187D11933FCF0083AC69 /* hash_memory.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9182B11933FCF0083AC69 /* hash_memory.c */; };
+ 22C9187E11933FCF0083AC69 /* md5.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9182C11933FCF0083AC69 /* md5.c */; };
+ 22C9187F11933FCF0083AC69 /* sha1.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9182D11933FCF0083AC69 /* sha1.c */; };
+ 22C9188011933FCF0083AC69 /* tomcrypt.h in Headers */ = {isa = PBXBuildFile; fileRef = 22C9182F11933FCF0083AC69 /* tomcrypt.h */; };
+ 22C9188111933FCF0083AC69 /* tomcrypt_argchk.h in Headers */ = {isa = PBXBuildFile; fileRef = 22C9183011933FCF0083AC69 /* tomcrypt_argchk.h */; };
+ 22C9188211933FCF0083AC69 /* tomcrypt_cfg.h in Headers */ = {isa = PBXBuildFile; fileRef = 22C9183111933FCF0083AC69 /* tomcrypt_cfg.h */; };
+ 22C9188311933FCF0083AC69 /* tomcrypt_cipher.h in Headers */ = {isa = PBXBuildFile; fileRef = 22C9183211933FCF0083AC69 /* tomcrypt_cipher.h */; };
+ 22C9188411933FCF0083AC69 /* tomcrypt_custom.h in Headers */ = {isa = PBXBuildFile; fileRef = 22C9183311933FCF0083AC69 /* tomcrypt_custom.h */; };
+ 22C9188511933FCF0083AC69 /* tomcrypt_hash.h in Headers */ = {isa = PBXBuildFile; fileRef = 22C9183411933FCF0083AC69 /* tomcrypt_hash.h */; };
+ 22C9188611933FCF0083AC69 /* tomcrypt_mac.h in Headers */ = {isa = PBXBuildFile; fileRef = 22C9183511933FCF0083AC69 /* tomcrypt_mac.h */; };
+ 22C9188711933FCF0083AC69 /* tomcrypt_macros.h in Headers */ = {isa = PBXBuildFile; fileRef = 22C9183611933FCF0083AC69 /* tomcrypt_macros.h */; };
+ 22C9188811933FCF0083AC69 /* tomcrypt_math.h in Headers */ = {isa = PBXBuildFile; fileRef = 22C9183711933FCF0083AC69 /* tomcrypt_math.h */; };
+ 22C9188911933FCF0083AC69 /* tomcrypt_misc.h in Headers */ = {isa = PBXBuildFile; fileRef = 22C9183811933FCF0083AC69 /* tomcrypt_misc.h */; };
+ 22C9188A11933FCF0083AC69 /* tomcrypt_pk.h in Headers */ = {isa = PBXBuildFile; fileRef = 22C9183911933FCF0083AC69 /* tomcrypt_pk.h */; };
+ 22C9188B11933FCF0083AC69 /* tomcrypt_pkcs.h in Headers */ = {isa = PBXBuildFile; fileRef = 22C9183A11933FCF0083AC69 /* tomcrypt_pkcs.h */; };
+ 22C9188C11933FCF0083AC69 /* tomcrypt_prng.h in Headers */ = {isa = PBXBuildFile; fileRef = 22C9183B11933FCF0083AC69 /* tomcrypt_prng.h */; };
+ 22C9188D11933FCF0083AC69 /* ltm_desc.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9183D11933FCF0083AC69 /* ltm_desc.c */; };
+ 22C9188E11933FCF0083AC69 /* multi.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9183E11933FCF0083AC69 /* multi.c */; };
+ 22C9188F11933FCF0083AC69 /* rand_prime.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9183F11933FCF0083AC69 /* rand_prime.c */; };
+ 22C9189011933FCF0083AC69 /* base64_decode.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9184111933FCF0083AC69 /* base64_decode.c */; };
+ 22C9189111933FCF0083AC69 /* crypt_argchk.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9184211933FCF0083AC69 /* crypt_argchk.c */; };
+ 22C9189211933FCF0083AC69 /* crypt_find_hash.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9184311933FCF0083AC69 /* crypt_find_hash.c */; };
+ 22C9189311933FCF0083AC69 /* crypt_find_prng.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9184411933FCF0083AC69 /* crypt_find_prng.c */; };
+ 22C9189411933FCF0083AC69 /* crypt_hash_descriptor.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9184511933FCF0083AC69 /* crypt_hash_descriptor.c */; };
+ 22C9189511933FCF0083AC69 /* crypt_hash_is_valid.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9184611933FCF0083AC69 /* crypt_hash_is_valid.c */; };
+ 22C9189611933FCF0083AC69 /* crypt_libc.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9184711933FCF0083AC69 /* crypt_libc.c */; };
+ 22C9189811933FCF0083AC69 /* crypt_prng_descriptor.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9184911933FCF0083AC69 /* crypt_prng_descriptor.c */; };
+ 22C9189911933FCF0083AC69 /* crypt_prng_is_valid.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9184A11933FCF0083AC69 /* crypt_prng_is_valid.c */; };
+ 22C9189A11933FCF0083AC69 /* crypt_register_hash.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9184B11933FCF0083AC69 /* crypt_register_hash.c */; };
+ 22C9189B11933FCF0083AC69 /* crypt_register_prng.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9184C11933FCF0083AC69 /* crypt_register_prng.c */; };
+ 22C9189C11933FCF0083AC69 /* zeromem.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9184D11933FCF0083AC69 /* zeromem.c */; };
+ 22C9189D11933FCF0083AC69 /* der_decode_bit_string.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9185011933FCF0083AC69 /* der_decode_bit_string.c */; };
+ 22C9189E11933FCF0083AC69 /* der_decode_boolean.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9185111933FCF0083AC69 /* der_decode_boolean.c */; };
+ 22C9189F11933FCF0083AC69 /* der_decode_choice.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9185211933FCF0083AC69 /* der_decode_choice.c */; };
+ 22C918A011933FCF0083AC69 /* der_decode_ia5_string.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9185311933FCF0083AC69 /* der_decode_ia5_string.c */; };
+ 22C918A111933FCF0083AC69 /* der_decode_integer.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9185411933FCF0083AC69 /* der_decode_integer.c */; };
+ 22C918A211933FCF0083AC69 /* der_decode_object_identifier.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9185511933FCF0083AC69 /* der_decode_object_identifier.c */; };
+ 22C918A311933FCF0083AC69 /* der_decode_octet_string.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9185611933FCF0083AC69 /* der_decode_octet_string.c */; };
+ 22C918A411933FCF0083AC69 /* der_decode_printable_string.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9185711933FCF0083AC69 /* der_decode_printable_string.c */; };
+ 22C918A511933FCF0083AC69 /* der_decode_sequence_ex.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9185811933FCF0083AC69 /* der_decode_sequence_ex.c */; };
+ 22C918A611933FCF0083AC69 /* der_decode_sequence_flexi.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9185911933FCF0083AC69 /* der_decode_sequence_flexi.c */; };
+ 22C918A711933FCF0083AC69 /* der_decode_sequence_multi.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9185A11933FCF0083AC69 /* der_decode_sequence_multi.c */; };
+ 22C918A811933FCF0083AC69 /* der_decode_short_integer.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9185B11933FCF0083AC69 /* der_decode_short_integer.c */; };
+ 22C918A911933FCF0083AC69 /* der_decode_utctime.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9185C11933FCF0083AC69 /* der_decode_utctime.c */; };
+ 22C918AA11933FCF0083AC69 /* der_decode_utf8_string.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9185D11933FCF0083AC69 /* der_decode_utf8_string.c */; };
+ 22C918AB11933FCF0083AC69 /* der_length_bit_string.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9185E11933FCF0083AC69 /* der_length_bit_string.c */; };
+ 22C918AC11933FCF0083AC69 /* der_length_boolean.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9185F11933FCF0083AC69 /* der_length_boolean.c */; };
+ 22C918AD11933FCF0083AC69 /* der_length_ia5_string.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9186011933FCF0083AC69 /* der_length_ia5_string.c */; };
+ 22C918AE11933FCF0083AC69 /* der_length_integer.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9186111933FCF0083AC69 /* der_length_integer.c */; };
+ 22C918AF11933FCF0083AC69 /* der_length_object_identifier.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9186211933FCF0083AC69 /* der_length_object_identifier.c */; };
+ 22C918B011933FCF0083AC69 /* der_length_octet_string.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9186311933FCF0083AC69 /* der_length_octet_string.c */; };
+ 22C918B111933FCF0083AC69 /* der_length_printable_string.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9186411933FCF0083AC69 /* der_length_printable_string.c */; };
+ 22C918B211933FCF0083AC69 /* der_length_sequence.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9186511933FCF0083AC69 /* der_length_sequence.c */; };
+ 22C918B311933FCF0083AC69 /* der_length_short_integer.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9186611933FCF0083AC69 /* der_length_short_integer.c */; };
+ 22C918B411933FCF0083AC69 /* der_length_utctime.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9186711933FCF0083AC69 /* der_length_utctime.c */; };
+ 22C918B511933FCF0083AC69 /* der_length_utf8_string.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9186811933FCF0083AC69 /* der_length_utf8_string.c */; };
+ 22C918B611933FCF0083AC69 /* der_sequence_free.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9186911933FCF0083AC69 /* der_sequence_free.c */; };
+ 22C918B711933FCF0083AC69 /* ltc_ecc_map.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9186B11933FCF0083AC69 /* ltc_ecc_map.c */; };
+ 22C918B811933FCF0083AC69 /* ltc_ecc_mul2add.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9186C11933FCF0083AC69 /* ltc_ecc_mul2add.c */; };
+ 22C918B911933FCF0083AC69 /* ltc_ecc_mulmod.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9186D11933FCF0083AC69 /* ltc_ecc_mulmod.c */; };
+ 22C918BA11933FCF0083AC69 /* ltc_ecc_points.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9186E11933FCF0083AC69 /* ltc_ecc_points.c */; };
+ 22C918BB11933FCF0083AC69 /* ltc_ecc_projective_add_point.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9186F11933FCF0083AC69 /* ltc_ecc_projective_add_point.c */; };
+ 22C918BC11933FCF0083AC69 /* ltc_ecc_projective_dbl_point.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9187011933FCF0083AC69 /* ltc_ecc_projective_dbl_point.c */; };
+ 22C918BD11933FCF0083AC69 /* pkcs_1_mgf1.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9187211933FCF0083AC69 /* pkcs_1_mgf1.c */; };
+ 22C918BE11933FCF0083AC69 /* pkcs_1_oaep_decode.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9187311933FCF0083AC69 /* pkcs_1_oaep_decode.c */; };
+ 22C918BF11933FCF0083AC69 /* pkcs_1_pss_decode.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9187411933FCF0083AC69 /* pkcs_1_pss_decode.c */; };
+ 22C918C011933FCF0083AC69 /* pkcs_1_v1_5_decode.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9187511933FCF0083AC69 /* pkcs_1_v1_5_decode.c */; };
+ 22C918C111933FCF0083AC69 /* rsa_exptmod.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9187711933FCF0083AC69 /* rsa_exptmod.c */; };
+ 22C918C211933FCF0083AC69 /* rsa_free.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9187811933FCF0083AC69 /* rsa_free.c */; };
+ 22C918C311933FCF0083AC69 /* rsa_import.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9187911933FCF0083AC69 /* rsa_import.c */; };
+ 22C918C411933FCF0083AC69 /* rsa_make_key.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9187A11933FCF0083AC69 /* rsa_make_key.c */; };
+ 22C918C511933FCF0083AC69 /* rsa_verify_hash.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9187B11933FCF0083AC69 /* rsa_verify_hash.c */; };
+ 22C918C611933FCF0083AC69 /* rsa_verify_simple.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9187C11933FCF0083AC69 /* rsa_verify_simple.c */; };
+ 22C918C711933FCF0083AC69 /* hash_memory.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9182B11933FCF0083AC69 /* hash_memory.c */; };
+ 22C918C811933FCF0083AC69 /* md5.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9182C11933FCF0083AC69 /* md5.c */; };
+ 22C918C911933FCF0083AC69 /* sha1.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9182D11933FCF0083AC69 /* sha1.c */; };
+ 22C918CA11933FCF0083AC69 /* tomcrypt.h in Headers */ = {isa = PBXBuildFile; fileRef = 22C9182F11933FCF0083AC69 /* tomcrypt.h */; };
+ 22C918CB11933FCF0083AC69 /* tomcrypt_argchk.h in Headers */ = {isa = PBXBuildFile; fileRef = 22C9183011933FCF0083AC69 /* tomcrypt_argchk.h */; };
+ 22C918CC11933FCF0083AC69 /* tomcrypt_cfg.h in Headers */ = {isa = PBXBuildFile; fileRef = 22C9183111933FCF0083AC69 /* tomcrypt_cfg.h */; };
+ 22C918CD11933FCF0083AC69 /* tomcrypt_cipher.h in Headers */ = {isa = PBXBuildFile; fileRef = 22C9183211933FCF0083AC69 /* tomcrypt_cipher.h */; };
+ 22C918CE11933FCF0083AC69 /* tomcrypt_custom.h in Headers */ = {isa = PBXBuildFile; fileRef = 22C9183311933FCF0083AC69 /* tomcrypt_custom.h */; };
+ 22C918CF11933FCF0083AC69 /* tomcrypt_hash.h in Headers */ = {isa = PBXBuildFile; fileRef = 22C9183411933FCF0083AC69 /* tomcrypt_hash.h */; };
+ 22C918D011933FCF0083AC69 /* tomcrypt_mac.h in Headers */ = {isa = PBXBuildFile; fileRef = 22C9183511933FCF0083AC69 /* tomcrypt_mac.h */; };
+ 22C918D111933FCF0083AC69 /* tomcrypt_macros.h in Headers */ = {isa = PBXBuildFile; fileRef = 22C9183611933FCF0083AC69 /* tomcrypt_macros.h */; };
+ 22C918D211933FCF0083AC69 /* tomcrypt_math.h in Headers */ = {isa = PBXBuildFile; fileRef = 22C9183711933FCF0083AC69 /* tomcrypt_math.h */; };
+ 22C918D311933FCF0083AC69 /* tomcrypt_misc.h in Headers */ = {isa = PBXBuildFile; fileRef = 22C9183811933FCF0083AC69 /* tomcrypt_misc.h */; };
+ 22C918D411933FCF0083AC69 /* tomcrypt_pk.h in Headers */ = {isa = PBXBuildFile; fileRef = 22C9183911933FCF0083AC69 /* tomcrypt_pk.h */; };
+ 22C918D511933FCF0083AC69 /* tomcrypt_pkcs.h in Headers */ = {isa = PBXBuildFile; fileRef = 22C9183A11933FCF0083AC69 /* tomcrypt_pkcs.h */; };
+ 22C918D611933FCF0083AC69 /* tomcrypt_prng.h in Headers */ = {isa = PBXBuildFile; fileRef = 22C9183B11933FCF0083AC69 /* tomcrypt_prng.h */; };
+ 22C918D711933FCF0083AC69 /* ltm_desc.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9183D11933FCF0083AC69 /* ltm_desc.c */; };
+ 22C918D811933FCF0083AC69 /* multi.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9183E11933FCF0083AC69 /* multi.c */; };
+ 22C918D911933FCF0083AC69 /* rand_prime.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9183F11933FCF0083AC69 /* rand_prime.c */; };
+ 22C918DA11933FCF0083AC69 /* base64_decode.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9184111933FCF0083AC69 /* base64_decode.c */; };
+ 22C918DB11933FCF0083AC69 /* crypt_argchk.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9184211933FCF0083AC69 /* crypt_argchk.c */; };
+ 22C918DC11933FCF0083AC69 /* crypt_find_hash.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9184311933FCF0083AC69 /* crypt_find_hash.c */; };
+ 22C918DD11933FCF0083AC69 /* crypt_find_prng.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9184411933FCF0083AC69 /* crypt_find_prng.c */; };
+ 22C918DE11933FCF0083AC69 /* crypt_hash_descriptor.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9184511933FCF0083AC69 /* crypt_hash_descriptor.c */; };
+ 22C918DF11933FCF0083AC69 /* crypt_hash_is_valid.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9184611933FCF0083AC69 /* crypt_hash_is_valid.c */; };
+ 22C918E011933FCF0083AC69 /* crypt_libc.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9184711933FCF0083AC69 /* crypt_libc.c */; };
+ 22C918E111933FCF0083AC69 /* crypt_ltc_mp_descriptor.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9184811933FCF0083AC69 /* crypt_ltc_mp_descriptor.c */; };
+ 22C918E211933FCF0083AC69 /* crypt_prng_descriptor.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9184911933FCF0083AC69 /* crypt_prng_descriptor.c */; };
+ 22C918E311933FCF0083AC69 /* crypt_prng_is_valid.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9184A11933FCF0083AC69 /* crypt_prng_is_valid.c */; };
+ 22C918E411933FCF0083AC69 /* crypt_register_hash.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9184B11933FCF0083AC69 /* crypt_register_hash.c */; };
+ 22C918E511933FCF0083AC69 /* crypt_register_prng.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9184C11933FCF0083AC69 /* crypt_register_prng.c */; };
+ 22C918E611933FCF0083AC69 /* zeromem.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9184D11933FCF0083AC69 /* zeromem.c */; };
+ 22C918E711933FCF0083AC69 /* der_decode_bit_string.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9185011933FCF0083AC69 /* der_decode_bit_string.c */; };
+ 22C918E811933FCF0083AC69 /* der_decode_boolean.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9185111933FCF0083AC69 /* der_decode_boolean.c */; };
+ 22C918E911933FCF0083AC69 /* der_decode_choice.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9185211933FCF0083AC69 /* der_decode_choice.c */; };
+ 22C918EA11933FCF0083AC69 /* der_decode_ia5_string.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9185311933FCF0083AC69 /* der_decode_ia5_string.c */; };
+ 22C918EB11933FCF0083AC69 /* der_decode_integer.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9185411933FCF0083AC69 /* der_decode_integer.c */; };
+ 22C918EC11933FCF0083AC69 /* der_decode_object_identifier.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9185511933FCF0083AC69 /* der_decode_object_identifier.c */; };
+ 22C918ED11933FCF0083AC69 /* der_decode_octet_string.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9185611933FCF0083AC69 /* der_decode_octet_string.c */; };
+ 22C918EE11933FCF0083AC69 /* der_decode_printable_string.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9185711933FCF0083AC69 /* der_decode_printable_string.c */; };
+ 22C918EF11933FCF0083AC69 /* der_decode_sequence_ex.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9185811933FCF0083AC69 /* der_decode_sequence_ex.c */; };
+ 22C918F011933FCF0083AC69 /* der_decode_sequence_flexi.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9185911933FCF0083AC69 /* der_decode_sequence_flexi.c */; };
+ 22C918F111933FCF0083AC69 /* der_decode_sequence_multi.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9185A11933FCF0083AC69 /* der_decode_sequence_multi.c */; };
+ 22C918F211933FCF0083AC69 /* der_decode_short_integer.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9185B11933FCF0083AC69 /* der_decode_short_integer.c */; };
+ 22C918F311933FCF0083AC69 /* der_decode_utctime.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9185C11933FCF0083AC69 /* der_decode_utctime.c */; };
+ 22C918F411933FCF0083AC69 /* der_decode_utf8_string.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9185D11933FCF0083AC69 /* der_decode_utf8_string.c */; };
+ 22C918F511933FCF0083AC69 /* der_length_bit_string.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9185E11933FCF0083AC69 /* der_length_bit_string.c */; };
+ 22C918F611933FCF0083AC69 /* der_length_boolean.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9185F11933FCF0083AC69 /* der_length_boolean.c */; };
+ 22C918F711933FCF0083AC69 /* der_length_ia5_string.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9186011933FCF0083AC69 /* der_length_ia5_string.c */; };
+ 22C918F811933FCF0083AC69 /* der_length_integer.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9186111933FCF0083AC69 /* der_length_integer.c */; };
+ 22C918F911933FCF0083AC69 /* der_length_object_identifier.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9186211933FCF0083AC69 /* der_length_object_identifier.c */; };
+ 22C918FA11933FCF0083AC69 /* der_length_octet_string.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9186311933FCF0083AC69 /* der_length_octet_string.c */; };
+ 22C918FB11933FCF0083AC69 /* der_length_printable_string.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9186411933FCF0083AC69 /* der_length_printable_string.c */; };
+ 22C918FC11933FCF0083AC69 /* der_length_sequence.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9186511933FCF0083AC69 /* der_length_sequence.c */; };
+ 22C918FD11933FCF0083AC69 /* der_length_short_integer.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9186611933FCF0083AC69 /* der_length_short_integer.c */; };
+ 22C918FE11933FCF0083AC69 /* der_length_utctime.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9186711933FCF0083AC69 /* der_length_utctime.c */; };
+ 22C918FF11933FCF0083AC69 /* der_length_utf8_string.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9186811933FCF0083AC69 /* der_length_utf8_string.c */; };
+ 22C9190011933FCF0083AC69 /* der_sequence_free.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9186911933FCF0083AC69 /* der_sequence_free.c */; };
+ 22C9190111933FCF0083AC69 /* ltc_ecc_map.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9186B11933FCF0083AC69 /* ltc_ecc_map.c */; };
+ 22C9190211933FCF0083AC69 /* ltc_ecc_mul2add.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9186C11933FCF0083AC69 /* ltc_ecc_mul2add.c */; };
+ 22C9190311933FCF0083AC69 /* ltc_ecc_mulmod.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9186D11933FCF0083AC69 /* ltc_ecc_mulmod.c */; };
+ 22C9190411933FCF0083AC69 /* ltc_ecc_points.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9186E11933FCF0083AC69 /* ltc_ecc_points.c */; };
+ 22C9190511933FCF0083AC69 /* ltc_ecc_projective_add_point.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9186F11933FCF0083AC69 /* ltc_ecc_projective_add_point.c */; };
+ 22C9190611933FCF0083AC69 /* ltc_ecc_projective_dbl_point.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9187011933FCF0083AC69 /* ltc_ecc_projective_dbl_point.c */; };
+ 22C9190711933FCF0083AC69 /* pkcs_1_mgf1.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9187211933FCF0083AC69 /* pkcs_1_mgf1.c */; };
+ 22C9190811933FCF0083AC69 /* pkcs_1_oaep_decode.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9187311933FCF0083AC69 /* pkcs_1_oaep_decode.c */; };
+ 22C9190911933FCF0083AC69 /* pkcs_1_pss_decode.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9187411933FCF0083AC69 /* pkcs_1_pss_decode.c */; };
+ 22C9190A11933FCF0083AC69 /* pkcs_1_v1_5_decode.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9187511933FCF0083AC69 /* pkcs_1_v1_5_decode.c */; };
+ 22C9190B11933FCF0083AC69 /* rsa_exptmod.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9187711933FCF0083AC69 /* rsa_exptmod.c */; };
+ 22C9190C11933FCF0083AC69 /* rsa_free.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9187811933FCF0083AC69 /* rsa_free.c */; };
+ 22C9190D11933FCF0083AC69 /* rsa_import.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9187911933FCF0083AC69 /* rsa_import.c */; };
+ 22C9190E11933FCF0083AC69 /* rsa_make_key.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9187A11933FCF0083AC69 /* rsa_make_key.c */; };
+ 22C9190F11933FCF0083AC69 /* rsa_verify_hash.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9187B11933FCF0083AC69 /* rsa_verify_hash.c */; };
+ 22C9191011933FCF0083AC69 /* rsa_verify_simple.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9187C11933FCF0083AC69 /* rsa_verify_simple.c */; };
+ 22C9198A1193400A0083AC69 /* bn_fast_mp_invmod.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919111193400A0083AC69 /* bn_fast_mp_invmod.c */; };
+ 22C9198B1193400A0083AC69 /* bn_fast_mp_montgomery_reduce.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919121193400A0083AC69 /* bn_fast_mp_montgomery_reduce.c */; };
+ 22C9198C1193400A0083AC69 /* bn_fast_s_mp_mul_digs.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919131193400A0083AC69 /* bn_fast_s_mp_mul_digs.c */; };
+ 22C9198D1193400A0083AC69 /* bn_fast_s_mp_mul_high_digs.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919141193400A0083AC69 /* bn_fast_s_mp_mul_high_digs.c */; };
+ 22C9198E1193400A0083AC69 /* bn_fast_s_mp_sqr.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919151193400A0083AC69 /* bn_fast_s_mp_sqr.c */; };
+ 22C9198F1193400A0083AC69 /* bn_mp_2expt.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919161193400A0083AC69 /* bn_mp_2expt.c */; };
+ 22C919901193400A0083AC69 /* bn_mp_abs.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919171193400A0083AC69 /* bn_mp_abs.c */; };
+ 22C919911193400A0083AC69 /* bn_mp_add_d.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919181193400A0083AC69 /* bn_mp_add_d.c */; };
+ 22C919921193400A0083AC69 /* bn_mp_add.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919191193400A0083AC69 /* bn_mp_add.c */; };
+ 22C919931193400A0083AC69 /* bn_mp_addmod.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9191A1193400A0083AC69 /* bn_mp_addmod.c */; };
+ 22C919941193400A0083AC69 /* bn_mp_and.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9191B1193400A0083AC69 /* bn_mp_and.c */; };
+ 22C919951193400A0083AC69 /* bn_mp_clamp.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9191C1193400A0083AC69 /* bn_mp_clamp.c */; };
+ 22C919961193400A0083AC69 /* bn_mp_clear_multi.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9191D1193400A0083AC69 /* bn_mp_clear_multi.c */; };
+ 22C919971193400A0083AC69 /* bn_mp_clear.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9191E1193400A0083AC69 /* bn_mp_clear.c */; };
+ 22C919981193400A0083AC69 /* bn_mp_cmp_d.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9191F1193400A0083AC69 /* bn_mp_cmp_d.c */; };
+ 22C919991193400A0083AC69 /* bn_mp_cmp_mag.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919201193400A0083AC69 /* bn_mp_cmp_mag.c */; };
+ 22C9199A1193400A0083AC69 /* bn_mp_cmp.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919211193400A0083AC69 /* bn_mp_cmp.c */; };
+ 22C9199B1193400A0083AC69 /* bn_mp_cnt_lsb.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919221193400A0083AC69 /* bn_mp_cnt_lsb.c */; };
+ 22C9199C1193400A0083AC69 /* bn_mp_copy.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919231193400A0083AC69 /* bn_mp_copy.c */; };
+ 22C9199D1193400A0083AC69 /* bn_mp_count_bits.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919241193400A0083AC69 /* bn_mp_count_bits.c */; };
+ 22C9199E1193400A0083AC69 /* bn_mp_div_2.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919251193400A0083AC69 /* bn_mp_div_2.c */; };
+ 22C9199F1193400A0083AC69 /* bn_mp_div_2d.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919261193400A0083AC69 /* bn_mp_div_2d.c */; };
+ 22C919A01193400A0083AC69 /* bn_mp_div_3.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919271193400A0083AC69 /* bn_mp_div_3.c */; };
+ 22C919A11193400A0083AC69 /* bn_mp_div_d.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919281193400A0083AC69 /* bn_mp_div_d.c */; };
+ 22C919A21193400A0083AC69 /* bn_mp_div.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919291193400A0083AC69 /* bn_mp_div.c */; };
+ 22C919A31193400A0083AC69 /* bn_mp_dr_is_modulus.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9192A1193400A0083AC69 /* bn_mp_dr_is_modulus.c */; };
+ 22C919A41193400A0083AC69 /* bn_mp_dr_reduce.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9192B1193400A0083AC69 /* bn_mp_dr_reduce.c */; };
+ 22C919A51193400A0083AC69 /* bn_mp_dr_setup.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9192C1193400A0083AC69 /* bn_mp_dr_setup.c */; };
+ 22C919A61193400A0083AC69 /* bn_mp_exch.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9192D1193400A0083AC69 /* bn_mp_exch.c */; };
+ 22C919A71193400A0083AC69 /* bn_mp_expt_d.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9192E1193400A0083AC69 /* bn_mp_expt_d.c */; };
+ 22C919A81193400A0083AC69 /* bn_mp_exptmod_fast.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9192F1193400A0083AC69 /* bn_mp_exptmod_fast.c */; };
+ 22C919A91193400A0083AC69 /* bn_mp_exptmod.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919301193400A0083AC69 /* bn_mp_exptmod.c */; };
+ 22C919AA1193400A0083AC69 /* bn_mp_exteuclid.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919311193400A0083AC69 /* bn_mp_exteuclid.c */; };
+ 22C919AB1193400A0083AC69 /* bn_mp_fread.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919321193400A0083AC69 /* bn_mp_fread.c */; };
+ 22C919AC1193400A0083AC69 /* bn_mp_fwrite.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919331193400A0083AC69 /* bn_mp_fwrite.c */; };
+ 22C919AD1193400A0083AC69 /* bn_mp_gcd.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919341193400A0083AC69 /* bn_mp_gcd.c */; };
+ 22C919AE1193400A0083AC69 /* bn_mp_get_int.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919351193400A0083AC69 /* bn_mp_get_int.c */; };
+ 22C919AF1193400A0083AC69 /* bn_mp_grow.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919361193400A0083AC69 /* bn_mp_grow.c */; };
+ 22C919B01193400A0083AC69 /* bn_mp_init_copy.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919371193400A0083AC69 /* bn_mp_init_copy.c */; };
+ 22C919B11193400A0083AC69 /* bn_mp_init_multi.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919381193400A0083AC69 /* bn_mp_init_multi.c */; };
+ 22C919B21193400A0083AC69 /* bn_mp_init_set_int.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919391193400A0083AC69 /* bn_mp_init_set_int.c */; };
+ 22C919B31193400A0083AC69 /* bn_mp_init_set.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9193A1193400A0083AC69 /* bn_mp_init_set.c */; };
+ 22C919B41193400A0083AC69 /* bn_mp_init_size.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9193B1193400A0083AC69 /* bn_mp_init_size.c */; };
+ 22C919B51193400A0083AC69 /* bn_mp_init.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9193C1193400A0083AC69 /* bn_mp_init.c */; };
+ 22C919B61193400A0083AC69 /* bn_mp_invmod_slow.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9193D1193400A0083AC69 /* bn_mp_invmod_slow.c */; };
+ 22C919B71193400A0083AC69 /* bn_mp_invmod.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9193E1193400A0083AC69 /* bn_mp_invmod.c */; };
+ 22C919B81193400A0083AC69 /* bn_mp_is_square.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9193F1193400A0083AC69 /* bn_mp_is_square.c */; };
+ 22C919B91193400A0083AC69 /* bn_mp_jacobi.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919401193400A0083AC69 /* bn_mp_jacobi.c */; };
+ 22C919BA1193400A0083AC69 /* bn_mp_karatsuba_mul.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919411193400A0083AC69 /* bn_mp_karatsuba_mul.c */; };
+ 22C919BB1193400A0083AC69 /* bn_mp_karatsuba_sqr.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919421193400A0083AC69 /* bn_mp_karatsuba_sqr.c */; };
+ 22C919BC1193400A0083AC69 /* bn_mp_lcm.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919431193400A0083AC69 /* bn_mp_lcm.c */; };
+ 22C919BD1193400A0083AC69 /* bn_mp_lshd.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919441193400A0083AC69 /* bn_mp_lshd.c */; };
+ 22C919BE1193400A0083AC69 /* bn_mp_mod_2d.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919451193400A0083AC69 /* bn_mp_mod_2d.c */; };
+ 22C919BF1193400A0083AC69 /* bn_mp_mod_d.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919461193400A0083AC69 /* bn_mp_mod_d.c */; };
+ 22C919C01193400A0083AC69 /* bn_mp_mod.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919471193400A0083AC69 /* bn_mp_mod.c */; };
+ 22C919C11193400A0083AC69 /* bn_mp_montgomery_calc_normalization.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919481193400A0083AC69 /* bn_mp_montgomery_calc_normalization.c */; };
+ 22C919C21193400A0083AC69 /* bn_mp_montgomery_reduce.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919491193400A0083AC69 /* bn_mp_montgomery_reduce.c */; };
+ 22C919C31193400A0083AC69 /* bn_mp_montgomery_setup.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9194A1193400A0083AC69 /* bn_mp_montgomery_setup.c */; };
+ 22C919C41193400A0083AC69 /* bn_mp_mul_2.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9194B1193400A0083AC69 /* bn_mp_mul_2.c */; };
+ 22C919C51193400A0083AC69 /* bn_mp_mul_2d.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9194C1193400A0083AC69 /* bn_mp_mul_2d.c */; };
+ 22C919C61193400A0083AC69 /* bn_mp_mul_d.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9194D1193400A0083AC69 /* bn_mp_mul_d.c */; };
+ 22C919C71193400A0083AC69 /* bn_mp_mul.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9194E1193400A0083AC69 /* bn_mp_mul.c */; };
+ 22C919C81193400A0083AC69 /* bn_mp_mulmod.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9194F1193400A0083AC69 /* bn_mp_mulmod.c */; };
+ 22C919C91193400A0083AC69 /* bn_mp_n_root.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919501193400A0083AC69 /* bn_mp_n_root.c */; };
+ 22C919CA1193400A0083AC69 /* bn_mp_neg.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919511193400A0083AC69 /* bn_mp_neg.c */; };
+ 22C919CB1193400A0083AC69 /* bn_mp_or.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919521193400A0083AC69 /* bn_mp_or.c */; };
+ 22C919CC1193400A0083AC69 /* bn_mp_prime_fermat.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919531193400A0083AC69 /* bn_mp_prime_fermat.c */; };
+ 22C919CD1193400A0083AC69 /* bn_mp_prime_is_divisible.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919541193400A0083AC69 /* bn_mp_prime_is_divisible.c */; };
+ 22C919CE1193400A0083AC69 /* bn_mp_prime_is_prime.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919551193400A0083AC69 /* bn_mp_prime_is_prime.c */; };
+ 22C919CF1193400A0083AC69 /* bn_mp_prime_miller_rabin.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919561193400A0083AC69 /* bn_mp_prime_miller_rabin.c */; };
+ 22C919D01193400A0083AC69 /* bn_mp_prime_next_prime.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919571193400A0083AC69 /* bn_mp_prime_next_prime.c */; };
+ 22C919D11193400A0083AC69 /* bn_mp_prime_rabin_miller_trials.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919581193400A0083AC69 /* bn_mp_prime_rabin_miller_trials.c */; };
+ 22C919D21193400A0083AC69 /* bn_mp_prime_random_ex.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919591193400A0083AC69 /* bn_mp_prime_random_ex.c */; };
+ 22C919D31193400A0083AC69 /* bn_mp_radix_size.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9195A1193400A0083AC69 /* bn_mp_radix_size.c */; };
+ 22C919D41193400A0083AC69 /* bn_mp_radix_smap.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9195B1193400A0083AC69 /* bn_mp_radix_smap.c */; };
+ 22C919D51193400A0083AC69 /* bn_mp_rand.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9195C1193400A0083AC69 /* bn_mp_rand.c */; };
+ 22C919D61193400A0083AC69 /* bn_mp_read_radix.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9195D1193400A0083AC69 /* bn_mp_read_radix.c */; };
+ 22C919D71193400A0083AC69 /* bn_mp_read_signed_bin.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9195E1193400A0083AC69 /* bn_mp_read_signed_bin.c */; };
+ 22C919D81193400A0083AC69 /* bn_mp_read_unsigned_bin.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9195F1193400A0083AC69 /* bn_mp_read_unsigned_bin.c */; };
+ 22C919D91193400A0083AC69 /* bn_mp_reduce_2k_l.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919601193400A0083AC69 /* bn_mp_reduce_2k_l.c */; };
+ 22C919DA1193400A0083AC69 /* bn_mp_reduce_2k_setup_l.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919611193400A0083AC69 /* bn_mp_reduce_2k_setup_l.c */; };
+ 22C919DB1193400A0083AC69 /* bn_mp_reduce_2k_setup.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919621193400A0083AC69 /* bn_mp_reduce_2k_setup.c */; };
+ 22C919DC1193400A0083AC69 /* bn_mp_reduce_2k.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919631193400A0083AC69 /* bn_mp_reduce_2k.c */; };
+ 22C919DD1193400A0083AC69 /* bn_mp_reduce_is_2k_l.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919641193400A0083AC69 /* bn_mp_reduce_is_2k_l.c */; };
+ 22C919DE1193400A0083AC69 /* bn_mp_reduce_is_2k.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919651193400A0083AC69 /* bn_mp_reduce_is_2k.c */; };
+ 22C919DF1193400A0083AC69 /* bn_mp_reduce_setup.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919661193400A0083AC69 /* bn_mp_reduce_setup.c */; };
+ 22C919E01193400A0083AC69 /* bn_mp_reduce.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919671193400A0083AC69 /* bn_mp_reduce.c */; };
+ 22C919E11193400A0083AC69 /* bn_mp_rshd.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919681193400A0083AC69 /* bn_mp_rshd.c */; };
+ 22C919E21193400A0083AC69 /* bn_mp_set_int.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919691193400A0083AC69 /* bn_mp_set_int.c */; };
+ 22C919E31193400A0083AC69 /* bn_mp_set.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9196A1193400A0083AC69 /* bn_mp_set.c */; };
+ 22C919E41193400A0083AC69 /* bn_mp_shrink.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9196B1193400A0083AC69 /* bn_mp_shrink.c */; };
+ 22C919E51193400A0083AC69 /* bn_mp_signed_bin_size.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9196C1193400A0083AC69 /* bn_mp_signed_bin_size.c */; };
+ 22C919E61193400A0083AC69 /* bn_mp_sqr.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9196D1193400A0083AC69 /* bn_mp_sqr.c */; };
+ 22C919E71193400A0083AC69 /* bn_mp_sqrmod.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9196E1193400A0083AC69 /* bn_mp_sqrmod.c */; };
+ 22C919E81193400A0083AC69 /* bn_mp_sqrt.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9196F1193400A0083AC69 /* bn_mp_sqrt.c */; };
+ 22C919E91193400A0083AC69 /* bn_mp_sub_d.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919701193400A0083AC69 /* bn_mp_sub_d.c */; };
+ 22C919EA1193400A0083AC69 /* bn_mp_sub.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919711193400A0083AC69 /* bn_mp_sub.c */; };
+ 22C919EB1193400A0083AC69 /* bn_mp_submod.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919721193400A0083AC69 /* bn_mp_submod.c */; };
+ 22C919EC1193400A0083AC69 /* bn_mp_to_signed_bin_n.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919731193400A0083AC69 /* bn_mp_to_signed_bin_n.c */; };
+ 22C919ED1193400A0083AC69 /* bn_mp_to_signed_bin.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919741193400A0083AC69 /* bn_mp_to_signed_bin.c */; };
+ 22C919EE1193400A0083AC69 /* bn_mp_to_unsigned_bin_n.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919751193400A0083AC69 /* bn_mp_to_unsigned_bin_n.c */; };
+ 22C919EF1193400A0083AC69 /* bn_mp_to_unsigned_bin.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919761193400A0083AC69 /* bn_mp_to_unsigned_bin.c */; };
+ 22C919F01193400A0083AC69 /* bn_mp_toom_mul.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919771193400A0083AC69 /* bn_mp_toom_mul.c */; };
+ 22C919F11193400A0083AC69 /* bn_mp_toom_sqr.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919781193400A0083AC69 /* bn_mp_toom_sqr.c */; };
+ 22C919F21193400A0083AC69 /* bn_mp_toradix_n.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919791193400A0083AC69 /* bn_mp_toradix_n.c */; };
+ 22C919F31193400A0083AC69 /* bn_mp_toradix.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9197A1193400A0083AC69 /* bn_mp_toradix.c */; };
+ 22C919F41193400A0083AC69 /* bn_mp_unsigned_bin_size.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9197B1193400A0083AC69 /* bn_mp_unsigned_bin_size.c */; };
+ 22C919F51193400A0083AC69 /* bn_mp_xor.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9197C1193400A0083AC69 /* bn_mp_xor.c */; };
+ 22C919F61193400A0083AC69 /* bn_mp_zero.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9197D1193400A0083AC69 /* bn_mp_zero.c */; };
+ 22C919F71193400A0083AC69 /* bn_prime_tab.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9197E1193400A0083AC69 /* bn_prime_tab.c */; };
+ 22C919F81193400A0083AC69 /* bn_reverse.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9197F1193400A0083AC69 /* bn_reverse.c */; };
+ 22C919F91193400A0083AC69 /* bn_s_mp_add.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919801193400A0083AC69 /* bn_s_mp_add.c */; };
+ 22C919FA1193400A0083AC69 /* bn_s_mp_exptmod.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919811193400A0083AC69 /* bn_s_mp_exptmod.c */; };
+ 22C919FB1193400A0083AC69 /* bn_s_mp_mul_digs.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919821193400A0083AC69 /* bn_s_mp_mul_digs.c */; };
+ 22C919FC1193400A0083AC69 /* bn_s_mp_mul_high_digs.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919831193400A0083AC69 /* bn_s_mp_mul_high_digs.c */; };
+ 22C919FD1193400A0083AC69 /* bn_s_mp_sqr.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919841193400A0083AC69 /* bn_s_mp_sqr.c */; };
+ 22C919FE1193400A0083AC69 /* bn_s_mp_sub.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919851193400A0083AC69 /* bn_s_mp_sub.c */; };
+ 22C919FF1193400A0083AC69 /* bncore.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919861193400A0083AC69 /* bncore.c */; };
+ 22C91A001193400A0083AC69 /* tommath_class.h in Headers */ = {isa = PBXBuildFile; fileRef = 22C919871193400A0083AC69 /* tommath_class.h */; };
+ 22C91A011193400A0083AC69 /* tommath_superclass.h in Headers */ = {isa = PBXBuildFile; fileRef = 22C919881193400A0083AC69 /* tommath_superclass.h */; };
+ 22C91A021193400A0083AC69 /* tommath.h in Headers */ = {isa = PBXBuildFile; fileRef = 22C919891193400A0083AC69 /* tommath.h */; };
+ 22C91A031193400A0083AC69 /* bn_fast_mp_invmod.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919111193400A0083AC69 /* bn_fast_mp_invmod.c */; };
+ 22C91A041193400A0083AC69 /* bn_fast_mp_montgomery_reduce.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919121193400A0083AC69 /* bn_fast_mp_montgomery_reduce.c */; };
+ 22C91A051193400A0083AC69 /* bn_fast_s_mp_mul_digs.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919131193400A0083AC69 /* bn_fast_s_mp_mul_digs.c */; };
+ 22C91A061193400A0083AC69 /* bn_fast_s_mp_mul_high_digs.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919141193400A0083AC69 /* bn_fast_s_mp_mul_high_digs.c */; };
+ 22C91A071193400A0083AC69 /* bn_fast_s_mp_sqr.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919151193400A0083AC69 /* bn_fast_s_mp_sqr.c */; };
+ 22C91A081193400A0083AC69 /* bn_mp_2expt.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919161193400A0083AC69 /* bn_mp_2expt.c */; };
+ 22C91A091193400A0083AC69 /* bn_mp_abs.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919171193400A0083AC69 /* bn_mp_abs.c */; };
+ 22C91A0A1193400A0083AC69 /* bn_mp_add_d.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919181193400A0083AC69 /* bn_mp_add_d.c */; };
+ 22C91A0B1193400A0083AC69 /* bn_mp_add.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919191193400A0083AC69 /* bn_mp_add.c */; };
+ 22C91A0C1193400A0083AC69 /* bn_mp_addmod.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9191A1193400A0083AC69 /* bn_mp_addmod.c */; };
+ 22C91A0D1193400A0083AC69 /* bn_mp_and.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9191B1193400A0083AC69 /* bn_mp_and.c */; };
+ 22C91A0E1193400A0083AC69 /* bn_mp_clamp.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9191C1193400A0083AC69 /* bn_mp_clamp.c */; };
+ 22C91A0F1193400A0083AC69 /* bn_mp_clear_multi.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9191D1193400A0083AC69 /* bn_mp_clear_multi.c */; };
+ 22C91A101193400A0083AC69 /* bn_mp_clear.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9191E1193400A0083AC69 /* bn_mp_clear.c */; };
+ 22C91A111193400A0083AC69 /* bn_mp_cmp_d.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9191F1193400A0083AC69 /* bn_mp_cmp_d.c */; };
+ 22C91A121193400A0083AC69 /* bn_mp_cmp_mag.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919201193400A0083AC69 /* bn_mp_cmp_mag.c */; };
+ 22C91A131193400A0083AC69 /* bn_mp_cmp.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919211193400A0083AC69 /* bn_mp_cmp.c */; };
+ 22C91A141193400A0083AC69 /* bn_mp_cnt_lsb.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919221193400A0083AC69 /* bn_mp_cnt_lsb.c */; };
+ 22C91A151193400A0083AC69 /* bn_mp_copy.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919231193400A0083AC69 /* bn_mp_copy.c */; };
+ 22C91A161193400A0083AC69 /* bn_mp_count_bits.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919241193400A0083AC69 /* bn_mp_count_bits.c */; };
+ 22C91A171193400A0083AC69 /* bn_mp_div_2.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919251193400A0083AC69 /* bn_mp_div_2.c */; };
+ 22C91A181193400A0083AC69 /* bn_mp_div_2d.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919261193400A0083AC69 /* bn_mp_div_2d.c */; };
+ 22C91A191193400A0083AC69 /* bn_mp_div_3.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919271193400A0083AC69 /* bn_mp_div_3.c */; };
+ 22C91A1A1193400A0083AC69 /* bn_mp_div_d.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919281193400A0083AC69 /* bn_mp_div_d.c */; };
+ 22C91A1B1193400A0083AC69 /* bn_mp_div.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919291193400A0083AC69 /* bn_mp_div.c */; };
+ 22C91A1C1193400A0083AC69 /* bn_mp_dr_is_modulus.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9192A1193400A0083AC69 /* bn_mp_dr_is_modulus.c */; };
+ 22C91A1D1193400A0083AC69 /* bn_mp_dr_reduce.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9192B1193400A0083AC69 /* bn_mp_dr_reduce.c */; };
+ 22C91A1E1193400A0083AC69 /* bn_mp_dr_setup.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9192C1193400A0083AC69 /* bn_mp_dr_setup.c */; };
+ 22C91A1F1193400A0083AC69 /* bn_mp_exch.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9192D1193400A0083AC69 /* bn_mp_exch.c */; };
+ 22C91A201193400A0083AC69 /* bn_mp_expt_d.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9192E1193400A0083AC69 /* bn_mp_expt_d.c */; };
+ 22C91A211193400A0083AC69 /* bn_mp_exptmod_fast.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9192F1193400A0083AC69 /* bn_mp_exptmod_fast.c */; };
+ 22C91A221193400A0083AC69 /* bn_mp_exptmod.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919301193400A0083AC69 /* bn_mp_exptmod.c */; };
+ 22C91A231193400A0083AC69 /* bn_mp_exteuclid.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919311193400A0083AC69 /* bn_mp_exteuclid.c */; };
+ 22C91A241193400A0083AC69 /* bn_mp_fread.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919321193400A0083AC69 /* bn_mp_fread.c */; };
+ 22C91A251193400A0083AC69 /* bn_mp_fwrite.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919331193400A0083AC69 /* bn_mp_fwrite.c */; };
+ 22C91A261193400A0083AC69 /* bn_mp_gcd.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919341193400A0083AC69 /* bn_mp_gcd.c */; };
+ 22C91A271193400A0083AC69 /* bn_mp_get_int.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919351193400A0083AC69 /* bn_mp_get_int.c */; };
+ 22C91A281193400A0083AC69 /* bn_mp_grow.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919361193400A0083AC69 /* bn_mp_grow.c */; };
+ 22C91A291193400A0083AC69 /* bn_mp_init_copy.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919371193400A0083AC69 /* bn_mp_init_copy.c */; };
+ 22C91A2A1193400A0083AC69 /* bn_mp_init_multi.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919381193400A0083AC69 /* bn_mp_init_multi.c */; };
+ 22C91A2B1193400A0083AC69 /* bn_mp_init_set_int.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919391193400A0083AC69 /* bn_mp_init_set_int.c */; };
+ 22C91A2C1193400A0083AC69 /* bn_mp_init_set.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9193A1193400A0083AC69 /* bn_mp_init_set.c */; };
+ 22C91A2D1193400A0083AC69 /* bn_mp_init_size.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9193B1193400A0083AC69 /* bn_mp_init_size.c */; };
+ 22C91A2E1193400A0083AC69 /* bn_mp_init.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9193C1193400A0083AC69 /* bn_mp_init.c */; };
+ 22C91A2F1193400A0083AC69 /* bn_mp_invmod_slow.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9193D1193400A0083AC69 /* bn_mp_invmod_slow.c */; };
+ 22C91A301193400A0083AC69 /* bn_mp_invmod.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9193E1193400A0083AC69 /* bn_mp_invmod.c */; };
+ 22C91A311193400A0083AC69 /* bn_mp_is_square.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9193F1193400A0083AC69 /* bn_mp_is_square.c */; };
+ 22C91A321193400A0083AC69 /* bn_mp_jacobi.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919401193400A0083AC69 /* bn_mp_jacobi.c */; };
+ 22C91A331193400A0083AC69 /* bn_mp_karatsuba_mul.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919411193400A0083AC69 /* bn_mp_karatsuba_mul.c */; };
+ 22C91A341193400A0083AC69 /* bn_mp_karatsuba_sqr.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919421193400A0083AC69 /* bn_mp_karatsuba_sqr.c */; };
+ 22C91A351193400A0083AC69 /* bn_mp_lcm.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919431193400A0083AC69 /* bn_mp_lcm.c */; };
+ 22C91A361193400A0083AC69 /* bn_mp_lshd.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919441193400A0083AC69 /* bn_mp_lshd.c */; };
+ 22C91A371193400A0083AC69 /* bn_mp_mod_2d.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919451193400A0083AC69 /* bn_mp_mod_2d.c */; };
+ 22C91A381193400A0083AC69 /* bn_mp_mod_d.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919461193400A0083AC69 /* bn_mp_mod_d.c */; };
+ 22C91A391193400A0083AC69 /* bn_mp_mod.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919471193400A0083AC69 /* bn_mp_mod.c */; };
+ 22C91A3A1193400A0083AC69 /* bn_mp_montgomery_calc_normalization.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919481193400A0083AC69 /* bn_mp_montgomery_calc_normalization.c */; };
+ 22C91A3B1193400A0083AC69 /* bn_mp_montgomery_reduce.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919491193400A0083AC69 /* bn_mp_montgomery_reduce.c */; };
+ 22C91A3C1193400A0083AC69 /* bn_mp_montgomery_setup.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9194A1193400A0083AC69 /* bn_mp_montgomery_setup.c */; };
+ 22C91A3D1193400A0083AC69 /* bn_mp_mul_2.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9194B1193400A0083AC69 /* bn_mp_mul_2.c */; };
+ 22C91A3E1193400A0083AC69 /* bn_mp_mul_2d.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9194C1193400A0083AC69 /* bn_mp_mul_2d.c */; };
+ 22C91A3F1193400A0083AC69 /* bn_mp_mul_d.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9194D1193400A0083AC69 /* bn_mp_mul_d.c */; };
+ 22C91A401193400A0083AC69 /* bn_mp_mul.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9194E1193400A0083AC69 /* bn_mp_mul.c */; };
+ 22C91A411193400A0083AC69 /* bn_mp_mulmod.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9194F1193400A0083AC69 /* bn_mp_mulmod.c */; };
+ 22C91A421193400A0083AC69 /* bn_mp_n_root.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919501193400A0083AC69 /* bn_mp_n_root.c */; };
+ 22C91A431193400A0083AC69 /* bn_mp_neg.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919511193400A0083AC69 /* bn_mp_neg.c */; };
+ 22C91A441193400A0083AC69 /* bn_mp_or.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919521193400A0083AC69 /* bn_mp_or.c */; };
+ 22C91A451193400A0083AC69 /* bn_mp_prime_fermat.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919531193400A0083AC69 /* bn_mp_prime_fermat.c */; };
+ 22C91A461193400A0083AC69 /* bn_mp_prime_is_divisible.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919541193400A0083AC69 /* bn_mp_prime_is_divisible.c */; };
+ 22C91A471193400A0083AC69 /* bn_mp_prime_is_prime.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919551193400A0083AC69 /* bn_mp_prime_is_prime.c */; };
+ 22C91A481193400A0083AC69 /* bn_mp_prime_miller_rabin.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919561193400A0083AC69 /* bn_mp_prime_miller_rabin.c */; };
+ 22C91A491193400A0083AC69 /* bn_mp_prime_next_prime.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919571193400A0083AC69 /* bn_mp_prime_next_prime.c */; };
+ 22C91A4A1193400A0083AC69 /* bn_mp_prime_rabin_miller_trials.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919581193400A0083AC69 /* bn_mp_prime_rabin_miller_trials.c */; };
+ 22C91A4B1193400A0083AC69 /* bn_mp_prime_random_ex.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919591193400A0083AC69 /* bn_mp_prime_random_ex.c */; };
+ 22C91A4C1193400A0083AC69 /* bn_mp_radix_size.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9195A1193400A0083AC69 /* bn_mp_radix_size.c */; };
+ 22C91A4D1193400A0083AC69 /* bn_mp_radix_smap.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9195B1193400A0083AC69 /* bn_mp_radix_smap.c */; };
+ 22C91A4E1193400A0083AC69 /* bn_mp_rand.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9195C1193400A0083AC69 /* bn_mp_rand.c */; };
+ 22C91A4F1193400A0083AC69 /* bn_mp_read_radix.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9195D1193400A0083AC69 /* bn_mp_read_radix.c */; };
+ 22C91A501193400A0083AC69 /* bn_mp_read_signed_bin.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9195E1193400A0083AC69 /* bn_mp_read_signed_bin.c */; };
+ 22C91A511193400A0083AC69 /* bn_mp_read_unsigned_bin.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9195F1193400A0083AC69 /* bn_mp_read_unsigned_bin.c */; };
+ 22C91A521193400A0083AC69 /* bn_mp_reduce_2k_l.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919601193400A0083AC69 /* bn_mp_reduce_2k_l.c */; };
+ 22C91A531193400A0083AC69 /* bn_mp_reduce_2k_setup_l.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919611193400A0083AC69 /* bn_mp_reduce_2k_setup_l.c */; };
+ 22C91A541193400A0083AC69 /* bn_mp_reduce_2k_setup.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919621193400A0083AC69 /* bn_mp_reduce_2k_setup.c */; };
+ 22C91A551193400A0083AC69 /* bn_mp_reduce_2k.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919631193400A0083AC69 /* bn_mp_reduce_2k.c */; };
+ 22C91A561193400A0083AC69 /* bn_mp_reduce_is_2k_l.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919641193400A0083AC69 /* bn_mp_reduce_is_2k_l.c */; };
+ 22C91A571193400A0083AC69 /* bn_mp_reduce_is_2k.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919651193400A0083AC69 /* bn_mp_reduce_is_2k.c */; };
+ 22C91A581193400A0083AC69 /* bn_mp_reduce_setup.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919661193400A0083AC69 /* bn_mp_reduce_setup.c */; };
+ 22C91A591193400A0083AC69 /* bn_mp_reduce.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919671193400A0083AC69 /* bn_mp_reduce.c */; };
+ 22C91A5A1193400A0083AC69 /* bn_mp_rshd.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919681193400A0083AC69 /* bn_mp_rshd.c */; };
+ 22C91A5B1193400A0083AC69 /* bn_mp_set_int.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919691193400A0083AC69 /* bn_mp_set_int.c */; };
+ 22C91A5C1193400A0083AC69 /* bn_mp_set.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9196A1193400A0083AC69 /* bn_mp_set.c */; };
+ 22C91A5D1193400A0083AC69 /* bn_mp_shrink.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9196B1193400A0083AC69 /* bn_mp_shrink.c */; };
+ 22C91A5E1193400A0083AC69 /* bn_mp_signed_bin_size.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9196C1193400A0083AC69 /* bn_mp_signed_bin_size.c */; };
+ 22C91A5F1193400A0083AC69 /* bn_mp_sqr.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9196D1193400A0083AC69 /* bn_mp_sqr.c */; };
+ 22C91A601193400A0083AC69 /* bn_mp_sqrmod.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9196E1193400A0083AC69 /* bn_mp_sqrmod.c */; };
+ 22C91A611193400A0083AC69 /* bn_mp_sqrt.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9196F1193400A0083AC69 /* bn_mp_sqrt.c */; };
+ 22C91A621193400A0083AC69 /* bn_mp_sub_d.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919701193400A0083AC69 /* bn_mp_sub_d.c */; };
+ 22C91A631193400A0083AC69 /* bn_mp_sub.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919711193400A0083AC69 /* bn_mp_sub.c */; };
+ 22C91A641193400A0083AC69 /* bn_mp_submod.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919721193400A0083AC69 /* bn_mp_submod.c */; };
+ 22C91A651193400A0083AC69 /* bn_mp_to_signed_bin_n.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919731193400A0083AC69 /* bn_mp_to_signed_bin_n.c */; };
+ 22C91A661193400A0083AC69 /* bn_mp_to_signed_bin.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919741193400A0083AC69 /* bn_mp_to_signed_bin.c */; };
+ 22C91A671193400A0083AC69 /* bn_mp_to_unsigned_bin_n.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919751193400A0083AC69 /* bn_mp_to_unsigned_bin_n.c */; };
+ 22C91A681193400A0083AC69 /* bn_mp_to_unsigned_bin.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919761193400A0083AC69 /* bn_mp_to_unsigned_bin.c */; };
+ 22C91A691193400A0083AC69 /* bn_mp_toom_mul.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919771193400A0083AC69 /* bn_mp_toom_mul.c */; };
+ 22C91A6A1193400A0083AC69 /* bn_mp_toom_sqr.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919781193400A0083AC69 /* bn_mp_toom_sqr.c */; };
+ 22C91A6B1193400A0083AC69 /* bn_mp_toradix_n.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919791193400A0083AC69 /* bn_mp_toradix_n.c */; };
+ 22C91A6C1193400A0083AC69 /* bn_mp_toradix.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9197A1193400A0083AC69 /* bn_mp_toradix.c */; };
+ 22C91A6D1193400A0083AC69 /* bn_mp_unsigned_bin_size.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9197B1193400A0083AC69 /* bn_mp_unsigned_bin_size.c */; };
+ 22C91A6E1193400A0083AC69 /* bn_mp_xor.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9197C1193400A0083AC69 /* bn_mp_xor.c */; };
+ 22C91A6F1193400A0083AC69 /* bn_mp_zero.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9197D1193400A0083AC69 /* bn_mp_zero.c */; };
+ 22C91A701193400A0083AC69 /* bn_prime_tab.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9197E1193400A0083AC69 /* bn_prime_tab.c */; };
+ 22C91A711193400A0083AC69 /* bn_reverse.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C9197F1193400A0083AC69 /* bn_reverse.c */; };
+ 22C91A721193400A0083AC69 /* bn_s_mp_add.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919801193400A0083AC69 /* bn_s_mp_add.c */; };
+ 22C91A731193400A0083AC69 /* bn_s_mp_exptmod.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919811193400A0083AC69 /* bn_s_mp_exptmod.c */; };
+ 22C91A741193400A0083AC69 /* bn_s_mp_mul_digs.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919821193400A0083AC69 /* bn_s_mp_mul_digs.c */; };
+ 22C91A751193400A0083AC69 /* bn_s_mp_mul_high_digs.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919831193400A0083AC69 /* bn_s_mp_mul_high_digs.c */; };
+ 22C91A761193400A0083AC69 /* bn_s_mp_sqr.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919841193400A0083AC69 /* bn_s_mp_sqr.c */; };
+ 22C91A771193400A0083AC69 /* bn_s_mp_sub.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919851193400A0083AC69 /* bn_s_mp_sub.c */; };
+ 22C91A781193400A0083AC69 /* bncore.c in Sources */ = {isa = PBXBuildFile; fileRef = 22C919861193400A0083AC69 /* bncore.c */; };
+ 22C91A791193400A0083AC69 /* tommath_class.h in Headers */ = {isa = PBXBuildFile; fileRef = 22C919871193400A0083AC69 /* tommath_class.h */; };
+ 22C91A7A1193400A0083AC69 /* tommath_superclass.h in Headers */ = {isa = PBXBuildFile; fileRef = 22C919881193400A0083AC69 /* tommath_superclass.h */; };
+ 22C91A7B1193400A0083AC69 /* tommath.h in Headers */ = {isa = PBXBuildFile; fileRef = 22C919891193400A0083AC69 /* tommath.h */; };
+ 22F5A9C51193DFBA00F8B121 /* SFileVerify.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 22F5A9C41193DFBA00F8B121 /* SFileVerify.cpp */; };
+ 22F5A9C61193DFBA00F8B121 /* SFileVerify.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 22F5A9C41193DFBA00F8B121 /* SFileVerify.cpp */; };
+/* End PBXBuildFile section */
+
+/* Begin PBXContainerItemProxy section */
+ 2229F62E11D4653600118914 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 0867D690FE84028FC02AAC07 /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = 225530D31056BAC800FA646A;
+ remoteInfo = StormLib;
+ };
+/* End PBXContainerItemProxy section */
+
+/* Begin PBXFileReference section */
+ 221F6A721168529C0026C852 /* LzmaDec.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LzmaDec.h; path = C/LzmaDec.h; sourceTree = ""; };
+ 221F6A731168529C0026C852 /* LzmaEnc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LzmaEnc.h; path = C/LzmaEnc.h; sourceTree = ""; };
+ 221F6A7A116852AA0026C852 /* LzmaEnc.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = LzmaEnc.c; path = C/LzmaEnc.c; sourceTree = ""; };
+ 221F6A7D116852B20026C852 /* LzmaDec.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = LzmaDec.c; path = C/LzmaDec.c; sourceTree = ""; };
+ 221F6AB31168545B0026C852 /* LzFind.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = LzFind.c; path = C/LzFind.c; sourceTree = ""; };
+ 221F6AB41168545B0026C852 /* LzFind.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LzFind.h; path = C/LzFind.h; sourceTree = ""; };
+ 221F6AB9116854730026C852 /* LzHash.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LzHash.h; path = C/LzHash.h; sourceTree = ""; };
+ 221F6ABC116854870026C852 /* Types.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Types.h; path = C/Types.h; sourceTree = ""; };
+ 2253A19F10568A83001909F9 /* StormLib.exp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.exports; name = StormLib.exp; path = stormlib_dll/StormLib.exp; sourceTree = ""; };
+ 22549054119489060044424D /* libgcc_s.1.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libgcc_s.1.dylib; path = /usr/lib/libgcc_s.1.dylib; sourceTree = ""; };
+ 225530D41056BAC800FA646A /* libStormLib.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libStormLib.a; sourceTree = BUILT_PRODUCTS_DIR; };
+ 225C734B1257CCC70009E8DA /* lookup.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lookup.h; sourceTree = ""; };
+ 225C734C1257CCC70009E8DA /* lookup3.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = lookup3.c; sourceTree = ""; };
+ 225C73531257CD0C0009E8DA /* SBaseFileTable.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBaseFileTable.cpp; path = src/SBaseFileTable.cpp; sourceTree = ""; };
+ 225FAC940E53B7F800DA2CAE /* StormLib.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = StormLib.framework; sourceTree = BUILT_PRODUCTS_DIR; };
+ 225FAC950E53B7F800DA2CAE /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
+ 228B538311BF7D0D001A58DA /* FileStream.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FileStream.cpp; path = src/FileStream.cpp; sourceTree = ""; };
+ 2295488911D45A820064B264 /* Test.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Test.cpp; path = test/Test.cpp; sourceTree = ""; };
+ 22954ACE11D463A30064B264 /* StormLib_Test */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = StormLib_Test; sourceTree = BUILT_PRODUCTS_DIR; };
+ 2299D9D51167EFA8005C19BF /* adpcm.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = adpcm.cpp; sourceTree = ""; };
+ 2299D9D61167EFA8005C19BF /* adpcm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = adpcm.h; sourceTree = ""; };
+ 2299D9DC1167EFC6005C19BF /* sparse.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = sparse.cpp; sourceTree = ""; };
+ 2299D9DD1167EFC6005C19BF /* sparse.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sparse.h; sourceTree = ""; };
+ 2299DA4D1167FD16005C19BF /* SFileAddFile.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SFileAddFile.cpp; path = src/SFileAddFile.cpp; sourceTree = ""; };
+ 22AEA121123125D800359B16 /* SFilePatchArchives.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SFilePatchArchives.cpp; path = src/SFilePatchArchives.cpp; sourceTree = ""; };
+ 22C9182B11933FCF0083AC69 /* hash_memory.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = hash_memory.c; sourceTree = ""; };
+ 22C9182C11933FCF0083AC69 /* md5.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = md5.c; sourceTree = ""; };
+ 22C9182D11933FCF0083AC69 /* sha1.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = sha1.c; sourceTree = ""; };
+ 22C9182F11933FCF0083AC69 /* tomcrypt.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tomcrypt.h; sourceTree = ""; };
+ 22C9183011933FCF0083AC69 /* tomcrypt_argchk.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tomcrypt_argchk.h; sourceTree = ""; };
+ 22C9183111933FCF0083AC69 /* tomcrypt_cfg.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tomcrypt_cfg.h; sourceTree = ""; };
+ 22C9183211933FCF0083AC69 /* tomcrypt_cipher.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tomcrypt_cipher.h; sourceTree = ""; };
+ 22C9183311933FCF0083AC69 /* tomcrypt_custom.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tomcrypt_custom.h; sourceTree = ""; };
+ 22C9183411933FCF0083AC69 /* tomcrypt_hash.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tomcrypt_hash.h; sourceTree = ""; };
+ 22C9183511933FCF0083AC69 /* tomcrypt_mac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tomcrypt_mac.h; sourceTree = ""; };
+ 22C9183611933FCF0083AC69 /* tomcrypt_macros.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tomcrypt_macros.h; sourceTree = ""; };
+ 22C9183711933FCF0083AC69 /* tomcrypt_math.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tomcrypt_math.h; sourceTree = ""; };
+ 22C9183811933FCF0083AC69 /* tomcrypt_misc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tomcrypt_misc.h; sourceTree = ""; };
+ 22C9183911933FCF0083AC69 /* tomcrypt_pk.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tomcrypt_pk.h; sourceTree = ""; };
+ 22C9183A11933FCF0083AC69 /* tomcrypt_pkcs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tomcrypt_pkcs.h; sourceTree = ""; };
+ 22C9183B11933FCF0083AC69 /* tomcrypt_prng.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tomcrypt_prng.h; sourceTree = ""; };
+ 22C9183D11933FCF0083AC69 /* ltm_desc.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ltm_desc.c; sourceTree = ""; };
+ 22C9183E11933FCF0083AC69 /* multi.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = multi.c; sourceTree = ""; };
+ 22C9183F11933FCF0083AC69 /* rand_prime.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = rand_prime.c; sourceTree = ""; };
+ 22C9184111933FCF0083AC69 /* base64_decode.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = base64_decode.c; sourceTree = ""; };
+ 22C9184211933FCF0083AC69 /* crypt_argchk.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = crypt_argchk.c; sourceTree = ""; };
+ 22C9184311933FCF0083AC69 /* crypt_find_hash.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = crypt_find_hash.c; sourceTree = ""; };
+ 22C9184411933FCF0083AC69 /* crypt_find_prng.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = crypt_find_prng.c; sourceTree = ""; };
+ 22C9184511933FCF0083AC69 /* crypt_hash_descriptor.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = crypt_hash_descriptor.c; sourceTree = ""; };
+ 22C9184611933FCF0083AC69 /* crypt_hash_is_valid.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = crypt_hash_is_valid.c; sourceTree = ""; };
+ 22C9184711933FCF0083AC69 /* crypt_libc.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = crypt_libc.c; sourceTree = ""; };
+ 22C9184811933FCF0083AC69 /* crypt_ltc_mp_descriptor.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = crypt_ltc_mp_descriptor.c; sourceTree = ""; };
+ 22C9184911933FCF0083AC69 /* crypt_prng_descriptor.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = crypt_prng_descriptor.c; sourceTree = ""; };
+ 22C9184A11933FCF0083AC69 /* crypt_prng_is_valid.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = crypt_prng_is_valid.c; sourceTree = ""; };
+ 22C9184B11933FCF0083AC69 /* crypt_register_hash.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = crypt_register_hash.c; sourceTree = ""; };
+ 22C9184C11933FCF0083AC69 /* crypt_register_prng.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = crypt_register_prng.c; sourceTree = ""; };
+ 22C9184D11933FCF0083AC69 /* zeromem.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = zeromem.c; sourceTree = ""; };
+ 22C9185011933FCF0083AC69 /* der_decode_bit_string.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = der_decode_bit_string.c; sourceTree = ""; };
+ 22C9185111933FCF0083AC69 /* der_decode_boolean.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = der_decode_boolean.c; sourceTree = ""; };
+ 22C9185211933FCF0083AC69 /* der_decode_choice.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = der_decode_choice.c; sourceTree = ""; };
+ 22C9185311933FCF0083AC69 /* der_decode_ia5_string.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = der_decode_ia5_string.c; sourceTree = ""; };
+ 22C9185411933FCF0083AC69 /* der_decode_integer.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = der_decode_integer.c; sourceTree = ""; };
+ 22C9185511933FCF0083AC69 /* der_decode_object_identifier.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = der_decode_object_identifier.c; sourceTree = ""; };
+ 22C9185611933FCF0083AC69 /* der_decode_octet_string.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = der_decode_octet_string.c; sourceTree = ""; };
+ 22C9185711933FCF0083AC69 /* der_decode_printable_string.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = der_decode_printable_string.c; sourceTree = ""; };
+ 22C9185811933FCF0083AC69 /* der_decode_sequence_ex.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = der_decode_sequence_ex.c; sourceTree = ""; };
+ 22C9185911933FCF0083AC69 /* der_decode_sequence_flexi.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = der_decode_sequence_flexi.c; sourceTree = ""; };
+ 22C9185A11933FCF0083AC69 /* der_decode_sequence_multi.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = der_decode_sequence_multi.c; sourceTree = ""; };
+ 22C9185B11933FCF0083AC69 /* der_decode_short_integer.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = der_decode_short_integer.c; sourceTree = ""; };
+ 22C9185C11933FCF0083AC69 /* der_decode_utctime.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = der_decode_utctime.c; sourceTree = ""; };
+ 22C9185D11933FCF0083AC69 /* der_decode_utf8_string.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = der_decode_utf8_string.c; sourceTree = ""; };
+ 22C9185E11933FCF0083AC69 /* der_length_bit_string.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = der_length_bit_string.c; sourceTree = ""; };
+ 22C9185F11933FCF0083AC69 /* der_length_boolean.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = der_length_boolean.c; sourceTree = ""; };
+ 22C9186011933FCF0083AC69 /* der_length_ia5_string.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = der_length_ia5_string.c; sourceTree = ""; };
+ 22C9186111933FCF0083AC69 /* der_length_integer.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = der_length_integer.c; sourceTree = ""; };
+ 22C9186211933FCF0083AC69 /* der_length_object_identifier.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = der_length_object_identifier.c; sourceTree = ""; };
+ 22C9186311933FCF0083AC69 /* der_length_octet_string.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = der_length_octet_string.c; sourceTree = ""; };
+ 22C9186411933FCF0083AC69 /* der_length_printable_string.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = der_length_printable_string.c; sourceTree = ""; };
+ 22C9186511933FCF0083AC69 /* der_length_sequence.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = der_length_sequence.c; sourceTree = ""; };
+ 22C9186611933FCF0083AC69 /* der_length_short_integer.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = der_length_short_integer.c; sourceTree = ""; };
+ 22C9186711933FCF0083AC69 /* der_length_utctime.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = der_length_utctime.c; sourceTree = ""; };
+ 22C9186811933FCF0083AC69 /* der_length_utf8_string.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = der_length_utf8_string.c; sourceTree = ""; };
+ 22C9186911933FCF0083AC69 /* der_sequence_free.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = der_sequence_free.c; sourceTree = ""; };
+ 22C9186B11933FCF0083AC69 /* ltc_ecc_map.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ltc_ecc_map.c; sourceTree = ""; };
+ 22C9186C11933FCF0083AC69 /* ltc_ecc_mul2add.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ltc_ecc_mul2add.c; sourceTree = ""; };
+ 22C9186D11933FCF0083AC69 /* ltc_ecc_mulmod.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ltc_ecc_mulmod.c; sourceTree = ""; };
+ 22C9186E11933FCF0083AC69 /* ltc_ecc_points.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ltc_ecc_points.c; sourceTree = ""; };
+ 22C9186F11933FCF0083AC69 /* ltc_ecc_projective_add_point.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ltc_ecc_projective_add_point.c; sourceTree = ""; };
+ 22C9187011933FCF0083AC69 /* ltc_ecc_projective_dbl_point.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ltc_ecc_projective_dbl_point.c; sourceTree = ""; };
+ 22C9187211933FCF0083AC69 /* pkcs_1_mgf1.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = pkcs_1_mgf1.c; sourceTree = ""; };
+ 22C9187311933FCF0083AC69 /* pkcs_1_oaep_decode.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = pkcs_1_oaep_decode.c; sourceTree = ""; };
+ 22C9187411933FCF0083AC69 /* pkcs_1_pss_decode.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = pkcs_1_pss_decode.c; sourceTree = ""; };
+ 22C9187511933FCF0083AC69 /* pkcs_1_v1_5_decode.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = pkcs_1_v1_5_decode.c; sourceTree = ""; };
+ 22C9187711933FCF0083AC69 /* rsa_exptmod.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = rsa_exptmod.c; sourceTree = ""; };
+ 22C9187811933FCF0083AC69 /* rsa_free.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = rsa_free.c; sourceTree = ""; };
+ 22C9187911933FCF0083AC69 /* rsa_import.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = rsa_import.c; sourceTree = ""; };
+ 22C9187A11933FCF0083AC69 /* rsa_make_key.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = rsa_make_key.c; sourceTree = ""; };
+ 22C9187B11933FCF0083AC69 /* rsa_verify_hash.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = rsa_verify_hash.c; sourceTree = ""; };
+ 22C9187C11933FCF0083AC69 /* rsa_verify_simple.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = rsa_verify_simple.c; sourceTree = ""; };
+ 22C919111193400A0083AC69 /* bn_fast_mp_invmod.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_fast_mp_invmod.c; sourceTree = ""; };
+ 22C919121193400A0083AC69 /* bn_fast_mp_montgomery_reduce.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_fast_mp_montgomery_reduce.c; sourceTree = ""; };
+ 22C919131193400A0083AC69 /* bn_fast_s_mp_mul_digs.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_fast_s_mp_mul_digs.c; sourceTree = ""; };
+ 22C919141193400A0083AC69 /* bn_fast_s_mp_mul_high_digs.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_fast_s_mp_mul_high_digs.c; sourceTree = ""; };
+ 22C919151193400A0083AC69 /* bn_fast_s_mp_sqr.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_fast_s_mp_sqr.c; sourceTree = ""; };
+ 22C919161193400A0083AC69 /* bn_mp_2expt.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_2expt.c; sourceTree = ""; };
+ 22C919171193400A0083AC69 /* bn_mp_abs.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_abs.c; sourceTree = ""; };
+ 22C919181193400A0083AC69 /* bn_mp_add_d.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_add_d.c; sourceTree = ""; };
+ 22C919191193400A0083AC69 /* bn_mp_add.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_add.c; sourceTree = ""; };
+ 22C9191A1193400A0083AC69 /* bn_mp_addmod.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_addmod.c; sourceTree = ""; };
+ 22C9191B1193400A0083AC69 /* bn_mp_and.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_and.c; sourceTree = ""; };
+ 22C9191C1193400A0083AC69 /* bn_mp_clamp.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_clamp.c; sourceTree = ""; };
+ 22C9191D1193400A0083AC69 /* bn_mp_clear_multi.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_clear_multi.c; sourceTree = ""; };
+ 22C9191E1193400A0083AC69 /* bn_mp_clear.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_clear.c; sourceTree = ""; };
+ 22C9191F1193400A0083AC69 /* bn_mp_cmp_d.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_cmp_d.c; sourceTree = ""; };
+ 22C919201193400A0083AC69 /* bn_mp_cmp_mag.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_cmp_mag.c; sourceTree = ""; };
+ 22C919211193400A0083AC69 /* bn_mp_cmp.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_cmp.c; sourceTree = ""; };
+ 22C919221193400A0083AC69 /* bn_mp_cnt_lsb.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_cnt_lsb.c; sourceTree = ""; };
+ 22C919231193400A0083AC69 /* bn_mp_copy.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_copy.c; sourceTree = ""; };
+ 22C919241193400A0083AC69 /* bn_mp_count_bits.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_count_bits.c; sourceTree = ""; };
+ 22C919251193400A0083AC69 /* bn_mp_div_2.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_div_2.c; sourceTree = ""; };
+ 22C919261193400A0083AC69 /* bn_mp_div_2d.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_div_2d.c; sourceTree = ""; };
+ 22C919271193400A0083AC69 /* bn_mp_div_3.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_div_3.c; sourceTree = ""; };
+ 22C919281193400A0083AC69 /* bn_mp_div_d.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_div_d.c; sourceTree = ""; };
+ 22C919291193400A0083AC69 /* bn_mp_div.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_div.c; sourceTree = ""; };
+ 22C9192A1193400A0083AC69 /* bn_mp_dr_is_modulus.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_dr_is_modulus.c; sourceTree = ""; };
+ 22C9192B1193400A0083AC69 /* bn_mp_dr_reduce.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_dr_reduce.c; sourceTree = ""; };
+ 22C9192C1193400A0083AC69 /* bn_mp_dr_setup.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_dr_setup.c; sourceTree = ""; };
+ 22C9192D1193400A0083AC69 /* bn_mp_exch.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_exch.c; sourceTree = ""; };
+ 22C9192E1193400A0083AC69 /* bn_mp_expt_d.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_expt_d.c; sourceTree = ""; };
+ 22C9192F1193400A0083AC69 /* bn_mp_exptmod_fast.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_exptmod_fast.c; sourceTree = ""; };
+ 22C919301193400A0083AC69 /* bn_mp_exptmod.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_exptmod.c; sourceTree = ""; };
+ 22C919311193400A0083AC69 /* bn_mp_exteuclid.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_exteuclid.c; sourceTree = ""; };
+ 22C919321193400A0083AC69 /* bn_mp_fread.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_fread.c; sourceTree = ""; };
+ 22C919331193400A0083AC69 /* bn_mp_fwrite.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_fwrite.c; sourceTree = ""; };
+ 22C919341193400A0083AC69 /* bn_mp_gcd.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_gcd.c; sourceTree = ""; };
+ 22C919351193400A0083AC69 /* bn_mp_get_int.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_get_int.c; sourceTree = ""; };
+ 22C919361193400A0083AC69 /* bn_mp_grow.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_grow.c; sourceTree = ""; };
+ 22C919371193400A0083AC69 /* bn_mp_init_copy.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_init_copy.c; sourceTree = ""; };
+ 22C919381193400A0083AC69 /* bn_mp_init_multi.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_init_multi.c; sourceTree = ""; };
+ 22C919391193400A0083AC69 /* bn_mp_init_set_int.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_init_set_int.c; sourceTree = ""; };
+ 22C9193A1193400A0083AC69 /* bn_mp_init_set.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_init_set.c; sourceTree = ""; };
+ 22C9193B1193400A0083AC69 /* bn_mp_init_size.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_init_size.c; sourceTree = ""; };
+ 22C9193C1193400A0083AC69 /* bn_mp_init.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_init.c; sourceTree = ""; };
+ 22C9193D1193400A0083AC69 /* bn_mp_invmod_slow.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_invmod_slow.c; sourceTree = ""; };
+ 22C9193E1193400A0083AC69 /* bn_mp_invmod.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_invmod.c; sourceTree = ""; };
+ 22C9193F1193400A0083AC69 /* bn_mp_is_square.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_is_square.c; sourceTree = ""; };
+ 22C919401193400A0083AC69 /* bn_mp_jacobi.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_jacobi.c; sourceTree = ""; };
+ 22C919411193400A0083AC69 /* bn_mp_karatsuba_mul.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_karatsuba_mul.c; sourceTree = ""; };
+ 22C919421193400A0083AC69 /* bn_mp_karatsuba_sqr.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_karatsuba_sqr.c; sourceTree = ""; };
+ 22C919431193400A0083AC69 /* bn_mp_lcm.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_lcm.c; sourceTree = ""; };
+ 22C919441193400A0083AC69 /* bn_mp_lshd.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_lshd.c; sourceTree = ""; };
+ 22C919451193400A0083AC69 /* bn_mp_mod_2d.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_mod_2d.c; sourceTree = ""; };
+ 22C919461193400A0083AC69 /* bn_mp_mod_d.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_mod_d.c; sourceTree = ""; };
+ 22C919471193400A0083AC69 /* bn_mp_mod.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_mod.c; sourceTree = ""; };
+ 22C919481193400A0083AC69 /* bn_mp_montgomery_calc_normalization.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_montgomery_calc_normalization.c; sourceTree = ""; };
+ 22C919491193400A0083AC69 /* bn_mp_montgomery_reduce.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_montgomery_reduce.c; sourceTree = ""; };
+ 22C9194A1193400A0083AC69 /* bn_mp_montgomery_setup.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_montgomery_setup.c; sourceTree = ""; };
+ 22C9194B1193400A0083AC69 /* bn_mp_mul_2.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_mul_2.c; sourceTree = ""; };
+ 22C9194C1193400A0083AC69 /* bn_mp_mul_2d.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_mul_2d.c; sourceTree = ""; };
+ 22C9194D1193400A0083AC69 /* bn_mp_mul_d.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_mul_d.c; sourceTree = ""; };
+ 22C9194E1193400A0083AC69 /* bn_mp_mul.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_mul.c; sourceTree = ""; };
+ 22C9194F1193400A0083AC69 /* bn_mp_mulmod.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_mulmod.c; sourceTree = ""; };
+ 22C919501193400A0083AC69 /* bn_mp_n_root.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_n_root.c; sourceTree = ""; };
+ 22C919511193400A0083AC69 /* bn_mp_neg.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_neg.c; sourceTree = ""; };
+ 22C919521193400A0083AC69 /* bn_mp_or.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_or.c; sourceTree = ""; };
+ 22C919531193400A0083AC69 /* bn_mp_prime_fermat.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_prime_fermat.c; sourceTree = ""; };
+ 22C919541193400A0083AC69 /* bn_mp_prime_is_divisible.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_prime_is_divisible.c; sourceTree = ""; };
+ 22C919551193400A0083AC69 /* bn_mp_prime_is_prime.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_prime_is_prime.c; sourceTree = ""; };
+ 22C919561193400A0083AC69 /* bn_mp_prime_miller_rabin.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_prime_miller_rabin.c; sourceTree = ""; };
+ 22C919571193400A0083AC69 /* bn_mp_prime_next_prime.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_prime_next_prime.c; sourceTree = ""; };
+ 22C919581193400A0083AC69 /* bn_mp_prime_rabin_miller_trials.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_prime_rabin_miller_trials.c; sourceTree = ""; };
+ 22C919591193400A0083AC69 /* bn_mp_prime_random_ex.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_prime_random_ex.c; sourceTree = ""; };
+ 22C9195A1193400A0083AC69 /* bn_mp_radix_size.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_radix_size.c; sourceTree = ""; };
+ 22C9195B1193400A0083AC69 /* bn_mp_radix_smap.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_radix_smap.c; sourceTree = ""; };
+ 22C9195C1193400A0083AC69 /* bn_mp_rand.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_rand.c; sourceTree = ""; };
+ 22C9195D1193400A0083AC69 /* bn_mp_read_radix.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_read_radix.c; sourceTree = ""; };
+ 22C9195E1193400A0083AC69 /* bn_mp_read_signed_bin.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_read_signed_bin.c; sourceTree = ""; };
+ 22C9195F1193400A0083AC69 /* bn_mp_read_unsigned_bin.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_read_unsigned_bin.c; sourceTree = ""; };
+ 22C919601193400A0083AC69 /* bn_mp_reduce_2k_l.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_reduce_2k_l.c; sourceTree = ""; };
+ 22C919611193400A0083AC69 /* bn_mp_reduce_2k_setup_l.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_reduce_2k_setup_l.c; sourceTree = ""; };
+ 22C919621193400A0083AC69 /* bn_mp_reduce_2k_setup.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_reduce_2k_setup.c; sourceTree = ""; };
+ 22C919631193400A0083AC69 /* bn_mp_reduce_2k.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_reduce_2k.c; sourceTree = ""; };
+ 22C919641193400A0083AC69 /* bn_mp_reduce_is_2k_l.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_reduce_is_2k_l.c; sourceTree = ""; };
+ 22C919651193400A0083AC69 /* bn_mp_reduce_is_2k.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_reduce_is_2k.c; sourceTree = ""; };
+ 22C919661193400A0083AC69 /* bn_mp_reduce_setup.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_reduce_setup.c; sourceTree = ""; };
+ 22C919671193400A0083AC69 /* bn_mp_reduce.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_reduce.c; sourceTree = ""; };
+ 22C919681193400A0083AC69 /* bn_mp_rshd.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_rshd.c; sourceTree = ""; };
+ 22C919691193400A0083AC69 /* bn_mp_set_int.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_set_int.c; sourceTree = ""; };
+ 22C9196A1193400A0083AC69 /* bn_mp_set.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_set.c; sourceTree = ""; };
+ 22C9196B1193400A0083AC69 /* bn_mp_shrink.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_shrink.c; sourceTree = ""; };
+ 22C9196C1193400A0083AC69 /* bn_mp_signed_bin_size.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_signed_bin_size.c; sourceTree = ""; };
+ 22C9196D1193400A0083AC69 /* bn_mp_sqr.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_sqr.c; sourceTree = ""; };
+ 22C9196E1193400A0083AC69 /* bn_mp_sqrmod.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_sqrmod.c; sourceTree = ""; };
+ 22C9196F1193400A0083AC69 /* bn_mp_sqrt.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_sqrt.c; sourceTree = ""; };
+ 22C919701193400A0083AC69 /* bn_mp_sub_d.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_sub_d.c; sourceTree = ""; };
+ 22C919711193400A0083AC69 /* bn_mp_sub.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_sub.c; sourceTree = ""; };
+ 22C919721193400A0083AC69 /* bn_mp_submod.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_submod.c; sourceTree = ""; };
+ 22C919731193400A0083AC69 /* bn_mp_to_signed_bin_n.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_to_signed_bin_n.c; sourceTree = ""; };
+ 22C919741193400A0083AC69 /* bn_mp_to_signed_bin.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_to_signed_bin.c; sourceTree = ""; };
+ 22C919751193400A0083AC69 /* bn_mp_to_unsigned_bin_n.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_to_unsigned_bin_n.c; sourceTree = ""; };
+ 22C919761193400A0083AC69 /* bn_mp_to_unsigned_bin.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_to_unsigned_bin.c; sourceTree = ""; };
+ 22C919771193400A0083AC69 /* bn_mp_toom_mul.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_toom_mul.c; sourceTree = ""; };
+ 22C919781193400A0083AC69 /* bn_mp_toom_sqr.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_toom_sqr.c; sourceTree = ""; };
+ 22C919791193400A0083AC69 /* bn_mp_toradix_n.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_toradix_n.c; sourceTree = ""; };
+ 22C9197A1193400A0083AC69 /* bn_mp_toradix.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_toradix.c; sourceTree = ""; };
+ 22C9197B1193400A0083AC69 /* bn_mp_unsigned_bin_size.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_unsigned_bin_size.c; sourceTree = ""; };
+ 22C9197C1193400A0083AC69 /* bn_mp_xor.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_xor.c; sourceTree = ""; };
+ 22C9197D1193400A0083AC69 /* bn_mp_zero.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_zero.c; sourceTree = ""; };
+ 22C9197E1193400A0083AC69 /* bn_prime_tab.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_prime_tab.c; sourceTree = ""; };
+ 22C9197F1193400A0083AC69 /* bn_reverse.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_reverse.c; sourceTree = ""; };
+ 22C919801193400A0083AC69 /* bn_s_mp_add.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_s_mp_add.c; sourceTree = ""; };
+ 22C919811193400A0083AC69 /* bn_s_mp_exptmod.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_s_mp_exptmod.c; sourceTree = ""; };
+ 22C919821193400A0083AC69 /* bn_s_mp_mul_digs.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_s_mp_mul_digs.c; sourceTree = ""; };
+ 22C919831193400A0083AC69 /* bn_s_mp_mul_high_digs.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_s_mp_mul_high_digs.c; sourceTree = ""; };
+ 22C919841193400A0083AC69 /* bn_s_mp_sqr.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_s_mp_sqr.c; sourceTree = ""; };
+ 22C919851193400A0083AC69 /* bn_s_mp_sub.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_s_mp_sub.c; sourceTree = ""; };
+ 22C919861193400A0083AC69 /* bncore.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bncore.c; sourceTree = ""; };
+ 22C919871193400A0083AC69 /* tommath_class.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tommath_class.h; sourceTree = ""; };
+ 22C919881193400A0083AC69 /* tommath_superclass.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tommath_superclass.h; sourceTree = ""; };
+ 22C919891193400A0083AC69 /* tommath.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tommath.h; sourceTree = ""; };
+ 22F5A9C41193DFBA00F8B121 /* SFileVerify.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SFileVerify.cpp; path = src/SFileVerify.cpp; sourceTree = ""; };
+ 32D20A8A0CF3902D00230E7A /* libbz2.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libbz2.dylib; path = /usr/lib/libbz2.dylib; sourceTree = ""; };
+ 32D20A8B0CF3902D00230E7A /* libz.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libz.dylib; path = /usr/lib/libz.dylib; sourceTree = ""; };
+ 32ED009C0D03542A00AB0B4E /* huff.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = huff.cpp; sourceTree = ""; };
+ 32ED009D0D03542A00AB0B4E /* huff.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = huff.h; sourceTree = ""; };
+ 32ED00A60D03542A00AB0B4E /* explode.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = explode.c; sourceTree = ""; };
+ 32ED00A70D03542A00AB0B4E /* implode.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = implode.c; sourceTree = ""; };
+ 32ED00A80D03542A00AB0B4E /* pklib.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = pklib.h; sourceTree = ""; };
+ 32ED00A90D03542A00AB0B4E /* SFileAttributes.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SFileAttributes.cpp; path = src/SFileAttributes.cpp; sourceTree = ""; };
+ 32ED00AA0D03542A00AB0B4E /* SBaseCommon.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBaseCommon.cpp; path = src/SBaseCommon.cpp; sourceTree = ""; };
+ 32ED00AB0D03542A00AB0B4E /* StormCommon.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = StormCommon.h; path = src/StormCommon.h; sourceTree = ""; };
+ 32ED00AC0D03542A00AB0B4E /* SCompression.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SCompression.cpp; path = src/SCompression.cpp; sourceTree = ""; };
+ 32ED00AD0D03542A00AB0B4E /* SFileCompactArchive.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SFileCompactArchive.cpp; path = src/SFileCompactArchive.cpp; sourceTree = ""; };
+ 32ED00AE0D03542A00AB0B4E /* SFileCreateArchive.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SFileCreateArchive.cpp; path = src/SFileCreateArchive.cpp; sourceTree = ""; };
+ 32ED00AF0D03542A00AB0B4E /* SFileExtractFile.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SFileExtractFile.cpp; path = src/SFileExtractFile.cpp; sourceTree = ""; };
+ 32ED00B00D03542A00AB0B4E /* SFileFindFile.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SFileFindFile.cpp; path = src/SFileFindFile.cpp; sourceTree = ""; };
+ 32ED00B10D03542A00AB0B4E /* SFileOpenArchive.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SFileOpenArchive.cpp; path = src/SFileOpenArchive.cpp; sourceTree = ""; };
+ 32ED00B20D03542A00AB0B4E /* SFileOpenFileEx.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SFileOpenFileEx.cpp; path = src/SFileOpenFileEx.cpp; sourceTree = ""; };
+ 32ED00B30D03542A00AB0B4E /* SFileReadFile.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SFileReadFile.cpp; path = src/SFileReadFile.cpp; sourceTree = ""; };
+ 32ED00B40D03542A00AB0B4E /* SFileListFile.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SFileListFile.cpp; path = src/SFileListFile.cpp; sourceTree = ""; };
+ 32ED00B60D03542A00AB0B4E /* StormLib.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = StormLib.h; path = src/StormLib.h; sourceTree = ""; };
+ 32ED00B70D03542A00AB0B4E /* StormPort.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = StormPort.h; path = src/StormPort.h; sourceTree = ""; };
+/* End PBXFileReference section */
+
+/* Begin PBXFrameworksBuildPhase section */
+ 225530D21056BAC800FA646A /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 225FAC920E53B7F800DA2CAE /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 225FADD40E53C06600DA2CAE /* libbz2.dylib in Frameworks */,
+ 225FADD50E53C06600DA2CAE /* libz.dylib in Frameworks */,
+ 22549055119489060044424D /* libgcc_s.1.dylib in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 22954ACC11D463A30064B264 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 22954AD611D463BE0064B264 /* libbz2.dylib in Frameworks */,
+ 22954AD711D463BE0064B264 /* libz.dylib in Frameworks */,
+ 22954AD811D463BE0064B264 /* libgcc_s.1.dylib in Frameworks */,
+ 22954AD311D463B50064B264 /* libStormLib.a in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXFrameworksBuildPhase section */
+
+/* Begin PBXGroup section */
+ 034768DDFF38A45A11DB9C8B /* Products */ = {
+ isa = PBXGroup;
+ children = (
+ 225FAC940E53B7F800DA2CAE /* StormLib.framework */,
+ 225530D41056BAC800FA646A /* libStormLib.a */,
+ 22954ACE11D463A30064B264 /* StormLib_Test */,
+ );
+ name = Products;
+ sourceTree = "";
+ };
+ 0867D691FE84028FC02AAC07 /* stormlib */ = {
+ isa = PBXGroup;
+ children = (
+ 32DBEE830D00E58F00DB1E81 /* Source */,
+ 2295488711D45A520064B264 /* Test */,
+ 0867D69AFE84028FC02AAC07 /* External Frameworks and Libraries */,
+ 22B54B321054B287001D6436 /* Resources */,
+ 034768DDFF38A45A11DB9C8B /* Products */,
+ 2253A19F10568A83001909F9 /* StormLib.exp */,
+ );
+ name = stormlib;
+ sourceTree = "";
+ };
+ 0867D69AFE84028FC02AAC07 /* External Frameworks and Libraries */ = {
+ isa = PBXGroup;
+ children = (
+ 32D20A8A0CF3902D00230E7A /* libbz2.dylib */,
+ 32D20A8B0CF3902D00230E7A /* libz.dylib */,
+ 22549054119489060044424D /* libgcc_s.1.dylib */,
+ );
+ name = "External Frameworks and Libraries";
+ sourceTree = "";
+ };
+ 221F652D116851D70026C852 /* lzma */ = {
+ isa = PBXGroup;
+ children = (
+ 221F6AB31168545B0026C852 /* LzFind.c */,
+ 221F6AB41168545B0026C852 /* LzFind.h */,
+ 221F6AB9116854730026C852 /* LzHash.h */,
+ 221F6A7D116852B20026C852 /* LzmaDec.c */,
+ 221F6A721168529C0026C852 /* LzmaDec.h */,
+ 221F6A7A116852AA0026C852 /* LzmaEnc.c */,
+ 221F6A731168529C0026C852 /* LzmaEnc.h */,
+ 221F6ABC116854870026C852 /* Types.h */,
+ );
+ name = lzma;
+ path = src/lzma;
+ sourceTree = "";
+ };
+ 225C734A1257CCC70009E8DA /* jenkins */ = {
+ isa = PBXGroup;
+ children = (
+ 225C734B1257CCC70009E8DA /* lookup.h */,
+ 225C734C1257CCC70009E8DA /* lookup3.c */,
+ );
+ name = jenkins;
+ path = src/jenkins;
+ sourceTree = "";
+ };
+ 2295488711D45A520064B264 /* Test */ = {
+ isa = PBXGroup;
+ children = (
+ 2295488911D45A820064B264 /* Test.cpp */,
+ );
+ name = Test;
+ sourceTree = "";
+ };
+ 2299D9D41167EFA8005C19BF /* adpcm */ = {
+ isa = PBXGroup;
+ children = (
+ 2299D9D51167EFA8005C19BF /* adpcm.cpp */,
+ 2299D9D61167EFA8005C19BF /* adpcm.h */,
+ );
+ name = adpcm;
+ path = src/adpcm;
+ sourceTree = "