[Rel21] Stage 1 of updates for Rel21 Build System

This commit is contained in:
Antz 2015-07-28 10:59:34 +01:00 committed by Antz
parent 13292befd6
commit fdefc0869a
1951 changed files with 40474 additions and 252610 deletions

3
.gitmodules vendored
View file

@ -1,6 +1,3 @@
[submodule "src/realmd"]
path = src/realmd
url = https://github.com/mangos/realmd.git
[submodule "src/modules/Eluna"]
path = src/modules/Eluna
url = https://github.com/ElunaLuaEngine/Eluna.git

View file

@ -1,5 +1,7 @@
# MaNGOS is a full featured server for World of Warcraft, supporting
# the following clients: 1.12.x, 2.4.3, 3.3.5a, 4.3.4a and 5.4.8
#
# This code is part of MaNGOS. Contributor & Copyright details are in AUTHORS/THANKS.
# Copyright (C) 2005-2015 MaNGOS project <http://getmangos.eu>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -14,7 +16,9 @@
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
project(MaNGOS)
set(MANGOS_VERSION 0.21)
# CMake policies
cmake_minimum_required(VERSION 2.8)
@ -24,35 +28,33 @@ if(POLICY CMP0043)
cmake_policy(SET CMP0043 OLD)
endif()
project(MaNGOS)
set(MANGOS_VERSION 0.20)
set(CMAKE_SKIP_BUILD_RPATH FALSE)
set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
set(CMAKE_INSTALL_RPATH "${LIBS_DIR}")
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
set(CMAKE_MODULE_PATH
"${CMAKE_MODULE_PATH}"
"${CMAKE_SOURCE_DIR}/cmake"
)
# Set the correct macro directory path
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
# define all options here
# Define available cmake options below
if(WIN32)
set(CONF_DIR "" CACHE STRING "Config path. Can be absolute or relative")
set(CONF_DIR "" CACHE STRING "Path to the configs, can be absolute or relative.")
else()
set(CONF_DIR "etc/" CACHE STRING "Config path. Can be absolute or relative")
set(CONF_DIR "etc/" CACHE STRING "Path to the configs, can be absolute or relative.")
endif()
option(DEBUG "Debug mode" OFF)
option(USE_STD_MALLOC "Use standard malloc instead of TBB" ON)
option(ACE_USE_EXTERNAL "Use external ACE" OFF)
option(POSTGRESQL "Use PostgreSQL" OFF)
option(BUILD_TOOLS "Build tools (map/vmap/mmap extractors)" ON)
#option(SCRIPT_LIB_ELUNA "Use Eluna as the scripting engine" ON) Temporarily disabled till more sync work is done
option(SCRIPT_LIB_SD2 "Use ScriptDev2 as the scripting engine" ON)
option(SOAP "Enable access via SOAP or not" OFF)
option(PCH "Use precompiled headers" ON)
# TODO: options that should be checked/created:
#option(CLI "With CLI" ON)
#option(RA "With Remote Access" OFF)
#option(SQL "Copy SQL files" OFF)
option(DEBUG "Debug mode (strict compile, all warnings)" OFF)
option(ACE_USE_EXTERNAL "Use external ACE" OFF)
option(POSTGRESQL "Use PostgreSQL instead of MySQL" OFF)
option(BUILD_TOOLS "Build the map/vmap/mmap extractors" ON)
option(SCRIPT_LIB_ELUNA "Compile with support for Eluna scripts" ON)
option(SCRIPT_LIB_SD2 "Compile with support for ScriptDev2 scripts" ON)
option(PLAYERBOTS "Enable Player Bots" OFF)
option(SOAP "Enable remote access via SOAP" OFF)
# Hidden option to enable/disable PCH. DEV ONLY!
set(PCH ON)
set(USE_STORMLIB ON)
# Output description of this script
# Print CLI helper message
message("")
message(
"This script builds the MaNGOS server.
@ -60,16 +62,15 @@ message(
General:
CMAKE_INSTALL_PREFIX Path where the server should be installed to
CONF_DIR Path to the configs, can be absolute or relative.
PCH Use precompiled headers
DEBUG Debug mode
USE_STD_MALLOC Use standard malloc instead of TBB
DEBUG Debug mode (strict compile, all warnings)
ACE_USE_EXTERNAL Use external ACE
BUILD_TOOLS Build map/vmap/mmap extractors
BUILD_TOOLS Build the map/vmap/mmap extractors
SOAP Enable remote access via SOAP
Scripting engines:
SCRIPT_LIB_ELUNA Compile with support for Eluna scripts
SCRIPT_LIB_SD2 Compile with support for ScriptDev2 scripts
Modules:
PLAYERBOTS Enable Player Bots
To set an option simply type -D<OPTION>=<VALUE> after 'cmake <srcs>'.
Also, you can specify the generator with -G. see 'cmake --help' for more details
For example: cmake .. -DDEBUG=1 -DCMAKE_INSTALL_PREFIX=/opt/mangos"
@ -78,101 +79,13 @@ message(
)
message("")
# Force out-of-source build
if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
message(FATAL_ERROR
"This project requires an out of source build. Remove the file 'CMakeCache.txt' found in this directory before continuing, create a separate build directory and run 'cmake [options] <srcs>' from there."
)
endif()
# Search for and set up the needed packages
set(OPENSSL_EXPECTED_VERSION 1.0.0)
# TODO: allow other compilers under windows in the future
if(WIN32 AND NOT MSVC)
message(FATAL_ERROR
"Under Windows other compiler than Microsoft Visual Studio are not supported."
)
endif()
# TODO: remove this in the future! it has only been added to make the switch easier for end users
if(PREFIX)
message(FATAL_ERROR "The parameter PREFIX has been removed. Please re-run CMake and use CMAKE_INSTALL_PREFIX instead to define your installation location!")
endif()
# TODO: use MSVC_CXX_ARCHITECTURE_ID instead to identify platform on windows (not required on other systems)
# find platform: required to build 3rd party libraries w/o CMake files
find_package(Platform REQUIRED)
# Find out what system we use to include the needed libs
if(WIN32)
if(PLATFORM MATCHES X86) # 32-bit
set(DEP_ARCH win32)
else() # 64-bit
set(DEP_ARCH x64)
endif()
endif()
# Used by map-extractor for now
if(UNIX)
find_package(BZip2 REQUIRED)
endif()
# find Git: used to get the revision number
find_package(Git)
# check if the platform supports precomiled headers
find_package(PCHSupport)
# TODO: remove this (refactor ACE & TBB CMake code)
# VS100 uses MSBuild.exe instead of devenv.com, so force it to use devenv.com
if(WIN32 AND MSVC_VERSION MATCHES 1600)
find_package(VisualStudio2010)
endif()
# Override configuration-types - we don't use anything else than debug and release
if(CMAKE_CONFIGURATION_TYPES)
set(CMAKE_CONFIGURATION_TYPES Release Debug)
set(CMAKE_CONFIGURATION_TYPES "${CMAKE_CONFIGURATION_TYPES}" CACHE STRING
"Reset the configurations to what we need"
FORCE)
endif()
#Force set the default install path if it is default
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/bin/" CACHE PATH "MaNGOS default install prefix" FORCE)
endif(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
#Output the compiled exes and DLLs to build/bin directory on windows by default
if(WIN32)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
endif()
#Set config install path correctly from given path
string(FIND "${CONF_DIR}" ":" CONF_DIR_ABSOLUTE)
if(${CONF_DIR_ABSOLUTE} EQUAL -1)
#Path was not absolute
set(CONF_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/${CONF_DIR}")
if(MSVC)
set(CONF_COPY_DIR "${CMAKE_BINARY_DIR}/bin/$(ConfigurationName)/${CONF_DIR}")
endif()
else()
#Path was absolute
set(CONF_INSTALL_DIR "${CONF_DIR}")
if(MSVC)
set(CONF_COPY_DIR "${CONF_DIR}")
endif()
endif()
# If win32 put binaries in root folder, else bin.
if(WIN32)
set(BIN_DIR ${CMAKE_INSTALL_PREFIX}/)
else()
set(BIN_DIR ${CMAKE_INSTALL_PREFIX}/bin)
endif()
# If win32 put libs in root folder, else bin.
if(WIN32)
set(LIBS_DIR ${CMAKE_INSTALL_PREFIX}/)
else()
set(LIBS_DIR ${CMAKE_INSTALL_PREFIX}/lib)
endif()
find_package(OpenSSL REQUIRED)
# For Unix systems set the rpath so that libraries are found
set(CMAKE_INSTALL_RPATH "${LIBS_DIR}")
@ -180,292 +93,108 @@ set(CMAKE_INSTALL_NAME_DIR "${LIBS_DIR}")
# Run out of build tree
set(CMAKE_BUILD_WITH_INSTALL_RPATH OFF)
# Find needed packages and if necessery abort if something important is missing
unset(ACE_INCLUDE_DIR CACHE)
unset(ACE_LIBRARIES CACHE)
unset(ACE_LIBRARIES_DIR CACHE)
unset(ACE_INCLUDE_DIR)
unset(ACE_LIBRARIES)
unset(ACE_LIBRARIES_DIR)
if(ACE_USE_EXTERNAL)
find_package(ACE)
if(NOT ACE_FOUND)
message(FATAL_ERROR
"This project requires ACE installed when ACE_USE_EXTERNAL is set. Please download the ACE Micro Release Kit from http://download.dre.vanderbilt.edu/ and install it. If this script didn't find ACE and it was correctly installed please set ACE_ROOT to the correct path."
)
endif()
if(EXISTS ${ACE_INCLUDE_DIR}/ace/Stack_Trace.h)
set(HAVE_ACE_STACK_TRACE_H ON) # config.h.cmake
endif()
find_package(ACE)
if(NOT ACE_FOUND)
message(FATAL_ERROR
"This project requires ACE installed when ACE_USE_EXTERNAL is set. Please download the ACE Micro Release Kit from http://download.dre.vanderbilt.edu/ and install it. If this script didn't find ACE and it was correctly installed please set ACE_ROOT to the correct path."
)
endif()
if(EXISTS ${ACE_INCLUDE_DIR}/ace/Stack_Trace.h)
add_definitions(-DHAVE_ACE_STACK_TRACE_H)
endif()
else()
include(cmake/ImportACE.cmake)
include(cmake/ImportACE.cmake)
endif()
# Win32 delivered packages
if(WIN32)
set(MYSQL_INCLUDE_DIR "${CMAKE_SOURCE_DIR}/dep/include/mysql")
set(MYSQL_LIBRARY "${CMAKE_SOURCE_DIR}/dep/lib/${DEP_ARCH}/libmySQL.lib")
set(MYSQL_DEBUG_LIBRARY "${CMAKE_SOURCE_DIR}/dep/lib/${DEP_ARCH}/libmySQL.lib")
set(OPENSSL_INCLUDE_DIR "${CMAKE_SOURCE_DIR}/dep/include/openssl")
set(OPENSSL_LIBRARIES "${CMAKE_SOURCE_DIR}/dep/lib/${DEP_ARCH}/libeay32.lib")
set(OPENSSL_DEBUG_LIBRARIES "${CMAKE_SOURCE_DIR}/dep/lib/${DEP_ARCH}/libeay32.lib")
# zlib is build
endif()
# *nix-specific packages
if(UNIX)
if(POSTGRESQL)
if(POSTGRESQL)
find_package(PostgreSQL REQUIRED)
if(POSTGRESQL_FOUND)
include_directories(${POSTGRESQL_INCLUDE_DIRS})
endif(POSTGRESQL_FOUND)
else()
else()
find_package(MySQL REQUIRED)
endif()
find_package(OpenSSL REQUIRED)
find_package(ZLIB REQUIRED)
endif()
# Add uninstall script and target
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
IMMEDIATE @ONLY
)
if(UNIX)
find_package(ZLIB)
find_package(BZip2)
endif()
add_custom_target(uninstall
"${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
)
#Include platform/compiler-specific definitions
include(${CMAKE_SOURCE_DIR}/cmake/SetDefinitions.cmake)
# Generate revision-extractor
set(GENREV_SRC src/tools/genrevision/genrevision.cpp)
add_executable(genrev ${GENREV_SRC})
# Find core revision
if(GIT_EXECUTABLE)
execute_process(
COMMAND ${GIT_EXECUTABLE} rev-parse HEAD
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
OUTPUT_VARIABLE GIT_REVISION
RESULT_VARIABLE GIT_RESULT
ERROR_QUIET
OUTPUT_STRIP_TRAILING_WHITESPACE
)
if(GIT_RESULT)
set(GIT_REVISION "Git repository not found")
endif()
execute_process(
COMMAND ${GIT_EXECUTABLE} rev-parse HEAD
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
OUTPUT_VARIABLE GIT_REVISION
RESULT_VARIABLE GIT_RESULT
ERROR_QUIET
OUTPUT_STRIP_TRAILING_WHITESPACE
)
if(GIT_RESULT)
set(GIT_REVISION "Git repository not found")
endif()
else()
set(GIT_REVISION "Git not found")
set(GIT_REVISION "Git not found")
endif()
message(STATUS "MaNGOS-Core revision : ${GIT_REVISION}")
message(STATUS "Install server to : ${CMAKE_INSTALL_PREFIX}")
message(STATUS "Install configs to : ${CONF_INSTALL_DIR}")
if("${CONF_DIR}" STREQUAL "")
message(STATUS "Search configs from : binary directory (default)")
message(STATUS "Search configs from : binary directory (default)")
else()
message(STATUS "Search configs from : ${CONF_DIR}")
message(STATUS "Search configs from : ${CONF_DIR}")
endif()
# if(CLI)
# message(STATUS "Build with CLI : Yes (default)")
# add_definitions(-DENABLE_CLI)
# else()
# message(STATUS "Build with CLI : No")
# endif()
# if(RA)
# message(STATUS "* Build with RA : Yes")
# add_definitions(-DENABLE_RA)
# else(RA)
# message(STATUS "* Build with RA : No (default)")
# endif(RA)
if(SOAP)
message(STATUS "Support for SOAP : Yes")
set(DEFINITIONS ${DEFINITIONS} -DENABLE_SOAP)
message(STATUS "Support for SOAP : Yes")
add_definitions(-DENABLE_SOAP)
else()
message(STATUS "Support for SOAP : No (default)")
message(STATUS "Support for SOAP : No (default)")
endif()
#Eluna temporarily disabled till more sync work can be done
#if(SCRIPT_LIB_ELUNA)
# message(STATUS "Script engine Eluna : Yes (default)")
# add_definitions(-DENABLE_ELUNA)
#else()
# message(STATUS "Script engine Eluna : No")
#endif()
if(SCRIPT_LIB_ELUNA)
message(STATUS "Script engine Eluna : Yes (default)")
add_definitions(-DENABLE_ELUNA)
else()
message(STATUS "Script engine Eluna : No")
endif()
if(SCRIPT_LIB_SD2)
message(STATUS "Script engine SD2 : Yes (default)")
add_definitions(-DENABLE_SD2)
message(STATUS "Script engine SD2 : Yes (default)")
add_definitions(-DENABLE_SD2)
else()
message(STATUS "Script engine SD2 : No")
message(STATUS "Script engine SD2 : No")
endif()
if(PLAYERBOTS)
message(STATUS "Enable Player Bots : Yes (default)")
add_definitions(-DENABLE_PLAYERBOTS)
else()
message(STATUS "Enable Player Bots : No")
endif()
if(BUILD_TOOLS)
message(STATUS "Build tools : Yes (default)")
message(STATUS "Build tools : Yes (default)")
else()
message(STATUS "Build tools : No")
endif()
if(PCH)
message(STATUS "Use PCH : Yes (default)")
else()
message(STATUS "Use PCH : No")
message(STATUS "Build tools : No")
endif()
if(DEBUG)
set(CMAKE_BUILD_TYPE Debug)
message(STATUS "Build in debug-mode : Yes")
set(CMAKE_BUILD_TYPE Debug)
message(STATUS "Build in debug-mode : Yes")
else()
set(CMAKE_BUILD_TYPE Release)
message(STATUS "Build in debug-mode : No (default)")
endif()
# Handle debugmode compiles (this will require further work for proper WIN32-setups)
if(UNIX)
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -g")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g")
endif()
# Set warning levels for different builds
if(UNIX)
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} --no-warnings")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} --no-warnings")
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Wall -Wfatal-errors -Wextra -Winvalid-pch")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wall -Wfatal-errors -Wextra -Winvalid-pch")
elseif(WIN32)
# Disable warnings in Visual Studio 8 and above and add /MP
if(MSVC AND NOT CMAKE_GENERATOR MATCHES "Visual Studio 7")
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /wd4996 /wd4355 /wd4244 /wd4985 /wd4267 /MP")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /wd4996 /wd4355 /wd4244 /wd4267 /MP")
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /wd4996 /wd4355 /wd4244 /wd4985 /wd4267 /MP")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /wd4996 /wd4355 /wd4244 /wd4985 /wd4267 /MP")
endif()
endif()
# if(SQL)
# message(STATUS "Install SQL-files : Yes")
# else()
# message(STATUS "Install SQL-files : No (default)")
# endif()
# Some small tweaks for Visual Studio 7 and above.
if(MSVC)
# Mark 32 bit executables large address aware so they can use > 2GB address space
if(PLATFORM MATCHES X86)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /LARGEADDRESSAWARE")
endif()
endif()
set(CMAKE_SKIP_BUILD_RPATH FALSE)
set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
set(CMAKE_INSTALL_RPATH "${LIBS_DIR}")
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
# Generate revision-extractor
set(GENREV_SRC
src/tools/genrevision/genrevision.cpp
)
add_executable(genrev
${GENREV_SRC}
)
if(WIN32)
install(
FILES
"${CMAKE_SOURCE_DIR}/dep/lib/${DEP_ARCH}/libeay32.dll"
"${CMAKE_SOURCE_DIR}/dep/lib/${DEP_ARCH}/ssleay32.dll"
"${CMAKE_SOURCE_DIR}/dep/lib/${DEP_ARCH}/libmySQL.dll"
DESTINATION ${LIBS_DIR}
CONFIGURATIONS Release
)
install(
FILES
"${CMAKE_SOURCE_DIR}/dep/lib/${DEP_ARCH}/libeay32.dll"
"${CMAKE_SOURCE_DIR}/dep/lib/${DEP_ARCH}/ssleay32.dll"
"${CMAKE_SOURCE_DIR}/dep/lib/${DEP_ARCH}/libmySQL.dll"
DESTINATION ${LIBS_DIR}
CONFIGURATIONS Debug
)
endif()
if(XCODE)
if(PLATFORM MATCHES X86)
set(CMAKE_OSX_ARCHITECTURES i386)
else()
set(CMAKE_OSX_ARCHITECTURES x86_64)
endif()
endif()
# This is used by config.h.cmake
if (SOAP)
set(ENABLE_SOAP ON)
else()
set(ENABLE_SOAP OFF)
set(CMAKE_BUILD_TYPE Release)
message(STATUS "Build in debug-mode : No (default)")
endif()
# Add dependency path
add_subdirectory(dep)
# Add definitions for all build types
# Don't place this above 'dep' subdirectory! Because of defines build will crash.
# Remember, this overwrites global preprocessors, thus SOAP, Eluna, SD2 etc. has to be defined twice.
# TODO: Clean this up?
set(DEFINITIONS
HAVE_CONFIG_H
MANGOS
)
if(SOAP)
set(DEFINITIONS ${DEFINITIONS} ENABLE_SOAP)
endif()
#Temporarily disabled till more work can be done
#if(SCRIPT_LIB_ELUNA)
# set(DEFINITIONS ${DEFINITIONS} ENABLE_ELUNA)
#endif()
if(SCRIPT_LIB_SD2)
set(DEFINITIONS ${DEFINITIONS} ENABLE_SD2)
endif()
if(POSTGRESQL)
set(DEFINITIONS ${DEFINITIONS} DO_POSTGRESQL)
else()
set(DEFINITIONS ${DEFINITIONS} DO_MYSQL)
endif()
set(DEFINITIONS_RELEASE NDEBUG)
set(DEFINITIONS_DEBUG) # _DEBUG MANGOS_DEBUG) was here..
if(WIN32)
set(DEFINITIONS ${DEFINITIONS} WIN32 _WIN32)
set(DEFINITIONS_RELEASE ${DEFINITIONS_RELEASE} _CRT_SECURE_NO_WARNINGS)
endif()
if(USE_STD_MALLOC)
set(DEFINITIONS ${DEFINITIONS} USE_STANDARD_MALLOC)
endif()
# Specify the maximum PreCompiled Header memory allocation limit
# Fixes a compiler-problem when using PCH - the /Ym flag is adjusted by the compiler in MSVC2012, hence we need to set an upper limit with /Zm to avoid discrepancies)
# (And yes, this is a verified , unresolved bug with MSVC... *sigh*)
# Make it MSVC specific, otherwise g++ etc pukes
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
string(REGEX REPLACE "/Zm[0-9]+ *" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Zm500" CACHE STRING "" FORCE)
endif()
if(CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -stdlib=libc++")
endif()
set_directory_properties(PROPERTIES COMPILE_DEFINITIONS "${DEFINITIONS}")
#Something like this is what i've imagined with the new generator expressions in cmake 3.0 / lfx
#set_directory_properties(PROPERTIES COMPILE_DEFINITIONS "$<$<CONFIG:Release>:"${DEFINITIONS} ${DEFINITIONS_RELEASE}">$<$<CONFIG:Debug>:"${DEFINITIONS} ${DEFINITIONS_DEBUG}">")
set_directory_properties(PROPERTIES COMPILE_DEFINITIONS_RELEASE "${DEFINITIONS_RELEASE}")
set_directory_properties(PROPERTIES COMPILE_DEFINITIONS_DEBUG "${DEFINITIONS_DEBUG}")
# Add source path
add_subdirectory(src)

View file

@ -72,51 +72,95 @@ find_path(MYSQL_INCLUDE_DIR
/usr/local/include
/usr/local/include/mysql
/usr/local/mysql/include
"C:/Program Files/MySQL/include"
"C:/Program Files/MySQL/MySQL Server 5.0/include"
"C:/Program Files/MySQL/MySQL Server 5.6/include"
"C:/Program Files/MySQL/MySQL Server 5.5/include"
"C:/Program Files/MySQL/MySQL Server 5.1/include"
"C:/Program Files/MySQL/MySQL Server 5.0/include"
"C:/Program Files/MySQL/include"
"C:/Program Files (x86)/MySQL/MySQL Server 5.6/include"
"C:/Program Files (x86)/MySQL/MySQL Server 5.5/include"
"C:/Program Files (x86)/MySQL/MySQL Server 5.1/include"
"C:/Program Files (x86)/MySQL/MySQL Server 5.0/include"
"C:/Program Files (x86)/MySQL/include"
"C:/MySQL/include"
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\MySQL AB\\MySQL Server 5.0;Location]/include"
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\MySQL AB\\MySQL Server 5.6;Location]/include"
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\MySQL AB\\MySQL Server 5.5;Location]/include"
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\MySQL AB\\MySQL Server 5.1;Location]/include"
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\MySQL AB\\MySQL Server 5.0;Location]/include"
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\MySQL AB\\MySQL Server 5.0;Location]/include"
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\MySQL AB\\MySQL Server 5.6;Location]/include"
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\MySQL AB\\MySQL Server 5.5;Location]/include"
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\MySQL AB\\MySQL Server 5.1;Location]/include"
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\MySQL AB\\MySQL Server 5.0;Location]/include"
"$ENV{ProgramFiles}/MySQL/*/include"
"$ENV{SystemDrive}/MySQL/*/include"
"c:/msys/local/include"
"$ENV{MYSQL_ROOT}/include"
DOC
"Specify the directory containing mysql.h."
)
if( UNIX )
foreach(LIB ${MYSQL_ADD_LIBRARIES})
find_library( MYSQL_LIBRARY
NAMES
mysql libmysql ${LIB}
PATHS
${MYSQL_ADD_LIBRARIES_PATH}
/usr/lib
/usr/lib/mysql
/usr/local/lib
/usr/local/lib/mysql
/usr/local/mysql/lib
DOC "Specify the location of the mysql library here."
)
endforeach(LIB ${MYSQL_ADD_LIBRARY})
foreach(LIB ${MYSQL_ADD_LIBRARIES})
find_library( MYSQL_LIBRARY
NAMES
mysql libmysql ${LIB}
PATHS
${MYSQL_ADD_LIBRARIES_PATH}
/usr/lib
/usr/lib/mysql
/usr/local/lib
/usr/local/lib/mysql
/usr/local/mysql/lib
DOC "Specify the location of the mysql library here."
)
endforeach(LIB ${MYSQL_ADD_LIBRARY})
endif( UNIX )
if( WIN32 )
find_library( MYSQL_LIBRARY
NAMES
mysql libmysql ${LIB}
libmysql
PATHS
${MYSQL_ADD_LIBRARIES_PATH}
"C:/Program Files/MySQL/lib"
"C:/Program Files/MySQL/MySQL Server 5.0/lib/opt"
"C:/Program Files/MySQL/MySQL Server 5.6/lib"
"C:/Program Files/MySQL/MySQL Server 5.6/lib/opt"
"C:/Program Files/MySQL/MySQL Server 5.5/lib"
"C:/Program Files/MySQL/MySQL Server 5.5/lib/opt"
"C:/Program Files/MySQL/MySQL Server 5.1/lib"
"C:/Program Files/MySQL/MySQL Server 5.1/lib/opt"
"C:/Program Files/MySQL/MySQL Server 5.0/lib"
"C:/Program Files/MySQL/MySQL Server 5.0/lib/opt"
"C:/Program Files/MySQL/lib"
"C:/Program Files (x86)/MySQL/MySQL Server 5.6/lib"
"C:/Program Files (x86)/MySQL/MySQL Server 5.6/lib/opt"
"C:/Program Files (x86)/MySQL/MySQL Server 5.5/lib"
"C:/Program Files (x86)/MySQL/MySQL Server 5.5/lib/opt"
"C:/Program Files (x86)/MySQL/MySQL Server 5.1/lib"
"C:/Program Files (x86)/MySQL/MySQL Server 5.1/lib/opt"
"C:/Program Files (x86)/MySQL/MySQL Server 5.0/lib"
"C:/Program Files (x86)/MySQL/MySQL Server 5.0/lib/opt"
"C:/Program Files (x86)/MySQL/lib"
"C:/MySQL/lib/debug"
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\MySQL AB\\MySQL Server 5.0;Location]/lib/opt"
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\MySQL AB\\MySQL Server 5.6;Location]/lib"
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\MySQL AB\\MySQL Server 5.6;Location]/lib/opt"
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\MySQL AB\\MySQL Server 5.5;Location]/lib"
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\MySQL AB\\MySQL Server 5.5;Location]/lib/opt"
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\MySQL AB\\MySQL Server 5.1;Location]/lib"
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\MySQL AB\\MySQL Server 5.1;Location]/lib/opt"
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\MySQL AB\\MySQL Server 5.0;Location]/lib/opt"
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\MySQL AB\\MySQL Server 5.0;Location]/lib"
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\MySQL AB\\MySQL Server 5.0;Location]/lib/opt"
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\MySQL AB\\MySQL Server 5.6;Location]/lib"
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\MySQL AB\\MySQL Server 5.6;Location]/lib/opt"
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\MySQL AB\\MySQL Server 5.5;Location]/lib"
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\MySQL AB\\MySQL Server 5.5;Location]/lib/opt"
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\MySQL AB\\MySQL Server 5.1;Location]/lib"
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\MySQL AB\\MySQL Server 5.1;Location]/lib/opt"
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\MySQL AB\\MySQL Server 5.0;Location]/lib"
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\MySQL AB\\MySQL Server 5.0;Location]/lib/opt"
"$ENV{ProgramFiles}/MySQL/*/lib/opt"
"$ENV{SystemDrive}/MySQL/*/lib/opt"
"c:/msys/local/include"
"$ENV{MYSQL_ROOT}/lib"
DOC "Specify the location of the mysql library here."
)
endif( WIN32 )
@ -144,9 +188,9 @@ if( MYSQL_LIBRARY )
message(STATUS "Found MySQL library: ${MYSQL_LIBRARY}")
message(STATUS "Found MySQL headers: ${MYSQL_INCLUDE_DIR}")
else( MYSQL_INCLUDE_DIR )
message(FATAL_ERROR "Could not find MySQL headers! Please install the development-libraries and headers.")
message(FATAL_ERROR "Could not find MySQL headers! Please install the development libraries and headers")
endif( MYSQL_INCLUDE_DIR )
mark_as_advanced( MYSQL_FOUND MYSQL_LIBRARY MYSQL_EXTRA_LIBRARIES MYSQL_INCLUDE_DIR )
else( MYSQL_LIBRARY )
message(FATAL_ERROR "Could not find the MySQL libraries! Please install the development-libraries and headers.")
endif( MYSQL_LIBRARY )
message(FATAL_ERROR "Could not find the MySQL libraries! Please install the development libraries and headers")
endif( MYSQL_LIBRARY )

View file

@ -1,107 +1,221 @@
# - Try to find the OpenSSL encryption library
# Once done this will define
#
# Find the OpenSSL client includes and library
# OPENSSL_ROOT_DIR - Set this variable to the root installation of OpenSSL
#
# Read-Only variables:
# OPENSSL_FOUND - system has the OpenSSL library
# OPENSSL_INCLUDE_DIR - the OpenSSL include directory
# OPENSSL_LIBRARIES - The libraries needed to use OpenSSL
# This module defines
# OPENSSL_INCLUDE_DIR, where to find openssl.h
# OPENSSL_LIBRARIES, the libraries to link against to connect to MySQL
# OPENSSL_FOUND, if false, you cannot build anything that requires MySQL.
#=============================================================================
# Copyright 2006-2009 Kitware, Inc.
# Copyright 2006 Alexander Neundorf <neundorf@kde.org>
# Copyright 2009-2010 Mathieu Malaterre <mathieu.malaterre@gmail.com>
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# (To distributed this file outside of CMake, substitute the full
# License text for the above reference.)
# also defined, but not for general use are
# OPENSSL_LIBRARY, where to find the MySQL library.
# http://www.slproweb.com/products/Win32OpenSSL.html
if( OPENSSL_INCLUDE_DIR AND OPENSSL_LIBRARIES )
# in cache already
set(OPENSSL_FOUND 1)
else( OPENSSL_INCLUDE_DIR AND OPENSSL_LIBRARIES )
set(OPENSSL_FOUND 0)
SET(_OPENSSL_ROOT_HINTS
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\OpenSSL (32-bit)_is1;Inno Setup: App Path]"
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\OpenSSL (64-bit)_is1;Inno Setup: App Path]"
)
if(WIN32)
if(PLATFORM MATCHES X64)
set(TMP_OPENSSL_INCLUDE_DIR
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\OpenSSL (64-bit)_is1;InstallLocation]/include/openssl"
)
set(TMP_OPENSSL_LIBRARIES
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\OpenSSL (64-bit)_is1;InstallLocation]/lib"
IF(PLATFORM EQUAL 64)
SET(_OPENSSL_ROOT_PATHS
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\OpenSSL (64-bit)_is1;InstallLocation]"
"C:/OpenSSL-Win64/"
"C:/OpenSSL/"
)
ELSE()
SET(_OPENSSL_ROOT_PATHS
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\OpenSSL (32-bit)_is1;InstallLocation]"
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\OpenSSL (32-bit)_is1;InstallLocation]"
"C:/OpenSSL/"
)
ENDIF()
FIND_PATH(OPENSSL_ROOT_DIR
NAMES
include/openssl/ssl.h
HINTS
${_OPENSSL_ROOT_HINTS}
PATHS
${_OPENSSL_ROOT_PATHS}
)
MARK_AS_ADVANCED(OPENSSL_ROOT_DIR)
# Re-use the previous path:
FIND_PATH(OPENSSL_INCLUDE_DIR openssl/ssl.h
${OPENSSL_ROOT_DIR}/include
)
IF(WIN32 AND NOT CYGWIN)
# MINGW should go here too
IF(MSVC)
# /MD and /MDd are the standard values - if someone wants to use
# others, the libnames have to change here too
# use also ssl and ssleay32 in debug as fallback for openssl < 0.9.8b
# TODO: handle /MT and static lib
# In Visual C++ naming convention each of these four kinds of Windows libraries has it's standard suffix:
# * MD for dynamic-release
# * MDd for dynamic-debug
# * MT for static-release
# * MTd for static-debug
# Implementation details:
# We are using the libraries located in the VC subdir instead of the parent directory eventhough :
# libeay32MD.lib is identical to ../libeay32.lib, and
# ssleay32MD.lib is identical to ../ssleay32.lib
FIND_LIBRARY(LIB_EAY_DEBUG
NAMES
libeay32MDd libeay32
PATHS
${OPENSSL_ROOT_DIR}/lib/VC
)
FIND_LIBRARY(LIB_EAY_RELEASE
NAMES
libeay32MD libeay32
PATHS
${OPENSSL_ROOT_DIR}/lib/VC
)
FIND_LIBRARY(SSL_EAY_DEBUG
NAMES
ssleay32MDd ssleay32 ssl
PATHS
${OPENSSL_ROOT_DIR}/lib/VC
)
FIND_LIBRARY(SSL_EAY_RELEASE
NAMES
ssleay32MD ssleay32 ssl
PATHS
${OPENSSL_ROOT_DIR}/lib/VC
)
if( CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE )
set( OPENSSL_LIBRARIES
optimized ${SSL_EAY_RELEASE} ${LIB_EAY_RELEASE}
debug ${SSL_EAY_DEBUG} ${LIB_EAY_DEBUG}
)
else()
set(TMP_OPENSSL_INCLUDE_DIR
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\OpenSSL (32-bit)_is1;InstallLocation]/include/openssl"
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\OpenSSL (32-bit)_is1;InstallLocation]/include/openssl"
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\OpenSSL (32-bit)_is1;InstallLocation]/include/openssl"
)
set(TMP_OPENSSL_LIBRARIES
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\OpenSSL (32-bit)_is1;InstallLocation]/lib"
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\OpenSSL (32-bit)_is1;InstallLocation]/lib"
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\OpenSSL (32-bit)_is1;InstallLocation]/lib"
set( OPENSSL_LIBRARIES
${SSL_EAY_RELEASE}
${LIB_EAY_RELEASE}
)
endif()
endif()
find_path(OPENSSL_INCLUDE_DIR
NAMES
ssl.h
PATHS
/usr/include
/usr/include/openssl
/usr/local/include
/usr/local/include/openssl
/usr/local/openssl/include
${TMP_OPENSSL_INCLUDE_DIR}
DOC
"Specify the directory containing openssl.h."
)
MARK_AS_ADVANCED(SSL_EAY_DEBUG SSL_EAY_RELEASE LIB_EAY_DEBUG LIB_EAY_RELEASE)
ELSEIF(MINGW)
find_library(OPENSSL_LIBRARIES
NAMES
ssleay32
ssl
PATHS
/usr/lib
/usr/lib/ssl
/usr/local/lib
/usr/local/lib/ssl
/usr/local/ssl/lib
${TMP_OPENSSL_LIBRARIES}
DOC "Specify the OpenSSL library here."
)
if( WIN32 )
find_library(OPENSSL_EXTRA_LIBRARIES
NAMES
libeay32
PATHS
${TMP_OPENSSL_LIBRARIES}
DOC
"if more libraries are necessary to link in a OpenSSL client, specify them here."
)
endif( WIN32 )
if( UNIX )
find_library(OPENSSL_EXTRA_LIBRARIES
# same player, for MingW
FIND_LIBRARY(LIB_EAY
NAMES
crypto
libeay32
PATHS
/usr/lib
/usr/lib/ssl
/usr/local/lib
/usr/local/lib/ssl
/usr/local/ssl/lib
${TMP_OPENSSL_LIBRARIES}
DOC "if more libraries are necessary to link in a OpenSSL client, specify them here."
${OPENSSL_ROOT_DIR}/lib/MinGW
)
endif()
if( OPENSSL_LIBRARIES )
if( OPENSSL_INCLUDE_DIR )
set( OPENSSL_FOUND 1 )
message(STATUS "Found OpenSSL library: ${OPENSSL_LIBRARIES}")
message(STATUS "Found OpenSSL headers: ${OPENSSL_INCLUDE_DIR}")
else ( OPENSSL_INCLUDE_DIR )
message(FATAL_ERROR "Could not find OpenSSL headers! Please install the development-headers")
endif( OPENSSL_INCLUDE_DIR )
else( OPENSSL_LIBRARIES )
message(FATAL_ERROR "Could not find OpenSSL libraries! Please install the library before continuing")
endif( OPENSSL_LIBRARIES )
mark_as_advanced( OPENSSL_FOUND OPENSSL_LIBRARIES OPENSSL_EXTRA_LIBRARIES OPENSSL_INCLUDE_DIR )
endif( OPENSSL_INCLUDE_DIR AND OPENSSL_LIBRARIES )
FIND_LIBRARY(SSL_EAY NAMES
NAMES
ssleay32
PATHS
${OPENSSL_ROOT_DIR}/lib/MinGW
)
MARK_AS_ADVANCED(SSL_EAY LIB_EAY)
set( OPENSSL_LIBRARIES
${SSL_EAY}
${LIB_EAY}
)
ELSE(MSVC)
# Not sure what to pick for -say- intel, let's use the toplevel ones and hope someone report issues:
FIND_LIBRARY(LIB_EAY
NAMES
libeay32
PATHS
${OPENSSL_ROOT_DIR}/lib
${OPENSSL_ROOT_DIR}/lib/VC
)
FIND_LIBRARY(SSL_EAY
NAMES
ssleay32
PATHS
${OPENSSL_ROOT_DIR}/lib
${OPENSSL_ROOT_DIR}/lib/VC
)
MARK_AS_ADVANCED(SSL_EAY LIB_EAY)
SET( OPENSSL_LIBRARIES ${SSL_EAY} ${LIB_EAY} )
ENDIF(MSVC)
ELSE(WIN32 AND NOT CYGWIN)
FIND_LIBRARY(OPENSSL_SSL_LIBRARIES NAMES ssl ssleay32 ssleay32MD)
FIND_LIBRARY(OPENSSL_CRYPTO_LIBRARIES NAMES crypto)
MARK_AS_ADVANCED(OPENSSL_CRYPTO_LIBRARIES OPENSSL_SSL_LIBRARIES)
SET(OPENSSL_LIBRARIES ${OPENSSL_SSL_LIBRARIES} ${OPENSSL_CRYPTO_LIBRARIES})
ENDIF(WIN32 AND NOT CYGWIN)
if (NOT OPENSSL_INCLUDE_DIR)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(OpenSSL DEFAULT_MSG
OPENSSL_LIBRARIES
OPENSSL_INCLUDE_DIR
)
endif()
if (OPENSSL_INCLUDE_DIR)
message( STATUS "Found OpenSSL library: ${OPENSSL_LIBRARIES}")
message( STATUS "Found OpenSSL headers: ${OPENSSL_INCLUDE_DIR}")
if (_OPENSSL_VERSION)
set(OPENSSL_VERSION "${_OPENSSL_VERSION}")
else (_OPENSSL_VERSION)
file(STRINGS "${OPENSSL_INCLUDE_DIR}/openssl/opensslv.h" openssl_version_str
REGEX "^# *define[\t ]+OPENSSL_VERSION_NUMBER[\t ]+0x[0-9][0-9][0-9][0-9][0-9][0-9].*")
# The version number is encoded as 0xMNNFFPPS: major minor fix patch status
# The status gives if this is a developer or prerelease and is ignored here.
# Major, minor, and fix directly translate into the version numbers shown in
# the string. The patch field translates to the single character suffix that
# indicates the bug fix state, which 00 -> nothing, 01 -> a, 02 -> b and so
# on.
string(REGEX REPLACE "^.*OPENSSL_VERSION_NUMBER[\t ]+0x([0-9a-f])([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]).*$"
"\\1;\\2;\\3;\\4;\\5" OPENSSL_VERSION_LIST "${openssl_version_str}")
list(GET OPENSSL_VERSION_LIST 0 OPENSSL_VERSION_MAJOR)
list(GET OPENSSL_VERSION_LIST 1 OPENSSL_VERSION_MINOR)
list(GET OPENSSL_VERSION_LIST 2 OPENSSL_VERSION_FIX)
list(GET OPENSSL_VERSION_LIST 3 OPENSSL_VERSION_PATCH)
string(REGEX REPLACE "^0(.)" "\\1" OPENSSL_VERSION_MINOR "${OPENSSL_VERSION_MINOR}")
string(REGEX REPLACE "^0(.)" "\\1" OPENSSL_VERSION_FIX "${OPENSSL_VERSION_FIX}")
if (NOT OPENSSL_VERSION_PATCH STREQUAL "00")
# 96 is the ASCII code of 'a' minus 1
math(EXPR OPENSSL_VERSION_PATCH_ASCII "${OPENSSL_VERSION_PATCH} + 96")
# Once anyone knows how OpenSSL would call the patch versions beyond 'z'
# this should be updated to handle that, too. This has not happened yet
# so it is simply ignored here for now.
string(ASCII "${OPENSSL_VERSION_PATCH_ASCII}" OPENSSL_VERSION_PATCH_STRING)
endif (NOT OPENSSL_VERSION_PATCH STREQUAL "00")
set(OPENSSL_VERSION "${OPENSSL_VERSION_MAJOR}.${OPENSSL_VERSION_MINOR}.${OPENSSL_VERSION_FIX}${OPENSSL_VERSION_PATCH_STRING}")
endif (_OPENSSL_VERSION)
endif (OPENSSL_INCLUDE_DIR)
MARK_AS_ADVANCED(OPENSSL_INCLUDE_DIR OPENSSL_LIBRARIES)

View file

@ -1,23 +1,21 @@
# Already set, so only add definition
# IF(PLATFORM)
# IF(PLATFORM MATCHES X64 AND WIN32)
# ADD_DEFINITIONS("-D_WIN64")
# ENDIF()
# ELSE()
# default to x86 platform. We'll check for X64 in a bit
SET(PLATFORM X86)
if(CMAKE_SIZEOF_VOID_P MATCHES 8)
set(PLATFORM 64)
MESSAGE(STATUS "Detected 64-bit platform")
else()
set(PLATFORM 32)
MESSAGE(STATUS "Detected 32-bit platform")
endif()
# This definition is necessary to work around a bug with Intellisense described
# here: http://tinyurl.com/2cb428. Syntax highlighting is important for proper
# debugger functionality.
if(PLATFORM MATCHES 32) # 32-bit
set(DEP_ARCH win32)
else() # 64-bit
set(DEP_ARCH x64)
endif()
IF(CMAKE_SIZEOF_VOID_P MATCHES 8)
MESSAGE(STATUS "Detected 64-bit platform.")
IF(WIN32)
ADD_DEFINITIONS("-D_WIN64")
ENDIF()
SET(PLATFORM X64)
ELSE()
MESSAGE(STATUS "Detected 32-bit platform.")
ENDIF()
# ENDIF()
if(XCODE)
if(PLATFORM MATCHES 32)
set(CMAKE_OSX_ARCHITECTURES i386)
else()
set(CMAKE_OSX_ARCHITECTURES x86_64)
endif()
endif()

186
cmake/FindPostgreSQL.cmake Normal file
View file

@ -0,0 +1,186 @@
#.rst:
# FindPostgreSQL
# --------------
#
# Find the PostgreSQL installation.
#
# In Windows, we make the assumption that, if the PostgreSQL files are
# installed, the default directory will be C:\Program Files\PostgreSQL.
#
# This module defines
#
# ::
#
# PostgreSQL_LIBRARIES - the PostgreSQL libraries needed for linking
# PostgreSQL_INCLUDE_DIRS - the directories of the PostgreSQL headers
# PostgreSQL_VERSION_STRING - the version of PostgreSQL found (since CMake 2.8.8)
#=============================================================================
# Copyright 2004-2009 Kitware, Inc.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# ----------------------------------------------------------------------------
# History:
# This module is derived from the module originally found in the VTK source tree.
#
# ----------------------------------------------------------------------------
# Note:
# PostgreSQL_ADDITIONAL_VERSIONS is a variable that can be used to set the
# version mumber of the implementation of PostgreSQL.
# In Windows the default installation of PostgreSQL uses that as part of the path.
# E.g C:\Program Files\PostgreSQL\8.4.
# Currently, the following version numbers are known to this module:
# "9.1" "9.0" "8.4" "8.3" "8.2" "8.1" "8.0"
#
# To use this variable just do something like this:
# set(PostgreSQL_ADDITIONAL_VERSIONS "9.2" "8.4.4")
# before calling find_package(PostgreSQL) in your CMakeLists.txt file.
# This will mean that the versions you set here will be found first in the order
# specified before the default ones are searched.
#
# ----------------------------------------------------------------------------
# You may need to manually set:
# PostgreSQL_INCLUDE_DIR - the path to where the PostgreSQL include files are.
# PostgreSQL_LIBRARY_DIR - The path to where the PostgreSQL library files are.
# If FindPostgreSQL.cmake cannot find the include files or the library files.
#
# ----------------------------------------------------------------------------
# The following variables are set if PostgreSQL is found:
# PostgreSQL_FOUND - Set to true when PostgreSQL is found.
# PostgreSQL_INCLUDE_DIRS - Include directories for PostgreSQL
# PostgreSQL_LIBRARY_DIRS - Link directories for PostgreSQL libraries
# PostgreSQL_LIBRARIES - The PostgreSQL libraries.
#
# ----------------------------------------------------------------------------
# If you have installed PostgreSQL in a non-standard location.
# (Please note that in the following comments, it is assumed that <Your Path>
# points to the root directory of the include directory of PostgreSQL.)
# Then you have three options.
# 1) After CMake runs, set PostgreSQL_INCLUDE_DIR to <Your Path>/include and
# PostgreSQL_LIBRARY_DIR to wherever the library pq (or libpq in windows) is
# 2) Use CMAKE_INCLUDE_PATH to set a path to <Your Path>/PostgreSQL<-version>. This will allow find_path()
# to locate PostgreSQL_INCLUDE_DIR by utilizing the PATH_SUFFIXES option. e.g. In your CMakeLists.txt file
# set(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} "<Your Path>/include")
# 3) Set an environment variable called ${PostgreSQL_ROOT} that points to the root of where you have
# installed PostgreSQL, e.g. <Your Path>.
#
# ----------------------------------------------------------------------------
set(PostgreSQL_INCLUDE_PATH_DESCRIPTION "top-level directory containing the PostgreSQL include directories. E.g /usr/local/include/PostgreSQL/8.4 or C:/Program Files/PostgreSQL/8.4/include")
set(PostgreSQL_INCLUDE_DIR_MESSAGE "Set the PostgreSQL_INCLUDE_DIR cmake cache entry to the ${PostgreSQL_INCLUDE_PATH_DESCRIPTION}")
set(PostgreSQL_LIBRARY_PATH_DESCRIPTION "top-level directory containing the PostgreSQL libraries.")
set(PostgreSQL_LIBRARY_DIR_MESSAGE "Set the PostgreSQL_LIBRARY_DIR cmake cache entry to the ${PostgreSQL_LIBRARY_PATH_DESCRIPTION}")
set(PostgreSQL_ROOT_DIR_MESSAGE "Set the PostgreSQL_ROOT system variable to where PostgreSQL is found on the machine E.g C:/Program Files/PostgreSQL/8.4")
set(PostgreSQL_KNOWN_VERSIONS ${PostgreSQL_ADDITIONAL_VERSIONS}
"9.1" "9.0" "8.4" "8.3" "8.2" "8.1" "8.0")
# Define additional search paths for root directories.
if ( WIN32 )
foreach (suffix ${PostgreSQL_KNOWN_VERSIONS} )
set(PostgreSQL_ADDITIONAL_SEARCH_PATHS ${PostgreSQL_ADDITIONAL_SEARCH_PATHS} "C:/Program Files/PostgreSQL/${suffix}" )
endforeach()
endif()
set( PostgreSQL_ROOT_DIRECTORIES
ENV PostgreSQL_ROOT
${PostgreSQL_ROOT}
${PostgreSQL_ADDITIONAL_SEARCH_PATHS}
)
#
# Look for an installation.
#
find_path(PostgreSQL_INCLUDE_DIR
NAMES libpq-fe.h
PATHS
# Look in other places.
${PostgreSQL_ROOT_DIRECTORIES}
PATH_SUFFIXES
pgsql
postgresql
include
# Help the user find it if we cannot.
DOC "The ${PostgreSQL_INCLUDE_DIR_MESSAGE}"
)
find_path(PostgreSQL_TYPE_INCLUDE_DIR
NAMES catalog/pg_type.h
PATHS
# Look in other places.
${PostgreSQL_ROOT_DIRECTORIES}
PATH_SUFFIXES
postgresql
pgsql/server
postgresql/server
include/server
# Help the user find it if we cannot.
DOC "The ${PostgreSQL_INCLUDE_DIR_MESSAGE}"
)
# The PostgreSQL library.
set (PostgreSQL_LIBRARY_TO_FIND pq)
# Setting some more prefixes for the library
set (PostgreSQL_LIB_PREFIX "")
if ( WIN32 )
set (PostgreSQL_LIB_PREFIX ${PostgreSQL_LIB_PREFIX} "lib")
set ( PostgreSQL_LIBRARY_TO_FIND ${PostgreSQL_LIB_PREFIX}${PostgreSQL_LIBRARY_TO_FIND})
endif()
find_library( PostgreSQL_LIBRARY
NAMES ${PostgreSQL_LIBRARY_TO_FIND}
PATHS
${PostgreSQL_ROOT_DIRECTORIES}
PATH_SUFFIXES
lib
)
get_filename_component(PostgreSQL_LIBRARY_DIR ${PostgreSQL_LIBRARY} PATH)
if (PostgreSQL_INCLUDE_DIR)
# Some platforms include multiple pg_config.hs for multi-lib configurations
# This is a temporary workaround. A better solution would be to compile
# a dummy c file and extract the value of the symbol.
file(GLOB _PG_CONFIG_HEADERS "${PostgreSQL_INCLUDE_DIR}/pg_config*.h")
foreach(_PG_CONFIG_HEADER ${_PG_CONFIG_HEADERS})
if(EXISTS "${_PG_CONFIG_HEADER}")
file(STRINGS "${_PG_CONFIG_HEADER}" pgsql_version_str
REGEX "^#define[\t ]+PG_VERSION[\t ]+\".*\"")
if(pgsql_version_str)
string(REGEX REPLACE "^#define[\t ]+PG_VERSION[\t ]+\"([^\"]*)\".*"
"\\1" PostgreSQL_VERSION_STRING "${pgsql_version_str}")
break()
endif()
endif()
endforeach()
unset(pgsql_version_str)
endif()
# Did we find anything?
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
find_package_handle_standard_args(PostgreSQL
REQUIRED_VARS PostgreSQL_LIBRARY PostgreSQL_INCLUDE_DIR PostgreSQL_TYPE_INCLUDE_DIR
VERSION_VAR PostgreSQL_VERSION_STRING)
set( PostgreSQL_FOUND ${POSTGRESQL_FOUND})
# Now try to get the include and library path.
if(PostgreSQL_FOUND)
set(PostgreSQL_INCLUDE_DIRS ${PostgreSQL_INCLUDE_DIR} ${PostgreSQL_TYPE_INCLUDE_DIR} )
set(PostgreSQL_LIBRARY_DIRS ${PostgreSQL_LIBRARY_DIR} )
set(PostgreSQL_LIBRARIES ${PostgreSQL_LIBRARY_TO_FIND})
#message("Final PostgreSQL include dir: ${PostgreSQL_INCLUDE_DIRS}")
#message("Final PostgreSQL library dir: ${PostgreSQL_LIBRARY_DIRS}")
#message("Final PostgreSQL libraries: ${PostgreSQL_LIBRARIES}")
endif()
mark_as_advanced(PostgreSQL_INCLUDE_DIR PostgreSQL_TYPE_INCLUDE_DIR PostgreSQL_LIBRARY )

View file

@ -1,22 +0,0 @@
# find Readline (terminal input library) includes and library
#
# READLINE_INCLUDE_DIR - where the directory containing the READLINE headers can be found
# READLINE_LIBRARY - full path to the READLINE library
# READLINE_FOUND - TRUE if READLINE was found
MACRO(FIND_READLINE)
FIND_PATH(READLINE_INCLUDE_DIR readline/readline.h)
FIND_LIBRARY(READLINE_LIBRARY NAMES readline)
IF (READLINE_INCLUDE_DIR AND READLINE_LIBRARY)
SET(READLINE_FOUND TRUE)
MESSAGE(STATUS "Found Readline library: ${READLINE_LIBRARY}")
MESSAGE(STATUS "Include dir is: ${READLINE_INCLUDE_DIR}")
INCLUDE_DIRECTORIES(${READLINE_INCLUDE_DIR})
ELSE (READLINE_INCLUDE_DIR AND READLINE_LIBRARY)
SET(READLINE_FOUND FALSE)
MESSAGE(FATAL_ERROR "** Readline library not found!\n** Your distro may provide a binary for Readline e.g. for ubuntu try apt-get install libreadline5-dev")
ENDIF (READLINE_INCLUDE_DIR AND READLINE_LIBRARY)
ENDMACRO(FIND_READLINE)

View file

@ -1,33 +0,0 @@
# find Termcap (terminal input library) includes and library
#
# TERMCAP_INCLUDE_DIR - where the directory containing the TERMCAP headers can be found
# TERMCAP_LIBRARY - full path to the TERMCAP library
# TERMCAP_FOUND - TRUE if TERMCAP was found
MACRO(FIND_TERMCAP)
FIND_PATH(TERMCAP_INCLUDE_DIR termcap.h
/usr/include
/usr/local/include
/opt/local/include
)
FIND_LIBRARY(TERMCAP_LIBRARY NAMES termcap PATH
/usr/lib
/usr/local/lib
/opt/local/lib
/usr/lib64
)
IF (TERMCAP_INCLUDE_DIR AND TERMCAP_LIBRARY)
SET(TERMCAP_FOUND TRUE)
MESSAGE(STATUS "Found GNU termcap: ${TERMCAP_LIBRARY}")
MESSAGE(STATUS "Include dir is: ${TERMCAP_INCLUDE_DIR}")
INCLUDE_DIRECTORIES(${TERMCAP_INCLUDE_DIR})
ELSE (TERMCAP_INCLUDE_DIR AND TERMCAP_LIBRARY)
SET(TERMCAP_FOUND FALSE)
MESSAGE(FATAL_ERROR "Could not find GNU termcap")
ENDIF (TERMCAP_INCLUDE_DIR AND TERMCAP_LIBRARY)
ENDMACRO(FIND_TERMCAP)

153
cmake/SetDefinitions.cmake Normal file
View file

@ -0,0 +1,153 @@
#
# This code is part of MaNGOS. Contributor & Copyright details are in AUTHORS/THANKS.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
#Force set the default install path if it is default
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/bin/" CACHE PATH "MaNGOS default install prefix" FORCE)
endif(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
#Set config install path correctly from given path
string(FIND "${CONF_DIR}" ":" CONF_DIR_ABSOLUTE)
if(${CONF_DIR_ABSOLUTE} EQUAL -1)
#Path was not absolute
set(CONF_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/${CONF_DIR}")
if(MSVC)
set(CONF_COPY_DIR "${CMAKE_BINARY_DIR}/bin/$(ConfigurationName)/${CONF_DIR}")
endif()
else()
#Path was absolute
set(CONF_INSTALL_DIR "${CONF_DIR}")
if(MSVC)
set(CONF_COPY_DIR "${CONF_DIR}")
endif()
endif()
if(WIN32)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
set(BIN_DIR ${CMAKE_INSTALL_PREFIX}/)
set(LIBS_DIR ${CMAKE_INSTALL_PREFIX}/)
if(MSVC)
if(PLATFORM EQUAL 64)
# This definition is necessary to work around a bug with Intellisense described
# here: http://tinyurl.com/2cb428. Syntax highlighting is important for proper
# debugger functionality.
add_definitions("-D_WIN64")
# Enable extended object support for debug compiles on X64 (not required on X86)
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /bigobj")
else()
# Mark 32 bit executables large address aware so they can use > 2GB address space
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /LARGEADDRESSAWARE")
add_definitions(/arch:SSE2)
endif()
if(NOT CMAKE_GENERATOR MATCHES "Visual Studio 7")
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /wd4996 /wd4355 /wd4244 /wd4985 /wd4267 /MP")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /wd4996 /wd4355 /wd4244 /wd4267 /MP")
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /wd4996 /wd4355 /wd4244 /wd4985 /wd4267 /MP")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /wd4996 /wd4355 /wd4244 /wd4985 /wd4267 /MP")
endif()
# Specify the maximum PreCompiled Header memory allocation limit
# Fixes a compiler-problem when using PCH - the /Ym flag is adjusted by the compiler in MSVC2012, hence we need to set an upper limit with /Zm to avoid discrepancies)
# (And yes, this is a verified , unresolved bug with MSVC... *sigh*)
string(REGEX REPLACE "/Zm[0-9]+ *" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Zm500" CACHE STRING "" FORCE)
elseif(MINGW)
if(PLATFORM EQUAL 32)
set(SSE_FLAGS "-msse2 -mfpmath=sse")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${SSE_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${SSE_FLAGS}")
endif()
add_definitions(-DHAVE_SSE2 -D__SSE2__)
if(NOT DEBUG)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --no-warnings")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --no-warnings")
else()
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -W -Wall -Wextra -Winit-self -Winvalid-pch -Wfatal-errors -g3")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -W -Wall -Wextra -Winit-self -Winvalid-pch -Wfatal-errors -Woverloaded-virtual -g3")
endif()
endif()
elseif(UNIX)
set(BIN_DIR ${CMAKE_INSTALL_PREFIX}/bin)
set(LIBS_DIR ${CMAKE_INSTALL_PREFIX}/lib)
# For Unix systems set the rpath so that libraries are found
set(CMAKE_INSTALL_RPATH "${LIBS_DIR}")
set(CMAKE_INSTALL_NAME_DIR "${LIBS_DIR}")
# Run out of build tree
set(CMAKE_BUILD_WITH_INSTALL_RPATH OFF)
# Add uninstall script and target
configure_file(
"${CMAKE_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in"
"${CMAKE_BINARY_DIR}/cmake_uninstall.cmake"
IMMEDIATE @ONLY
)
add_custom_target(uninstall
"${CMAKE_COMMAND}" -P "${CMAKE_BINARY_DIR}/cmake_uninstall.cmake"
)
if(CMAKE_C_COMPILER MATCHES "gcc" OR CMAKE_C_COMPILER_ID STREQUAL "GNU")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99")
if(PLATFORM EQUAL 32)
set(SSE_FLAGS "-msse2 -mfpmath=sse")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${SSE_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${SSE_FLAGS}")
endif()
add_definitions(-DHAVE_SSE2 -D__SSE2__)
if(NOT DEBUG)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --no-warnings")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --no-warnings")
else()
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -W -Wall -Wextra -Winit-self -Winvalid-pch -Wfatal-errors -g3")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -W -Wall -Wextra -Winit-self -Winvalid-pch -Wfatal-errors -Woverloaded-virtual -g3")
endif()
elseif(CMAKE_C_COMPILER MATCHES "icc")
if(PLATFORM EQUAL 32)
add_definitions(-axSSE2)
else()
add_definitions(-xSSE2)
endif()
if(DEBUG)
add_definitions(-w1)
add_definitions(-g)
endif()
elseif(CMAKE_C_COMPILER MATCHES "clang" OR CMAKE_C_COMPILER_ID STREQUAL "Clang")
if(DEBUG)
set(WARNING_FLAGS "-W -Wall -Wextra -Winit-self -Wfatal-errors")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${WARNING_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${WARNING_FLAGS} -Woverloaded-virtual")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g3")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g3")
endif()
# -Wno-narrowing needed to suppress a warning in g3d
# -Wno-deprecated-register is needed to suppress 185 gsoap warnings on Unix systems.
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wno-narrowing -Wno-deprecated-register")
endif()
elseif(FreeBSD)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -stdlib=libc++")
endif()

View file

@ -18,10 +18,22 @@ if(NOT ACE_USE_EXTERNAL)
add_subdirectory(acelite)
endif()
add_subdirectory(recastnavigation)
add_subdirectory(src)
add_subdirectory(StormLib)
if(SOAP)
add_subdirectory(gsoap)
endif()
if(SCRIPT_LIB_ELUNA)
add_subdirectory(lualib)
endif()
endif()
if(USE_STORMLIB)
add_subdirectory(StormLib)
else()
add_subdirectory(libmpq)
endif()
add_subdirectory(recastnavigation)
add_subdirectory(g3dlite)
add_subdirectory(zlib)
add_subdirectory(loadlib)
add_subdirectory(bzip2)

63
dep/README.md Normal file
View file

@ -0,0 +1,63 @@
[![](https://www.getmangos.eu/images/primus/blue/misc/logo.png)](http://www.getmangos.eu)&nbsp;
[![](https://github.com/mangoszero/server/raw/master/icons/FORUM.gif)](https://www.getmangos.eu/forum.php)
[![](https://github.com/mangoszero/server/raw/master/icons/WIKI.gif)](http://github.com/mangoswiki/wiki/wiki)
[![](https://github.com/mangoszero/server/raw/master/icons/TOOLS.gif)](http://github.com/mangostools)
[![](https://github.com/mangoszero/server/raw/master/icons/TRACKER.gif)](https://www.getmangos.eu/project.php)
Mangos Dependencies
------------
*Mangos* stands on the shoulders of well-known Open Source
libraries, and a few awesome, but less known libraries to prevent us from
inventing the wheel again.
*Please note that Linux and Mac OS X users should install packages using
their systems package management instead of source packages.*
* **MySQL** / **PostgreSQL**: to store content, and user data, we rely on
[MySQL][1]/[MariaDB][2] and [PostgreSQL][3] to handle data.
* **ACE**: the [ADAPTIVE Communication Environment][4] aka. *ACE* provides us
with a solid cross-platform framework for abstracting operating system
specific details.
* **Recast**: in order to create navigation data from the client's map files,
we use [Recast][5] to do the dirty work. It provides functions for
rendering, pathing, etc.
* **G3D**: the [G3D][6] engine provides the basic framework for handling 3D
data, and is used to handle basic map data.
* **libmpq**: [libmpq][7] provides an abstraction layer for reading from the
client's data files.
* **Zlib**: [Zlib][12] ([Zlib for Windows][10]) provides compression algorithms
used in both MPQ archive handling and the client/server protocol.
* **Bzip2**: [Bzip2][13] ([Bzip2 for Windows][11]) provides compression
algorithms used in MPQ archives.
* **OpenSSL**: [OpenSSL][8] ([OpenSSL for Windows][14]) provides encryption
algorithms used when authenticating clients.
* **Lua**: [Lua 5.2][15] ([Lua 5.2 for Windows][16]) provides a convenient, fast
scripting environment, which allows us to make live changes to scripted
content.
*Recast*, *G3D* and *libmpq* are included in the *Mangos* distribution as
we rely on specific versions. *libmpq* is to be replaced with *stormlib* shortly.
Optional dependencies
---------------------
* **Doxygen**: if you want to export HTML or PDF formatted documentation for the
*Mangos* API, you should install [Doxygen][9].
[1]: http://www.mysql.com/ "MySQL · The world's most popular open source database"
[2]: http://www.mariadb.org/ "MariaDB · An enhanced, drop-in replacement for MySQL"
[3]: http://www.postgresql.org/ "PostgreSQL · The world's most advanced open source database"
[4]: http://www.cs.wustl.edu/~schmidt/ACE.html "ACE · The ADAPTIVE Communication Environment"
[5]: http://github.com/memononen/recastnavigation "Recast · Navigation-mesh Toolset for Games"
[6]: http://sourceforge.net/projects/g3d/ "G3D · G3D Innovation Engine"
[7]: http://github.com/ge0rg/libmpq "libmpq · A library for reading data from MPQ archives"
[8]: http://www.openssl.org/ "OpenSSL · The Open Source toolkit for SSL/TLS"
[9]: http://www.stack.nl/~dimitri/doxygen/ "Doxygen · API documentation generator"
[10]: http://gnuwin32.sourceforge.net/packages/zlib.htm "Zlib for Windows"
[11]: http://gnuwin32.sourceforge.net/packages/bzip2.htm "Bzip2 for Windows"
[12]: http://www.zlib.net/ "Zlib"
[13]: http://www.bzip.org/ "Bzip2"
[14]: http://slproweb.com/products/Win32OpenSSL.html "OpenSSL for Windows"
[15]: http://www.lua.org/ "Lua"
[16]: https://code.google.com/p/luaforwindows/ "Lua for Windows"

View file

@ -2,115 +2,113 @@ 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/SBaseDumpData.cpp
src/SBaseFileTable.cpp
src/SBaseSubTypes.cpp
src/SCompression.cpp
src/SFileAddFile.cpp
src/SFileAttributes.cpp
src/SFileCompactArchive.cpp
src/SFileCreateArchive.cpp
src/SFileExtractFile.cpp
src/SFileFindFile.cpp
src/SFileGetFileInfo.cpp
src/SFileListFile.cpp
src/SFileOpenArchive.cpp
src/SFileOpenFileEx.cpp
src/SFilePatchArchives.cpp
src/SFileReadFile.cpp
src/SFileVerify.cpp
src/libtomcrypt/src/pk/rsa/rsa_verify_simple.c
src/libtomcrypt/src/misc/crypt_libc.c
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/SBaseDumpData.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
src/libtomcrypt/src/pk/rsa/rsa_verify_simple.c
src/libtomcrypt/src/misc/crypt_libc.c
)
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_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_encode_bit_string.c
src/libtomcrypt/src/pk/asn1/der_encode_boolean.c
src/libtomcrypt/src/pk/asn1/der_encode_ia5_string.c
src/libtomcrypt/src/pk/asn1/der_encode_integer.c
src/libtomcrypt/src/pk/asn1/der_encode_object_identifier.c
src/libtomcrypt/src/pk/asn1/der_encode_octet_string.c
src/libtomcrypt/src/pk/asn1/der_encode_printable_string.c
src/libtomcrypt/src/pk/asn1/der_encode_sequence_ex.c
src/libtomcrypt/src/pk/asn1/der_encode_sequence_multi.c
src/libtomcrypt/src/pk/asn1/der_encode_set.c
src/libtomcrypt/src/pk/asn1/der_encode_setof.c
src/libtomcrypt/src/pk/asn1/der_encode_short_integer.c
src/libtomcrypt/src/pk/asn1/der_encode_utctime.c
src/libtomcrypt/src/pk/asn1/der_encode_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_pss_encode.c
src/libtomcrypt/src/pk/pkcs1/pkcs_1_v1_5_decode.c
src/libtomcrypt/src/pk/pkcs1/pkcs_1_v1_5_encode.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_sign_hash.c
src/libtomcrypt/src/pk/rsa/rsa_verify_hash.c
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_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_encode_bit_string.c
src/libtomcrypt/src/pk/asn1/der_encode_boolean.c
src/libtomcrypt/src/pk/asn1/der_encode_ia5_string.c
src/libtomcrypt/src/pk/asn1/der_encode_integer.c
src/libtomcrypt/src/pk/asn1/der_encode_object_identifier.c
src/libtomcrypt/src/pk/asn1/der_encode_octet_string.c
src/libtomcrypt/src/pk/asn1/der_encode_printable_string.c
src/libtomcrypt/src/pk/asn1/der_encode_sequence_ex.c
src/libtomcrypt/src/pk/asn1/der_encode_sequence_multi.c
src/libtomcrypt/src/pk/asn1/der_encode_set.c
src/libtomcrypt/src/pk/asn1/der_encode_setof.c
src/libtomcrypt/src/pk/asn1/der_encode_short_integer.c
src/libtomcrypt/src/pk/asn1/der_encode_utctime.c
src/libtomcrypt/src/pk/asn1/der_encode_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_pss_encode.c
src/libtomcrypt/src/pk/pkcs1/pkcs_1_v1_5_decode.c
src/libtomcrypt/src/pk/pkcs1/pkcs_1_v1_5_encode.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_sign_hash.c
src/libtomcrypt/src/pk/rsa/rsa_verify_hash.c
)
set(TOMMATH_FILES

File diff suppressed because it is too large Load diff

View file

@ -14,77 +14,58 @@
//-----------------------------------------------------------------------------
// Function prototypes
typedef void (*STREAM_INIT)(
struct TFileStream * pStream // Pointer to an unopened stream
);
typedef bool (*STREAM_CREATE)(
struct TFileStream * pStream // Pointer to an unopened stream
);
typedef bool (*STREAM_OPEN)(
struct TFileStream * pStream, // Pointer to an unopened stream
const TCHAR * szFileName, // Pointer to file name to be open
DWORD dwStreamFlags // Stream flags
);
typedef bool (*STREAM_READ)(
struct TFileStream * pStream, // Pointer to an open stream
ULONGLONG * pByteOffset, // Pointer to file byte offset. If NULL, it reads from the current position
void * pvBuffer, // Pointer to data to be read
DWORD dwBytesToRead // Number of bytes to read from the file
);
struct TFileStream * pStream, // Pointer to an open stream
ULONGLONG * pByteOffset, // Pointer to file byte offset. If NULL, it reads from the current position
void * pvBuffer, // Pointer to data to be read
DWORD dwBytesToRead // Number of bytes to read from the file
);
typedef bool (*STREAM_WRITE)(
struct TFileStream * pStream, // Pointer to an open stream
ULONGLONG * pByteOffset, // Pointer to file byte offset. If NULL, it writes to the current position
const void * pvBuffer, // Pointer to data to be written
DWORD dwBytesToWrite // Number of bytes to read from the file
);
typedef bool (*STREAM_RESIZE)(
struct TFileStream * pStream, // Pointer to an open stream
ULONGLONG FileSize // New size for the file, in bytes
);
typedef bool (*STREAM_GETSIZE)(
struct TFileStream * pStream, // Pointer to an open stream
ULONGLONG * pFileSize // Receives the file size, in bytes
);
struct TFileStream * pStream, // Pointer to an open stream
ULONGLONG * pByteOffset, // Pointer to file byte offset. If NULL, it writes to the current position
const void * pvBuffer, // Pointer to data to be written
DWORD dwBytesToWrite // Number of bytes to read from the file
);
typedef bool (*STREAM_GETPOS)(
struct TFileStream * pStream, // Pointer to an open stream
ULONGLONG * pByteOffset // Pointer to store current file position
);
struct TFileStream * pStream, // Pointer to an open stream
ULONGLONG * pByteOffset // Pointer to store current file position
);
typedef bool (*STREAM_GETSIZE)(
struct TFileStream * pStream, // Pointer to an open stream
ULONGLONG * pFileSize // Receives the file size, in bytes
);
typedef bool (*STREAM_SETSIZE)(
struct TFileStream * pStream, // Pointer to an open stream
ULONGLONG FileSize // New size for the file, in bytes
);
typedef bool (*STREAM_GETTIME)(
struct TFileStream * pStream,
ULONGLONG * pFT
);
typedef bool (*STREAM_SWITCH)(
struct TFileStream * pStream,
struct TFileStream * pNewStream
);
typedef bool (*STREAM_GETBMP)(
TFileStream * pStream,
TFileBitmap * pBitmap,
DWORD Length,
LPDWORD LengthNeeded
);
typedef void (*STREAM_CLOSE)(
struct TFileStream * pStream // Pointer to an open stream
);
typedef bool (*BLOCK_READ)(
struct TFileStream * pStream, // Pointer to a block-oriented stream
ULONGLONG StartOffset, // Byte offset of start of the block array
ULONGLONG EndOffset, // End offset (either end of the block or end of the file)
LPBYTE BlockBuffer, // Pointer to block-aligned buffer
DWORD BytesNeeded, // Number of bytes that are really needed
bool bAvailable // true if the block is available
);
typedef bool (*BLOCK_CHECK)(
struct TFileStream * pStream, // Pointer to a block-oriented stream
ULONGLONG BlockOffset // Offset of the file to check
);
typedef void (*BLOCK_SAVEMAP)(
struct TFileStream * pStream // Pointer to a block-oriented stream
);
struct TFileStream * pStream
);
//-----------------------------------------------------------------------------
// Local structures - partial file structure and bitmap footer
#define ID_FILE_BITMAP_FOOTER 0x33767470 // Signature of the file bitmap footer ('ptv3')
#define DEFAULT_BLOCK_SIZE 0x00004000 // Default size of the stream block
#define DEFAULT_BUILD_NUMBER 10958 // Build number for newly created partial MPQs
// Local structures - part file structure
typedef struct _PART_FILE_HEADER
{
@ -108,108 +89,99 @@ typedef struct _PART_FILE_MAP_ENTRY
} PART_FILE_MAP_ENTRY, *PPART_FILE_MAP_ENTRY;
typedef struct _FILE_BITMAP_FOOTER
{
DWORD Signature; // 'ptv3' (ID_FILE_BITMAP_FOOTER)
DWORD Version; // Unknown, seems to always have value of 3 (version?)
DWORD BuildNumber; // Game build number for that MPQ
DWORD MapOffsetLo; // Low 32-bits of the offset of the bit map
DWORD MapOffsetHi; // High 32-bits of the offset of the bit map
DWORD BlockSize; // Size of one block (usually 0x4000 bytes)
} FILE_BITMAP_FOOTER, *PFILE_BITMAP_FOOTER;
//-----------------------------------------------------------------------------
// Structure for file stream
// Local structures
union TBaseProviderData
union TBaseData
{
struct
{
ULONGLONG FileSize; // Size of the file
ULONGLONG FilePos; // Current file position
ULONGLONG FileTime; // Last write time
ULONGLONG FileTime; // Date/time of last modification of the file
HANDLE hFile; // File handle
} File;
struct
{
ULONGLONG FileSize; // Size of the file
ULONGLONG FilePos; // Current file position
ULONGLONG FileTime; // Last write time
ULONGLONG FileSize; // Mapped file size
ULONGLONG FilePos; // Current stream position
ULONGLONG FileTime; // Date/time of last modification of the file
LPBYTE pbFile; // Pointer to mapped view
} Map;
struct
{
ULONGLONG FileSize; // Size of the file
ULONGLONG FilePos; // Current file position
ULONGLONG FileTime; // Last write time
ULONGLONG FileSize; // Size of the internet file
ULONGLONG FilePos; // Current position in the file
ULONGLONG FileTime; // Date/time of last modification of the file
HANDLE hInternet; // Internet handle
HANDLE hConnect; // Connection to the internet server
} Http;
};
//-----------------------------------------------------------------------------
// Structure for linear stream
struct TFileStream
{
// Stream provider functions
STREAM_READ StreamRead; // Pointer to stream read function for this archive. Do not use directly.
STREAM_WRITE StreamWrite; // Pointer to stream write function for this archive. Do not use directly.
STREAM_RESIZE StreamResize; // Pointer to function changing file size
STREAM_GETSIZE StreamGetSize; // Pointer to function returning file size
STREAM_GETPOS StreamGetPos; // Pointer to function that returns current file position
STREAM_GETSIZE StreamGetSize; // Pointer to function returning file size
STREAM_SETSIZE StreamSetSize; // Pointer to function changing file size
STREAM_GETTIME StreamGetTime; // Pointer to function retrieving the file time
STREAM_GETBMP StreamGetBmp; // Pointer to function that retrieves the file bitmap
STREAM_SWITCH StreamSwitch; // Pointer to function changing the stream to another file
STREAM_CLOSE StreamClose; // Pointer to function closing the stream
// Block-oriented functions
BLOCK_READ BlockRead; // Pointer to function reading one or more blocks
BLOCK_CHECK BlockCheck; // Pointer to function checking whether the block is present
// Stream provider data members
TCHAR szFileName[MAX_PATH]; // File name
DWORD dwFlags; // Stream flags
// Base provider functions
STREAM_CREATE BaseCreate; // Pointer to base create function
STREAM_OPEN BaseOpen; // Pointer to base open function
STREAM_READ BaseRead; // Read from the stream
STREAM_WRITE BaseWrite; // Write to the stream
STREAM_RESIZE BaseResize; // Pointer to function changing file size
STREAM_GETSIZE BaseGetSize; // Pointer to function returning file size
STREAM_READ BaseRead;
STREAM_WRITE BaseWrite;
STREAM_GETPOS BaseGetPos; // Pointer to function that returns current file position
STREAM_GETSIZE BaseGetSize; // Pointer to function returning file size
STREAM_SETSIZE BaseSetSize; // Pointer to function changing file size
STREAM_GETTIME BaseGetTime; // Pointer to function retrieving the file time
STREAM_CLOSE BaseClose; // Pointer to function closing the stream
// Base provider data (file size, file position)
TBaseProviderData Base;
// Stream provider data
TFileStream * pMaster; // Master stream (e.g. MPQ on a web server)
TCHAR * szFileName; // File name (self-relative pointer)
ULONGLONG StreamSize; // Stream size (can be less than file size)
ULONGLONG StreamPos; // Stream position
DWORD BuildNumber; // Game build number
DWORD dwFlags; // Stream flags
// Base provider data members
TBaseData Base; // Base provider data
// Followed by stream provider data, with variable length
};
//-----------------------------------------------------------------------------
// Structures for block-oriented stream
// Structure for linear stream
struct TBlockStream : public TFileStream
struct TLinearStream : public TFileStream
{
SFILE_DOWNLOAD_CALLBACK pfnCallback; // Callback for downloading
void * FileBitmap; // Array of bits for file blocks
void * UserData; // User data to be passed to the download callback
DWORD BitmapSize; // Size of the file bitmap (in bytes)
DWORD BlockSize; // Size of one block, in bytes
DWORD BlockCount; // Number of data blocks in the file
DWORD IsComplete; // If nonzero, no blocks are missing
DWORD IsModified; // nonzero if the bitmap has been modified
};
TFileBitmap * pBitmap; // Pointer to the stream bitmap
};
//-----------------------------------------------------------------------------
// Structure for partial stream
struct TPartialStream : public TFileStream
{
ULONGLONG VirtualSize; // Virtual size of the file
ULONGLONG VirtualPos; // Virtual position in the file
DWORD BlockCount; // Number of file blocks. Used by partial file stream
DWORD BlockSize; // Size of one block. Used by partial file stream
PPART_FILE_MAP_ENTRY PartMap; // File map, variable length
};
//-----------------------------------------------------------------------------
// Structure for encrypted stream
#define MPQE_CHUNK_SIZE 0x40 // Size of one chunk to be decrypted
struct TEncryptedStream : public TBlockStream
struct TEncryptedStream : public TFileStream
{
BYTE Key[MPQE_CHUNK_SIZE]; // File key
};

File diff suppressed because it is too large Load diff

View file

@ -49,14 +49,14 @@ void DumpHetAndBetTable(TMPQHetTable * pHetTable, TMPQBetTable * pBetTable)
return;
printf("== HET Header =================================\n");
printf("ULONGLONG AndMask64 = %016llX\n", pHetTable->AndMask64);
printf("ULONGLONG OrMask64 = %016llX\n", pHetTable->OrMask64);
printf("ULONGLONG AndMask64 = %016llX\n", pHetTable->AndMask64);
printf("ULONGLONG OrMask64 = %016llX\n", pHetTable->OrMask64);
printf("DWORD dwIndexSizeTotal = %08X\n", pHetTable->dwIndexSizeTotal);
printf("DWORD dwIndexSizeExtra = %08X\n", pHetTable->dwIndexSizeExtra);
printf("DWORD dwIndexSize = %08X\n", pHetTable->dwIndexSize);
printf("DWORD dwMaxFileCount = %08X\n", pHetTable->dwMaxFileCount);
printf("DWORD dwHashTableSize = %08X\n", pHetTable->dwHashTableSize);
printf("DWORD dwHashBitSize = %08X\n", pHetTable->dwHashBitSize);
printf("DWORD dwIndexSize = %08X\n", pHetTable->dwIndexSize);
printf("DWORD dwMaxFileCount = %08X\n", pHetTable->dwMaxFileCount);
printf("DWORD dwHashTableSize = %08X\n", pHetTable->dwHashTableSize);
printf("DWORD dwHashBitSize = %08X\n", pHetTable->dwHashBitSize);
printf("-----------------------------------------------\n\n");
printf("== BET Header =================================\n");
@ -69,7 +69,7 @@ void DumpHetAndBetTable(TMPQHetTable * pHetTable, TMPQBetTable * pBetTable)
printf("DWORD dwBitCount_FilePos = %08X\n", pBetTable->dwBitCount_FilePos);
printf("DWORD dwBitCount_FileSize = %08X\n", pBetTable->dwBitCount_FileSize);
printf("DWORD dwBitCount_CmpSize = %08X\n", pBetTable->dwBitCount_CmpSize);
printf("DWORD dwBitCount_FlagIndex = %08X\n", pBetTable->dwBitCount_FlagIndex);
printf("DWORD dwBitCount_FlagIndex = %08X\n", pBetTable->dwBitCount_FlagIndex);
printf("DWORD dwBitCount_Unknown = %08X\n", pBetTable->dwBitCount_Unknown);
printf("DWORD dwBetHashSizeTotal = %08X\n", pBetTable->dwBetHashSizeTotal);
printf("DWORD dwBetHashSizeExtra = %08X\n", pBetTable->dwBetHashSizeExtra);
@ -93,50 +93,50 @@ void DumpHetAndBetTable(TMPQHetTable * pHetTable, TMPQBetTable * pBetTable)
GetBits(pHetTable->pBetIndexes, i * pHetTable->dwIndexSizeTotal,
pHetTable->dwIndexSize,
&dwBetIndex,
&dwBetIndex,
4);
if(dwBetIndex < pHetTable->dwMaxFileCount)
{
DWORD dwEntryIndex = pBetTable->dwTableEntrySize * dwBetIndex;
GetBits(pBetTable->pBetHashes, dwBetIndex * pBetTable->dwBetHashSizeTotal,
pBetTable->dwBetHashSize,
&BetHash,
&BetHash,
8);
GetBits(pBetTable->pFileTable, dwEntryIndex + pBetTable->dwBitIndex_FilePos,
GetBits(dwEntryIndex + pBetTable->dwBitIndex_FilePos,
pBetTable->dwBitCount_FilePos,
&ByteOffset,
&ByteOffset,
8);
GetBits(pBetTable->pFileTable, dwEntryIndex + pBetTable->dwBitIndex_FileSize,
GetBits(dwEntryIndex + pBetTable->dwBitIndex_FileSize,
pBetTable->dwBitCount_FileSize,
&dwFileSize,
&dwFileSize,
4);
GetBits(pBetTable->pFileTable, dwEntryIndex + pBetTable->dwBitIndex_CmpSize,
GetBits(dwEntryIndex + pBetTable->dwBitIndex_CmpSize,
pBetTable->dwBitCount_CmpSize,
&dwCmpSize,
&dwCmpSize,
4);
GetBits(pBetTable->pFileTable, dwEntryIndex + pBetTable->dwBitIndex_FlagIndex,
GetBits(dwEntryIndex + pBetTable->dwBitIndex_FlagIndex,
pBetTable->dwBitCount_FlagIndex,
&dwFlagIndex,
&dwFlagIndex,
4);
dwFlags = pBetTable->pFileFlags[dwFlagIndex];
}
printf(" %04X %02lX %04X %016llX %016llX %08X %08X %04X %08X\n", i,
pHetTable->pHetHashes[i],
dwBetIndex,
BetHash,
ByteOffset,
dwFileSize,
dwCmpSize,
dwFlagIndex,
dwFlags);
pHetTable->pHetHashes[i],
dwBetIndex,
BetHash,
ByteOffset,
dwFileSize,
dwCmpSize,
dwFlagIndex,
dwFlags);
}
printf("-----------------------------------------------------------------------------------------\n");
}

File diff suppressed because it is too large Load diff

View file

@ -1,620 +0,0 @@
/*****************************************************************************/
/* SBaseSubTypes.cpp Copyright (c) Ladislav Zezula 2013 */
/*---------------------------------------------------------------------------*/
/* Conversion routines for archive formats that are similar to MPQ format */
/*---------------------------------------------------------------------------*/
/* Date Ver Who Comment */
/* -------- ---- --- ------- */
/* 02.11.11 1.00 Lad The first version of SBaseSubTypes.cpp */
/*****************************************************************************/
#define __STORMLIB_SELF__
#include "StormLib.h"
#include "StormCommon.h"
/*****************************************************************************/
/* */
/* Support for SQP file format (War of the Immortals) */
/* */
/*****************************************************************************/
typedef struct _TSQPHeader
{
// The ID_MPQ ('MPQ\x1A') signature
DWORD dwID;
// Size of the archive header
DWORD dwHeaderSize;
// 32-bit size of MPQ archive
DWORD dwArchiveSize;
// 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;
// Must be zero for SQP files
USHORT wFormatVersion;
// Power of two exponent specifying the number of 512-byte disk sectors in each file sector
// in the archive. The size of each file sector in the archive is 512 * 2 ^ wSectorSize.
USHORT wSectorSize;
} TSQPHeader;
typedef struct _TSQPHash
{
// Most likely the lcLocale+wPlatform.
DWORD dwAlwaysZero;
// 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;
// The hash of the file path, using method A.
DWORD dwName1;
// The hash of the file path, using method B.
DWORD dwName2;
} TSQPHash;
typedef struct _TSQPBlock
{
// Offset of the beginning of the file, relative to the beginning of the archive.
DWORD dwFilePos;
// Flags for the file. See MPQ_FILE_XXXX constants
DWORD dwFlags;
// Compressed file size
DWORD dwCSize;
// Uncompressed file size
DWORD dwFSize;
} TSQPBlock;
//-----------------------------------------------------------------------------
// Functions - SQP file format
// This function converts SQP file header into MPQ file header
int ConvertSqpHeaderToFormat4(
TMPQArchive * ha,
ULONGLONG FileSize,
DWORD dwFlags)
{
TSQPHeader * pSqpHeader = (TSQPHeader *)ha->HeaderData;
TMPQHeader Header;
// SQP files from War of the Immortal use MPQ file format with slightly
// modified structure. These fields have different position:
//
// Offset TMPQHeader TSQPHeader
// ------ ---------- -----------
// 000C wFormatVersion dwHashTablePos (lo)
// 000E wSectorSize dwHashTablePos (hi)
// 001C dwBlockTableSize (lo) wBlockSize
// 001E dwHashTableSize (hi) wFormatVersion
// Can't open the archive with certain flags
if(dwFlags & MPQ_OPEN_FORCE_MPQ_V1)
return ERROR_FILE_CORRUPT;
// The file must not be greater than 4 GB
if((FileSize >> 0x20) != 0)
return ERROR_FILE_CORRUPT;
// Translate the SQP header into a MPQ header
memset(&Header, 0, sizeof(TMPQHeader));
Header.dwID = BSWAP_INT32_UNSIGNED(pSqpHeader->dwID);
Header.dwHeaderSize = BSWAP_INT32_UNSIGNED(pSqpHeader->dwHeaderSize);
Header.dwArchiveSize = BSWAP_INT32_UNSIGNED(pSqpHeader->dwArchiveSize);
Header.dwHashTablePos = BSWAP_INT32_UNSIGNED(pSqpHeader->dwHashTablePos);
Header.dwBlockTablePos = BSWAP_INT32_UNSIGNED(pSqpHeader->dwBlockTablePos);
Header.dwHashTableSize = BSWAP_INT32_UNSIGNED(pSqpHeader->dwHashTableSize);
Header.dwBlockTableSize = BSWAP_INT32_UNSIGNED(pSqpHeader->dwBlockTableSize);
Header.wFormatVersion = BSWAP_INT16_UNSIGNED(pSqpHeader->wFormatVersion);
Header.wSectorSize = BSWAP_INT16_UNSIGNED(pSqpHeader->wSectorSize);
// Verify the SQP header
if(Header.dwID == ID_MPQ && Header.dwHeaderSize == sizeof(TSQPHeader) && Header.dwArchiveSize == FileSize)
{
// Check for fixed values of version and sector size
if(Header.wFormatVersion == MPQ_FORMAT_VERSION_1 && Header.wSectorSize == 3)
{
// Initialize the fields of 3.0 header
Header.ArchiveSize64 = Header.dwArchiveSize;
Header.HashTableSize64 = Header.dwHashTableSize * sizeof(TMPQHash);
Header.BlockTableSize64 = Header.dwBlockTableSize * sizeof(TMPQBlock);
// Copy the converted MPQ header back
memcpy(ha->HeaderData, &Header, sizeof(TMPQHeader));
// Mark this file as SQP file
ha->pfnHashString = HashStringSlash;
ha->dwFlags |= MPQ_FLAG_READ_ONLY;
ha->dwSubType = MPQ_SUBTYPE_SQP;
return ERROR_SUCCESS;
}
}
return ERROR_FILE_CORRUPT;
}
void * LoadSqpTable(TMPQArchive * ha, DWORD dwByteOffset, DWORD cbTableSize, DWORD dwKey)
{
ULONGLONG ByteOffset;
LPBYTE pbSqpTable;
// Allocate buffer for the table
pbSqpTable = STORM_ALLOC(BYTE, cbTableSize);
if(pbSqpTable != NULL)
{
// Load the table
ByteOffset = ha->MpqPos + dwByteOffset;
if(FileStream_Read(ha->pStream, &ByteOffset, pbSqpTable, cbTableSize))
{
// Decrypt the SQP table
DecryptMpqBlock(pbSqpTable, cbTableSize, dwKey);
return pbSqpTable;
}
// Free the table
STORM_FREE(pbSqpTable);
}
return NULL;
}
TMPQHash * LoadSqpHashTable(TMPQArchive * ha)
{
TMPQHeader * pHeader = ha->pHeader;
TSQPHash * pSqpHashTable;
TSQPHash * pSqpHashEnd;
TSQPHash * pSqpHash;
TMPQHash * pMpqHash;
DWORD dwBlockIndex;
int nError = ERROR_SUCCESS;
// Load the hash table
pSqpHashTable = (TSQPHash *)LoadSqpTable(ha, pHeader->dwHashTablePos, pHeader->dwHashTableSize * sizeof(TSQPHash), MPQ_KEY_HASH_TABLE);
if(pSqpHashTable != NULL)
{
// Parse the entire hash table and convert it to MPQ hash table
pSqpHashEnd = pSqpHashTable + pHeader->dwHashTableSize;
pMpqHash = (TMPQHash *)pSqpHashTable;
for(pSqpHash = pSqpHashTable; pSqpHash < pSqpHashEnd; pSqpHash++, pMpqHash++)
{
// Ignore free entries
if(pSqpHash->dwBlockIndex != HASH_ENTRY_FREE)
{
// Check block index against the size of the block table
dwBlockIndex = pSqpHash->dwBlockIndex;
if(pHeader->dwBlockTableSize <= dwBlockIndex && dwBlockIndex < HASH_ENTRY_DELETED)
nError = ERROR_FILE_CORRUPT;
// We do not support nonzero locale and platform ID
if(pSqpHash->dwAlwaysZero != 0 && pSqpHash->dwAlwaysZero != HASH_ENTRY_FREE)
nError = ERROR_FILE_CORRUPT;
// Store the file name hash
pMpqHash->dwName1 = pSqpHash->dwName1;
pMpqHash->dwName2 = pSqpHash->dwName2;
// Store the rest. Note that this must be done last,
// because pSqpHash->dwBlockIndex corresponds to pMpqHash->dwName2
pMpqHash->dwBlockIndex = dwBlockIndex;
pMpqHash->wPlatform = 0;
pMpqHash->lcLocale = 0;
}
}
// If an error occured, we need to free the hash table
if(nError != ERROR_SUCCESS)
{
STORM_FREE(pSqpHashTable);
pSqpHashTable = NULL;
}
}
// Return the converted hash table (or NULL on failure)
return (TMPQHash *)pSqpHashTable;
}
// Loads the SQP Block table and converts it to a MPQ block table
TMPQBlock * LoadSqpBlockTable(TMPQArchive * ha)
{
TMPQHeader * pHeader = ha->pHeader;
TSQPBlock * pSqpBlockTable;
TSQPBlock * pSqpBlockEnd;
TSQPBlock * pSqpBlock;
TMPQBlock * pMpqBlock;
DWORD dwFlags;
int nError = ERROR_SUCCESS;
// Load the hash table
pSqpBlockTable = (TSQPBlock *)LoadSqpTable(ha, pHeader->dwBlockTablePos, pHeader->dwBlockTableSize * sizeof(TSQPBlock), MPQ_KEY_BLOCK_TABLE);
if(pSqpBlockTable != NULL)
{
// Parse the entire hash table and convert it to MPQ hash table
pSqpBlockEnd = pSqpBlockTable + pHeader->dwBlockTableSize;
pMpqBlock = (TMPQBlock *)pSqpBlockTable;
for(pSqpBlock = pSqpBlockTable; pSqpBlock < pSqpBlockEnd; pSqpBlock++, pMpqBlock++)
{
// Check for valid flags
if(pSqpBlock->dwFlags & ~MPQ_FILE_VALID_FLAGS)
nError = ERROR_FILE_CORRUPT;
// Convert SQP block table entry to MPQ block table entry
dwFlags = pSqpBlock->dwFlags;
pMpqBlock->dwCSize = pSqpBlock->dwCSize;
pMpqBlock->dwFSize = pSqpBlock->dwFSize;
pMpqBlock->dwFlags = dwFlags;
}
// If an error occured, we need to free the hash table
if(nError != ERROR_SUCCESS)
{
STORM_FREE(pSqpBlockTable);
pSqpBlockTable = NULL;
}
}
// Return the converted hash table (or NULL on failure)
return (TMPQBlock *)pSqpBlockTable;
}
/*****************************************************************************/
/* */
/* Support for MPK file format (Longwu Online) */
/* */
/*****************************************************************************/
#define MPK_FILE_UNKNOWN_0001 0x00000001 // Seems to be always present
#define MPK_FILE_UNKNOWN_0010 0x00000010 // Seems to be always present
#define MPK_FILE_COMPRESSED 0x00000100 // Indicates a compressed file
#define MPK_FILE_UNKNOWN_2000 0x00002000 // Seems to be always present
#define MPK_FILE_EXISTS 0x01000000 // Seems to be always present
typedef struct _TMPKHeader
{
// The ID_MPK ('MPK\x1A') signature
DWORD dwID;
// Contains '2000'
DWORD dwVersion;
// 32-bit size of the archive
DWORD dwArchiveSize;
// Size of the archive header
DWORD dwHeaderSize;
DWORD dwHashTablePos;
DWORD dwHashTableSize;
DWORD dwBlockTablePos;
DWORD dwBlockTableSize;
DWORD dwUnknownPos;
DWORD dwUnknownSize;
} TMPKHeader;
typedef struct _TMPKHash
{
// The hash of the file path, using method A.
DWORD dwName1;
// The hash of the file path, using method B.
DWORD dwName2;
// The hash of the file path, using method C.
DWORD dwName3;
// 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;
} TMPKHash;
typedef struct _TMPKBlock
{
DWORD dwFlags; // 0x1121 - Compressed , 0x1120 - Not compressed
DWORD dwFilePos; // Offset of the beginning of the file, relative to the beginning of the archive.
DWORD dwFSize; // Uncompressed file size
DWORD dwCSize; // Compressed file size
DWORD dwUnknown; // 0x86364E6D
} TMPKBlock;
//-----------------------------------------------------------------------------
// Local variables - MPK file format
static const unsigned char MpkDecryptionKey[512] =
{
0x60, 0x20, 0x29, 0xE1, 0x01, 0xCE, 0xAA, 0xFE, 0xA3, 0xAB, 0x8E, 0x30, 0xAF, 0x02, 0xD1, 0x7D,
0x41, 0x24, 0x06, 0xBD, 0xAE, 0xBE, 0x43, 0xC3, 0xBA, 0xB7, 0x08, 0x13, 0x51, 0xCF, 0xF8, 0xF7,
0x25, 0x42, 0xA5, 0x4A, 0xDA, 0x0F, 0x52, 0x1C, 0x90, 0x3B, 0x63, 0x49, 0x36, 0xF6, 0xDD, 0x1B,
0xEA, 0x58, 0xD4, 0x40, 0x70, 0x61, 0x55, 0x09, 0xCD, 0x0B, 0xA2, 0x4B, 0x68, 0x2C, 0x8A, 0xF1,
0x3C, 0x3A, 0x65, 0xBB, 0xA1, 0xA8, 0x23, 0x97, 0xFD, 0x15, 0x00, 0x94, 0x88, 0x33, 0x59, 0xE9,
0xFB, 0x69, 0x21, 0xEF, 0x85, 0x5B, 0x57, 0x6C, 0xFA, 0xB5, 0xEE, 0xB8, 0x71, 0xDC, 0xB1, 0x38,
0x0C, 0x0A, 0x5C, 0x56, 0xC9, 0xB4, 0x84, 0x17, 0x1E, 0xE5, 0xD3, 0x5A, 0xCC, 0xFC, 0x11, 0x86,
0x7F, 0x45, 0x4F, 0x54, 0xC8, 0x8D, 0x73, 0x89, 0x79, 0x5D, 0xB3, 0xBF, 0xB9, 0xE3, 0x93, 0xE4,
0x6F, 0x35, 0x2D, 0x46, 0xF2, 0x76, 0xC5, 0x7E, 0xE2, 0xA4, 0xE6, 0xD9, 0x6E, 0x48, 0x34, 0x2B,
0xC6, 0x5F, 0xBC, 0xA0, 0x6D, 0x0D, 0x47, 0x6B, 0x95, 0x96, 0x92, 0x91, 0xB2, 0x27, 0xEB, 0x9E,
0xEC, 0x8F, 0xDF, 0x9C, 0x74, 0x99, 0x64, 0xF5, 0xFF, 0x28, 0xB6, 0x37, 0xF3, 0x7C, 0x81, 0x03,
0x44, 0x62, 0x1F, 0xDB, 0x04, 0x7B, 0xB0, 0x9B, 0x31, 0xA7, 0xDE, 0x78, 0x9F, 0xAD, 0x0E, 0x3F,
0x3E, 0x4D, 0xC7, 0xD7, 0x39, 0x19, 0x5E, 0xC2, 0xD0, 0xAC, 0xE8, 0x1A, 0x87, 0x8B, 0x07, 0x05,
0x22, 0xED, 0x72, 0x2E, 0x1D, 0xC1, 0xA9, 0xD6, 0xE0, 0x83, 0xD5, 0xD8, 0xCB, 0x80, 0xF0, 0x66,
0x7A, 0x9D, 0x50, 0xF9, 0x10, 0x4E, 0x16, 0x14, 0x77, 0x75, 0x6A, 0x67, 0xD2, 0xC0, 0xA6, 0xC4,
0x53, 0x8C, 0x32, 0xCA, 0x82, 0x2A, 0x18, 0x9A, 0xF4, 0x4C, 0x3D, 0x26, 0x12, 0xE7, 0x98, 0x2F,
0x4A, 0x04, 0x0D, 0xAF, 0xB4, 0xCF, 0x12, 0xCE, 0x1A, 0x37, 0x61, 0x39, 0x60, 0x95, 0xBE, 0x25,
0xE4, 0x6E, 0xFC, 0x1B, 0xE7, 0x49, 0xE6, 0x67, 0xF6, 0xC5, 0xCB, 0x2F, 0x27, 0xD4, 0x68, 0xB2,
0x01, 0x52, 0xD0, 0x46, 0x11, 0x20, 0xFB, 0x9D, 0xA9, 0x02, 0xF5, 0x8F, 0x3D, 0x82, 0xD3, 0xFF,
0x0B, 0xB8, 0xF2, 0x4D, 0x8E, 0x81, 0x2C, 0xAB, 0x5F, 0xC4, 0x41, 0x29, 0x40, 0xFA, 0xC0, 0xBF,
0x33, 0x10, 0x21, 0x16, 0xB0, 0x71, 0x83, 0x96, 0x8D, 0x2B, 0x23, 0x3B, 0xF9, 0xC1, 0xE5, 0x72,
0xE2, 0x1C, 0x26, 0xF0, 0x73, 0x36, 0x63, 0x56, 0x31, 0x4E, 0x6B, 0x55, 0x62, 0x79, 0xC6, 0x91,
0x00, 0x35, 0xB1, 0x2A, 0xA6, 0x42, 0xDF, 0xEB, 0x3C, 0x51, 0xEA, 0x97, 0x57, 0x94, 0x8C, 0x80,
0x34, 0x5C, 0xD2, 0x76, 0xA4, 0xE9, 0x85, 0xE8, 0xBB, 0x78, 0xE0, 0xB5, 0xAD, 0x0F, 0x87, 0x70,
0xDD, 0xAE, 0xF4, 0xD9, 0x66, 0x54, 0x6F, 0xCC, 0x4C, 0x77, 0x3E, 0xCD, 0xF1, 0x75, 0x0A, 0xA1,
0x28, 0x9B, 0x9A, 0x7E, 0x4B, 0x98, 0x99, 0x47, 0xFE, 0xA5, 0xF7, 0xB7, 0xA3, 0xE1, 0x9F, 0xBC,
0x93, 0x44, 0x3A, 0x08, 0x89, 0x22, 0xEE, 0xB9, 0x45, 0xD6, 0x06, 0x09, 0xC9, 0xBD, 0x14, 0x0C,
0xB6, 0x5E, 0x9C, 0x7A, 0x65, 0x59, 0xAA, 0x19, 0x5B, 0x7C, 0x18, 0x43, 0x92, 0x13, 0x15, 0x7B,
0xED, 0xD5, 0xC7, 0x17, 0xEF, 0x86, 0x90, 0xC2, 0x74, 0x64, 0xF3, 0xDC, 0x6C, 0x38, 0x05, 0x1D,
0xC8, 0x0E, 0xEC, 0x6A, 0x32, 0xDA, 0xD7, 0xC3, 0xDB, 0x8B, 0x24, 0xB3, 0x5D, 0x2E, 0xBA, 0xA2,
0xD8, 0x03, 0x88, 0x7D, 0x7F, 0x69, 0x8A, 0xFD, 0xCA, 0x4F, 0x30, 0x9E, 0xA0, 0xD1, 0x5A, 0x53,
0xDE, 0x3F, 0x84, 0xAC, 0xF8, 0xA7, 0x2D, 0x1F, 0x1E, 0xE3, 0x58, 0x50, 0x6D, 0x48, 0x07, 0xA8
};
//-----------------------------------------------------------------------------
// Functions - MPK file format
// This function converts MPK file header into MPQ file header
int ConvertMpkHeaderToFormat4(
TMPQArchive * ha,
ULONGLONG FileSize,
DWORD dwFlags)
{
TMPKHeader * pMpkHeader = (TMPKHeader *)ha->HeaderData;
TMPQHeader Header;
// Can't open the archive with certain flags
if(dwFlags & MPQ_OPEN_FORCE_MPQ_V1)
return ERROR_FILE_CORRUPT;
// Translate the MPK header into a MPQ header
// Note: Hash table size and block table size are in bytes, not in entries
memset(&Header, 0, sizeof(TMPQHeader));
Header.dwID = BSWAP_INT32_UNSIGNED(pMpkHeader->dwID);
Header.dwArchiveSize = BSWAP_INT32_UNSIGNED(pMpkHeader->dwArchiveSize);
Header.dwHeaderSize = BSWAP_INT32_UNSIGNED(pMpkHeader->dwHeaderSize);
Header.dwHashTablePos = BSWAP_INT32_UNSIGNED(pMpkHeader->dwHashTablePos);
Header.dwHashTableSize = BSWAP_INT32_UNSIGNED(pMpkHeader->dwHashTableSize) / sizeof(TMPKHash);
Header.dwBlockTablePos = BSWAP_INT32_UNSIGNED(pMpkHeader->dwBlockTablePos);
Header.dwBlockTableSize = BSWAP_INT32_UNSIGNED(pMpkHeader->dwBlockTableSize) / sizeof(TMPKBlock);
// Header.dwUnknownPos = BSWAP_INT32_UNSIGNED(pMpkHeader->dwUnknownPos);
// Header.dwUnknownSize = BSWAP_INT32_UNSIGNED(pMpkHeader->dwUnknownSize);
assert(Header.dwHeaderSize == sizeof(TMPKHeader));
// Verify the MPK header
if(Header.dwID == ID_MPK && Header.dwHeaderSize == sizeof(TMPKHeader) && Header.dwArchiveSize == (DWORD)FileSize)
{
// The header ID must be ID_MPQ
Header.dwID = ID_MPQ;
Header.wFormatVersion = MPQ_FORMAT_VERSION_1;
Header.wSectorSize = 3;
// Initialize the fields of 3.0 header
Header.ArchiveSize64 = Header.dwArchiveSize;
Header.HashTableSize64 = Header.dwHashTableSize * sizeof(TMPQHash);
Header.BlockTableSize64 = Header.dwBlockTableSize * sizeof(TMPQBlock);
// Copy the converted MPQ header back
memcpy(ha->HeaderData, &Header, sizeof(TMPQHeader));
// Mark this file as MPK file
ha->pfnHashString = HashStringLower;
ha->dwFlags |= MPQ_FLAG_READ_ONLY;
ha->dwSubType = MPQ_SUBTYPE_MPK;
return ERROR_SUCCESS;
}
return ERROR_FILE_CORRUPT;
}
// Attempts to search a free hash entry in the hash table being converted.
// The created hash table must always be of nonzero size,
// should have no duplicated items and no deleted entries
TMPQHash * FindFreeHashEntry(TMPQHash * pHashTable, DWORD dwHashTableSize, DWORD dwStartIndex)
{
TMPQHash * pHash;
DWORD dwIndex;
// Set the initial index
dwStartIndex = dwIndex = (dwStartIndex & (dwHashTableSize - 1));
assert(dwHashTableSize != 0);
// Search the hash table and return the found entries in the following priority:
for(;;)
{
// We are not expecting to find matching entry in the hash table being built
// We are not expecting to find deleted entry either
pHash = pHashTable + dwIndex;
// If we found a free entry, we need to stop searching
if(pHash->dwBlockIndex == HASH_ENTRY_FREE)
return pHash;
// Move to the next hash entry.
// If we reached the starting entry, it's failure.
dwIndex = (dwIndex + 1) & (dwHashTableSize - 1);
if(dwIndex == dwStartIndex)
break;
}
// We haven't found anything
assert(false);
return NULL;
}
void DecryptMpkTable(void * pvMpkTable, size_t cbSize)
{
LPBYTE pbMpkTable = (LPBYTE)pvMpkTable;
for(size_t i = 0; i < cbSize; i++)
pbMpkTable[i] = MpkDecryptionKey[pbMpkTable[i]];
}
void * LoadMpkTable(TMPQArchive * ha, DWORD dwByteOffset, DWORD cbTableSize)
{
ULONGLONG ByteOffset;
LPBYTE pbMpkTable = NULL;
// Allocate space for the table
pbMpkTable = STORM_ALLOC(BYTE, cbTableSize);
if(pbMpkTable != NULL)
{
// Load and the MPK hash table
ByteOffset = ha->MpqPos + dwByteOffset;
if(FileStream_Read(ha->pStream, &ByteOffset, pbMpkTable, cbTableSize))
{
// Decrypt the table
DecryptMpkTable(pbMpkTable, cbTableSize);
return pbMpkTable;
}
// Free the MPK table
STORM_FREE(pbMpkTable);
pbMpkTable = NULL;
}
// Return the table
return pbMpkTable;
}
TMPQHash * LoadMpkHashTable(TMPQArchive * ha)
{
TMPQHeader * pHeader = ha->pHeader;
TMPQHash * pHashTable = NULL;
TMPKHash * pMpkHash;
TMPQHash * pHash = NULL;
DWORD dwHashTableSize = pHeader->dwHashTableSize;
// MPKs use different hash table searching.
// Instead of using MPQ_HASH_TABLE_INDEX hash as index,
// they store the value directly in the hash table.
// Also for faster searching, the hash table is sorted ascending by the value
// Load and decrypt the MPK hash table.
pMpkHash = (TMPKHash *)LoadMpkTable(ha, pHeader->dwHashTablePos, pHeader->dwHashTableSize * sizeof(TMPKHash));
if(pMpkHash != NULL)
{
// Calculate the hash table size as if it was real MPQ hash table
pHeader->dwHashTableSize = GetHashTableSizeForFileCount(dwHashTableSize);
pHeader->HashTableSize64 = pHeader->dwHashTableSize * sizeof(TMPQHash);
// Now allocate table that will serve like a true MPQ hash table,
// so we translate the MPK hash table to MPQ hash table
pHashTable = STORM_ALLOC(TMPQHash, pHeader->dwHashTableSize);
if(pHashTable != NULL)
{
// Set the entire hash table to free
memset(pHashTable, 0xFF, (size_t)pHeader->HashTableSize64);
// Copy the MPK hash table into MPQ hash table
for(DWORD i = 0; i < dwHashTableSize; i++)
{
// Finds the free hash entry in the hash table
// We don't expect any errors here, because we are putting files to empty hash table
pHash = FindFreeHashEntry(pHashTable, pHeader->dwHashTableSize, pMpkHash[i].dwName1);
assert(pHash->dwBlockIndex == HASH_ENTRY_FREE);
// Copy the MPK hash entry to the hash table
pHash->dwBlockIndex = pMpkHash[i].dwBlockIndex;
pHash->wPlatform = 0;
pHash->lcLocale = 0;
pHash->dwName1 = pMpkHash[i].dwName2;
pHash->dwName2 = pMpkHash[i].dwName3;
}
}
// Free the temporary hash table
STORM_FREE(pMpkHash);
}
return pHashTable;
}
static DWORD ConvertMpkFlagsToMpqFlags(DWORD dwMpkFlags)
{
DWORD dwMpqFlags = MPQ_FILE_EXISTS;
// Check for flags that are always present
assert((dwMpkFlags & MPK_FILE_UNKNOWN_0001) != 0);
assert((dwMpkFlags & MPK_FILE_UNKNOWN_0010) != 0);
assert((dwMpkFlags & MPK_FILE_UNKNOWN_2000) != 0);
assert((dwMpkFlags & MPK_FILE_EXISTS) != 0);
// Append the compressed flag
dwMpqFlags |= (dwMpkFlags & MPK_FILE_COMPRESSED) ? MPQ_FILE_COMPRESS : 0;
// All files in the MPQ seem to be single unit files
dwMpqFlags |= MPQ_FILE_ENCRYPTED | MPQ_FILE_SINGLE_UNIT;
return dwMpqFlags;
}
TMPQBlock * LoadMpkBlockTable(TMPQArchive * ha)
{
TMPQHeader * pHeader = ha->pHeader;
TMPKBlock * pMpkBlockTable;
TMPKBlock * pMpkBlockEnd;
TMPQBlock * pBlockTable = NULL;
TMPKBlock * pMpkBlock;
TMPQBlock * pMpqBlock;
// Load and decrypt the MPK block table
pMpkBlockTable = pMpkBlock = (TMPKBlock *)LoadMpkTable(ha, pHeader->dwBlockTablePos, pHeader->dwBlockTableSize * sizeof(TMPKBlock));
if(pMpkBlockTable != NULL)
{
// Allocate buffer for MPQ-like block table
pBlockTable = pMpqBlock = STORM_ALLOC(TMPQBlock, pHeader->dwBlockTableSize);
if(pBlockTable != NULL)
{
// Convert the MPK block table to MPQ block table
pMpkBlockEnd = pMpkBlockTable + pHeader->dwBlockTableSize;
while(pMpkBlock < pMpkBlockEnd)
{
// Translate the MPK block table entry to MPQ block table entry
pMpqBlock->dwFilePos = pMpkBlock->dwFilePos;
pMpqBlock->dwCSize = pMpkBlock->dwCSize;
pMpqBlock->dwFSize = pMpkBlock->dwFSize;
pMpqBlock->dwFlags = ConvertMpkFlagsToMpqFlags(pMpkBlock->dwFlags);
// Move both
pMpkBlock++;
pMpqBlock++;
}
}
// Free the MPK block table
STORM_FREE(pMpkBlockTable);
}
return pBlockTable;
}

View file

@ -2,7 +2,7 @@
/* 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 */
/* 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. */
/*---------------------------------------------------------------------------*/
@ -22,34 +22,35 @@
// Information about the input and output buffers for pklib
typedef struct
{
unsigned char * pbInBuff; // Pointer to input data buffer
unsigned char * pbInBuffEnd; // End of the input buffer
unsigned char * pbOutBuff; // Pointer to output data buffer
unsigned char * pbOutBuffEnd; // Pointer to output data buffer
char * pbInBuff; // Pointer to input data buffer
char * pbInBuffEnd; // End of the input buffer
char * pbOutBuff; // Pointer to output data buffer
char * pbOutBuffEnd; // Pointer to output data buffer
} TDataInfo;
// Prototype of the compression function
// Function doesn't return an error. A success means that the size of compressed buffer
// is lower than size of uncompressed buffer.
typedef void (*COMPRESS)(
void * pvOutBuffer, // [out] Pointer to the buffer where the compressed data will be stored
int * pcbOutBuffer, // [in] Pointer to length of the buffer pointed by pvOutBuffer
void * pvInBuffer, // [in] Pointer to the buffer with data to compress
int cbInBuffer, // [in] Length of the buffer pointer by pvInBuffer
int * pCmpType, // [in] Compression-method specific value. ADPCM Setups this for the following Huffman compression
int nCmpLevel); // [in] Compression specific value. ADPCM uses this. Should be set to zero.
char * pbOutBuffer, // [out] Pointer to the buffer where the compressed data will be stored
int * pcbOutBuffer, // [in] Pointer to length of the buffer pointed by pbOutBuffer
// [out] Contains length of the compressed data
char * pbInBuffer, // [in] Pointer to the buffer with data to compress
int cbInBuffer, // [in] Length of the buffer pointer by pbInBuffer
int * pCmpType, // [in] Compression-method specific value. ADPCM Setups this for the following Huffman compression
int nCmpLevel); // [in] Compression specific value. ADPCM uses this. Should be set to zero.
// Prototype of the decompression function
// Returns 1 if success, 0 if failure
typedef int (*DECOMPRESS)(
void * pvOutBuffer, // [out] Pointer to the buffer where to store decompressed data
int * pcbOutBuffer, // [in] Pointer to total size of the buffer pointed by pvOutBuffer
// [out] Contains length of the decompressed data
void * pvInBuffer, // [in] Pointer to data to be decompressed
int cbInBuffer); // [in] Length of the data to be decompressed
char * pbOutBuffer, // [out] Pointer to the buffer where to store decompressed data
int * pcbOutBuffer, // [in] Pointer to total size of the buffer pointed by pbOutBuffer
// [out] Contains length of the decompressed data
char * pbInBuffer, // [in] Pointer to data to be decompressed
int cbInBuffer); // [in] Length of the data to be decompressed
// Table of compression functions
typedef struct
typedef struct
{
unsigned long uMask; // Compression mask
COMPRESS Compress; // Compression function
@ -69,22 +70,59 @@ typedef struct
/* */
/*****************************************************************************/
void Compress_huff(void * pvOutBuffer, int * pcbOutBuffer, void * pvInBuffer, int cbInBuffer, int * pCmpType, int nCmpLevel)
// 1500F4C0
void Compress_huff(
char * pbOutBuffer,
int * pcbOutBuffer,
char * pbInBuffer,
int cbInBuffer,
int * pCmpType,
int /* nCmpLevel */)
{
THuffmannTree ht(true);
TOutputStream os(pvOutBuffer, *pcbOutBuffer);
THuffmannTree ht; // Huffmann tree for compression
TOutputStream os; // Output stream
STORMLIB_UNUSED(nCmpLevel);
*pcbOutBuffer = ht.Compress(&os, pvInBuffer, cbInBuffer, *pCmpType);
}
// Initialize output stream
os.pbOutBuffer = (unsigned char *)pbOutBuffer;
os.cbOutSize = *pcbOutBuffer;
os.pbOutPos = (unsigned char *)pbOutBuffer;
os.dwBitBuff = 0;
os.nBits = 0;
int Decompress_huff(void * pvOutBuffer, int * pcbOutBuffer, void * pvInBuffer, int cbInBuffer)
// Initialize the Huffmann tree for compression
ht.InitTree(true);
*pcbOutBuffer = ht.DoCompression(&os, (unsigned char *)pbInBuffer, cbInBuffer, *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();
}
// 1500F5F0
int Decompress_huff(char * pbOutBuffer, int * pcbOutBuffer, char * pbInBuffer, int cbInBuffer)
{
THuffmannTree ht(false);
TInputStream is(pvInBuffer, cbInBuffer);
THuffmannTree ht;
TInputStream is;
*pcbOutBuffer = ht.Decompress(pvOutBuffer, *pcbOutBuffer, &is);
return (*pcbOutBuffer == 0) ? 0 : 1;
// Initialize input stream
is.pbInBufferEnd = (unsigned char *)pbInBuffer + cbInBuffer;
is.pbInBuffer = (unsigned char *)pbInBuffer;
is.BitBuffer = 0;
is.BitCount = 0;
// Initialize the Huffmann tree for compression
ht.InitTree(false);
*pcbOutBuffer = ht.DoDecompression((unsigned char *)pbOutBuffer, *pcbOutBuffer, &is);
if(*pcbOutBuffer == 0)
return 0;
// 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 1;
}
/******************************************************************************/
@ -93,21 +131,23 @@ int Decompress_huff(void * pvOutBuffer, int * pcbOutBuffer, void * pvInBuffer, i
/* */
/******************************************************************************/
void Compress_ZLIB(void * pvOutBuffer, int * pcbOutBuffer, void * pvInBuffer, int cbInBuffer, int * pCmpType, int nCmpLevel)
void Compress_ZLIB(
char * pbOutBuffer,
int * pcbOutBuffer,
char * pbInBuffer,
int cbInBuffer,
int * /* pCmpType */,
int /* nCmpLevel */)
{
z_stream z; // Stream information for zlib
int windowBits;
int nResult;
// Keep compilers happy
STORMLIB_UNUSED(pCmpType);
STORMLIB_UNUSED(nCmpLevel);
// Fill the stream structure for zlib
z.next_in = (Bytef *)pvInBuffer;
z.next_in = (Bytef *)pbInBuffer;
z.avail_in = (uInt)cbInBuffer;
z.total_in = cbInBuffer;
z.next_out = (Bytef *)pvOutBuffer;
z.next_out = (Bytef *)pbOutBuffer;
z.avail_out = *pcbOutBuffer;
z.total_out = 0;
z.zalloc = NULL;
@ -135,16 +175,16 @@ void Compress_ZLIB(void * pvOutBuffer, int * pcbOutBuffer, void * pvInBuffer, in
// Storm.dll uses zlib version 1.1.3
// Wow.exe uses zlib version 1.2.3
nResult = deflateInit2(&z,
6, // Compression level used by WoW MPQs
Z_DEFLATED,
windowBits,
8,
Z_DEFAULT_STRATEGY);
6, // Compression level used by WoW MPQs
Z_DEFLATED,
windowBits,
8,
Z_DEFAULT_STRATEGY);
if(nResult == Z_OK)
{
// Call zlib to compress the data
nResult = deflate(&z, Z_FINISH);
if(nResult == Z_OK || nResult == Z_STREAM_END)
*pcbOutBuffer = z.total_out;
@ -152,16 +192,16 @@ void Compress_ZLIB(void * pvOutBuffer, int * pcbOutBuffer, void * pvInBuffer, in
}
}
int Decompress_ZLIB(void * pvOutBuffer, int * pcbOutBuffer, void * pvInBuffer, int cbInBuffer)
int Decompress_ZLIB(char * pbOutBuffer, int * pcbOutBuffer, char * pbInBuffer, int cbInBuffer)
{
z_stream z; // Stream information for zlib
int nResult;
// Fill the stream structure for zlib
z.next_in = (Bytef *)pvInBuffer;
z.next_in = (Bytef *)pbInBuffer;
z.avail_in = (uInt)cbInBuffer;
z.total_in = cbInBuffer;
z.next_out = (Bytef *)pvOutBuffer;
z.next_out = (Bytef *)pbOutBuffer;
z.avail_out = *pcbOutBuffer;
z.total_out = 0;
z.zalloc = NULL;
@ -187,7 +227,7 @@ int Decompress_ZLIB(void * pvOutBuffer, int * pcbOutBuffer, void * pvInBuffer, i
// 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
@ -201,7 +241,7 @@ static unsigned int ReadInputData(char * buf, unsigned int * size, void * param)
// Check the case when not enough data available
if(nToRead > nMaxAvail)
nToRead = nMaxAvail;
// Load data and increment offsets
memcpy(buf, pInfo->pbInBuff, nToRead);
pInfo->pbInBuff += nToRead;
@ -211,7 +251,7 @@ static unsigned int ReadInputData(char * buf, unsigned int * size, void * param)
// 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
@ -232,74 +272,68 @@ static void WriteOutputData(char * buf, unsigned int * size, void * param)
assert(pInfo->pbOutBuff <= pInfo->pbOutBuffEnd);
}
static void Compress_PKLIB(void * pvOutBuffer, int * pcbOutBuffer, void * pvInBuffer, int cbInBuffer, int * pCmpType, int nCmpLevel)
static void Compress_PKLIB(
char * pbOutBuffer,
int * pcbOutBuffer,
char * pbInBuffer,
int cbInBuffer,
int * /* pCmpType */,
int /* nCmpLevel */)
{
TDataInfo Info; // Data information
char * work_buf = STORM_ALLOC(char, CMP_BUFFER_SIZE);// Pklib's work buffer
unsigned int dict_size; // Dictionary size
unsigned int ctype = CMP_BINARY; // Compression type
// Keep compilers happy
STORMLIB_UNUSED(pCmpType);
STORMLIB_UNUSED(nCmpLevel);
// Fill data information structure
memset(work_buf, 0, CMP_BUFFER_SIZE);
Info.pbInBuff = pbInBuffer;
Info.pbInBuffEnd = pbInBuffer + cbInBuffer;
Info.pbOutBuff = pbOutBuffer;
Info.pbOutBuffEnd = pbOutBuffer + *pcbOutBuffer;
// Handle no-memory condition
if(work_buf != NULL)
{
// Fill data information structure
memset(work_buf, 0, CMP_BUFFER_SIZE);
Info.pbInBuff = (unsigned char *)pvInBuffer;
Info.pbInBuffEnd = (unsigned char *)pvInBuffer + cbInBuffer;
Info.pbOutBuff = (unsigned char *)pvOutBuffer;
Info.pbOutBuffEnd = (unsigned char *)pvOutBuffer + *pcbOutBuffer;
//
// Set the dictionary size
//
// Diablo I ues fixed dictionary size of CMP_IMPLODE_DICT_SIZE3
// Starcraft uses the variable dictionary size based on algorithm below
//
//
// Set the dictionary size
//
// Diablo I uses fixed dictionary size of CMP_IMPLODE_DICT_SIZE3
// Starcraft I uses the variable dictionary size based on algorithm below
//
if (cbInBuffer < 0x600)
dict_size = CMP_IMPLODE_DICT_SIZE1;
else if(0x600 <= cbInBuffer && cbInBuffer < 0xC00)
dict_size = CMP_IMPLODE_DICT_SIZE2;
else
dict_size = CMP_IMPLODE_DICT_SIZE3;
if (cbInBuffer < 0x600)
dict_size = CMP_IMPLODE_DICT_SIZE1;
else if(0x600 <= cbInBuffer && cbInBuffer < 0xC00)
dict_size = CMP_IMPLODE_DICT_SIZE2;
else
dict_size = CMP_IMPLODE_DICT_SIZE3;
// Do the compression
if(implode(ReadInputData, WriteOutputData, work_buf, &Info, &ctype, &dict_size) == CMP_NO_ERROR)
*pcbOutBuffer = (int)(Info.pbOutBuff - pbOutBuffer);
// Do the compression
if(implode(ReadInputData, WriteOutputData, work_buf, &Info, &ctype, &dict_size) == CMP_NO_ERROR)
*pcbOutBuffer = (int)(Info.pbOutBuff - (unsigned char *)pvOutBuffer);
STORM_FREE(work_buf);
}
STORM_FREE(work_buf);
}
static int Decompress_PKLIB(void * pvOutBuffer, int * pcbOutBuffer, void * pvInBuffer, int cbInBuffer)
static int Decompress_PKLIB(char * pbOutBuffer, int * pcbOutBuffer, char * pbInBuffer, int cbInBuffer)
{
TDataInfo Info; // Data information
char * work_buf = STORM_ALLOC(char, EXP_BUFFER_SIZE);// Pklib's work buffer
// Handle no-memory condition
if(work_buf == NULL)
return 0;
// Fill data information structure
memset(work_buf, 0, EXP_BUFFER_SIZE);
Info.pbInBuff = (unsigned char *)pvInBuffer;
Info.pbInBuffEnd = (unsigned char *)pvInBuffer + cbInBuffer;
Info.pbOutBuff = (unsigned char *)pvOutBuffer;
Info.pbOutBuffEnd = (unsigned char *)pvOutBuffer + *pcbOutBuffer;
Info.pbInBuff = pbInBuffer;
Info.pbInBuffEnd = pbInBuffer + cbInBuffer;
Info.pbOutBuff = pbOutBuffer;
Info.pbOutBuffEnd = pbOutBuffer + *pcbOutBuffer;
// Do the decompression
explode(ReadInputData, WriteOutputData, work_buf, &Info);
// If PKLIB is unable to decompress the data, return 0;
if(Info.pbOutBuff == pvOutBuffer)
if(Info.pbOutBuff == pbOutBuffer)
return 0;
// Give away the number of decompressed bytes
*pcbOutBuffer = (int)(Info.pbOutBuff - (unsigned char *)pvOutBuffer);
*pcbOutBuffer = (int)(Info.pbOutBuff - pbOutBuffer);
STORM_FREE(work_buf);
return 1;
}
@ -310,17 +344,19 @@ static int Decompress_PKLIB(void * pvOutBuffer, int * pcbOutBuffer, void * pvInB
/* */
/******************************************************************************/
static void Compress_BZIP2(void * pvOutBuffer, int * pcbOutBuffer, void * pvInBuffer, int cbInBuffer, int * pCmpType, int nCmpLevel)
static void Compress_BZIP2(
char * pbOutBuffer,
int * pcbOutBuffer,
char * pbInBuffer,
int cbInBuffer,
int * /* pCmpType */,
int /* nCmpLevel */)
{
bz_stream strm;
int blockSize100k = 9;
int workFactor = 30;
int bzError;
// Keep compilers happy
STORMLIB_UNUSED(pCmpType);
STORMLIB_UNUSED(nCmpLevel);
// Initialize the BZIP2 compression
strm.bzalloc = NULL;
strm.bzfree = NULL;
@ -329,9 +365,9 @@ static void Compress_BZIP2(void * pvOutBuffer, int * pcbOutBuffer, void * pvInBu
// Last checked on Starcraft II
if(BZ2_bzCompressInit(&strm, blockSize100k, 0, workFactor) == BZ_OK)
{
strm.next_in = (char *)pvInBuffer;
strm.next_in = pbInBuffer;
strm.avail_in = cbInBuffer;
strm.next_out = (char *)pvOutBuffer;
strm.next_out = pbOutBuffer;
strm.avail_out = *pcbOutBuffer;
// Perform the compression
@ -350,7 +386,7 @@ static void Compress_BZIP2(void * pvOutBuffer, int * pcbOutBuffer, void * pvInBu
}
}
static int Decompress_BZIP2(void * pvOutBuffer, int * pcbOutBuffer, void * pvInBuffer, int cbInBuffer)
static int Decompress_BZIP2(char * pbOutBuffer, int * pcbOutBuffer, char * pbInBuffer, int cbInBuffer)
{
bz_stream strm;
int nResult = BZ_OK;
@ -360,17 +396,17 @@ static int Decompress_BZIP2(void * pvOutBuffer, int * pcbOutBuffer, void * pvInB
strm.bzfree = NULL;
if(BZ2_bzDecompressInit(&strm, 0, 0) == BZ_OK)
{
strm.next_in = (char *)pvInBuffer;
strm.next_in = pbInBuffer;
strm.avail_in = cbInBuffer;
strm.next_out = (char *)pvOutBuffer;
strm.next_out = pbOutBuffer;
strm.avail_out = *pcbOutBuffer;
// Perform the decompression
while(nResult != BZ_STREAM_END)
{
nResult = BZ2_bzDecompress(&strm);
// If any error there, break the loop
// If any error there, break the loop
if(nResult < BZ_OK)
break;
}
@ -425,12 +461,17 @@ static void LZMA_Callback_Free(void *p, void *address)
// the data compressed by StormLib.
//
static void Compress_LZMA(void * pvOutBuffer, int * pcbOutBuffer, void * pvInBuffer, int cbInBuffer, int * pCmpType, int nCmpLevel)
/*static */ void Compress_LZMA(
char * pbOutBuffer,
int * pcbOutBuffer,
char * pbInBuffer,
int cbInBuffer,
int * /* pCmpType */,
int /* nCmpLevel */)
{
ICompressProgress Progress;
CLzmaEncProps props;
ISzAlloc SzAlloc;
Byte * pbOutBuffer = (Byte *)pvOutBuffer;
Byte * destBuffer;
SizeT destLen = *pcbOutBuffer;
SizeT srcLen = cbInBuffer;
@ -438,10 +479,6 @@ static void Compress_LZMA(void * pvOutBuffer, int * pcbOutBuffer, void * pvInBuf
size_t encodedPropsSize = LZMA_PROPS_SIZE;
SRes nResult;
// Keep compilers happy
STORMLIB_UNUSED(pCmpType);
STORMLIB_UNUSED(nCmpLevel);
// Fill the callbacks in structures
Progress.Progress = LZMA_Callback_Progress;
SzAlloc.Alloc = LZMA_Callback_Alloc;
@ -451,19 +488,19 @@ static void Compress_LZMA(void * pvOutBuffer, int * pcbOutBuffer, void * pvInBuf
LzmaEncProps_Init(&props);
// Perform compression
destBuffer = (Byte *)pvOutBuffer + LZMA_HEADER_SIZE;
destBuffer = (Byte *)pbOutBuffer + LZMA_HEADER_SIZE;
destLen = *pcbOutBuffer - LZMA_HEADER_SIZE;
nResult = LzmaEncode(destBuffer,
&destLen,
(Byte *)pvInBuffer,
&destLen,
(Byte *)pbInBuffer,
srcLen,
&props,
&props,
encodedProps,
&encodedPropsSize,
&encodedPropsSize,
0,
&Progress,
&SzAlloc,
&SzAlloc);
&Progress,
&SzAlloc,
&SzAlloc);
if(nResult != SZ_OK)
return;
@ -475,7 +512,7 @@ static void Compress_LZMA(void * pvOutBuffer, int * pcbOutBuffer, void * pvInBuf
*pbOutBuffer++ = 0;
// Copy the encoded properties to the output buffer
memcpy(pvOutBuffer, encodedProps, encodedPropsSize);
memcpy(pbOutBuffer, encodedProps, encodedPropsSize);
pbOutBuffer += encodedPropsSize;
// Copy the size of the data
@ -492,18 +529,18 @@ static void Compress_LZMA(void * pvOutBuffer, int * pcbOutBuffer, void * pvInBuf
*pcbOutBuffer = (unsigned int)(destLen + LZMA_HEADER_SIZE);
}
static int Decompress_LZMA(void * pvOutBuffer, int * pcbOutBuffer, void * pvInBuffer, int cbInBuffer)
static int Decompress_LZMA(char * pbOutBuffer, int * pcbOutBuffer, char * pbInBuffer, int cbInBuffer)
{
ELzmaStatus LzmaStatus;
ISzAlloc SzAlloc;
Byte * destBuffer = (Byte *)pvOutBuffer;
Byte * srcBuffer = (Byte *)pvInBuffer;
Byte * destBuffer = (Byte *)pbOutBuffer;
Byte * srcBuffer = (Byte *)pbInBuffer;
SizeT destLen = *pcbOutBuffer;
SizeT srcLen = cbInBuffer;
SRes nResult;
// There must be at least 0x0E bytes in the buffer
if(srcLen <= LZMA_HEADER_SIZE)
if(srcLen <= LZMA_HEADER_SIZE)
return 0;
// We only accept blocks that have no filter used
@ -517,55 +554,14 @@ static int Decompress_LZMA(void * pvOutBuffer, int * pcbOutBuffer, void * pvInBu
// Perform compression
srcLen = cbInBuffer - LZMA_HEADER_SIZE;
nResult = LzmaDecode(destBuffer,
&destLen,
&destLen,
srcBuffer + LZMA_HEADER_SIZE,
&srcLen,
srcBuffer + 1,
&srcLen,
srcBuffer + 1,
LZMA_PROPS_SIZE,
LZMA_FINISH_END,
&LzmaStatus,
&SzAlloc);
if(nResult != SZ_OK)
return 0;
*pcbOutBuffer = (unsigned int)destLen;
return 1;
}
static int Decompress_LZMA_MPK(void * pvOutBuffer, int * pcbOutBuffer, void * pvInBuffer, int cbInBuffer)
{
ELzmaStatus LzmaStatus;
ISzAlloc SzAlloc;
Byte * destBuffer = (Byte *)pvOutBuffer;
Byte * srcBuffer = (Byte *)pvInBuffer;
SizeT destLen = *pcbOutBuffer;
SizeT srcLen = cbInBuffer;
SRes nResult;
BYTE LZMA_Props[] = {0x5D, 0x00, 0x00, 0x00, 0x01};
// There must be at least 0x0E bytes in the buffer
if(srcLen <= sizeof(LZMA_Props))
return 0;
// Verify the props header
if(memcmp(pvInBuffer, LZMA_Props, sizeof(LZMA_Props)))
return 0;
// Fill the callbacks in structures
SzAlloc.Alloc = LZMA_Callback_Alloc;
SzAlloc.Free = LZMA_Callback_Free;
// Perform compression
srcLen = cbInBuffer - sizeof(LZMA_Props);
nResult = LzmaDecode(destBuffer,
&destLen,
srcBuffer + sizeof(LZMA_Props),
&srcLen,
srcBuffer,
sizeof(LZMA_Props),
LZMA_FINISH_END,
&LzmaStatus,
&SzAlloc);
&LzmaStatus,
&SzAlloc);
if(nResult != SZ_OK)
return 0;
@ -579,18 +575,20 @@ static int Decompress_LZMA_MPK(void * pvOutBuffer, int * pcbOutBuffer, void * pv
/* */
/******************************************************************************/
void Compress_SPARSE(void * pvOutBuffer, int * pcbOutBuffer, void * pvInBuffer, int cbInBuffer, int * pCmpType, int nCmpLevel)
void Compress_SPARSE(
char * pbOutBuffer,
int * pcbOutBuffer,
char * pbInBuffer,
int cbInBuffer,
int * /* pCmpType */,
int /* nCmpLevel */)
{
// Keep compilers happy
STORMLIB_UNUSED(pCmpType);
STORMLIB_UNUSED(nCmpLevel);
CompressSparse(pvOutBuffer, pcbOutBuffer, pvInBuffer, cbInBuffer);
CompressSparse((unsigned char *)pbOutBuffer, pcbOutBuffer, (unsigned char *)pbInBuffer, cbInBuffer);
}
int Decompress_SPARSE(void * pvOutBuffer, int * pcbOutBuffer, void * pvInBuffer, int cbInBuffer)
int Decompress_SPARSE(char * pbOutBuffer, int * pcbOutBuffer, char * pbInBuffer, int cbInBuffer)
{
return DecompressSparse(pvOutBuffer, pcbOutBuffer, pvInBuffer, cbInBuffer);
return DecompressSparse((unsigned char *)pbOutBuffer, pcbOutBuffer, (unsigned char *)pbInBuffer, cbInBuffer);
}
/******************************************************************************/
@ -599,7 +597,13 @@ int Decompress_SPARSE(void * pvOutBuffer, int * pcbOutBuffer, void * pvInBuffer,
/* */
/******************************************************************************/
static void Compress_ADPCM_mono(void * pvOutBuffer, int * pcbOutBuffer, void * pvInBuffer, int cbInBuffer, int * pCmpType, int nCmpLevel)
static void Compress_ADPCM_mono(
char * pbOutBuffer,
int * pcbOutBuffer,
char * pbInBuffer,
int cbInBuffer,
int * pCmpType,
int nCmpLevel)
{
// Prepare the compression level for Huffmann compression,
// which will be called as next step
@ -618,12 +622,12 @@ static void Compress_ADPCM_mono(void * pvOutBuffer, int * pcbOutBuffer, void * p
nCmpLevel = 5;
*pCmpType = 7;
}
*pcbOutBuffer = CompressADPCM(pvOutBuffer, *pcbOutBuffer, pvInBuffer, cbInBuffer, 1, nCmpLevel);
*pcbOutBuffer = CompressADPCM((unsigned char *)pbOutBuffer, *pcbOutBuffer, (short *)pbInBuffer, cbInBuffer, 1, nCmpLevel);
}
static int Decompress_ADPCM_mono(void * pvOutBuffer, int * pcbOutBuffer, void * pvInBuffer, int cbInBuffer)
static int Decompress_ADPCM_mono(char * pbOutBuffer, int * pcbOutBuffer, char * pbInBuffer, int cbInBuffer)
{
*pcbOutBuffer = DecompressADPCM(pvOutBuffer, *pcbOutBuffer, pvInBuffer, cbInBuffer, 1);
*pcbOutBuffer = DecompressADPCM((unsigned char *)pbOutBuffer, *pcbOutBuffer, (unsigned char *)pbInBuffer, cbInBuffer, 1);
return 1;
}
@ -633,7 +637,13 @@ static int Decompress_ADPCM_mono(void * pvOutBuffer, int * pcbOutBuffer, void *
/* */
/******************************************************************************/
static void Compress_ADPCM_stereo(void * pvOutBuffer, int * pcbOutBuffer, void * pvInBuffer, int cbInBuffer, int * pCmpType, int nCmpLevel)
static void Compress_ADPCM_stereo(
char * pbOutBuffer,
int * pcbOutBuffer,
char * pbInBuffer,
int cbInBuffer,
int * pCmpType,
int nCmpLevel)
{
// Prepare the compression level for Huffmann compression,
// which will be called as next step
@ -652,12 +662,12 @@ static void Compress_ADPCM_stereo(void * pvOutBuffer, int * pcbOutBuffer, void *
nCmpLevel = 5;
*pCmpType = 7;
}
*pcbOutBuffer = CompressADPCM(pvOutBuffer, *pcbOutBuffer, pvInBuffer, cbInBuffer, 2, nCmpLevel);
*pcbOutBuffer = CompressADPCM((unsigned char *)pbOutBuffer, *pcbOutBuffer, (short *)pbInBuffer, cbInBuffer, 2, nCmpLevel);
}
static int Decompress_ADPCM_stereo(void * pvOutBuffer, int * pcbOutBuffer, void * pvInBuffer, int cbInBuffer)
static int Decompress_ADPCM_stereo(char * pbOutBuffer, int * pcbOutBuffer, char * pbInBuffer, int cbInBuffer)
{
*pcbOutBuffer = DecompressADPCM(pvOutBuffer, *pcbOutBuffer, pvInBuffer, cbInBuffer, 2);
*pcbOutBuffer = DecompressADPCM((unsigned char *)pbOutBuffer, *pcbOutBuffer, (unsigned char *)pbInBuffer, cbInBuffer, 2);
return 1;
}
@ -667,25 +677,24 @@ static int Decompress_ADPCM_stereo(void * pvOutBuffer, int * pcbOutBuffer, void
/* */
/*****************************************************************************/
int WINAPI SCompImplode(void * pvOutBuffer, int * pcbOutBuffer, void * pvInBuffer, int cbInBuffer)
int WINAPI SCompImplode(char * pbOutBuffer, int * pcbOutBuffer, char * pbInBuffer, int cbInBuffer)
{
int cbOutBuffer;
int cbOutBuffer = *pcbOutBuffer;
// Check for valid parameters
if(!pcbOutBuffer || *pcbOutBuffer < cbInBuffer || !pvOutBuffer || !pvInBuffer)
if(!pcbOutBuffer || *pcbOutBuffer < cbInBuffer || !pbOutBuffer || !pbInBuffer)
{
SetLastError(ERROR_INVALID_PARAMETER);
return 0;
}
// Perform the compression
cbOutBuffer = *pcbOutBuffer;
Compress_PKLIB(pvOutBuffer, &cbOutBuffer, pvInBuffer, cbInBuffer, NULL, 0);
Compress_PKLIB(pbOutBuffer, &cbOutBuffer, pbInBuffer, cbInBuffer, NULL, 0);
// If the compression was unsuccessful, copy the data as-is
if(cbOutBuffer >= *pcbOutBuffer)
{
memcpy(pvOutBuffer, pvInBuffer, cbInBuffer);
memcpy(pbOutBuffer, pbInBuffer, cbInBuffer);
cbOutBuffer = *pcbOutBuffer;
}
@ -699,34 +708,33 @@ int WINAPI SCompImplode(void * pvOutBuffer, int * pcbOutBuffer, void * pvInBuffe
/* */
/*****************************************************************************/
int WINAPI SCompExplode(void * pvOutBuffer, int * pcbOutBuffer, void * pvInBuffer, int cbInBuffer)
int WINAPI SCompExplode(char * pbOutBuffer, int * pcbOutBuffer, char * pbInBuffer, int cbInBuffer)
{
int cbOutBuffer;
int cbOutBuffer = *pcbOutBuffer;
// Check for valid parameters
if(!pcbOutBuffer || *pcbOutBuffer < cbInBuffer || !pvOutBuffer || !pvInBuffer)
if(!pcbOutBuffer || *pcbOutBuffer < cbInBuffer || !pbOutBuffer || !pbInBuffer)
{
SetLastError(ERROR_INVALID_PARAMETER);
return 0;
}
// If the input length is the same as output length, do nothing.
cbOutBuffer = *pcbOutBuffer;
if(cbInBuffer == cbOutBuffer)
{
// If the buffers are equal, don't copy anything.
if(pvInBuffer == pvOutBuffer)
if(pbInBuffer == pbOutBuffer)
return 1;
memcpy(pvOutBuffer, pvInBuffer, cbInBuffer);
memcpy(pbOutBuffer, pbInBuffer, cbInBuffer);
return 1;
}
// Perform decompression
if(!Decompress_PKLIB(pvOutBuffer, &cbOutBuffer, pvInBuffer, cbInBuffer))
if(!Decompress_PKLIB(pbOutBuffer, &cbOutBuffer, pbInBuffer, cbInBuffer))
{
SetLastError(ERROR_FILE_CORRUPT);
return 0;
return false;
}
*pcbOutBuffer = cbOutBuffer;
@ -750,23 +758,29 @@ int WINAPI SCompExplode(void * pvOutBuffer, int * pcbOutBuffer, void * pvInBuffe
static TCompressTable cmp_table[] =
{
{MPQ_COMPRESSION_SPARSE, Compress_SPARSE}, // Sparse compression
{MPQ_COMPRESSION_ADPCM_MONO, Compress_ADPCM_mono}, // IMA ADPCM mono compression
{MPQ_COMPRESSION_ADPCM_STEREO, Compress_ADPCM_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
{MPQ_COMPRESSION_SPARSE, Compress_SPARSE}, // Sparse compression
{MPQ_COMPRESSION_ADPCM_MONO, Compress_ADPCM_mono}, // IMA ADPCM mono compression
{MPQ_COMPRESSION_ADPCM_STEREO, Compress_ADPCM_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(void * pvOutBuffer, int * pcbOutBuffer, void * pvInBuffer, int cbInBuffer, unsigned uCompressionMask, int nCmpType, int nCmpLevel)
int WINAPI SCompCompress(
char * pbOutBuffer,
int * pcbOutBuffer,
char * pbInBuffer,
int cbInBuffer,
unsigned uCompressionMask,
int nCmpType,
int nCmpLevel)
{
COMPRESS CompressFuncArray[0x10]; // Array of compression functions, applied sequentially
unsigned char CompressByte[0x10]; // CompressByte for each method in the CompressFuncArray array
unsigned char * pbWorkBuffer = NULL; // Temporary storage for decompressed data
unsigned char * pbOutBuffer = (unsigned char *)pvOutBuffer;
unsigned char * pbOutput = (unsigned char *)pvOutBuffer;// Current output buffer
unsigned char * pbInput = (unsigned char *)pvInBuffer; // Current input buffer
COMPRESS CompressFuncArray[0x10]; // Array of compression functions, applied sequentially
unsigned char CompressByte[0x10]; // CompressByte for each method in the CompressFuncArray array
char * pbWorkBuffer = NULL; // Temporary storage for decompressed data
char * pbOutput = pbOutBuffer; // Current output buffer
char * pbInput = pbInBuffer; // Current input buffer
int nCompressCount = 0;
int nCompressIndex = 0;
int nAtLeastOneCompressionDone = 0;
@ -775,7 +789,7 @@ int WINAPI SCompCompress(void * pvOutBuffer, int * pcbOutBuffer, void * pvInBuff
int nResult = 1;
// Check for valid parameters
if(!pcbOutBuffer || *pcbOutBuffer < cbInBuffer || !pvOutBuffer || !pvInBuffer)
if(!pcbOutBuffer || *pcbOutBuffer < cbInBuffer || !pbOutBuffer || !pbInBuffer)
{
SetLastError(ERROR_INVALID_PARAMETER);
return 0;
@ -824,7 +838,7 @@ int WINAPI SCompCompress(void * pvOutBuffer, int * pcbOutBuffer, void * pvInBuff
// If we need to do more than 1 compression, allocate intermediate buffer
if(nCompressCount > 1)
{
pbWorkBuffer = STORM_ALLOC(unsigned char, *pcbOutBuffer);
pbWorkBuffer = STORM_ALLOC(char, *pcbOutBuffer);
if(pbWorkBuffer == NULL)
{
SetLastError(ERROR_NOT_ENOUGH_MEMORY);
@ -870,12 +884,12 @@ int WINAPI SCompCompress(void * pvOutBuffer, int * pcbOutBuffer, void * pvInBuff
// If at least one compression succeeded, put the compression
// mask to the begin of the output buffer
if(nAtLeastOneCompressionDone)
*pbOutBuffer = (unsigned char)uCompressionMask;
*pbOutBuffer = (char)uCompressionMask;
*pcbOutBuffer = cbOutBuffer + nAtLeastOneCompressionDone;
}
else
{
memcpy(pvOutBuffer, pvInBuffer, cbInBuffer);
memcpy(pbOutBuffer, pbInBuffer, cbInBuffer);
*pcbOutBuffer = cbInBuffer;
}
@ -905,13 +919,15 @@ static TDecompressTable dcmp_table[] =
{MPQ_COMPRESSION_SPARSE, Decompress_SPARSE} // Sparse decompression
};
int WINAPI SCompDecompress(void * pvOutBuffer, int * pcbOutBuffer, void * pvInBuffer, int cbInBuffer)
int WINAPI SCompDecompress(
char * pbOutBuffer,
int * pcbOutBuffer,
char * pbInBuffer,
int cbInBuffer)
{
unsigned char * pbWorkBuffer = NULL;
unsigned char * pbOutBuffer = (unsigned char *)pvOutBuffer;
unsigned char * pbInBuffer = (unsigned char *)pvInBuffer;
unsigned char * pbOutput = (unsigned char *)pvOutBuffer;
unsigned char * pbInput;
char * pbWorkBuffer = NULL; // Temporary storage for decompressed data
char * pbOutput = pbOutBuffer; // Where to store decompressed data
char * pbInput; // Where to store decompressed data
unsigned uCompressionMask; // Decompressions applied to the data
unsigned uCompressionCopy; // Decompressions applied to the data
int cbOutBuffer = *pcbOutBuffer; // Current size of the output buffer
@ -928,8 +944,8 @@ int WINAPI SCompDecompress(void * pvOutBuffer, int * pcbOutBuffer, void * pvInBu
if(cbOutBuffer == cbInBuffer)
{
// If the buffers are equal, don't copy anything.
if(pvInBuffer != pvOutBuffer)
memcpy(pvOutBuffer, pvInBuffer, cbInBuffer);
if(pbInBuffer != pbOutBuffer)
memcpy(pbOutBuffer, pbInBuffer, cbInBuffer);
return 1;
}
@ -965,7 +981,7 @@ int WINAPI SCompDecompress(void * pvOutBuffer, int * pcbOutBuffer, void * pvInBu
// If there is more than one compression, we have to allocate extra buffer
if(nCompressCount > 1)
{
pbWorkBuffer = STORM_ALLOC(unsigned char, cbOutBuffer);
pbWorkBuffer = STORM_ALLOC(char, cbOutBuffer);
if(pbWorkBuffer == NULL)
{
SetLastError(ERROR_NOT_ENOUGH_MEMORY);
@ -985,7 +1001,7 @@ int WINAPI SCompDecompress(void * pvOutBuffer, int * pcbOutBuffer, void * pvInBu
// Get the correct output buffer
pbOutput = (nCompressIndex & 1) ? pbWorkBuffer : pbOutBuffer;
nCompressIndex--;
// Perform the decompression
cbOutBuffer = *pcbOutBuffer;
nResult = dcmp_table[i].Decompress(pbOutput, &cbOutBuffer, pbInput, cbInLength);
@ -1011,12 +1027,15 @@ int WINAPI SCompDecompress(void * pvOutBuffer, int * pcbOutBuffer, void * pvInBu
return nResult;
}
int WINAPI SCompDecompress2(void * pvOutBuffer, int * pcbOutBuffer, void * pvInBuffer, int cbInBuffer)
int WINAPI SCompDecompress2(
char * pbOutBuffer,
int * pcbOutBuffer,
char * pbInBuffer,
int cbInBuffer)
{
DECOMPRESS pfnDecompress1 = NULL;
DECOMPRESS pfnDecompress2 = NULL;
unsigned char * pbWorkBuffer = (unsigned char *)pvOutBuffer;
unsigned char * pbInBuffer = (unsigned char *)pvInBuffer;
char * pbWorkBuffer = pbOutBuffer;
int cbWorkBuffer = *pcbOutBuffer;
int nResult;
char CompressionMethod;
@ -1028,8 +1047,8 @@ int WINAPI SCompDecompress2(void * pvOutBuffer, int * pcbOutBuffer, void * pvInB
// If the outputbuffer is as big as input buffer, just copy the block
if(*pcbOutBuffer == cbInBuffer)
{
if(pvOutBuffer != pvInBuffer)
memcpy(pvOutBuffer, pvInBuffer, cbInBuffer);
if(pbOutBuffer != pbInBuffer)
memcpy(pbOutBuffer, pbInBuffer, cbInBuffer);
return 1;
}
@ -1040,35 +1059,35 @@ int WINAPI SCompDecompress2(void * pvOutBuffer, int * pcbOutBuffer, void * pvInB
// We only recognize a fixed set of compression methods
switch((unsigned char)CompressionMethod)
{
case MPQ_COMPRESSION_ZLIB:
pfnDecompress1 = Decompress_ZLIB;
break;
case MPQ_COMPRESSION_ZLIB:
pfnDecompress1 = Decompress_ZLIB;
break;
case MPQ_COMPRESSION_PKWARE:
pfnDecompress1 = Decompress_PKLIB;
break;
case MPQ_COMPRESSION_PKWARE:
pfnDecompress1 = Decompress_PKLIB;
break;
case MPQ_COMPRESSION_BZIP2:
pfnDecompress1 = Decompress_BZIP2;
break;
case MPQ_COMPRESSION_BZIP2:
pfnDecompress1 = Decompress_BZIP2;
break;
case MPQ_COMPRESSION_LZMA:
pfnDecompress1 = Decompress_LZMA;
break;
case MPQ_COMPRESSION_LZMA:
pfnDecompress1 = Decompress_LZMA;
break;
case MPQ_COMPRESSION_SPARSE:
pfnDecompress1 = Decompress_SPARSE;
break;
case MPQ_COMPRESSION_SPARSE:
pfnDecompress1 = Decompress_SPARSE;
break;
case (MPQ_COMPRESSION_SPARSE | MPQ_COMPRESSION_ZLIB):
pfnDecompress1 = Decompress_ZLIB;
pfnDecompress2 = Decompress_SPARSE;
break;
case (MPQ_COMPRESSION_SPARSE | MPQ_COMPRESSION_ZLIB):
pfnDecompress1 = Decompress_ZLIB;
pfnDecompress2 = Decompress_SPARSE;
break;
case (MPQ_COMPRESSION_SPARSE | MPQ_COMPRESSION_BZIP2):
pfnDecompress1 = Decompress_BZIP2;
pfnDecompress2 = Decompress_SPARSE;
break;
case (MPQ_COMPRESSION_SPARSE | MPQ_COMPRESSION_BZIP2):
pfnDecompress1 = Decompress_BZIP2;
pfnDecompress2 = Decompress_SPARSE;
break;
//
// Note: Any combination including MPQ_COMPRESSION_ADPCM_MONO,
@ -1076,25 +1095,15 @@ int WINAPI SCompDecompress2(void * pvOutBuffer, int * pcbOutBuffer, void * pvInB
// is not supported by newer MPQs.
//
case (MPQ_COMPRESSION_ADPCM_MONO | MPQ_COMPRESSION_HUFFMANN):
pfnDecompress1 = Decompress_huff;
pfnDecompress2 = Decompress_ADPCM_mono;
break;
case (MPQ_COMPRESSION_ADPCM_STEREO | MPQ_COMPRESSION_HUFFMANN):
pfnDecompress1 = Decompress_huff;
pfnDecompress2 = Decompress_ADPCM_stereo;
break;
default:
SetLastError(ERROR_FILE_CORRUPT);
return 0;
default:
SetLastError(ERROR_FILE_CORRUPT);
return 0;
}
// If we have to use two decompressions, allocate temporary buffer
if(pfnDecompress2 != NULL)
{
pbWorkBuffer = STORM_ALLOC(unsigned char, *pcbOutBuffer);
pbWorkBuffer = STORM_ALLOC(char, *pcbOutBuffer);
if(pbWorkBuffer == NULL)
{
SetLastError(ERROR_NOT_ENOUGH_MEMORY);
@ -1110,29 +1119,17 @@ int WINAPI SCompDecompress2(void * pvOutBuffer, int * pcbOutBuffer, void * pvInB
{
cbInBuffer = cbWorkBuffer;
cbWorkBuffer = *pcbOutBuffer;
nResult = pfnDecompress2(pvOutBuffer, &cbWorkBuffer, pbWorkBuffer, cbInBuffer);
nResult = pfnDecompress2(pbOutBuffer, &cbWorkBuffer, pbWorkBuffer, cbInBuffer);
}
// Supply the output buffer size
*pcbOutBuffer = cbWorkBuffer;
// Free temporary buffer
if(pbWorkBuffer != pvOutBuffer)
if(pbWorkBuffer != pbOutBuffer)
STORM_FREE(pbWorkBuffer);
if(nResult == 0)
SetLastError(ERROR_FILE_CORRUPT);
return nResult;
}
/*****************************************************************************/
/* */
/* File decompression for MPK archives */
/* */
/*****************************************************************************/
int SCompDecompressMpk(void * pvOutBuffer, int * pcbOutBuffer, void * pvInBuffer, int cbInBuffer)
{
return Decompress_LZMA_MPK(pvOutBuffer, pcbOutBuffer, pvInBuffer, cbInBuffer);
}

View file

@ -6,7 +6,6 @@
/* Date Ver Who Comment */
/* -------- ---- --- ------- */
/* 27.03.10 1.00 Lad Splitted from SFileCreateArchiveEx.cpp */
/* 21.04.13 1.01 Dea AddFile callback now part of TMPQArchive */
/*****************************************************************************/
#define __STORMLIB_SELF__
@ -14,17 +13,7 @@
#include "StormCommon.h"
//-----------------------------------------------------------------------------
// Local variables
// Mask for lossy compressions
#define MPQ_LOSSY_COMPRESSION_MASK (MPQ_COMPRESSION_ADPCM_MONO | MPQ_COMPRESSION_ADPCM_STEREO | MPQ_COMPRESSION_HUFFMANN)
// Data compression for SFileAddFile
// Kept here for compatibility with code that was created with StormLib version < 6.50
static DWORD DefaultDataCompression = MPQ_COMPRESSION_PKWARE;
//-----------------------------------------------------------------------------
// WAVE verification
// Local structures
#define FILE_SIGNATURE_RIFF 0x46464952
#define FILE_SIGNATURE_WAVE 0x45564157
@ -36,8 +25,8 @@ typedef struct _WAVE_FILE_HEADER
DWORD dwChunkId; // 0x52494646 ("RIFF")
DWORD dwChunkSize; // Size of that chunk, in bytes
DWORD dwFormat; // Must be 0x57415645 ("WAVE")
// Format sub-chunk
// Format sub-chunk
DWORD dwSubChunk1Id; // 0x666d7420 ("fmt ")
DWORD dwSubChunk1Size; // 0x16 for PCM
USHORT wAudioFormat; // 1 = PCM. Other value means some sort of compression
@ -50,29 +39,36 @@ typedef struct _WAVE_FILE_HEADER
// Followed by "data" sub-chunk (we don't care)
} WAVE_FILE_HEADER, *PWAVE_FILE_HEADER;
static bool IsWaveFile_16BitsPerAdpcmSample(
LPBYTE pbFileData,
DWORD cbFileData,
LPDWORD pdwChannels)
//-----------------------------------------------------------------------------
// Local variables
// Data compression for SFileAddFile
// Kept here for compatibility with code that was created with StormLib version < 6.50
static DWORD DefaultDataCompression = MPQ_COMPRESSION_PKWARE;
static SFILE_ADDFILE_CALLBACK AddFileCB = NULL;
static void * pvUserData = NULL;
//-----------------------------------------------------------------------------
// MPQ write data functions
#define LOSSY_COMPRESSION_MASK (MPQ_COMPRESSION_ADPCM_MONO | MPQ_COMPRESSION_ADPCM_STEREO | MPQ_COMPRESSION_HUFFMANN)
static int IsWaveFile(
LPBYTE pbFileData,
DWORD cbFileData,
LPDWORD pdwChannels)
{
PWAVE_FILE_HEADER pWaveHdr = (PWAVE_FILE_HEADER)pbFileData;
// The amount of file data must be at least size of WAVE header
if(cbFileData > sizeof(WAVE_FILE_HEADER))
{
// Check for the RIFF header
if(pWaveHdr->dwChunkId == FILE_SIGNATURE_RIFF && pWaveHdr->dwFormat == FILE_SIGNATURE_WAVE)
{
// Check for ADPCM format
if(pWaveHdr->dwSubChunk1Id == FILE_SIGNATURE_FMT && pWaveHdr->wAudioFormat == AUDIO_FORMAT_PCM)
{
// Now the number of bits per sample must be at least 16.
// If not, the WAVE file gets corrupted by the ADPCM compression
if(pWaveHdr->wBitsPerSample >= 0x10)
{
*pdwChannels = pWaveHdr->wChannels;
return true;
}
*pdwChannels = pWaveHdr->wChannels;
return true;
}
}
}
@ -80,29 +76,33 @@ static bool IsWaveFile_16BitsPerAdpcmSample(
return false;
}
//-----------------------------------------------------------------------------
// MPQ write data functions
static int WriteDataToMpqFile(
TMPQArchive * ha,
TMPQFile * hf,
LPBYTE pbFileData,
DWORD dwDataSize,
DWORD dwCompression)
TMPQArchive * ha,
TMPQFile * hf,
LPBYTE pbFileData,
DWORD dwDataSize,
DWORD dwCompression)
{
TFileEntry * pFileEntry = hf->pFileEntry;
ULONGLONG ByteOffset;
LPBYTE pbCompressed = NULL; // Compressed (target) data
LPBYTE pbToWrite = hf->pbFileSector; // Data to write to the file
int nCompressionLevel; // ADPCM compression level (only used for wave files)
LPBYTE pbCompressed = NULL; // Compressed (target) data
LPBYTE pbToWrite = NULL; // Data to write to the file
int nCompressionLevel = -1; // ADPCM compression level (only used for wave files)
int nError = ERROR_SUCCESS;
// If the caller wants ADPCM compression, we will set wave compression level to 4,
// which corresponds to medium quality
if(dwCompression & LOSSY_COMPRESSION_MASK)
nCompressionLevel = 4;
// Make sure that the caller won't overrun the previously initiated file size
assert(hf->dwFilePos + dwDataSize <= pFileEntry->dwFileSize);
assert(hf->dwSectorCount != 0);
assert(hf->pbFileSector != NULL);
if((hf->dwFilePos + dwDataSize) > pFileEntry->dwFileSize)
return ERROR_DISK_FULL;
pbToWrite = hf->pbFileSector;
// Now write all data to the file sector buffer
if(nError == ERROR_SUCCESS)
@ -111,11 +111,11 @@ static int WriteDataToMpqFile(
DWORD dwSectorIndex = hf->dwFilePos / hf->dwSectorSize;
DWORD dwBytesToCopy;
// Process all data.
// Process all data.
while(dwDataSize != 0)
{
dwBytesToCopy = dwDataSize;
// Check for sector overflow
if(dwBytesToCopy > (hf->dwSectorSize - dwBytesInSector))
dwBytesToCopy = (hf->dwSectorSize - dwBytesInSector);
@ -141,7 +141,7 @@ static int WriteDataToMpqFile(
hf->dwCrc32 = crc32(hf->dwCrc32, hf->pbFileSector, dwBytesInSector);
// Compress the file sector, if needed
if(pFileEntry->dwFlags & MPQ_FILE_COMPRESS_MASK)
if(pFileEntry->dwFlags & MPQ_FILE_COMPRESSED)
{
int nOutBuffer = (int)dwBytesInSector;
int nInBuffer = (int)dwBytesInSector;
@ -160,33 +160,27 @@ static int WriteDataToMpqFile(
}
//
// Note that both SCompImplode and SCompCompress copy data as-is,
// if they are unable to compress the data.
// Note that both SCompImplode and SCompCompress give original buffer,
// if they are unable to comperss the data.
//
if(pFileEntry->dwFlags & MPQ_FILE_IMPLODE)
{
SCompImplode(pbCompressed, &nOutBuffer, hf->pbFileSector, nInBuffer);
SCompImplode((char *)pbCompressed,
&nOutBuffer,
(char *)hf->pbFileSector,
nInBuffer);
}
if(pFileEntry->dwFlags & MPQ_FILE_COMPRESS)
{
// If this is the first sector, we need to override the given compression
// by the first sector compression. This is because the entire sector must
// be compressed by the same compression.
//
// Test case:
//
// WRITE_FILE(hFile, pvBuffer, 0x10, MPQ_COMPRESSION_PKWARE) // Write 0x10 bytes (sector 0)
// WRITE_FILE(hFile, pvBuffer, 0x10, MPQ_COMPRESSION_ADPCM_MONO) // Write 0x10 bytes (still sector 0)
// WRITE_FILE(hFile, pvBuffer, 0x10, MPQ_COMPRESSION_ADPCM_MONO) // Write 0x10 bytes (still sector 0)
// WRITE_FILE(hFile, pvBuffer, 0x10, MPQ_COMPRESSION_ADPCM_MONO) // Write 0x10 bytes (still sector 0)
dwCompression = (dwSectorIndex == 0) ? hf->dwCompression0 : dwCompression;
// If the caller wants ADPCM compression, we will set wave compression level to 4,
// which corresponds to medium quality
nCompressionLevel = (dwCompression & MPQ_LOSSY_COMPRESSION_MASK) ? 4 : -1;
SCompCompress(pbCompressed, &nOutBuffer, hf->pbFileSector, nInBuffer, (unsigned)dwCompression, 0, nCompressionLevel);
SCompCompress((char *)pbCompressed,
&nOutBuffer,
(char *)hf->pbFileSector,
nInBuffer,
(unsigned)dwCompression,
0,
nCompressionLevel);
}
// Update sector positions
@ -197,7 +191,7 @@ static int WriteDataToMpqFile(
// We have to calculate sector CRC, if enabled
if(hf->SectorChksums != NULL)
hf->SectorChksums[dwSectorIndex] = adler32(0, pbCompressed, nOutBuffer);
}
}
// Encrypt the sector, if necessary
if(pFileEntry->dwFlags & MPQ_FILE_ENCRYPTED)
@ -215,8 +209,8 @@ static int WriteDataToMpqFile(
}
// Call the compact callback, if any
if(ha->pfnAddFileCB != NULL)
ha->pfnAddFileCB(ha->pvAddFileUserData, hf->dwFilePos, hf->dwDataSize, false);
if(AddFileCB != NULL)
AddFileCB(pvUserData, hf->dwFilePos, hf->dwDataSize, false);
// Update the compressed file size
pFileEntry->dwCmpSize += dwBytesInSector;
@ -236,10 +230,10 @@ static int WriteDataToMpqFile(
// Recrypts file data for file renaming
static int RecryptFileData(
TMPQArchive * ha,
TMPQFile * hf,
const char * szFileName,
const char * szNewFileName)
TMPQArchive * ha,
TMPQFile * hf,
const char * szFileName,
const char * szNewFileName)
{
ULONGLONG RawFilePos;
TFileEntry * pFileEntry = hf->pFileEntry;
@ -252,8 +246,8 @@ static int RecryptFileData(
assert(pFileEntry->dwFlags & MPQ_FILE_ENCRYPTED);
// File decryption key is calculated from the plain name
szNewFileName = GetPlainFileName(szNewFileName);
szFileName = GetPlainFileName(szFileName);
szNewFileName = GetPlainFileNameA(szNewFileName);
szFileName = GetPlainFileNameA(szFileName);
// Calculate both file keys
dwOldKey = DecryptFileKey(szFileName, pFileEntry->ByteOffset, pFileEntry->dwFileSize, pFileEntry->dwFlags);
@ -283,7 +277,7 @@ static int RecryptFileData(
if(hf->SectorOffsets != NULL)
{
// Allocate secondary buffer for sectors copy
DWORD * SectorOffsetsCopy = STORM_ALLOC(DWORD, hf->SectorOffsets[0] / sizeof(DWORD));
DWORD * SectorOffsetsCopy = (DWORD *)STORM_ALLOC(BYTE, hf->SectorOffsets[0]);
DWORD dwSectorOffsLen = hf->SectorOffsets[0];
if(SectorOffsetsCopy == NULL)
@ -331,7 +325,7 @@ static int RecryptFileData(
}
// If necessary, re-encrypt the sector
// Note: Recompression is not necessary here. Unlike encryption,
// Note: Recompression is not necessary here. Unlike encryption,
// the compression does not depend on the position of the file in MPQ.
BSWAP_ARRAY32_UNSIGNED(hf->pbFileSector, dwRawDataInSector);
DecryptMpqBlock(hf->pbFileSector, dwRawDataInSector, dwOldKey + dwSector);
@ -357,13 +351,13 @@ static int RecryptFileData(
// Support functions for adding files to the MPQ
int SFileAddFile_Init(
TMPQArchive * ha,
const char * szFileName,
ULONGLONG FileTime,
DWORD dwFileSize,
LCID lcLocale,
DWORD dwFlags,
TMPQFile ** phf)
TMPQArchive * ha,
const char * szFileName,
ULONGLONG FileTime,
DWORD dwFileSize,
LCID lcLocale,
DWORD dwFlags,
TMPQFile ** phf)
{
TFileEntry * pFileEntry = NULL;
ULONGLONG TempPos; // For various file offset calculations
@ -381,9 +375,9 @@ int SFileAddFile_Init(
dwFlags &= ~MPQ_FILE_SECTOR_CRC;
// Sector CRC is not allowed if the file is not compressed
if(!(dwFlags & MPQ_FILE_COMPRESS_MASK))
if(!(dwFlags & MPQ_FILE_COMPRESSED))
dwFlags &= ~MPQ_FILE_SECTOR_CRC;
// Fix Key is not allowed if the file is not enrypted
if(!(dwFlags & MPQ_FILE_ENCRYPTED))
dwFlags &= ~MPQ_FILE_FIX_KEY;
@ -394,18 +388,21 @@ int SFileAddFile_Init(
lcLocale = 0;
// Allocate the TMPQFile entry for newly added file
hf = CreateFileHandle(ha, NULL);
hf = CreateMpqFile(ha);
if(hf == NULL)
nError = ERROR_NOT_ENOUGH_MEMORY;
// Find a free space in the MPQ and verify if it's not over 4 GB on MPQs v1
// Find a free space in the MPQ, as well as free block table entry
if(nError == ERROR_SUCCESS)
{
// Find the position where the file will be stored
hf->MpqFilePos = FindFreeMpqSpace(ha);
FindFreeMpqSpace(ha, &hf->MpqFilePos);
hf->RawFilePos = ha->MpqPos + hf->MpqFilePos;
hf->bIsWriteHandle = true;
// Sanity check: The MPQ must be marked as changed at this point
assert((ha->dwFlags & MPQ_FLAG_CHANGED) != 0);
// When format V1, the size of the archive cannot exceed 4 GB
if(ha->pHeader->wFormatVersion == MPQ_FORMAT_VERSION_1)
{
@ -431,31 +428,34 @@ int SFileAddFile_Init(
}
else
{
// If the caller didn't set MPQ_FILE_REPLACEEXISTING, fail it
// If the file exists and "replace existing" is not set, fail it
if((dwFlags & MPQ_FILE_REPLACEEXISTING) == 0)
nError = ERROR_ALREADY_EXISTS;
// When replacing an existing file,
// we still need to invalidate the (attributes) file
// If the file entry already contains a file
// and it is a pseudo-name, replace it
if(nError == ERROR_SUCCESS)
InvalidateInternalFiles(ha);
{
AllocateFileName(pFileEntry, szFileName);
}
}
}
// Fill the file entry and TMPQFile structure
//
// At this point, the file name in file entry must be non-NULL
//
// Create key for file encryption
if(nError == ERROR_SUCCESS && (dwFlags & MPQ_FILE_ENCRYPTED))
{
hf->dwFileKey = DecryptFileKey(szFileName, hf->MpqFilePos, dwFileSize, dwFlags);
}
if(nError == ERROR_SUCCESS)
{
// At this point, the file name in the file entry must be set
assert(pFileEntry->szFileName != NULL);
assert(_stricmp(pFileEntry->szFileName, szFileName) == 0);
// Initialize the hash entry for the file
hf->pFileEntry = pFileEntry;
hf->dwDataSize = dwFileSize;
// Decrypt the file key
if(dwFlags & MPQ_FILE_ENCRYPTED)
hf->dwFileKey = DecryptFileKey(szFileName, hf->MpqFilePos, dwFileSize, dwFlags);
// Initialize the block table entry for the file
pFileEntry->ByteOffset = hf->MpqFilePos;
@ -473,20 +473,14 @@ int SFileAddFile_Init(
// If the caller gave us a file time, use it.
pFileEntry->FileTime = FileTime;
// Mark the archive as modified
ha->dwFlags |= MPQ_FLAG_CHANGED;
// Call the callback, if needed
if(ha->pfnAddFileCB != NULL)
ha->pfnAddFileCB(ha->pvAddFileUserData, 0, hf->dwDataSize, false);
hf->nAddFileError = ERROR_SUCCESS;
if(AddFileCB != NULL)
AddFileCB(pvUserData, 0, hf->dwDataSize, false);
}
// Fre the file handle if failed
if(nError != ERROR_SUCCESS && hf != NULL)
FreeFileHandle(hf);
// Give the handle to the caller
// If an error occured, remember it
if(nError != ERROR_SUCCESS)
hf->bErrorOccured = true;
*phf = hf;
return nError;
}
@ -511,9 +505,12 @@ int SFileAddFile_Write(TMPQFile * hf, const void * pvData, DWORD dwSize, DWORD d
ULONGLONG RawFilePos = hf->RawFilePos;
// Allocate buffer for file sector
hf->nAddFileError = nError = AllocateSectorBuffer(hf);
nError = AllocateSectorBuffer(hf);
if(nError != ERROR_SUCCESS)
{
hf->bErrorOccured = true;
return nError;
}
// Allocate patch info, if the data is patch
if(hf->pPatchInfo == NULL && IsIncrementalPatchFile(pvData, dwSize, &hf->dwPatchedFileSize))
@ -522,25 +519,34 @@ int SFileAddFile_Write(TMPQFile * hf, const void * pvData, DWORD dwSize, DWORD d
hf->pFileEntry->dwFlags |= MPQ_FILE_PATCH_FILE;
// Allocate the patch info
hf->nAddFileError = nError = AllocatePatchInfo(hf, false);
nError = AllocatePatchInfo(hf, false);
if(nError != ERROR_SUCCESS)
{
hf->bErrorOccured = true;
return nError;
}
}
// Allocate sector offsets
if(hf->SectorOffsets == NULL)
{
hf->nAddFileError = nError = AllocateSectorOffsets(hf, false);
nError = AllocateSectorOffsets(hf, false);
if(nError != ERROR_SUCCESS)
{
hf->bErrorOccured = true;
return nError;
}
}
// Create array of sector checksums
if(hf->SectorChksums == NULL && (pFileEntry->dwFlags & MPQ_FILE_SECTOR_CRC))
{
hf->nAddFileError = nError = AllocateSectorChecksums(hf, false);
nError = AllocateSectorChecksums(hf, false);
if(nError != ERROR_SUCCESS)
{
hf->bErrorOccured = true;
return nError;
}
}
// Pre-save the patch info, if any
@ -548,7 +554,7 @@ int SFileAddFile_Write(TMPQFile * hf, const void * pvData, DWORD dwSize, DWORD d
{
if(!FileStream_Write(ha->pStream, &RawFilePos, hf->pPatchInfo, hf->pPatchInfo->dwLength))
nError = GetLastError();
pFileEntry->dwCmpSize += hf->pPatchInfo->dwLength;
RawFilePos += hf->pPatchInfo->dwLength;
}
@ -568,16 +574,7 @@ int SFileAddFile_Write(TMPQFile * hf, const void * pvData, DWORD dwSize, DWORD d
// Write the MPQ data to the file
if(nError == ERROR_SUCCESS)
{
// Save the first sector compression to the file structure
// Note that the entire first file sector will be compressed
// by compression that was passed to the first call of SFileAddFile_Write
if(hf->dwFilePos == 0)
hf->dwCompression0 = dwCompression;
// Write the data to the MPQ
nError = WriteDataToMpqFile(ha, hf, (LPBYTE)pvData, dwSize, dwCompression);
}
// If it succeeded and we wrote all the file data,
// we need to re-save sector offset table
@ -595,6 +592,8 @@ int SFileAddFile_Write(TMPQFile * hf, const void * pvData, DWORD dwSize, DWORD d
if(hf->SectorChksums != NULL)
{
nError = WriteSectorChecksums(hf);
if(nError != ERROR_SUCCESS)
hf->bErrorOccured = true;
}
// Now write patch info
@ -604,12 +603,16 @@ int SFileAddFile_Write(TMPQFile * hf, const void * pvData, DWORD dwSize, DWORD d
hf->pPatchInfo->dwDataSize = hf->pFileEntry->dwFileSize;
hf->pFileEntry->dwFileSize = hf->dwPatchedFileSize;
nError = WritePatchInfo(hf);
if(nError != ERROR_SUCCESS)
hf->bErrorOccured = true;
}
// Now write sector offsets to the file
if(hf->SectorOffsets != NULL)
{
nError = WriteSectorOffsets(hf);
if(nError != ERROR_SUCCESS)
hf->bErrorOccured = true;
}
// Write the MD5 hashes of each file chunk, if required
@ -619,12 +622,16 @@ int SFileAddFile_Write(TMPQFile * hf, const void * pvData, DWORD dwSize, DWORD d
ha->MpqPos + hf->pFileEntry->ByteOffset,
hf->pFileEntry->dwCmpSize,
ha->pHeader->dwRawChunkSize);
if(nError != ERROR_SUCCESS)
hf->bErrorOccured = true;
}
}
}
else
{
hf->bErrorOccured = true;
}
// Store the error code from the Write File operation
hf->nAddFileError = nError;
return nError;
}
@ -632,87 +639,88 @@ int SFileAddFile_Finish(TMPQFile * hf)
{
TMPQArchive * ha = hf->ha;
TFileEntry * pFileEntry = hf->pFileEntry;
int nError = hf->nAddFileError;
int nError = ERROR_SUCCESS;
// If all previous operations succeeded, we can update the MPQ
if(nError == ERROR_SUCCESS)
if(!hf->bErrorOccured)
{
// Verify if the caller wrote the file properly
if(hf->pPatchInfo == NULL)
{
assert(pFileEntry != NULL);
if(hf->dwFilePos != pFileEntry->dwFileSize)
{
nError = ERROR_CAN_NOT_COMPLETE;
hf->bErrorOccured = true;
}
}
else
{
if(hf->dwFilePos != hf->pPatchInfo->dwDataSize)
{
nError = ERROR_CAN_NOT_COMPLETE;
hf->bErrorOccured = true;
}
}
}
// Now we need to recreate the HET table, if exists
if(nError == ERROR_SUCCESS && ha->pHetTable != NULL)
{
nError = RebuildHetTable(ha);
}
// Update the block table size
if(nError == ERROR_SUCCESS)
if(!hf->bErrorOccured)
{
// Call the user callback, if any
if(ha->pfnAddFileCB != NULL)
ha->pfnAddFileCB(ha->pvAddFileUserData, hf->dwDataSize, hf->dwDataSize, true);
if(AddFileCB != NULL)
AddFileCB(pvUserData, hf->dwDataSize, hf->dwDataSize, true);
// Update the size of the block table
ha->pHeader->dwBlockTableSize = ha->dwFileTableSize;
}
else
{
// Free the file entry in MPQ tables
if(pFileEntry != NULL)
DeleteFileEntry(ha, pFileEntry);
FreeFileEntry(ha, pFileEntry);
}
// Clear the add file callback
FreeFileHandle(hf);
FreeMPQFile(hf);
pvUserData = NULL;
AddFileCB = NULL;
return nError;
}
//-----------------------------------------------------------------------------
// Adds data as file to the archive
// Adds data as file to the archive
bool WINAPI SFileCreateFile(
HANDLE hMpq,
const char * szArchivedName,
ULONGLONG FileTime,
DWORD dwFileSize,
LCID lcLocale,
DWORD dwFlags,
HANDLE * phFile)
HANDLE hMpq,
const char * szArchivedName,
ULONGLONG FileTime,
DWORD dwFileSize,
LCID lcLocale,
DWORD dwFlags,
HANDLE * phFile)
{
TMPQArchive * ha = (TMPQArchive *)hMpq;
int nError = ERROR_SUCCESS;
// Check valid parameters
if(!IsValidMpqHandle(hMpq))
if(!IsValidMpqHandle(ha))
nError = ERROR_INVALID_HANDLE;
if(szArchivedName == NULL || *szArchivedName == 0)
nError = ERROR_INVALID_PARAMETER;
if(phFile == NULL)
nError = ERROR_INVALID_PARAMETER;
// Don't allow to add file if the MPQ is open for read only
if(nError == ERROR_SUCCESS)
{
if(ha->dwFlags & MPQ_FLAG_READ_ONLY)
nError = ERROR_ACCESS_DENIED;
if(ha->dwFlags & MPQ_FLAG_READ_ONLY)
nError = ERROR_ACCESS_DENIED;
// Don't allow to add a file under pseudo-file name
if(IsPseudoFileName(szArchivedName, NULL))
nError = ERROR_INVALID_PARAMETER;
// Don't allow to add a file under pseudo-file name
if(IsPseudoFileName(szArchivedName, NULL))
nError = ERROR_INVALID_PARAMETER;
// Don't allow to add any of the internal files
if(IsInternalMpqFileName(szArchivedName))
nError = ERROR_INTERNAL_FILE;
}
// Don't allow to add any of the internal files
if(IsInternalMpqFileName(szArchivedName))
nError = ERROR_INTERNAL_FILE;
// Perform validity check of the MPQ flags
if(nError == ERROR_SUCCESS)
@ -725,17 +733,16 @@ bool WINAPI SFileCreateFile(
nError = ERROR_INVALID_PARAMETER;
}
// Check for MPQs that have invalid block table size
// Example: size of block table: 0x41, size of hash table: 0x40
// Create the file in MPQ
if(nError == ERROR_SUCCESS)
{
if(ha->dwFileTableSize > ha->dwMaxFileCount)
nError = ERROR_DISK_FULL;
}
// Invalidate the entries for (listfile) and (attributes)
// After we are done with MPQ changes, we need to re-create them anyway
InvalidateInternalFiles(ha);
// Initiate the add file operation
if(nError == ERROR_SUCCESS)
// Initiate the add file operation
nError = SFileAddFile_Init(ha, szArchivedName, FileTime, dwFileSize, lcLocale, dwFlags, (TMPQFile **)phFile);
}
// Deal with the errors
if(nError != ERROR_SUCCESS)
@ -744,16 +751,16 @@ bool WINAPI SFileCreateFile(
}
bool WINAPI SFileWriteFile(
HANDLE hFile,
const void * pvData,
DWORD dwSize,
DWORD dwCompression)
HANDLE hFile,
const void * pvData,
DWORD dwSize,
DWORD dwCompression)
{
TMPQFile * hf = (TMPQFile *)hFile;
int nError = ERROR_SUCCESS;
// Check the proper parameters
if(!IsValidFileHandle(hFile))
if(!IsValidFileHandle(hf))
nError = ERROR_INVALID_HANDLE;
if(hf->bIsWriteHandle == false)
nError = ERROR_INVALID_HANDLE;
@ -767,14 +774,14 @@ bool WINAPI SFileWriteFile(
// the calling application must ensure that such flag combination doesn't get here
//
// if(dwFlags & MPQ_FILE_IMPLODE)
// nError = ERROR_INVALID_PARAMETER;
//
// if(dwFlags & MPQ_FILE_ENCRYPTED)
// nError = ERROR_INVALID_PARAMETER;
// if(dwFlags & MPQ_FILE_IMPLODE)
// nError = ERROR_INVALID_PARAMETER;
//
// if(dwFlags & MPQ_FILE_ENCRYPTED)
// nError = ERROR_INVALID_PARAMETER;
// Lossy compression is not allowed on single unit files
if(dwCompression & MPQ_LOSSY_COMPRESSION_MASK)
if(dwCompression & LOSSY_COMPRESSION_MASK)
nError = ERROR_INVALID_PARAMETER;
}
@ -782,7 +789,7 @@ bool WINAPI SFileWriteFile(
// Write the data to the file
if(nError == ERROR_SUCCESS)
nError = SFileAddFile_Write(hf, pvData, dwSize, dwCompression);
// Deal with errors
if(nError != ERROR_SUCCESS)
SetLastError(nError);
@ -795,7 +802,7 @@ bool WINAPI SFileFinishFile(HANDLE hFile)
int nError = ERROR_SUCCESS;
// Check the proper parameters
if(!IsValidFileHandle(hFile))
if(!IsValidFileHandle(hf))
nError = ERROR_INVALID_HANDLE;
if(hf->bIsWriteHandle == false)
nError = ERROR_INVALID_HANDLE;
@ -803,7 +810,7 @@ bool WINAPI SFileFinishFile(HANDLE hFile)
// Finish the file
if(nError == ERROR_SUCCESS)
nError = SFileAddFile_Finish(hf);
// Deal with errors
if(nError != ERROR_SUCCESS)
SetLastError(nError);
@ -811,15 +818,15 @@ bool WINAPI SFileFinishFile(HANDLE hFile)
}
//-----------------------------------------------------------------------------
// Adds a file to the archive
// Adds a file to the archive
bool WINAPI SFileAddFileEx(
HANDLE hMpq,
const TCHAR * szFileName,
const char * szArchivedName,
DWORD dwFlags,
DWORD dwCompression, // Compression of the first sector
DWORD dwCompressionNext) // Compression of next sectors
HANDLE hMpq,
const TCHAR * szFileName,
const char * szArchivedName,
DWORD dwFlags,
DWORD dwCompression, // Compression of the first sector
DWORD dwCompressionNext) // Compression of next sectors
{
ULONGLONG FileSize = 0;
ULONGLONG FileTime = 0;
@ -835,13 +842,13 @@ bool WINAPI SFileAddFileEx(
int nError = ERROR_SUCCESS;
// Check parameters
if(hMpq == NULL || szFileName == NULL || *szFileName == 0)
if(szFileName == NULL || *szFileName == 0)
nError = ERROR_INVALID_PARAMETER;
// Open added file
if(nError == ERROR_SUCCESS)
{
pStream = FileStream_OpenFile(szFileName, STREAM_FLAG_READ_ONLY | STREAM_PROVIDER_FLAT | BASE_PROVIDER_FILE);
pStream = FileStream_OpenFile(szFileName, STREAM_FLAG_READ_ONLY | STREAM_PROVIDER_LINEAR | BASE_PROVIDER_FILE);
if(pStream == NULL)
nError = GetLastError();
}
@ -851,7 +858,7 @@ bool WINAPI SFileAddFileEx(
{
FileStream_GetTime(pStream, &FileTime);
FileStream_GetSize(pStream, &FileSize);
// Files bigger than 4GB cannot be added to MPQ
if(FileSize >> 32)
nError = ERROR_DISK_FULL;
@ -873,18 +880,15 @@ bool WINAPI SFileAddFileEx(
// we will copy the compression for the first sector
if(dwCompressionNext == MPQ_COMPRESSION_NEXT_SAME)
dwCompressionNext = dwCompression;
// If the caller wants ADPCM compression, we make sure
// that the first sector is not compressed with lossy compression
if(dwCompressionNext & (MPQ_COMPRESSION_ADPCM_MONO | MPQ_COMPRESSION_ADPCM_STEREO))
{
// The compression of the first file sector must not be ADPCM
// in order not to corrupt the headers
// The first compression must not be WAVE
if(dwCompression & (MPQ_COMPRESSION_ADPCM_MONO | MPQ_COMPRESSION_ADPCM_STEREO))
dwCompression = MPQ_COMPRESSION_PKWARE;
// Remove both flag mono and stereo flags.
// They will be re-added according to WAVE type
dwCompressionNext &= ~(MPQ_COMPRESSION_ADPCM_MONO | MPQ_COMPRESSION_ADPCM_STEREO);
bIsAdpcmCompression = true;
}
@ -912,19 +916,15 @@ bool WINAPI SFileAddFileEx(
// If the file being added is a WAVE file, we check number of channels
if(bIsFirstSector && bIsAdpcmCompression)
{
// The file must really be a WAVE file with at least 16 bits per sample,
// otherwise the ADPCM compression will corrupt it
if(IsWaveFile_16BitsPerAdpcmSample(pbFileData, dwBytesToRead, &dwChannels))
// The file must really be a wave file, otherwise it's data corruption
if(!IsWaveFile(pbFileData, dwBytesToRead, &dwChannels))
{
// Setup the compression of next sectors according to number of channels
dwCompressionNext |= (dwChannels == 1) ? MPQ_COMPRESSION_ADPCM_MONO : MPQ_COMPRESSION_ADPCM_STEREO;
}
else
{
// Setup the compression of next sectors to a lossless compression
dwCompressionNext = (dwCompression & MPQ_LOSSY_COMPRESSION_MASK) ? MPQ_COMPRESSION_PKWARE : dwCompression;
nError = ERROR_BAD_FORMAT;
break;
}
// Setup the compression according to number of channels
dwCompressionNext |= (dwChannels == 1) ? MPQ_COMPRESSION_ADPCM_MONO : MPQ_COMPRESSION_ADPCM_STEREO;
bIsFirstSector = false;
}
@ -956,7 +956,7 @@ bool WINAPI SFileAddFileEx(
SetLastError(nError);
return (nError == ERROR_SUCCESS);
}
// Adds a data file into the archive
bool WINAPI SFileAddFile(HANDLE hMpq, const TCHAR * szFileName, const char * szArchivedName, DWORD dwFlags)
{
@ -983,25 +983,25 @@ bool WINAPI SFileAddWave(HANDLE hMpq, const TCHAR * szFileName, const char * szA
// Starcraft files are packed as Mono (0x41) on medium quality.
// Because this compression is not used anymore, our compression functions
// will default to WaveCompressionLevel = 4 when using ADPCM compression
//
//
// Convert quality to data compression
switch(dwQuality)
{
case MPQ_WAVE_QUALITY_HIGH:
// WaveCompressionLevel = -1;
dwCompression = MPQ_COMPRESSION_PKWARE;
break;
case MPQ_WAVE_QUALITY_HIGH:
// WaveCompressionLevel = -1;
dwCompression = MPQ_COMPRESSION_PKWARE;
break;
case MPQ_WAVE_QUALITY_MEDIUM:
// WaveCompressionLevel = 4;
dwCompression = MPQ_COMPRESSION_ADPCM_STEREO | MPQ_COMPRESSION_HUFFMANN;
break;
case MPQ_WAVE_QUALITY_MEDIUM:
// WaveCompressionLevel = 4;
dwCompression = MPQ_COMPRESSION_ADPCM_STEREO | MPQ_COMPRESSION_HUFFMANN;
break;
case MPQ_WAVE_QUALITY_LOW:
// WaveCompressionLevel = 2;
dwCompression = MPQ_COMPRESSION_ADPCM_STEREO | MPQ_COMPRESSION_HUFFMANN;
break;
case MPQ_WAVE_QUALITY_LOW:
// WaveCompressionLevel = 2;
dwCompression = MPQ_COMPRESSION_ADPCM_STEREO | MPQ_COMPRESSION_HUFFMANN;
break;
}
return SFileAddFileEx(hMpq,
@ -1017,7 +1017,7 @@ bool WINAPI SFileAddWave(HANDLE hMpq, const TCHAR * szFileName, const char * szA
//
// 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.
// table are updated.
bool WINAPI SFileRemoveFile(HANDLE hMpq, const char * szFileName, DWORD dwSearchScope)
{
@ -1032,7 +1032,7 @@ bool WINAPI SFileRemoveFile(HANDLE hMpq, const char * szFileName, DWORD dwSearch
// Check the parameters
if(nError == ERROR_SUCCESS)
{
if(!IsValidMpqHandle(hMpq))
if(!IsValidMpqHandle(ha))
nError = ERROR_INVALID_HANDLE;
if(szFileName == NULL || *szFileName == 0)
nError = ERROR_INVALID_PARAMETER;
@ -1075,12 +1075,8 @@ bool WINAPI SFileRemoveFile(HANDLE hMpq, const char * szFileName, DWORD dwSearch
// After we are done with MPQ changes, we need to re-create them anyway
InvalidateInternalFiles(ha);
// Delete the file entry in the file table and defragment the file table
DeleteFileEntry(ha, pFileEntry);
// We also need to rebuild the HET table, if present
if(ha->pHetTable != NULL)
nError = RebuildHetTable(ha);
// Mark the file entry as free
nError = FreeFileEntry(ha, pFileEntry);
}
// Resolve error and exit
@ -1101,7 +1097,7 @@ bool WINAPI SFileRenameFile(HANDLE hMpq, const char * szFileName, const char * s
// Test the valid parameters
if(nError == ERROR_SUCCESS)
{
if(!IsValidMpqHandle(hMpq))
if(!IsValidMpqHandle(ha))
nError = ERROR_INVALID_HANDLE;
if(szFileName == NULL || *szFileName == 0 || szNewFileName == NULL || *szNewFileName == 0)
nError = ERROR_INVALID_PARAMETER;
@ -1131,7 +1127,7 @@ bool WINAPI SFileRenameFile(HANDLE hMpq, const char * szFileName, const char * s
if(pFileEntry == NULL)
nError = ERROR_FILE_NOT_FOUND;
}
// Also try to find file entry for the new file.
// This verifies if we are not overwriting an existing file
// (whose name we perhaps don't know)
@ -1148,10 +1144,6 @@ bool WINAPI SFileRenameFile(HANDLE hMpq, const char * szFileName, const char * s
nError = RenameFileEntry(ha, pFileEntry, szNewFileName);
}
// Now we need to recreate the HET table, if we have one
if(nError == ERROR_SUCCESS && ha->pHetTable != NULL)
nError = RebuildHetTable(ha);
// Now we copy the existing file entry to the new one
if(nError == ERROR_SUCCESS)
{
@ -1159,12 +1151,14 @@ bool WINAPI SFileRenameFile(HANDLE hMpq, const char * szFileName, const char * s
// with the new decryption key
if(pFileEntry->dwFlags & MPQ_FILE_ENCRYPTED)
{
hf = CreateFileHandle(ha, pFileEntry);
hf = CreateMpqFile(ha);
if(hf != NULL)
{
// Recrypt the file data in the MPQ
hf->pFileEntry = pFileEntry;
hf->dwDataSize = pFileEntry->dwFileSize;
nError = RecryptFileData(ha, hf, szFileName, szNewFileName);
// Update the MD5
if(ha->pHeader->dwRawChunkSize != 0)
{
@ -1174,8 +1168,8 @@ bool WINAPI SFileRenameFile(HANDLE hMpq, const char * szFileName, const char * s
pFileEntry->dwCmpSize,
ha->pHeader->dwRawChunkSize);
}
FreeFileHandle(hf);
FreeMPQFile(hf);
}
else
{
@ -1184,8 +1178,9 @@ bool WINAPI SFileRenameFile(HANDLE hMpq, const char * szFileName, const char * s
}
}
//
// Note: MPQ_FLAG_CHANGED is set by RenameFileEntry
// assert((ha->dwFlags & MPQ_FLAG_CHANGED) != 0);
//
// Resolve error and return
if(nError != ERROR_SUCCESS)
@ -1220,7 +1215,7 @@ bool WINAPI SFileSetFileLocale(HANDLE hFile, LCID lcNewLocale)
TMPQFile * hf = (TMPQFile *)hFile;
// Invalid handle => do nothing
if(!IsValidFileHandle(hFile))
if(!IsValidFileHandle(hf))
{
SetLastError(ERROR_INVALID_HANDLE);
return false;
@ -1283,17 +1278,9 @@ bool WINAPI SFileSetFileLocale(HANDLE hFile, LCID lcNewLocale)
//-----------------------------------------------------------------------------
// Sets add file callback
bool WINAPI SFileSetAddFileCallback(HANDLE hMpq, SFILE_ADDFILE_CALLBACK AddFileCB, void * pvUserData)
bool WINAPI SFileSetAddFileCallback(HANDLE /* hMpq */, SFILE_ADDFILE_CALLBACK aAddFileCB, void * pvData)
{
TMPQArchive * ha = (TMPQArchive *) hMpq;
if(!IsValidMpqHandle(hMpq))
{
SetLastError(ERROR_INVALID_HANDLE);
return false;
}
ha->pvAddFileUserData = pvUserData;
ha->pfnAddFileCB = AddFileCB;
pvUserData = pvData;
AddFileCB = aAddFileCB;
return true;
}

View file

@ -24,450 +24,346 @@ typedef struct _MPQ_ATTRIBUTES_HEADER
// Followed by an array of file times
// Followed by an array of MD5
// Followed by an array of patch bits
// Note: The MD5 in (attributes), if present, is a hash of the entire file.
// In case the file is an incremental patch, it contains MD5 of the file
// after being patched.
} MPQ_ATTRIBUTES_HEADER, *PMPQ_ATTRIBUTES_HEADER;
//-----------------------------------------------------------------------------
// Local functions
static DWORD GetSizeOfAttributesFile(DWORD dwAttrFlags, DWORD dwFileTableSize)
{
DWORD cbAttrFile = sizeof(MPQ_ATTRIBUTES_HEADER);
// Calculate size of the (attributes) file
if(dwAttrFlags & MPQ_ATTRIBUTE_CRC32)
cbAttrFile += dwFileTableSize * sizeof(DWORD);
if(dwAttrFlags & MPQ_ATTRIBUTE_FILETIME)
cbAttrFile += dwFileTableSize * sizeof(ULONGLONG);
if(dwAttrFlags & MPQ_ATTRIBUTE_MD5)
cbAttrFile += dwFileTableSize * MD5_DIGEST_SIZE;
// The bit array has been created without the last bit belonging to (attributes)
// When the number of files is a multiplier of 8 plus one, then the size of (attributes)
// if 1 byte less than expected.
// Example: wow-update-13164.MPQ: BlockTableSize = 0x62E1, but there's only 0xC5C bytes
if(dwAttrFlags & MPQ_ATTRIBUTE_PATCH_BIT)
cbAttrFile += (dwFileTableSize + 6) / 8;
return cbAttrFile;
}
static DWORD CheckSizeOfAttributesFile(DWORD cbAttrFile, DWORD dwAttrFlags, DWORD dwFileTableSize)
{
DWORD cbHeaderSize = sizeof(MPQ_ATTRIBUTES_HEADER);
DWORD cbChecksumSize1 = 0;
DWORD cbChecksumSize2 = 0;
DWORD cbFileTimeSize1 = 0;
DWORD cbFileTimeSize2 = 0;
DWORD cbFileHashSize1 = 0;
DWORD cbFileHashSize2 = 0;
DWORD cbPatchBitSize1 = 0;
DWORD cbPatchBitSize2 = 0;
DWORD cbPatchBitSize3 = 0;
//
// Various variants with the patch bit
//
// interface.MPQ.part from WoW build 10958 has
// the MPQ_ATTRIBUTE_PATCH_BIT set, but there's an array of DWORDs instead.
// The array is filled with zeros, so we don't know what it should contain
//
// Zenith.SC2MAP has the MPQ_ATTRIBUTE_PATCH_BIT set, but the bit array is missing
//
// Elimination Tournament 2.w3x's (attributes) have one entry less
//
// There may be two variants: Either the (attributes) file has full
// number of entries, or has one entry less
//
// Get the expected size of CRC32 array
if(dwAttrFlags & MPQ_ATTRIBUTE_CRC32)
{
cbChecksumSize1 += dwFileTableSize * sizeof(DWORD);
cbChecksumSize2 += cbChecksumSize1 - sizeof(DWORD);
}
// Get the expected size of FILETIME array
if(dwAttrFlags & MPQ_ATTRIBUTE_FILETIME)
{
cbFileTimeSize1 += dwFileTableSize * sizeof(ULONGLONG);
cbFileTimeSize2 += cbFileTimeSize1 - sizeof(ULONGLONG);
}
// Get the expected size of MD5 array
if(dwAttrFlags & MPQ_ATTRIBUTE_MD5)
{
cbFileHashSize1 += dwFileTableSize * MD5_DIGEST_SIZE;
cbFileHashSize2 += cbFileHashSize1 - MD5_DIGEST_SIZE;
}
// Get the expected size of patch bit array
if(dwAttrFlags & MPQ_ATTRIBUTE_PATCH_BIT)
{
cbPatchBitSize1 =
cbPatchBitSize2 = ((dwFileTableSize + 6) / 8);
cbPatchBitSize3 = dwFileTableSize * sizeof(DWORD);
}
// Check if the (attributes) file entry count is equal to our file table size
if(cbAttrFile == (cbHeaderSize + cbChecksumSize1 + cbFileTimeSize1 + cbFileHashSize1 + cbPatchBitSize1))
return dwFileTableSize;
// Check if the (attributes) file entry count is equal to our file table size minus one
if(cbAttrFile == (cbHeaderSize + cbChecksumSize2 + cbFileTimeSize2 + cbFileHashSize2 + cbPatchBitSize2))
return dwFileTableSize - 1;
// Zenith.SC2MAP has the MPQ_ATTRIBUTE_PATCH_BIT set, but the bit array is missing
if(cbAttrFile == (cbHeaderSize + cbChecksumSize1 + cbFileTimeSize1 + cbFileHashSize1))
return dwFileTableSize;
// interface.MPQ.part (WoW build 10958) has the MPQ_ATTRIBUTE_PATCH_BIT set
// but there's an array of DWORDs (filled with zeros) instead of array of bits
if(cbAttrFile == (cbHeaderSize + cbChecksumSize1 + cbFileTimeSize1 + cbFileHashSize1 + cbPatchBitSize3))
return dwFileTableSize;
#ifdef __STORMLIB_TEST__
// Invalid size of the (attributes) file
// Note that many MPQs, especially Warcraft III maps have the size of (attributes) invalid.
// We only perform this check if this is the STORMLIB testprogram itself
// assert(false);
#endif
return 0;
}
static int LoadAttributesFile(TMPQArchive * ha, LPBYTE pbAttrFile, DWORD cbAttrFile)
{
LPBYTE pbAttrFileEnd = pbAttrFile + cbAttrFile;
LPBYTE pbAttrPtr = pbAttrFile;
DWORD dwAttributesEntries = 0;
DWORD i;
// Load and verify the header
if((pbAttrPtr + sizeof(MPQ_ATTRIBUTES_HEADER)) <= pbAttrFileEnd)
{
PMPQ_ATTRIBUTES_HEADER pAttrHeader = (PMPQ_ATTRIBUTES_HEADER)pbAttrPtr;
// Verify the header version
BSWAP_ARRAY32_UNSIGNED(pAttrHeader, sizeof(MPQ_ATTRIBUTES_HEADER));
if(pAttrHeader->dwVersion != MPQ_ATTRIBUTES_V1)
return ERROR_BAD_FORMAT;
// Verify the flags
if(pAttrHeader->dwFlags & ~MPQ_ATTRIBUTE_ALL)
return ERROR_BAD_FORMAT;
// Verify whether file size of (attributes) is expected
dwAttributesEntries = CheckSizeOfAttributesFile(cbAttrFile, pAttrHeader->dwFlags, ha->pHeader->dwBlockTableSize);
if(dwAttributesEntries == 0)
return ERROR_BAD_FORMAT;
ha->dwAttrFlags = pAttrHeader->dwFlags;
pbAttrPtr = (LPBYTE)(pAttrHeader + 1);
}
// Load the CRC32 (if present)
if(ha->dwAttrFlags & MPQ_ATTRIBUTE_CRC32)
{
LPDWORD ArrayCRC32 = (LPDWORD)pbAttrPtr;
DWORD cbArraySize = dwAttributesEntries * sizeof(DWORD);
// Verify if there's enough data
if((pbAttrPtr + cbArraySize) > pbAttrFileEnd)
return ERROR_FILE_CORRUPT;
BSWAP_ARRAY32_UNSIGNED(ArrayCRC32, cbCRC32Size);
for(i = 0; i < dwAttributesEntries; i++)
ha->pFileTable[i].dwCrc32 = ArrayCRC32[i];
pbAttrPtr += cbArraySize;
}
// Load the FILETIME (if present)
if(ha->dwAttrFlags & MPQ_ATTRIBUTE_FILETIME)
{
ULONGLONG * ArrayFileTime = (ULONGLONG *)pbAttrPtr;
DWORD cbArraySize = dwAttributesEntries * sizeof(ULONGLONG);
// Verify if there's enough data
if((pbAttrPtr + cbArraySize) > pbAttrFileEnd)
return ERROR_FILE_CORRUPT;
BSWAP_ARRAY64_UNSIGNED(ArrayFileTime, cbFileTimeSize);
for(i = 0; i < dwAttributesEntries; i++)
ha->pFileTable[i].FileTime = ArrayFileTime[i];
pbAttrPtr += cbArraySize;
}
// Load the MD5 (if present)
if(ha->dwAttrFlags & MPQ_ATTRIBUTE_MD5)
{
LPBYTE ArrayMd5 = pbAttrPtr;
DWORD cbArraySize = dwAttributesEntries * MD5_DIGEST_SIZE;
// Verify if there's enough data
if((pbAttrPtr + cbArraySize) > pbAttrFileEnd)
return ERROR_FILE_CORRUPT;
for(i = 0; i < dwAttributesEntries; i++)
{
memcpy(ha->pFileTable[i].md5, ArrayMd5, MD5_DIGEST_SIZE);
ArrayMd5 += MD5_DIGEST_SIZE;
}
pbAttrPtr += cbArraySize;
}
// Read the patch bit for each file (if present)
if(ha->dwAttrFlags & MPQ_ATTRIBUTE_PATCH_BIT)
{
LPBYTE pbBitArray = pbAttrPtr;
DWORD cbArraySize = (dwAttributesEntries + 7) / 8;
DWORD dwByteIndex = 0;
DWORD dwBitMask = 0x80;
// Verify if there's enough data
if((pbAttrPtr + cbArraySize) == pbAttrFileEnd)
{
for(i = 0; i < dwAttributesEntries; i++)
{
ha->pFileTable[i].dwFlags |= (pbBitArray[dwByteIndex] & dwBitMask) ? MPQ_FILE_PATCH_FILE : 0;
dwByteIndex += (dwBitMask & 0x01);
dwBitMask = (dwBitMask << 0x07) | (dwBitMask >> 0x01);
}
}
}
return ERROR_SUCCESS;
}
static LPBYTE CreateAttributesFile(TMPQArchive * ha, DWORD * pcbAttrFile)
{
PMPQ_ATTRIBUTES_HEADER pAttrHeader;
TFileEntry * pFileTableEnd = ha->pFileTable + ha->dwFileTableSize;
TFileEntry * pFileEntry;
LPBYTE pbAttrFile;
LPBYTE pbAttrPtr;
size_t cbAttrFile;
DWORD dwFinalEntries = ha->dwFileTableSize + ha->dwReservedFiles;
// Check if we need patch bits in the (attributes) file
for(pFileEntry = ha->pFileTable; pFileEntry < pFileTableEnd; pFileEntry++)
{
if(pFileEntry->dwFlags & MPQ_FILE_PATCH_FILE)
{
ha->dwAttrFlags |= MPQ_ATTRIBUTE_PATCH_BIT;
break;
}
}
// Allocate the buffer for holding the entire (attributes)
// Allodate 1 byte more (See GetSizeOfAttributesFile for more info)
cbAttrFile = GetSizeOfAttributesFile(ha->dwAttrFlags, dwFinalEntries);
pbAttrFile = pbAttrPtr = STORM_ALLOC(BYTE, cbAttrFile + 1);
if(pbAttrFile != NULL)
{
// Make sure it's all zeroed
memset(pbAttrFile, 0, cbAttrFile + 1);
// Write the header of the (attributes) file
pAttrHeader = (PMPQ_ATTRIBUTES_HEADER)pbAttrPtr;
pAttrHeader->dwVersion = BSWAP_INT32_UNSIGNED(100);
pAttrHeader->dwFlags = BSWAP_INT32_UNSIGNED((ha->dwAttrFlags & MPQ_ATTRIBUTE_ALL));
pbAttrPtr = (LPBYTE)(pAttrHeader + 1);
// Write the array of CRC32, if present
if(ha->dwAttrFlags & MPQ_ATTRIBUTE_CRC32)
{
LPDWORD pArrayCRC32 = (LPDWORD)pbAttrPtr;
// Copy from file table
for(pFileEntry = ha->pFileTable; pFileEntry < pFileTableEnd; pFileEntry++)
*pArrayCRC32++ = BSWAP_INT32_UNSIGNED(pFileEntry->dwCrc32);
// Skip the reserved entries
pbAttrPtr = (LPBYTE)(pArrayCRC32 + ha->dwReservedFiles);
}
// Write the array of file time
if(ha->dwAttrFlags & MPQ_ATTRIBUTE_FILETIME)
{
ULONGLONG * pArrayFileTime = (ULONGLONG *)pbAttrPtr;
// Copy from file table
for(pFileEntry = ha->pFileTable; pFileEntry < pFileTableEnd; pFileEntry++)
*pArrayFileTime++ = BSWAP_INT64_UNSIGNED(pFileEntry->FileTime);
// Skip the reserved entries
pbAttrPtr = (LPBYTE)(pArrayFileTime + ha->dwReservedFiles);
}
// Write the array of MD5s
if(ha->dwAttrFlags & MPQ_ATTRIBUTE_MD5)
{
LPBYTE pbArrayMD5 = pbAttrPtr;
// Copy from file table
for(pFileEntry = ha->pFileTable; pFileEntry < pFileTableEnd; pFileEntry++)
{
memcpy(pbArrayMD5, pFileEntry->md5, MD5_DIGEST_SIZE);
pbArrayMD5 += MD5_DIGEST_SIZE;
}
// Skip the reserved items
pbAttrPtr = pbArrayMD5 + (ha->dwReservedFiles * MD5_DIGEST_SIZE);
}
// Write the array of patch bits
if(ha->dwAttrFlags & MPQ_ATTRIBUTE_PATCH_BIT)
{
LPBYTE pbBitArray = pbAttrPtr;
DWORD dwByteIndex = 0;
BYTE dwBitMask = 0x80;
// Copy from file table
for(pFileEntry = ha->pFileTable; pFileEntry < pFileTableEnd; pFileEntry++)
{
// Set the bit, if needed
if(pFileEntry->dwFlags & MPQ_FILE_PATCH_FILE)
pbBitArray[dwByteIndex] |= dwBitMask;
// Update bit index and bit mask
dwByteIndex += (dwBitMask & 0x01);
dwBitMask = (dwBitMask << 0x07) | (dwBitMask >> 0x01);
}
// Having incremented the bit array just by the number of items in the file table
// will create the bit array one byte less of the number of files is a multiplier of 8).
// Blizzard MPQs have the same feature.
// Move past the bit array
pbAttrPtr = (pbBitArray + dwByteIndex) + ((dwBitMask & 0x7F) ? 1 : 0);
}
// Now we expect that current position matches the estimated size
// Note that if there is 1 extra bit above the byte size,
// the table is actually 1 byte shorted in Blizzard MPQs. See GetSizeOfAttributesFile
assert((size_t)(pbAttrPtr - pbAttrFile) == cbAttrFile);
}
// Give away the attributes file
if(pcbAttrFile != NULL)
*pcbAttrFile = (DWORD)cbAttrFile;
return pbAttrFile;
}
//-----------------------------------------------------------------------------
// Public functions (internal use by StormLib)
int SAttrLoadAttributes(TMPQArchive * ha)
{
MPQ_ATTRIBUTES_HEADER AttrHeader;
HANDLE hFile = NULL;
LPBYTE pbAttrFile;
DWORD dwBlockTableSize = ha->pHeader->dwBlockTableSize;
DWORD dwArraySize;
DWORD dwBytesRead;
DWORD cbAttrFile = 0;
int nError = ERROR_FILE_CORRUPT;
DWORD i;
int nError = ERROR_SUCCESS;
// File table must be initialized
assert(ha->pFileTable != NULL);
// Don't load the attributes file from malformed Warcraft III maps
if(ha->dwFlags & MPQ_FLAG_MALFORMED)
return ERROR_FILE_CORRUPT;
// Attempt to open the "(attributes)" file.
// If it's not there, then the archive doesn't support attributes
if(SFileOpenFileEx((HANDLE)ha, ATTRIBUTES_NAME, SFILE_OPEN_ANY_LOCALE, &hFile))
{
// Retrieve and check size of the (attributes) file
cbAttrFile = SFileGetFileSize(hFile, NULL);
// Load the content of the attributes file
SFileReadFile(hFile, &AttrHeader, sizeof(MPQ_ATTRIBUTES_HEADER), &dwBytesRead, NULL);
if(dwBytesRead != sizeof(MPQ_ATTRIBUTES_HEADER))
nError = ERROR_FILE_CORRUPT;
// Size of the (attributes) might be 1 byte less than expected
// See GetSizeOfAttributesFile for more info
pbAttrFile = STORM_ALLOC(BYTE, cbAttrFile + 1);
if(pbAttrFile != NULL)
// Verify the header of the (attributes) file
if(nError == ERROR_SUCCESS)
{
// Set the last byte to 0 in case the size should be 1 byte greater
pbAttrFile[cbAttrFile] = 0;
// Load the entire file to memory
SFileReadFile(hFile, pbAttrFile, cbAttrFile, &dwBytesRead, NULL);
if(dwBytesRead == cbAttrFile)
nError = LoadAttributesFile(ha, pbAttrFile, cbAttrFile);
// Free the buffer
STORM_FREE(pbAttrFile);
AttrHeader.dwVersion = BSWAP_INT32_UNSIGNED(AttrHeader.dwVersion);
AttrHeader.dwFlags = BSWAP_INT32_UNSIGNED(AttrHeader.dwFlags);
ha->dwAttrFlags = AttrHeader.dwFlags;
if(dwBytesRead != sizeof(MPQ_ATTRIBUTES_HEADER))
nError = ERROR_FILE_CORRUPT;
}
// Close the attributes file
// Verify format of the attributes
if(nError == ERROR_SUCCESS)
{
if(AttrHeader.dwVersion > MPQ_ATTRIBUTES_V1)
nError = ERROR_BAD_FORMAT;
}
// Load the CRC32 (if any)
if(nError == ERROR_SUCCESS && (AttrHeader.dwFlags & MPQ_ATTRIBUTE_CRC32))
{
LPDWORD pArrayCRC32 = STORM_ALLOC(DWORD, dwBlockTableSize);
if(pArrayCRC32 != NULL)
{
dwArraySize = dwBlockTableSize * sizeof(DWORD);
SFileReadFile(hFile, pArrayCRC32, dwArraySize, &dwBytesRead, NULL);
if(dwBytesRead == dwArraySize)
{
for(i = 0; i < dwBlockTableSize; i++)
ha->pFileTable[i].dwCrc32 = BSWAP_INT32_UNSIGNED(pArrayCRC32[i]);
}
else
nError = ERROR_FILE_CORRUPT;
STORM_FREE(pArrayCRC32);
}
else
nError = ERROR_NOT_ENOUGH_MEMORY;
}
// Read the array of file times
if(nError == ERROR_SUCCESS && (AttrHeader.dwFlags & MPQ_ATTRIBUTE_FILETIME))
{
ULONGLONG * pArrayFileTime = STORM_ALLOC(ULONGLONG, dwBlockTableSize);
if(pArrayFileTime != NULL)
{
dwArraySize = dwBlockTableSize * sizeof(ULONGLONG);
SFileReadFile(hFile, pArrayFileTime, dwArraySize, &dwBytesRead, NULL);
if(dwBytesRead == dwArraySize)
{
for(i = 0; i < dwBlockTableSize; i++)
ha->pFileTable[i].FileTime = BSWAP_INT64_UNSIGNED(pArrayFileTime[i]);
}
else
nError = ERROR_FILE_CORRUPT;
STORM_FREE(pArrayFileTime);
}
else
nError = ERROR_NOT_ENOUGH_MEMORY;
}
// Read the MD5 (if any)
// Note: MD5 array can be incomplete, if it's the last array in the (attributes)
if(nError == ERROR_SUCCESS && (AttrHeader.dwFlags & MPQ_ATTRIBUTE_MD5))
{
unsigned char * pArrayMD5 = STORM_ALLOC(unsigned char, (dwBlockTableSize * MD5_DIGEST_SIZE));
unsigned char * md5;
if(pArrayMD5 != NULL)
{
dwArraySize = dwBlockTableSize * MD5_DIGEST_SIZE;
SFileReadFile(hFile, pArrayMD5, dwArraySize, &dwBytesRead, NULL);
if(dwBytesRead == dwArraySize)
{
md5 = pArrayMD5;
for(i = 0; i < dwBlockTableSize; i++)
{
memcpy(ha->pFileTable[i].md5, md5, MD5_DIGEST_SIZE);
md5 += MD5_DIGEST_SIZE;
}
}
else
nError = ERROR_FILE_CORRUPT;
STORM_FREE(pArrayMD5);
}
else
nError = ERROR_NOT_ENOUGH_MEMORY;
}
// Read the patch bit for each file
if(nError == ERROR_SUCCESS && (AttrHeader.dwFlags & MPQ_ATTRIBUTE_PATCH_BIT))
{
LPBYTE pbBitArray;
DWORD dwByteSize = ((dwBlockTableSize - 1) / 8) + 1;
pbBitArray = STORM_ALLOC(BYTE, dwByteSize);
if(pbBitArray != NULL)
{
SFileReadFile(hFile, pbBitArray, dwByteSize, &dwBytesRead, NULL);
if(dwBytesRead == dwByteSize)
{
for(i = 0; i < dwBlockTableSize; i++)
{
DWORD dwByteIndex = i / 8;
DWORD dwBitMask = 0x80 >> (i & 7);
// Is the appropriate bit set?
if(pbBitArray[dwByteIndex] & dwBitMask)
{
// At the moment, we assume that the patch bit is present
// in both file table and (attributes)
assert((ha->pFileTable[i].dwFlags & MPQ_FILE_PATCH_FILE) != 0);
ha->pFileTable[i].dwFlags |= MPQ_FILE_PATCH_FILE;
}
}
}
else
nError = ERROR_FILE_CORRUPT;
STORM_FREE(pbBitArray);
}
}
//
// Note: Version 7.00 of StormLib saved the (attributes) incorrectly.
// Sometimes, number of entries in the (attributes) was 1 item less
// than block table size.
// If we encounter such table, we will zero all three arrays
//
if(nError != ERROR_SUCCESS)
ha->dwAttrFlags = 0;
// Cleanup & exit
SFileCloseFile(hFile);
}
return nError;
}
// Saves the (attributes) to the MPQ
int SAttrFileSaveToMpq(TMPQArchive * ha)
{
MPQ_ATTRIBUTES_HEADER AttrHeader;
TFileEntry * pFileEntry;
TMPQFile * hf = NULL;
LPBYTE pbAttrFile;
DWORD cbAttrFile = 0;
DWORD dwFinalBlockTableSize = ha->dwFileTableSize;
DWORD dwFileSize = 0;
DWORD dwToWrite;
DWORD i;
int nError = ERROR_SUCCESS;
// Only save the attributes if we should do so
if(ha->dwFileFlags2 != 0)
// Now we have to check if we need patch bits in the (attributes)
if(nError == ERROR_SUCCESS)
{
// At this point, we expect to have at least one reserved entry in the file table
assert(ha->dwFlags & MPQ_FLAG_ATTRIBUTES_INVALID);
assert(ha->dwReservedFiles >= 1);
// Create the raw data that is to be written to (attributes)
// Note: Blizzard MPQs have entries for (listfile) and (attributes),
// but they are filled empty
pbAttrFile = CreateAttributesFile(ha, &cbAttrFile);
if(pbAttrFile != NULL)
for(i = 0; i < ha->dwFileTableSize; i++)
{
// We expect it to be nonzero size
assert(cbAttrFile != 0);
// Determine the real flags for (attributes)
if(ha->dwFileFlags2 == MPQ_FILE_EXISTS)
ha->dwFileFlags2 = GetDefaultSpecialFileFlags(cbAttrFile, ha->pHeader->wFormatVersion);
// Create the attributes file in the MPQ
nError = SFileAddFile_Init(ha, ATTRIBUTES_NAME,
0,
cbAttrFile,
LANG_NEUTRAL,
ha->dwFileFlags2 | MPQ_FILE_REPLACEEXISTING,
&hf);
// Write the attributes file raw data to it
if(nError == ERROR_SUCCESS)
if(ha->pFileTable[i].dwFlags & MPQ_FILE_PATCH_FILE)
{
// Write the content of the attributes file to the MPQ
nError = SFileAddFile_Write(hf, pbAttrFile, cbAttrFile, MPQ_COMPRESSION_ZLIB);
SFileAddFile_Finish(hf);
ha->dwAttrFlags |= MPQ_ATTRIBUTE_PATCH_BIT;
break;
}
// Free the attributes buffer
STORM_FREE(pbAttrFile);
}
else
{
// If the list file is empty, we assume ERROR_SUCCESS
nError = (cbAttrFile == 0) ? ERROR_SUCCESS : ERROR_NOT_ENOUGH_MEMORY;
}
// If the save process succeeded, we clear the MPQ_FLAG_ATTRIBUTE_INVALID flag
if(nError == ERROR_SUCCESS)
{
ha->dwFlags &= ~MPQ_FLAG_ATTRIBUTES_INVALID;
ha->dwReservedFiles--;
}
}
// If the (attributes) is not in the file table yet,
// we have to increase the final block table size
pFileEntry = GetFileEntryExact(ha, ATTRIBUTES_NAME, LANG_NEUTRAL);
if(pFileEntry != NULL)
{
// If "(attributes)" file exists, and it's set to 0, then remove it
if(ha->dwAttrFlags == 0)
{
FreeFileEntry(ha, pFileEntry);
return ERROR_SUCCESS;
}
}
else
{
// If we don't want to create file atributes, do nothing
if(ha->dwAttrFlags == 0)
return ERROR_SUCCESS;
// Check where the file entry is going to be allocated.
// If at the end of the file table, we have to increment
// the expected size of the (attributes) file.
pFileEntry = FindFreeFileEntry(ha);
if(pFileEntry == ha->pFileTable + ha->dwFileTableSize)
dwFinalBlockTableSize++;
}
// Calculate the size of the attributes file
if(nError == ERROR_SUCCESS)
{
dwFileSize = sizeof(MPQ_ATTRIBUTES_HEADER); // Header
if(ha->dwAttrFlags & MPQ_ATTRIBUTE_CRC32)
dwFileSize += dwFinalBlockTableSize * sizeof(DWORD);
if(ha->dwAttrFlags & MPQ_ATTRIBUTE_FILETIME)
dwFileSize += dwFinalBlockTableSize * sizeof(ULONGLONG);
if(ha->dwAttrFlags & MPQ_ATTRIBUTE_MD5)
dwFileSize += dwFinalBlockTableSize * MD5_DIGEST_SIZE;
if(ha->dwAttrFlags & MPQ_ATTRIBUTE_PATCH_BIT)
dwFileSize += ((dwFinalBlockTableSize - 1)) / 8 + 1;
}
// Determine the flags for (attributes)
if(ha->dwFileFlags2 == 0)
ha->dwFileFlags2 = GetDefaultSpecialFileFlags(ha, dwFileSize);
// Create the attributes file in the MPQ
nError = SFileAddFile_Init(ha, ATTRIBUTES_NAME,
0,
dwFileSize,
LANG_NEUTRAL,
ha->dwFileFlags2 | MPQ_FILE_REPLACEEXISTING,
&hf);
// Write all parts of the (attributes) file
if(nError == ERROR_SUCCESS)
{
assert(ha->dwFileTableSize == dwFinalBlockTableSize);
// Note that we don't know what the new bit (0x08) means.
AttrHeader.dwVersion = BSWAP_INT32_UNSIGNED(100);
AttrHeader.dwFlags = BSWAP_INT32_UNSIGNED((ha->dwAttrFlags & MPQ_ATTRIBUTE_ALL));
dwToWrite = sizeof(MPQ_ATTRIBUTES_HEADER);
nError = SFileAddFile_Write(hf, &AttrHeader, dwToWrite, MPQ_COMPRESSION_ZLIB);
}
// Write the array of CRC32
if(nError == ERROR_SUCCESS && (ha->dwAttrFlags & MPQ_ATTRIBUTE_CRC32))
{
LPDWORD pArrayCRC32 = STORM_ALLOC(DWORD, dwFinalBlockTableSize);
if(pArrayCRC32 != NULL)
{
// Copy from file table
for(i = 0; i < ha->dwFileTableSize; i++)
pArrayCRC32[i] = BSWAP_INT32_UNSIGNED(ha->pFileTable[i].dwCrc32);
dwToWrite = ha->dwFileTableSize * sizeof(DWORD);
nError = SFileAddFile_Write(hf, pArrayCRC32, dwToWrite, MPQ_COMPRESSION_ZLIB);
STORM_FREE(pArrayCRC32);
}
}
// Write the array of file time
if(nError == ERROR_SUCCESS && (ha->dwAttrFlags & MPQ_ATTRIBUTE_FILETIME))
{
ULONGLONG * pArrayFileTime = STORM_ALLOC(ULONGLONG, ha->dwFileTableSize);
if(pArrayFileTime != NULL)
{
// Copy from file table
for(i = 0; i < ha->dwFileTableSize; i++)
pArrayFileTime[i] = BSWAP_INT64_UNSIGNED(ha->pFileTable[i].FileTime);
dwToWrite = ha->dwFileTableSize * sizeof(ULONGLONG);
nError = SFileAddFile_Write(hf, pArrayFileTime, dwToWrite, MPQ_COMPRESSION_ZLIB);
STORM_FREE(pArrayFileTime);
}
}
// Write the array of MD5s
if(nError == ERROR_SUCCESS && (ha->dwAttrFlags & MPQ_ATTRIBUTE_MD5))
{
char * pArrayMD5 = STORM_ALLOC(char, ha->dwFileTableSize * MD5_DIGEST_SIZE);
if(pArrayMD5 != NULL)
{
// Copy from file table
for(i = 0; i < ha->dwFileTableSize; i++)
memcpy(&pArrayMD5[i * MD5_DIGEST_SIZE], ha->pFileTable[i].md5, MD5_DIGEST_SIZE);
dwToWrite = ha->dwFileTableSize * MD5_DIGEST_SIZE;
nError = SFileAddFile_Write(hf, pArrayMD5, dwToWrite, MPQ_COMPRESSION_ZLIB);
STORM_FREE(pArrayMD5);
}
}
// Write the array of patch bits
if(nError == ERROR_SUCCESS && (ha->dwAttrFlags & MPQ_ATTRIBUTE_PATCH_BIT))
{
LPBYTE pbBitArray;
DWORD dwByteSize = ((ha->dwFileTableSize - 1) / 8) + 1;
pbBitArray = STORM_ALLOC(BYTE, dwByteSize);
if(pbBitArray != NULL)
{
memset(pbBitArray, 0, dwByteSize);
for(i = 0; i < ha->dwFileTableSize; i++)
{
DWORD dwByteIndex = i / 8;
DWORD dwBitMask = 0x80 >> (i & 7);
if(ha->pFileTable[i].dwFlags & MPQ_FILE_PATCH_FILE)
pbBitArray[dwByteIndex] |= dwBitMask;
}
nError = SFileAddFile_Write(hf, pbBitArray, dwByteSize, MPQ_COMPRESSION_ZLIB);
STORM_FREE(pbBitArray);
}
}
// Finalize the file in the archive
if(hf != NULL)
{
SFileAddFile_Finish(hf);
}
if(nError == ERROR_SUCCESS)
ha->dwFlags &= ~MPQ_FLAG_INV_ATTRIBUTES;
return nError;
}
@ -479,7 +375,7 @@ DWORD WINAPI SFileGetAttributes(HANDLE hMpq)
TMPQArchive * ha = (TMPQArchive *)hMpq;
// Verify the parameters
if(!IsValidMpqHandle(hMpq))
if(!IsValidMpqHandle(ha))
{
SetLastError(ERROR_INVALID_PARAMETER);
return SFILE_INVALID_ATTRIBUTES;
@ -493,7 +389,7 @@ bool WINAPI SFileSetAttributes(HANDLE hMpq, DWORD dwFlags)
TMPQArchive * ha = (TMPQArchive *)hMpq;
// Verify the parameters
if(!IsValidMpqHandle(hMpq))
if(!IsValidMpqHandle(ha))
{
SetLastError(ERROR_INVALID_PARAMETER);
return false;
@ -538,12 +434,12 @@ bool WINAPI SFileUpdateFileAttributes(HANDLE hMpq, const char * szFileName)
}
// Attempt to open the file
if(!SFileOpenFileEx(hMpq, szFileName, SFILE_OPEN_BASE_FILE, &hFile))
if(!SFileOpenFileEx(hMpq, szFileName, SFILE_OPEN_FROM_MPQ, &hFile))
return false;
// Get the file size
hf = (TMPQFile *)hFile;
dwTotalBytes = hf->pFileEntry->dwFileSize;
SFileGetFileInfo(hFile, SFILE_INFO_FILE_SIZE, &dwTotalBytes, sizeof(DWORD), NULL);
// Initialize the CRC32 and MD5 contexts
md5_init(&md5_state);

View file

@ -7,47 +7,26 @@
/* -------- ---- --- ------- */
/* 14.04.03 1.00 Lad Splitted from SFileCreateArchiveEx.cpp */
/* 19.11.03 1.01 Dan Big endian handling */
/* 21.04.13 1.02 Dea Compact callback now part of TMPQArchive */
/*****************************************************************************/
#define __STORMLIB_SELF__
#include "StormLib.h"
#include "StormCommon.h"
/*****************************************************************************/
/* Local variables */
/*****************************************************************************/
static SFILE_COMPACT_CALLBACK CompactCB = NULL;
static ULONGLONG CompactBytesProcessed = 0;
static ULONGLONG CompactTotalBytes = 0;
static void * pvUserData = NULL;
/*****************************************************************************/
/* Local functions */
/*****************************************************************************/
static int CheckIfAllFilesKnown(TMPQArchive * ha)
{
TFileEntry * pFileTableEnd;
TFileEntry * pFileEntry;
DWORD dwBlockIndex = 0;
int nError = ERROR_SUCCESS;
// Verify the file table
if(nError == ERROR_SUCCESS)
{
pFileTableEnd = ha->pFileTable + ha->dwFileTableSize;
for(pFileEntry = ha->pFileTable; pFileEntry < pFileTableEnd; pFileEntry++, dwBlockIndex++)
{
// If there is an existing entry in the file table, check its name
if(pFileEntry->dwFlags & MPQ_FILE_EXISTS)
{
// The name must be valid and must not be a pseudo-name
if(pFileEntry->szFileName == NULL || IsPseudoFileName(pFileEntry->szFileName, NULL))
{
nError = ERROR_UNKNOWN_FILE_NAMES;
break;
}
}
}
}
return nError;
}
static int CheckIfAllKeysKnown(TMPQArchive * ha, const char * szListFile, LPDWORD pFileKeys)
static int CheckIfAllFilesKnown(TMPQArchive * ha, const char * szListFile, LPDWORD pFileKeys)
{
TFileEntry * pFileTableEnd;
TFileEntry * pFileEntry;
@ -55,11 +34,11 @@ static int CheckIfAllKeysKnown(TMPQArchive * ha, const char * szListFile, LPDWOR
int nError = ERROR_SUCCESS;
// Add the listfile to the MPQ
if(szListFile != NULL)
if(nError == ERROR_SUCCESS && szListFile != NULL)
{
// Notify the user
if(ha->pfnCompactCB != NULL)
ha->pfnCompactCB(ha->pvCompactUserData, CCB_CHECKING_FILES, ha->CompactBytesProcessed, ha->CompactTotalBytes);
if(CompactCB != NULL)
CompactCB(pvUserData, CCB_CHECKING_FILES, CompactBytesProcessed, CompactTotalBytes);
nError = SFileAddListFile((HANDLE)ha, szListFile);
}
@ -70,49 +49,30 @@ static int CheckIfAllKeysKnown(TMPQArchive * ha, const char * szListFile, LPDWOR
pFileTableEnd = ha->pFileTable + ha->dwFileTableSize;
for(pFileEntry = ha->pFileTable; pFileEntry < pFileTableEnd; pFileEntry++, dwBlockIndex++)
{
// If the file exists and it's encrypted
if(pFileEntry->dwFlags & MPQ_FILE_EXISTS)
{
// If we know the name, we decrypt the file key from the file name
if(pFileEntry->szFileName != NULL && !IsPseudoFileName(pFileEntry->szFileName, NULL))
{
// Give the key to the caller
pFileKeys[dwBlockIndex] = DecryptFileKey(pFileEntry->szFileName,
pFileEntry->ByteOffset,
pFileEntry->dwFileSize,
pFileEntry->dwFlags);
continue;
}
/*
// If the file has a nonzero size, we can try to read few bytes of data
// and force to detect the decryption key that way
if(pFileEntry->dwFileSize > 0x10)
{
TMPQFile * hf = NULL;
DWORD dwBytesRead = 0;
DWORD FileData[4];
DWORD dwFileKey = 0;
// Create file handle where we load the sector offset table
hf = CreateFileHandle(ha, pFileEntry);
if(hf != NULL)
// Resolve the file key. Use plain file name for it
if(pFileEntry->dwFlags & MPQ_FILE_ENCRYPTED)
{
// Call one dummy load of the first 4 bytes.
// This enforces loading all buffers and also detecting of the decryption key
SFileReadFile((HANDLE)hf, FileData, sizeof(FileData), &dwBytesRead, NULL);
pFileKeys[dwBlockIndex] = hf->dwFileKey;
FreeFileHandle(hf);
dwFileKey = DecryptFileKey(pFileEntry->szFileName,
pFileEntry->ByteOffset,
pFileEntry->dwFileSize,
pFileEntry->dwFlags);
}
// If we succeeded in reading 16 bytes from the file,
// we also know the encryption key
if(dwBytesRead == sizeof(FileData))
continue;
// Give the key to the caller
if(pFileKeys != NULL)
pFileKeys[dwBlockIndex] = dwFileKey;
}
else
{
nError = ERROR_CAN_NOT_COMPLETE;
break;
}
*/
// We don't know the encryption key of this file,
// thus we cannot compact the file
nError = ERROR_UNKNOWN_FILE_NAMES;
break;
}
}
}
@ -121,11 +81,10 @@ static int CheckIfAllKeysKnown(TMPQArchive * ha, const char * szListFile, LPDWOR
}
static int CopyNonMpqData(
TMPQArchive * ha,
TFileStream * pSrcStream,
TFileStream * pTrgStream,
ULONGLONG & ByteOffset,
ULONGLONG & ByteCount)
TFileStream * pSrcStream,
TFileStream * pTrgStream,
ULONGLONG & ByteOffset,
ULONGLONG & ByteCount)
{
ULONGLONG DataSize = ByteCount;
DWORD dwToRead;
@ -155,10 +114,10 @@ static int CopyNonMpqData(
}
// Update the progress
if(ha->pfnCompactCB != NULL)
if(CompactCB != NULL)
{
ha->CompactBytesProcessed += dwToRead;
ha->pfnCompactCB(ha->pvCompactUserData, CCB_COPYING_NON_MPQ_DATA, ha->CompactBytesProcessed, ha->CompactTotalBytes);
CompactBytesProcessed += dwToRead;
CompactCB(pvUserData, CCB_COPYING_NON_MPQ_DATA, CompactBytesProcessed, CompactTotalBytes);
}
// Decrement the number of data to be copied
@ -166,18 +125,18 @@ static int CopyNonMpqData(
DataSize -= dwToRead;
}
return nError;
return ERROR_SUCCESS;
}
// Copies all file sectors into another archive.
static int CopyMpqFileSectors(
TMPQArchive * ha,
TMPQFile * hf,
TFileStream * pNewStream,
ULONGLONG MpqFilePos) // MPQ file position in the new archive
TMPQArchive * ha,
TMPQFile * hf,
TFileStream * pNewStream)
{
TFileEntry * pFileEntry = hf->pFileEntry;
ULONGLONG RawFilePos; // Used for calculating sector offset in the old MPQ archive
ULONGLONG MpqFilePos; // MPQ file position in the new archive
DWORD dwBytesToCopy = pFileEntry->dwCmpSize;
DWORD dwPatchSize = 0; // Size of patch header
DWORD dwFileKey1 = 0; // File key used for decryption
@ -185,7 +144,11 @@ static int CopyMpqFileSectors(
DWORD dwCmpSize = 0; // Compressed file size, including patch header
int nError = ERROR_SUCCESS;
// Resolve decryption keys. Note that the file key given
// Remember the position in the destination file
FileStream_GetPos(pNewStream, &MpqFilePos);
MpqFilePos -= ha->MpqPos;
// Resolve decryption keys. Note that the file key given
// in the TMPQFile structure also includes the key adjustment
if(nError == ERROR_SUCCESS && (pFileEntry->dwFlags & MPQ_FILE_ENCRYPTED))
{
@ -211,11 +174,11 @@ static int CopyMpqFileSectors(
// If we have to save sector offset table, do it.
if(nError == ERROR_SUCCESS && hf->SectorOffsets != NULL)
{
DWORD * SectorOffsetsCopy = STORM_ALLOC(DWORD, hf->SectorOffsets[0] / sizeof(DWORD));
DWORD * SectorOffsetsCopy = (DWORD *)STORM_ALLOC(BYTE, hf->SectorOffsets[0]);
DWORD dwSectorOffsLen = hf->SectorOffsets[0];
assert((pFileEntry->dwFlags & MPQ_FILE_SINGLE_UNIT) == 0);
assert(pFileEntry->dwFlags & MPQ_FILE_COMPRESS_MASK);
assert(pFileEntry->dwFlags & MPQ_FILE_COMPRESSED);
if(SectorOffsetsCopy == NULL)
nError = ERROR_NOT_ENOUGH_MEMORY;
@ -236,10 +199,10 @@ static int CopyMpqFileSectors(
}
// Update compact progress
if(ha->pfnCompactCB != NULL)
if(CompactCB != NULL)
{
ha->CompactBytesProcessed += dwSectorOffsLen;
ha->pfnCompactCB(ha->pvCompactUserData, CCB_COMPACTING_FILES, ha->CompactBytesProcessed, ha->CompactTotalBytes);
CompactBytesProcessed += dwSectorOffsLen;
CompactCB(pvUserData, CCB_COMPACTING_FILES, CompactBytesProcessed, CompactTotalBytes);
}
STORM_FREE(SectorOffsetsCopy);
@ -267,7 +230,7 @@ static int CopyMpqFileSectors(
// Calculate the raw file offset of the file sector
CalculateRawSectorOffset(RawFilePos, hf, dwRawByteOffset);
// Read the file sector
if(!FileStream_Read(ha->pStream, &RawFilePos, hf->pbFileSector, dwRawDataInSector))
{
@ -276,7 +239,7 @@ static int CopyMpqFileSectors(
}
// If necessary, re-encrypt the sector
// Note: Recompression is not necessary here. Unlike encryption,
// Note: Recompression is not necessary here. Unlike encryption,
// the compression does not depend on the position of the file in MPQ.
if((pFileEntry->dwFlags & MPQ_FILE_ENCRYPTED) && dwFileKey1 != dwFileKey2)
{
@ -294,10 +257,10 @@ static int CopyMpqFileSectors(
}
// Update compact progress
if(ha->pfnCompactCB != NULL)
if(CompactCB != NULL)
{
ha->CompactBytesProcessed += dwRawDataInSector;
ha->pfnCompactCB(ha->pvCompactUserData, CCB_COMPACTING_FILES, ha->CompactBytesProcessed, ha->CompactTotalBytes);
CompactBytesProcessed += dwRawDataInSector;
CompactCB(pvUserData, CCB_COMPACTING_FILES, CompactBytesProcessed, CompactTotalBytes);
}
// Adjust byte counts
@ -322,10 +285,10 @@ static int CopyMpqFileSectors(
nError = GetLastError();
// Update compact progress
if(ha->pfnCompactCB != NULL)
if(CompactCB != NULL)
{
ha->CompactBytesProcessed += dwCrcLength;
ha->pfnCompactCB(ha->pvCompactUserData, CCB_COMPACTING_FILES, ha->CompactBytesProcessed, ha->CompactTotalBytes);
CompactBytesProcessed += dwCrcLength;
CompactCB(pvUserData, CCB_COMPACTING_FILES, CompactBytesProcessed, CompactTotalBytes);
}
// Size of the CRC block is also included in the compressed file size
@ -355,6 +318,7 @@ static int CopyMpqFileSectors(
// Include these extra data in the compressed size
dwCmpSize += dwBytesToCopy;
dwBytesToCopy = 0;
STORM_FREE(pbExtraData);
}
else
@ -364,30 +328,36 @@ static int CopyMpqFileSectors(
// Write the MD5's of the raw file data, if needed
if(nError == ERROR_SUCCESS && ha->pHeader->dwRawChunkSize != 0)
{
nError = WriteMpqDataMD5(pNewStream,
nError = WriteMpqDataMD5(pNewStream,
ha->MpqPos + MpqFilePos,
pFileEntry->dwCmpSize,
ha->pHeader->dwRawChunkSize);
}
// Verify the number of bytes written
// 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 (an unknown archive version, MPQ malformation, ...)
//
// there's something wrong (an unknown archive version, MPQ protection, ...)
//
// Note: Diablo savegames have very weird layout, and the file "hero"
// seems to have improper compressed size. Instead of real compressed size,
// the "dwCmpSize" member of the block table entry contains
// uncompressed size of file data + size of the sector table.
// If we compact the archive, Diablo will refuse to load the game
// Seems like some sort of protection to me.
//
// Note: Some patch files in WOW patches don't count the patch header
// into compressed size
//
if(!(dwCmpSize <= pFileEntry->dwCmpSize && pFileEntry->dwCmpSize <= dwCmpSize + dwPatchSize))
if(dwCmpSize <= pFileEntry->dwCmpSize && pFileEntry->dwCmpSize <= dwCmpSize + dwPatchSize)
{
// Note: DO NOT update the compressed size in the file entry, no matter how bad it is.
pFileEntry->ByteOffset = MpqFilePos;
}
else
{
nError = ERROR_FILE_CORRUPT;
assert(false);
@ -402,7 +372,6 @@ static int CopyMpqFiles(TMPQArchive * ha, LPDWORD pFileKeys, TFileStream * pNewS
TFileEntry * pFileTableEnd = ha->pFileTable + ha->dwFileTableSize;
TFileEntry * pFileEntry;
TMPQFile * hf = NULL;
ULONGLONG MpqFilePos;
int nError = ERROR_SUCCESS;
// Walk through all files and write them to the destination MPQ archive
@ -410,66 +379,63 @@ static int CopyMpqFiles(TMPQArchive * ha, LPDWORD pFileKeys, TFileStream * pNewS
{
// Copy all the file sectors
// Only do that when the file has nonzero size
if((pFileEntry->dwFlags & MPQ_FILE_EXISTS))
if((pFileEntry->dwFlags & MPQ_FILE_EXISTS) && pFileEntry->dwFileSize != 0)
{
// Query the position where the destination file will be
FileStream_GetPos(pNewStream, &MpqFilePos);
MpqFilePos = MpqFilePos - ha->MpqPos;
// Allocate structure for the MPQ file
hf = CreateMpqFile(ha);
if(hf == NULL)
return ERROR_NOT_ENOUGH_MEMORY;
// Perform file copy ONLY if the file has nonzero size
if(pFileEntry->dwFileSize != 0)
// Store file entry
hf->pFileEntry = pFileEntry;
// Set the raw file position
hf->MpqFilePos = pFileEntry->ByteOffset;
hf->RawFilePos = ha->MpqPos + hf->MpqFilePos;
// Set the file decryption key
hf->dwFileKey = pFileKeys[pFileEntry - ha->pFileTable];
hf->dwDataSize = pFileEntry->dwFileSize;
// If the file is a patch file, load the patch header
if(pFileEntry->dwFlags & MPQ_FILE_PATCH_FILE)
{
// Allocate structure for the MPQ file
hf = CreateFileHandle(ha, pFileEntry);
if(hf == NULL)
return ERROR_NOT_ENOUGH_MEMORY;
// Set the file decryption key
hf->dwFileKey = pFileKeys[pFileEntry - ha->pFileTable];
// If the file is a patch file, load the patch header
if(pFileEntry->dwFlags & MPQ_FILE_PATCH_FILE)
{
nError = AllocatePatchInfo(hf, true);
if(nError != ERROR_SUCCESS)
break;
}
// Allocate buffers for file sector and sector offset table
nError = AllocateSectorBuffer(hf);
nError = AllocatePatchInfo(hf, true);
if(nError != ERROR_SUCCESS)
break;
// Also allocate sector offset table and sector checksum table
nError = AllocateSectorOffsets(hf, true);
if(nError != ERROR_SUCCESS)
break;
// Also load sector checksums, if any
if(pFileEntry->dwFlags & MPQ_FILE_SECTOR_CRC)
{
nError = AllocateSectorChecksums(hf, false);
if(nError != ERROR_SUCCESS)
break;
}
// Copy all file sectors
nError = CopyMpqFileSectors(ha, hf, pNewStream, MpqFilePos);
if(nError != ERROR_SUCCESS)
break;
// Free buffers. This also sets "hf" to NULL.
FreeFileHandle(hf);
}
// Note: DO NOT update the compressed size in the file entry, no matter how bad it is.
pFileEntry->ByteOffset = MpqFilePos;
// Allocate buffers for file sector and sector offset table
nError = AllocateSectorBuffer(hf);
if(nError != ERROR_SUCCESS)
break;
// Also allocate sector offset table and sector checksum table
nError = AllocateSectorOffsets(hf, true);
if(nError != ERROR_SUCCESS)
break;
// Also load sector checksums, if any
if(pFileEntry->dwFlags & MPQ_FILE_SECTOR_CRC)
{
nError = AllocateSectorChecksums(hf, false);
if(nError != ERROR_SUCCESS)
break;
}
// Copy all file sectors
nError = CopyMpqFileSectors(ha, hf, pNewStream);
if(nError != ERROR_SUCCESS)
break;
// Free buffers. This also sets "hf" to NULL.
FreeMPQFile(hf);
}
}
// Cleanup and exit
if(hf != NULL)
FreeFileHandle(hf);
FreeMPQFile(hf);
return nError;
}
@ -478,18 +444,10 @@ static int CopyMpqFiles(TMPQArchive * ha, LPDWORD pFileKeys, TFileStream * pNewS
/* Public functions */
/*****************************************************************************/
bool WINAPI SFileSetCompactCallback(HANDLE hMpq, SFILE_COMPACT_CALLBACK pfnCompactCB, void * pvUserData)
bool WINAPI SFileSetCompactCallback(HANDLE /* hMpq */, SFILE_COMPACT_CALLBACK aCompactCB, void * pvData)
{
TMPQArchive * ha = (TMPQArchive *) hMpq;
if (!IsValidMpqHandle(hMpq))
{
SetLastError(ERROR_INVALID_HANDLE);
return false;
}
ha->pfnCompactCB = pfnCompactCB;
ha->pvCompactUserData = pvUserData;
CompactCB = aCompactCB;
pvUserData = pvData;
return true;
}
@ -508,7 +466,7 @@ bool WINAPI SFileCompactArchive(HANDLE hMpq, const char * szListFile, bool /* bR
int nError = ERROR_SUCCESS;
// Test the valid parameters
if(!IsValidMpqHandle(hMpq))
if(!IsValidMpqHandle(ha))
nError = ERROR_INVALID_HANDLE;
if(ha->dwFlags & MPQ_FLAG_READ_ONLY)
nError = ERROR_ACCESS_DENIED;
@ -533,9 +491,9 @@ bool WINAPI SFileCompactArchive(HANDLE hMpq, const char * szListFile, bool /* bR
if(nError == ERROR_SUCCESS)
{
// Initialize the progress variables for compact callback
FileStream_GetSize(ha->pStream, &(ha->CompactTotalBytes));
ha->CompactBytesProcessed = 0;
nError = CheckIfAllKeysKnown(ha, szListFile, pFileKeys);
FileStream_GetSize(ha->pStream, &CompactTotalBytes);
CompactBytesProcessed = 0;
nError = CheckIfAllFilesKnown(ha, szListFile, pFileKeys);
}
// Get the temporary file name and create it
@ -547,7 +505,7 @@ bool WINAPI SFileCompactArchive(HANDLE hMpq, const char * szListFile, bool /* bR
else
_tcscat(szTempFile, _T("_"));
pTempStream = FileStream_CreateFile(szTempFile, STREAM_PROVIDER_FLAT | BASE_PROVIDER_FILE);
pTempStream = FileStream_CreateFile(szTempFile, STREAM_PROVIDER_LINEAR | BASE_PROVIDER_FILE);
if(pTempStream == NULL)
nError = GetLastError();
}
@ -556,12 +514,12 @@ bool WINAPI SFileCompactArchive(HANDLE hMpq, const char * szListFile, bool /* bR
if(nError == ERROR_SUCCESS && ha->UserDataPos != 0)
{
// Inform the application about the progress
if(ha->pfnCompactCB != NULL)
ha->pfnCompactCB(ha->pvCompactUserData, CCB_COPYING_NON_MPQ_DATA, ha->CompactBytesProcessed, ha->CompactTotalBytes);
if(CompactCB != NULL)
CompactCB(pvUserData, CCB_COPYING_NON_MPQ_DATA, CompactBytesProcessed, CompactTotalBytes);
ByteOffset = 0;
ByteCount = ha->UserDataPos;
nError = CopyNonMpqData(ha, ha->pStream, pTempStream, ByteOffset, ByteCount);
nError = CopyNonMpqData(ha->pStream, pTempStream, ByteOffset, ByteCount);
}
// Write the MPQ user data (if any)
@ -575,50 +533,35 @@ bool WINAPI SFileCompactArchive(HANDLE hMpq, const char * szListFile, bool /* bR
assert(ha->pUserData != NULL);
assert(ha->pUserData->dwHeaderOffs == ByteCount);
nError = CopyNonMpqData(ha, ha->pStream, pTempStream, ByteOffset, ByteCount);
nError = CopyNonMpqData(ha->pStream, pTempStream, ByteOffset, ByteCount);
}
// Write the MPQ header
if(nError == ERROR_SUCCESS)
{
TMPQHeader SaveMpqHeader;
// Remember the header size before swapping
DWORD dwBytesToWrite = ha->pHeader->dwHeaderSize;
// Write the MPQ header to the file
memcpy(&SaveMpqHeader, ha->pHeader, ha->pHeader->dwHeaderSize);
BSWAP_TMPQHEADER(&SaveMpqHeader, MPQ_FORMAT_VERSION_1);
BSWAP_TMPQHEADER(&SaveMpqHeader, MPQ_FORMAT_VERSION_2);
BSWAP_TMPQHEADER(&SaveMpqHeader, MPQ_FORMAT_VERSION_3);
BSWAP_TMPQHEADER(&SaveMpqHeader, MPQ_FORMAT_VERSION_4);
if(!FileStream_Write(pTempStream, NULL, &SaveMpqHeader, ha->pHeader->dwHeaderSize))
BSWAP_TMPQHEADER(ha->pHeader);
if(!FileStream_Write(pTempStream, NULL, ha->pHeader, dwBytesToWrite))
nError = GetLastError();
BSWAP_TMPQHEADER(ha->pHeader);
// Update the progress
ha->CompactBytesProcessed += ha->pHeader->dwHeaderSize;
CompactBytesProcessed += ha->pHeader->dwHeaderSize;
}
// Now copy all files
if(nError == ERROR_SUCCESS)
nError = CopyMpqFiles(ha, pFileKeys, pTempStream);
// Defragment the file table
if(nError == ERROR_SUCCESS)
nError = RebuildFileTable(ha, ha->pHeader->dwHashTableSize, ha->dwMaxFileCount);
// We also need to rebuild the HET table, if any
if(nError == ERROR_SUCCESS)
{
// Invalidate (listfile) and (attributes)
InvalidateInternalFiles(ha);
// Rebuild the HET table, if we have any
if(ha->pHetTable != NULL)
nError = RebuildHetTable(ha);
nError = CopyMpqFiles(ha, pFileKeys, pTempStream);
ha->dwFlags |= MPQ_FLAG_CHANGED;
}
// If succeeded, switch the streams
if(nError == ERROR_SUCCESS)
{
if(FileStream_Replace(ha->pStream, pTempStream))
if(FileStream_Switch(ha->pStream, pTempStream))
pTempStream = NULL;
else
nError = ERROR_CAN_NOT_COMPLETE;
@ -630,17 +573,21 @@ bool WINAPI SFileCompactArchive(HANDLE hMpq, const char * szListFile, bool /* bR
//
// Note: We don't recalculate position of the MPQ tables at this point.
// SaveMPQTables does it automatically.
//
//
nError = SaveMPQTables(ha);
if(nError == ERROR_SUCCESS && ha->pfnCompactCB != NULL)
if(nError == ERROR_SUCCESS && CompactCB != NULL)
{
ha->CompactBytesProcessed += (ha->pHeader->dwHashTableSize * sizeof(TMPQHash));
ha->CompactBytesProcessed += (ha->pHeader->dwBlockTableSize * sizeof(TMPQBlock));
ha->pfnCompactCB(ha->pvCompactUserData, CCB_CLOSING_ARCHIVE, ha->CompactBytesProcessed, ha->CompactTotalBytes);
CompactBytesProcessed += (ha->pHeader->dwHashTableSize * sizeof(TMPQHash));
CompactBytesProcessed += (ha->pHeader->dwBlockTableSize * sizeof(TMPQBlock));
CompactCB(pvUserData, CCB_CLOSING_ARCHIVE, CompactBytesProcessed, CompactTotalBytes);
}
}
// Invalidate the compact callback
pvUserData = NULL;
CompactCB = NULL;
// Cleanup and return
if(pTempStream != NULL)
FileStream_Close(pTempStream);
@ -663,48 +610,156 @@ DWORD WINAPI SFileGetMaxFileCount(HANDLE hMpq)
bool WINAPI SFileSetMaxFileCount(HANDLE hMpq, DWORD dwMaxFileCount)
{
TMPQHetTable * pOldHetTable = NULL;
TMPQArchive * ha = (TMPQArchive *)hMpq;
DWORD dwNewHashTableSize = 0;
TFileEntry * pOldFileTableEnd = ha->pFileTable + ha->dwFileTableSize;
TFileEntry * pOldFileTable = NULL;
TFileEntry * pOldFileEntry;
TFileEntry * pFileEntry;
TMPQHash * pOldHashTable = NULL;
DWORD dwOldHashTableSize = 0;
DWORD dwOldFileTableSize = 0;
int nError = ERROR_SUCCESS;
// Test the valid parameters
if(!IsValidMpqHandle(hMpq))
if(!IsValidMpqHandle(ha))
nError = ERROR_INVALID_HANDLE;
if(ha->dwFlags & MPQ_FLAG_READ_ONLY)
nError = ERROR_ACCESS_DENIED;
if(dwMaxFileCount < ha->dwFileTableSize)
// The new limit must not be lower than the index of the last file entry in the table
if(nError == ERROR_SUCCESS && ha->dwFileTableSize > dwMaxFileCount)
nError = ERROR_DISK_FULL;
// ALL file names must be known in order to be able
// to rebuild hash table
// to rebuild hash table size
if(nError == ERROR_SUCCESS)
{
nError = CheckIfAllFilesKnown(ha);
nError = CheckIfAllFilesKnown(ha, NULL, NULL);
}
// If the MPQ has a hash table, then we relocate the hash table
if(nError == ERROR_SUCCESS)
if(nError == ERROR_SUCCESS && ha->pHashTable != NULL)
{
// Calculate the hash table size for the new file limit
dwNewHashTableSize = GetHashTableSizeForFileCount(dwMaxFileCount);
// Save parameters for the current hash table
dwOldHashTableSize = ha->pHeader->dwHashTableSize;
pOldHashTable = ha->pHashTable;
// Rebuild both file tables
nError = RebuildFileTable(ha, dwNewHashTableSize, dwMaxFileCount);
// Allocate new hash table
ha->pHeader->dwHashTableSize = GetHashTableSizeForFileCount(dwMaxFileCount);
ha->pHashTable = STORM_ALLOC(TMPQHash, ha->pHeader->dwHashTableSize);
if(ha->pHashTable != NULL)
memset(ha->pHashTable, 0xFF, ha->pHeader->dwHashTableSize * sizeof(TMPQHash));
else
nError = ERROR_NOT_ENOUGH_MEMORY;
}
// We always have to rebuild the (attributes) file due to file table change
// If the MPQ has HET table, allocate new one as well
if(nError == ERROR_SUCCESS && ha->pHetTable != NULL)
{
// Save the original HET table
pOldHetTable = ha->pHetTable;
// Create new one
ha->pHetTable = CreateHetTable(dwMaxFileCount, 0x40, true);
if(ha->pHetTable == NULL)
nError = ERROR_NOT_ENOUGH_MEMORY;
}
// Now reallocate the file table
if(nError == ERROR_SUCCESS)
{
// Invalidate (listfile) and (attributes)
// Save the current file table
dwOldFileTableSize = ha->dwFileTableSize;
pOldFileTable = ha->pFileTable;
// Create new one
ha->pFileTable = STORM_ALLOC(TFileEntry, dwMaxFileCount);
if(ha->pFileTable != NULL)
memset(ha->pFileTable, 0, dwMaxFileCount * sizeof(TFileEntry));
else
nError = ERROR_NOT_ENOUGH_MEMORY;
}
// Now we have to build both classic hash table and HET table.
if(nError == ERROR_SUCCESS)
{
DWORD dwFileIndex = 0;
DWORD dwHashIndex = 0;
// Create new hash and HET entry for each file
pFileEntry = ha->pFileTable;
for(pOldFileEntry = pOldFileTable; pOldFileEntry < pOldFileTableEnd; pOldFileEntry++)
{
if(pOldFileEntry->dwFlags & MPQ_FILE_EXISTS)
{
// Copy the old file entry to the new one
memcpy(pFileEntry, pOldFileEntry, sizeof(TFileEntry));
assert(pFileEntry->szFileName != NULL);
// Create new entry in the hash table
if(ha->pHashTable != NULL)
{
dwHashIndex = AllocateHashEntry(ha, pFileEntry);
if(dwHashIndex == HASH_ENTRY_FREE)
{
nError = ERROR_CAN_NOT_COMPLETE;
break;
}
}
// Create new entry in the HET table, if needed
if(ha->pHetTable != NULL)
{
dwHashIndex = AllocateHetEntry(ha, pFileEntry);
if(dwHashIndex == HASH_ENTRY_FREE)
{
nError = ERROR_CAN_NOT_COMPLETE;
break;
}
}
// Move to the next file entry in the new table
pFileEntry++;
dwFileIndex++;
}
}
}
// Mark the archive as changed
// Note: We always have to rebuild the (attributes) file due to file table change
if(nError == ERROR_SUCCESS)
{
ha->dwMaxFileCount = dwMaxFileCount;
InvalidateInternalFiles(ha);
}
else
{
// Revert the hash table
if(ha->pHashTable != NULL && pOldHashTable != NULL)
{
STORM_FREE(ha->pHashTable);
ha->pHeader->dwHashTableSize = dwOldHashTableSize;
ha->pHashTable = pOldHashTable;
}
// Rebuild the HET table, if we have any
if(ha->pHetTable != NULL)
nError = RebuildHetTable(ha);
// Revert the HET table
if(ha->pHetTable != NULL && pOldHetTable != NULL)
{
FreeHetTable(ha->pHetTable);
ha->pHetTable = pOldHetTable;
}
// Revert the file table
if(pOldFileTable != NULL)
{
STORM_FREE(ha->pFileTable);
ha->pFileTable = pOldFileTable;
}
SetLastError(nError);
}
// Return the error
if(nError != ERROR_SUCCESS)
SetLastError(nError);
// Return the result
return (nError == ERROR_SUCCESS);
}

View file

@ -56,10 +56,7 @@ static int WriteNakedMPQHeader(TMPQArchive * ha)
Header.wSectorSize = pHeader->wSectorSize;
// Write it to the file
BSWAP_TMPQHEADER(&Header, MPQ_FORMAT_VERSION_1);
BSWAP_TMPQHEADER(&Header, MPQ_FORMAT_VERSION_2);
BSWAP_TMPQHEADER(&Header, MPQ_FORMAT_VERSION_3);
BSWAP_TMPQHEADER(&Header, MPQ_FORMAT_VERSION_4);
BSWAP_TMPQHEADER(&Header);
if(!FileStream_Write(ha->pStream, &ha->MpqPos, &Header, dwBytesToWrite))
nError = GetLastError();
@ -69,32 +66,19 @@ static int WriteNakedMPQHeader(TMPQArchive * ha)
//-----------------------------------------------------------------------------
// Creates a new MPQ archive.
bool WINAPI SFileCreateArchive(const TCHAR * szMpqName, DWORD dwCreateFlags, DWORD dwMaxFileCount, HANDLE * phMpq)
bool WINAPI SFileCreateArchive(const TCHAR * szMpqName, DWORD dwFlags, DWORD dwMaxFileCount, HANDLE * phMpq)
{
SFILE_CREATE_MPQ CreateInfo;
// Fill the create structure
memset(&CreateInfo, 0, sizeof(SFILE_CREATE_MPQ));
CreateInfo.cbSize = sizeof(SFILE_CREATE_MPQ);
CreateInfo.dwMpqVersion = (dwCreateFlags & MPQ_CREATE_ARCHIVE_VMASK) >> FLAGS_TO_FORMAT_SHIFT;
CreateInfo.dwStreamFlags = STREAM_PROVIDER_FLAT | BASE_PROVIDER_FILE;
CreateInfo.dwFileFlags1 = (dwCreateFlags & MPQ_CREATE_LISTFILE) ? MPQ_FILE_EXISTS : 0;
CreateInfo.dwFileFlags2 = (dwCreateFlags & MPQ_CREATE_ATTRIBUTES) ? MPQ_FILE_EXISTS : 0;
CreateInfo.dwFileFlags3 = (dwCreateFlags & MPQ_CREATE_SIGNATURE) ? MPQ_FILE_EXISTS : 0;
CreateInfo.dwAttrFlags = (dwCreateFlags & MPQ_CREATE_ATTRIBUTES) ? (MPQ_ATTRIBUTE_CRC32 | MPQ_ATTRIBUTE_FILETIME | MPQ_ATTRIBUTE_MD5) : 0;
CreateInfo.dwMpqVersion = (dwFlags & MPQ_CREATE_ARCHIVE_VMASK) >> FLAGS_TO_FORMAT_SHIFT;
CreateInfo.dwStreamFlags = STREAM_PROVIDER_LINEAR | BASE_PROVIDER_FILE;
CreateInfo.dwAttrFlags = (dwFlags & MPQ_CREATE_ATTRIBUTES) ? MPQ_ATTRIBUTE_ALL : 0;
CreateInfo.dwSectorSize = (CreateInfo.dwMpqVersion >= MPQ_FORMAT_VERSION_3) ? 0x4000 : 0x1000;
CreateInfo.dwRawChunkSize = (CreateInfo.dwMpqVersion >= MPQ_FORMAT_VERSION_4) ? 0x4000 : 0;
CreateInfo.dwMaxFileCount = dwMaxFileCount;
// Set the proper attribute parts
if((CreateInfo.dwMpqVersion >= MPQ_FORMAT_VERSION_3) && (dwCreateFlags & MPQ_CREATE_ATTRIBUTES))
CreateInfo.dwAttrFlags |= MPQ_ATTRIBUTE_PATCH_BIT;
// Backward compatibility: SFileCreateArchive always used to add (listfile)
// We would break loads of applications if we change that
CreateInfo.dwFileFlags1 = MPQ_FILE_EXISTS;
// Let the main function create the archive
return SFileCreateArchive2(szMpqName, &CreateInfo, phMpq);
}
@ -102,13 +86,11 @@ bool WINAPI SFileCreateArchive2(const TCHAR * szMpqName, PSFILE_CREATE_MPQ pCrea
{
TFileStream * pStream = NULL; // File stream
TMPQArchive * ha = NULL; // MPQ archive handle
TMPQHeader * pHeader;
ULONGLONG MpqPos = 0; // Position of MPQ header in the file
HANDLE hMpq = NULL;
DWORD dwBlockTableSize = 0; // Initial block table size
DWORD dwHashTableSize = 0;
DWORD dwReservedFiles = 0; // Number of reserved file entries
DWORD dwMpqFlags = 0;
DWORD dwMaxFileCount;
int nError = ERROR_SUCCESS;
// Check the parameters, if they are valid
@ -119,12 +101,13 @@ bool WINAPI SFileCreateArchive2(const TCHAR * szMpqName, PSFILE_CREATE_MPQ pCrea
}
// Verify if all variables in SFILE_CREATE_MPQ are correct
if((pCreateInfo->cbSize == 0 || pCreateInfo->cbSize > sizeof(SFILE_CREATE_MPQ)) ||
(pCreateInfo->dwMpqVersion > MPQ_FORMAT_VERSION_4) ||
(pCreateInfo->pvUserData != NULL || pCreateInfo->cbUserData != 0) ||
(pCreateInfo->dwAttrFlags & ~MPQ_ATTRIBUTE_ALL) ||
(pCreateInfo->dwSectorSize & (pCreateInfo->dwSectorSize - 1)) ||
(pCreateInfo->dwRawChunkSize & (pCreateInfo->dwRawChunkSize - 1)))
if((pCreateInfo->cbSize == 0 || pCreateInfo->cbSize > sizeof(SFILE_CREATE_MPQ)) ||
(pCreateInfo->dwMpqVersion > MPQ_FORMAT_VERSION_4) ||
(pCreateInfo->pvUserData != NULL || pCreateInfo->cbUserData != 0) ||
(pCreateInfo->dwAttrFlags & ~MPQ_ATTRIBUTE_ALL) ||
(pCreateInfo->dwSectorSize & (pCreateInfo->dwSectorSize - 1)) ||
(pCreateInfo->dwRawChunkSize & (pCreateInfo->dwRawChunkSize - 1)) ||
(pCreateInfo->dwMaxFileCount < 4))
{
SetLastError(ERROR_INVALID_PARAMETER);
return false;
@ -135,7 +118,7 @@ bool WINAPI SFileCreateArchive2(const TCHAR * szMpqName, PSFILE_CREATE_MPQ pCrea
// We verify if the file already exists and if it's a MPQ archive.
// If yes, we won't allow to overwrite it.
if(SFileOpenArchive(szMpqName, 0, STREAM_PROVIDER_FLAT | BASE_PROVIDER_FILE | MPQ_OPEN_NO_ATTRIBUTES | MPQ_OPEN_NO_LISTFILE, &hMpq))
if(SFileOpenArchive(szMpqName, 0, STREAM_PROVIDER_LINEAR | BASE_PROVIDER_FILE | MPQ_OPEN_NO_ATTRIBUTES | MPQ_OPEN_NO_LISTFILE, &hMpq))
{
SFileCloseArchive(hMpq);
SetLastError(ERROR_ALREADY_EXISTS);
@ -156,29 +139,15 @@ bool WINAPI SFileCreateArchive2(const TCHAR * szMpqName, PSFILE_CREATE_MPQ pCrea
return false;
}
// Increment the maximum amount of files to have space for (listfile)
if(pCreateInfo->dwMaxFileCount && pCreateInfo->dwFileFlags1)
{
dwMpqFlags |= MPQ_FLAG_LISTFILE_INVALID;
dwReservedFiles++;
}
// Increment the maximum amount of files to have space for (attributes)
if(pCreateInfo->dwMaxFileCount && pCreateInfo->dwFileFlags2 && pCreateInfo->dwAttrFlags)
{
dwMpqFlags |= MPQ_FLAG_ATTRIBUTES_INVALID;
dwReservedFiles++;
}
// Increment the maximum amount of files to have space for (signature)
if(pCreateInfo->dwMaxFileCount && pCreateInfo->dwFileFlags3)
{
dwMpqFlags |= MPQ_FLAG_SIGNATURE_INVALID;
dwReservedFiles++;
}
// Increment the maximum amount of files to have space
// for listfile and attributes file
dwMaxFileCount = pCreateInfo->dwMaxFileCount;
if(pCreateInfo->dwAttrFlags != 0)
dwMaxFileCount++;
dwMaxFileCount++;
// If file count is not zero, initialize the hash table size
dwHashTableSize = GetHashTableSizeForFileCount(pCreateInfo->dwMaxFileCount + dwReservedFiles);
dwHashTableSize = GetHashTableSizeForFileCount(dwMaxFileCount);
// Retrieve the file size and round it up to 0x200 bytes
FileStream_GetSize(pStream, &MpqPos);
@ -186,9 +155,9 @@ bool WINAPI SFileCreateArchive2(const TCHAR * szMpqName, PSFILE_CREATE_MPQ pCrea
if(!FileStream_SetSize(pStream, MpqPos))
nError = GetLastError();
#ifdef _DEBUG
#ifdef _DEBUG
// Debug code, used for testing StormLib
// dwBlockTableSize = dwHashTableSize * 2;
// dwBlockTableSize = dwHashTableSize * 2;
#endif
// Create the archive handle
@ -202,21 +171,26 @@ bool WINAPI SFileCreateArchive2(const TCHAR * szMpqName, PSFILE_CREATE_MPQ pCrea
if(nError == ERROR_SUCCESS)
{
memset(ha, 0, sizeof(TMPQArchive));
ha->pfnHashString = HashString;
ha->pStream = pStream;
ha->dwSectorSize = pCreateInfo->dwSectorSize;
ha->UserDataPos = MpqPos;
ha->MpqPos = MpqPos;
ha->pHeader = pHeader = (TMPQHeader *)ha->HeaderData;
ha->dwMaxFileCount = dwHashTableSize;
ha->pHeader = (TMPQHeader *)ha->HeaderData;
ha->dwMaxFileCount = dwMaxFileCount;
ha->dwFileTableSize = 0;
ha->dwReservedFiles = dwReservedFiles;
ha->dwFileFlags1 = pCreateInfo->dwFileFlags1;
ha->dwFileFlags2 = pCreateInfo->dwFileFlags2;
ha->dwFileFlags3 = pCreateInfo->dwFileFlags3 ? MPQ_FILE_EXISTS : 0;
ha->dwFlags = 0;
// Setup the attributes
ha->dwAttrFlags = pCreateInfo->dwAttrFlags;
ha->dwFlags = dwMpqFlags | MPQ_FLAG_CHANGED;
pStream = NULL;
}
// Fill the MPQ header
if(nError == ERROR_SUCCESS)
{
TMPQHeader * pHeader = ha->pHeader;
// Fill the MPQ header
memset(pHeader, 0, sizeof(ha->HeaderData));
@ -237,24 +211,27 @@ bool WINAPI SFileCreateArchive2(const TCHAR * szMpqName, PSFILE_CREATE_MPQ pCrea
// Write the naked MPQ header
nError = WriteNakedMPQHeader(ha);
// Remember that the (listfile) and (attributes) need to be saved
ha->dwFlags |= MPQ_FLAG_CHANGED | MPQ_FLAG_INV_LISTFILE | MPQ_FLAG_INV_ATTRIBUTES;
}
// Create initial HET table, if the caller required an MPQ format 3.0 or newer
if(nError == ERROR_SUCCESS && pCreateInfo->dwMpqVersion >= MPQ_FORMAT_VERSION_3 && pCreateInfo->dwMaxFileCount != 0)
if(nError == ERROR_SUCCESS && pCreateInfo->dwMpqVersion >= MPQ_FORMAT_VERSION_3)
{
ha->pHetTable = CreateHetTable(ha->dwFileTableSize, 0, 0x40, NULL);
ha->pHetTable = CreateHetTable(ha->dwMaxFileCount, 0x40, true);
if(ha->pHetTable == NULL)
nError = ERROR_NOT_ENOUGH_MEMORY;
}
// Create initial hash table
if(nError == ERROR_SUCCESS && dwHashTableSize != 0)
if(nError == ERROR_SUCCESS)
{
nError = CreateHashTable(ha, dwHashTableSize);
}
// Create initial file table
if(nError == ERROR_SUCCESS && ha->dwMaxFileCount != 0)
if(nError == ERROR_SUCCESS)
{
ha->pFileTable = STORM_ALLOC(TFileEntry, ha->dwMaxFileCount);
if(ha->pFileTable != NULL)
@ -267,11 +244,11 @@ bool WINAPI SFileCreateArchive2(const TCHAR * szMpqName, PSFILE_CREATE_MPQ pCrea
if(nError != ERROR_SUCCESS)
{
FileStream_Close(pStream);
FreeArchiveHandle(ha);
FreeMPQArchive(ha);
SetLastError(nError);
ha = NULL;
}
// Return the values
*phMpq = (HANDLE)ha;
return (nError == ERROR_SUCCESS);

View file

@ -28,7 +28,7 @@ bool WINAPI SFileExtractFile(HANDLE hMpq, const char * szToExtract, const TCHAR
// Create the local file
if(nError == ERROR_SUCCESS)
{
pLocalFile = FileStream_CreateFile(szExtracted, 0);
pLocalFile = FileStream_CreateFile(szExtracted, STREAM_PROVIDER_LINEAR | BASE_PROVIDER_FILE);
if(pLocalFile == NULL)
nError = GetLastError();
}

View file

@ -37,14 +37,12 @@ struct TMPQSearch
//-----------------------------------------------------------------------------
// Local functions
static TMPQSearch * IsValidSearchHandle(HANDLE hFind)
static bool IsValidSearchHandle(TMPQSearch * hs)
{
TMPQSearch * hs = (TMPQSearch *)hFind;
if(hs == NULL)
return false;
if(hs != NULL && IsValidMpqHandle(hs->ha))
return hs;
return NULL;
return IsValidMpqHandle(hs->ha);
}
bool CheckWildCard(const char * szString, const char * szWildCard)
@ -71,7 +69,7 @@ bool CheckWildCard(const char * szString, const char * szWildCard)
szString++;
}
// If there is '*', means zero or more chars. We have to
// If there is '*', means zero or more chars. We have to
// find the sequence after '*'
if(*szWildCard == '*')
{
@ -97,7 +95,7 @@ bool CheckWildCard(const char * szString, const char * szWildCard)
// Calculate match count
while(nMatchCount < nSubStringLength)
{
if(AsciiToUpperTable[(BYTE)szString[nMatchCount]] != AsciiToUpperTable[(BYTE)szWildCard[nMatchCount]])
if(toupper(szString[nMatchCount]) != toupper(szWildCard[nMatchCount]))
break;
if(szString[nMatchCount] == 0)
break;
@ -120,7 +118,7 @@ bool CheckWildCard(const char * szString, const char * szWildCard)
else
{
// If we came to the end of the string, compare it to the wildcard
if(AsciiToUpperTable[(BYTE)*szString] != AsciiToUpperTable[(BYTE)*szWildCard])
if(toupper(*szString) != toupper(*szWildCard))
return false;
// If we arrived to the end of the string, it's a match
@ -142,7 +140,7 @@ static DWORD GetSearchTableItems(TMPQArchive * ha)
while(ha != NULL)
{
// Append the number of files
dwMergeItems += (ha->pHetTable != NULL) ? ha->pHetTable->dwEntryCount
dwMergeItems += (ha->pHetTable != NULL) ? ha->pHetTable->dwMaxFileCount
: ha->pHeader->dwBlockTableSize;
// Move to the patched archive
ha = ha->haPatch;
@ -153,9 +151,9 @@ static DWORD GetSearchTableItems(TMPQArchive * ha)
}
static bool FileWasFoundBefore(
TMPQArchive * ha,
TMPQSearch * hs,
TFileEntry * pFileEntry)
TMPQArchive * ha,
TMPQSearch * hs,
TFileEntry * pFileEntry)
{
TFileEntry * pEntry;
char * szRealFileName = pFileEntry->szFileName;
@ -167,14 +165,14 @@ static bool FileWasFoundBefore(
{
// If we are in patch MPQ, we check if patch prefix matches
// and then trim the patch prefix
if(ha->pPatchPrefix != NULL)
if(ha->cchPatchPrefix != 0)
{
// If the patch prefix doesn't fit, we pretend that the file
// was there before and it will be skipped
if(_strnicmp(szRealFileName, ha->pPatchPrefix->szPatchPrefix, ha->pPatchPrefix->nLength))
if(_strnicmp(szRealFileName, ha->szPatchPrefix, ha->cchPatchPrefix))
return true;
szRealFileName += ha->pPatchPrefix->nLength;
szRealFileName += ha->cchPatchPrefix;
}
// Calculate the hash to the table
@ -213,14 +211,6 @@ static bool FileWasFoundBefore(
return false;
}
static inline bool FileEntryIsInvalid(
TMPQArchive * ha,
TFileEntry * pFileEntry)
{
// Spazzler3 protector: Some files are clearly wrong
return ((ha->dwFlags & MPQ_FLAG_MALFORMED) && (pFileEntry->dwCmpSize & 0xFFFF0000) >= 0x7FFF0000);
}
static TFileEntry * FindPatchEntry(TMPQArchive * ha, TFileEntry * pFileEntry)
{
TFileEntry * pPatchEntry = NULL;
@ -233,11 +223,9 @@ static TFileEntry * FindPatchEntry(TMPQArchive * ha, TFileEntry * pFileEntry)
{
// Move to the patch archive
ha = ha->haPatch;
szFileName[0] = 0;
// Prepare the prefix for the file name
if(ha->pPatchPrefix != NULL)
strcpy(szFileName, ha->pPatchPrefix->szPatchPrefix);
strcpy(szFileName, ha->szPatchPrefix);
strcat(szFileName, pFileEntry->szFileName);
// Try to find the file there
@ -271,7 +259,7 @@ static int DoMPQSearch(TMPQSearch * hs, SFILE_FIND_DATA * lpFindFileData)
pFileEntry = ha->pFileTable + hs->dwNextIndex;
// Get the length of the patch prefix (0 if none)
nPrefixLength = (ha->pPatchPrefix != NULL) ? ha->pPatchPrefix->nLength : 0;
nPrefixLength = strlen(ha->szPatchPrefix);
// Parse the file table
while(pFileEntry < pFileTableEnd)
@ -279,77 +267,61 @@ static int DoMPQSearch(TMPQSearch * hs, SFILE_FIND_DATA * lpFindFileData)
// Increment the next index for subsequent search
hs->dwNextIndex++;
// Is it a file but not a patch file?
// Is it a file and not a patch file?
if((pFileEntry->dwFlags & hs->dwFlagMask) == MPQ_FILE_EXISTS)
{
// Spazzler3 protector: Some files are clearly wrong
if(!FileEntryIsInvalid(ha, pFileEntry))
{
// Now we have to check if this file was not enumerated before
if(!FileWasFoundBefore(ha, hs, pFileEntry))
// Now we have to check if this file was not enumerated before
if(!FileWasFoundBefore(ha, hs, pFileEntry))
{
// Find a patch to this file
pPatchEntry = FindPatchEntry(ha, pFileEntry);
if(pPatchEntry == NULL)
pPatchEntry = pFileEntry;
// Prepare the block index
dwBlockIndex = (DWORD)(pFileEntry - ha->pFileTable);
// Get the file name. If it's not known, we will create pseudo-name
szFileName = pFileEntry->szFileName;
if(szFileName == NULL)
{
// if(pFileEntry != NULL && !_stricmp(pFileEntry->szFileName, "TriggerLibs\\NativeLib.galaxy"))
// DebugBreak();
// Find a patch to this file
pPatchEntry = FindPatchEntry(ha, pFileEntry);
if(pPatchEntry == NULL)
pPatchEntry = pFileEntry;
// Prepare the block index
dwBlockIndex = (DWORD)(pFileEntry - ha->pFileTable);
// Get the file name. If it's not known, we will create pseudo-name
szFileName = pFileEntry->szFileName;
if(szFileName == NULL)
// Open the file by its pseudo-name.
// This also generates the file name with a proper extension
sprintf(szPseudoName, "File%08u.xxx", dwBlockIndex);
if(SFileOpenFileEx((HANDLE)hs->ha, szPseudoName, SFILE_OPEN_FROM_MPQ, &hFile))
{
// Open the file by its pseudo-name.
// This also generates the file name with a proper extension
sprintf(szPseudoName, "File%08u.xxx", (unsigned int)dwBlockIndex);
if(SFileOpenFileEx((HANDLE)hs->ha, szPseudoName, SFILE_OPEN_BASE_FILE, &hFile))
{
szFileName = (pFileEntry->szFileName != NULL) ? pFileEntry->szFileName : szPseudoName;
SFileCloseFile(hFile);
}
}
// If the file name is still NULL, we cannot include the file to search results
if(szFileName != NULL)
{
// Check the file name against the wildcard
if(CheckWildCard(szFileName + nPrefixLength, hs->szSearchMask))
{
// Fill the found entry. hash entry and block index are taken from the base MPQ
lpFindFileData->dwHashIndex = pFileEntry->dwHashIndex;
lpFindFileData->dwBlockIndex = dwBlockIndex;
lpFindFileData->dwFileSize = pPatchEntry->dwFileSize;
lpFindFileData->dwFileFlags = pPatchEntry->dwFlags;
lpFindFileData->dwCompSize = pPatchEntry->dwCmpSize;
lpFindFileData->lcLocale = pPatchEntry->lcLocale;
// Fill the filetime
lpFindFileData->dwFileTimeHi = (DWORD)(pPatchEntry->FileTime >> 32);
lpFindFileData->dwFileTimeLo = (DWORD)(pPatchEntry->FileTime);
// Fill the file name and plain file name
strcpy(lpFindFileData->cFileName, szFileName + nPrefixLength);
lpFindFileData->szPlainName = (char *)GetPlainFileName(lpFindFileData->cFileName);
return ERROR_SUCCESS;
}
szFileName = (pFileEntry->szFileName != NULL) ? pFileEntry->szFileName : szPseudoName;
SFileCloseFile(hFile);
}
}
// Check the file name against the wildcard
if(CheckWildCard(szFileName + nPrefixLength, hs->szSearchMask))
{
// Fill the found entry
lpFindFileData->dwHashIndex = pPatchEntry->dwHashIndex;
lpFindFileData->dwBlockIndex = dwBlockIndex;
lpFindFileData->dwFileSize = pPatchEntry->dwFileSize;
lpFindFileData->dwFileFlags = pPatchEntry->dwFlags;
lpFindFileData->dwCompSize = pPatchEntry->dwCmpSize;
lpFindFileData->lcLocale = pPatchEntry->lcLocale;
// Fill the filetime
lpFindFileData->dwFileTimeHi = (DWORD)(pPatchEntry->FileTime >> 32);
lpFindFileData->dwFileTimeLo = (DWORD)(pPatchEntry->FileTime);
// Fill the file name and plain file name
strcpy(lpFindFileData->cFileName, szFileName + nPrefixLength);
lpFindFileData->szPlainName = (char *)GetPlainFileNameA(lpFindFileData->cFileName);
return ERROR_SUCCESS;
}
}
}
pFileEntry++;
}
// If there is no more patches in the chain, stop it.
// This also keeps hs->ha non-NULL, which is required
// for freeing the handle later
if(ha->haPatch == NULL)
break;
// Move to the next patch in the patch chain
hs->ha = ha = ha->haPatch;
hs->dwNextIndex = 0;
@ -381,7 +353,7 @@ HANDLE WINAPI SFileFindFirstFile(HANDLE hMpq, const char * szMask, SFILE_FIND_DA
int nError = ERROR_SUCCESS;
// Check for the valid parameters
if(!IsValidMpqHandle(hMpq))
if(!IsValidMpqHandle(ha))
nError = ERROR_INVALID_HANDLE;
if(szMask == NULL || lpFindFileData == NULL)
nError = ERROR_INVALID_PARAMETER;
@ -434,18 +406,18 @@ HANDLE WINAPI SFileFindFirstFile(HANDLE hMpq, const char * szMask, SFILE_FIND_DA
FreeMPQSearch(hs);
SetLastError(nError);
}
// Return the result value
return (HANDLE)hs;
}
bool WINAPI SFileFindNextFile(HANDLE hFind, SFILE_FIND_DATA * lpFindFileData)
{
TMPQSearch * hs = IsValidSearchHandle(hFind);
TMPQSearch * hs = (TMPQSearch *)hFind;
int nError = ERROR_SUCCESS;
// Check the parameters
if(hs == NULL)
if(!IsValidSearchHandle(hs))
nError = ERROR_INVALID_HANDLE;
if(lpFindFileData == NULL)
nError = ERROR_INVALID_PARAMETER;
@ -460,10 +432,10 @@ bool WINAPI SFileFindNextFile(HANDLE hFind, SFILE_FIND_DATA * lpFindFileData)
bool WINAPI SFileFindClose(HANDLE hFind)
{
TMPQSearch * hs = IsValidSearchHandle(hFind);
TMPQSearch * hs = (TMPQSearch *)hFind;
// Check the parameters
if(hs == NULL)
if(!IsValidSearchHandle(hs))
{
SetLastError(ERROR_INVALID_HANDLE);
return false;

File diff suppressed because it is too large Load diff

View file

@ -21,85 +21,85 @@
struct TListFileCache
{
HANDLE hFile; // Stormlib file handle
char * szMask; // Self-relative pointer to file mask
char * szMask; // File mask
DWORD dwFileSize; // Total size of the cached file
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[CACHE_BUFFER_SIZE];
// char MaskBuff[1] // Followed by the name mask (if any)
BYTE Buffer[CACHE_BUFFER_SIZE]; // Listfile cache itself
};
//-----------------------------------------------------------------------------
// Local functions (cache)
static char * CopyListLine(char * szListLine, const char * szFileName)
{
// Copy the string
while(szFileName[0] != 0)
*szListLine++ = *szFileName++;
// Append the end-of-line
*szListLine++ = 0x0D;
*szListLine++ = 0x0A;
return szListLine;
}
static bool FreeListFileCache(TListFileCache * pCache)
{
// Valid parameter check
if(pCache != NULL)
STORM_FREE(pCache);
if(pCache == NULL)
return false;
// Free all allocated buffers
if(pCache->hFile != NULL)
SFileCloseFile(pCache->hFile);
if(pCache->szMask != NULL)
STORM_FREE(pCache->szMask);
STORM_FREE(pCache);
return true;
}
static TListFileCache * CreateListFileCache(HANDLE hListFile, const char * szMask)
{
TListFileCache * pCache = NULL;
size_t nMaskLength = 0;
DWORD dwBytesRead = 0;
DWORD dwFileSize;
// Get the amount of bytes that need to be allocated
dwFileSize = SFileGetFileSize(hListFile, NULL);
if(dwFileSize == 0)
return NULL;
// Append buffer for name mask, if any
if(szMask != NULL)
nMaskLength = strlen(szMask) + 1;
int nError = ERROR_SUCCESS;
// Allocate cache for one file block
pCache = (TListFileCache *)STORM_ALLOC(BYTE, sizeof(TListFileCache) + nMaskLength);
if(pCache != NULL)
{
// Clear the entire structure
memset(pCache, 0, sizeof(TListFileCache) + nMaskLength);
pCache = (TListFileCache *)STORM_ALLOC(TListFileCache, 1);
if(pCache == NULL)
nError = ERROR_NOT_ENOUGH_MEMORY;
// Shall we copy the mask?
// Clear the entire structure
if(nError == ERROR_SUCCESS)
{
memset(pCache, 0, sizeof(TListFileCache));
pCache->hFile = hListFile;
// Shall we allocate a mask?
if(szMask != NULL)
{
pCache->szMask = (char *)(pCache + 1);
memcpy(pCache->szMask, szMask, nMaskLength);
pCache->szMask = STORM_ALLOC(char, strlen(szMask) + 1);
if(pCache->szMask != NULL)
strcpy(pCache->szMask, szMask);
else
nError = ERROR_NOT_ENOUGH_MEMORY;
}
}
// Load the file cache from the file
SFileReadFile(hListFile, pCache->Buffer, CACHE_BUFFER_SIZE, &dwBytesRead, NULL);
if(dwBytesRead != 0)
{
// Allocate pointers
pCache->pBegin = pCache->pPos = &pCache->Buffer[0];
pCache->pEnd = pCache->pBegin + dwBytesRead;
pCache->dwFileSize = dwFileSize;
pCache->hFile = hListFile;
}
else
{
FreeListFileCache(pCache);
pCache = NULL;
}
// Initialize the file cache
if(nError == ERROR_SUCCESS)
{
pCache->dwFileSize = SFileGetFileSize(pCache->hFile, NULL);
// Fill the cache
SFileReadFile(pCache->hFile, pCache->Buffer, CACHE_BUFFER_SIZE, &dwBytesRead, NULL);
if(dwBytesRead == 0)
nError = GetLastError();
}
// Allocate pointers
if(nError == ERROR_SUCCESS)
{
pCache->pBegin =
pCache->pPos = &pCache->Buffer[0];
pCache->pEnd = pCache->pBegin + dwBytesRead;
}
else
{
FreeListFileCache(pCache);
SetLastError(nError);
pCache = NULL;
}
// Return the cache
@ -116,6 +116,8 @@ static DWORD ReloadListFileCache(TListFileCache * pCache)
// Only do something if the cache is empty
if(pCache->pPos >= pCache->pEnd)
{
// __TryReadBlock:
// Move the file position forward
pCache->dwFilePos += CACHE_BUFFER_SIZE;
if(pCache->dwFilePos >= pCache->dwFileSize)
@ -128,7 +130,7 @@ static DWORD ReloadListFileCache(TListFileCache * pCache)
// Load the next data chunk to the cache
SFileSetFilePointer(pCache->hFile, pCache->dwFilePos, NULL, FILE_BEGIN);
SFileReadFile(pCache->hFile, pCache->Buffer, dwBytesToRead, &dwBytesRead, NULL);
SFileReadFile(pCache->hFile, pCache->Buffer, CACHE_BUFFER_SIZE, &dwBytesRead, NULL);
// If we didn't read anything, it might mean that the block
// of the file is not available (in case of partial MPQs).
@ -139,7 +141,7 @@ static DWORD ReloadListFileCache(TListFileCache * pCache)
// Set the buffer pointers
pCache->pBegin =
pCache->pPos = &pCache->Buffer[0];
pCache->pPos = &pCache->Buffer[0];
pCache->pEnd = pCache->pBegin + dwBytesRead;
}
@ -151,7 +153,7 @@ static size_t ReadListFileLine(TListFileCache * pCache, char * szLine, int nMaxC
char * szLineBegin = szLine;
char * szLineEnd = szLine + nMaxChars - 1;
char * szExtraString = NULL;
// Skip newlines, spaces, tabs and another non-printable stuff
for(;;)
{
@ -189,10 +191,6 @@ static size_t ReadListFileLine(TListFileCache * pCache, char * szLine, int nMaxC
if(*pCache->pPos == '~')
szExtraString = szLine;
// Remember that last occurence of a slash or backslash
// if(*pCache->pPos == '\\' || *pCache->pPos == '/')
// szPlainName = szLine + 1;
// Copy the character
*szLine++ = *pCache->pPos++;
}
@ -214,7 +212,7 @@ static size_t ReadListFileLine(TListFileCache * pCache, char * szLine, int nMaxC
return (szLine - szLineBegin);
}
static int CompareFileNodes(const void * p1, const void * p2)
static int CompareFileNodes(const void * p1, const void * p2)
{
char * szFileName1 = *(char **)p1;
char * szFileName2 = *(char **)p2;
@ -222,91 +220,19 @@ static int CompareFileNodes(const void * p1, const void * p2)
return _stricmp(szFileName1, szFileName2);
}
static LPBYTE CreateListFile(TMPQArchive * ha, DWORD * pcbListFile)
static int WriteListFileLine(
TMPQFile * hf,
const char * szLine)
{
TFileEntry * pFileTableEnd = ha->pFileTable + ha->dwFileTableSize;
TFileEntry * pFileEntry;
char ** SortTable = NULL;
char * szListFile = NULL;
char * szListLine;
size_t nFileNodes = 0;
size_t cbListFile = 0;
size_t nIndex0;
size_t nIndex1;
char szNewLine[2] = {0x0D, 0x0A};
size_t nLength = strlen(szLine);
int nError;
// Allocate the table for sorting listfile
SortTable = STORM_ALLOC(char*, ha->dwFileTableSize);
if(SortTable == NULL)
return NULL;
nError = SFileAddFile_Write(hf, szLine, (DWORD)nLength, MPQ_COMPRESSION_ZLIB);
if(nError != ERROR_SUCCESS)
return nError;
// Construct the sort table
// Note: in MPQs with multiple locale versions of the same file,
// this code causes adding multiple listfile entries.
// They will get removed after the listfile sorting
for(pFileEntry = ha->pFileTable; pFileEntry < pFileTableEnd; pFileEntry++)
{
// Only take existing items
if((pFileEntry->dwFlags & MPQ_FILE_EXISTS) && pFileEntry->szFileName != NULL)
{
// Ignore pseudo-names and internal names
if(!IsPseudoFileName(pFileEntry->szFileName, NULL) && !IsInternalMpqFileName(pFileEntry->szFileName))
{
SortTable[nFileNodes++] = pFileEntry->szFileName;
}
}
}
// Remove duplicities
if(nFileNodes > 0)
{
// Sort the table
qsort(SortTable, nFileNodes, sizeof(char *), CompareFileNodes);
// Count the 0-th item
cbListFile += strlen(SortTable[0]) + 2;
// Walk through the items and only use the ones that are not duplicated
for(nIndex0 = 0, nIndex1 = 1; nIndex1 < nFileNodes; nIndex1++)
{
// If the next file node is different, we will include it to the result listfile
if(_stricmp(SortTable[nIndex1], SortTable[nIndex0]) != 0)
{
cbListFile += strlen(SortTable[nIndex1]) + 2;
nIndex0 = nIndex1;
}
}
// Now allocate buffer for the entire listfile
szListFile = szListLine = STORM_ALLOC(char, cbListFile + 1);
if(szListFile != NULL)
{
// Copy the 0-th item
szListLine = CopyListLine(szListLine, SortTable[0]);
// Walk through the items and only use the ones that are not duplicated
for(nIndex0 = 0, nIndex1 = 1; nIndex1 < nFileNodes; nIndex1++)
{
// If the next file node is different, we will include it to the result listfile
if(_stricmp(SortTable[nIndex1], SortTable[nIndex0]) != 0)
{
// Copy the listfile line
szListLine = CopyListLine(szListLine, SortTable[nIndex1]);
nIndex0 = nIndex1;
}
}
// Sanity check - does the size match?
assert((size_t)(szListLine - szListFile) == cbListFile);
}
}
// Free the sort table
STORM_FREE(SortTable);
// Give away the listfile
if(pcbListFile != NULL)
*pcbListFile = (DWORD)cbListFile;
return (LPBYTE)szListFile;
return SFileAddFile_Write(hf, szNewLine, sizeof(szNewLine), MPQ_COMPRESSION_ZLIB);
}
//-----------------------------------------------------------------------------
@ -321,6 +247,7 @@ static int SListFileCreateNodeForAllLocales(TMPQArchive * ha, const char * szFil
TFileEntry * pFileEntry;
TMPQHash * pFirstHash;
TMPQHash * pHash;
bool bNameEntryCreated = false;
// If we have HET table, use that one
if(ha->pHetTable != NULL)
@ -329,14 +256,15 @@ static int SListFileCreateNodeForAllLocales(TMPQArchive * ha, const char * szFil
if(pFileEntry != NULL)
{
// Allocate file name for the file entry
AllocateFileName(ha, pFileEntry, szFileName);
AllocateFileName(pFileEntry, szFileName);
bNameEntryCreated = true;
}
return ERROR_SUCCESS;
}
// If we have hash table, we use it
if(ha->pHashTable != NULL)
if(bNameEntryCreated == false && ha->pHashTable != NULL)
{
// Look for the first hash table entry for the file
pFirstHash = pHash = GetFirstHashEntry(ha, szFileName);
@ -348,7 +276,8 @@ static int SListFileCreateNodeForAllLocales(TMPQArchive * ha, const char * szFil
if(pHash->dwBlockIndex < pHeader->dwBlockTableSize)
{
// Allocate file name for the file entry
AllocateFileName(ha, ha->pFileTable + pHash->dwBlockIndex, szFileName);
AllocateFileName(ha->pFileTable + pHash->dwBlockIndex, szFileName);
bNameEntryCreated = true;
}
// Now find the next language version of the file
@ -359,68 +288,123 @@ static int SListFileCreateNodeForAllLocales(TMPQArchive * ha, const char * szFil
return ERROR_CAN_NOT_COMPLETE;
}
// Saves the whole listfile to the MPQ
// Saves the whole listfile into the MPQ.
int SListFileSaveToMpq(TMPQArchive * ha)
{
TFileEntry * pFileTableEnd = ha->pFileTable + ha->dwFileTableSize;
TFileEntry * pFileEntry;
TMPQFile * hf = NULL;
LPBYTE pbListFile;
DWORD cbListFile = 0;
char * szPrevItem;
char ** SortTable = NULL;
DWORD dwFileSize = 0;
size_t nFileNodes = 0;
size_t i;
int nError = ERROR_SUCCESS;
// Only save the listfile if we should do so
if(ha->dwFileFlags1 != 0)
// Allocate the table for sorting listfile
SortTable = STORM_ALLOC(char*, ha->dwFileTableSize);
if(SortTable == NULL)
return ERROR_NOT_ENOUGH_MEMORY;
// Construct the sort table
// Note: in MPQs with multiple locale versions of the same file,
// this code causes adding multiple listfile entries.
// Since those MPQs were last time used in Starcraft,
// we leave it as it is.
for(pFileEntry = ha->pFileTable; pFileEntry < pFileTableEnd; pFileEntry++)
{
// At this point, we expect to have at least one reserved entry in the file table
assert(ha->dwFlags & MPQ_FLAG_LISTFILE_INVALID);
assert(ha->dwReservedFiles >= 1);
// Create the raw data that is to be written to (listfile)
// Note: Creating the raw data before the (listfile) has been created in the MPQ
// causes that the name of the listfile will not be included in the listfile itself.
// That is OK, because (listfile) in Blizzard MPQs does not contain it either.
pbListFile = CreateListFile(ha, &cbListFile);
if(pbListFile != NULL)
// Only take existing items
if((pFileEntry->dwFlags & MPQ_FILE_EXISTS) && pFileEntry->szFileName != NULL)
{
// We expect it to be nonzero size
assert(cbListFile != 0);
// Determine the real flags for (listfile)
if(ha->dwFileFlags1 == MPQ_FILE_EXISTS)
ha->dwFileFlags1 = GetDefaultSpecialFileFlags(cbListFile, ha->pHeader->wFormatVersion);
// Create the listfile in the MPQ
nError = SFileAddFile_Init(ha, LISTFILE_NAME,
0,
cbListFile,
LANG_NEUTRAL,
ha->dwFileFlags1 | MPQ_FILE_REPLACEEXISTING,
&hf);
// Write the listfile raw data to it
if(nError == ERROR_SUCCESS)
// Ignore pseudo-names
if(!IsPseudoFileName(pFileEntry->szFileName, NULL) && !IsInternalMpqFileName(pFileEntry->szFileName))
{
// Write the content of the listfile to the MPQ
nError = SFileAddFile_Write(hf, pbListFile, cbListFile, MPQ_COMPRESSION_ZLIB);
SFileAddFile_Finish(hf);
SortTable[nFileNodes++] = pFileEntry->szFileName;
}
// Free the listfile buffer
STORM_FREE(pbListFile);
}
else
{
// If the list file is empty, we assume ERROR_SUCCESS
nError = (cbListFile == 0) ? ERROR_SUCCESS : ERROR_NOT_ENOUGH_MEMORY;
}
// If the save process succeeded, we clear the MPQ_FLAG_LISTFILE_INVALID flag
if(nError == ERROR_SUCCESS)
{
ha->dwFlags &= ~MPQ_FLAG_LISTFILE_INVALID;
ha->dwReservedFiles--;
}
}
// Sort the table
qsort(SortTable, nFileNodes, sizeof(char *), CompareFileNodes);
// Now parse the table of file names again - remove duplicates
// and count file size.
if(nFileNodes != 0)
{
// Count the 0-th item
dwFileSize += (DWORD)strlen(SortTable[0]) + 2;
szPrevItem = SortTable[0];
// Count all next items
for(i = 1; i < nFileNodes; i++)
{
// If the item is the same like the last one, skip it
if(_stricmp(SortTable[i], szPrevItem))
{
dwFileSize += (DWORD)strlen(SortTable[i]) + 2;
szPrevItem = SortTable[i];
}
}
// Determine the flags for (listfile)
if(ha->dwFileFlags1 == 0)
ha->dwFileFlags1 = GetDefaultSpecialFileFlags(ha, dwFileSize);
// Create the listfile in the MPQ
nError = SFileAddFile_Init(ha, LISTFILE_NAME,
0,
dwFileSize,
LANG_NEUTRAL,
ha->dwFileFlags1 | MPQ_FILE_REPLACEEXISTING,
&hf);
// Add all file names
if(nError == ERROR_SUCCESS)
{
// Each name is followed by newline ("\x0D\x0A")
szPrevItem = SortTable[0];
nError = WriteListFileLine(hf, SortTable[0]);
// Count all next items
for(i = 1; i < nFileNodes; i++)
{
// If the item is the same like the last one, skip it
if(_stricmp(SortTable[i], szPrevItem))
{
WriteListFileLine(hf, SortTable[i]);
szPrevItem = SortTable[i];
}
}
}
}
else
{
// Create the listfile in the MPQ
dwFileSize = (DWORD)strlen(LISTFILE_NAME) + 2;
nError = SFileAddFile_Init(ha, LISTFILE_NAME,
0,
dwFileSize,
LANG_NEUTRAL,
MPQ_FILE_ENCRYPTED | MPQ_FILE_COMPRESS | MPQ_FILE_REPLACEEXISTING,
&hf);
// Just add "(listfile)" there
if(nError == ERROR_SUCCESS)
{
WriteListFileLine(hf, LISTFILE_NAME);
}
}
// Finalize the file in the MPQ
if(hf != NULL)
{
SFileAddFile_Finish(hf);
}
// Free buffers
if(nError == ERROR_SUCCESS)
ha->dwFlags &= ~MPQ_FLAG_INV_LISTFILE;
if(SortTable != NULL)
STORM_FREE(SortTable);
return nError;
}
@ -431,20 +415,25 @@ static int SFileAddArbitraryListFile(
TListFileCache * pCache = NULL;
size_t nLength;
char szFileName[MAX_PATH];
int nError = ERROR_SUCCESS;
// Create the listfile cache for that file
pCache = CreateListFileCache(hListFile, NULL);
if(pCache != NULL)
if(pCache == NULL)
nError = GetLastError();
// Load the node list. Add the node for every locale in the archive
if(nError == ERROR_SUCCESS)
{
// Load the node list. Add the node for every locale in the archive
while((nLength = ReadListFileLine(pCache, szFileName, sizeof(szFileName))) > 0)
SListFileCreateNodeForAllLocales(ha, szFileName);
// Delete the cache
FreeListFileCache(pCache);
pCache->hFile = NULL;
}
return (pCache != NULL) ? ERROR_SUCCESS : ERROR_FILE_CORRUPT;
// Delete the cache
if(pCache != NULL)
FreeListFileCache(pCache);
return nError;
}
static int SFileAddExternalListFile(
@ -456,12 +445,12 @@ static int SFileAddExternalListFile(
int nError = ERROR_SUCCESS;
// Open the external list file
if(!SFileOpenFileEx(hMpq, szListFile, SFILE_OPEN_LOCAL_FILE, &hListFile))
return GetLastError();
// Add the data from the listfile to MPQ
nError = SFileAddArbitraryListFile(ha, hListFile);
SFileCloseFile(hListFile);
if(SFileOpenFileEx(hMpq, szListFile, SFILE_OPEN_LOCAL_FILE, &hListFile))
{
// Add the data from the listfile to MPQ
nError = SFileAddArbitraryListFile(ha, hListFile);
SFileCloseFile(hListFile);
}
return nError;
}
@ -491,7 +480,7 @@ static int SFileAddInternalListFile(
nError = SFileAddArbitraryListFile(ha, hListFile);
SFileCloseFile(hListFile);
}
// Restore the original locale
SFileSetLocale(lcSaveLocale);
@ -528,9 +517,9 @@ int WINAPI SFileAddListFile(HANDLE hMpq, const char * szListFile)
while(ha != NULL)
{
if(szListFile != NULL)
nError = SFileAddExternalListFile(ha, hMpq, szListFile);
SFileAddExternalListFile(ha, hMpq, szListFile);
else
nError = SFileAddInternalListFile(ha, hMpq);
SFileAddInternalListFile(ha, hMpq);
// Also, add three special files to the listfile:
// (listfile) itself, (attributes) and (signature)
@ -551,7 +540,7 @@ int WINAPI SFileAddListFile(HANDLE hMpq, const char * szListFile)
HANDLE WINAPI SListFileFindFirstFile(HANDLE hMpq, const char * szListFile, const char * szMask, SFILE_FIND_DATA * lpFindFileData)
{
TListFileCache * pCache = NULL;
HANDLE hListFile = NULL;
HANDLE hListFile;
size_t nLength = 0;
DWORD dwSearchScope = SFILE_OPEN_LOCAL_FILE;
int nError = ERROR_SUCCESS;
@ -577,16 +566,12 @@ HANDLE WINAPI SListFileFindFirstFile(HANDLE hMpq, const char * szListFile, const
{
pCache = CreateListFileCache(hListFile, szMask);
if(pCache == NULL)
nError = ERROR_FILE_CORRUPT;
nError = GetLastError();
}
// Perform file search
if(nError == ERROR_SUCCESS)
{
// The listfile handle is in the cache now
hListFile = NULL;
// Iterate through the listfile
for(;;)
{
// Read the (next) line
@ -599,24 +584,19 @@ HANDLE WINAPI SListFileFindFirstFile(HANDLE hMpq, const char * szListFile, const
// If some mask entered, check it
if(CheckWildCard(lpFindFileData->cFileName, pCache->szMask))
break;
break;
}
}
// Cleanup & exit
if(nError != ERROR_SUCCESS)
{
if(pCache != NULL)
FreeListFileCache(pCache);
pCache = NULL;
memset(lpFindFileData, 0, sizeof(SFILE_FIND_DATA));
SetLastError(nError);
}
FreeListFileCache(pCache);
// Close remaining unowned listfile handle
if(hListFile != NULL)
SFileCloseFile(hListFile);
SetLastError(nError);
pCache = NULL;
}
return (HANDLE)pCache;
}
@ -624,44 +604,34 @@ bool WINAPI SListFileFindNextFile(HANDLE hFind, SFILE_FIND_DATA * lpFindFileData
{
TListFileCache * pCache = (TListFileCache *)hFind;
size_t nLength;
int nError = ERROR_INVALID_PARAMETER;
bool bResult = false;
int nError = ERROR_SUCCESS;
// Check for parameters
if(pCache != NULL)
for(;;)
{
for(;;)
// Read the (next) line
nLength = ReadListFileLine(pCache, lpFindFileData->cFileName, sizeof(lpFindFileData->cFileName));
if(nLength == 0)
{
// Read the (next) line
nLength = ReadListFileLine(pCache, lpFindFileData->cFileName, sizeof(lpFindFileData->cFileName));
if(nLength == 0)
{
nError = ERROR_NO_MORE_FILES;
break;
}
nError = ERROR_NO_MORE_FILES;
break;
}
// If some mask entered, check it
if(CheckWildCard(lpFindFileData->cFileName, pCache->szMask))
{
nError = ERROR_SUCCESS;
break;
}
// If some mask entered, check it
if(CheckWildCard(lpFindFileData->cFileName, pCache->szMask))
{
bResult = true;
break;
}
}
if(nError != ERROR_SUCCESS)
SetLastError(nError);
return (nError == ERROR_SUCCESS);
return bResult;
}
bool WINAPI SListFileFindClose(HANDLE hFind)
{
TListFileCache * pCache = (TListFileCache *)hFind;
if(pCache == NULL)
return false;
if(pCache->hFile != NULL)
SFileCloseFile(pCache->hFile);
return FreeListFileCache(pCache);
return FreeListFileCache((TListFileCache *)hFind);
}

View file

@ -21,41 +21,43 @@
/* Local functions */
/*****************************************************************************/
static bool IsAviFile(DWORD * HeaderData)
static bool IsAviFile(void * pvFileBegin)
{
DWORD DwordValue0 = BSWAP_INT32_UNSIGNED(HeaderData[0]);
DWORD DwordValue2 = BSWAP_INT32_UNSIGNED(HeaderData[2]);
DWORD DwordValue3 = BSWAP_INT32_UNSIGNED(HeaderData[3]);
LPDWORD AviHeader = (DWORD *)pvFileBegin;
DWORD DwordValue0 = BSWAP_INT32_UNSIGNED(AviHeader[0]);
DWORD DwordValue2 = BSWAP_INT32_UNSIGNED(AviHeader[2]);
DWORD DwordValue3 = BSWAP_INT32_UNSIGNED(AviHeader[3]);
// Test for 'RIFF', 'AVI ' or 'LIST'
return (DwordValue0 == 0x46464952 && DwordValue2 == 0x20495641 && DwordValue3 == 0x5453494C);
}
static TMPQUserData * IsValidMpqUserData(ULONGLONG ByteOffset, ULONGLONG FileSize, void * pvUserData)
static TFileBitmap * CreateFileBitmap(TMPQArchive * ha, TMPQBitmap * pMpqBitmap, bool bFileIsComplete)
{
TMPQUserData * pUserData;
TFileBitmap * pBitmap;
size_t nLength;
// BSWAP the source data and copy them to our buffer
BSWAP_ARRAY32_UNSIGNED(&pvUserData, sizeof(TMPQUserData));
pUserData = (TMPQUserData *)pvUserData;
// Calculate the length of the bitmap in blocks and in bytes
nLength = (size_t)(((ha->pHeader->ArchiveSize64 - 1) / pMpqBitmap->dwBlockSize) + 1);
nLength = (size_t)(((nLength - 1) / 8) + 1);
// Check the sizes
if(pUserData->cbUserDataHeader <= pUserData->cbUserDataSize && pUserData->cbUserDataSize <= pUserData->dwHeaderOffs)
// Allocate the file bitmap
pBitmap = (TFileBitmap *)STORM_ALLOC(BYTE, sizeof(TFileBitmap) + nLength);
if(pBitmap != NULL)
{
// Move to the position given by the userdata
ByteOffset += pUserData->dwHeaderOffs;
// Fill the structure
pBitmap->StartOffset = ha->MpqPos;
pBitmap->EndOffset = ha->MpqPos + ha->pHeader->ArchiveSize64;
pBitmap->IsComplete = bFileIsComplete ? 1 : 0;
pBitmap->BitmapSize = (DWORD)nLength;
pBitmap->BlockSize = pMpqBitmap->dwBlockSize;
pBitmap->Reserved = 0;
// The MPQ header should be within range of the file size
if((ByteOffset + MPQ_HEADER_SIZE_V1) < FileSize)
{
// Note: We should verify if there is the MPQ header.
// However, the header could be at any position below that
// that is multiplier of 0x200
return (TMPQUserData *)pvUserData;
}
// Copy the file bitmap
memcpy((pBitmap + 1), (pMpqBitmap + 1), nLength);
}
return NULL;
return pBitmap;
}
// This function gets the right positions of the hash table and the block table.
@ -84,9 +86,6 @@ static int VerifyMpqTablePositions(TMPQArchive * ha, ULONGLONG FileSize)
if(pHeader->wHashTablePosHi || pHeader->dwHashTablePos)
{
ByteOffset = ha->MpqPos + MAKE_OFFSET64(pHeader->wHashTablePosHi, pHeader->dwHashTablePos);
if((pHeader->wFormatVersion == MPQ_FORMAT_VERSION_1) && (ha->dwFlags & MPQ_FLAG_MALFORMED))
ByteOffset = (DWORD)ha->MpqPos + pHeader->dwHashTablePos;
if(ByteOffset > FileSize)
return ERROR_BAD_FORMAT;
}
@ -95,9 +94,6 @@ static int VerifyMpqTablePositions(TMPQArchive * ha, ULONGLONG FileSize)
if(pHeader->wBlockTablePosHi || pHeader->dwBlockTablePos)
{
ByteOffset = ha->MpqPos + MAKE_OFFSET64(pHeader->wBlockTablePosHi, pHeader->dwBlockTablePos);
if((pHeader->wFormatVersion == MPQ_FORMAT_VERSION_1) && (ha->dwFlags & MPQ_FLAG_MALFORMED))
ByteOffset = (DWORD)ha->MpqPos + pHeader->dwBlockTablePos;
if(ByteOffset > FileSize)
return ERROR_BAD_FORMAT;
}
@ -143,17 +139,16 @@ LCID WINAPI SFileSetLocale(LCID lcNewLocale)
// phMpq - Pointer to store open archive handle
bool WINAPI SFileOpenArchive(
const TCHAR * szMpqName,
DWORD dwPriority,
DWORD dwFlags,
HANDLE * phMpq)
const TCHAR * szMpqName,
DWORD dwPriority,
DWORD dwFlags,
HANDLE * phMpq)
{
TMPQUserData * pUserData;
TFileStream * pStream = NULL; // Open file stream
TMPQArchive * ha = NULL; // Archive handle
TFileEntry * pFileEntry;
ULONGLONG FileSize = 0; // Size of the file
int nError = ERROR_SUCCESS;
int nError = ERROR_SUCCESS;
// Verify the parameters
if(szMpqName == NULL || *szMpqName == 0 || phMpq == NULL)
@ -166,28 +161,16 @@ bool WINAPI SFileOpenArchive(
// Open the MPQ archive file
if(nError == ERROR_SUCCESS)
{
DWORD dwStreamFlags = (dwFlags & STREAM_FLAGS_MASK);
// If not forcing MPQ v 1.0, also use file bitmap
dwStreamFlags |= (dwFlags & MPQ_OPEN_FORCE_MPQ_V1) ? 0 : STREAM_FLAG_USE_BITMAP;
// Initialize the stream
pStream = FileStream_OpenFile(szMpqName, dwStreamFlags);
pStream = FileStream_OpenFile(szMpqName, (dwFlags & STREAM_OPTIONS_MASK));
if(pStream == NULL)
nError = GetLastError();
}
// Check the file size. There must be at least 0x20 bytes
if(nError == ERROR_SUCCESS)
{
FileStream_GetSize(pStream, &FileSize);
if(FileSize < MPQ_HEADER_SIZE_V1)
nError = ERROR_BAD_FORMAT;
}
// Allocate the MPQhandle
if(nError == ERROR_SUCCESS)
{
FileStream_GetSize(pStream, &FileSize);
if((ha = STORM_ALLOC(TMPQArchive, 1)) == NULL)
nError = ERROR_NOT_ENOUGH_MEMORY;
}
@ -195,129 +178,98 @@ bool WINAPI SFileOpenArchive(
// Initialize handle structure and allocate structure for MPQ header
if(nError == ERROR_SUCCESS)
{
ULONGLONG SearchOffset = 0;
ULONGLONG EndOfSearch = FileSize;
DWORD dwStreamFlags = 0;
DWORD dwHeaderSize;
DWORD dwHeaderID;
memset(ha, 0, sizeof(TMPQArchive));
ha->pfnHashString = HashString;
ha->pStream = pStream;
pStream = NULL;
// Set the archive read only if the stream is read-only
FileStream_GetFlags(ha->pStream, &dwStreamFlags);
ha->dwFlags |= (dwStreamFlags & STREAM_FLAG_READ_ONLY) ? MPQ_FLAG_READ_ONLY : 0;
// Remember if the archive is open for write
if(FileStream_IsReadOnly(ha->pStream))
ha->dwFlags |= MPQ_FLAG_READ_ONLY;
// Also remember if we shall check sector CRCs when reading file
ha->dwFlags |= (dwFlags & MPQ_OPEN_CHECK_SECTOR_CRC) ? MPQ_FLAG_CHECK_SECTOR_CRC : 0;
if(dwFlags & MPQ_OPEN_CHECK_SECTOR_CRC)
ha->dwFlags |= MPQ_FLAG_CHECK_SECTOR_CRC;
}
// Also remember if this MPQ is a patch
ha->dwFlags |= (dwFlags & MPQ_OPEN_PATCH) ? MPQ_FLAG_PATCH : 0;
// Limit the header searching to about 130 MB of data
if(EndOfSearch > 0x08000000)
EndOfSearch = 0x08000000;
// Find the offset of MPQ header within the file
if(nError == ERROR_SUCCESS)
{
ULONGLONG SearchPos = 0;
DWORD dwHeaderID;
// Find the offset of MPQ header within the file
while(SearchOffset < EndOfSearch)
while(SearchPos < FileSize)
{
DWORD dwBytesAvailable = MPQ_HEADER_SIZE_V4;
// Cut the bytes available, if needed
if((FileSize - SearchOffset) < MPQ_HEADER_SIZE_V4)
dwBytesAvailable = (DWORD)(FileSize - SearchOffset);
if((FileSize - SearchPos) < MPQ_HEADER_SIZE_V4)
dwBytesAvailable = (DWORD)(FileSize - SearchPos);
// Read the eventual MPQ header
if(!FileStream_Read(ha->pStream, &SearchOffset, ha->HeaderData, dwBytesAvailable))
if(!FileStream_Read(ha->pStream, &SearchPos, ha->HeaderData, dwBytesAvailable))
{
nError = GetLastError();
break;
}
// There are AVI files from Warcraft III with 'MPQ' extension.
if(SearchOffset == 0 && IsAviFile(ha->HeaderData))
if(SearchPos == 0 && IsAviFile(ha->HeaderData))
{
nError = ERROR_AVI_FILE;
break;
}
// If there is the MPQ user data signature, process it
dwHeaderID = BSWAP_INT32_UNSIGNED(ha->HeaderData[0]);
if(dwHeaderID == ID_MPQ_USERDATA && ha->pUserData == NULL && (dwFlags & MPQ_OPEN_FORCE_MPQ_V1) == 0)
dwHeaderID = BSWAP_INT32_UNSIGNED(*(LPDWORD)ha->HeaderData);
if(dwHeaderID == ID_MPQ_USERDATA && ha->pUserData == NULL)
{
// Verify if this looks like a valid user data
pUserData = IsValidMpqUserData(SearchOffset, FileSize, ha->HeaderData);
if(pUserData != NULL)
// Ignore the MPQ user data completely if the caller wants to open the MPQ as V1.0
if((dwFlags & MPQ_OPEN_FORCE_MPQ_V1) == 0)
{
// Fill the user data header
ha->UserDataPos = SearchOffset;
ha->pUserData = &ha->UserData;
memcpy(ha->pUserData, pUserData, sizeof(TMPQUserData));
memcpy(ha->pUserData, ha->HeaderData, sizeof(TMPQUserData));
BSWAP_TMPQUSERDATA(ha->pUserData);
// Continue searching from that position
SearchOffset += ha->pUserData->dwHeaderOffs;
// Remember the position of the user data and continue search
ha->UserDataPos = SearchPos;
SearchPos += ha->pUserData->dwHeaderOffs;
continue;
}
}
// There must be MPQ header signature. Note that STORM.dll from Warcraft III actually
// tests the MPQ header size. It must be at least 0x20 bytes in order to load it
// Abused by Spazzler Map protector. Note that the size check is not present
// in Storm.dll v 1.00, so Diablo I code would load the MPQ anyway.
dwHeaderSize = BSWAP_INT32_UNSIGNED(ha->HeaderData[1]);
if(dwHeaderID == ID_MPQ && dwHeaderSize >= MPQ_HEADER_SIZE_V1)
// There must be MPQ header signature
if(dwHeaderID == ID_MPQ)
{
// Save the position where the MPQ header has been found
if(ha->pUserData == NULL)
ha->UserDataPos = SearchPos;
ha->pHeader = (TMPQHeader *)ha->HeaderData;
ha->MpqPos = SearchPos;
// Now convert the header to version 4
nError = ConvertMpqHeaderToFormat4(ha, SearchOffset, FileSize, dwFlags);
break;
}
// Check for MPK archives (Longwu Online - MPQ fork)
if(dwHeaderID == ID_MPK)
{
// Now convert the MPK header to MPQ Header version 4
nError = ConvertMpkHeaderToFormat4(ha, FileSize, dwFlags);
break;
}
// If searching for the MPQ header is disabled, return an error
if(dwFlags & MPQ_OPEN_NO_HEADER_SEARCH)
{
nError = ERROR_NOT_SUPPORTED;
BSWAP_TMPQHEADER(ha->pHeader);
nError = ConvertMpqHeaderToFormat4(ha, FileSize, dwFlags);
break;
}
// Move to the next possible offset
SearchOffset += 0x200;
SearchPos += 0x200;
}
// Did we identify one of the supported headers?
if(nError == ERROR_SUCCESS)
{
// Set the user data position to the MPQ header, if none
if(ha->pUserData == NULL)
ha->UserDataPos = SearchOffset;
// Set the position of the MPQ header
ha->pHeader = (TMPQHeader *)ha->HeaderData;
ha->MpqPos = SearchOffset;
// Sector size must be nonzero.
if(SearchOffset >= FileSize || ha->pHeader->wSectorSize == 0)
nError = ERROR_BAD_FORMAT;
}
// If we haven't found MPQ header in the file, it's an error
if(ha->pHeader == NULL)
nError = ERROR_BAD_FORMAT;
}
// Fix table positions according to format
if(nError == ERROR_SUCCESS)
{
// Dump the header
// DumpMpqHeader(ha->pHeader);
// DumpMpqHeader(ha->pHeader);
// W3x Map Protectors use the fact that War3's Storm.dll ignores the MPQ user data,
// and ignores the MPQ format version as well. The trick is to
// 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)
@ -339,6 +291,24 @@ bool WINAPI SFileOpenArchive(
nError = VerifyMpqTablePositions(ha, FileSize);
}
// Check if the MPQ has data bitmap. If yes, we can verify if the MPQ is complete
if(nError == ERROR_SUCCESS && ha->pHeader->wFormatVersion >= MPQ_FORMAT_VERSION_4)
{
TFileBitmap * pBitmap;
bool bFileIsComplete = true;
LoadMpqDataBitmap(ha, FileSize, &bFileIsComplete);
if(ha->pBitmap != NULL && bFileIsComplete == false)
{
// Convert the MPQ bitmap to the file bitmap
pBitmap = CreateFileBitmap(ha, ha->pBitmap, bFileIsComplete);
// Set the data bitmap into the file stream for additional checks
FileStream_SetBitmap(ha->pStream, pBitmap);
ha->dwFlags |= MPQ_FLAG_READ_ONLY;
}
}
// Read the hash table. Ignore the result, as hash table is no longer required
// Read HET table. Ignore the result, as HET table is no longer required
if(nError == ERROR_SUCCESS)
@ -350,13 +320,14 @@ bool WINAPI SFileOpenArchive(
// the block table, BET table, hi-block table, (attributes) and (listfile).
if(nError == ERROR_SUCCESS)
{
nError = BuildFileTable(ha);
nError = BuildFileTable(ha, FileSize);
}
// Verify the file table, if no kind of malformation was detected
if(nError == ERROR_SUCCESS && (ha->dwFlags & MPQ_FLAG_MALFORMED) == 0)
// Verify the file table, if no kind of protection was detected
if(nError == ERROR_SUCCESS && (ha->dwFlags & MPQ_FLAG_PROTECTED) == 0)
{
TFileEntry * pFileTableEnd = ha->pFileTable + ha->dwFileTableSize;
TFileEntry * pFileTableEnd = ha->pFileTable + ha->pHeader->dwBlockTableSize;
// ULONGLONG ArchiveSize = 0;
ULONGLONG RawFilePos;
// Parse all file entries
@ -383,6 +354,10 @@ bool WINAPI SFileOpenArchive(
nError = ERROR_FILE_CORRUPT;
break;
}
// Also, we remember end of the file
// if(RawFilePos > ArchiveSize)
// ArchiveSize = RawFilePos;
}
}
}
@ -390,47 +365,32 @@ bool WINAPI SFileOpenArchive(
// Load the internal listfile and include it to the file table
if(nError == ERROR_SUCCESS && (dwFlags & MPQ_OPEN_NO_LISTFILE) == 0)
{
// Quick check for (listfile)
// Save the flags for (listfile)
pFileEntry = GetFileEntryLocale(ha, LISTFILE_NAME, LANG_NEUTRAL);
if(pFileEntry != NULL)
{
// Ignore result of the operation. (listfile) is optional.
SFileAddListFile((HANDLE)ha, NULL);
ha->dwFileFlags1 = pFileEntry->dwFlags;
}
// Ignore result of the operation. (listfile) is optional.
SFileAddListFile((HANDLE)ha, NULL);
}
// Load the "(attributes)" file and merge it to the file table
if(nError == ERROR_SUCCESS && (dwFlags & MPQ_OPEN_NO_ATTRIBUTES) == 0)
{
// Quick check for (attributes)
// Save the flags for (attributes)
pFileEntry = GetFileEntryLocale(ha, ATTRIBUTES_NAME, LANG_NEUTRAL);
if(pFileEntry != NULL)
{
// Ignore result of the operation. (attributes) is optional.
SAttrLoadAttributes(ha);
ha->dwFileFlags2 = pFileEntry->dwFlags;
}
}
// Remember whether the archive has weak signature. Only for MPQs format 1.0.
if(nError == ERROR_SUCCESS)
{
// Quick check for (signature)
pFileEntry = GetFileEntryLocale(ha, SIGNATURE_NAME, LANG_NEUTRAL);
if(pFileEntry != NULL)
{
// Just remember that the archive is weak-signed
assert(pFileEntry->dwFlags == MPQ_FILE_EXISTS);
ha->dwFileFlags3 = pFileEntry->dwFlags;
}
// Ignore result of the operation. (attributes) is optional.
SAttrLoadAttributes(ha);
}
// Cleanup and exit
if(nError != ERROR_SUCCESS)
{
FileStream_Close(pStream);
FreeArchiveHandle(ha);
FreeMPQArchive(ha);
SetLastError(nError);
ha = NULL;
}
@ -440,23 +400,13 @@ bool WINAPI SFileOpenArchive(
}
//-----------------------------------------------------------------------------
// bool WINAPI SFileSetDownloadCallback(HANDLE, SFILE_DOWNLOAD_CALLBACK, void *);
//
// Sets a callback that is called when content is downloaded from the master MPQ
//
// SFileGetArchiveBitmap
bool WINAPI SFileSetDownloadCallback(HANDLE hMpq, SFILE_DOWNLOAD_CALLBACK DownloadCB, void * pvUserData)
bool WINAPI SFileGetArchiveBitmap(HANDLE hMpq, TFileBitmap * pBitmap, DWORD Length, LPDWORD LengthNeeded)
{
TMPQArchive * ha = (TMPQArchive *)hMpq;
// Do nothing if 'hMpq' is bad parameter
if(!IsValidMpqHandle(hMpq))
{
SetLastError(ERROR_INVALID_HANDLE);
return false;
}
return FileStream_SetCallback(ha->pStream, DownloadCB, pvUserData);
return FileStream_GetBitmap(ha->pStream, pBitmap, Length, LengthNeeded);
}
//-----------------------------------------------------------------------------
@ -475,25 +425,14 @@ bool WINAPI SFileFlushArchive(HANDLE hMpq)
int nError;
// Do nothing if 'hMpq' is bad parameter
if(!IsValidMpqHandle(hMpq))
if(!IsValidMpqHandle(ha))
{
SetLastError(ERROR_INVALID_HANDLE);
return false;
}
// Indicate that we are saving MPQ internal structures
ha->dwFlags |= MPQ_FLAG_SAVING_TABLES;
// If the (signature) has been invalidated, save it
if(ha->dwFlags & MPQ_FLAG_SIGNATURE_INVALID)
{
nError = SSignFileCreate(ha);
if(nError != ERROR_SUCCESS)
nResultError = nError;
}
// If the (listfile) has been invalidated, save it
if(ha->dwFlags & MPQ_FLAG_LISTFILE_INVALID)
if(ha->dwFlags & MPQ_FLAG_INV_LISTFILE)
{
nError = SListFileSaveToMpq(ha);
if(nError != ERROR_SUCCESS)
@ -501,7 +440,7 @@ bool WINAPI SFileFlushArchive(HANDLE hMpq)
}
// If the (attributes) has been invalidated, save it
if(ha->dwFlags & MPQ_FLAG_ATTRIBUTES_INVALID)
if(ha->dwFlags & MPQ_FLAG_INV_ATTRIBUTES)
{
nError = SAttrFileSaveToMpq(ha);
if(nError != ERROR_SUCCESS)
@ -511,23 +450,11 @@ bool WINAPI SFileFlushArchive(HANDLE hMpq)
// Save HET table, BET table, hash table, block table, hi-block table
if(ha->dwFlags & MPQ_FLAG_CHANGED)
{
// Save all MPQ tables first
nError = SaveMPQTables(ha);
if(nError != ERROR_SUCCESS)
nResultError = nError;
// If the archive has weak signature, we need to finish it
if(ha->dwFileFlags3 != 0)
{
nError = SSignFileFinish(ha);
if(nError != ERROR_SUCCESS)
nResultError = nError;
}
}
// We are no longer saving internal MPQ structures
ha->dwFlags &= ~MPQ_FLAG_SAVING_TABLES;
// Return the error
if(nResultError != ERROR_SUCCESS)
SetLastError(nResultError);
@ -543,16 +470,11 @@ bool WINAPI SFileCloseArchive(HANDLE hMpq)
TMPQArchive * ha = (TMPQArchive *)hMpq;
bool bResult;
// Invalidate the add file callback so it won't be called
// when saving (listfile) and (attributes)
ha->pfnAddFileCB = NULL;
ha->pvAddFileUserData = NULL;
// Flush all unsaved data to the storage
bResult = SFileFlushArchive(hMpq);
// Free all memory used by MPQ archive
FreeArchiveHandle(ha);
FreeMPQArchive(ha);
return bResult;
}

View file

@ -16,46 +16,29 @@
/* Local functions */
/*****************************************************************************/
static const char * GetPatchFileName(TMPQArchive * ha, const char * szFileName, char * szBuffer)
{
TMPQNamePrefix * pPrefix;
// Are there patches in the current MPQ?
if(ha->dwFlags & MPQ_FLAG_PATCH)
{
// The patch prefix must be already known here
assert(ha->pPatchPrefix != NULL);
pPrefix = ha->pPatchPrefix;
// The patch name for "OldWorld\\XXX\\YYY" is "Base\\XXX\YYY"
// We need to remove the "OldWorld\\" prefix
if(!_strnicmp(szFileName, "OldWorld\\", 9))
szFileName += 9;
// Create the file name from the known patch entry
memcpy(szBuffer, pPrefix->szPatchPrefix, pPrefix->nLength);
strcpy(szBuffer + pPrefix->nLength, szFileName);
szFileName = szBuffer;
}
return szFileName;
}
static bool OpenLocalFile(const char * szFileName, HANDLE * phFile)
{
TFileStream * pStream;
TMPQFile * hf = NULL;
// We have to convert the local file name to UNICODE, if needed
#ifdef _UNICODE
TCHAR szFileNameT[MAX_PATH];
int i;
// Convert the file name to UNICODE (if needed)
CopyFileName(szFileNameT, szFileName, strlen(szFileName));
for(i = 0; szFileName[i] != 0; i++)
szFileNameT[i] = szFileName[i];
szFileNameT[i] = 0;
pStream = FileStream_OpenFile(szFileNameT, STREAM_PROVIDER_LINEAR | BASE_PROVIDER_FILE);
#else
pStream = FileStream_OpenFile(szFileName, STREAM_PROVIDER_LINEAR | BASE_PROVIDER_FILE);
#endif
// Open the file and create the TMPQFile structure
pStream = FileStream_OpenFile(szFileNameT, STREAM_FLAG_READ_ONLY);
if(pStream != NULL)
{
// Allocate and initialize file handle
hf = CreateFileHandle(NULL, NULL);
hf = CreateMpqFile(NULL);
if(hf != NULL)
{
hf->pStream = pStream;
@ -72,67 +55,87 @@ static bool OpenLocalFile(const char * szFileName, HANDLE * phFile)
return false;
}
bool OpenPatchedFile(HANDLE hMpq, const char * szFileName, HANDLE * phFile)
bool OpenPatchedFile(HANDLE hMpq, const char * szFileName, DWORD dwReserved, HANDLE * phFile)
{
TMPQArchive * haBase = NULL;
TMPQArchive * ha = (TMPQArchive *)hMpq;
TFileEntry * pFileEntry;
TMPQFile * hfPatch; // Pointer to patch file
TMPQFile * hfBase = NULL; // Pointer to base open file
TMPQFile * hfLast = NULL; // The highest file in the chain that is not patch file
TMPQFile * hf = NULL;
HANDLE hPatchFile;
char szNameBuffer[MAX_PATH];
char szPatchFileName[MAX_PATH];
// First of all, find the latest archive where the file is in base version
// (i.e. where the original, unpatched version of the file exists)
// Keep this flag here for future updates
dwReserved = dwReserved;
// First of all, try to open the original version of the file in any of the patch chain
while(ha != NULL)
{
// If the file is there, then we remember the archive
pFileEntry = GetFileEntryExact(ha, GetPatchFileName(ha, szFileName, szNameBuffer), 0);
if(pFileEntry != NULL && (pFileEntry->dwFlags & MPQ_FILE_PATCH_FILE) == 0)
haBase = ha;
// Construct the name of the patch file
strcpy(szPatchFileName, ha->szPatchPrefix);
strcpy(&szPatchFileName[ha->cchPatchPrefix], szFileName);
if(SFileOpenFileEx((HANDLE)ha, szPatchFileName, SFILE_OPEN_FROM_MPQ, (HANDLE *)&hfBase))
{
// The file must be a base file, i.e. without MPQ_FILE_PATCH_FILE
if((hfBase->pFileEntry->dwFlags & MPQ_FILE_PATCH_FILE) == 0)
{
hf = hfLast = hfBase;
break;
}
// Move to the patch archive
SFileCloseFile((HANDLE)hfBase);
}
// Move to the next file in the patch chain
ha = ha->haPatch;
}
// If we couldn't find the base file in any of the patches, it doesn't exist
if((ha = haBase) == NULL)
// If we couldn't find the file in any of the patches, it doesn't exist
if(hf == NULL)
{
SetLastError(ERROR_FILE_NOT_FOUND);
return false;
}
// Now open the base file
if(SFileOpenFileEx((HANDLE)ha, GetPatchFileName(ha, szFileName, szNameBuffer), SFILE_OPEN_BASE_FILE, (HANDLE *)&hfBase))
// Now keep going in the patch chain and open every patch file that is there
for(ha = ha->haPatch; ha != NULL; ha = ha->haPatch)
{
// The file must be a base file, i.e. without MPQ_FILE_PATCH_FILE
assert((hfBase->pFileEntry->dwFlags & MPQ_FILE_PATCH_FILE) == 0);
hf = hfBase;
// Now open all patches and attach them on top of the base file
for(ha = ha->haPatch; ha != NULL; ha = ha->haPatch)
// Construct patch file name
strcpy(szPatchFileName, ha->szPatchPrefix);
strcpy(&szPatchFileName[ha->cchPatchPrefix], szFileName);
if(SFileOpenFileEx((HANDLE)ha, szPatchFileName, SFILE_OPEN_FROM_MPQ, &hPatchFile))
{
// Prepare the file name with a correct prefix
if(SFileOpenFileEx((HANDLE)ha, GetPatchFileName(ha, szFileName, szNameBuffer), SFILE_OPEN_BASE_FILE, &hPatchFile))
{
// Remember the new version
hfPatch = (TMPQFile *)hPatchFile;
// Remember the new version
hfPatch = (TMPQFile *)hPatchFile;
// We should not find patch file
assert((hfPatch->pFileEntry->dwFlags & MPQ_FILE_PATCH_FILE) != 0);
// If we encountered a full replacement of the file,
// we have to remember the highest full file
if((hfPatch->pFileEntry->dwFlags & MPQ_FILE_PATCH_FILE) == 0)
hfLast = hfPatch;
// Attach the patch to the base file
hf->hfPatch = hfPatch;
hf = hfPatch;
}
// Set current patch to base file and move on
hf->hfPatchFile = hfPatch;
hf = hfPatch;
}
}
// Now we need to free all files that are below the highest unpatched version
while(hfBase != hfLast)
{
TMPQFile * hfNext = hfBase->hfPatchFile;
// Free the file below
hfBase->hfPatchFile = NULL;
FreeMPQFile(hfBase);
// Move the base to the next file
hfBase = hfNext;
}
// Give the updated base MPQ
if(phFile != NULL)
*phFile = (HANDLE)hfBase;
return (hfBase != NULL);
return true;
}
/*****************************************************************************/
@ -140,17 +143,17 @@ bool OpenPatchedFile(HANDLE hMpq, const char * szFileName, HANDLE * phFile)
/*****************************************************************************/
//-----------------------------------------------------------------------------
// SFileEnumLocales enums all locale versions within MPQ.
// 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,
LPDWORD pdwMaxLocales,
DWORD dwSearchScope)
HANDLE hMpq,
const char * szFileName,
LCID * plcLocales,
LPDWORD pdwMaxLocales,
DWORD dwSearchScope)
{
TMPQArchive * ha = (TMPQArchive *)hMpq;
TFileEntry * pFileEntry;
@ -160,13 +163,13 @@ int WINAPI SFileEnumLocales(
DWORD dwLocales = 0;
// Test the parameters
if(!IsValidMpqHandle(hMpq))
if(!IsValidMpqHandle(ha))
return ERROR_INVALID_HANDLE;
if(szFileName == NULL || *szFileName == 0)
return ERROR_INVALID_PARAMETER;
if(pdwMaxLocales == NULL)
return ERROR_INVALID_PARAMETER;
// Keep compiler happy
dwSearchScope = dwSearchScope;
@ -229,11 +232,11 @@ bool WINAPI SFileHasFile(HANDLE hMpq, const char * szFileName)
TFileEntry * pFileEntry;
DWORD dwFlagsToCheck = MPQ_FILE_EXISTS;
DWORD dwFileIndex = 0;
char szPrefixBuffer[MAX_PATH];
char szPatchFileName[MAX_PATH];
bool bIsPseudoName;
int nError = ERROR_SUCCESS;
if(!IsValidMpqHandle(hMpq))
if(!IsValidMpqHandle(ha))
nError = ERROR_INVALID_HANDLE;
if(szFileName == NULL || *szFileName == 0)
nError = ERROR_INVALID_PARAMETER;
@ -248,7 +251,7 @@ bool WINAPI SFileHasFile(HANDLE hMpq, const char * szFileName)
while(ha != NULL)
{
// Verify presence of the file
pFileEntry = (bIsPseudoName == false) ? GetFileEntryLocale(ha, GetPatchFileName(ha, szFileName, szPrefixBuffer), lcFileLocale)
pFileEntry = (bIsPseudoName == false) ? GetFileEntryLocale(ha, szFileName, lcFileLocale)
: GetFileEntryByIndex(ha, dwFileIndex);
// Verify the file flags
if(pFileEntry != NULL && (pFileEntry->dwFlags & dwFlagsToCheck) == MPQ_FILE_EXISTS)
@ -257,6 +260,14 @@ bool WINAPI SFileHasFile(HANDLE hMpq, const char * szFileName)
// If this is patched archive, go to the patch
dwFlagsToCheck = MPQ_FILE_EXISTS | MPQ_FILE_PATCH_FILE;
ha = ha->haPatch;
// Prepare the patched file name
if(ha != NULL)
{
strcpy(szPatchFileName, ha->szPatchPrefix);
strcat(szPatchFileName, szFileName);
szFileName = szPatchFileName;
}
}
// Not found, sorry
@ -295,78 +306,73 @@ bool WINAPI SFileOpenFileEx(HANDLE hMpq, const char * szFileName, DWORD dwSearch
{
switch(dwSearchScope)
{
case SFILE_OPEN_FROM_MPQ:
case SFILE_OPEN_BASE_FILE:
if(!IsValidMpqHandle(hMpq))
{
nError = ERROR_INVALID_HANDLE;
break;
}
case SFILE_OPEN_PATCHED_FILE:
if(szFileName == NULL || *szFileName == 0)
{
nError = ERROR_INVALID_PARAMETER;
break;
}
// We want to open the updated version of the file
return OpenPatchedFile(hMpq, szFileName, 0, phFile);
// Check the pseudo-file name
if(IsPseudoFileName(szFileName, &dwFileIndex))
{
pFileEntry = GetFileEntryByIndex(ha, dwFileIndex);
bOpenByIndex = true;
if(pFileEntry == NULL)
nError = ERROR_FILE_NOT_FOUND;
}
else
{
// If this MPQ is a patched archive, open the file as patched
if(ha->haPatch == NULL || dwSearchScope == SFILE_OPEN_BASE_FILE)
{
// Otherwise, open the file from *this* MPQ
pFileEntry = GetFileEntryLocale(ha, szFileName, lcFileLocale);
if(pFileEntry == NULL)
nError = ERROR_FILE_NOT_FOUND;
}
else
{
return OpenPatchedFile(hMpq, szFileName, phFile);
}
}
case SFILE_OPEN_FROM_MPQ:
if(!IsValidMpqHandle(ha))
{
nError = ERROR_INVALID_HANDLE;
break;
}
case SFILE_OPEN_ANY_LOCALE:
// This open option is reserved for opening MPQ internal listfile.
// No argument validation. Tries to open file with neutral locale first,
// then any other available.
pFileEntry = GetFileEntryAny(ha, szFileName);
if(pFileEntry == NULL)
nError = ERROR_FILE_NOT_FOUND;
break;
case SFILE_OPEN_LOCAL_FILE:
if(szFileName == NULL || *szFileName == 0)
{
nError = ERROR_INVALID_PARAMETER;
break;
}
return OpenLocalFile(szFileName, phFile);
default:
// Don't accept any other value
if(szFileName == NULL || *szFileName == 0)
{
nError = ERROR_INVALID_PARAMETER;
break;
}
// First of all, check the name as-is
if(!IsPseudoFileName(szFileName, &dwFileIndex))
{
pFileEntry = GetFileEntryLocale(ha, szFileName, lcFileLocale);
if(pFileEntry == NULL)
nError = ERROR_FILE_NOT_FOUND;
}
else
{
bOpenByIndex = true;
pFileEntry = GetFileEntryByIndex(ha, dwFileIndex);
if(pFileEntry == NULL)
nError = ERROR_FILE_NOT_FOUND;
}
break;
case SFILE_OPEN_ANY_LOCALE:
// This open option is reserved for opening MPQ internal listfile.
// No argument validation. Tries to open file with neutral locale first,
// then any other available.
dwSearchScope = SFILE_OPEN_FROM_MPQ;
pFileEntry = GetFileEntryAny(ha, szFileName);
if(pFileEntry == NULL)
nError = ERROR_FILE_NOT_FOUND;
break;
case SFILE_OPEN_LOCAL_FILE:
if(szFileName == NULL || *szFileName == 0)
{
nError = ERROR_INVALID_PARAMETER;
break;
}
return OpenLocalFile(szFileName, phFile);
default:
// Don't accept any other value
nError = ERROR_INVALID_PARAMETER;
break;
}
// Quick return if something failed
if(nError != ERROR_SUCCESS)
{
SetLastError(nError);
*phFile = NULL;
return false;
}
}
@ -383,14 +389,22 @@ bool WINAPI SFileOpenFileEx(HANDLE hMpq, const char * szFileName, DWORD dwSearch
// Allocate file handle
if(nError == ERROR_SUCCESS)
{
hf = CreateFileHandle(ha, pFileEntry);
if(hf == NULL)
if((hf = STORM_ALLOC(TMPQFile, 1)) == NULL)
nError = ERROR_NOT_ENOUGH_MEMORY;
}
// Initialize file handle
if(nError == ERROR_SUCCESS)
{
memset(hf, 0, sizeof(TMPQFile));
hf->pFileEntry = pFileEntry;
hf->dwMagic = ID_MPQ_FILE;
hf->ha = ha;
hf->MpqFilePos = pFileEntry->ByteOffset;
hf->RawFilePos = ha->MpqPos + hf->MpqFilePos;
hf->dwDataSize = pFileEntry->dwFileSize;
// If the MPQ has sector CRC enabled, enable if for the file
if(ha->dwFlags & MPQ_FLAG_CHECK_SECTOR_CRC)
hf->bCheckSectorCRCs = true;
@ -399,7 +413,7 @@ bool WINAPI SFileOpenFileEx(HANDLE hMpq, const char * szFileName, DWORD dwSearch
if(bOpenByIndex == false)
{
// If there is no file name yet, allocate it
AllocateFileName(ha, pFileEntry, szFileName);
AllocateFileName(pFileEntry, szFileName);
// If the file is encrypted, we should detect the file key
if(pFileEntry->dwFlags & MPQ_FILE_ENCRYPTED)
@ -418,16 +432,22 @@ bool WINAPI SFileOpenFileEx(HANDLE hMpq, const char * szFileName, DWORD dwSearch
}
}
// Cleanup and exit
// If the file is actually a patch file, we have to load the patch file header
if(nError == ERROR_SUCCESS && pFileEntry->dwFlags & MPQ_FILE_PATCH_FILE)
{
assert(hf->pPatchInfo == NULL);
nError = AllocatePatchInfo(hf, true);
}
// Cleanup
if(nError != ERROR_SUCCESS)
{
SetLastError(nError);
FreeFileHandle(hf);
return false;
FreeMPQFile(hf);
}
*phFile = hf;
return true;
return (nError == ERROR_SUCCESS);
}
//-----------------------------------------------------------------------------
@ -436,14 +456,14 @@ bool WINAPI SFileOpenFileEx(HANDLE hMpq, const char * szFileName, DWORD dwSearch
bool WINAPI SFileCloseFile(HANDLE hFile)
{
TMPQFile * hf = (TMPQFile *)hFile;
if(!IsValidFileHandle(hFile))
if(!IsValidFileHandle(hf))
{
SetLastError(ERROR_INVALID_HANDLE);
return false;
}
// Free the structure
FreeFileHandle(hf);
FreeMPQFile(hf);
return true;
}

View file

@ -15,10 +15,6 @@
//-----------------------------------------------------------------------------
// Local structures
#define PATCH_SIGNATURE_HEADER 0x48435450
#define PATCH_SIGNATURE_MD5 0x5f35444d
#define PATCH_SIGNATURE_XFRM 0x4d524658
typedef struct _BLIZZARD_BSDIFF40_FILE
{
ULONGLONG Signature;
@ -27,40 +23,49 @@ typedef struct _BLIZZARD_BSDIFF40_FILE
ULONGLONG NewFileSize;
} BLIZZARD_BSDIFF40_FILE, *PBLIZZARD_BSDIFF40_FILE;
//-----------------------------------------------------------------------------
// Local variables
static const char * LanguageList[] =
{
"deDE",
"enCN",
"enGB",
"enTW",
"enUS",
"esES",
"esMX",
"frFR",
"koKR",
"ptBR",
"ptPT",
"ruRU",
"zhCN",
"zhTW",
NULL
};
//-----------------------------------------------------------------------------
// Local functions
static bool GetDefaultPatchPrefix(
const TCHAR * szBaseMpqName,
char * szBuffer)
{
const TCHAR * szExtension;
const TCHAR * szDash;
// Ensure that both names are plain names
szBaseMpqName = GetPlainFileNameT(szBaseMpqName);
// Patch prefix is for the Cataclysm MPQs, whose names
// are like "locale-enGB.MPQ" or "speech-enGB.MPQ"
szExtension = _tcsrchr(szBaseMpqName, _T('.'));
szDash = _tcsrchr(szBaseMpqName, _T('-'));
strcpy(szBuffer, "Base");
// If the length of the prefix doesn't match, use default one
if(szExtension != NULL && szDash != NULL && (szExtension - szDash) == 5)
{
// Copy the prefix
szBuffer[0] = (char)szDash[1];
szBuffer[1] = (char)szDash[2];
szBuffer[2] = (char)szDash[3];
szBuffer[3] = (char)szDash[4];
szBuffer[4] = 0;
}
return true;
}
static void Decompress_RLE(LPBYTE pbDecompressed, DWORD cbDecompressed, LPBYTE pbCompressed, DWORD cbCompressed)
{
LPBYTE pbDecompressedEnd = pbDecompressed + cbDecompressed;
LPBYTE pbCompressedEnd = pbCompressed + cbCompressed;
BYTE RepeatCount;
BYTE RepeatCount;
BYTE OneByte;
// Cut the initial DWORD from the compressed chunk
pbCompressed += sizeof(DWORD);
cbCompressed -= sizeof(DWORD);
// Pre-fill decompressed buffer with zeros
memset(pbDecompressed, 0, cbDecompressed);
@ -69,7 +74,7 @@ static void Decompress_RLE(LPBYTE pbDecompressed, DWORD cbDecompressed, LPBYTE p
while(pbCompressed < pbCompressedEnd && pbDecompressed < pbDecompressedEnd)
{
OneByte = *pbCompressed++;
// Is it a repetition byte ?
if(OneByte & 0x80)
{
@ -89,7 +94,7 @@ static void Decompress_RLE(LPBYTE pbDecompressed, DWORD cbDecompressed, LPBYTE p
}
}
static int LoadFilePatch_COPY(TMPQFile * hf, TPatchHeader * pPatchHeader)
static int LoadMpqPatch_COPY(TMPQFile * hf, TPatchHeader * pPatchHeader)
{
int nError = ERROR_SUCCESS;
@ -115,7 +120,7 @@ static int LoadFilePatch_COPY(TMPQFile * hf, TPatchHeader * pPatchHeader)
return nError;
}
static int LoadFilePatch_BSD0(TMPQFile * hf, TPatchHeader * pPatchHeader)
static int LoadMpqPatch_BSD0(TMPQFile * hf, TPatchHeader * pPatchHeader)
{
LPBYTE pbDecompressed = NULL;
LPBYTE pbCompressed = NULL;
@ -128,7 +133,7 @@ static int LoadFilePatch_BSD0(TMPQFile * hf, TPatchHeader * pPatchHeader)
cbCompressed = pPatchHeader->dwXfrmBlockSize - SIZE_OF_XFRM_HEADER;
pbCompressed = STORM_ALLOC(BYTE, cbCompressed);
if(pbCompressed == NULL)
nError = ERROR_NOT_ENOUGH_MEMORY;
nError = ERROR_SUCCESS;
// Read the compressed patch data
if(nError == ERROR_SUCCESS)
@ -173,38 +178,46 @@ static int LoadFilePatch_BSD0(TMPQFile * hf, TPatchHeader * pPatchHeader)
return nError;
}
static int ApplyFilePatch_COPY(
TMPQFile * hfFrom,
TMPQFile * hf,
TPatchHeader * pPatchHeader)
static int ApplyMpqPatch_COPY(
TMPQFile * hf,
TPatchHeader * pPatchHeader)
{
// Sanity checks
assert(hf->cbFileData == (pPatchHeader->dwXfrmBlockSize - SIZE_OF_XFRM_HEADER));
assert(hf->pbFileData != NULL);
hfFrom = hfFrom;
LPBYTE pbNewFileData;
DWORD cbNewFileData;
// Allocate space for new file data
cbNewFileData = pPatchHeader->dwXfrmBlockSize - SIZE_OF_XFRM_HEADER;
pbNewFileData = STORM_ALLOC(BYTE, cbNewFileData);
if(pbNewFileData == NULL)
return ERROR_NOT_ENOUGH_MEMORY;
// Copy the patch data as-is
memcpy(hf->pbFileData, (LPBYTE)pPatchHeader + sizeof(TPatchHeader), hf->cbFileData);
memcpy(pbNewFileData, (LPBYTE)pPatchHeader + sizeof(TPatchHeader), cbNewFileData);
// Free the old file data
STORM_FREE(hf->pbFileData);
// Put the new file data there
hf->pbFileData = pbNewFileData;
hf->cbFileData = cbNewFileData;
return ERROR_SUCCESS;
}
static int ApplyFilePatch_BSD0(
TMPQFile * hfFrom,
TMPQFile * hf,
TPatchHeader * pPatchHeader)
static int ApplyMpqPatch_BSD0(
TMPQFile * hf,
TPatchHeader * pPatchHeader)
{
PBLIZZARD_BSDIFF40_FILE pBsdiff;
LPDWORD pCtrlBlock;
LPBYTE pbPatchData = (LPBYTE)pPatchHeader + sizeof(TPatchHeader);
LPBYTE pDataBlock;
LPBYTE pExtraBlock;
LPBYTE pbOldData = hfFrom->pbFileData;
LPBYTE pbNewData = hf->pbFileData;
DWORD dwCombineSize;
LPBYTE pbNewData = NULL;
LPBYTE pbOldData = (LPBYTE)hf->pbFileData;
DWORD dwNewOffset = 0; // Current position to patch
DWORD dwOldOffset = 0; // Current source position
DWORD dwNewSize; // Patched file size
DWORD dwOldSize = hfFrom->cbFileData; // File size before patch
DWORD dwOldSize = hf->cbFileData; // File size before patch
// Get pointer to the patch header
// Format of BSDIFF header corresponds to original BSDIFF, which is:
@ -232,6 +245,11 @@ static int ApplyFilePatch_BSD0(
pExtraBlock = (LPBYTE)pbPatchData;
dwNewSize = (DWORD)BSWAP_INT64_UNSIGNED(pBsdiff->NewFileSize);
// Allocate new buffer
pbNewData = STORM_ALLOC(BYTE, dwNewSize);
if(pbNewData == NULL)
return ERROR_NOT_ENOUGH_MEMORY;
// Now patch the file
while(dwNewOffset < dwNewSize)
{
@ -242,26 +260,31 @@ static int ApplyFilePatch_BSD0(
// Sanity check
if((dwNewOffset + dwAddDataLength) > dwNewSize)
{
STORM_FREE(pbNewData);
return ERROR_FILE_CORRUPT;
}
// Read the diff string to the target buffer
memcpy(pbNewData + dwNewOffset, pDataBlock, dwAddDataLength);
pDataBlock += dwAddDataLength;
// Get the longest block that we can combine
dwCombineSize = ((dwOldOffset + dwAddDataLength) >= dwOldSize) ? (dwOldSize - dwOldOffset) : dwAddDataLength;
// Now combine the patch data with the original file
for(i = 0; i < dwCombineSize; i++)
pbNewData[dwNewOffset + i] = pbNewData[dwNewOffset + i] + pbOldData[dwOldOffset + i];
// Move the offsets
dwNewOffset += dwAddDataLength;
dwOldOffset += dwAddDataLength;
for(i = 0; i < dwAddDataLength; i++)
{
if(dwOldOffset < dwOldSize)
pbNewData[dwNewOffset] = pbNewData[dwNewOffset] + pbOldData[dwOldOffset];
dwNewOffset++;
dwOldOffset++;
}
// Sanity check
if((dwNewOffset + dwMovDataLength) > dwNewSize)
{
STORM_FREE(pbNewData);
return ERROR_FILE_CORRUPT;
}
// Copy the data from the extra block in BSDIFF patch
memcpy(pbNewData + dwNewOffset, pExtraBlock, dwMovDataLength);
@ -275,12 +298,17 @@ static int ApplyFilePatch_BSD0(
pCtrlBlock += 3;
}
// Success
// Free the old file data
STORM_FREE(hf->pbFileData);
// Put the new data to the fil structure
hf->pbFileData = pbNewData;
hf->cbFileData = dwNewSize;
return ERROR_SUCCESS;
}
static int LoadFilePatch(TMPQFile * hf)
static int LoadMpqPatch(TMPQFile * hf)
{
TPatchHeader PatchHeader;
DWORD dwBytesRead;
@ -300,7 +328,7 @@ static int LoadFilePatch(TMPQFile * hf)
PatchHeader.dwXfrmBlockSize = BSWAP_INT32_UNSIGNED(PatchHeader.dwXfrmBlockSize);
PatchHeader.dwPatchType = BSWAP_INT32_UNSIGNED(PatchHeader.dwPatchType);
if(PatchHeader.dwSignature != PATCH_SIGNATURE_HEADER || PatchHeader.dwMD5 != PATCH_SIGNATURE_MD5 || PatchHeader.dwXFRM != PATCH_SIGNATURE_XFRM)
if(PatchHeader.dwSignature != 0x48435450 || PatchHeader.dwMD5 != 0x5f35444d || PatchHeader.dwXFRM != 0x4d524658)
nError = ERROR_FILE_CORRUPT;
}
@ -309,65 +337,52 @@ static int LoadFilePatch(TMPQFile * hf)
{
switch(PatchHeader.dwPatchType)
{
case 0x59504f43: // 'COPY'
nError = LoadFilePatch_COPY(hf, &PatchHeader);
break;
case 0x59504f43: // 'COPY'
nError = LoadMpqPatch_COPY(hf, &PatchHeader);
break;
case 0x30445342: // 'BSD0'
nError = LoadFilePatch_BSD0(hf, &PatchHeader);
break;
case 0x30445342: // 'BSD0'
nError = LoadMpqPatch_BSD0(hf, &PatchHeader);
break;
default:
nError = ERROR_FILE_CORRUPT;
break;
default:
nError = ERROR_FILE_CORRUPT;
break;
}
}
return nError;
}
static int ApplyFilePatch(
TMPQFile * hfBase, // The file in the base MPQ
TMPQFile * hfPrev, // The file in the previous MPQ
TMPQFile * hf)
static int ApplyMpqPatch(
TMPQFile * hf,
TPatchHeader * pPatchHeader)
{
TPatchHeader * pPatchHeader = hf->pPatchHeader;
TMPQFile * hfFrom = NULL;
int nError = ERROR_SUCCESS;
// Sanity checks
assert(hf->pbFileData == NULL);
// Either take the base version or the previous version
if(!memcmp(hfBase->FileDataMD5, pPatchHeader->md5_before_patch, MD5_DIGEST_SIZE))
hfFrom = hfBase;
if(!memcmp(hfPrev->FileDataMD5, pPatchHeader->md5_before_patch, MD5_DIGEST_SIZE))
hfFrom = hfPrev;
if(hfFrom == NULL)
return ERROR_FILE_CORRUPT;
// Allocate the buffer for patched file content
hf->pbFileData = STORM_ALLOC(BYTE, pPatchHeader->dwSizeAfterPatch);
hf->cbFileData = pPatchHeader->dwSizeAfterPatch;
if(hf->pbFileData == NULL)
return ERROR_NOT_ENOUGH_MEMORY;
// Verify the original file before patching
if(pPatchHeader->dwSizeBeforePatch != 0)
{
if(!VerifyDataBlockHash(hf->pbFileData, hf->cbFileData, pPatchHeader->md5_before_patch))
nError = ERROR_FILE_CORRUPT;
}
// Apply the patch
if(nError == ERROR_SUCCESS)
{
switch(pPatchHeader->dwPatchType)
{
case 0x59504f43: // 'COPY'
nError = ApplyFilePatch_COPY(hfFrom, hf, pPatchHeader);
break;
case 0x59504f43: // 'COPY'
nError = ApplyMpqPatch_COPY(hf, pPatchHeader);
break;
case 0x30445342: // 'BSD0'
nError = ApplyFilePatch_BSD0(hfFrom, hf, pPatchHeader);
break;
case 0x30445342: // 'BSD0'
nError = ApplyMpqPatch_BSD0(hf, pPatchHeader);
break;
default:
nError = ERROR_FILE_CORRUPT;
break;
default:
nError = ERROR_FILE_CORRUPT;
break;
}
}
@ -377,267 +392,11 @@ static int ApplyFilePatch(
// Verify the patched file
if(!VerifyDataBlockHash(hf->pbFileData, hf->cbFileData, pPatchHeader->md5_after_patch))
nError = ERROR_FILE_CORRUPT;
// Copy the MD5 of the new block
memcpy(hf->FileDataMD5, pPatchHeader->md5_after_patch, MD5_DIGEST_SIZE);
}
return nError;
}
static void FreePatchData(TMPQFile * hf)
{
STORM_FREE(hf->pbFileData);
hf->pbFileData = NULL;
hf->cbFileData = 0;
STORM_FREE(hf->pPatchHeader);
hf->pPatchHeader = NULL;
}
//-----------------------------------------------------------------------------
// Local functions (patch prefix matching)
static TFileEntry * FindMd5ListFile(TMPQArchive * ha)
{
TFileEntry * pFileEntry = ha->pFileTable + ha->dwFileTableSize;
char * szLstName;
size_t nTryCount = 0;
size_t nLength;
// Check every file entry for "*-md5.lst".
// Go backwards, as the entry is usually at the end of the file table
while(pFileEntry > ha->pFileTable && nTryCount < 10)
{
// The file name must be valid
if(pFileEntry->szFileName != NULL)
{
// Get the name and length
szLstName = pFileEntry->szFileName;
nLength = strlen(szLstName);
// Check for the tail name
if(!_stricmp(szLstName + nLength - 8, "-md5.lst"))
return pFileEntry;
}
// Move back
pFileEntry--;
nTryCount++;
}
// Not found, sorry
return NULL;
}
static bool CreatePatchPrefix(TMPQArchive * ha, const char * szFileName, const char * szPrefixEnd)
{
TMPQNamePrefix * pNewPrefix;
size_t nLength;
// If the end of the patch prefix was not entered, find it
if(szFileName != NULL && szPrefixEnd == NULL)
szPrefixEnd = szFileName + strlen(szFileName);
// Create the patch prefix
nLength = (szPrefixEnd - szFileName);
pNewPrefix = (TMPQNamePrefix *)STORM_ALLOC(BYTE, sizeof(TMPQNamePrefix) + nLength);
if(pNewPrefix != NULL)
{
// Fill the name prefix
pNewPrefix->nLength = nLength;
pNewPrefix->szPatchPrefix[0] = 0;
// Fill the name prefix. Also add the backslash
if(szFileName && nLength)
{
memcpy(pNewPrefix->szPatchPrefix, szFileName, nLength);
pNewPrefix->szPatchPrefix[nLength] = 0;
}
}
ha->pPatchPrefix = pNewPrefix;
return (pNewPrefix != NULL);
}
static bool IsMatchingPatchFile(
TMPQArchive * ha,
const char * szFileName,
LPBYTE pbFileMd5)
{
TPatchHeader PatchHeader = {0};
HANDLE hFile = NULL;
DWORD dwTransferred = 0;
bool bResult = false;
// Open the file and load the patch header
if(SFileOpenFileEx((HANDLE)ha, szFileName, SFILE_OPEN_BASE_FILE, &hFile))
{
// Load the patch header
SFileReadFile(hFile, &PatchHeader, sizeof(TPatchHeader), &dwTransferred, NULL);
BSWAP_ARRAY32_UNSIGNED(pPatchHeader, sizeof(DWORD) * 6);
// If the file contains an incremental patch,
// compare the "MD5 before patching" with the base file MD5
if(dwTransferred == sizeof(TPatchHeader) && PatchHeader.dwSignature == PATCH_SIGNATURE_HEADER)
bResult = (!memcmp(PatchHeader.md5_before_patch, pbFileMd5, MD5_DIGEST_SIZE));
// Close the file
SFileCloseFile(hFile);
}
return bResult;
}
static const char * GetLstFileLanguage(const char * szFileName)
{
char szLstSuffix[0x80];
size_t nLength;
size_t nSuffixLength;
// Each language-dependent file ends with "xxXX-md5.lst"
nLength = strlen(szFileName);
if(nLength < 12)
return NULL;
// Try each and every possibility
for(size_t i = 0; LanguageList[i] != NULL; i++)
{
nSuffixLength = sprintf(szLstSuffix, "%s-md5.lst", LanguageList[i]);
assert(nSuffixLength == 12);
if(!_stricmp(szFileName + nLength - nSuffixLength, szLstSuffix))
return LanguageList[i];
}
return NULL;
}
static bool FindPatchPrefix_WoW_13164_13623(TMPQArchive * haBase, TMPQArchive * haPatch)
{
TFileEntry * pFileEntry;
const char * szFilePrefix = "Base";
const char * szLanguage;
char szNamePrefix[0x10];
int nLength;
// Find a *-md5.lst file in the base archive
pFileEntry = FindMd5ListFile(haBase);
if(pFileEntry == NULL)
return false;
// Language-specific MPQs have the language identifier right before extension
szLanguage = GetLstFileLanguage(pFileEntry->szFileName);
if(szLanguage != NULL)
szFilePrefix = szLanguage;
// Format the name prefix
nLength = sprintf(szNamePrefix, "%s\\", szFilePrefix);
return CreatePatchPrefix(haPatch, szNamePrefix, &szNamePrefix[nLength]);
}
//
// Find match in Starcraft II patch MPQs
// Match a LST file in the root directory if the MPQ with any of the file in subdirectories
//
// The problem:
// Base: enGB-md5.lst
// Patch: Campaigns\Liberty.SC2Campaign\enGB.SC2Assets\enGB-md5.lst
// Campaigns\Liberty.SC2Campaign\enGB.SC2Data\enGB-md5.lst
// Campaigns\LibertyStory.SC2Campaign\enGB.SC2Data\enGB-md5.lst
// Campaigns\LibertyStory.SC2Campaign\enGB.SC2Data\enGB-md5.lst Mods\Core.SC2Mod\enGB.SC2Assets\enGB-md5.lst
// Mods\Core.SC2Mod\enGB.SC2Data\enGB-md5.lst
// Mods\Liberty.SC2Mod\enGB.SC2Assets\enGB-md5.lst
// Mods\Liberty.SC2Mod\enGB.SC2Data\enGB-md5.lst
// Mods\LibertyMulti.SC2Mod\enGB.SC2Data\enGB-md5.lst
//
// Solution:
// We need to match the file by its MD5
//
static bool FindPatchPrefix_SC2(TMPQArchive * haBase, TMPQArchive * haPatch)
{
TFileEntry * pFileTableEnd;
TFileEntry * pFileEntry;
TFileEntry * pBaseEntry;
const char * szPlainName;
char * szLstFileName;
size_t cchWorkBuffer = 0x400;
size_t cchBaseName;
size_t cchDirName;
bool bResult = false;
// Find a *-md5.lst file in the base archive
pBaseEntry = FindMd5ListFile(haBase);
if(pBaseEntry == NULL)
return false;
cchBaseName = strlen(pBaseEntry->szFileName) + 1;
// Allocate working buffer for merging LST file
szLstFileName = STORM_ALLOC(char, cchWorkBuffer);
if(szLstFileName != NULL)
{
// Find that file in the patch MPQ
pFileTableEnd = haPatch->pFileTable + haPatch->dwFileTableSize;
for(pFileEntry = haPatch->pFileTable; pFileEntry < pFileTableEnd; pFileEntry++)
{
// Find the "(patch_metadata)" file within that folder
// Note that the file is always relatively small and contains the patch prefix
// Checking for file size greatly speeds up the search process
if(pFileEntry->szFileName && !(pFileEntry->dwFlags & MPQ_FILE_PATCH_FILE) && (0 < pFileEntry->dwFileSize && pFileEntry->dwFileSize < 0x40))
{
// If the plain file name matches, we need to check its MD5
szPlainName = GetPlainFileName(pFileEntry->szFileName);
cchDirName = (size_t)(szPlainName - pFileEntry->szFileName);
// The file name must not too long and must be PATCH_METADATA_NAME
if((cchDirName + cchBaseName) < cchWorkBuffer && _stricmp(szPlainName, PATCH_METADATA_NAME) == 0)
{
// Construct the name of the eventuall LST file
memcpy(szLstFileName, pFileEntry->szFileName, cchDirName);
memcpy(szLstFileName + cchDirName, pBaseEntry->szFileName, cchBaseName);
// If there is the "*-md5.lst" file in that directory, we check its MD5
if(IsMatchingPatchFile(haPatch, szLstFileName, pBaseEntry->md5))
{
bResult = CreatePatchPrefix(haPatch, pFileEntry->szFileName, szPlainName);
break;
}
}
}
}
// Free the work buffer
STORM_FREE(szLstFileName);
}
return bResult;
}
static bool FindPatchPrefix(TMPQArchive * haBase, TMPQArchive * haPatch, const char * szPatchPathPrefix)
{
// If the patch prefix was explicitly entered, we use that one
if(szPatchPathPrefix != NULL)
return CreatePatchPrefix(haPatch, szPatchPathPrefix, szPatchPathPrefix + strlen(szPatchPathPrefix));
// Patches for World of Warcraft - mostly the do not use prefix.
// Those who do, they have the (patch_metadata) file present in the "base" subdirectory.
// All patches that use patch prefix have the "base\\(patch_metadata) file present
if(GetFileEntryAny(haPatch, "base\\" PATCH_METADATA_NAME))
return FindPatchPrefix_WoW_13164_13623(haBase, haPatch);
// Updates for Starcraft II
// Match: LocalizedData\GameHotkeys.txt <==> Campaigns\Liberty.SC2Campaign\enGB.SC2Data\LocalizedData\GameHotkeys.txt
// All Starcraft II base archives seem to have the file "StreamingBuckets.txt" present
if(GetFileEntryAny(haBase, "StreamingBuckets.txt"))
return FindPatchPrefix_SC2(haBase, haPatch);
// Diablo III patch MPQs don't use patch prefix
// Hearthstone MPQs don't use patch prefix
CreatePatchPrefix(haPatch, NULL, NULL);
return true;
}
//-----------------------------------------------------------------------------
// Public functions (StormLib internals)
@ -666,75 +425,34 @@ bool IsIncrementalPatchFile(const void * pvData, DWORD cbData, LPDWORD pdwPatche
return false;
}
//
// Note: The patch may either be applied to the base file or to the previous version
// In Starcraft II, Mods\Core.SC2Mod\Base.SC2Data, file StreamingBuckets.txt:
//
// Base file MD5: 31376b0344b6df59ad009d4296125539
//
// s2-update-base-23258: from 31376b0344b6df59ad009d4296125539 to 941a82683452e54bf024a8d491501824
// s2-update-base-24540: from 31376b0344b6df59ad009d4296125539 to 941a82683452e54bf024a8d491501824
// s2-update-base-26147: from 31376b0344b6df59ad009d4296125539 to d5d5253c762fac6b9761240288a0771a
// s2-update-base-28522: from 31376b0344b6df59ad009d4296125539 to 5a76c4b356920aab7afd22e0e1913d7a
// s2-update-base-30508: from 31376b0344b6df59ad009d4296125539 to 8cb0d4799893fe801cc78ae4488a3671
// s2-update-base-32283: from 31376b0344b6df59ad009d4296125539 to 8cb0d4799893fe801cc78ae4488a3671
//
// We don't keep all intermediate versions in memory, as it would cause massive
// memory usage during patching process. A prime example is the file
// DBFilesClient\\Item-Sparse.db2 from locale-enGB.MPQ (WoW 16965), which has
// 9 patches in a row, each requiring 70 MB memory (35 MB patch data + 35 MB work buffer)
//
int PatchFileData(TMPQFile * hf)
{
TMPQFile * hfBase = hf;
TMPQFile * hfPrev = hf;
int nError = ERROR_SUCCESS;
// We need to calculate the MD5 of the entire file
assert(hf->pbFileData != NULL);
assert(hf->cbFileData != 0);
CalculateDataBlockHash(hf->pbFileData, hf->cbFileData, hf->FileDataMD5);
// Move to the first patch
hf = hf->hfPatchFile;
// Apply all patches
for(hf = hf->hfPatch; hf != NULL; hf = hf->hfPatch)
// Now go through all patches and patch the original data
while(hf != NULL)
{
// This must be true
assert(hf->pFileEntry->dwFlags & MPQ_FILE_PATCH_FILE);
// Make sure that the patch data is loaded
nError = LoadFilePatch(hf);
nError = LoadMpqPatch(hf);
if(nError != ERROR_SUCCESS)
break;
// Apply the patch
nError = ApplyFilePatch(hfBase, hfPrev, hf);
nError = ApplyMpqPatch(hfBase, hf->pPatchHeader);
if(nError != ERROR_SUCCESS)
break;
// Only keep base file version and previous version
if(hfPrev != hfBase)
FreePatchData(hfPrev);
// Is this the last patch in the chain?
if(hf->hfPatch == NULL)
break;
hfPrev = hf;
// Move to the next patch
hf = hf->hfPatchFile;
}
// When done, we need to rewrite the base file data
// with the last of the patch chain
if(nError == ERROR_SUCCESS)
{
// Free the base file data
STORM_FREE(hfBase->pbFileData);
// Switch the latest patched data to the base file
hfBase->pbFileData = hf->pbFileData;
hfBase->cbFileData = hf->cbFileData;
hf->pbFileData = NULL;
hf->cbFileData = 0;
}
return nError;
}
@ -760,25 +478,34 @@ int PatchFileData(TMPQFile * hf)
//
bool WINAPI SFileOpenPatchArchive(
HANDLE hMpq,
const TCHAR * szPatchMpqName,
const char * szPatchPathPrefix,
DWORD dwFlags)
HANDLE hMpq,
const TCHAR * szPatchMpqName,
const char * szPatchPathPrefix,
DWORD dwFlags)
{
TMPQArchive * haPatch;
TMPQArchive * ha = (TMPQArchive *)hMpq;
HANDLE hPatchMpq = NULL;
char szPatchPrefixBuff[MPQ_PATCH_PREFIX_LEN];
int nError = ERROR_SUCCESS;
// Keep compiler happy
dwFlags = dwFlags;
// Verify input parameters
if(!IsValidMpqHandle(hMpq))
if(!IsValidMpqHandle(ha))
nError = ERROR_INVALID_HANDLE;
if(szPatchMpqName == NULL || *szPatchMpqName == 0)
nError = ERROR_INVALID_PARAMETER;
// If the user didn't give the patch prefix, get default one
if(szPatchPathPrefix != NULL)
{
// Save length of the patch prefix
if(strlen(szPatchPathPrefix) > MPQ_PATCH_PREFIX_LEN - 2)
nError = ERROR_INVALID_PARAMETER;
}
//
// We don't allow adding patches to archives that have been open for write
//
@ -793,19 +520,38 @@ bool WINAPI SFileOpenPatchArchive(
if(nError == ERROR_SUCCESS)
{
if(!(ha->dwFlags & MPQ_FLAG_READ_ONLY))
if(!FileStream_IsReadOnly(ha->pStream))
nError = ERROR_ACCESS_DENIED;
}
// Open the archive like it is normal archive
if(nError == ERROR_SUCCESS)
{
if(!SFileOpenArchive(szPatchMpqName, 0, MPQ_OPEN_READ_ONLY | MPQ_OPEN_PATCH, &hPatchMpq))
if(!SFileOpenArchive(szPatchMpqName, 0, MPQ_OPEN_READ_ONLY, &hPatchMpq))
return false;
haPatch = (TMPQArchive *)hPatchMpq;
// We need to remember the proper patch prefix to match names of patched files
FindPatchPrefix(ha, (TMPQArchive *)hPatchMpq, szPatchPathPrefix);
// Older WoW patches (build 13914) used to have
// several language versions in one patch file
// Those patches needed to have a path prefix
// We can distinguish such patches by not having the (patch_metadata) file
if(szPatchPathPrefix == NULL)
{
if(!SFileHasFile(hPatchMpq, PATCH_METADATA_NAME))
{
GetDefaultPatchPrefix(FileStream_GetFileName(ha->pStream), szPatchPrefixBuff);
szPatchPathPrefix = szPatchPrefixBuff;
}
}
// Save the prefix for patch file names.
// Make sure that there is backslash after it
if(szPatchPathPrefix != NULL && *szPatchPathPrefix != 0)
{
strcpy(haPatch->szPatchPrefix, szPatchPathPrefix);
strcat(haPatch->szPatchPrefix, "\\");
haPatch->cchPatchPrefix = strlen(haPatch->szPatchPrefix);
}
// Now add the patch archive to the list of patches to the original MPQ
while(ha != NULL)
@ -834,7 +580,7 @@ bool WINAPI SFileIsPatchedArchive(HANDLE hMpq)
TMPQArchive * ha = (TMPQArchive *)hMpq;
// Verify input parameters
if(!IsValidMpqHandle(hMpq))
if(!IsValidMpqHandle(ha))
return false;
return (ha->haPatch != NULL);

File diff suppressed because it is too large Load diff

View file

@ -20,83 +20,89 @@
//-----------------------------------------------------------------------------
// Local defines
#define SIGNATURE_TYPE_NONE 0
#define SIGNATURE_TYPE_WEAK 1
#define SIGNATURE_TYPE_STRONG 2
#define MPQ_DIGEST_UNIT_SIZE 0x10000
typedef struct _MPQ_SIGNATURE_INFO
{
ULONGLONG BeginMpqData; // File offset where the hashing starts
ULONGLONG BeginExclude; // Begin of the excluded area (used for (signature) file)
ULONGLONG EndExclude; // End of the excluded area (used for (signature) file)
ULONGLONG EndMpqData; // File offset where the hashing ends
ULONGLONG EndOfFile; // Size of the entire file
BYTE Signature[MPQ_STRONG_SIGNATURE_SIZE + 0x10];
DWORD cbSignatureSize; // Length of the signature
int nSignatureType; // See SIGNATURE_TYPE_XXX
} MPQ_SIGNATURE_INFO, *PMPQ_SIGNATURE_INFO;
//-----------------------------------------------------------------------------
// Known Blizzard public keys
// Created by Jean-Francois Roy using OpenSSL
static const char * szBlizzardWeakPrivateKey =
"-----BEGIN PRIVATE KEY-----"
"MIIBOQIBAAJBAJJidwS/uILMBSO5DLGsBFknIXWWjQJe2kfdfEk3G/j66w4KkhZ1"
"V61Rt4zLaMVCYpDun7FLwRjkMDSepO1q2DcCAwEAAQJANtiztVDMJh2hE1hjPDKy"
"UmEJ9U/aN3gomuKOjbQbQ/bWWcM/WfhSVHmPqtqh/bQI2UXFr0rnXngeteZHLr/b"
"8QIhAMuWriSKGMACw18/rVVfUrThs915odKBH1Alr3vMVVzZAiEAuBHPSQkgwcb6"
"L4MWaiKuOzq08mSyNqPeN8oSy18q848CIHeMn+3s+eOmu7su1UYQl6yH7OrdBd1q"
"3UxfFNEJiAbhAiAqxdCyOxHGlbM7aS3DOg3cq5ayoN2cvtV7h1R4t8OmVwIgF+5z"
"/6vkzBUsZhd8Nwyis+MeQYH0rpFpMKdTlqmPF2Q="
"-----END PRIVATE KEY-----";
static const char * szBlizzardWeakPublicKey =
"-----BEGIN PUBLIC KEY-----"
"MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAJJidwS/uILMBSO5DLGsBFknIXWWjQJe"
"2kfdfEk3G/j66w4KkhZ1V61Rt4zLaMVCYpDun7FLwRjkMDSepO1q2DcCAwEAAQ=="
"-----END PUBLIC KEY-----";
"-----BEGIN PUBLIC KEY-----"
"MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAJJidwS/uILMBSO5DLGsBFknIXWWjQJe"
"2kfdfEk3G/j66w4KkhZ1V61Rt4zLaMVCYpDun7FLwRjkMDSepO1q2DcCAwEAAQ=="
"-----END PUBLIC KEY-----";
static const char * szBlizzardStrongPublicKey =
"-----BEGIN PUBLIC KEY-----"
"MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAsQZ+ziT2h8h+J/iMQpgd"
"tH1HaJzOBE3agjU4yMPcrixaPOZoA4t8bwfey7qczfWywocYo3pleytFF+IuD4HD"
"Fl9OXN1SFyupSgMx1EGZlgbFAomnbq9MQJyMqQtMhRAjFgg4TndS7YNb+JMSAEKp"
"kXNqY28n/EVBHD5TsMuVCL579gIenbr61dI92DDEdy790IzIG0VKWLh/KOTcTJfm"
"Ds/7HQTkGouVW+WUsfekuqNQo7ND9DBnhLjLjptxeFE2AZqYcA1ao3S9LN3GL1tW"
"lVXFIX9c7fWqaVTQlZ2oNsI/ARVApOK3grNgqvwH6YoVYVXjNJEo5sQJsPsdV/hk"
"dwIDAQAB"
"-----END PUBLIC KEY-----";
"-----BEGIN PUBLIC KEY-----"
"MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAsQZ+ziT2h8h+J/iMQpgd"
"tH1HaJzOBE3agjU4yMPcrixaPOZoA4t8bwfey7qczfWywocYo3pleytFF+IuD4HD"
"Fl9OXN1SFyupSgMx1EGZlgbFAomnbq9MQJyMqQtMhRAjFgg4TndS7YNb+JMSAEKp"
"kXNqY28n/EVBHD5TsMuVCL579gIenbr61dI92DDEdy790IzIG0VKWLh/KOTcTJfm"
"Ds/7HQTkGouVW+WUsfekuqNQo7ND9DBnhLjLjptxeFE2AZqYcA1ao3S9LN3GL1tW"
"lVXFIX9c7fWqaVTQlZ2oNsI/ARVApOK3grNgqvwH6YoVYVXjNJEo5sQJsPsdV/hk"
"dwIDAQAB"
"-----END PUBLIC KEY-----";
static const char * szWarcraft3MapPublicKey =
"-----BEGIN PUBLIC KEY-----"
"MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA1BwklUUQ3UvjizOBRoF5"
"yyOVc7KD+oGOQH5i6eUk1yfs0luCC70kNucNrfqhmviywVtahRse1JtXCPrx2bd3"
"iN8Dx91fbkxjYIOGTsjYoHKTp0BbaFkJih776fcHgnFSb+7mJcDuJVvJOXxEH6w0"
"1vo6VtujCqj1arqbyoal+xtAaczF3us5cOEp45sR1zAWTn1+7omN7VWV4QqJPaDS"
"gBSESc0l1grO0i1VUSumayk7yBKIkb+LBvcG6WnYZHCi7VdLmaxER5m8oZfER66b"
"heHoiSQIZf9PAY6Guw2DT5BTc54j/AaLQAKf2qcRSgQLVo5kQaddF3rCpsXoB/74"
"6QIDAQAB"
"-----END PUBLIC KEY-----";
"-----BEGIN PUBLIC KEY-----"
"MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA1BwklUUQ3UvjizOBRoF5"
"yyOVc7KD+oGOQH5i6eUk1yfs0luCC70kNucNrfqhmviywVtahRse1JtXCPrx2bd3"
"iN8Dx91fbkxjYIOGTsjYoHKTp0BbaFkJih776fcHgnFSb+7mJcDuJVvJOXxEH6w0"
"1vo6VtujCqj1arqbyoal+xtAaczF3us5cOEp45sR1zAWTn1+7omN7VWV4QqJPaDS"
"gBSESc0l1grO0i1VUSumayk7yBKIkb+LBvcG6WnYZHCi7VdLmaxER5m8oZfER66b"
"heHoiSQIZf9PAY6Guw2DT5BTc54j/AaLQAKf2qcRSgQLVo5kQaddF3rCpsXoB/74"
"6QIDAQAB"
"-----END PUBLIC KEY-----";
static const char * szWowPatchPublicKey =
"-----BEGIN PUBLIC KEY-----"
"MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAwOsMV0LagAWPEtEQM6b9"
"6FHFkUyGbbyda2/Dfc9dyl21E9QvX+Yw7qKRMAKPzA2TlQQLZKvXpnKXF/YIK5xa"
"5uwg9CEHCEAYolLG4xn0FUOE0E/0PuuytI0p0ICe6rk00PifZzTr8na2wI/l/GnQ"
"bvnIVF1ck6cslATpQJ5JJVMXzoFlUABS19WESw4MXuJAS3AbMhxNWdEhVv7eO51c"
"yGjRLy9QjogZODZTY0fSEksgBqQxNCoYVJYI/sF5K2flDsGqrIp0OdJ6teJlzg1Y"
"UjYnb6bKjlidXoHEXI2TgA/mD6O3XFIt08I9s3crOCTgICq7cgX35qrZiIVWZdRv"
"TwIDAQAB"
"-----END PUBLIC KEY-----";
"-----BEGIN PUBLIC KEY-----"
"MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAwOsMV0LagAWPEtEQM6b9"
"6FHFkUyGbbyda2/Dfc9dyl21E9QvX+Yw7qKRMAKPzA2TlQQLZKvXpnKXF/YIK5xa"
"5uwg9CEHCEAYolLG4xn0FUOE0E/0PuuytI0p0ICe6rk00PifZzTr8na2wI/l/GnQ"
"bvnIVF1ck6cslATpQJ5JJVMXzoFlUABS19WESw4MXuJAS3AbMhxNWdEhVv7eO51c"
"yGjRLy9QjogZODZTY0fSEksgBqQxNCoYVJYI/sF5K2flDsGqrIp0OdJ6teJlzg1Y"
"UjYnb6bKjlidXoHEXI2TgA/mD6O3XFIt08I9s3crOCTgICq7cgX35qrZiIVWZdRv"
"TwIDAQAB"
"-----END PUBLIC KEY-----";
static const char * szWowSurveyPublicKey =
"-----BEGIN PUBLIC KEY-----"
"MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAnIt1DR6nRyyKsy2qahHe"
"MKLtacatn/KxieHcwH87wLBxKy+jZ0gycTmJ7SaTdBAEMDs/V5IPIXEtoqYnid2c"
"63TmfGDU92oc3Ph1PWUZ2PWxBhT06HYxRdbrgHw9/I29pNPi/607x+lzPORITOgU"
"BR6MR8au8HsQP4bn4vkJNgnSgojh48/XQOB/cAln7As1neP61NmVimoLR4Bwi3zt"
"zfgrZaUpyeNCUrOYJmH09YIjbBySTtXOUidoPHjFrMsCWpr6xs8xbETbs7MJFL6a"
"vcUfTT67qfIZ9RsuKfnXJTIrV0kwDSjjuNXiPTmWAehSsiHIsrUXX5RNcwsSjClr"
"nQIDAQAB"
"-----END PUBLIC KEY-----";
"-----BEGIN PUBLIC KEY-----"
"MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAnIt1DR6nRyyKsy2qahHe"
"MKLtacatn/KxieHcwH87wLBxKy+jZ0gycTmJ7SaTdBAEMDs/V5IPIXEtoqYnid2c"
"63TmfGDU92oc3Ph1PWUZ2PWxBhT06HYxRdbrgHw9/I29pNPi/607x+lzPORITOgU"
"BR6MR8au8HsQP4bn4vkJNgnSgojh48/XQOB/cAln7As1neP61NmVimoLR4Bwi3zt"
"zfgrZaUpyeNCUrOYJmH09YIjbBySTtXOUidoPHjFrMsCWpr6xs8xbETbs7MJFL6a"
"vcUfTT67qfIZ9RsuKfnXJTIrV0kwDSjjuNXiPTmWAehSsiHIsrUXX5RNcwsSjClr"
"nQIDAQAB"
"-----END PUBLIC KEY-----";
static const char * szStarcraft2MapPublicKey =
"-----BEGIN PUBLIC KEY-----"
"MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAmk4GT8zb+ICC25a17KZB"
"q/ygKGJ2VSO6IT5PGHJlm1KfnHBA4B6SH3xMlJ4c6eG2k7QevZv+FOhjsAHubyWq"
"2VKqWbrIFKv2ILc2RfMn8J9EDVRxvcxh6slRrVL69D0w1tfVGjMiKq2Fym5yGoRT"
"E7CRgDqbAbXP9LBsCNWHiJLwfxMGzHbk8pIl9oia5pvM7ofZamSHchxlpy6xa4GJ"
"7xKN01YCNvklTL1D7uol3wkwcHc7vrF8QwuJizuA5bSg4poEGtH62BZOYi+UL/z0"
"31YK+k9CbQyM0X0pJoJoYz1TK+Y5J7vBnXCZtfcTYQ/ZzN6UcxTa57dJaiOlCh9z"
"nQIDAQAB"
"-----END PUBLIC KEY-----";
"-----BEGIN PUBLIC KEY-----"
"MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAmk4GT8zb+ICC25a17KZB"
"q/ygKGJ2VSO6IT5PGHJlm1KfnHBA4B6SH3xMlJ4c6eG2k7QevZv+FOhjsAHubyWq"
"2VKqWbrIFKv2ILc2RfMn8J9EDVRxvcxh6slRrVL69D0w1tfVGjMiKq2Fym5yGoRT"
"E7CRgDqbAbXP9LBsCNWHiJLwfxMGzHbk8pIl9oia5pvM7ofZamSHchxlpy6xa4GJ"
"7xKN01YCNvklTL1D7uol3wkwcHc7vrF8QwuJizuA5bSg4poEGtH62BZOYi+UL/z0"
"31YK+k9CbQyM0X0pJoJoYz1TK+Y5J7vBnXCZtfcTYQ/ZzN6UcxTa57dJaiOlCh9z"
"nQIDAQAB"
"-----END PUBLIC KEY-----";
//-----------------------------------------------------------------------------
// Local functions
@ -113,6 +119,13 @@ static void memrev(unsigned char *buf, size_t count)
}
}
static bool is_valid_md5(void * pvMd5)
{
LPDWORD Md5 = (LPDWORD)pvMd5;
return (Md5[0] | Md5[1] | Md5[2] | Md5[3]) ? true : false;
}
static bool decode_base64_key(const char * szKeyBase64, rsa_key * key)
{
unsigned char decoded_key[0x200];
@ -140,10 +153,10 @@ static bool decode_base64_key(const char * szKeyBase64, rsa_key * key)
}
static void GetPlainAnsiFileName(
const TCHAR * szFileName,
char * szPlainName)
const TCHAR * szFileName,
char * szPlainName)
{
const TCHAR * szPlainNameT = GetPlainFileName(szFileName);
const TCHAR * szPlainNameT = GetPlainFileNameT(szFileName);
// Convert the plain name to ANSI
while(*szPlainNameT != 0)
@ -153,8 +166,8 @@ static void GetPlainAnsiFileName(
// Calculate begin and end of the MPQ archive
static void CalculateArchiveRange(
TMPQArchive * ha,
PMPQ_SIGNATURE_INFO pSI)
TMPQArchive * ha,
PMPQ_SIGNATURE_INFO pSI)
{
ULONGLONG TempPos = 0;
char szMapHeader[0x200];
@ -173,17 +186,71 @@ static void CalculateArchiveRange(
}
}
// Get the MPQ data end. This is stored in the MPQ header
// Get the MPQ data end. This is stored in our MPQ header,
// and it's been already prepared by SFileOpenArchive,
pSI->EndMpqData = ha->MpqPos + ha->pHeader->ArchiveSize64;
// Get the size of the entire file
FileStream_GetSize(ha->pStream, &pSI->EndOfFile);
}
static bool QueryMpqSignatureInfo(
TMPQArchive * ha,
PMPQ_SIGNATURE_INFO pSI)
{
ULONGLONG ExtraBytes;
TMPQFile * hf;
HANDLE hFile;
DWORD dwFileSize;
// Calculate the range of the MPQ
CalculateArchiveRange(ha, pSI);
// If there is "(signature)" file in the MPQ, it has a weak signature
if(SFileOpenFileEx((HANDLE)ha, SIGNATURE_NAME, SFILE_OPEN_FROM_MPQ, &hFile))
{
// Get the content of the signature
SFileReadFile(hFile, pSI->Signature, sizeof(pSI->Signature), &pSI->cbSignatureSize, NULL);
// Verify the size of the signature
hf = (TMPQFile *)hFile;
// We have to exclude the signature file from the digest
pSI->BeginExclude = ha->MpqPos + hf->pFileEntry->ByteOffset;
pSI->EndExclude = pSI->BeginExclude + hf->pFileEntry->dwCmpSize;
dwFileSize = hf->dwDataSize;
// Close the file
SFileCloseFile(hFile);
pSI->nSignatureType = SIGNATURE_TYPE_WEAK;
return (dwFileSize == (MPQ_WEAK_SIGNATURE_SIZE + 8)) ? true : false;
}
// If there is extra bytes beyond the end of the archive,
// it's the strong signature
ExtraBytes = pSI->EndOfFile - pSI->EndMpqData;
if(ExtraBytes >= (MPQ_STRONG_SIGNATURE_SIZE + 4))
{
// Read the strong signature
if(!FileStream_Read(ha->pStream, &pSI->EndMpqData, pSI->Signature, (MPQ_STRONG_SIGNATURE_SIZE + 4)))
return false;
// Check the signature header "NGIS"
if(pSI->Signature[0] != 'N' || pSI->Signature[1] != 'G' || pSI->Signature[2] != 'I' || pSI->Signature[3] != 'S')
return false;
pSI->nSignatureType = SIGNATURE_TYPE_STRONG;
return true;
}
// Succeeded, but no known signature found
return true;
}
static bool CalculateMpqHashMd5(
TMPQArchive * ha,
PMPQ_SIGNATURE_INFO pSI,
LPBYTE pMd5Digest)
TMPQArchive * ha,
PMPQ_SIGNATURE_INFO pSI,
LPBYTE pMd5Digest)
{
hash_state md5_state;
ULONGLONG BeginBuffer;
@ -216,7 +283,7 @@ static bool CalculateMpqHashMd5(
if(dwToRead == 0)
break;
// Read the next chunk
// Read the next chunk
if(!FileStream_Read(ha->pStream, &BeginBuffer, pbDigestBuffer, dwToRead))
{
STORM_FREE(pbDigestBuffer);
@ -257,18 +324,17 @@ static bool CalculateMpqHashMd5(
}
static void AddTailToSha1(
hash_state * psha1_state,
const char * szTail)
hash_state * psha1_state,
const char * szTail)
{
unsigned char * pbTail = (unsigned char *)szTail;
unsigned char szUpperCase[0x200];
unsigned long nLength = 0;
// Convert the tail to uppercase
// Note that we don't need to terminate the string with zero
while(*pbTail != 0)
while(*szTail != 0)
{
szUpperCase[nLength++] = AsciiToUpperTable[*pbTail++];
szUpperCase[nLength++] = (unsigned char)toupper(*szTail++);
}
// Append the tail to the SHA1
@ -276,11 +342,11 @@ static void AddTailToSha1(
}
static bool CalculateMpqHashSha1(
TMPQArchive * ha,
PMPQ_SIGNATURE_INFO pSI,
unsigned char * sha1_tail0,
unsigned char * sha1_tail1,
unsigned char * sha1_tail2)
TMPQArchive * ha,
PMPQ_SIGNATURE_INFO pSI,
unsigned char * sha1_tail0,
unsigned char * sha1_tail1,
unsigned char * sha1_tail2)
{
ULONGLONG BeginBuffer;
hash_state sha1_state_temp;
@ -312,7 +378,7 @@ static bool CalculateMpqHashSha1(
if(dwToRead == 0)
break;
// Read the next chunk
// Read the next chunk
if(!FileStream_Read(ha->pStream, &BeginBuffer, pbDigestBuffer, dwToRead))
{
STORM_FREE(pbDigestBuffer);
@ -345,9 +411,9 @@ static bool CalculateMpqHashSha1(
}
static int VerifyRawMpqData(
TMPQArchive * ha,
ULONGLONG ByteOffset,
DWORD dwDataSize)
TMPQArchive * ha,
ULONGLONG ByteOffset,
DWORD dwDataSize)
{
ULONGLONG DataOffset = ha->MpqPos + ByteOffset;
LPBYTE pbDataChunk;
@ -433,8 +499,8 @@ static int VerifyRawMpqData(
}
static DWORD VerifyWeakSignature(
TMPQArchive * ha,
PMPQ_SIGNATURE_INFO pSI)
TMPQArchive * ha,
PMPQ_SIGNATURE_INFO pSI)
{
BYTE RevSignature[MPQ_WEAK_SIGNATURE_SIZE];
BYTE Md5Digest[MD5_DIGEST_SIZE];
@ -461,9 +527,9 @@ static DWORD VerifyWeakSignature(
}
static DWORD VerifyStrongSignatureWithKey(
unsigned char * reversed_signature,
unsigned char * padded_digest,
const char * szPublicKey)
unsigned char * reversed_signature,
unsigned char * padded_digest,
const char * szPublicKey)
{
rsa_key key;
int result = 0;
@ -478,15 +544,15 @@ static DWORD VerifyStrongSignatureWithKey(
// Verify the signature
if(rsa_verify_simple(reversed_signature, MPQ_STRONG_SIGNATURE_SIZE, padded_digest, MPQ_STRONG_SIGNATURE_SIZE, &result, &key) != CRYPT_OK)
return ERROR_VERIFY_FAILED;
// Free the key and return result
rsa_free(&key);
return result ? ERROR_STRONG_SIGNATURE_OK : ERROR_STRONG_SIGNATURE_ERROR;
}
static DWORD VerifyStrongSignature(
TMPQArchive * ha,
PMPQ_SIGNATURE_INFO pSI)
TMPQArchive * ha,
PMPQ_SIGNATURE_INFO pSI)
{
unsigned char reversed_signature[MPQ_STRONG_SIGNATURE_SIZE];
unsigned char Sha1Digest_tail0[SHA1_DIGEST_SIZE];
@ -548,11 +614,11 @@ static DWORD VerifyStrongSignature(
}
static DWORD VerifyFile(
HANDLE hMpq,
const char * szFileName,
LPDWORD pdwCrc32,
char * pMD5,
DWORD dwFlags)
HANDLE hMpq,
const char * szFileName,
LPDWORD pdwCrc32,
char * pMD5,
DWORD dwFlags)
{
hash_state md5_state;
unsigned char * pFileMd5;
@ -562,17 +628,14 @@ static DWORD VerifyFile(
BYTE Buffer[0x1000];
HANDLE hFile = NULL;
DWORD dwVerifyResult = 0;
DWORD dwSearchScope = SFILE_OPEN_FROM_MPQ;
DWORD dwTotalBytes = 0;
DWORD dwBytesRead;
DWORD dwCrc32 = 0;
//
// Note: When the MPQ is patched, it will
// automatically check the patched version of the file
//
// Make sure the md5 is initialized
memset(md5, 0, sizeof(md5));
// Fix the open type for patched archives
if(SFileIsPatchedArchive(hMpq))
dwSearchScope = SFILE_OPEN_PATCHED_FILE;
// If we have to verify raw data MD5, do it before file open
if(dwFlags & SFILE_VERIFY_RAW_MD5)
@ -604,7 +667,7 @@ static DWORD VerifyFile(
}
// Attempt to open the file
if(SFileOpenFileEx(hMpq, szFileName, SFILE_OPEN_FROM_MPQ, &hFile))
if(SFileOpenFileEx(hMpq, szFileName, dwSearchScope, &hFile))
{
// Get the file size
hf = (TMPQFile *)hFile;
@ -634,7 +697,7 @@ static DWORD VerifyFile(
// Update CRC32 value
if(dwFlags & SFILE_VERIFY_FILE_CRC)
dwCrc32 = crc32(dwCrc32, Buffer, dwBytesRead);
// Update MD5 value
if(dwFlags & SFILE_VERIFY_FILE_MD5)
md5_process(&md5_state, Buffer, dwBytesRead);
@ -656,7 +719,7 @@ static DWORD VerifyFile(
if(dwTotalBytes == 0)
{
// Check CRC32 and MD5 only if there is no patches
if(hf->hfPatch == NULL)
if(hf->hfPatchFile == NULL)
{
// Check if the CRC32 matches.
if(dwFlags & SFILE_VERIFY_FILE_CRC)
@ -678,7 +741,7 @@ static DWORD VerifyFile(
md5_done(&md5_state, md5);
// Only check the MD5 if it is valid
if(IsValidMD5(pFileMd5))
if(is_valid_md5(pFileMd5))
{
dwVerifyResult |= VERIFY_FILE_HAS_MD5;
if(memcmp(md5, pFileMd5, MD5_DIGEST_SIZE))
@ -709,159 +772,11 @@ static DWORD VerifyFile(
if(pdwCrc32 != NULL)
*pdwCrc32 = dwCrc32;
if(pMD5 != NULL)
memcpy(pMD5, md5, MD5_DIGEST_SIZE);
memcpy(pMD5, md5, MD5_DIGEST_SIZE);
return dwVerifyResult;
}
// Used in SFileGetFileInfo
bool QueryMpqSignatureInfo(
TMPQArchive * ha,
PMPQ_SIGNATURE_INFO pSI)
{
TFileEntry * pFileEntry;
ULONGLONG ExtraBytes;
DWORD dwFileSize;
// Make sure it's all zeroed
memset(pSI, 0, sizeof(MPQ_SIGNATURE_INFO));
// Calculate the range of the MPQ
CalculateArchiveRange(ha, pSI);
// If there is "(signature)" file in the MPQ, it has a weak signature
pFileEntry = GetFileEntryLocale(ha, SIGNATURE_NAME, LANG_NEUTRAL);
if(pFileEntry != NULL)
{
// Calculate the begin and end of the signature file itself
pSI->BeginExclude = ha->MpqPos + pFileEntry->ByteOffset;
pSI->EndExclude = pSI->BeginExclude + pFileEntry->dwCmpSize;
dwFileSize = (DWORD)(pSI->EndExclude - pSI->BeginExclude);
// Does the signature have proper size?
if(dwFileSize == MPQ_SIGNATURE_FILE_SIZE)
{
// Read the weak signature
if(!FileStream_Read(ha->pStream, &pSI->BeginExclude, pSI->Signature, dwFileSize))
return false;
pSI->cbSignatureSize = dwFileSize;
pSI->SignatureTypes |= SIGNATURE_TYPE_WEAK;
return true;
}
}
// If there is extra bytes beyond the end of the archive,
// it's the strong signature
ExtraBytes = pSI->EndOfFile - pSI->EndMpqData;
if(ExtraBytes >= (MPQ_STRONG_SIGNATURE_SIZE + 4))
{
// Read the strong signature
if(!FileStream_Read(ha->pStream, &pSI->EndMpqData, pSI->Signature, (MPQ_STRONG_SIGNATURE_SIZE + 4)))
return false;
// Check the signature header "NGIS"
if(pSI->Signature[0] != 'N' || pSI->Signature[1] != 'G' || pSI->Signature[2] != 'I' || pSI->Signature[3] != 'S')
return false;
pSI->SignatureTypes |= SIGNATURE_TYPE_STRONG;
return true;
}
// Succeeded, but no known signature found
return true;
}
//-----------------------------------------------------------------------------
// Support for weak signature
int SSignFileCreate(TMPQArchive * ha)
{
TMPQFile * hf = NULL;
BYTE EmptySignature[MPQ_SIGNATURE_FILE_SIZE];
int nError = ERROR_SUCCESS;
// Only save the signature if we should do so
if(ha->dwFileFlags3 != 0)
{
// The (signature) file must be non-encrypted and non-compressed
assert(ha->dwFileFlags3 == MPQ_FILE_EXISTS);
// Create the (signature) file file in the MPQ
// Note that the file must not be compressed or encrypted
nError = SFileAddFile_Init(ha, SIGNATURE_NAME,
0,
sizeof(EmptySignature),
LANG_NEUTRAL,
ha->dwFileFlags3 | MPQ_FILE_REPLACEEXISTING,
&hf);
// Write the empty signature file to the archive
if(nError == ERROR_SUCCESS)
{
// Write the empty zeroed fiel to the MPQ
memset(EmptySignature, 0, sizeof(EmptySignature));
nError = SFileAddFile_Write(hf, EmptySignature, (DWORD)sizeof(EmptySignature), 0);
}
// If the save process succeeded, we clear the MPQ_FLAG_ATTRIBUTE_INVALID flag
if(nError == ERROR_SUCCESS)
{
ha->dwFlags &= ~MPQ_FLAG_SIGNATURE_INVALID;
ha->dwReservedFiles--;
}
// Free the file
if(hf != NULL)
SFileAddFile_Finish(hf);
}
return nError;
}
int SSignFileFinish(TMPQArchive * ha)
{
MPQ_SIGNATURE_INFO si;
unsigned long signature_len = MPQ_WEAK_SIGNATURE_SIZE;
BYTE WeakSignature[MPQ_SIGNATURE_FILE_SIZE];
BYTE Md5Digest[MD5_DIGEST_SIZE];
rsa_key key;
int hash_idx = find_hash("md5");
// Sanity checks
assert((ha->dwFlags & MPQ_FLAG_CHANGED) == 0);
assert(ha->dwFileFlags3 == MPQ_FILE_EXISTS);
// Query the weak signature info
memset(&si, 0, sizeof(MPQ_SIGNATURE_INFO));
if(!QueryMpqSignatureInfo(ha, &si))
return ERROR_FILE_CORRUPT;
// There must be exactly one signature
if(si.SignatureTypes != SIGNATURE_TYPE_WEAK)
return ERROR_FILE_CORRUPT;
// Calculate MD5 of the entire archive
if(!CalculateMpqHashMd5(ha, &si, Md5Digest))
return ERROR_VERIFY_FAILED;
// Decode the private key
if(!decode_base64_key(szBlizzardWeakPrivateKey, &key))
return ERROR_VERIFY_FAILED;
// Sign the hash
memset(WeakSignature, 0, sizeof(WeakSignature));
rsa_sign_hash_ex(Md5Digest, sizeof(Md5Digest), WeakSignature + 8, &signature_len, LTC_LTC_PKCS_1_V1_5, 0, 0, hash_idx, 0, &key);
memrev(WeakSignature + 8, MPQ_WEAK_SIGNATURE_SIZE);
rsa_free(&key);
// Write the signature to the MPQ. Don't use SFile* functions, but write the hash directly
if(!FileStream_Write(ha->pStream, &si.BeginExclude, WeakSignature, MPQ_SIGNATURE_FILE_SIZE))
return GetLastError();
return ERROR_SUCCESS;
}
//-----------------------------------------------------------------------------
// Public (exported) functions
@ -909,7 +824,7 @@ int WINAPI SFileVerifyRawData(HANDLE hMpq, DWORD dwWhatToVerify, const char * sz
TMPQHeader * pHeader;
// Verify input parameters
if(!IsValidMpqHandle(hMpq))
if(!IsValidMpqHandle(ha))
return ERROR_INVALID_PARAMETER;
pHeader = ha->pHeader;
@ -920,54 +835,54 @@ int WINAPI SFileVerifyRawData(HANDLE hMpq, DWORD dwWhatToVerify, const char * sz
// If we have to verify MPQ header, do it
switch(dwWhatToVerify)
{
case SFILE_VERIFY_MPQ_HEADER:
// Only if the header is of version 4 or newer
if(pHeader->dwHeaderSize >= (MPQ_HEADER_SIZE_V4 - MD5_DIGEST_SIZE))
return VerifyRawMpqData(ha, 0, MPQ_HEADER_SIZE_V4 - MD5_DIGEST_SIZE);
return ERROR_SUCCESS;
case SFILE_VERIFY_MPQ_HEADER:
case SFILE_VERIFY_HET_TABLE:
// Only if the header is of version 4 or newer
if(pHeader->dwHeaderSize >= (MPQ_HEADER_SIZE_V4 - MD5_DIGEST_SIZE))
return VerifyRawMpqData(ha, 0, MPQ_HEADER_SIZE_V4 - MD5_DIGEST_SIZE);
return ERROR_SUCCESS;
// Only if we have HET table
if(pHeader->HetTablePos64 && pHeader->HetTableSize64)
return VerifyRawMpqData(ha, pHeader->HetTablePos64, (DWORD)pHeader->HetTableSize64);
return ERROR_SUCCESS;
case SFILE_VERIFY_HET_TABLE:
case SFILE_VERIFY_BET_TABLE:
// Only if we have HET table
if(pHeader->HetTablePos64 && pHeader->HetTableSize64)
return VerifyRawMpqData(ha, pHeader->HetTablePos64, (DWORD)pHeader->HetTableSize64);
return ERROR_SUCCESS;
// Only if we have BET table
if(pHeader->BetTablePos64 && pHeader->BetTableSize64)
return VerifyRawMpqData(ha, pHeader->BetTablePos64, (DWORD)pHeader->BetTableSize64);
return ERROR_SUCCESS;
case SFILE_VERIFY_BET_TABLE:
case SFILE_VERIFY_HASH_TABLE:
// Only if we have BET table
if(pHeader->BetTablePos64 && pHeader->BetTableSize64)
return VerifyRawMpqData(ha, pHeader->BetTablePos64, (DWORD)pHeader->BetTableSize64);
return ERROR_SUCCESS;
// Hash table is not protected by MD5
return ERROR_SUCCESS;
case SFILE_VERIFY_HASH_TABLE:
case SFILE_VERIFY_BLOCK_TABLE:
// Hash table is not protected by MD5
return ERROR_SUCCESS;
// Block table is not protected by MD5
return ERROR_SUCCESS;
case SFILE_VERIFY_BLOCK_TABLE:
case SFILE_VERIFY_HIBLOCK_TABLE:
// Block table is not protected by MD5
return ERROR_SUCCESS;
// It is unknown if the hi-block table is protected my MD5 or not.
return ERROR_SUCCESS;
case SFILE_VERIFY_HIBLOCK_TABLE:
case SFILE_VERIFY_FILE:
// It is unknown if the hi-block table is protected my MD5 or not.
return ERROR_SUCCESS;
// Verify parameters
if(szFileName == NULL || *szFileName == 0)
return ERROR_INVALID_PARAMETER;
case SFILE_VERIFY_FILE:
// Get the offset of a file
pFileEntry = GetFileEntryLocale(ha, szFileName, lcFileLocale);
if(pFileEntry == NULL)
return ERROR_FILE_NOT_FOUND;
// Verify parameters
if(szFileName == NULL || *szFileName == 0)
return ERROR_INVALID_PARAMETER;
return VerifyRawMpqData(ha, pFileEntry->ByteOffset, pFileEntry->dwCmpSize);
// Get the offset of a file
pFileEntry = GetFileEntryLocale(ha, szFileName, lcFileLocale);
if(pFileEntry == NULL)
return ERROR_FILE_NOT_FOUND;
return VerifyRawMpqData(ha, pFileEntry->ByteOffset, pFileEntry->dwCmpSize);
}
return ERROR_INVALID_PARAMETER;
@ -981,73 +896,26 @@ DWORD WINAPI SFileVerifyArchive(HANDLE hMpq)
TMPQArchive * ha = (TMPQArchive *)hMpq;
// Verify input parameters
if(!IsValidMpqHandle(hMpq))
if(!IsValidMpqHandle(ha))
return ERROR_VERIFY_FAILED;
// If the archive was modified, we need to flush it
if(ha->dwFlags & MPQ_FLAG_CHANGED)
SFileFlushArchive(hMpq);
// Get the MPQ signature and signature type
memset(&si, 0, sizeof(MPQ_SIGNATURE_INFO));
if(!QueryMpqSignatureInfo(ha, &si))
return ERROR_VERIFY_FAILED;
// If there is no signature
if(si.SignatureTypes == 0)
// Verify the signature
switch(si.nSignatureType)
{
case SIGNATURE_TYPE_NONE:
return ERROR_NO_SIGNATURE;
// We haven't seen a MPQ with both signatures
assert(si.SignatureTypes == SIGNATURE_TYPE_WEAK || si.SignatureTypes == SIGNATURE_TYPE_STRONG);
// Verify the strong signature, if present
if(si.SignatureTypes & SIGNATURE_TYPE_STRONG)
return VerifyStrongSignature(ha, &si);
// Verify the weak signature, if present
if(si.SignatureTypes & SIGNATURE_TYPE_WEAK)
case SIGNATURE_TYPE_WEAK:
return VerifyWeakSignature(ha, &si);
return ERROR_NO_SIGNATURE;
case SIGNATURE_TYPE_STRONG:
return VerifyStrongSignature(ha, &si);
}
return ERROR_VERIFY_FAILED;
}
// Verifies the archive against the signature
bool WINAPI SFileSignArchive(HANDLE hMpq, DWORD dwSignatureType)
{
TMPQArchive * ha;
// Verify the archive handle
ha = IsValidMpqHandle(hMpq);
if(ha == NULL)
{
SetLastError(ERROR_INVALID_PARAMETER);
return false;
}
// We only support weak signature, and only for MPQs version 1.0
if(dwSignatureType != SIGNATURE_TYPE_WEAK)
{
SetLastError(ERROR_INVALID_PARAMETER);
return false;
}
// The archive must not be malformed and must not be read-only
if(ha->dwFlags & (MPQ_FLAG_READ_ONLY | MPQ_FLAG_MALFORMED))
{
SetLastError(ERROR_ACCESS_DENIED);
return false;
}
// If the signature is not there yet
if(ha->dwFileFlags3 == 0)
{
// Turn the signature on. The signature will
// be applied when the archive is closed
ha->dwFlags |= MPQ_FLAG_SIGNATURE_INVALID | MPQ_FLAG_CHANGED;
ha->dwFileFlags3 = MPQ_FILE_EXISTS;
ha->dwReservedFiles++;
}
return true;
}

View file

@ -35,16 +35,16 @@
// Include functions from zlib
#ifndef __SYS_ZLIB
#include "zlib/zlib.h"
#include "zlib/zlib.h"
#else
#include <zlib.h>
#include <zlib.h>
#endif
// Include functions from bzlib
#ifndef __SYS_BZLIB
#include "bzip2/bzlib.h"
#include "bzip2/bzlib.h"
#else
#include <bzlib.h>
#include <bzlib.h>
#endif
//-----------------------------------------------------------------------------
@ -61,73 +61,56 @@
#define ID_MPQ_FILE 0x46494c45 // Used internally for checking TMPQFile ('FILE')
#define MPQ_WEAK_SIGNATURE_SIZE 64
#define MPQ_STRONG_SIGNATURE_SIZE 256
// 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)
#define STORMLIB_UNUSED(p) ((void)(p))
// Macro for building 64-bit file offset from two 32-bit
#define MAKE_OFFSET64(hi, lo) (((ULONGLONG)hi << 32) | (ULONGLONG)lo)
//-----------------------------------------------------------------------------
// MPQ signature information
// Size of each signature type
#define MPQ_WEAK_SIGNATURE_SIZE 64
#define MPQ_STRONG_SIGNATURE_SIZE 256
#define MPQ_STRONG_SIGNATURE_ID 0x5349474E // ID of the strong signature ("NGIS")
#define MPQ_SIGNATURE_FILE_SIZE (MPQ_WEAK_SIGNATURE_SIZE + 8)
// MPQ signature info
typedef struct _MPQ_SIGNATURE_INFO
{
ULONGLONG BeginMpqData; // File offset where the hashing starts
ULONGLONG BeginExclude; // Begin of the excluded area (used for (signature) file)
ULONGLONG EndExclude; // End of the excluded area (used for (signature) file)
ULONGLONG EndMpqData; // File offset where the hashing ends
ULONGLONG EndOfFile; // Size of the entire file
BYTE Signature[MPQ_STRONG_SIGNATURE_SIZE + 0x10];
DWORD cbSignatureSize; // Length of the signature
DWORD SignatureTypes; // See SIGNATURE_TYPE_XXX
} MPQ_SIGNATURE_INFO, *PMPQ_SIGNATURE_INFO;
#define MAKE_OFFSET64(hi, lo) (((ULONGLONG)hi << 32) | lo)
//-----------------------------------------------------------------------------
// Memory management
//
// We use our own macros for allocating/freeing memory. If you want
// to redefine them, please keep the following rules:
// to redefine them, please keep the following rules
//
// - The memory allocation must return NULL if not enough memory
// (i.e not to throw exception)
// - The allocating function does not need to fill the allocated buffer with zeros
// - Memory freeing function doesn't have to test the pointer to NULL
// - It is not necessary to fill the allocated buffer with zeros
// - Memory freeing function doesn't have to test the pointer to NULL.
//
//#if defined(_MSC_VER) && defined(_DEBUG)
//
//#define STORM_ALLOC(type, nitems) (type *)HeapAlloc(GetProcessHeap(), 0, ((nitems) * sizeof(type)))
//#define STORM_FREE(ptr) HeapFree(GetProcessHeap(), 0, ptr)
//
//#else
#if defined(_MSC_VER) && defined(_DEBUG)
__inline void * DebugMalloc(char * /* szFile */, int /* nLine */, size_t nSize)
{
// return new BYTE[nSize];
return HeapAlloc(GetProcessHeap(), 0, nSize);
}
#define STORM_ALLOC(type, nitems) (type *)malloc((nitems) * sizeof(type))
#define STORM_FREE(ptr) free(ptr)
__inline void DebugFree(void * ptr)
{
// delete [] ptr;
HeapFree(GetProcessHeap(), 0, ptr);
}
//#endif
#define STORM_ALLOC(type, nitems) (type *)DebugMalloc(__FILE__, __LINE__, (nitems) * sizeof(type))
#define STORM_FREE(ptr) DebugFree(ptr)
#else
#define STORM_ALLOC(type, nitems) (type *)malloc((nitems) * sizeof(type))
#define STORM_FREE(ptr) free(ptr)
#endif
//-----------------------------------------------------------------------------
// StormLib internal global variables
extern LCID lcFileLocale; // Preferred file locale
//-----------------------------------------------------------------------------
// Conversion to uppercase/lowercase (and "/" to "\")
extern unsigned char AsciiToLowerTable[256];
extern unsigned char AsciiToUpperTable[256];
//-----------------------------------------------------------------------------
// Encryption and decryption functions
@ -135,11 +118,8 @@ extern unsigned char AsciiToUpperTable[256];
#define MPQ_HASH_NAME_A 0x100
#define MPQ_HASH_NAME_B 0x200
#define MPQ_HASH_FILE_KEY 0x300
#define MPQ_HASH_KEY2_MIX 0x400
DWORD HashString(const char * szFileName, DWORD dwHashType);
DWORD HashStringSlash(const char * szFileName, DWORD dwHashType);
DWORD HashStringLower(const char * szFileName, DWORD dwHashType);
void InitializeMpqCryptography();
@ -148,13 +128,15 @@ DWORD GetHashTableSizeForFileCount(DWORD dwFileCount);
bool IsPseudoFileName(const char * szFileName, LPDWORD pdwFileIndex);
ULONGLONG HashStringJenkins(const char * szFileName);
DWORD GetDefaultSpecialFileFlags(DWORD dwFileSize, USHORT wFormatVersion);
int ConvertMpqHeaderToFormat4(TMPQArchive * ha, ULONGLONG FileSize, DWORD dwFlags);
void EncryptMpqBlock(void * pvDataBlock, DWORD dwLength, DWORD dwKey);
void DecryptMpqBlock(void * pvDataBlock, DWORD dwLength, DWORD dwKey);
DWORD GetDefaultSpecialFileFlags(TMPQArchive * ha, DWORD dwFileSize);
DWORD DetectFileKeyBySectorSize(LPDWORD EncryptedData, DWORD dwSectorSize, DWORD dwSectorOffsLen);
DWORD DetectFileKeyByContent(void * pvEncryptedData, DWORD dwSectorSize, DWORD dwFileSize);
void EncryptMpqBlock(void * pvFileBlock, DWORD dwLength, DWORD dwKey);
void DecryptMpqBlock(void * pvFileBlock, DWORD dwLength, DWORD dwKey);
DWORD DetectFileKeyBySectorSize(LPDWORD SectorOffsets, DWORD decrypted);
DWORD DetectFileKeyByContent(void * pvFileContent, DWORD dwFileSize);
DWORD DecryptFileKey(const char * szFileName, ULONGLONG MpqPos, DWORD dwFileSize, DWORD dwFlags);
bool IsValidMD5(LPBYTE pbMd5);
@ -164,38 +146,29 @@ void CalculateDataBlockHash(void * pvDataBlock, DWORD cbDataBlock, LPBYTE md5_ha
//-----------------------------------------------------------------------------
// Handle validation functions
TMPQArchive * IsValidMpqHandle(HANDLE hMpq);
TMPQFile * IsValidFileHandle(HANDLE hFile);
bool IsValidMpqHandle(TMPQArchive * ha);
bool IsValidFileHandle(TMPQFile * hf);
//-----------------------------------------------------------------------------
// Support for MPQ file tables
// Hash table and block table manipulation
int ConvertMpqHeaderToFormat4(TMPQArchive * ha, ULONGLONG MpqOffset, ULONGLONG FileSize, DWORD dwFlags);
TMPQHash * FindFreeHashEntry(TMPQArchive * ha, DWORD dwStartIndex, DWORD dwName1, DWORD dwName2, LCID lcLocale);
TMPQHash * GetFirstHashEntry(TMPQArchive * ha, const char * szFileName);
TMPQHash * GetNextHashEntry(TMPQArchive * ha, TMPQHash * pFirstHash, TMPQHash * pPrevHash);
TMPQHash * AllocateHashEntry(TMPQArchive * ha, TFileEntry * pFileEntry);
DWORD AllocateHashEntry(TMPQArchive * ha, TFileEntry * pFileEntry);
DWORD AllocateHetEntry(TMPQArchive * ha, TFileEntry * pFileEntry);
TMPQExtHeader * LoadExtTable(TMPQArchive * ha, ULONGLONG ByteOffset, size_t Size, DWORD dwSignature, DWORD dwKey);
TMPQHetTable * LoadHetTable(TMPQArchive * ha);
TMPQBetTable * LoadBetTable(TMPQArchive * ha);
void FindFreeMpqSpace(TMPQArchive * ha, ULONGLONG * pFreeSpacePos);
TMPQHash * LoadHashTable(TMPQArchive * ha);
TMPQBlock * LoadBlockTable(TMPQArchive * ha, bool bDontFixEntries = false);
TMPQBlock * TranslateBlockTable(TMPQArchive * ha, ULONGLONG * pcbTableSize, bool * pbNeedHiBlockTable);
ULONGLONG FindFreeMpqSpace(TMPQArchive * ha);
// Functions that loads and verifies MPQ data bitmap
int LoadMpqDataBitmap(TMPQArchive * ha, ULONGLONG FileSize, bool * pbFileIsComplete);
// Functions that load the HET and BET tables
int CreateHashTable(TMPQArchive * ha, DWORD dwHashTableSize);
int LoadAnyHashTable(TMPQArchive * ha);
int BuildFileTable(TMPQArchive * ha);
int RebuildHetTable(TMPQArchive * ha);
int RebuildFileTable(TMPQArchive * ha, DWORD dwNewHashTableSize, DWORD dwNewMaxFileCount);
int BuildFileTable(TMPQArchive * ha, ULONGLONG FileSize);
int SaveMPQTables(TMPQArchive * ha);
TMPQHetTable * CreateHetTable(DWORD dwEntryCount, DWORD dwTotalCount, DWORD dwHashBitSize, LPBYTE pbSrcData);
TMPQHetTable * CreateHetTable(DWORD dwMaxFileCount, DWORD dwHashBitSize, bool bCreateEmpty);
void FreeHetTable(TMPQHetTable * pHetTable);
TMPQBetTable * CreateBetTable(DWORD dwMaxFileCount);
@ -208,37 +181,23 @@ TFileEntry * GetFileEntryExact(TMPQArchive * ha, const char * szFileName, LCID l
TFileEntry * GetFileEntryByIndex(TMPQArchive * ha, DWORD dwIndex);
// Allocates file name in the file entry
void AllocateFileName(TMPQArchive * ha, TFileEntry * pFileEntry, const char * szFileName);
void AllocateFileName(TFileEntry * pFileEntry, const char * szFileName);
// Allocates new file entry in the MPQ tables. Reuses existing, if possible
TFileEntry * FindFreeFileEntry(TMPQArchive * ha);
TFileEntry * AllocateFileEntry(TMPQArchive * ha, const char * szFileName, LCID lcLocale);
int RenameFileEntry(TMPQArchive * ha, TFileEntry * pFileEntry, const char * szNewFileName);
void DeleteFileEntry(TMPQArchive * ha, TFileEntry * pFileEntry);
void ClearFileEntry(TMPQArchive * ha, TFileEntry * pFileEntry);
int FreeFileEntry(TMPQArchive * ha, TFileEntry * pFileEntry);
// Invalidates entries for (listfile) and (attributes)
void InvalidateInternalFiles(TMPQArchive * ha);
// Retrieves information about the strong signature
bool QueryMpqSignatureInfo(TMPQArchive * ha, PMPQ_SIGNATURE_INFO pSignatureInfo);
//-----------------------------------------------------------------------------
// Support for alternate file formats (SBaseSubTypes.cpp)
int ConvertSqpHeaderToFormat4(TMPQArchive * ha, ULONGLONG FileSize, DWORD dwFlags);
TMPQHash * LoadSqpHashTable(TMPQArchive * ha);
TMPQBlock * LoadSqpBlockTable(TMPQArchive * ha);
int ConvertMpkHeaderToFormat4(TMPQArchive * ha, ULONGLONG FileSize, DWORD dwFlags);
void DecryptMpkTable(void * pvMpkTable, size_t cbSize);
TMPQHash * LoadMpkHashTable(TMPQArchive * ha);
TMPQBlock * LoadMpkBlockTable(TMPQArchive * ha);
int SCompDecompressMpk(void * pvOutBuffer, int * pcbOutBuffer, void * pvInBuffer, int cbInBuffer);
//-----------------------------------------------------------------------------
// Common functions - MPQ File
TMPQFile * CreateFileHandle(TMPQArchive * ha, TFileEntry * pFileEntry);
void * LoadMpqTable(TMPQArchive * ha, ULONGLONG ByteOffset, DWORD dwCompressedSize, DWORD dwRealSize, DWORD dwKey);
TMPQFile * CreateMpqFile(TMPQArchive * ha);
int LoadMpqTable(TMPQArchive * ha, ULONGLONG ByteOffset, void * pvTable, DWORD dwCompressedSize, DWORD dwRealSize, DWORD dwKey);
int AllocateSectorBuffer(TMPQFile * hf);
int AllocatePatchInfo(TMPQFile * hf, bool bLoadFromFile);
int AllocateSectorOffsets(TMPQFile * hf, bool bLoadFromFile);
@ -249,48 +208,44 @@ int WriteSectorOffsets(TMPQFile * hf);
int WriteSectorChecksums(TMPQFile * hf);
int WriteMemDataMD5(TFileStream * pStream, ULONGLONG RawDataOffs, void * pvRawData, DWORD dwRawDataSize, DWORD dwChunkSize, LPDWORD pcbTotalSize);
int WriteMpqDataMD5(TFileStream * pStream, ULONGLONG RawDataOffs, DWORD dwRawDataSize, DWORD dwChunkSize);
void FreeFileHandle(TMPQFile *& hf);
void FreeMPQFile(TMPQFile *& hf);
bool IsIncrementalPatchFile(const void * pvData, DWORD cbData, LPDWORD pdwPatchedFileSize);
int PatchFileData(TMPQFile * hf);
void FreeArchiveHandle(TMPQArchive *& ha);
void FreeMPQArchive(TMPQArchive *& ha);
//-----------------------------------------------------------------------------
// Utility functions
bool CheckWildCard(const char * szString, const char * szWildCard);
const char * GetPlainFileNameA(const char * szFileName);
const TCHAR * GetPlainFileNameT(const TCHAR * szFileName);
bool IsInternalMpqFileName(const char * szFileName);
const TCHAR * GetPlainFileName(const TCHAR * szFileName);
const char * GetPlainFileName(const char * szFileName);
void CopyFileName(TCHAR * szTarget, const char * szSource, size_t cchLength);
void CopyFileName(char * szTarget, const TCHAR * szSource, size_t cchLength);
//-----------------------------------------------------------------------------
// Support for adding files to the MPQ
int SFileAddFile_Init(
TMPQArchive * ha,
const char * szArchivedName,
ULONGLONG ft,
DWORD dwFileSize,
LCID lcLocale,
DWORD dwFlags,
TMPQFile ** phf
);
TMPQArchive * ha,
const char * szArchivedName,
ULONGLONG ft,
DWORD dwFileSize,
LCID lcLocale,
DWORD dwFlags,
TMPQFile ** phf
);
int SFileAddFile_Write(
TMPQFile * hf,
const void * pvData,
DWORD dwSize,
DWORD dwCompression
);
TMPQFile * hf,
const void * pvData,
DWORD dwSize,
DWORD dwCompression
);
int SFileAddFile_Finish(
TMPQFile * hf
);
TMPQFile * hf
);
//-----------------------------------------------------------------------------
// Attributes support
@ -303,12 +258,6 @@ int SAttrFileSaveToMpq(TMPQArchive * ha);
int SListFileSaveToMpq(TMPQArchive * ha);
//-----------------------------------------------------------------------------
// Weak signature support
int SSignFileCreate(TMPQArchive * ha);
int SSignFileFinish(TMPQArchive * ha);
//-----------------------------------------------------------------------------
// Dump data support

File diff suppressed because it is too large Load diff

View file

@ -21,270 +21,221 @@
/* 24.07.04 1.03 Sam Mac OS X compatibility */
/* 22.11.06 1.04 Sam Mac OS X compatibility (for StormLib 6.0) */
/* 31.12.06 1.05 XPinguin Full GNU/Linux compatibility */
/* 17.10.12 1.05 Lad Moved error codes so they don't overlap with errno.h */
/*****************************************************************************/
#ifndef __STORMPORT_H__
#define __STORMPORT_H__
#ifndef __cplusplus
#define bool char
#define true 1
#define false 0
#define bool char
#define true 1
#define false 0
#endif
//-----------------------------------------------------------------------------
// Defines for Windows
#if !defined(PLATFORM_DEFINED) && (defined(WIN32) || defined(WIN64))
// In MSVC 8.0, there are some functions declared as deprecated.
#if _MSC_VER >= 1400
#define _CRT_SECURE_NO_DEPRECATE
#define _CRT_NON_CONFORMING_SWPRINTFS
#endif
// In MSVC 8.0, there are some functions declared as deprecated.
#if _MSC_VER >= 1400
#define _CRT_SECURE_NO_DEPRECATE
#define _CRT_NON_CONFORMING_SWPRINTFS
#endif
#include <tchar.h>
#include <assert.h>
#include <ctype.h>
#include <stdio.h>
#include <windows.h>
#include <wininet.h>
#define PLATFORM_LITTLE_ENDIAN
#include <tchar.h>
#include <assert.h>
#include <ctype.h>
#include <stdio.h>
#include <windows.h>
#include <wininet.h>
#define PLATFORM_LITTLE_ENDIAN
#ifdef WIN64
#define PLATFORM_64BIT
#else
#define PLATFORM_32BIT
#endif
#ifdef WIN64
#define PLATFORM_64BIT
#else
#define PLATFORM_32BIT
#endif
#define PLATFORM_WINDOWS
#define PLATFORM_DEFINED // The platform is known now
#define PLATFORM_WINDOWS
#define PLATFORM_DEFINED // The platform is known now
#endif
//-----------------------------------------------------------------------------
// Defines for Mac
#if !defined(PLATFORM_DEFINED) && defined(__APPLE__) // Mac BSD API
// Macintosh
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/mman.h>
#include <unistd.h>
#include <fcntl.h>
#include <stdlib.h>
#include <errno.h>
// Macintosh
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/mman.h>
#include <unistd.h>
#include <fcntl.h>
#include <stdlib.h>
#include <errno.h>
// Support for PowerPC on Max OS X
#if (__ppc__ == 1) || (__POWERPC__ == 1) || (_ARCH_PPC == 1)
#include <stdint.h>
#include <CoreFoundation/CFByteOrder.h>
#endif
#define PKEXPORT
#define __SYS_ZLIB
#define __SYS_BZLIB
#define PKEXPORT
#define __SYS_ZLIB
#define __SYS_BZLIB
#ifndef __BIG_ENDIAN__
#define PLATFORM_LITTLE_ENDIAN
#endif
#ifndef __BIG_ENDIAN__
#define PLATFORM_LITTLE_ENDIAN
#endif
#define PLATFORM_MAC
#define PLATFORM_DEFINED // The platform is known now
#define PLATFORM_MAC
#define PLATFORM_DEFINED // The platform is known now
#endif
//-----------------------------------------------------------------------------
// Assumption: we are not on Windows nor Macintosh, so this must be linux *grin*
#if !defined(PLATFORM_DEFINED)
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/mman.h>
#include <fcntl.h>
#include <unistd.h>
#include <stdint.h>
#include <stdlib.h>
#include <stdio.h>
#include <stdarg.h>
#include <string.h>
#include <ctype.h>
#include <assert.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/mman.h>
#include <fcntl.h>
#include <unistd.h>
#include <stdint.h>
#include <stdlib.h>
#include <stdio.h>
#include <stdarg.h>
#include <string.h>
#include <ctype.h>
#include <assert.h>
#include <errno.h>
#define PLATFORM_LITTLE_ENDIAN
#define PLATFORM_LINUX
#define PLATFORM_DEFINED
#define PLATFORM_LITTLE_ENDIAN
#define PLATFORM_LINUX
#define PLATFORM_DEFINED
#endif
//-----------------------------------------------------------------------------
// Definition of Windows-specific types for non-Windows platforms
// Definition of Windows-specific structures for non-Windows platforms
#ifndef PLATFORM_WINDOWS
#if __LP64__
#define PLATFORM_64BIT
#else
#define PLATFORM_32BIT
#endif
#if __LP64__
#define PLATFORM_64BIT
#else
#define PLATFORM_32BIT
#endif
// Typedefs for ANSI C
typedef unsigned char BYTE;
typedef unsigned short USHORT;
typedef int LONG;
typedef unsigned int DWORD;
typedef unsigned long DWORD_PTR;
typedef long LONG_PTR;
typedef long INT_PTR;
typedef long long LONGLONG;
typedef unsigned long long ULONGLONG;
typedef void * HANDLE;
typedef void * LPOVERLAPPED; // Unsupported on Linux and Mac
typedef char TCHAR;
typedef unsigned int LCID;
typedef LONG * PLONG;
typedef DWORD * LPDWORD;
typedef BYTE * LPBYTE;
// Typedefs for ANSI C
typedef unsigned char BYTE;
typedef unsigned short USHORT;
typedef int LONG;
typedef unsigned int DWORD;
typedef unsigned long DWORD_PTR;
typedef long LONG_PTR;
typedef long INT_PTR;
typedef long long LONGLONG;
typedef unsigned long long ULONGLONG;
typedef void * HANDLE;
typedef void * LPOVERLAPPED; // Unsupported on Linux and Mac
typedef char TCHAR;
typedef unsigned int LCID;
typedef LONG * PLONG;
typedef DWORD * LPDWORD;
typedef BYTE * LPBYTE;
#ifdef PLATFORM_32BIT
#define _LZMA_UINT32_IS_ULONG
#endif
#ifdef PLATFORM_32BIT
#define _LZMA_UINT32_IS_ULONG
#endif
// Some Windows-specific defines
#ifndef MAX_PATH
#define MAX_PATH 1024
#endif
// Some Windows-specific defines
#ifndef MAX_PATH
#define MAX_PATH 1024
#endif
#define WINAPI
#define WINAPI
#define FILE_BEGIN SEEK_SET
#define FILE_CURRENT SEEK_CUR
#define FILE_END SEEK_END
#define FILE_BEGIN SEEK_SET
#define FILE_CURRENT SEEK_CUR
#define FILE_END SEEK_END
#define _T(x) x
#define _tcslen strlen
#define _tcscpy strcpy
#define _tcscat strcat
#define _tcschr strchr
#define _tcsrchr strrchr
#define _tcsstr strstr
#define _tprintf printf
#define _stprintf sprintf
#define _tremove remove
#define _T(x) x
#define _tcslen strlen
#define _tcscpy strcpy
#define _tcscat strcat
#define _tcsrchr strrchr
#define _tprintf printf
#define _stprintf sprintf
#define _tremove remove
#define _stricmp strcasecmp
#define _strnicmp strncasecmp
#define _tcsicmp strcasecmp
#define _tcsnicmp strncasecmp
#define _stricmp strcasecmp
#define _strnicmp strncasecmp
#define _tcsnicmp strncasecmp
#endif // !PLATFORM_WINDOWS
#endif // !WIN32
// 64-bit calls are supplied by "normal" calls on Mac
#if defined(PLATFORM_MAC)
#define stat64 stat
#define fstat64 fstat
#define lseek64 lseek
#define ftruncate64 ftruncate
#define off64_t off_t
#define O_LARGEFILE 0
#define stat64 stat
#define fstat64 fstat
#define lseek64 lseek
#define off64_t off_t
#define O_LARGEFILE 0
#endif
// Platform-specific error codes for UNIX-based platforms
#if defined(PLATFORM_MAC) || defined(PLATFORM_LINUX)
#define ERROR_SUCCESS 0
#define ERROR_FILE_NOT_FOUND ENOENT
#define ERROR_ACCESS_DENIED EPERM
#define ERROR_INVALID_HANDLE EBADF
#define ERROR_NOT_ENOUGH_MEMORY ENOMEM
#define ERROR_NOT_SUPPORTED ENOTSUP
#define ERROR_INVALID_PARAMETER EINVAL
#define ERROR_DISK_FULL ENOSPC
#define ERROR_ALREADY_EXISTS EEXIST
#define ERROR_INSUFFICIENT_BUFFER ENOBUFS
#define ERROR_BAD_FORMAT 1000 // No such error code under Linux
#define ERROR_NO_MORE_FILES 1001 // No such error code under Linux
#define ERROR_HANDLE_EOF 1002 // No such error code under Linux
#define ERROR_CAN_NOT_COMPLETE 1003 // No such error code under Linux
#define ERROR_FILE_CORRUPT 1004 // No such error code under Linux
#define ERROR_SUCCESS 0
#define ERROR_FILE_NOT_FOUND ENOENT
#define ERROR_ACCESS_DENIED EPERM
#define ERROR_INVALID_HANDLE EBADF
#define ERROR_NOT_ENOUGH_MEMORY ENOMEM
#define ERROR_BAD_FORMAT 105 // No such error code under Linux
#define ERROR_NO_MORE_FILES 106
#define ERROR_HANDLE_EOF 107 // No such error code under Linux
#define ERROR_NOT_SUPPORTED ENOTSUP
#define ERROR_INVALID_PARAMETER EINVAL
#define ERROR_DISK_FULL ENOSPC
#define ERROR_ALREADY_EXISTS EEXIST
#define ERROR_CAN_NOT_COMPLETE 108 // No such error code under Linux
#define ERROR_FILE_CORRUPT 109 // No such error code under Linux
#define ERROR_INSUFFICIENT_BUFFER ENOBUFS
#endif
//-----------------------------------------------------------------------------
// Swapping functions
#ifdef PLATFORM_LITTLE_ENDIAN
#define BSWAP_INT16_UNSIGNED(a) (a)
#define BSWAP_INT16_SIGNED(a) (a)
#define BSWAP_INT32_UNSIGNED(a) (a)
#define BSWAP_INT32_SIGNED(a) (a)
#define BSWAP_INT64_SIGNED(a) (a)
#define BSWAP_INT64_UNSIGNED(a) (a)
#define BSWAP_ARRAY16_UNSIGNED(a,b) {}
#define BSWAP_ARRAY32_UNSIGNED(a,b) {}
#define BSWAP_ARRAY64_UNSIGNED(a,b) {}
#define BSWAP_PART_HEADER(a) {}
#define BSWAP_TMPQHEADER(a,b) {}
#define BSWAP_TMPKHEADER(a) {}
#define BSWAP_INT16_UNSIGNED(a) (a)
#define BSWAP_INT16_SIGNED(a) (a)
#define BSWAP_INT32_UNSIGNED(a) (a)
#define BSWAP_INT32_SIGNED(a) (a)
#define BSWAP_INT64_SIGNED(a) (a)
#define BSWAP_INT64_UNSIGNED(a) (a)
#define BSWAP_ARRAY16_UNSIGNED(a,b) {}
#define BSWAP_ARRAY32_UNSIGNED(a,b) {}
#define BSWAP_ARRAY64_UNSIGNED(a,b) {}
#define BSWAP_PART_HEADER(a) {}
#define BSWAP_TMPQUSERDATA(a) {}
#define BSWAP_TMPQHEADER(a) {}
#else
#ifdef __cplusplus
extern "C" {
#endif
int16_t SwapInt16(uint16_t);
uint16_t SwapUInt16(uint16_t);
int32_t SwapInt32(uint32_t);
uint32_t SwapUInt32(uint32_t);
int64_t SwapInt64(uint64_t);
uint64_t SwapUInt64(uint64_t);
void ConvertUInt16Buffer(void * ptr, size_t length);
void ConvertUInt32Buffer(void * ptr, size_t length);
void ConvertUInt64Buffer(void * ptr, size_t length);
void ConvertTMPQUserData(void *userData);
void ConvertTMPQHeader(void *header, uint16_t wPart);
void ConvertTMPKHeader(void *header);
int16_t SwapInt16(uint16_t);
uint16_t SwapUInt16(uint16_t);
int32_t SwapInt32(uint32_t);
uint32_t SwapUInt32(uint32_t);
int64_t SwapInt64(uint64_t);
uint64_t SwapUInt64(uint64_t);
void ConvertUInt16Buffer(void * ptr, size_t length);
void ConvertUInt32Buffer(void * ptr, size_t length);
void ConvertUInt64Buffer(void * ptr, size_t length);
void ConvertPartHeader(void * partHeader);
void ConvertTMPQUserData(void *userData);
void ConvertTMPQHeader(void *header);
#ifdef __cplusplus
}
#endif
#define BSWAP_INT16_SIGNED(a) SwapInt16((a))
#define BSWAP_INT16_UNSIGNED(a) SwapUInt16((a))
#define BSWAP_INT32_SIGNED(a) SwapInt32((a))
#define BSWAP_INT32_UNSIGNED(a) SwapUInt32((a))
#define BSWAP_INT64_SIGNED(a) SwapInt64((a))
#define BSWAP_INT64_UNSIGNED(a) SwapUInt64((a))
#define BSWAP_ARRAY16_UNSIGNED(a,b) ConvertUInt16Buffer((a),(b))
#define BSWAP_ARRAY32_UNSIGNED(a,b) ConvertUInt32Buffer((a),(b))
#define BSWAP_ARRAY64_UNSIGNED(a,b) ConvertUInt64Buffer((a),(b))
#define BSWAP_TMPQHEADER(a,b) ConvertTMPQHeader((a),(b))
#define BSWAP_TMPKHEADER(a) ConvertTMPKHeader((a))
#define BSWAP_INT16_SIGNED(a) SwapInt16((a))
#define BSWAP_INT16_UNSIGNED(a) SwapUInt16((a))
#define BSWAP_INT32_SIGNED(a) SwapInt32((a))
#define BSWAP_INT32_UNSIGNED(a) SwapUInt32((a))
#define BSWAP_INT64_SIGNED(a) SwapInt64((a))
#define BSWAP_INT64_UNSIGNED(a) SwapUInt64((a))
#define BSWAP_ARRAY16_UNSIGNED(a,b) ConvertUInt16Buffer((a),(b))
#define BSWAP_ARRAY32_UNSIGNED(a,b) ConvertUInt32Buffer((a),(b))
#define BSWAP_ARRAY64_UNSIGNED(a,b) ConvertUInt64Buffer((a),(b))
#define BSWAP_PART_HEADER(a) ConvertPartHeader(a)
#define BSWAP_TMPQUSERDATA(a) ConvertTMPQUserData((a))
#define BSWAP_TMPQHEADER(a) ConvertTMPQHeader((a))
#endif
//-----------------------------------------------------------------------------
// Macro for deprecated symbols
/*
#ifdef _MSC_VER
#if _MSC_FULL_VER >= 140050320
#define STORMLIB_DEPRECATED(_Text) __declspec(deprecated(_Text))
#else
#define STORMLIB_DEPRECATED(_Text) __declspec(deprecated)
#endif
#else
#ifdef __GNUC__
#define STORMLIB_DEPRECATED(_Text) __attribute__((deprecated))
#else
#define STORMLIB_DEPRECATED(_Text) __attribute__((deprecated(_Text)))
#endif
#endif
// When a flag is deprecated, use this macro
#ifndef _STORMLIB_NO_DEPRECATE
#define STORMLIB_DEPRECATED_FLAG(type, oldflag, newflag) \
const STORMLIB_DEPRECATED(#oldflag " is deprecated. Use " #newflag ". To supress this warning, define _STORMLIB_NO_DEPRECATE") static type oldflag = (type)newflag;
#else
#define STORMLIB_DEPRECATED_FLAG(type, oldflag, newflag) static type oldflag = (type)newflag;
#endif
*/
#endif // __STORMPORT_H__

View file

@ -10,389 +10,349 @@
/* 11.03.03 1.00 Lad Splitted from Pkware.cpp */
/* 20.05.03 2.00 Lad Added compression */
/* 19.11.03 2.01 Dan Big endian handling */
/* 10.01.13 3.00 Lad Refactored, beautified, documented :-) */
/*****************************************************************************/
#include "../StormPort.h"
#include "adpcm.h"
//------------------------------------------------------------------------------
// Structures
typedef union _BYTE_AND_WORD_PTR
{
short * pw;
unsigned char * pb;
} BYTE_AND_WORD_PTR;
typedef union _WORD_AND_BYTE_ARRAY
{
short w;
unsigned char b[2];
} WORD_AND_BYTE_ARRAY;
//-----------------------------------------------------------------------------
// Tables necessary dor decompression
static int NextStepTable[] =
static long Table1503F120[] =
{
-1, 0, -1, 4, -1, 2, -1, 6,
-1, 1, -1, 5, -1, 3, -1, 7,
-1, 1, -1, 5, -1, 3, -1, 7,
-1, 2, -1, 4, -1, 6, -1, 8
0xFFFFFFFF, 0x00000000, 0xFFFFFFFF, 0x00000004, 0xFFFFFFFF, 0x00000002, 0xFFFFFFFF, 0x00000006,
0xFFFFFFFF, 0x00000001, 0xFFFFFFFF, 0x00000005, 0xFFFFFFFF, 0x00000003, 0xFFFFFFFF, 0x00000007,
0xFFFFFFFF, 0x00000001, 0xFFFFFFFF, 0x00000005, 0xFFFFFFFF, 0x00000003, 0xFFFFFFFF, 0x00000007,
0xFFFFFFFF, 0x00000002, 0xFFFFFFFF, 0x00000004, 0xFFFFFFFF, 0x00000006, 0xFFFFFFFF, 0x00000008
};
static int StepSizeTable[] =
static long step_table[] =
{
7, 8, 9, 10, 11, 12, 13, 14,
16, 17, 19, 21, 23, 25, 28, 31,
34, 37, 41, 45, 50, 55, 60, 66,
73, 80, 88, 97, 107, 118, 130, 143,
157, 173, 190, 209, 230, 253, 279, 307,
337, 371, 408, 449, 494, 544, 598, 658,
724, 796, 876, 963, 1060, 1166, 1282, 1411,
1552, 1707, 1878, 2066, 2272, 2499, 2749, 3024,
3327, 3660, 4026, 4428, 4871, 5358, 5894, 6484,
7132, 7845, 8630, 9493, 10442, 11487, 12635, 13899,
15289, 16818, 18500, 20350, 22385, 24623, 27086, 29794,
32767
0x00000007, 0x00000008, 0x00000009, 0x0000000A, 0x0000000B, 0x0000000C, 0x0000000D, 0x0000000E,
0x00000010, 0x00000011, 0x00000013, 0x00000015, 0x00000017, 0x00000019, 0x0000001C, 0x0000001F,
0x00000022, 0x00000025, 0x00000029, 0x0000002D, 0x00000032, 0x00000037, 0x0000003C, 0x00000042,
0x00000049, 0x00000050, 0x00000058, 0x00000061, 0x0000006B, 0x00000076, 0x00000082, 0x0000008F,
0x0000009D, 0x000000AD, 0x000000BE, 0x000000D1, 0x000000E6, 0x000000FD, 0x00000117, 0x00000133,
0x00000151, 0x00000173, 0x00000198, 0x000001C1, 0x000001EE, 0x00000220, 0x00000256, 0x00000292,
0x000002D4, 0x0000031C, 0x0000036C, 0x000003C3, 0x00000424, 0x0000048E, 0x00000502, 0x00000583,
0x00000610, 0x000006AB, 0x00000756, 0x00000812, 0x000008E0, 0x000009C3, 0x00000ABD, 0x00000BD0,
0x00000CFF, 0x00000E4C, 0x00000FBA, 0x0000114C, 0x00001307, 0x000014EE, 0x00001706, 0x00001954,
0x00001BDC, 0x00001EA5, 0x000021B6, 0x00002515, 0x000028CA, 0x00002CDF, 0x0000315B, 0x0000364B,
0x00003BB9, 0x000041B2, 0x00004844, 0x00004F7E, 0x00005771, 0x0000602F, 0x000069CE, 0x00007462,
0x00007FFF
};
//-----------------------------------------------------------------------------
// Helper class for writing output ADPCM data
class TADPCMStream
{
public:
TADPCMStream(void * pvBuffer, size_t cbBuffer)
{
pbBufferEnd = (unsigned char *)pvBuffer + cbBuffer;
pbBuffer = (unsigned char *)pvBuffer;
}
bool ReadByteSample(unsigned char & ByteSample)
{
// Check if there is enough space in the buffer
if(pbBuffer >= pbBufferEnd)
return false;
ByteSample = *pbBuffer++;
return true;
}
bool WriteByteSample(unsigned char ByteSample)
{
// Check if there is enough space in the buffer
if(pbBuffer >= pbBufferEnd)
return false;
*pbBuffer++ = ByteSample;
return true;
}
bool ReadWordSample(short & OneSample)
{
// Check if we have enough space in the output buffer
if((size_t)(pbBufferEnd - pbBuffer) < sizeof(short))
return false;
// Write the sample
OneSample = pbBuffer[0] + (((short)pbBuffer[1]) << 0x08);
pbBuffer += sizeof(short);
return true;
}
bool WriteWordSample(short OneSample)
{
// Check if we have enough space in the output buffer
if((size_t)(pbBufferEnd - pbBuffer) < sizeof(short))
return false;
// Write the sample
*pbBuffer++ = (unsigned char)(OneSample & 0xFF);
*pbBuffer++ = (unsigned char)(OneSample >> 0x08);
return true;
}
int LengthProcessed(void * pvBuffer)
{
return pbBuffer - (unsigned char *)pvBuffer;
}
unsigned char * pbBufferEnd;
unsigned char * pbBuffer;
};
//----------------------------------------------------------------------------
// Local functions
// CompressWave
static inline short GetNextStepIndex(int StepIndex, unsigned int EncodedSample)
// 1500EF70
int CompressADPCM(unsigned char * pbOutBuffer, int dwOutLength, short * pwInBuffer, int dwInLength, int nChannels, int nCmpLevel)
// ECX EDX
{
// Get the next step index
StepIndex = StepIndex + NextStepTable[EncodedSample & 0x1F];
WORD_AND_BYTE_ARRAY Wcmp;
BYTE_AND_WORD_PTR out; // Pointer to the output buffer
long SInt32Array1[2];
long SInt32Array2[2];
long SInt32Array3[2];
long nBytesRemains = dwOutLength; // Number of bytes remaining
long nWordsRemains; // Number of words remaining
// unsigned char * pbSaveOutBuffer; // Copy of output buffer (actually not used)
unsigned long dwBitBuff;
unsigned long dwStopBit;
unsigned long dwBit;
unsigned long ebx;
unsigned long esi;
long nTableValue;
long nOneWord;
long var_1C;
long var_2C;
int nLength;
int nIndex;
int nValue;
int i, chnl;
// Don't make the step index overflow
if(StepIndex < 0)
StepIndex = 0;
else if(StepIndex > 88)
StepIndex = 88;
return (short)StepIndex;
}
static inline int UpdatePredictedSample(int PredictedSample, int EncodedSample, int Difference)
{
// Is the sign bit set?
if(EncodedSample & 0x40)
{
PredictedSample -= Difference;
if(PredictedSample <= -32768)
PredictedSample = -32768;
}
else
{
PredictedSample += Difference;
if(PredictedSample >= 32767)
PredictedSample = 32767;
}
return PredictedSample;
}
static inline int DecodeSample(int PredictedSample, int EncodedSample, int StepSize, int Difference)
{
if(EncodedSample & 0x01)
Difference += (StepSize >> 0);
if(EncodedSample & 0x02)
Difference += (StepSize >> 1);
if(EncodedSample & 0x04)
Difference += (StepSize >> 2);
if(EncodedSample & 0x08)
Difference += (StepSize >> 3);
if(EncodedSample & 0x10)
Difference += (StepSize >> 4);
if(EncodedSample & 0x20)
Difference += (StepSize >> 5);
return UpdatePredictedSample(PredictedSample, EncodedSample, Difference);
}
//----------------------------------------------------------------------------
// Compression routine
int CompressADPCM(void * pvOutBuffer, int cbOutBuffer, void * pvInBuffer, int cbInBuffer, int ChannelCount, int CompressionLevel)
{
TADPCMStream os(pvOutBuffer, cbOutBuffer); // The output stream
TADPCMStream is(pvInBuffer, cbInBuffer); // The input stream
unsigned char BitShift = (unsigned char)(CompressionLevel - 1);
short PredictedSamples[MAX_ADPCM_CHANNEL_COUNT];// Predicted samples for each channel
short StepIndexes[MAX_ADPCM_CHANNEL_COUNT]; // Step indexes for each channel
short InputSample; // Input sample for the current channel
int TotalStepSize;
int ChannelIndex;
int AbsDifference;
int Difference;
int MaxBitMask;
int StepSize;
// _tprintf(_T("== CMPR Started ==============\n"));
// First byte in the output stream contains zero. The second one contains the compression level
os.WriteByteSample(0);
if(!os.WriteByteSample(BitShift))
// If less than 2 bytes remain, don't decompress anything
// pbSaveOutBuffer = pbOutBuffer;
out.pb = pbOutBuffer;
if(nBytesRemains < 2)
return 2;
// Set the initial step index for each channel
StepIndexes[0] = StepIndexes[1] = INITIAL_ADPCM_STEP_INDEX;
Wcmp.b[1] = (unsigned char)(nCmpLevel - 1);
Wcmp.b[0] = (unsigned char)0;
// Next, InitialSample value for each channel follows
for(int i = 0; i < ChannelCount; i++)
*out.pw++ = BSWAP_INT16_SIGNED(Wcmp.w);
if((out.pb - pbOutBuffer + (nChannels * 2)) > nBytesRemains)
return (int)(out.pb - pbOutBuffer + (nChannels * 2));
SInt32Array1[0] = SInt32Array1[1] = 0x2C;
for(i = 0; i < nChannels; i++)
{
// Get the initial sample from the input stream
if(!is.ReadWordSample(InputSample))
return os.LengthProcessed(pvOutBuffer);
// Store the initial sample to our sample array
PredictedSamples[i] = InputSample;
// Also store the loaded sample to the output stream
if(!os.WriteWordSample(InputSample))
return os.LengthProcessed(pvOutBuffer);
nOneWord = BSWAP_INT16_SIGNED(*pwInBuffer++);
*out.pw++ = BSWAP_INT16_SIGNED((short)nOneWord);
SInt32Array2[i] = nOneWord;
}
// Get the initial index
ChannelIndex = ChannelCount - 1;
// Now keep reading the input data as long as there is something in the input buffer
while(is.ReadWordSample(InputSample))
// Weird. But it's there
nLength = dwInLength;
if(nLength < 0) // mov eax, dwInLength; cdq; sub eax, edx;
nLength++;
nLength = (nLength / 2) - (int)(out.pb - pbOutBuffer);
nLength = (nLength < 0) ? 0 : nLength;
nIndex = nChannels - 1; // edi
nWordsRemains = dwInLength / 2; // eax
// ebx - nChannels
// ecx - pwOutPos
for(chnl = nChannels; chnl < nWordsRemains; chnl++)
{
int EncodedSample = 0;
// 1500F030
if((out.pb - pbOutBuffer + 2) > nBytesRemains)
return (int)(out.pb - pbOutBuffer + 2);
// If we have two channels, we need to flip the channel index
ChannelIndex = (ChannelIndex + 1) % ChannelCount;
// Switch index
if(nChannels == 2)
nIndex = (nIndex == 0) ? 1 : 0;
// Get the difference from the previous sample.
// If the difference is negative, set the sign bit to the encoded sample
AbsDifference = InputSample - PredictedSamples[ChannelIndex];
if(AbsDifference < 0)
// Load one word from the input stream
nOneWord = BSWAP_INT16_SIGNED(*pwInBuffer++); // ecx - nOneWord
SInt32Array3[nIndex] = nOneWord;
// esi - SInt32Array2[nIndex]
// eax - nValue
nValue = nOneWord - SInt32Array2[nIndex];
nValue = (nValue < 0) ? ((nValue ^ 0xFFFFFFFF) + 1) : nValue;
ebx = (nOneWord >= SInt32Array2[nIndex]) ? 0 : 0x40;
// esi - SInt32Array2[nIndex]
// edx - step_table[SInt32Array2[nIndex]]
// edi - (step_table[SInt32Array1[nIndex]] >> nCmpLevel)
nTableValue = step_table[SInt32Array1[nIndex]];
dwStopBit = (unsigned long)nCmpLevel;
// edi - nIndex;
if(nValue < (nTableValue >> nCmpLevel))
{
AbsDifference = -AbsDifference;
EncodedSample |= 0x40;
}
// If the difference is too low (higher that difference treshold),
// write a step index modifier marker
StepSize = StepSizeTable[StepIndexes[ChannelIndex]];
if(AbsDifference < (StepSize >> CompressionLevel))
{
if(StepIndexes[ChannelIndex] != 0)
StepIndexes[ChannelIndex]--;
os.WriteByteSample(0x80);
if(SInt32Array1[nIndex] != 0)
SInt32Array1[nIndex]--;
*out.pb++ = 0x80;
}
else
{
// If the difference is too high, write marker that
// indicates increase in step size
while(AbsDifference > (StepSize << 1))
while(nValue > nTableValue * 2)
{
if(StepIndexes[ChannelIndex] >= 0x58)
if(SInt32Array1[nIndex] >= 0x58 || nLength == 0)
break;
// Modify the step index
StepIndexes[ChannelIndex] += 8;
if(StepIndexes[ChannelIndex] > 0x58)
StepIndexes[ChannelIndex] = 0x58;
SInt32Array1[nIndex] += 8;
if(SInt32Array1[nIndex] > 0x58)
SInt32Array1[nIndex] = 0x58;
// Write the "modify step index" marker
StepSize = StepSizeTable[StepIndexes[ChannelIndex]];
os.WriteByteSample(0x81);
nTableValue = step_table[SInt32Array1[nIndex]];
*out.pb++ = 0x81;
nLength--;
}
// Get the limit bit value
MaxBitMask = (1 << (BitShift - 1));
MaxBitMask = (MaxBitMask > 0x20) ? 0x20 : MaxBitMask;
Difference = StepSize >> BitShift;
TotalStepSize = 0;
var_2C = nTableValue >> Wcmp.b[1];
dwBitBuff = 0;
for(int BitVal = 0x01; BitVal <= MaxBitMask; BitVal <<= 1)
esi = (1 << (dwStopBit - 2));
dwStopBit = (esi <= 0x20) ? esi : 0x20;
for(var_1C = 0, dwBit = 1; ; dwBit <<= 1)
{
if((TotalStepSize + StepSize) <= AbsDifference)
// esi = var_1C + nTableValue;
if((var_1C + nTableValue) <= nValue)
{
TotalStepSize += StepSize;
EncodedSample |= BitVal;
var_1C += nTableValue;
dwBitBuff |= dwBit;
}
StepSize >>= 1;
if(dwBit == dwStopBit)
break;
nTableValue >>= 1;
}
PredictedSamples[ChannelIndex] = (short)UpdatePredictedSample(PredictedSamples[ChannelIndex],
EncodedSample,
Difference + TotalStepSize);
// Write the encoded sample to the output stream
if(!os.WriteByteSample((unsigned char)EncodedSample))
break;
// Calculates the step index to use for the next encode
StepIndexes[ChannelIndex] = GetNextStepIndex(StepIndexes[ChannelIndex], EncodedSample);
nValue = SInt32Array2[nIndex];
if(ebx != 0)
{
nValue -= (var_1C + var_2C);
if(nValue < -32768)
nValue = -32768;
}
else
{
nValue += (var_1C + var_2C);
if(nValue > 32767)
nValue = 32767;
}
SInt32Array2[nIndex] = nValue;
*out.pb++ = (unsigned char)(dwBitBuff | ebx);
nTableValue = Table1503F120[dwBitBuff & 0x1F];
SInt32Array1[nIndex] = SInt32Array1[nIndex] + nTableValue;
if(SInt32Array1[nIndex] < 0)
SInt32Array1[nIndex] = 0;
else if(SInt32Array1[nIndex] > 0x58)
SInt32Array1[nIndex] = 0x58;
}
}
// _tprintf(_T("== CMPR Ended ================\n"));
return os.LengthProcessed(pvOutBuffer);
return (int)(out.pb - pbOutBuffer);
}
//----------------------------------------------------------------------------
// Decompression routine
// DecompressADPCM
int DecompressADPCM(void * pvOutBuffer, int cbOutBuffer, void * pvInBuffer, int cbInBuffer, int ChannelCount)
// 1500F230
int DecompressADPCM(unsigned char * pbOutBuffer, int dwOutLength, unsigned char * pbInBuffer, int dwInLength, int nChannels)
{
TADPCMStream os(pvOutBuffer, cbOutBuffer); // Output stream
TADPCMStream is(pvInBuffer, cbInBuffer); // Input stream
unsigned char EncodedSample;
unsigned char BitShift;
short PredictedSamples[MAX_ADPCM_CHANNEL_COUNT]; // Predicted sample for each channel
short StepIndexes[MAX_ADPCM_CHANNEL_COUNT]; // Predicted step index for each channel
int ChannelIndex; // Current channel index
BYTE_AND_WORD_PTR out; // Output buffer
BYTE_AND_WORD_PTR in;
unsigned char * pbInBufferEnd = (pbInBuffer + dwInLength);
long SInt32Array1[2];
long SInt32Array2[2];
long nOneWord;
int nIndex;
int i;
// Initialize the StepIndex for each channel
StepIndexes[0] = StepIndexes[1] = INITIAL_ADPCM_STEP_INDEX;
SInt32Array1[0] = SInt32Array1[1] = 0x2C;
out.pb = pbOutBuffer;
in.pb = pbInBuffer;
in.pw++;
// _tprintf(_T("== DCMP Started ==============\n"));
// The first byte is always zero, the second one contains bit shift (compression level - 1)
is.ReadByteSample(BitShift);
is.ReadByteSample(BitShift);
// _tprintf(_T("DCMP: BitShift = %u\n"), (unsigned int)(unsigned char)BitShift);
// Next, InitialSample value for each channel follows
for(int i = 0; i < ChannelCount; i++)
// Fill the Uint32Array2 array by channel values.
for(i = 0; i < nChannels; i++)
{
// Get the initial sample from the input stream
short InitialSample;
nOneWord = BSWAP_INT16_SIGNED(*in.pw++);
SInt32Array2[i] = nOneWord;
if(dwOutLength < 2)
return (int)(out.pb - pbOutBuffer);
// Attempt to read the initial sample
if(!is.ReadWordSample(InitialSample))
return os.LengthProcessed(pvOutBuffer);
// _tprintf(_T("DCMP: Loaded InitialSample[%u]: %04X\n"), i, (unsigned int)(unsigned short)InitialSample);
// Store the initial sample to our sample array
PredictedSamples[i] = InitialSample;
// Also store the loaded sample to the output stream
if(!os.WriteWordSample(InitialSample))
return os.LengthProcessed(pvOutBuffer);
*out.pw++ = BSWAP_INT16_SIGNED((short)nOneWord);
dwOutLength -= sizeof(short);
}
// Get the initial index
ChannelIndex = ChannelCount - 1;
nIndex = nChannels - 1;
// Keep reading as long as there is something in the input buffer
while(is.ReadByteSample(EncodedSample))
// Perform the decompression
while(in.pb < pbInBufferEnd)
{
// _tprintf(_T("DCMP: Loaded Encoded Sample: %02X\n"), (unsigned int)(unsigned char)EncodedSample);
unsigned char nOneByte = *in.pb++;
// If we have two channels, we need to flip the channel index
ChannelIndex = (ChannelIndex + 1) % ChannelCount;
// Switch index
if(nChannels == 2)
nIndex = (nIndex == 0) ? 1 : 0;
if(EncodedSample == 0x80)
// 1500F2A2: Get one byte from input buffer
if(nOneByte & 0x80)
{
if(StepIndexes[ChannelIndex] != 0)
StepIndexes[ChannelIndex]--;
switch(nOneByte & 0x7F)
{
case 0: // 1500F315
if(SInt32Array1[nIndex] != 0)
SInt32Array1[nIndex]--;
// _tprintf(_T("DCMP: Writing Decoded Sample: %04lX\n"), (unsigned int)(unsigned short)PredictedSamples[ChannelIndex]);
if(!os.WriteWordSample(PredictedSamples[ChannelIndex]))
return os.LengthProcessed(pvOutBuffer);
}
else if(EncodedSample == 0x81)
{
// Modify the step index
StepIndexes[ChannelIndex] += 8;
if(StepIndexes[ChannelIndex] > 0x58)
StepIndexes[ChannelIndex] = 0x58;
if(dwOutLength < 2)
return (int)(out.pb - pbOutBuffer);
// _tprintf(_T("DCMP: New value of StepIndex: %04lX\n"), (unsigned int)(unsigned short)StepIndexes[ChannelIndex]);
*out.pw++ = BSWAP_INT16_SIGNED((unsigned short)SInt32Array2[nIndex]);
dwOutLength -= sizeof(unsigned short);
break;
// Next pass, keep going on the same channel
ChannelIndex = (ChannelIndex + 1) % ChannelCount;
case 1: // 1500F2E8
SInt32Array1[nIndex] += 8;
if(SInt32Array1[nIndex] > 0x58)
SInt32Array1[nIndex] = 0x58;
if(nChannels == 2)
nIndex = (nIndex == 0) ? 1 : 0;
break;
case 2: // 1500F41E
break;
default: // 1500F2C4
SInt32Array1[nIndex] -= 8;
if(SInt32Array1[nIndex] < 0)
SInt32Array1[nIndex] = 0;
if(nChannels == 2)
nIndex = (nIndex == 0) ? 1 : 0;
break;
}
}
else
{
int StepIndex = StepIndexes[ChannelIndex];
int StepSize = StepSizeTable[StepIndex];
// 1500F349
long temp1 = step_table[SInt32Array1[nIndex]]; // EDI
long temp2 = temp1 >> pbInBuffer[1]; // ESI
long temp3 = SInt32Array2[nIndex]; // ECX
// Encode one sample
PredictedSamples[ChannelIndex] = (short)DecodeSample(PredictedSamples[ChannelIndex],
EncodedSample,
StepSize,
StepSize >> BitShift);
if(nOneByte & 0x01) // EBX = nOneByte
temp2 += (temp1 >> 0);
// _tprintf(_T("DCMP: Writing decoded sample: %04X\n"), (unsigned int)(unsigned short)PredictedSamples[ChannelIndex]);
if(nOneByte & 0x02)
temp2 += (temp1 >> 1);
// Write the decoded sample to the output stream
if(!os.WriteWordSample(PredictedSamples[ChannelIndex]))
if(nOneByte & 0x04)
temp2 += (temp1 >> 2);
if(nOneByte & 0x08)
temp2 += (temp1 >> 3);
if(nOneByte & 0x10)
temp2 += (temp1 >> 4);
if(nOneByte & 0x20)
temp2 += (temp1 >> 5);
if(nOneByte & 0x40)
{
temp3 = temp3 - temp2;
if(temp3 <= -32768)
temp3 = -32768;
}
else
{
temp3 = temp3 + temp2;
if(temp3 >= 32767)
temp3 = 32767;
}
SInt32Array2[nIndex] = temp3;
if(dwOutLength < 2)
break;
// Calculates the step index to use for the next encode
StepIndexes[ChannelIndex] = GetNextStepIndex(StepIndex, EncodedSample);
// _tprintf(_T("DCMP: New step index: %04X\n"), (unsigned int)(unsigned short)StepIndexes[ChannelIndex]);
// Store the output 16-bit value
*out.pw++ = BSWAP_INT16_SIGNED((short)SInt32Array2[nIndex]);
dwOutLength -= 2;
SInt32Array1[nIndex] += Table1503F120[nOneByte & 0x1F];
if(SInt32Array1[nIndex] < 0)
SInt32Array1[nIndex] = 0;
else if(SInt32Array1[nIndex] > 0x58)
SInt32Array1[nIndex] = 0x58;
}
}
// _tprintf(_T("DCMP: Total length written: %u\n"), (unsigned int)os.LengthProcessed(pvOutBuffer));
// _tprintf(_T("== DCMP Ended ================\n"));
// Return total bytes written since beginning of the output buffer
return os.LengthProcessed(pvOutBuffer);
return (int)(out.pb - pbOutBuffer);
}

View file

@ -12,15 +12,11 @@
#define __ADPCM_H__
//-----------------------------------------------------------------------------
// Defines
// Functions
#define MAX_ADPCM_CHANNEL_COUNT 2
#define INITIAL_ADPCM_STEP_INDEX 0x2C
#include "../StormPort.h"
//-----------------------------------------------------------------------------
// Public functions
int CompressADPCM (void * pvOutBuffer, int dwOutLength, void * pvInBuffer, int dwInLength, int nCmpType, int ChannelCount);
int DecompressADPCM(void * pvOutBuffer, int dwOutLength, void * pvInBuffer, int dwInLength, int ChannelCount);
int CompressADPCM (unsigned char * pbOutBuffer, int dwOutLength, short * pwInBuffer, int dwInLength, int nCmpType, int nChannels);
int DecompressADPCM(unsigned char * pbOutBuffer, int dwOutLength, unsigned char * pbInBuffer, int dwInLength, int nChannels);
#endif // __ADPCM_H__

File diff suppressed because it is too large Load diff

View file

@ -9,15 +9,25 @@
/* 03.05.03 2.00 Lad Added compression */
/* 08.12.03 2.01 Dan High-memory handling (> 0x80000000) */
/*****************************************************************************/
#ifndef __HUFFMAN_H__
#define __HUFFMAN_H__
#include "../StormPort.h"
//-----------------------------------------------------------------------------
// Defines
#define HUFF_ITEM_COUNT 0x203 // Number of items in the item pool
#define LINK_ITEM_COUNT 0x80 // Maximum number of quick-link items
#define INSERT_ITEM 1
#define SWITCH_ITEMS 2 // Switch the item1 and item2
#define PTR_NOT(ptr) (THTreeItem *)(~(DWORD_PTR)(ptr))
#define PTR_PTR(ptr) ((THTreeItem *)(ptr))
#define PTR_INT(ptr) (INT_PTR)(ptr)
#ifndef NULL
#define NULL 0
#endif
//-----------------------------------------------------------------------------
// Structures and classes
@ -27,76 +37,65 @@ class TInputStream
{
public:
TInputStream(void * pvInBuffer, size_t cbInBuffer);
unsigned int Get1Bit();
unsigned int Peek7Bits();
unsigned int Get8Bits();
unsigned long GetBit();
unsigned long Get7Bits();
unsigned long Get8Bits();
void SkipBits(unsigned int BitCount);
unsigned char * pbInBufferEnd; // End position in the the input buffer
unsigned char * pbInBuffer; // Current position in the the input buffer
unsigned int BitBuffer; // Input bit buffer
unsigned int BitCount; // Number of bits remaining in 'dwBitBuff'
unsigned char * pbInBuffer; // Input data
unsigned char * pbInBufferEnd; // End of the input buffer
unsigned long BitBuffer; // Input bit buffer
unsigned int BitCount; // Number of bits remaining in 'dwBitBuff'
};
// Output stream for Huffmann compression
class TOutputStream
{
public:
TOutputStream(void * pvOutBuffer, size_t cbOutLength);
void PutBits(unsigned int dwValue, unsigned int nBitCount);
void Flush();
unsigned char * pbOutBufferEnd; // End position in the output buffer
unsigned char * pbOutBuffer; // Current position in the output buffer
unsigned int BitBuffer; // Bit buffer
unsigned int BitCount; // Number of bits in the bit buffer
void PutBits(unsigned long dwBuff, unsigned int nPutBits);
unsigned char * pbOutBuffer; // 00 : Output buffer
unsigned long cbOutSize; // 04 : Size of output buffer
unsigned char * pbOutPos; // 08 : Current output position
unsigned long dwBitBuff; // 0C : Bit buffer
unsigned long nBits; // 10 : Number of bits in the bit buffer
};
// A virtual tree item that represents the head of the item list
#define LIST_HEAD() ((THTreeItem *)(&pFirst))
enum TInsertPoint
{
InsertAfter = 1,
InsertBefore = 2
};
// Huffmann tree item
// Huffmann tree item (?)
struct THTreeItem
{
THTreeItem() { pPrev = pNext = NULL;}
// ~THTreeItem() { RemoveItem(); }
THTreeItem * Call1501DB70(THTreeItem * pLast);
THTreeItem * GetPrevItem(LONG_PTR value);
void ClearItemLinks();
void RemoveItem();
// void RemoveEntry();
THTreeItem * pNext; // Pointer to lower-weight tree item
THTreeItem * pPrev; // Pointer to higher-weight item
unsigned int DecompressedValue; // 08 - Decompressed byte value (also index in the array)
unsigned int Weight; // 0C - Weight
THTreeItem * pParent; // 10 - Pointer to parent item (NULL if none)
THTreeItem * pChildLo; // 14 - Pointer to the child with lower-weight child ("left child")
THTreeItem * next; // 00 - Pointer to next THTreeItem
THTreeItem * prev; // 04 - Pointer to prev THTreeItem (< 0 if none)
unsigned long dcmpByte; // 08 - Index of this item in item pointer array, decompressed byte value
unsigned long byteValue; // 0C - Some byte value
THTreeItem * parent; // 10 - Pointer to parent THTreeItem (NULL if none)
THTreeItem * child; // 14 - Pointer to child THTreeItem
int addressMultiplier; // -1 if object on negative address (>0x80000000), +1 if positive
};
// Structure used for quick navigating in the huffmann tree.
// Allows skipping up to 7 bits in the compressed stream, thus
// decompressing a bit faster. Sometimes it can even get the decompressed
// byte directly.
struct TQuickLink
{
unsigned int ValidValue; // If greater than THuffmannTree::MinValidValue, the entry is valid
unsigned int ValidBits; // Number of bits that are valid for this item link
// Structure used for quick decompress. The 'bitCount' contains number of bits
// and byte value contains result decompressed byte value.
// After each walk through Huffman tree are filled all entries which are
// multiplies of number of bits loaded from input stream. These entries
// contain number of bits and result value. At the next 7 bits is tested this
// structure first. If corresponding entry found, decompression routine will
// not walk through Huffman tree and directly stores output byte to output stream.
struct TQDecompress
{
unsigned long offs00; // 00 - 1 if resolved
unsigned long nBits; // 04 - Bit count
union
{
THTreeItem * pItem; // Pointer to the item within the Huffmann tree
unsigned int DecompressedValue; // Value for direct decompression
unsigned long dcmpByte; // 08 - Byte value for decompress (if bitCount <= 7)
THTreeItem * pItem; // 08 - THTreeItem (if number of bits is greater than 7
};
};
// Structure for Huffman tree (Size 0x3674 bytes). Because I'm not expert
// for the decompression, I do not know actually if the class is really a Hufmann
@ -104,40 +103,40 @@ struct TQuickLink
class THuffmannTree
{
public:
THuffmannTree(bool bCompression);
~THuffmannTree();
void LinkTwoItems(THTreeItem * pItem1, THTreeItem * pItem2);
void InsertItem(THTreeItem * item, TInsertPoint InsertPoint, THTreeItem * item2);
THuffmannTree();
void InitTree(bool bCompression);
void BuildTree(unsigned int nCmpType);
// void ModifyTree(unsigned long dwIndex);
// void UninitTree();
THTreeItem * FindHigherOrEqualItem(THTreeItem * pItem, unsigned int Weight);
THTreeItem * CreateNewItem(unsigned int DecompressedValue, unsigned int Weight, TInsertPoint InsertPoint);
// void Call15007010(Bit32 dwInLength, THTreeItem * item);
THTreeItem * Call1500E740(unsigned int nValue);
void Call1500E820(THTreeItem * pItem);
unsigned int DoCompression(TOutputStream * os, unsigned char * pbInBuffer, int nInLength, int nCmpType);
unsigned int DoDecompression(unsigned char * pbOutBuffer, unsigned int dwOutLength, TInputStream * is);
unsigned int FixupItemPosByWeight(THTreeItem * pItem, unsigned int MaxWeight);
void BuildTree(unsigned int CompressionType);
unsigned long bIsCmp0; // 0000 - 1 if compression type 0
unsigned long offs0004; // 0004 - Some flag
THTreeItem items0008[0x203]; // 0008 - HTree items
void IncWeightsAndRebalance(THTreeItem * pItem);
void InsertNewBranchAndRebalance(unsigned int Value1, unsigned int Value2);
//- Sometimes used as HTree item -----------
THTreeItem * pItem3050; // 3050 - Always NULL (?)
THTreeItem * pItem3054; // 3054 - Pointer to Huffman tree item
THTreeItem * pItem3058; // 3058 - Pointer to Huffman tree item (< 0 if invalid)
void EncodeOneByte(TOutputStream * os, THTreeItem * pItem);
unsigned int DecodeOneByte(TInputStream * is);
//- Sometimes used as HTree item -----------
THTreeItem * pItem305C; // 305C - Usually NULL
THTreeItem * pFirst; // 3060 - Pointer to top (first) Huffman tree item
THTreeItem * pLast; // 3064 - Pointer to bottom (last) Huffman tree item (< 0 if invalid)
unsigned long nItems; // 3068 - Number of used HTree items
unsigned int Compress(TOutputStream * os, void * pvInBuffer, int cbInBuffer, int nCmpType);
unsigned int Decompress(void * pvOutBuffer, unsigned int cbOutLength, TInputStream * is);
THTreeItem ItemBuffer[HUFF_ITEM_COUNT]; // Buffer for tree items. No memory allocation is needed
unsigned int ItemsUsed; // Number of tree items used from ItemBuffer
// Head of the linear item list
THTreeItem * pFirst; // Pointer to the highest weight item
THTreeItem * pLast; // Pointer to the lowest weight item
//-------------------------------------------
THTreeItem * items306C[0x102]; // 306C - THTreeItem pointer array
TQDecompress qd3474[0x80]; // 3474 - Array for quick decompression
int addressMultiplier; // -1 if object on negative address (>0x80000000), +1 if positive
THTreeItem * ItemsByByte[0x102]; // Array of item pointers, one for each possible byte value
TQuickLink QuickLinks[LINK_ITEM_COUNT]; // Array of quick-link items
unsigned int MinValidValue; // A minimum value of TQDecompress::ValidValue to be considered valid
unsigned int bIsCmp0; // 1 if compression type 0
static unsigned char Table1502A630[];// Some table
};
#endif // __HUFFMAN_H__

View file

@ -292,7 +292,7 @@ uint32_t hashlittle( const void *key, size_t length, uint32_t initval)
u.ptr = key;
if (HASH_LITTLE_ENDIAN && ((u.i & 0x3) == 0)) {
const uint32_t *k = (const uint32_t *)key; /* read 32-bit chunks */
//const uint8_t *k8;
const uint8_t *k8;
/*------ all but last block: aligned reads and affect 32 bits of (a,b,c) */
while (length > 12)
@ -336,7 +336,7 @@ uint32_t hashlittle( const void *key, size_t length, uint32_t initval)
#else /* make valgrind happy */
const uint8_t *k8 = (const uint8_t *)k;
k8 = (const uint8_t *)k;
switch(length)
{
case 12: c+=k[2]; b+=k[1]; a+=k[0]; break;
@ -358,7 +358,7 @@ uint32_t hashlittle( const void *key, size_t length, uint32_t initval)
} else if (HASH_LITTLE_ENDIAN && ((u.i & 0x1) == 0)) {
const uint16_t *k = (const uint16_t *)key; /* read 16-bit chunks */
//const uint8_t *k8;
const uint8_t *k8;
/*--------------- all but last block: aligned reads and different mixing */
while (length > 12)
@ -372,7 +372,7 @@ uint32_t hashlittle( const void *key, size_t length, uint32_t initval)
}
/*----------------------------- handle the last (probably partial) block */
const uint8_t *k8 = (const uint8_t *)k;
k8 = (const uint8_t *)k;
switch(length)
{
case 12: c+=k[4]+(((uint32_t)k[5])<<16);
@ -477,7 +477,7 @@ void hashlittle2(
u.ptr = key;
if (HASH_LITTLE_ENDIAN && ((u.i & 0x3) == 0)) {
const uint32_t *k = (const uint32_t *)key; /* read 32-bit chunks */
//const uint8_t *k8;
const uint8_t *k8;
/*------ all but last block: aligned reads and affect 32 bits of (a,b,c) */
while (length > 12)
@ -521,7 +521,7 @@ void hashlittle2(
#else /* make valgrind happy */
const uint8_t *k8 = (const uint8_t *)k;
k8 = (const uint8_t *)k;
switch(length)
{
case 12: c+=k[2]; b+=k[1]; a+=k[0]; break;
@ -654,7 +654,7 @@ uint32_t hashbig( const void *key, size_t length, uint32_t initval)
u.ptr = key;
if (HASH_BIG_ENDIAN && ((u.i & 0x3) == 0)) {
const uint32_t *k = (const uint32_t *)key; /* read 32-bit chunks */
//const uint8_t *k8;
const uint8_t *k8;
/*------ all but last block: aligned reads and affect 32 bits of (a,b,c) */
while (length > 12)
@ -698,7 +698,7 @@ uint32_t hashbig( const void *key, size_t length, uint32_t initval)
#else /* make valgrind happy */
const uint8_t *k8 = (const uint8_t *)k;
k8 = (const uint8_t *)k;
switch(length) /* all the case statements fall through */
{
case 12: c+=k[2]; b+=k[1]; a+=k[0]; break;

View file

@ -16,7 +16,7 @@
#include "pklib.h"
#define PKDCL_OK 0
#define PKDCL_OK 0
#define PKDCL_STREAM_END 1 // All data from the input stream is read
#define PKDCL_NEED_DICT 2 // Need more data (dictionary)
#define PKDCL_CONTINUE 10 // Internal flag, not returned to user
@ -31,7 +31,7 @@ char CopyrightPkware[] = "PKWARE Data Compression Library for Win32\r\n"
//-----------------------------------------------------------------------------
// Tables
static unsigned char DistBits[] =
static unsigned char DistBits[] =
{
0x02, 0x04, 0x04, 0x05, 0x05, 0x05, 0x05, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06,
0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07,
@ -39,7 +39,7 @@ static unsigned char DistBits[] =
0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08
};
static unsigned char DistCode[] =
static unsigned char DistCode[] =
{
0x03, 0x0D, 0x05, 0x19, 0x09, 0x11, 0x01, 0x3E, 0x1E, 0x2E, 0x0E, 0x36, 0x16, 0x26, 0x06, 0x3A,
0x1A, 0x2A, 0x0A, 0x32, 0x12, 0x22, 0x42, 0x02, 0x7C, 0x3C, 0x5C, 0x1C, 0x6C, 0x2C, 0x4C, 0x0C,
@ -88,7 +88,7 @@ static unsigned char ChBitsAsc[] =
0x0D, 0x0D, 0x0C, 0x0C, 0x0C, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D
};
static unsigned short ChCodeAsc[] =
static unsigned short ChCodeAsc[] =
{
0x0490, 0x0FE0, 0x07E0, 0x0BE0, 0x03E0, 0x0DE0, 0x05E0, 0x09E0,
0x01E0, 0x00B8, 0x0062, 0x0EE0, 0x06E0, 0x0022, 0x0AE0, 0x02E0,
@ -121,7 +121,7 @@ static unsigned short ChCodeAsc[] =
0x0300, 0x0D40, 0x1D00, 0x0D00, 0x1500, 0x0540, 0x0500, 0x1900,
0x0900, 0x0940, 0x1100, 0x0100, 0x1E00, 0x0E00, 0x0140, 0x1600,
0x0600, 0x1A00, 0x0E40, 0x0640, 0x0A40, 0x0A00, 0x1200, 0x0200,
0x1C00, 0x0C00, 0x1400, 0x0400, 0x1800, 0x0800, 0x1000, 0x0000
0x1C00, 0x0C00, 0x1400, 0x0400, 0x1800, 0x0800, 0x1000, 0x0000
};
//-----------------------------------------------------------------------------
@ -133,8 +133,8 @@ static void GenDecodeTabs(
unsigned char * length_bits, // [in] Table of lengths. Each length is stored as number of bits
size_t elements) // [in] Number of elements in start_indexes and length_bits
{
unsigned int index;
unsigned int length;
unsigned long index;
unsigned long length;
size_t i;
for(i = 0; i < elements; i++)
@ -151,7 +151,7 @@ static void GenDecodeTabs(
static void GenAscTabs(TDcmpStruct * pWork)
{
unsigned short * pChCodeAsc = &ChCodeAsc[0xFF];
unsigned int acc, add;
unsigned long acc, add;
unsigned short count;
for(count = 0x00FF; pChCodeAsc >= ChCodeAsc; pChCodeAsc--, count--)
@ -227,7 +227,7 @@ static void GenAscTabs(TDcmpStruct * pWork)
// Returns: PKDCL_OK: Operation was successful
// PKDCL_STREAM_END: There are no more bits in the input buffer
static int WasteBits(TDcmpStruct * pWork, unsigned int nBits)
static int WasteBits(TDcmpStruct * pWork, unsigned long nBits)
{
// If number of bits required is less than number of (bits in the buffer) ?
if(nBits <= pWork->extra_bits)
@ -267,22 +267,22 @@ static int WasteBits(TDcmpStruct * pWork, unsigned int nBits)
// 0x305: End of stream
// 0x306: Error
static unsigned int DecodeLit(TDcmpStruct * pWork)
static unsigned long DecodeLit(TDcmpStruct * pWork)
{
unsigned int extra_length_bits; // Number of bits of extra literal length
unsigned int length_code; // Length code
unsigned int value;
unsigned long extra_length_bits; // Number of bits of extra literal length
unsigned long length_code; // Length code
unsigned long value;
// Test the current bit in byte buffer. If is not set, simply return the next 8 bits.
if(pWork->bit_buff & 1)
{
// Remove one bit from the input data
if(WasteBits(pWork, 1))
return 0x306;
return 0x306;
// The next 8 bits hold the index to the length code table
length_code = pWork->LengthCodes[pWork->bit_buff & 0xFF];
// Remove the apropriate number of bits
if(WasteBits(pWork, pWork->LenBits[length_code]))
return 0x306;
@ -290,7 +290,7 @@ static unsigned int DecodeLit(TDcmpStruct * pWork)
// Are there some extra bits for the obtained length code ?
if((extra_length_bits = pWork->ExLenBits[length_code]) != 0)
{
unsigned int extra_length = pWork->bit_buff & ((1 << extra_length_bits) - 1);
unsigned long extra_length = pWork->bit_buff & ((1 << extra_length_bits) - 1);
if(WasteBits(pWork, extra_length_bits))
{
@ -312,7 +312,7 @@ static unsigned int DecodeLit(TDcmpStruct * pWork)
// If the binary compression type, read 8 bits and return them as one byte.
if(pWork->ctype == CMP_BINARY)
{
unsigned int uncompressed_byte = pWork->bit_buff & 0xFF;
unsigned long uncompressed_byte = pWork->bit_buff & 0xFF;
if(WasteBits(pWork, 8))
return 0x306;
@ -357,11 +357,11 @@ static unsigned int DecodeLit(TDcmpStruct * pWork)
// Decodes the distance of the repetition, backwards relative to the
// current output buffer position
static unsigned int DecodeDist(TDcmpStruct * pWork, unsigned int rep_length)
static unsigned long DecodeDist(TDcmpStruct * pWork, unsigned long rep_length)
{
unsigned int dist_pos_code; // Distance position code
unsigned int dist_pos_bits; // Number of bits of distance position
unsigned int distance; // Distance position
unsigned long dist_pos_code; // Distance position code
unsigned long dist_pos_bits; // Number of bits of distance position
unsigned long distance; // Distance position
// Next 2-8 bits in the input buffer is the distance position code
dist_pos_code = pWork->DistPosCodes[pWork->bit_buff & 0xFF];
@ -388,10 +388,10 @@ static unsigned int DecodeDist(TDcmpStruct * pWork, unsigned int rep_length)
return distance + 1;
}
static unsigned int Expand(TDcmpStruct * pWork)
static unsigned long Expand(TDcmpStruct * pWork)
{
unsigned int next_literal; // Literal decoded from the compressed data
unsigned int result; // Value to be returned
unsigned long next_literal; // Literal decoded from the compressed data
unsigned long result; // Value to be returned
unsigned int copyBytes; // Number of bytes to copy to the output buffer
pWork->outputPos = 0x1000; // Initialize output buffer position
@ -412,8 +412,8 @@ static unsigned int Expand(TDcmpStruct * pWork)
{
unsigned char * source;
unsigned char * target;
unsigned int rep_length; // Length of the repetition, in bytes
unsigned int minus_dist; // Backward distance to the repetition, relative to the current buffer position
unsigned long rep_length; // Length of the repetition, in bytes
unsigned long minus_dist; // Backward distance to the repetition, relative to the current buffer position
// Get the length of the repeating sequence.
// Note that the repeating block may overlap the current output position,
@ -442,7 +442,7 @@ static unsigned int Expand(TDcmpStruct * pWork)
{
pWork->out_buff[pWork->outputPos++] = (unsigned char)next_literal;
}
// Flush the output buffer, if number of extracted bytes has reached the end
if(pWork->outputPos >= 0x2000)
{
@ -495,7 +495,7 @@ unsigned int explode(
pWork->in_pos = 3; // Position in input buffer
// Test for the valid dictionary size
if(4 > pWork->dsize_bits || pWork->dsize_bits > 6)
if(4 > pWork->dsize_bits || pWork->dsize_bits > 6)
return CMP_INVALID_DICTSIZE;
pWork->dsize_mask = 0xFFFF >> (0x10 - pWork->dsize_bits); // Shifted by 'sar' instruction
@ -517,6 +517,6 @@ unsigned int explode(
GenDecodeTabs(pWork->DistPosCodes, DistCode, pWork->DistBits, sizeof(pWork->DistBits));
if(Expand(pWork) != 0x306)
return CMP_NO_ERROR;
return CMP_ABORT;
}

View file

@ -27,7 +27,7 @@
//-----------------------------------------------------------------------------
// Tables
static unsigned char DistBits[] =
static unsigned char DistBits[] =
{
0x02, 0x04, 0x04, 0x05, 0x05, 0x05, 0x05, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06,
0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07,
@ -35,7 +35,7 @@ static unsigned char DistBits[] =
0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08
};
static unsigned char DistCode[] =
static unsigned char DistCode[] =
{
0x03, 0x0D, 0x05, 0x19, 0x09, 0x11, 0x01, 0x3E, 0x1E, 0x2E, 0x0E, 0x36, 0x16, 0x26, 0x06, 0x3A,
0x1A, 0x2A, 0x0A, 0x32, 0x12, 0x22, 0x42, 0x02, 0x7C, 0x3C, 0x5C, 0x1C, 0x6C, 0x2C, 0x4C, 0x0C,
@ -78,7 +78,7 @@ static unsigned char ChBitsAsc[] =
0x0D, 0x0D, 0x0C, 0x0C, 0x0C, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D
};
static unsigned short ChCodeAsc[] =
static unsigned short ChCodeAsc[] =
{
0x0490, 0x0FE0, 0x07E0, 0x0BE0, 0x03E0, 0x0DE0, 0x05E0, 0x09E0,
0x01E0, 0x00B8, 0x0062, 0x0EE0, 0x06E0, 0x0022, 0x0AE0, 0x02E0,
@ -111,7 +111,7 @@ static unsigned short ChCodeAsc[] =
0x0300, 0x0D40, 0x1D00, 0x0D00, 0x1500, 0x0540, 0x0500, 0x1900,
0x0900, 0x0940, 0x1100, 0x0100, 0x1E00, 0x0E00, 0x0140, 0x1600,
0x0600, 0x1A00, 0x0E40, 0x0640, 0x0A40, 0x0A00, 0x1200, 0x0200,
0x1C00, 0x0C00, 0x1400, 0x0400, 0x1800, 0x0800, 0x1000, 0x0000
0x1C00, 0x0C00, 0x1400, 0x0400, 0x1800, 0x0800, 0x1000, 0x0000
};
//-----------------------------------------------------------------------------
@ -140,7 +140,7 @@ static void SortBuffer(TCmpStruct * pWork, unsigned char * buffer_begin, unsigne
// Zero the entire "phash_to_index" table
memset(pWork->phash_to_index, 0, sizeof(pWork->phash_to_index));
// Step 1: Count amount of each PAIR_HASH in the input buffer
// The table will look like this:
// offs 0x000: Number of occurences of PAIR_HASH 0
@ -150,7 +150,7 @@ static void SortBuffer(TCmpStruct * pWork, unsigned char * buffer_begin, unsigne
for(buffer_ptr = buffer_begin; buffer_ptr < buffer_end; buffer_ptr++)
pWork->phash_to_index[BYTE_PAIR_HASH(buffer_ptr)]++;
// Step 2: Convert the table to the array of PAIR_HASH amounts.
// Step 2: Convert the table to the array of PAIR_HASH amounts.
// Each element contains count of PAIR_HASHes that is less or equal
// to element index
// The table will look like this:
@ -218,7 +218,7 @@ static void OutputBits(TCmpStruct * pWork, unsigned int nbits, unsigned long bit
{
pWork->out_bytes++;
bit_buff >>= (8 - out_bits);
pWork->out_buff[pWork->out_bytes] = (unsigned char)bit_buff;
pWork->out_bits &= 7;
}
@ -236,7 +236,7 @@ static void OutputBits(TCmpStruct * pWork, unsigned int nbits, unsigned long bit
// This function searches for a repetition
// (a previous occurence of the current byte sequence)
// Returns length of the repetition, and stores the backward distance
// Returns length of the repetition, and stores the backward distance
// to pWork structure.
static unsigned int FindRep(TCmpStruct * pWork, unsigned char * input_data)
{
@ -277,7 +277,7 @@ static unsigned int FindRep(TCmpStruct * pWork, unsigned char * input_data)
phash_offs = pWork->phash_offs + phash_offs_index;
prev_repetition = pWork->work_buff + phash_offs[0];
repetition_limit = input_data - 1;
// If the current PAIR_HASH was not encountered before,
// we haven't found a repetition.
if(prev_repetition >= repetition_limit)
@ -303,7 +303,7 @@ static unsigned int FindRep(TCmpStruct * pWork, unsigned char * input_data)
{
prev_repetition++;
input_data_ptr++;
// Are the bytes different ?
if(*prev_repetition != *input_data_ptr)
break;
@ -399,7 +399,7 @@ static unsigned int FindRep(TCmpStruct * pWork, unsigned char * input_data)
pWork->offs09BC[++offs_in_rep] = ++di_val;
}
//
//
// Now go through all the repetitions from the first found one
// to the current input data, and check if any of them migh be
// a start of a greater sequence match.
@ -408,7 +408,7 @@ static unsigned int FindRep(TCmpStruct * pWork, unsigned char * input_data)
prev_repetition = pWork->work_buff + phash_offs[0];
prev_rep_end = prev_repetition + rep_length;
rep_length2 = rep_length;
for(;;)
{
rep_length2 = pWork->offs09BC[rep_length2];
@ -502,7 +502,7 @@ static void WriteCmpData(TCmpStruct * pWork)
unsigned int save_rep_length; // Saved length of current repetition
unsigned int save_distance = 0; // Saved distance of current repetition
unsigned int rep_length; // Length of the found repetition
unsigned int phase = 0; //
unsigned int phase = 0; //
// Store the compression type and dictionary size
pWork->out_buff[0] = (char)pWork->ctype;
@ -542,12 +542,12 @@ static void WriteCmpData(TCmpStruct * pWork)
input_data_end = pWork->work_buff + pWork->dsize_bytes + total_loaded;
if(input_data_ended)
input_data_end += 0x204;
//
// Warning: The end of the buffer passed to "SortBuffer" is actually 2 bytes beyond
// valid data. It is questionable if this is actually a bug or not,
// but it might cause the compressed data output to be dependent on random bytes
// that are in the buffer.
// that are in the buffer.
// To prevent that, the calling application must always zero the compression
// buffer before passing it to "implode"
//
@ -556,7 +556,7 @@ static void WriteCmpData(TCmpStruct * pWork)
// previously compressed data, if any.
switch(phase)
{
case 0:
case 0:
SortBuffer(pWork, input_data, input_data_end + 1);
phase++;
if(pWork->dsize_bytes != 0x1000)

View file

@ -34,7 +34,7 @@
#ifndef PKEXPORT
#ifdef WIN32
#define PKEXPORT __cdecl // Use for normal __cdecl calling
#define PKEXPORT __cdecl // Use for normal __cdecl calling
#else
#define PKEXPORT
#endif
@ -47,7 +47,7 @@
typedef struct
{
unsigned int distance; // 0000: Backward distance of the currently found repetition, decreased by 1
unsigned int out_bytes; // 0004: # bytes available in out_buff
unsigned int out_bytes; // 0004: # bytes available in out_buff
unsigned int out_bits; // 0008: # of bits available in the last out byte
unsigned int dsize_bits; // 000C: Number of bits needed for dictionary size. 4 = 0x400, 5 = 0x800, 6 = 0x1000
unsigned int dsize_mask; // 0010: Bit mask for dictionary. 0x0F = 0x400, 0x1F = 0x800, 0x3F = 0x1000
@ -57,14 +57,14 @@ typedef struct
unsigned char dist_codes[0x40]; // 005C: Distance codes
unsigned char nChBits[0x306]; // 009C: Table of literal bit lengths to be put to the output stream
unsigned short nChCodes[0x306]; // 03A2: Table of literal codes to be put to the output stream
unsigned short offs09AE; // 09AE:
unsigned short offs09AE; // 09AE:
void * param; // 09B0: User parameter
unsigned int (*read_buf)(char *buf, unsigned int *size, void *param); // 9B4
void (*write_buf)(char *buf, unsigned int *size, void *param); // 9B8
unsigned short offs09BC[0x204]; // 09BC:
unsigned long offs0DC4; // 0DC4:
unsigned long offs0DC4; // 0DC4:
unsigned short phash_to_index[0x900]; // 0DC8: Array of indexes (one for each PAIR_HASH) to the "pair_hash_offsets" table
unsigned short phash_to_index_end; // 1FC8: End marker for "phash_to_index" table
char out_buff[0x802]; // 1FCA: Compressed data
@ -101,15 +101,15 @@ typedef struct
unsigned char in_buff[0x800]; // 2234: Buffer for data to be decompressed
unsigned char DistPosCodes[0x100]; // 2A34: Table of distance position codes
unsigned char LengthCodes[0x100]; // 2B34: Table of length codes
unsigned char offs2C34[0x100]; // 2C34: Buffer for
unsigned char offs2D34[0x100]; // 2D34: Buffer for
unsigned char offs2E34[0x80]; // 2EB4: Buffer for
unsigned char offs2EB4[0x100]; // 2EB4: Buffer for
unsigned char ChBitsAsc[0x100]; // 2FB4: Buffer for
unsigned char offs2C34[0x100]; // 2C34: Buffer for
unsigned char offs2D34[0x100]; // 2D34: Buffer for
unsigned char offs2E34[0x80]; // 2EB4: Buffer for
unsigned char offs2EB4[0x100]; // 2EB4: Buffer for
unsigned char ChBitsAsc[0x100]; // 2FB4: Buffer for
unsigned char DistBits[0x40]; // 30B4: Numbers of bytes to skip copied block length
unsigned char LenBits[0x10]; // 30F4: Numbers of bits for skip copied block length
unsigned char ExLenBits[0x10]; // 3104: Number of valid bits for copied block
unsigned short LenBase[0x10]; // 3114: Buffer for
unsigned short LenBase[0x10]; // 3114: Buffer for
} TDcmpStruct;
#define EXP_BUFFER_SIZE sizeof(TDcmpStruct) // Size of decompression structure

View file

@ -14,24 +14,22 @@
/* 19.11.03 1.01 Dan Big endian handling */
/* 08.12.03 2.01 Dan High-memory handling (> 0x80000000) */
/*****************************************************************************/
#include <assert.h>
#include <string.h>
#include "sparse.h"
//-----------------------------------------------------------------------------
// Public functions
void CompressSparse(void * pvOutBuffer, int * pcbOutBuffer, void * pvInBuffer, int cbInBuffer)
void CompressSparse(unsigned char * pbOutBuffer, int * pcbOutBuffer, unsigned char * pbInBuffer, int cbInBuffer)
{
unsigned char * pbOutBufferEnd = (unsigned char *)pvOutBuffer + *pcbOutBuffer;
unsigned char * pbInBufferEnd = (unsigned char *)pvInBuffer + cbInBuffer;
unsigned char * pbLastNonZero = (unsigned char *)pvInBuffer;
unsigned char * pbOutBuffer0 = (unsigned char *)pvOutBuffer;
unsigned char * pbInBuffPtr = (unsigned char *)pvInBuffer;
unsigned char * pbOutBuffer = (unsigned char *)pvOutBuffer;
unsigned char * pbInBuffer = (unsigned char *)pvInBuffer;
unsigned char * pbOutBufferEnd = pbOutBuffer + *pcbOutBuffer;
unsigned char * pbInBufferEnd = pbInBuffer + cbInBuffer;
unsigned char * pbLastNonZero = pbInBuffer;
unsigned char * pbOutBuffer0 = pbOutBuffer;
unsigned char * pbInBuffPtr = pbInBuffer;
size_t NumberOfNonZeros;
size_t NumberOfZeros;
@ -88,7 +86,7 @@ void CompressSparse(void * pvOutBuffer, int * pcbOutBuffer, void * pvInBuffer, i
// Put marker that means "0x80 of nonzeros"
*pbOutBuffer++ = 0xFF;
memcpy(pbOutBuffer, pbInBuffer, 0x80);
// Adjust counter of nonzeros and both pointers
NumberOfNonZeros -= 0x80;
pbOutBuffer += 0x80;
@ -108,7 +106,7 @@ void CompressSparse(void * pvOutBuffer, int * pcbOutBuffer, void * pvInBuffer, i
// Put marker that means "1 nonzero byte"
*pbOutBuffer++ = 0x80;
memcpy(pbOutBuffer, pbInBuffer, 1);
// Adjust counter of nonzeros and both pointers
NumberOfNonZeros--;
pbOutBuffer++;
@ -185,7 +183,7 @@ void CompressSparse(void * pvOutBuffer, int * pcbOutBuffer, void * pvInBuffer, i
// Put marker that means "Several zeros"
*pbOutBuffer++ = (unsigned char)(NumberOfZeros - 3);
// Adjust pointer
pbInBuffer += NumberOfZeros;
}
@ -210,7 +208,7 @@ void CompressSparse(void * pvOutBuffer, int * pcbOutBuffer, void * pvInBuffer, i
// Terminate with a marker that means "0x80 of nonzeros"
*pbOutBuffer++ = 0xFF;
memcpy(pbOutBuffer, pbInBuffer, NumberOfNonZeros);
// Adjust pointer
pbOutBuffer += NumberOfNonZeros;
break;
@ -236,11 +234,9 @@ void CompressSparse(void * pvOutBuffer, int * pcbOutBuffer, void * pvInBuffer, i
*pcbOutBuffer = (int)(pbOutBuffer - pbOutBuffer0);
}
int DecompressSparse(void * pvOutBuffer, int * pcbOutBuffer, void * pvInBuffer, int cbInBuffer)
int DecompressSparse(unsigned char * pbOutBuffer, int * pcbOutBuffer, unsigned char * pbInBuffer, int cbInBuffer)
{
unsigned char * pbInBufferEnd = (unsigned char *)pvInBuffer + cbInBuffer;
unsigned char * pbOutBuffer = (unsigned char *)pvOutBuffer;
unsigned char * pbInBuffer = (unsigned char *)pvInBuffer;
unsigned char * pbInBufferEnd = pbInBuffer + cbInBuffer;
unsigned int cbChunkSize;
unsigned int cbOutBuffer = 0;
unsigned int OneByte;
@ -260,7 +256,7 @@ int DecompressSparse(void * pvOutBuffer, int * pcbOutBuffer, void * pvInBuffer,
cbOutBuffer |= (OneByte << 0x00);
// Verify the size of the stream against the output buffer size
if(cbOutBuffer > (unsigned int)*pcbOutBuffer)
if(cbOutBuffer > *pcbOutBuffer)
return 0;
// Put the output size to the buffer

View file

@ -13,7 +13,7 @@
#include "../StormPort.h"
void CompressSparse(void * pvOutBuffer, int * pcbOutBuffer, void * pvInBuffer, int cbInBuffer);
int DecompressSparse(void * pvOutBuffer, int * pcbOutBuffer, void * pvInBuffer, int cbInBuffer);
void CompressSparse(unsigned char * pbOutBuffer, int * pcbOutLength, unsigned char * pbInBuffer, int cbInLength);
int DecompressSparse(unsigned char * pbOutBuffer, int * pcbOutLength, unsigned char * pbInBuffer, int cbInLength);
#endif // __SPARSE_H__

View file

@ -1,15 +1,12 @@
/* adler32.c -- compute the Adler-32 checksum of a data stream
* Copyright (C) 1995-2007 Mark Adler
* Copyright (C) 1995-2004 Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
*/
/* @(#) $Id$ */
#include "zutil.h"
#define local static
local uLong adler32_combine_(uLong adler1, uLong adler2, z_off64_t len2);
#define ZLIB_INTERNAL
#include "zlib.h"
#define BASE 65521UL /* largest prime smaller than 65536 */
#define NMAX 5552
@ -128,10 +125,10 @@ uLong ZEXPORT adler32(adler, buf, len)
}
/* ========================================================================= */
local uLong adler32_combine_(adler1, adler2, len2)
uLong ZEXPORT adler32_combine(adler1, adler2, len2)
uLong adler1;
uLong adler2;
z_off64_t len2;
z_off_t len2;
{
unsigned long sum1;
unsigned long sum2;
@ -144,26 +141,9 @@ local uLong adler32_combine_(adler1, adler2, len2)
MOD(sum2);
sum1 += (adler2 & 0xffff) + BASE - 1;
sum2 += ((adler1 >> 16) & 0xffff) + ((adler2 >> 16) & 0xffff) + BASE - rem;
if (sum1 >= BASE) sum1 -= BASE;
if (sum1 >= BASE) sum1 -= BASE;
if (sum2 >= (BASE << 1)) sum2 -= (BASE << 1);
if (sum2 >= BASE) sum2 -= BASE;
if (sum1 > BASE) sum1 -= BASE;
if (sum1 > BASE) sum1 -= BASE;
if (sum2 > (BASE << 1)) sum2 -= (BASE << 1);
if (sum2 > BASE) sum2 -= BASE;
return sum1 | (sum2 << 16);
}
/* ========================================================================= */
uLong ZEXPORT adler32_combine(adler1, adler2, len2)
uLong adler1;
uLong adler2;
z_off_t len2;
{
return adler32_combine_(adler1, adler2, len2);
}
uLong ZEXPORT adler32_combine64(adler1, adler2, len2)
uLong adler1;
uLong adler2;
z_off64_t len2;
{
return adler32_combine_(adler1, adler2, len2);
}

View file

@ -1,5 +1,5 @@
/* crc32.c -- compute the CRC-32 of a data stream
* Copyright (C) 1995-2006, 2010 Mark Adler
* Copyright (C) 1995-2005 Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
*
* Thanks to Rodney Brown <rbrown64@csc.com.au> for his contribution of faster
@ -53,7 +53,7 @@
/* Definitions for doing the crc four data bytes at a time. */
#ifdef BYFOUR
# define REV(w) ((((w)>>24)&0xff)+(((w)>>8)&0xff00)+ \
# define REV(w) (((w)>>24)+(((w)>>8)&0xff00)+ \
(((w)&0xff00)<<8)+(((w)&0xff)<<24))
local unsigned long crc32_little OF((unsigned long,
const unsigned char FAR *, unsigned));
@ -68,8 +68,6 @@
local unsigned long gf2_matrix_times OF((unsigned long *mat,
unsigned long vec));
local void gf2_matrix_square OF((unsigned long *square, unsigned long *mat));
local uLong crc32_combine_(uLong crc1, uLong crc2, z_off64_t len2);
#ifdef DYNAMIC_CRC_TABLE
@ -221,7 +219,7 @@ const unsigned long FAR * ZEXPORT get_crc_table()
unsigned long ZEXPORT crc32(crc, buf, len)
unsigned long crc;
const unsigned char FAR *buf;
uInt len;
unsigned len;
{
if (buf == Z_NULL) return 0UL;
@ -369,22 +367,22 @@ local void gf2_matrix_square(square, mat)
}
/* ========================================================================= */
local uLong crc32_combine_(crc1, crc2, len2)
uLong ZEXPORT crc32_combine(crc1, crc2, len2)
uLong crc1;
uLong crc2;
z_off64_t len2;
z_off_t len2;
{
int n;
unsigned long row;
unsigned long even[GF2_DIM]; /* even-power-of-two zeros operator */
unsigned long odd[GF2_DIM]; /* odd-power-of-two zeros operator */
/* degenerate case (also disallow negative lengths) */
if (len2 <= 0)
/* degenerate case */
if (len2 == 0)
return crc1;
/* put operator for one zero bit in odd */
odd[0] = 0xedb88320UL; /* CRC-32 polynomial */
odd[0] = 0xedb88320L; /* CRC-32 polynomial */
row = 1;
for (n = 1; n < GF2_DIM; n++) {
odd[n] = row;
@ -423,20 +421,3 @@ local uLong crc32_combine_(crc1, crc2, len2)
crc1 ^= crc2;
return crc1;
}
/* ========================================================================= */
uLong ZEXPORT crc32_combine(crc1, crc2, len2)
uLong crc1;
uLong crc2;
z_off_t len2;
{
return crc32_combine_(crc1, crc2, len2);
}
uLong ZEXPORT crc32_combine64(crc1, crc2, len2)
uLong crc1;
uLong crc2;
z_off64_t len2;
{
return crc32_combine_(crc1, crc2, len2);
}

View file

@ -1,5 +1,5 @@
/* deflate.c -- compress data using the deflation algorithm
* Copyright (C) 1995-2010 Jean-loup Gailly and Mark Adler
* Copyright (C) 1995-2005 Jean-loup Gailly.
* For conditions of distribution and use, see copyright notice in zlib.h
*/
@ -52,7 +52,7 @@
#include "deflate.h"
const char deflate_copyright[] =
" deflate 1.2.5 Copyright 1995-2010 Jean-loup Gailly and Mark Adler ";
" deflate 1.2.3 Copyright 1995-2005 Jean-loup Gailly ";
/*
If you use the zlib library in a product, an acknowledgment is welcome
in the documentation of your product. If for some reason you cannot
@ -79,18 +79,19 @@ local block_state deflate_fast OF((deflate_state *s, int flush));
#ifndef FASTEST
local block_state deflate_slow OF((deflate_state *s, int flush));
#endif
local block_state deflate_rle OF((deflate_state *s, int flush));
local block_state deflate_huff OF((deflate_state *s, int flush));
local void lm_init OF((deflate_state *s));
local void putShortMSB OF((deflate_state *s, uInt b));
local void flush_pending OF((z_streamp strm));
local int read_buf OF((z_streamp strm, Bytef *buf, unsigned size));
#ifndef FASTEST
#ifdef ASMV
void match_init OF((void)); /* asm code initialization */
uInt longest_match OF((deflate_state *s, IPos cur_match));
#else
local uInt longest_match OF((deflate_state *s, IPos cur_match));
#endif
#endif
local uInt longest_match_fast OF((deflate_state *s, IPos cur_match));
#ifdef DEBUG
local void check_match OF((deflate_state *s, IPos start, IPos match,
@ -109,6 +110,11 @@ local void check_match OF((deflate_state *s, IPos start, IPos match,
#endif
/* Matches of length 3 are discarded if their distance exceeds TOO_FAR */
#define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1)
/* Minimum amount of lookahead, except at the end of the input file.
* See deflate.c for comments about the MIN_MATCH+1.
*/
/* Values for max_lazy_match, good_match and max_chain_length, depending on
* the desired pack level (0..9). The values given below have been tuned to
* exclude worst case performance for pathological files. Better values may be
@ -282,8 +288,6 @@ int ZEXPORT deflateInit2_(strm, level, method, windowBits, memLevel, strategy,
s->prev = (Posf *) ZALLOC(strm, s->w_size, sizeof(Pos));
s->head = (Posf *) ZALLOC(strm, s->hash_size, sizeof(Pos));
s->high_water = 0; /* nothing written to s->window yet */
s->lit_bufsize = 1 << (memLevel + 6); /* 16K elements by default */
overlay = (ushf *) ZALLOC(strm, s->lit_bufsize, sizeof(ush)+2);
@ -328,8 +332,8 @@ int ZEXPORT deflateSetDictionary (strm, dictionary, dictLength)
strm->adler = adler32(strm->adler, dictionary, dictLength);
if (length < MIN_MATCH) return Z_OK;
if (length > s->w_size) {
length = s->w_size;
if (length > MAX_DIST(s)) {
length = MAX_DIST(s);
dictionary += dictLength - length; /* use the tail of the dictionary */
}
zmemcpy(s->window, dictionary, length);
@ -431,10 +435,9 @@ int ZEXPORT deflateParams(strm, level, strategy)
}
func = configuration_table[s->level].func;
if ((strategy != s->strategy || func != configuration_table[level].func) &&
strm->total_in != 0) {
if (func != configuration_table[level].func && strm->total_in != 0) {
/* Flush the last buffer: */
err = deflate(strm, Z_BLOCK);
err = deflate(strm, Z_PARTIAL_FLUSH);
}
if (s->level != level) {
s->level = level;
@ -478,66 +481,33 @@ int ZEXPORT deflateTune(strm, good_length, max_lazy, nice_length, max_chain)
* resulting from using fixed blocks instead of stored blocks, which deflate
* can emit on compressed data for some combinations of the parameters.
*
* This function could be more sophisticated to provide closer upper bounds for
* every combination of windowBits and memLevel. But even the conservative
* upper bound of about 14% expansion does not seem onerous for output buffer
* allocation.
* This function could be more sophisticated to provide closer upper bounds
* for every combination of windowBits and memLevel, as well as wrap.
* But even the conservative upper bound of about 14% expansion does not
* seem onerous for output buffer allocation.
*/
uLong ZEXPORT deflateBound(strm, sourceLen)
z_streamp strm;
uLong sourceLen;
{
deflate_state *s;
uLong complen, wraplen;
Bytef *str;
uLong destLen;
/* conservative upper bound for compressed data */
complen = sourceLen +
((sourceLen + 7) >> 3) + ((sourceLen + 63) >> 6) + 5;
/* conservative upper bound */
destLen = sourceLen +
((sourceLen + 7) >> 3) + ((sourceLen + 63) >> 6) + 11;
/* if can't get parameters, return conservative bound plus zlib wrapper */
/* if can't get parameters, return conservative bound */
if (strm == Z_NULL || strm->state == Z_NULL)
return complen + 6;
/* compute wrapper length */
s = strm->state;
switch (s->wrap) {
case 0: /* raw deflate */
wraplen = 0;
break;
case 1: /* zlib wrapper */
wraplen = 6 + (s->strstart ? 4 : 0);
break;
case 2: /* gzip wrapper */
wraplen = 18;
if (s->gzhead != Z_NULL) { /* user-supplied gzip header */
if (s->gzhead->extra != Z_NULL)
wraplen += 2 + s->gzhead->extra_len;
str = s->gzhead->name;
if (str != Z_NULL)
do {
wraplen++;
} while (*str++);
str = s->gzhead->comment;
if (str != Z_NULL)
do {
wraplen++;
} while (*str++);
if (s->gzhead->hcrc)
wraplen += 2;
}
break;
default: /* for compiler happiness */
wraplen = 6;
}
return destLen;
/* if not default parameters, return conservative bound */
s = strm->state;
if (s->w_bits != 15 || s->hash_bits != 8 + 7)
return complen + wraplen;
return destLen;
/* default settings: return tight bound for that case */
return sourceLen + (sourceLen >> 12) + (sourceLen >> 14) +
(sourceLen >> 25) + 13 - 6 + wraplen;
return compressBound(sourceLen);
}
/* =========================================================================
@ -587,7 +557,7 @@ int ZEXPORT deflate (strm, flush)
deflate_state *s;
if (strm == Z_NULL || strm->state == Z_NULL ||
flush > Z_BLOCK || flush < 0) {
flush > Z_FINISH || flush < 0) {
return Z_STREAM_ERROR;
}
s = strm->state;
@ -611,7 +581,7 @@ int ZEXPORT deflate (strm, flush)
put_byte(s, 31);
put_byte(s, 139);
put_byte(s, 8);
if (s->gzhead == Z_NULL) {
if (s->gzhead == NULL) {
put_byte(s, 0);
put_byte(s, 0);
put_byte(s, 0);
@ -638,7 +608,7 @@ int ZEXPORT deflate (strm, flush)
(s->strategy >= Z_HUFFMAN_ONLY || s->level < 2 ?
4 : 0));
put_byte(s, s->gzhead->os & 0xff);
if (s->gzhead->extra != Z_NULL) {
if (s->gzhead->extra != NULL) {
put_byte(s, s->gzhead->extra_len & 0xff);
put_byte(s, (s->gzhead->extra_len >> 8) & 0xff);
}
@ -680,7 +650,7 @@ int ZEXPORT deflate (strm, flush)
}
#ifdef GZIP
if (s->status == EXTRA_STATE) {
if (s->gzhead->extra != Z_NULL) {
if (s->gzhead->extra != NULL) {
uInt beg = s->pending; /* start of bytes to update crc */
while (s->gzindex < (s->gzhead->extra_len & 0xffff)) {
@ -708,7 +678,7 @@ int ZEXPORT deflate (strm, flush)
s->status = NAME_STATE;
}
if (s->status == NAME_STATE) {
if (s->gzhead->name != Z_NULL) {
if (s->gzhead->name != NULL) {
uInt beg = s->pending; /* start of bytes to update crc */
int val;
@ -739,7 +709,7 @@ int ZEXPORT deflate (strm, flush)
s->status = COMMENT_STATE;
}
if (s->status == COMMENT_STATE) {
if (s->gzhead->comment != Z_NULL) {
if (s->gzhead->comment != NULL) {
uInt beg = s->pending; /* start of bytes to update crc */
int val;
@ -817,9 +787,7 @@ int ZEXPORT deflate (strm, flush)
(flush != Z_NO_FLUSH && s->status != FINISH_STATE)) {
block_state bstate;
bstate = s->strategy == Z_HUFFMAN_ONLY ? deflate_huff(s, flush) :
(s->strategy == Z_RLE ? deflate_rle(s, flush) :
(*(configuration_table[s->level].func))(s, flush));
bstate = (*(configuration_table[s->level].func))(s, flush);
if (bstate == finish_started || bstate == finish_done) {
s->status = FINISH_STATE;
@ -840,17 +808,13 @@ int ZEXPORT deflate (strm, flush)
if (bstate == block_done) {
if (flush == Z_PARTIAL_FLUSH) {
_tr_align(s);
} else if (flush != Z_BLOCK) { /* FULL_FLUSH or SYNC_FLUSH */
} else { /* FULL_FLUSH or SYNC_FLUSH */
_tr_stored_block(s, (char*)0, 0L, 0);
/* For a full flush, this empty block will be recognized
* as a special marker by inflate_sync().
*/
if (flush == Z_FULL_FLUSH) {
CLEAR_HASH(s); /* forget history */
if (s->lookahead == 0) {
s->strstart = 0;
s->block_start = 0L;
}
}
}
flush_pending(strm);
@ -1203,13 +1167,12 @@ local uInt longest_match(s, cur_match)
return s->lookahead;
}
#endif /* ASMV */
#else /* FASTEST */
#endif /* FASTEST */
/* ---------------------------------------------------------------------------
* Optimized version for FASTEST only
* Optimized version for level == 1 or strategy == Z_RLE only
*/
local uInt longest_match(s, cur_match)
local uInt longest_match_fast(s, cur_match)
deflate_state *s;
IPos cur_match; /* current match */
{
@ -1262,8 +1225,6 @@ local uInt longest_match(s, cur_match)
return (uInt)len <= s->lookahead ? (uInt)len : s->lookahead;
}
#endif /* FASTEST */
#ifdef DEBUG
/* ===========================================================================
* Check that the match at match_start is indeed a match.
@ -1342,6 +1303,7 @@ local void fill_window(s)
later. (Using level 0 permanently is not an optimal usage of
zlib, so we don't care about this pathological case.)
*/
/* %%% avoid this when Z_RLE */
n = s->hash_size;
p = &s->head[n];
do {
@ -1393,61 +1355,27 @@ local void fill_window(s)
*/
} while (s->lookahead < MIN_LOOKAHEAD && s->strm->avail_in != 0);
/* If the WIN_INIT bytes after the end of the current data have never been
* written, then zero those bytes in order to avoid memory check reports of
* the use of uninitialized (or uninitialised as Julian writes) bytes by
* the longest match routines. Update the high water mark for the next
* time through here. WIN_INIT is set to MAX_MATCH since the longest match
* routines allow scanning to strstart + MAX_MATCH, ignoring lookahead.
*/
if (s->high_water < s->window_size) {
ulg curr = s->strstart + (ulg)(s->lookahead);
ulg init;
if (s->high_water < curr) {
/* Previous high water mark below current data -- zero WIN_INIT
* bytes or up to end of window, whichever is less.
*/
init = s->window_size - curr;
if (init > WIN_INIT)
init = WIN_INIT;
zmemzero(s->window + curr, (unsigned)init);
s->high_water = curr + init;
}
else if (s->high_water < (ulg)curr + WIN_INIT) {
/* High water mark at or above current data, but below current data
* plus WIN_INIT -- zero out to current data plus WIN_INIT, or up
* to end of window, whichever is less.
*/
init = (ulg)curr + WIN_INIT - s->high_water;
if (init > s->window_size - s->high_water)
init = s->window_size - s->high_water;
zmemzero(s->window + s->high_water, (unsigned)init);
s->high_water += init;
}
}
}
/* ===========================================================================
* Flush the current block, with given end-of-file flag.
* IN assertion: strstart is set to the end of the current match.
*/
#define FLUSH_BLOCK_ONLY(s, last) { \
#define FLUSH_BLOCK_ONLY(s, eof) { \
_tr_flush_block(s, (s->block_start >= 0L ? \
(charf *)&s->window[(unsigned)s->block_start] : \
(charf *)Z_NULL), \
(ulg)((long)s->strstart - s->block_start), \
(last)); \
(eof)); \
s->block_start = s->strstart; \
flush_pending(s->strm); \
Tracev((stderr,"[FLUSH]")); \
}
/* Same but force premature exit if necessary. */
#define FLUSH_BLOCK(s, last) { \
FLUSH_BLOCK_ONLY(s, last); \
if (s->strm->avail_out == 0) return (last) ? finish_started : need_more; \
#define FLUSH_BLOCK(s, eof) { \
FLUSH_BLOCK_ONLY(s, eof); \
if (s->strm->avail_out == 0) return (eof) ? finish_started : need_more; \
}
/* ===========================================================================
@ -1521,7 +1449,7 @@ local block_state deflate_fast(s, flush)
deflate_state *s;
int flush;
{
IPos hash_head; /* head of the hash chain */
IPos hash_head = NIL; /* head of the hash chain */
int bflush; /* set if current block must be flushed */
for (;;) {
@ -1541,7 +1469,6 @@ local block_state deflate_fast(s, flush)
/* Insert the string window[strstart .. strstart+2] in the
* dictionary, and set hash_head to the head of the hash chain:
*/
hash_head = NIL;
if (s->lookahead >= MIN_MATCH) {
INSERT_STRING(s, s->strstart, hash_head);
}
@ -1554,8 +1481,19 @@ local block_state deflate_fast(s, flush)
* of window index 0 (in particular we have to avoid a match
* of the string with itself at the start of the input file).
*/
s->match_length = longest_match (s, hash_head);
/* longest_match() sets match_start */
#ifdef FASTEST
if ((s->strategy != Z_HUFFMAN_ONLY && s->strategy != Z_RLE) ||
(s->strategy == Z_RLE && s->strstart - hash_head == 1)) {
s->match_length = longest_match_fast (s, hash_head);
}
#else
if (s->strategy != Z_HUFFMAN_ONLY && s->strategy != Z_RLE) {
s->match_length = longest_match (s, hash_head);
} else if (s->strategy == Z_RLE && s->strstart - hash_head == 1) {
s->match_length = longest_match_fast (s, hash_head);
}
#endif
/* longest_match() or longest_match_fast() sets match_start */
}
if (s->match_length >= MIN_MATCH) {
check_match(s, s->strstart, s->match_start, s->match_length);
@ -1617,7 +1555,7 @@ local block_state deflate_slow(s, flush)
deflate_state *s;
int flush;
{
IPos hash_head; /* head of hash chain */
IPos hash_head = NIL; /* head of hash chain */
int bflush; /* set if current block must be flushed */
/* Process the input block. */
@ -1638,7 +1576,6 @@ local block_state deflate_slow(s, flush)
/* Insert the string window[strstart .. strstart+2] in the
* dictionary, and set hash_head to the head of the hash chain:
*/
hash_head = NIL;
if (s->lookahead >= MIN_MATCH) {
INSERT_STRING(s, s->strstart, hash_head);
}
@ -1654,8 +1591,12 @@ local block_state deflate_slow(s, flush)
* of window index 0 (in particular we have to avoid a match
* of the string with itself at the start of the input file).
*/
s->match_length = longest_match (s, hash_head);
/* longest_match() sets match_start */
if (s->strategy != Z_HUFFMAN_ONLY && s->strategy != Z_RLE) {
s->match_length = longest_match (s, hash_head);
} else if (s->strategy == Z_RLE && s->strstart - hash_head == 1) {
s->match_length = longest_match_fast (s, hash_head);
}
/* longest_match() or longest_match_fast() sets match_start */
if (s->match_length <= 5 && (s->strategy == Z_FILTERED
#if TOO_FAR <= 32767
@ -1733,6 +1674,7 @@ local block_state deflate_slow(s, flush)
}
#endif /* FASTEST */
#if 0
/* ===========================================================================
* For Z_RLE, simply look for runs of bytes, generate matches only of distance
* one. Do not maintain a hash table. (It will be regenerated if this run of
@ -1742,9 +1684,11 @@ local block_state deflate_rle(s, flush)
deflate_state *s;
int flush;
{
int bflush; /* set if current block must be flushed */
uInt prev; /* byte at distance one to match */
Bytef *scan, *strend; /* scan goes up to strend for length of run */
int bflush; /* set if current block must be flushed */
uInt run; /* length of run */
uInt max; /* maximum length of run */
uInt prev; /* byte at distance one to match */
Bytef *scan; /* scan for end of run */
for (;;) {
/* Make sure that we always have enough lookahead, except
@ -1760,33 +1704,23 @@ local block_state deflate_rle(s, flush)
}
/* See how many times the previous byte repeats */
s->match_length = 0;
if (s->lookahead >= MIN_MATCH && s->strstart > 0) {
run = 0;
if (s->strstart > 0) { /* if there is a previous byte, that is */
max = s->lookahead < MAX_MATCH ? s->lookahead : MAX_MATCH;
scan = s->window + s->strstart - 1;
prev = *scan;
if (prev == *++scan && prev == *++scan && prev == *++scan) {
strend = s->window + s->strstart + MAX_MATCH;
do {
} while (prev == *++scan && prev == *++scan &&
prev == *++scan && prev == *++scan &&
prev == *++scan && prev == *++scan &&
prev == *++scan && prev == *++scan &&
scan < strend);
s->match_length = MAX_MATCH - (int)(strend - scan);
if (s->match_length > s->lookahead)
s->match_length = s->lookahead;
}
prev = *scan++;
do {
if (*scan++ != prev)
break;
} while (++run < max);
}
/* Emit match if have run of MIN_MATCH or longer, else emit literal */
if (s->match_length >= MIN_MATCH) {
check_match(s, s->strstart, s->strstart - 1, s->match_length);
_tr_tally_dist(s, 1, s->match_length - MIN_MATCH, bflush);
s->lookahead -= s->match_length;
s->strstart += s->match_length;
s->match_length = 0;
if (run >= MIN_MATCH) {
check_match(s, s->strstart, s->strstart - 1, run);
_tr_tally_dist(s, 1, run - MIN_MATCH, bflush);
s->lookahead -= run;
s->strstart += run;
} else {
/* No match, output a literal byte */
Tracevv((stderr,"%c", s->window[s->strstart]));
@ -1799,36 +1733,4 @@ local block_state deflate_rle(s, flush)
FLUSH_BLOCK(s, flush == Z_FINISH);
return flush == Z_FINISH ? finish_done : block_done;
}
/* ===========================================================================
* For Z_HUFFMAN_ONLY, do not look for matches. Do not maintain a hash table.
* (It will be regenerated if this run of deflate switches away from Huffman.)
*/
local block_state deflate_huff(s, flush)
deflate_state *s;
int flush;
{
int bflush; /* set if current block must be flushed */
for (;;) {
/* Make sure that we have a literal to write. */
if (s->lookahead == 0) {
fill_window(s);
if (s->lookahead == 0) {
if (flush == Z_NO_FLUSH)
return need_more;
break; /* flush the current block */
}
}
/* Output a literal byte */
s->match_length = 0;
Tracevv((stderr,"%c", s->window[s->strstart]));
_tr_tally_lit (s, s->window[s->strstart], bflush);
s->lookahead--;
s->strstart++;
if (bflush) FLUSH_BLOCK(s, 0);
}
FLUSH_BLOCK(s, flush == Z_FINISH);
return flush == Z_FINISH ? finish_done : block_done;
}
#endif

View file

@ -1,5 +1,5 @@
/* deflate.h -- internal compression state
* Copyright (C) 1995-2010 Jean-loup Gailly
* Copyright (C) 1995-2004 Jean-loup Gailly
* For conditions of distribution and use, see copyright notice in zlib.h
*/
@ -260,13 +260,6 @@ typedef struct internal_state {
* are always zero.
*/
ulg high_water;
/* High water mark offset in window for initialized bytes -- bytes above
* this are set to zero in order to avoid memory check warnings when
* longest match routines access bytes past the input. This is then
* updated to the new high water mark.
*/
} FAR deflate_state;
/* Output a byte on the stream.
@ -285,18 +278,14 @@ typedef struct internal_state {
* distances are limited to MAX_DIST instead of WSIZE.
*/
#define WIN_INIT MAX_MATCH
/* Number of bytes after end of data in window to initialize in order to avoid
memory checker errors from longest match routines */
/* in trees.c */
void ZLIB_INTERNAL _tr_init OF((deflate_state *s));
int ZLIB_INTERNAL _tr_tally OF((deflate_state *s, unsigned dist, unsigned lc));
void ZLIB_INTERNAL _tr_flush_block OF((deflate_state *s, charf *buf,
ulg stored_len, int last));
void ZLIB_INTERNAL _tr_align OF((deflate_state *s));
void ZLIB_INTERNAL _tr_stored_block OF((deflate_state *s, charf *buf,
ulg stored_len, int last));
void _tr_init OF((deflate_state *s));
int _tr_tally OF((deflate_state *s, unsigned dist, unsigned lc));
void _tr_flush_block OF((deflate_state *s, charf *buf, ulg stored_len,
int eof));
void _tr_align OF((deflate_state *s));
void _tr_stored_block OF((deflate_state *s, charf *buf, ulg stored_len,
int eof));
#define d_code(dist) \
((dist) < 256 ? _dist_code[dist] : _dist_code[256+((dist)>>7)])
@ -309,11 +298,11 @@ void ZLIB_INTERNAL _tr_stored_block OF((deflate_state *s, charf *buf,
/* Inline versions of _tr_tally for speed: */
#if defined(GEN_TREES_H) || !defined(STDC)
extern uch ZLIB_INTERNAL _length_code[];
extern uch ZLIB_INTERNAL _dist_code[];
extern uch _length_code[];
extern uch _dist_code[];
#else
extern const uch ZLIB_INTERNAL _length_code[];
extern const uch ZLIB_INTERNAL _dist_code[];
extern const uch _length_code[];
extern const uch _dist_code[];
#endif
# define _tr_tally_lit(s, c, flush) \

View file

@ -1,5 +1,5 @@
/* inffast.c -- fast decoding
* Copyright (C) 1995-2008, 2010 Mark Adler
* Copyright (C) 1995-2004 Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
*/
@ -64,7 +64,7 @@
requires strm->avail_out >= 258 for each loop to avoid checking for
output space.
*/
void ZLIB_INTERNAL inflate_fast(strm, start)
void inflate_fast(strm, start)
z_streamp strm;
unsigned start; /* inflate()'s starting value for strm->avail_out */
{
@ -79,7 +79,7 @@ unsigned start; /* inflate()'s starting value for strm->avail_out */
#endif
unsigned wsize; /* window size or zero if not using window */
unsigned whave; /* valid bytes in the window */
unsigned wnext; /* window write index */
unsigned write; /* window write index */
unsigned char FAR *window; /* allocated sliding window, if wsize != 0 */
unsigned long hold; /* local strm->hold */
unsigned bits; /* local strm->bits */
@ -87,7 +87,7 @@ unsigned start; /* inflate()'s starting value for strm->avail_out */
code const FAR *dcode; /* local strm->distcode */
unsigned lmask; /* mask for first level of length codes */
unsigned dmask; /* mask for first level of distance codes */
code here; /* retrieved table entry */
code this; /* retrieved table entry */
unsigned op; /* code bits, operation, extra bits, or */
/* window position, window bytes to copy */
unsigned len; /* match length, unused bytes */
@ -106,7 +106,7 @@ unsigned start; /* inflate()'s starting value for strm->avail_out */
#endif
wsize = state->wsize;
whave = state->whave;
wnext = state->wnext;
write = state->write;
window = state->window;
hold = state->hold;
bits = state->bits;
@ -124,20 +124,20 @@ unsigned start; /* inflate()'s starting value for strm->avail_out */
hold += (unsigned long)(PUP(in)) << bits;
bits += 8;
}
here = lcode[hold & lmask];
this = lcode[hold & lmask];
dolen:
op = (unsigned)(here.bits);
op = (unsigned)(this.bits);
hold >>= op;
bits -= op;
op = (unsigned)(here.op);
op = (unsigned)(this.op);
if (op == 0) { /* literal */
Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ?
Tracevv((stderr, this.val >= 0x20 && this.val < 0x7f ?
"inflate: literal '%c'\n" :
"inflate: literal 0x%02x\n", here.val));
PUP(out) = (unsigned char)(here.val);
"inflate: literal 0x%02x\n", this.val));
PUP(out) = (unsigned char)(this.val);
}
else if (op & 16) { /* length base */
len = (unsigned)(here.val);
len = (unsigned)(this.val);
op &= 15; /* number of extra bits */
if (op) {
if (bits < op) {
@ -155,14 +155,14 @@ unsigned start; /* inflate()'s starting value for strm->avail_out */
hold += (unsigned long)(PUP(in)) << bits;
bits += 8;
}
here = dcode[hold & dmask];
this = dcode[hold & dmask];
dodist:
op = (unsigned)(here.bits);
op = (unsigned)(this.bits);
hold >>= op;
bits -= op;
op = (unsigned)(here.op);
op = (unsigned)(this.op);
if (op & 16) { /* distance base */
dist = (unsigned)(here.val);
dist = (unsigned)(this.val);
op &= 15; /* number of extra bits */
if (bits < op) {
hold += (unsigned long)(PUP(in)) << bits;
@ -187,34 +187,12 @@ unsigned start; /* inflate()'s starting value for strm->avail_out */
if (dist > op) { /* see if copy from window */
op = dist - op; /* distance back in window */
if (op > whave) {
if (state->sane) {
strm->msg =
(char *)"invalid distance too far back";
state->mode = BAD;
break;
}
#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR
if (len <= op - whave) {
do {
PUP(out) = 0;
} while (--len);
continue;
}
len -= op - whave;
do {
PUP(out) = 0;
} while (--op > whave);
if (op == 0) {
from = out - dist;
do {
PUP(out) = PUP(from);
} while (--len);
continue;
}
#endif
strm->msg = (char *)"invalid distance too far back";
state->mode = BAD;
break;
}
from = window - OFF;
if (wnext == 0) { /* very common case */
if (write == 0) { /* very common case */
from += wsize - op;
if (op < len) { /* some from window */
len -= op;
@ -224,17 +202,17 @@ unsigned start; /* inflate()'s starting value for strm->avail_out */
from = out - dist; /* rest from output */
}
}
else if (wnext < op) { /* wrap around window */
from += wsize + wnext - op;
op -= wnext;
else if (write < op) { /* wrap around window */
from += wsize + write - op;
op -= write;
if (op < len) { /* some from end of window */
len -= op;
do {
PUP(out) = PUP(from);
} while (--op);
from = window - OFF;
if (wnext < len) { /* some from start of window */
op = wnext;
if (write < len) { /* some from start of window */
op = write;
len -= op;
do {
PUP(out) = PUP(from);
@ -244,7 +222,7 @@ unsigned start; /* inflate()'s starting value for strm->avail_out */
}
}
else { /* contiguous in window */
from += wnext - op;
from += write - op;
if (op < len) { /* some from window */
len -= op;
do {
@ -281,7 +259,7 @@ unsigned start; /* inflate()'s starting value for strm->avail_out */
}
}
else if ((op & 64) == 0) { /* 2nd level distance code */
here = dcode[here.val + (hold & ((1U << op) - 1))];
this = dcode[this.val + (hold & ((1U << op) - 1))];
goto dodist;
}
else {
@ -291,7 +269,7 @@ unsigned start; /* inflate()'s starting value for strm->avail_out */
}
}
else if ((op & 64) == 0) { /* 2nd level length code */
here = lcode[here.val + (hold & ((1U << op) - 1))];
this = lcode[this.val + (hold & ((1U << op) - 1))];
goto dolen;
}
else if (op & 32) { /* end-of-block */
@ -327,7 +305,7 @@ unsigned start; /* inflate()'s starting value for strm->avail_out */
inflate_fast() speedups that turned out slower (on a PowerPC G3 750CXe):
- Using bit fields for code structure
- Different op definition to avoid & for extra bits (do & for table bits)
- Three separate decoding do-loops for direct, window, and wnext == 0
- Three separate decoding do-loops for direct, window, and write == 0
- Special case for distance > 1 copies to do overlapped load and store copy
- Explicit branch predictions (based on measured branch probabilities)
- Deferring match copy and interspersed it with decoding subsequent codes

View file

@ -1,5 +1,5 @@
/* inffast.h -- header to use inffast.c
* Copyright (C) 1995-2003, 2010 Mark Adler
* Copyright (C) 1995-2003 Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
*/
@ -8,4 +8,4 @@
subject to change. Applications should only use zlib.h.
*/
void ZLIB_INTERNAL inflate_fast OF((z_streamp strm, unsigned start));
void inflate_fast OF((z_streamp strm, unsigned start));

View file

@ -1,5 +1,5 @@
/* inflate.c -- zlib decompression
* Copyright (C) 1995-2010 Mark Adler
* Copyright (C) 1995-2005 Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
*/
@ -45,7 +45,7 @@
* - Rearrange window copies in inflate_fast() for speed and simplification
* - Unroll last copy for window match in inflate_fast()
* - Use local copies of window variables in inflate_fast() for speed
* - Pull out common wnext == 0 case for speed in inflate_fast()
* - Pull out common write == 0 case for speed in inflate_fast()
* - Make op and len in inflate_fast() unsigned for consistency
* - Add FAR to lcode and dcode declarations in inflate_fast()
* - Simplified bad distance check in inflate_fast()
@ -117,52 +117,28 @@ z_streamp strm;
state->head = Z_NULL;
state->wsize = 0;
state->whave = 0;
state->wnext = 0;
state->write = 0;
state->hold = 0;
state->bits = 0;
state->lencode = state->distcode = state->next = state->codes;
state->sane = 1;
state->back = -1;
Tracev((stderr, "inflate: reset\n"));
return Z_OK;
}
int ZEXPORT inflateReset2(strm, windowBits)
int ZEXPORT inflatePrime(strm, bits, value)
z_streamp strm;
int windowBits;
int bits;
int value;
{
int wrap;
struct inflate_state FAR *state;
/* get the state */
if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
state = (struct inflate_state FAR *)strm->state;
/* extract wrap request from windowBits parameter */
if (windowBits < 0) {
wrap = 0;
windowBits = -windowBits;
}
else {
wrap = (windowBits >> 4) + 1;
#ifdef GUNZIP
if (windowBits < 48)
windowBits &= 15;
#endif
}
/* set number of window bits, free window if different */
if (windowBits && (windowBits < 8 || windowBits > 15))
return Z_STREAM_ERROR;
if (state->window != Z_NULL && state->wbits != (unsigned)windowBits) {
ZFREE(strm, state->window);
state->window = Z_NULL;
}
/* update state and reset the rest of it */
state->wrap = wrap;
state->wbits = (unsigned)windowBits;
return inflateReset(strm);
if (bits > 16 || state->bits + bits > 32) return Z_STREAM_ERROR;
value &= (1L << bits) - 1;
state->hold += value << state->bits;
state->bits += bits;
return Z_OK;
}
int ZEXPORT inflateInit2_(strm, windowBits, version, stream_size)
@ -171,7 +147,6 @@ int windowBits;
const char *version;
int stream_size;
{
int ret;
struct inflate_state FAR *state;
if (version == Z_NULL || version[0] != ZLIB_VERSION[0] ||
@ -189,13 +164,24 @@ int stream_size;
if (state == Z_NULL) return Z_MEM_ERROR;
Tracev((stderr, "inflate: allocated\n"));
strm->state = (struct internal_state FAR *)state;
state->window = Z_NULL;
ret = inflateReset2(strm, windowBits);
if (ret != Z_OK) {
if (windowBits < 0) {
state->wrap = 0;
windowBits = -windowBits;
}
else {
state->wrap = (windowBits >> 4) + 1;
#ifdef GUNZIP
if (windowBits < 48) windowBits &= 15;
#endif
}
if (windowBits < 8 || windowBits > 15) {
ZFREE(strm, state);
strm->state = Z_NULL;
return Z_STREAM_ERROR;
}
return ret;
state->wbits = (unsigned)windowBits;
state->window = Z_NULL;
return inflateReset(strm);
}
int ZEXPORT inflateInit_(strm, version, stream_size)
@ -206,27 +192,6 @@ int stream_size;
return inflateInit2_(strm, DEF_WBITS, version, stream_size);
}
int ZEXPORT inflatePrime(strm, bits, value)
z_streamp strm;
int bits;
int value;
{
struct inflate_state FAR *state;
if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
state = (struct inflate_state FAR *)strm->state;
if (bits < 0) {
state->hold = 0;
state->bits = 0;
return Z_OK;
}
if (bits > 16 || state->bits + bits > 32) return Z_STREAM_ERROR;
value &= (1L << bits) - 1;
state->hold += value << state->bits;
state->bits += bits;
return Z_OK;
}
/*
Return state with length and distance decoding tables and index sizes set to
fixed code decoding. Normally this returns fixed tables from inffixed.h.
@ -375,7 +340,7 @@ unsigned out;
/* if window not in use yet, initialize */
if (state->wsize == 0) {
state->wsize = 1U << state->wbits;
state->wnext = 0;
state->write = 0;
state->whave = 0;
}
@ -383,22 +348,22 @@ unsigned out;
copy = out - strm->avail_out;
if (copy >= state->wsize) {
zmemcpy(state->window, strm->next_out - state->wsize, state->wsize);
state->wnext = 0;
state->write = 0;
state->whave = state->wsize;
}
else {
dist = state->wsize - state->wnext;
dist = state->wsize - state->write;
if (dist > copy) dist = copy;
zmemcpy(state->window + state->wnext, strm->next_out - copy, dist);
zmemcpy(state->window + state->write, strm->next_out - copy, dist);
copy -= dist;
if (copy) {
zmemcpy(state->window, strm->next_out - copy, copy);
state->wnext = copy;
state->write = copy;
state->whave = state->wsize;
}
else {
state->wnext += dist;
if (state->wnext == state->wsize) state->wnext = 0;
state->write += dist;
if (state->write == state->wsize) state->write = 0;
if (state->whave < state->wsize) state->whave += dist;
}
}
@ -599,7 +564,7 @@ int flush;
unsigned in, out; /* save starting available input and output */
unsigned copy; /* number of stored or match bytes to copy */
unsigned char FAR *from; /* where to copy match bytes from */
code here; /* current decoding table entry */
code this; /* current decoding table entry */
code last; /* parent table entry */
unsigned len; /* length to copy for repeats, bits to drop */
int ret; /* return code */
@ -654,9 +619,7 @@ int flush;
}
DROPBITS(4);
len = BITS(4) + 8;
if (state->wbits == 0)
state->wbits = len;
else if (len > state->wbits) {
if (len > state->wbits) {
strm->msg = (char *)"invalid window size";
state->mode = BAD;
break;
@ -808,7 +771,7 @@ int flush;
strm->adler = state->check = adler32(0L, Z_NULL, 0);
state->mode = TYPE;
case TYPE:
if (flush == Z_BLOCK || flush == Z_TREES) goto inf_leave;
if (flush == Z_BLOCK) goto inf_leave;
case TYPEDO:
if (state->last) {
BYTEBITS();
@ -828,11 +791,7 @@ int flush;
fixedtables(state);
Tracev((stderr, "inflate: fixed codes block%s\n",
state->last ? " (last)" : ""));
state->mode = LEN_; /* decode codes */
if (flush == Z_TREES) {
DROPBITS(2);
goto inf_leave;
}
state->mode = LEN; /* decode codes */
break;
case 2: /* dynamic block */
Tracev((stderr, "inflate: dynamic codes block%s\n",
@ -857,9 +816,6 @@ int flush;
Tracev((stderr, "inflate: stored length %u\n",
state->length));
INITBITS();
state->mode = COPY_;
if (flush == Z_TREES) goto inf_leave;
case COPY_:
state->mode = COPY;
case COPY:
copy = state->length;
@ -920,19 +876,19 @@ int flush;
case CODELENS:
while (state->have < state->nlen + state->ndist) {
for (;;) {
here = state->lencode[BITS(state->lenbits)];
if ((unsigned)(here.bits) <= bits) break;
this = state->lencode[BITS(state->lenbits)];
if ((unsigned)(this.bits) <= bits) break;
PULLBYTE();
}
if (here.val < 16) {
NEEDBITS(here.bits);
DROPBITS(here.bits);
state->lens[state->have++] = here.val;
if (this.val < 16) {
NEEDBITS(this.bits);
DROPBITS(this.bits);
state->lens[state->have++] = this.val;
}
else {
if (here.val == 16) {
NEEDBITS(here.bits + 2);
DROPBITS(here.bits);
if (this.val == 16) {
NEEDBITS(this.bits + 2);
DROPBITS(this.bits);
if (state->have == 0) {
strm->msg = (char *)"invalid bit length repeat";
state->mode = BAD;
@ -942,16 +898,16 @@ int flush;
copy = 3 + BITS(2);
DROPBITS(2);
}
else if (here.val == 17) {
NEEDBITS(here.bits + 3);
DROPBITS(here.bits);
else if (this.val == 17) {
NEEDBITS(this.bits + 3);
DROPBITS(this.bits);
len = 0;
copy = 3 + BITS(3);
DROPBITS(3);
}
else {
NEEDBITS(here.bits + 7);
DROPBITS(here.bits);
NEEDBITS(this.bits + 7);
DROPBITS(this.bits);
len = 0;
copy = 11 + BITS(7);
DROPBITS(7);
@ -969,16 +925,7 @@ int flush;
/* handle error breaks in while */
if (state->mode == BAD) break;
/* check for end-of-block code (better have one) */
if (state->lens[256] == 0) {
strm->msg = (char *)"invalid code -- missing end-of-block";
state->mode = BAD;
break;
}
/* build code tables -- note: do not change the lenbits or distbits
values here (9 and 6) without reading the comments in inftrees.h
concerning the ENOUGH constants, which depend on those values */
/* build code tables */
state->next = state->codes;
state->lencode = (code const FAR *)(state->next);
state->lenbits = 9;
@ -999,102 +946,88 @@ int flush;
break;
}
Tracev((stderr, "inflate: codes ok\n"));
state->mode = LEN_;
if (flush == Z_TREES) goto inf_leave;
case LEN_:
state->mode = LEN;
case LEN:
if (have >= 6 && left >= 258) {
RESTORE();
inflate_fast(strm, out);
LOAD();
if (state->mode == TYPE)
state->back = -1;
break;
}
state->back = 0;
for (;;) {
here = state->lencode[BITS(state->lenbits)];
if ((unsigned)(here.bits) <= bits) break;
this = state->lencode[BITS(state->lenbits)];
if ((unsigned)(this.bits) <= bits) break;
PULLBYTE();
}
if (here.op && (here.op & 0xf0) == 0) {
last = here;
if (this.op && (this.op & 0xf0) == 0) {
last = this;
for (;;) {
here = state->lencode[last.val +
this = state->lencode[last.val +
(BITS(last.bits + last.op) >> last.bits)];
if ((unsigned)(last.bits + here.bits) <= bits) break;
if ((unsigned)(last.bits + this.bits) <= bits) break;
PULLBYTE();
}
DROPBITS(last.bits);
state->back += last.bits;
}
DROPBITS(here.bits);
state->back += here.bits;
state->length = (unsigned)here.val;
if ((int)(here.op) == 0) {
Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ?
DROPBITS(this.bits);
state->length = (unsigned)this.val;
if ((int)(this.op) == 0) {
Tracevv((stderr, this.val >= 0x20 && this.val < 0x7f ?
"inflate: literal '%c'\n" :
"inflate: literal 0x%02x\n", here.val));
"inflate: literal 0x%02x\n", this.val));
state->mode = LIT;
break;
}
if (here.op & 32) {
if (this.op & 32) {
Tracevv((stderr, "inflate: end of block\n"));
state->back = -1;
state->mode = TYPE;
break;
}
if (here.op & 64) {
if (this.op & 64) {
strm->msg = (char *)"invalid literal/length code";
state->mode = BAD;
break;
}
state->extra = (unsigned)(here.op) & 15;
state->extra = (unsigned)(this.op) & 15;
state->mode = LENEXT;
case LENEXT:
if (state->extra) {
NEEDBITS(state->extra);
state->length += BITS(state->extra);
DROPBITS(state->extra);
state->back += state->extra;
}
Tracevv((stderr, "inflate: length %u\n", state->length));
state->was = state->length;
state->mode = DIST;
case DIST:
for (;;) {
here = state->distcode[BITS(state->distbits)];
if ((unsigned)(here.bits) <= bits) break;
this = state->distcode[BITS(state->distbits)];
if ((unsigned)(this.bits) <= bits) break;
PULLBYTE();
}
if ((here.op & 0xf0) == 0) {
last = here;
if ((this.op & 0xf0) == 0) {
last = this;
for (;;) {
here = state->distcode[last.val +
this = state->distcode[last.val +
(BITS(last.bits + last.op) >> last.bits)];
if ((unsigned)(last.bits + here.bits) <= bits) break;
if ((unsigned)(last.bits + this.bits) <= bits) break;
PULLBYTE();
}
DROPBITS(last.bits);
state->back += last.bits;
}
DROPBITS(here.bits);
state->back += here.bits;
if (here.op & 64) {
DROPBITS(this.bits);
if (this.op & 64) {
strm->msg = (char *)"invalid distance code";
state->mode = BAD;
break;
}
state->offset = (unsigned)here.val;
state->extra = (unsigned)(here.op) & 15;
state->offset = (unsigned)this.val;
state->extra = (unsigned)(this.op) & 15;
state->mode = DISTEXT;
case DISTEXT:
if (state->extra) {
NEEDBITS(state->extra);
state->offset += BITS(state->extra);
DROPBITS(state->extra);
state->back += state->extra;
}
#ifdef INFLATE_STRICT
if (state->offset > state->dmax) {
@ -1103,6 +1036,11 @@ int flush;
break;
}
#endif
if (state->offset > state->whave + out - left) {
strm->msg = (char *)"invalid distance too far back";
state->mode = BAD;
break;
}
Tracevv((stderr, "inflate: distance %u\n", state->offset));
state->mode = MATCH;
case MATCH:
@ -1110,32 +1048,12 @@ int flush;
copy = out - left;
if (state->offset > copy) { /* copy from window */
copy = state->offset - copy;
if (copy > state->whave) {
if (state->sane) {
strm->msg = (char *)"invalid distance too far back";
state->mode = BAD;
break;
}
#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR
Trace((stderr, "inflate.c too far\n"));
copy -= state->whave;
if (copy > state->length) copy = state->length;
if (copy > left) copy = left;
left -= copy;
state->length -= copy;
do {
*put++ = 0;
} while (--copy);
if (state->length == 0) state->mode = LEN;
break;
#endif
}
if (copy > state->wnext) {
copy -= state->wnext;
if (copy > state->write) {
copy -= state->write;
from = state->window + (state->wsize - copy);
}
else
from = state->window + (state->wnext - copy);
from = state->window + (state->write - copy);
if (copy > state->length) copy = state->length;
}
else { /* copy from output */
@ -1228,8 +1146,7 @@ int flush;
strm->adler = state->check =
UPDATE(state->check, strm->next_out - out, out);
strm->data_type = state->bits + (state->last ? 64 : 0) +
(state->mode == TYPE ? 128 : 0) +
(state->mode == LEN_ || state->mode == COPY_ ? 256 : 0);
(state->mode == TYPE ? 128 : 0);
if (((in == 0 && out == 0) || flush == Z_FINISH) && ret == Z_OK)
ret = Z_BUF_ERROR;
return ret;
@ -1449,32 +1366,3 @@ z_streamp source;
dest->state = (struct internal_state FAR *)copy;
return Z_OK;
}
int ZEXPORT inflateUndermine(strm, subvert)
z_streamp strm;
int subvert;
{
struct inflate_state FAR *state;
if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
state = (struct inflate_state FAR *)strm->state;
state->sane = !subvert;
#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR
return Z_OK;
#else
state->sane = 1;
return Z_DATA_ERROR;
#endif
}
long ZEXPORT inflateMark(strm)
z_streamp strm;
{
struct inflate_state FAR *state;
if (strm == Z_NULL || strm->state == Z_NULL) return -1L << 16;
state = (struct inflate_state FAR *)strm->state;
return ((long)(state->back) << 16) +
(state->mode == COPY ? state->length :
(state->mode == MATCH ? state->was - state->length : 0));
}

View file

@ -1,5 +1,5 @@
/* inflate.h -- internal inflate state definition
* Copyright (C) 1995-2009 Mark Adler
* Copyright (C) 1995-2004 Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
*/
@ -32,13 +32,11 @@ typedef enum {
TYPE, /* i: waiting for type bits, including last-flag bit */
TYPEDO, /* i: same, but skip check to exit inflate on new block */
STORED, /* i: waiting for stored size (length and complement) */
COPY_, /* i/o: same as COPY below, but only first time in */
COPY, /* i/o: waiting for input or output to copy stored block */
TABLE, /* i: waiting for dynamic block table lengths */
LENLENS, /* i: waiting for code length code lengths */
CODELENS, /* i: waiting for length/lit and distance code lengths */
LEN_, /* i: same as LEN below, but only first time in */
LEN, /* i: waiting for length/lit/eob code */
LEN, /* i: waiting for length/lit code */
LENEXT, /* i: waiting for length extra bits */
DIST, /* i: waiting for distance code */
DISTEXT, /* i: waiting for distance extra bits */
@ -55,21 +53,19 @@ typedef enum {
/*
State transitions between above modes -
(most modes can go to BAD or MEM on error -- not shown for clarity)
(most modes can go to the BAD or MEM mode -- not shown for clarity)
Process header:
HEAD -> (gzip) or (zlib) or (raw)
(gzip) -> FLAGS -> TIME -> OS -> EXLEN -> EXTRA -> NAME -> COMMENT ->
HCRC -> TYPE
HEAD -> (gzip) or (zlib)
(gzip) -> FLAGS -> TIME -> OS -> EXLEN -> EXTRA -> NAME
NAME -> COMMENT -> HCRC -> TYPE
(zlib) -> DICTID or TYPE
DICTID -> DICT -> TYPE
(raw) -> TYPEDO
Read deflate blocks:
TYPE -> TYPEDO -> STORED or TABLE or LEN_ or CHECK
STORED -> COPY_ -> COPY -> TYPE
TABLE -> LENLENS -> CODELENS -> LEN_
LEN_ -> LEN
Read deflate codes in fixed or dynamic block:
TYPE -> STORED or TABLE or LEN or CHECK
STORED -> COPY -> TYPE
TABLE -> LENLENS -> CODELENS -> LEN
Read deflate codes:
LEN -> LENEXT or LIT or TYPE
LENEXT -> DIST -> DISTEXT -> MATCH -> LEN
LIT -> LEN
@ -77,7 +73,7 @@ typedef enum {
CHECK -> LENGTH -> DONE
*/
/* state maintained between inflate() calls. Approximately 10K bytes. */
/* state maintained between inflate() calls. Approximately 7K bytes. */
struct inflate_state {
inflate_mode mode; /* current inflate mode */
int last; /* true if processing last block */
@ -92,7 +88,7 @@ struct inflate_state {
unsigned wbits; /* log base 2 of requested window size */
unsigned wsize; /* window size or zero if not using window */
unsigned whave; /* valid bytes in the window */
unsigned wnext; /* window write index */
unsigned write; /* window write index */
unsigned char FAR *window; /* allocated sliding window, if needed */
/* bit accumulator */
unsigned long hold; /* input bit accumulator */
@ -116,7 +112,4 @@ struct inflate_state {
unsigned short lens[320]; /* temporary storage for code lengths */
unsigned short work[288]; /* work area for code table building */
code codes[ENOUGH]; /* space for code tables */
int sane; /* if false, allow invalid distance too far */
int back; /* bits back of last unprocessed length/lit */
unsigned was; /* initial length of match */
};

View file

@ -1,5 +1,5 @@
/* inftrees.c -- generate Huffman trees for efficient decoding
* Copyright (C) 1995-2010 Mark Adler
* Copyright (C) 1995-2005 Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
*/
@ -9,7 +9,7 @@
#define MAXBITS 15
const char inflate_copyright[] =
" inflate 1.2.5 Copyright 1995-2010 Mark Adler ";
" inflate 1.2.3 Copyright 1995-2005 Mark Adler ";
/*
If you use the zlib library in a product, an acknowledgment is welcome
in the documentation of your product. If for some reason you cannot
@ -29,7 +29,7 @@ const char inflate_copyright[] =
table index bits. It will differ if the request is greater than the
longest code or if it is less than the shortest code.
*/
int ZLIB_INTERNAL inflate_table(type, lens, codes, table, bits, work)
int inflate_table(type, lens, codes, table, bits, work)
codetype type;
unsigned short FAR *lens;
unsigned codes;
@ -50,7 +50,7 @@ unsigned short FAR *work;
unsigned fill; /* index for replicating entries */
unsigned low; /* low bits for current root entry */
unsigned mask; /* mask for low root bits */
code here; /* table entry for duplication */
code this; /* table entry for duplication */
code FAR *next; /* next available space in table */
const unsigned short FAR *base; /* base value table to use */
const unsigned short FAR *extra; /* extra bits table to use */
@ -62,7 +62,7 @@ unsigned short FAR *work;
35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0};
static const unsigned short lext[31] = { /* Length codes 257..285 extra */
16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18,
19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 73, 195};
19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 201, 196};
static const unsigned short dbase[32] = { /* Distance codes 0..29 base */
1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193,
257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145,
@ -115,15 +115,15 @@ unsigned short FAR *work;
if (count[max] != 0) break;
if (root > max) root = max;
if (max == 0) { /* no symbols to code at all */
here.op = (unsigned char)64; /* invalid code marker */
here.bits = (unsigned char)1;
here.val = (unsigned short)0;
*(*table)++ = here; /* make a table to force an error */
*(*table)++ = here;
this.op = (unsigned char)64; /* invalid code marker */
this.bits = (unsigned char)1;
this.val = (unsigned short)0;
*(*table)++ = this; /* make a table to force an error */
*(*table)++ = this;
*bits = 1;
return 0; /* no symbols, but wait for decoding to report error */
}
for (min = 1; min < max; min++)
for (min = 1; min <= MAXBITS; min++)
if (count[min] != 0) break;
if (root < min) root = min;
@ -166,10 +166,11 @@ unsigned short FAR *work;
entered in the tables.
used keeps track of how many table entries have been allocated from the
provided *table space. It is checked for LENS and DIST tables against
the constants ENOUGH_LENS and ENOUGH_DISTS to guard against changes in
the initial root table size constants. See the comments in inftrees.h
for more information.
provided *table space. It is checked when a LENS table is being made
against the space in *table, ENOUGH, minus the maximum space needed by
the worst case distance code, MAXD. This should never happen, but the
sufficiency of ENOUGH has not been proven exhaustively, hence the check.
This assumes that when type == LENS, bits == 9.
sym increments through all symbols, and the loop terminates when
all codes of length max, i.e. all codes, have been processed. This
@ -208,25 +209,24 @@ unsigned short FAR *work;
mask = used - 1; /* mask for comparing low */
/* check available table space */
if ((type == LENS && used >= ENOUGH_LENS) ||
(type == DISTS && used >= ENOUGH_DISTS))
if (type == LENS && used >= ENOUGH - MAXD)
return 1;
/* process all codes and make table entries */
for (;;) {
/* create table entry */
here.bits = (unsigned char)(len - drop);
this.bits = (unsigned char)(len - drop);
if ((int)(work[sym]) < end) {
here.op = (unsigned char)0;
here.val = work[sym];
this.op = (unsigned char)0;
this.val = work[sym];
}
else if ((int)(work[sym]) > end) {
here.op = (unsigned char)(extra[work[sym]]);
here.val = base[work[sym]];
this.op = (unsigned char)(extra[work[sym]]);
this.val = base[work[sym]];
}
else {
here.op = (unsigned char)(32 + 64); /* end of block */
here.val = 0;
this.op = (unsigned char)(32 + 64); /* end of block */
this.val = 0;
}
/* replicate for those indices with low len bits equal to huff */
@ -235,7 +235,7 @@ unsigned short FAR *work;
min = fill; /* save offset to next table */
do {
fill -= incr;
next[(huff >> drop) + fill] = here;
next[(huff >> drop) + fill] = this;
} while (fill != 0);
/* backwards increment the len-bit code huff */
@ -277,8 +277,7 @@ unsigned short FAR *work;
/* check for enough space */
used += 1U << curr;
if ((type == LENS && used >= ENOUGH_LENS) ||
(type == DISTS && used >= ENOUGH_DISTS))
if (type == LENS && used >= ENOUGH - MAXD)
return 1;
/* point entry in root table to sub-table */
@ -296,20 +295,20 @@ unsigned short FAR *work;
through high index bits. When the current sub-table is filled, the loop
drops back to the root table to fill in any remaining entries there.
*/
here.op = (unsigned char)64; /* invalid code marker */
here.bits = (unsigned char)(len - drop);
here.val = (unsigned short)0;
this.op = (unsigned char)64; /* invalid code marker */
this.bits = (unsigned char)(len - drop);
this.val = (unsigned short)0;
while (huff != 0) {
/* when done with sub-table, drop back to root table */
if (drop != 0 && (huff & mask) != low) {
drop = 0;
len = root;
next = *table;
here.bits = (unsigned char)len;
this.bits = (unsigned char)len;
}
/* put invalid code marker in table */
next[huff >> drop] = here;
next[huff >> drop] = this;
/* backwards increment the len-bit code huff */
incr = 1U << (len - 1);

View file

@ -1,5 +1,5 @@
/* inftrees.h -- header to use inftrees.c
* Copyright (C) 1995-2005, 2010 Mark Adler
* Copyright (C) 1995-2005 Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
*/
@ -35,28 +35,21 @@ typedef struct {
01000000 - invalid code
*/
/* Maximum size of the dynamic table. The maximum number of code structures is
1444, which is the sum of 852 for literal/length codes and 592 for distance
codes. These values were found by exhaustive searches using the program
examples/enough.c found in the zlib distribtution. The arguments to that
program are the number of symbols, the initial root table size, and the
maximum bit length of a code. "enough 286 9 15" for literal/length codes
returns returns 852, and "enough 30 6 15" for distance codes returns 592.
The initial root table size (9 or 6) is found in the fifth argument of the
inflate_table() calls in inflate.c and infback.c. If the root table size is
changed, then these maximum sizes would be need to be recalculated and
updated. */
#define ENOUGH_LENS 852
#define ENOUGH_DISTS 592
#define ENOUGH (ENOUGH_LENS+ENOUGH_DISTS)
/* Maximum size of dynamic tree. The maximum found in a long but non-
exhaustive search was 1444 code structures (852 for length/literals
and 592 for distances, the latter actually the result of an
exhaustive search). The true maximum is not known, but the value
below is more than safe. */
#define ENOUGH 2048
#define MAXD 592
/* Type of code to build for inflate_table() */
/* Type of code to build for inftable() */
typedef enum {
CODES,
LENS,
DISTS
} codetype;
int ZLIB_INTERNAL inflate_table OF((codetype type, unsigned short FAR *lens,
extern int inflate_table OF((codetype type, unsigned short FAR *lens,
unsigned codes, code FAR * FAR *table,
unsigned FAR *bits, unsigned short FAR *work));

View file

@ -1,6 +1,5 @@
/* trees.c -- output deflated data using Huffman coding
* Copyright (C) 1995-2010 Jean-loup Gailly
* detect_data_type() function provided freely by Cosmin Truta, 2006
* Copyright (C) 1995-2005 Jean-loup Gailly
* For conditions of distribution and use, see copyright notice in zlib.h
*/
@ -153,7 +152,7 @@ local void send_all_trees OF((deflate_state *s, int lcodes, int dcodes,
int blcodes));
local void compress_block OF((deflate_state *s, ct_data *ltree,
ct_data *dtree));
local int detect_data_type OF((deflate_state *s));
local void set_data_type OF((deflate_state *s));
local unsigned bi_reverse OF((unsigned value, int length));
local void bi_windup OF((deflate_state *s));
local void bi_flush OF((deflate_state *s));
@ -204,12 +203,12 @@ local void send_bits(s, value, length)
* unused bits in value.
*/
if (s->bi_valid > (int)Buf_size - length) {
s->bi_buf |= (ush)value << s->bi_valid;
s->bi_buf |= (value << s->bi_valid);
put_short(s, s->bi_buf);
s->bi_buf = (ush)value >> (Buf_size - s->bi_valid);
s->bi_valid += length - Buf_size;
} else {
s->bi_buf |= (ush)value << s->bi_valid;
s->bi_buf |= value << s->bi_valid;
s->bi_valid += length;
}
}
@ -219,12 +218,12 @@ local void send_bits(s, value, length)
{ int len = length;\
if (s->bi_valid > (int)Buf_size - len) {\
int val = value;\
s->bi_buf |= (ush)val << s->bi_valid;\
s->bi_buf |= (val << s->bi_valid);\
put_short(s, s->bi_buf);\
s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
s->bi_valid += len - Buf_size;\
} else {\
s->bi_buf |= (ush)(value) << s->bi_valid;\
s->bi_buf |= (value) << s->bi_valid;\
s->bi_valid += len;\
}\
}
@ -251,13 +250,11 @@ local void tr_static_init()
if (static_init_done) return;
/* For some embedded targets, global variables are not initialized: */
#ifdef NO_INIT_GLOBAL_POINTERS
static_l_desc.static_tree = static_ltree;
static_l_desc.extra_bits = extra_lbits;
static_d_desc.static_tree = static_dtree;
static_d_desc.extra_bits = extra_dbits;
static_bl_desc.extra_bits = extra_blbits;
#endif
/* Initialize the mapping length (0..255) -> length code (0..28) */
length = 0;
@ -351,14 +348,13 @@ void gen_trees_header()
static_dtree[i].Len, SEPARATOR(i, D_CODES-1, 5));
}
fprintf(header, "const uch ZLIB_INTERNAL _dist_code[DIST_CODE_LEN] = {\n");
fprintf(header, "const uch _dist_code[DIST_CODE_LEN] = {\n");
for (i = 0; i < DIST_CODE_LEN; i++) {
fprintf(header, "%2u%s", _dist_code[i],
SEPARATOR(i, DIST_CODE_LEN-1, 20));
}
fprintf(header,
"const uch ZLIB_INTERNAL _length_code[MAX_MATCH-MIN_MATCH+1]= {\n");
fprintf(header, "const uch _length_code[MAX_MATCH-MIN_MATCH+1]= {\n");
for (i = 0; i < MAX_MATCH-MIN_MATCH+1; i++) {
fprintf(header, "%2u%s", _length_code[i],
SEPARATOR(i, MAX_MATCH-MIN_MATCH, 20));
@ -383,7 +379,7 @@ void gen_trees_header()
/* ===========================================================================
* Initialize the tree data structures for a new zlib stream.
*/
void ZLIB_INTERNAL _tr_init(s)
void _tr_init(s)
deflate_state *s;
{
tr_static_init();
@ -868,13 +864,13 @@ local void send_all_trees(s, lcodes, dcodes, blcodes)
/* ===========================================================================
* Send a stored block
*/
void ZLIB_INTERNAL _tr_stored_block(s, buf, stored_len, last)
void _tr_stored_block(s, buf, stored_len, eof)
deflate_state *s;
charf *buf; /* input block */
ulg stored_len; /* length of input block */
int last; /* one if this is the last block for a file */
int eof; /* true if this is the last block for a file */
{
send_bits(s, (STORED_BLOCK<<1)+last, 3); /* send block type */
send_bits(s, (STORED_BLOCK<<1)+eof, 3); /* send block type */
#ifdef DEBUG
s->compressed_len = (s->compressed_len + 3 + 7) & (ulg)~7L;
s->compressed_len += (stored_len + 4) << 3;
@ -893,7 +889,7 @@ void ZLIB_INTERNAL _tr_stored_block(s, buf, stored_len, last)
* To simplify the code, we assume the worst case of last real code encoded
* on one bit only.
*/
void ZLIB_INTERNAL _tr_align(s)
void _tr_align(s)
deflate_state *s;
{
send_bits(s, STATIC_TREES<<1, 3);
@ -922,11 +918,11 @@ void ZLIB_INTERNAL _tr_align(s)
* Determine the best encoding for the current block: dynamic trees, static
* trees or store, and output the encoded block to the zip file.
*/
void ZLIB_INTERNAL _tr_flush_block(s, buf, stored_len, last)
void _tr_flush_block(s, buf, stored_len, eof)
deflate_state *s;
charf *buf; /* input block, or NULL if too old */
ulg stored_len; /* length of input block */
int last; /* one if this is the last block for a file */
int eof; /* true if this is the last block for a file */
{
ulg opt_lenb, static_lenb; /* opt_len and static_len in bytes */
int max_blindex = 0; /* index of last bit length code of non zero freq */
@ -935,8 +931,8 @@ void ZLIB_INTERNAL _tr_flush_block(s, buf, stored_len, last)
if (s->level > 0) {
/* Check if the file is binary or text */
if (s->strm->data_type == Z_UNKNOWN)
s->strm->data_type = detect_data_type(s);
if (stored_len > 0 && s->strm->data_type == Z_UNKNOWN)
set_data_type(s);
/* Construct the literal and distance trees */
build_tree(s, (tree_desc *)(&(s->l_desc)));
@ -982,20 +978,20 @@ void ZLIB_INTERNAL _tr_flush_block(s, buf, stored_len, last)
* successful. If LIT_BUFSIZE <= WSIZE, it is never too late to
* transform a block into a stored block.
*/
_tr_stored_block(s, buf, stored_len, last);
_tr_stored_block(s, buf, stored_len, eof);
#ifdef FORCE_STATIC
} else if (static_lenb >= 0) { /* force static trees */
#else
} else if (s->strategy == Z_FIXED || static_lenb == opt_lenb) {
#endif
send_bits(s, (STATIC_TREES<<1)+last, 3);
send_bits(s, (STATIC_TREES<<1)+eof, 3);
compress_block(s, (ct_data *)static_ltree, (ct_data *)static_dtree);
#ifdef DEBUG
s->compressed_len += 3 + s->static_len;
#endif
} else {
send_bits(s, (DYN_TREES<<1)+last, 3);
send_bits(s, (DYN_TREES<<1)+eof, 3);
send_all_trees(s, s->l_desc.max_code+1, s->d_desc.max_code+1,
max_blindex+1);
compress_block(s, (ct_data *)s->dyn_ltree, (ct_data *)s->dyn_dtree);
@ -1009,21 +1005,21 @@ void ZLIB_INTERNAL _tr_flush_block(s, buf, stored_len, last)
*/
init_block(s);
if (last) {
if (eof) {
bi_windup(s);
#ifdef DEBUG
s->compressed_len += 7; /* align on byte boundary */
#endif
}
Tracev((stderr,"\ncomprlen %lu(%lu) ", s->compressed_len>>3,
s->compressed_len-7*last));
s->compressed_len-7*eof));
}
/* ===========================================================================
* Save the match info and tally the frequency counts. Return true if
* the current block must be flushed.
*/
int ZLIB_INTERNAL _tr_tally (s, dist, lc)
int _tr_tally (s, dist, lc)
deflate_state *s;
unsigned dist; /* distance of matched string */
unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */
@ -1122,45 +1118,24 @@ local void compress_block(s, ltree, dtree)
}
/* ===========================================================================
* Check if the data type is TEXT or BINARY, using the following algorithm:
* - TEXT if the two conditions below are satisfied:
* a) There are no non-portable control characters belonging to the
* "black list" (0..6, 14..25, 28..31).
* b) There is at least one printable character belonging to the
* "white list" (9 {TAB}, 10 {LF}, 13 {CR}, 32..255).
* - BINARY otherwise.
* - The following partially-portable control characters form a
* "gray list" that is ignored in this detection algorithm:
* (7 {BEL}, 8 {BS}, 11 {VT}, 12 {FF}, 26 {SUB}, 27 {ESC}).
* Set the data type to BINARY or TEXT, using a crude approximation:
* set it to Z_TEXT if all symbols are either printable characters (33 to 255)
* or white spaces (9 to 13, or 32); or set it to Z_BINARY otherwise.
* IN assertion: the fields Freq of dyn_ltree are set.
*/
local int detect_data_type(s)
local void set_data_type(s)
deflate_state *s;
{
/* black_mask is the bit mask of black-listed bytes
* set bits 0..6, 14..25, and 28..31
* 0xf3ffc07f = binary 11110011111111111100000001111111
*/
unsigned long black_mask = 0xf3ffc07fUL;
int n;
/* Check for non-textual ("black-listed") bytes. */
for (n = 0; n <= 31; n++, black_mask >>= 1)
if ((black_mask & 1) && (s->dyn_ltree[n].Freq != 0))
return Z_BINARY;
/* Check for textual ("white-listed") bytes. */
if (s->dyn_ltree[9].Freq != 0 || s->dyn_ltree[10].Freq != 0
|| s->dyn_ltree[13].Freq != 0)
return Z_TEXT;
for (n = 32; n < LITERALS; n++)
for (n = 0; n < 9; n++)
if (s->dyn_ltree[n].Freq != 0)
return Z_TEXT;
/* There are no "black-listed" or "white-listed" bytes:
* this stream either is empty or has tolerated ("gray-listed") bytes only.
*/
return Z_BINARY;
break;
if (n == 9)
for (n = 14; n < 32; n++)
if (s->dyn_ltree[n].Freq != 0)
break;
s->strm->data_type = (n == 32) ? Z_TEXT : Z_BINARY;
}
/* ===========================================================================

View file

@ -70,7 +70,7 @@ local const ct_data static_dtree[D_CODES] = {
{{19},{ 5}}, {{11},{ 5}}, {{27},{ 5}}, {{ 7},{ 5}}, {{23},{ 5}}
};
const uch ZLIB_INTERNAL _dist_code[DIST_CODE_LEN] = {
const uch _dist_code[DIST_CODE_LEN] = {
0, 1, 2, 3, 4, 4, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 8,
8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10,
10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
@ -99,7 +99,7 @@ const uch ZLIB_INTERNAL _dist_code[DIST_CODE_LEN] = {
29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29
};
const uch ZLIB_INTERNAL _length_code[MAX_MATCH-MIN_MATCH+1]= {
const uch _length_code[MAX_MATCH-MIN_MATCH+1]= {
0, 1, 2, 3, 4, 5, 6, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 12, 12,
13, 13, 13, 13, 14, 14, 14, 14, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16,
17, 17, 17, 17, 17, 17, 17, 17, 18, 18, 18, 18, 18, 18, 18, 18, 19, 19, 19, 19,

View file

@ -1,5 +1,5 @@
/* zconf.h -- configuration of the zlib compression library
* Copyright (C) 1995-2010 Jean-loup Gailly.
* Copyright (C) 1995-2005 Jean-loup Gailly.
* For conditions of distribution and use, see copyright notice in zlib.h
*/
@ -11,124 +11,52 @@
/*
* If you *really* need a unique prefix for all types and library functions,
* compile with -DZ_PREFIX. The "standard" zlib should be compiled without it.
* Even better than compiling with -DZ_PREFIX would be to use configure to set
* this permanently in zconf.h using "./configure --zprefix".
*/
#ifdef Z_PREFIX /* may be set to #if 1 by ./configure */
/* all linked symbols */
# define _dist_code z__dist_code
# define _length_code z__length_code
# define _tr_align z__tr_align
# define _tr_flush_block z__tr_flush_block
# define _tr_init z__tr_init
# define _tr_stored_block z__tr_stored_block
# define _tr_tally z__tr_tally
# define adler32 z_adler32
# define adler32_combine z_adler32_combine
# define adler32_combine64 z_adler32_combine64
# define compress z_compress
# define compress2 z_compress2
# define compressBound z_compressBound
# define crc32 z_crc32
# define crc32_combine z_crc32_combine
# define crc32_combine64 z_crc32_combine64
# define deflate z_deflate
# define deflateBound z_deflateBound
# define deflateCopy z_deflateCopy
# define deflateEnd z_deflateEnd
# define deflateInit2_ z_deflateInit2_
#ifdef Z_PREFIX
# define deflateInit_ z_deflateInit_
# define deflateParams z_deflateParams
# define deflatePrime z_deflatePrime
# define deflateReset z_deflateReset
# define deflateSetDictionary z_deflateSetDictionary
# define deflateSetHeader z_deflateSetHeader
# define deflateTune z_deflateTune
# define deflate_copyright z_deflate_copyright
# define get_crc_table z_get_crc_table
# define gz_error z_gz_error
# define gz_intmax z_gz_intmax
# define gz_strwinerror z_gz_strwinerror
# define gzbuffer z_gzbuffer
# define gzclearerr z_gzclearerr
# define gzclose z_gzclose
# define gzclose_r z_gzclose_r
# define gzclose_w z_gzclose_w
# define gzdirect z_gzdirect
# define gzdopen z_gzdopen
# define gzeof z_gzeof
# define gzerror z_gzerror
# define gzflush z_gzflush
# define gzgetc z_gzgetc
# define gzgets z_gzgets
# define gzoffset z_gzoffset
# define gzoffset64 z_gzoffset64
# define gzopen z_gzopen
# define gzopen64 z_gzopen64
# define gzprintf z_gzprintf
# define gzputc z_gzputc
# define gzputs z_gzputs
# define gzread z_gzread
# define gzrewind z_gzrewind
# define gzseek z_gzseek
# define gzseek64 z_gzseek64
# define gzsetparams z_gzsetparams
# define gztell z_gztell
# define gztell64 z_gztell64
# define gzungetc z_gzungetc
# define gzwrite z_gzwrite
# define inflate z_inflate
# define inflateBack z_inflateBack
# define inflateBackEnd z_inflateBackEnd
# define inflateBackInit_ z_inflateBackInit_
# define inflateCopy z_inflateCopy
# define inflateEnd z_inflateEnd
# define inflateGetHeader z_inflateGetHeader
# define inflateInit2_ z_inflateInit2_
# define deflate z_deflate
# define deflateEnd z_deflateEnd
# define inflateInit_ z_inflateInit_
# define inflateMark z_inflateMark
# define inflatePrime z_inflatePrime
# define inflateReset z_inflateReset
# define inflateReset2 z_inflateReset2
# define inflate z_inflate
# define inflateEnd z_inflateEnd
# define deflateInit2_ z_deflateInit2_
# define deflateSetDictionary z_deflateSetDictionary
# define deflateCopy z_deflateCopy
# define deflateReset z_deflateReset
# define deflateParams z_deflateParams
# define deflateBound z_deflateBound
# define deflatePrime z_deflatePrime
# define inflateInit2_ z_inflateInit2_
# define inflateSetDictionary z_inflateSetDictionary
# define inflateSync z_inflateSync
# define inflateSyncPoint z_inflateSyncPoint
# define inflateUndermine z_inflateUndermine
# define inflate_copyright z_inflate_copyright
# define inflate_fast z_inflate_fast
# define inflate_table z_inflate_table
# define inflateCopy z_inflateCopy
# define inflateReset z_inflateReset
# define inflateBack z_inflateBack
# define inflateBackEnd z_inflateBackEnd
# define compress z_compress
# define compress2 z_compress2
# define compressBound z_compressBound
# define uncompress z_uncompress
# define adler32 z_adler32
# define crc32 z_crc32
# define get_crc_table z_get_crc_table
# define zError z_zError
# define zcalloc z_zcalloc
# define zcfree z_zcfree
# define zlibCompileFlags z_zlibCompileFlags
# define zlibVersion z_zlibVersion
/* all zlib typedefs in zlib.h and zconf.h */
# define Byte z_Byte
# define Bytef z_Bytef
# define alloc_func z_alloc_func
# define charf z_charf
# define free_func z_free_func
# define gzFile z_gzFile
# define gz_header z_gz_header
# define gz_headerp z_gz_headerp
# define in_func z_in_func
# define intf z_intf
# define out_func z_out_func
# define Byte z_Byte
# define uInt z_uInt
# define uIntf z_uIntf
# define uLong z_uLong
# define Bytef z_Bytef
# define charf z_charf
# define intf z_intf
# define uIntf z_uIntf
# define uLongf z_uLongf
# define voidp z_voidp
# define voidpc z_voidpc
# define voidpf z_voidpf
/* all zlib structs in zlib.h and zconf.h */
# define gz_header_s z_gz_header_s
# define internal_state z_internal_state
# define voidp z_voidp
#endif
#if defined(__MSDOS__) && !defined(MSDOS)
@ -356,73 +284,49 @@ typedef uLong FAR uLongf;
typedef Byte *voidp;
#endif
#ifdef HAVE_UNISTD_H /* may be set to #if 1 by ./configure */
# define Z_HAVE_UNISTD_H
#endif
#ifdef STDC
# include <sys/types.h> /* for off_t */
#endif
/* a little trick to accommodate both "#define _LARGEFILE64_SOURCE" and
* "#define _LARGEFILE64_SOURCE 1" as requesting 64-bit operations, (even
* though the former does not conform to the LFS document), but considering
* both "#undef _LARGEFILE64_SOURCE" and "#define _LARGEFILE64_SOURCE 0" as
* equivalently requesting no 64-bit operations
*/
#if -_LARGEFILE64_SOURCE - -1 == 1
# undef _LARGEFILE64_SOURCE
#endif
#if defined(Z_HAVE_UNISTD_H) || defined(_LARGEFILE64_SOURCE)
# include <unistd.h> /* for SEEK_* and off_t */
#if 0 /* HAVE_UNISTD_H -- this line is updated by ./configure */
# include <sys/types.h> /* for off_t */
# include <unistd.h> /* for SEEK_* and off_t */
# ifdef VMS
# include <unixio.h> /* for off_t */
# endif
# ifndef z_off_t
# define z_off_t off_t
# include <unixio.h> /* for off_t */
# endif
# define z_off_t off_t
#endif
#ifndef SEEK_SET
# define SEEK_SET 0 /* Seek from beginning of file. */
# define SEEK_CUR 1 /* Seek from current position. */
# define SEEK_END 2 /* Set file pointer to EOF plus "offset" */
#endif
#ifndef z_off_t
# define z_off_t long
#endif
#if defined(_LARGEFILE64_SOURCE) && _LFS64_LARGEFILE-0
# define z_off64_t off64_t
#else
# define z_off64_t z_off_t
#endif
#if defined(__OS400__)
# define NO_vsnprintf
#endif
#if defined(__MVS__)
# define NO_vsnprintf
# ifdef FAR
# undef FAR
# endif
#endif
/* MVS linker does not support external names larger than 8 bytes */
#if defined(__MVS__)
#pragma map(deflateInit_,"DEIN")
#pragma map(deflateInit2_,"DEIN2")
#pragma map(deflateEnd,"DEEND")
#pragma map(deflateBound,"DEBND")
#pragma map(inflateInit_,"ININ")
#pragma map(inflateInit2_,"ININ2")
#pragma map(inflateEnd,"INEND")
#pragma map(inflateSync,"INSY")
#pragma map(inflateSetDictionary,"INSEDI")
#pragma map(compressBound,"CMBND")
#pragma map(inflate_table,"INTABL")
#pragma map(inflate_fast,"INFA")
#pragma map(inflate_copyright,"INCOPY")
# pragma map(deflateInit_,"DEIN")
# pragma map(deflateInit2_,"DEIN2")
# pragma map(deflateEnd,"DEEND")
# pragma map(deflateBound,"DEBND")
# pragma map(inflateInit_,"ININ")
# pragma map(inflateInit2_,"ININ2")
# pragma map(inflateEnd,"INEND")
# pragma map(inflateSync,"INSY")
# pragma map(inflateSetDictionary,"INSEDI")
# pragma map(compressBound,"CMBND")
# pragma map(inflate_table,"INTABL")
# pragma map(inflate_fast,"INFA")
# pragma map(inflate_copyright,"INCOPY")
#endif
#endif /* ZCONF_H */

File diff suppressed because it is too large Load diff

View file

@ -1,5 +1,5 @@
/* zutil.c -- target dependent utility functions for the compression library
* Copyright (C) 1995-2005, 2010 Jean-loup Gailly.
* Copyright (C) 1995-2005 Jean-loup Gailly.
* For conditions of distribution and use, see copyright notice in zlib.h
*/
@ -34,25 +34,25 @@ uLong ZEXPORT zlibCompileFlags()
uLong flags;
flags = 0;
switch ((int)(sizeof(uInt))) {
switch (sizeof(uInt)) {
case 2: break;
case 4: flags += 1; break;
case 8: flags += 2; break;
default: flags += 3;
}
switch ((int)(sizeof(uLong))) {
switch (sizeof(uLong)) {
case 2: break;
case 4: flags += 1 << 2; break;
case 8: flags += 2 << 2; break;
default: flags += 3 << 2;
}
switch ((int)(sizeof(voidpf))) {
switch (sizeof(voidpf)) {
case 2: break;
case 4: flags += 1 << 4; break;
case 8: flags += 2 << 4; break;
default: flags += 3 << 4;
}
switch ((int)(sizeof(z_off_t))) {
switch (sizeof(z_off_t)) {
case 2: break;
case 4: flags += 1 << 6; break;
case 8: flags += 2 << 6; break;
@ -117,9 +117,9 @@ uLong ZEXPORT zlibCompileFlags()
# ifndef verbose
# define verbose 0
# endif
int ZLIB_INTERNAL z_verbose = verbose;
int z_verbose = verbose;
void ZLIB_INTERNAL z_error (m)
void z_error (m)
char *m;
{
fprintf(stderr, "%s\n", m);
@ -146,7 +146,7 @@ const char * ZEXPORT zError(err)
#ifndef HAVE_MEMCPY
void ZLIB_INTERNAL zmemcpy(dest, source, len)
void zmemcpy(dest, source, len)
Bytef* dest;
const Bytef* source;
uInt len;
@ -157,7 +157,7 @@ void ZLIB_INTERNAL zmemcpy(dest, source, len)
} while (--len != 0);
}
int ZLIB_INTERNAL zmemcmp(s1, s2, len)
int zmemcmp(s1, s2, len)
const Bytef* s1;
const Bytef* s2;
uInt len;
@ -170,7 +170,7 @@ int ZLIB_INTERNAL zmemcmp(s1, s2, len)
return 0;
}
void ZLIB_INTERNAL zmemzero(dest, len)
void zmemzero(dest, len)
Bytef* dest;
uInt len;
{
@ -213,7 +213,7 @@ local ptr_table table[MAX_PTR];
* a protected system like OS/2. Use Microsoft C instead.
*/
voidpf ZLIB_INTERNAL zcalloc (voidpf opaque, unsigned items, unsigned size)
voidpf zcalloc (voidpf opaque, unsigned items, unsigned size)
{
voidpf buf = opaque; /* just to make some compilers happy */
ulg bsize = (ulg)items*size;
@ -237,7 +237,7 @@ voidpf ZLIB_INTERNAL zcalloc (voidpf opaque, unsigned items, unsigned size)
return buf;
}
void ZLIB_INTERNAL zcfree (voidpf opaque, voidpf ptr)
void zcfree (voidpf opaque, voidpf ptr)
{
int n;
if (*(ush*)&ptr != 0) { /* object < 64K */
@ -272,13 +272,13 @@ void ZLIB_INTERNAL zcfree (voidpf opaque, voidpf ptr)
# define _hfree hfree
#endif
voidpf ZLIB_INTERNAL zcalloc (voidpf opaque, uInt items, uInt size)
voidpf zcalloc (voidpf opaque, unsigned items, unsigned size)
{
if (opaque) opaque = 0; /* to make compiler happy */
return _halloc((long)items, size);
}
void ZLIB_INTERNAL zcfree (voidpf opaque, voidpf ptr)
void zcfree (voidpf opaque, voidpf ptr)
{
if (opaque) opaque = 0; /* to make compiler happy */
_hfree(ptr);
@ -297,7 +297,7 @@ extern voidp calloc OF((uInt items, uInt size));
extern void free OF((voidpf ptr));
#endif
voidpf ZLIB_INTERNAL zcalloc (opaque, items, size)
voidpf zcalloc (opaque, items, size)
voidpf opaque;
unsigned items;
unsigned size;
@ -307,7 +307,7 @@ voidpf ZLIB_INTERNAL zcalloc (opaque, items, size)
(voidpf)calloc(items, size);
}
void ZLIB_INTERNAL zcfree (opaque, ptr)
void zcfree (opaque, ptr)
voidpf opaque;
voidpf ptr;
{

View file

@ -1,5 +1,5 @@
/* zutil.h -- internal interface and configuration of the compression library
* Copyright (C) 1995-2010 Jean-loup Gailly.
* Copyright (C) 1995-2005 Jean-loup Gailly.
* For conditions of distribution and use, see copyright notice in zlib.h
*/
@ -13,21 +13,31 @@
#ifndef ZUTIL_H
#define ZUTIL_H
#if ((__GNUC__-0) * 10 + __GNUC_MINOR__-0 >= 33) && !defined(NO_VIZ)
# define ZLIB_INTERNAL __attribute__((visibility ("hidden")))
#else
# define ZLIB_INTERNAL
#endif
#define ZLIB_INTERNAL
#include "zlib.h"
#ifdef STDC
# if !(defined(_WIN32_WCE) && defined(_MSC_VER))
# ifndef _WIN32_WCE
# include <stddef.h>
# endif
# include <string.h>
# include <stdlib.h>
#endif
#ifdef NO_ERRNO_H
# ifdef _WIN32_WCE
/* The Microsoft C Run-Time Library for Windows CE doesn't have
* errno. We define it as a global variable to simplify porting.
* Its value is always 0 and should not be used. We rename it to
* avoid conflict with other libraries that use the same workaround.
*/
# define errno z_errno
# endif
extern int errno;
#else
# ifndef _WIN32_WCE
# include <errno.h>
# endif
#endif
#ifndef local
# define local static
@ -79,7 +89,7 @@ extern const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
#if defined(MSDOS) || (defined(WINDOWS) && !defined(WIN32))
# define OS_CODE 0x00
# if defined(__TURBOC__) || defined(__BORLANDC__)
# if (__STDC__ == 1) && (defined(__LARGE__) || defined(__COMPACT__))
# if(__STDC__ == 1) && (defined(__LARGE__) || defined(__COMPACT__))
/* Allow compilation with ANSI keywords only enabled */
void _Cdecl farfree( void *block );
void *_Cdecl farmalloc( unsigned long nbytes );
@ -108,7 +118,7 @@ extern const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
#ifdef OS2
# define OS_CODE 0x06
# ifdef M_I86
# include <malloc.h>
#include <malloc.h>
# endif
#endif
@ -141,7 +151,7 @@ extern const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
# define fdopen(fd,mode) NULL /* No fdopen() */
#endif
#if (defined(_MSC_VER) && (_MSC_VER > 600)) && !defined __INTERIX
#if (defined(_MSC_VER) && (_MSC_VER > 600))
# if defined(_WIN32_WCE)
# define fdopen(fd,mode) NULL /* No fdopen() */
# ifndef _PTRDIFF_T_DEFINED
@ -153,18 +163,6 @@ extern const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
# endif
#endif
#if defined(__BORLANDC__)
#pragma warn -8004
#pragma warn -8008
#pragma warn -8066
#endif
/* provide prototypes for these when building zlib without LFS */
#if !defined(_LARGEFILE64_SOURCE) || _LFS64_LARGEFILE-0 == 0
ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off_t));
ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off_t));
#endif
/* common defaults */
#ifndef OS_CODE
@ -199,9 +197,7 @@ extern const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
# ifdef WIN32
/* In Win32, vsnprintf is available as the "non-ANSI" _vsnprintf. */
# if !defined(vsnprintf) && !defined(NO_vsnprintf)
# if !defined(_MSC_VER) || ( defined(_MSC_VER) && _MSC_VER < 1500 )
# define vsnprintf _vsnprintf
# endif
# define vsnprintf _vsnprintf
# endif
# endif
# ifdef __SASC
@ -236,16 +232,16 @@ extern const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
# define zmemzero(dest, len) memset(dest, 0, len)
# endif
#else
void ZLIB_INTERNAL zmemcpy OF((Bytef* dest, const Bytef* source, uInt len));
int ZLIB_INTERNAL zmemcmp OF((const Bytef* s1, const Bytef* s2, uInt len));
void ZLIB_INTERNAL zmemzero OF((Bytef* dest, uInt len));
extern void zmemcpy OF((Bytef* dest, const Bytef* source, uInt len));
extern int zmemcmp OF((const Bytef* s1, const Bytef* s2, uInt len));
extern void zmemzero OF((Bytef* dest, uInt len));
#endif
/* Diagnostic functions */
#ifdef DEBUG
# include <stdio.h>
extern int ZLIB_INTERNAL z_verbose;
extern void ZLIB_INTERNAL z_error OF((char *m));
extern int z_verbose;
extern void z_error OF((char *m));
# define Assert(cond,msg) {if(!(cond)) z_error(msg);}
# define Trace(x) {if (z_verbose>=0) fprintf x ;}
# define Tracev(x) {if (z_verbose>0) fprintf x ;}
@ -262,9 +258,8 @@ extern const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
#endif
voidpf ZLIB_INTERNAL zcalloc OF((voidpf opaque, unsigned items,
unsigned size));
void ZLIB_INTERNAL zcfree OF((voidpf opaque, voidpf ptr));
voidpf zcalloc OF((voidpf opaque, unsigned items, unsigned size));
void zcfree OF((voidpf opaque, voidpf ptr));
#define ZALLOC(strm, items, size) \
(*((strm)->zalloc))((strm)->opaque, (items), (size))

View file

@ -1,13 +0,0 @@
#
# NOTE! Don't add files that are generated in specific
# subdirectories here. Add them in the ".gitignore" file
# in that subdirectory instead.
#
# NOTE! Please use 'git-ls-files -i --exclude-standard'
# command after changing this file, to see if there are
# any tracked files which get ignored after the change.
#
# MaNGOS generated files at Windows build
#
bin

View file

@ -1,304 +0,0 @@
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/SBaseDumpData.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})
set(LINK_LIBS wininet)
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(storm SHARED ${SRC_FILES} ${SRC_ADDITIONAL_FILES})
target_link_libraries(storm ${LINK_LIBS})
# option(WITH_TEST "Compile Test application" OFF)
# if(WITH_TEST)
# add_executable(storm_test ${TEST_SRC_FILES})
# target_link_libraries(storm_test storm)
# endif()
# option(WITH_STATIC "Compile static linked library" OFF)
# if(WITH_STATIC)
# 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)
# endif()
if(APPLE)
set_target_properties(storm PROPERTIES FRAMEWORK true)
set_target_properties(storm PROPERTIES PUBLIC_HEADER "src/StormLib.h src/StormPort.h")
set_target_properties(storm PROPERTIES LINK_FLAGS "-framework Carbon")
endif()
if(UNIX)
set_target_properties(storm PROPERTIES VERSION 8.20.0)
set_target_properties(storm PROPERTIES SOVERSION 8.20)
endif()
# On Win32, build StormLib.dll since we don't want to clash with Storm.dll
if(WIN32)
set_target_properties(storm PROPERTIES OUTPUT_NAME StormLib)
endif()
install(TARGETS storm RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib FRAMEWORK DESTINATION /Library/Frameworks)
install(FILES src/StormLib.h src/StormPort.h DESTINATION include)

View file

@ -1,22 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIdentifier</key>
<string>net.zezula.${PRODUCT_NAME:rfc1034Identifier}</string>
<key>CFBundleName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>8.01</string>
</dict>
</plist>

View file

@ -1,275 +0,0 @@
#####################################################################
###
#
# Makefile for compiling StormLib under linux
#
# Author: Marko Friedemann <marko.friedemann@bmx-chemnitz.de>
# 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

View file

@ -1,253 +0,0 @@
#####################################################################
#
# 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 $<

View file

@ -1,22 +0,0 @@
@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\CMakeLists.txt
zip.exe -u9 ..\WWW\web\download\stormlib.zip StormLib\makefile.*
zip.exe -u9 ..\WWW\web\download\stormlib.zip StormLib\Info.plist
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
echo.
echo Press any key to exit ...
pause >nul

View file

@ -1,22 +0,0 @@
@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\CMakeLists.txt
zip.exe -u9 ..\WWW\web\download\stormlib_beta.zip StormLib\makefile.*
zip.exe -u9 ..\WWW\web\download\stormlib_beta.zip StormLib\Info.plist
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
echo.
echo Press any key to exit ...
pause >nul

View file

@ -1,23 +0,0 @@
stormlib ![Project status](http://getmangos.co.uk/assets/img/repository-status-maintained.png)
========
The StormLib library is a pack of modules, written in C++, which are able to
read and also to write files from/to the MPQ archives.
MPQ (MoPaQ) is an archive format developed by Blizzard Entertainment,
purposed for storing data files, images, sounds, music and videos for their
games.
*Notice*: this repository is meant to track the development of the original
[stormlib][1], developed by [Ladislav Zezula][2].
Usage
-----
This library is used inside of [mangos-zero][3] to access data inside of MPQ
archives included in the [World of Warcraft][4] game client.
[1]: http://www.zezula.net/en/mpq/stormlib.html "StormLib"
[2]: http://www.zezula.net/ "Ladislav Zezula"
[3]: http://github.com/mangos-zero "mangos-zero"
[4]: http://eu.blizzard.com/en-gb/games/wow/ "World of Warcraft"

View file

@ -1,22 +0,0 @@
@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

View file

@ -1,140 +0,0 @@

Microsoft Visual Studio Solution File, Format Version 10.00
# Visual Studio 2008
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "StormLib", "StormLib.vcproj", "{78424708-1F6E-4D4B-920C-FB6D26847055}"
EndProject
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
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
{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|x64
{AA561A7B-26EA-49AF-90E8-C53C1FA2965D}.Debug|x64.Build.0 = Debug|x64
{AA561A7B-26EA-49AF-90E8-C53C1FA2965D}.DebugAD|Win32.ActiveCfg = Debug|x64
{AA561A7B-26EA-49AF-90E8-C53C1FA2965D}.DebugAD|x64.ActiveCfg = Debug|x64
{AA561A7B-26EA-49AF-90E8-C53C1FA2965D}.DebugAD|x64.Build.0 = Debug|x64
{AA561A7B-26EA-49AF-90E8-C53C1FA2965D}.DebugAS|Win32.ActiveCfg = Debug|x64
{AA561A7B-26EA-49AF-90E8-C53C1FA2965D}.DebugAS|x64.ActiveCfg = Debug|x64
{AA561A7B-26EA-49AF-90E8-C53C1FA2965D}.DebugAS|x64.Build.0 = Debug|x64
{AA561A7B-26EA-49AF-90E8-C53C1FA2965D}.DebugUD|Win32.ActiveCfg = Debug|x64
{AA561A7B-26EA-49AF-90E8-C53C1FA2965D}.DebugUD|x64.ActiveCfg = Debug|x64
{AA561A7B-26EA-49AF-90E8-C53C1FA2965D}.DebugUD|x64.Build.0 = Debug|x64
{AA561A7B-26EA-49AF-90E8-C53C1FA2965D}.DebugUS|Win32.ActiveCfg = Debug|x64
{AA561A7B-26EA-49AF-90E8-C53C1FA2965D}.DebugUS|x64.ActiveCfg = Debug|x64
{AA561A7B-26EA-49AF-90E8-C53C1FA2965D}.DebugUS|x64.Build.0 = Debug|x64
{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|x64
{AA561A7B-26EA-49AF-90E8-C53C1FA2965D}.Release|x64.Build.0 = Release|x64
{AA561A7B-26EA-49AF-90E8-C53C1FA2965D}.ReleaseAD|Win32.ActiveCfg = Release|x64
{AA561A7B-26EA-49AF-90E8-C53C1FA2965D}.ReleaseAD|x64.ActiveCfg = Release|x64
{AA561A7B-26EA-49AF-90E8-C53C1FA2965D}.ReleaseAD|x64.Build.0 = Release|x64
{AA561A7B-26EA-49AF-90E8-C53C1FA2965D}.ReleaseAS|Win32.ActiveCfg = Release|x64
{AA561A7B-26EA-49AF-90E8-C53C1FA2965D}.ReleaseAS|x64.ActiveCfg = Release|x64
{AA561A7B-26EA-49AF-90E8-C53C1FA2965D}.ReleaseAS|x64.Build.0 = Release|x64
{AA561A7B-26EA-49AF-90E8-C53C1FA2965D}.ReleaseUD|Win32.ActiveCfg = Release|x64
{AA561A7B-26EA-49AF-90E8-C53C1FA2965D}.ReleaseUD|x64.ActiveCfg = Release|x64
{AA561A7B-26EA-49AF-90E8-C53C1FA2965D}.ReleaseUD|x64.Build.0 = Release|x64
{AA561A7B-26EA-49AF-90E8-C53C1FA2965D}.ReleaseUS|Win32.ActiveCfg = Release|x64
{AA561A7B-26EA-49AF-90E8-C53C1FA2965D}.ReleaseUS|x64.ActiveCfg = Release|x64
{AA561A7B-26EA-49AF-90E8-C53C1FA2965D}.ReleaseUS|x64.Build.0 = Release|x64
{78424708-1F6E-4D4B-920C-FB6D26847055}.Debug|Win32.ActiveCfg = DebugUS|x64
{78424708-1F6E-4D4B-920C-FB6D26847055}.Debug|x64.ActiveCfg = DebugUS|x64
{78424708-1F6E-4D4B-920C-FB6D26847055}.Debug|x64.Build.0 = DebugUS|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 = ReleaseUS|x64
{78424708-1F6E-4D4B-920C-FB6D26847055}.Release|x64.ActiveCfg = ReleaseUS|x64
{78424708-1F6E-4D4B-920C-FB6D26847055}.Release|x64.Build.0 = ReleaseUS|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
{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
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

File diff suppressed because it is too large Load diff

View file

@ -1,688 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="DebugAD|Win32">
<Configuration>DebugAD</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="DebugAD|x64">
<Configuration>DebugAD</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="DebugAS|Win32">
<Configuration>DebugAS</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="DebugAS|x64">
<Configuration>DebugAS</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="ReleaseAD|Win32">
<Configuration>ReleaseAD</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="ReleaseAD|x64">
<Configuration>ReleaseAD</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="ReleaseAS|Win32">
<Configuration>ReleaseAS</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="ReleaseAS|x64">
<Configuration>ReleaseAS</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectName>StormLib</ProjectName>
<ProjectGuid>{78424708-1F6E-4D4B-920C-FB6D26847055}</ProjectGuid>
<RootNamespace>StormLib</RootNamespace>
<Keyword>Win32Proj</Keyword>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugAS|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugAD|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugAS|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugAD|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugAS|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugAD|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugAS|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugAD|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>
<OutDir Condition="'$(Configuration)|$(Platform)'=='DebugAD|Win32'">./bin/$(ProjectName)/$(Platform)/$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='DebugAD|Win32'">./bin/$(ProjectName)/$(Platform)/$(Configuration)\</IntDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='DebugAD|x64'">./bin/$(ProjectName)/$(Platform)/$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='DebugAD|x64'">./bin/$(ProjectName)/$(Platform)/$(Configuration)\</IntDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='DebugAS|Win32'">./bin/$(ProjectName)/$(Platform)/$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='DebugAS|Win32'">./bin/$(ProjectName)/$(Platform)/$(Configuration)\</IntDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='DebugAS|x64'">./bin/$(ProjectName)/$(Platform)/$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='DebugAS|x64'">./bin/$(ProjectName)/$(Platform)/$(Configuration)\</IntDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|Win32'">./bin/$(ProjectName)/$(Platform)/$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|Win32'">./bin/$(ProjectName)/$(Platform)/$(Configuration)\</IntDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|x64'">./bin/$(ProjectName)/$(Platform)/$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|x64'">./bin/$(ProjectName)/$(Platform)/$(Configuration)\</IntDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|Win32'">./bin/$(ProjectName)/$(Platform)/$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|Win32'">./bin/$(ProjectName)/$(Platform)/$(Configuration)\</IntDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|x64'">./bin/$(ProjectName)/$(Platform)/$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|x64'">./bin/$(ProjectName)/$(Platform)/$(Configuration)\</IntDir>
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='DebugAD|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='DebugAD|Win32'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='DebugAD|Win32'" />
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='DebugAD|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='DebugAD|x64'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='DebugAD|x64'" />
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='DebugAS|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='DebugAS|Win32'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='DebugAS|Win32'" />
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='DebugAS|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='DebugAS|x64'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='DebugAS|x64'" />
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|Win32'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|Win32'" />
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|x64'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|x64'" />
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|Win32'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|Win32'" />
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|x64'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|x64'" />
<TargetName Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|Win32'">$(ProjectName)RAS</TargetName>
<TargetName Condition="'$(Configuration)|$(Platform)'=='DebugAD|Win32'">$(ProjectName)DAD</TargetName>
<TargetName Condition="'$(Configuration)|$(Platform)'=='DebugAS|Win32'">$(ProjectName)DAS</TargetName>
<TargetName Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|Win32'">$(ProjectName)RAD</TargetName>
<TargetName Condition="'$(Configuration)|$(Platform)'=='DebugAD|x64'">$(ProjectName)DAD</TargetName>
<TargetName Condition="'$(Configuration)|$(Platform)'=='DebugAS|x64'">$(ProjectName)DAS</TargetName>
<TargetName Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|x64'">$(ProjectName)RAD</TargetName>
<TargetName Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|x64'">$(ProjectName)RAS</TargetName>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugAD|Win32'">
<ClCompile>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>false</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level1</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Lib>
<OutputFile>$(OutDir)$(ProjectName)DAD.lib</OutputFile>
</Lib>
<PostBuildEvent>
<Command>StormLib.bat $(Platform) $(Configuration)</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugAD|x64'">
<Midl>
<TargetEnvironment>X64</TargetEnvironment>
</Midl>
<ClCompile>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>false</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level1</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Lib>
<OutputFile>$(OutDir)$(ProjectName)DAD.lib</OutputFile>
</Lib>
<PostBuildEvent>
<Command>StormLib.bat $(Platform) $(Configuration)</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugAS|Win32'">
<ClCompile>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>false</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level1</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Lib>
<OutputFile>$(OutDir)$(ProjectName)DAS.lib</OutputFile>
</Lib>
<PostBuildEvent>
<Command>StormLib.bat $(Platform) $(Configuration)</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugAS|x64'">
<Midl>
<TargetEnvironment>X64</TargetEnvironment>
</Midl>
<ClCompile>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>false</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level1</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Lib>
<OutputFile>$(OutDir)$(ProjectName)DAS.lib</OutputFile>
</Lib>
<PostBuildEvent>
<Command>StormLib.bat $(Platform) $(Configuration)</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|Win32'">
<ClCompile>
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level1</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Lib>
<OutputFile>$(OutDir)$(ProjectName)RAD.lib</OutputFile>
</Lib>
<PostBuildEvent>
<Command>StormLib.bat $(Platform) $(Configuration)</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|x64'">
<Midl>
<TargetEnvironment>X64</TargetEnvironment>
</Midl>
<ClCompile>
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level1</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Lib>
<OutputFile>$(OutDir)$(ProjectName)RAD.lib</OutputFile>
</Lib>
<PostBuildEvent>
<Command>StormLib.bat $(Platform) $(Configuration)</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|Win32'">
<ClCompile>
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level1</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Lib>
<OutputFile>$(OutDir)$(ProjectName)RAS.lib</OutputFile>
</Lib>
<PostBuildEvent>
<Command>StormLib.bat $(Platform) $(Configuration)</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|x64'">
<Midl>
<TargetEnvironment>X64</TargetEnvironment>
</Midl>
<ClCompile>
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level1</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Lib>
<OutputFile>$(OutDir)$(ProjectName)RAS.lib</OutputFile>
</Lib>
<PostBuildEvent>
<Command>StormLib.bat $(Platform) $(Configuration)</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemGroup>
<None Include="doc\History.txt" />
<None Include="doc\The MoPaQ File Format 0.9.txt" />
<None Include="doc\The MoPaQ File Format 1.0.txt" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="src\StormCommon.h" />
<ClInclude Include="src\StormLib.h" />
<ClInclude Include="src\StormPort.h" />
<ClInclude Include="src\adpcm\adpcm.h" />
<ClInclude Include="src\huffman\huff.h" />
<ClInclude Include="src\pklib\pklib.h" />
<ClInclude Include="src\sparse\sparse.h" />
<ClInclude Include="src\jenkins\lookup.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="src\FileStream.cpp">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|x64'">Level4</WarningLevel>
</ClCompile>
<ClCompile Include="src\SBaseCommon.cpp">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|x64'">Level4</WarningLevel>
</ClCompile>
<ClCompile Include="src\SBaseFileTable.cpp">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|x64'">Level4</WarningLevel>
</ClCompile>
<ClCompile Include="src\SCompression.cpp">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|x64'">Level4</WarningLevel>
</ClCompile>
<ClCompile Include="src\SFileAddFile.cpp">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|x64'">Level4</WarningLevel>
</ClCompile>
<ClCompile Include="src\SFileAttributes.cpp">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|x64'">Level4</WarningLevel>
</ClCompile>
<ClCompile Include="src\SFileCompactArchive.cpp">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|x64'">Level4</WarningLevel>
</ClCompile>
<ClCompile Include="src\SFileCreateArchive.cpp">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|x64'">Level4</WarningLevel>
</ClCompile>
<ClCompile Include="src\SFileExtractFile.cpp">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|x64'">Level4</WarningLevel>
</ClCompile>
<ClCompile Include="src\SFileFindFile.cpp">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|x64'">Level4</WarningLevel>
</ClCompile>
<ClCompile Include="src\SFileListFile.cpp">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|x64'">Level4</WarningLevel>
</ClCompile>
<ClCompile Include="src\SFileOpenArchive.cpp">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|x64'">Level4</WarningLevel>
</ClCompile>
<ClCompile Include="src\SFileOpenFileEx.cpp">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|x64'">Level4</WarningLevel>
</ClCompile>
<ClCompile Include="src\SFilePatchArchives.cpp" />
<ClCompile Include="src\SFileReadFile.cpp">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|x64'">Level4</WarningLevel>
</ClCompile>
<ClCompile Include="src\SFileVerify.cpp">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|x64'">Level4</WarningLevel>
</ClCompile>
<ClCompile Include="src\adpcm\adpcm.cpp" />
<ClCompile Include="src\bzip2\blocksort.c" />
<ClCompile Include="src\bzip2\bzlib.c" />
<ClCompile Include="src\bzip2\compress.c" />
<ClCompile Include="src\bzip2\crctable.c" />
<ClCompile Include="src\bzip2\decompress.c" />
<ClCompile Include="src\bzip2\huffman.c" />
<ClCompile Include="src\bzip2\randtable.c" />
<ClCompile Include="src\huffman\huff.cpp" />
<ClCompile Include="src\libtomcrypt\src\hashes\hash_memory.c" />
<ClCompile Include="src\libtomcrypt\src\hashes\md5.c" />
<ClCompile Include="src\libtomcrypt\src\hashes\sha1.c" />
<ClCompile Include="src\libtomcrypt\src\math\ltm_desc.c" />
<ClCompile Include="src\libtomcrypt\src\math\multi.c" />
<ClCompile Include="src\libtomcrypt\src\math\rand_prime.c" />
<ClCompile Include="src\libtomcrypt\src\misc\base64_decode.c" />
<ClCompile Include="src\libtomcrypt\src\misc\crypt_argchk.c" />
<ClCompile Include="src\libtomcrypt\src\misc\crypt_find_hash.c" />
<ClCompile Include="src\libtomcrypt\src\misc\crypt_find_prng.c" />
<ClCompile Include="src\libtomcrypt\src\misc\crypt_hash_descriptor.c" />
<ClCompile Include="src\libtomcrypt\src\misc\crypt_hash_is_valid.c" />
<ClCompile Include="src\libtomcrypt\src\misc\crypt_libc.c" />
<ClCompile Include="src\libtomcrypt\src\misc\crypt_ltc_mp_descriptor.c" />
<ClCompile Include="src\libtomcrypt\src\misc\crypt_prng_descriptor.c" />
<ClCompile Include="src\libtomcrypt\src\misc\crypt_prng_is_valid.c" />
<ClCompile Include="src\libtomcrypt\src\misc\crypt_register_hash.c" />
<ClCompile Include="src\libtomcrypt\src\misc\crypt_register_prng.c" />
<ClCompile Include="src\libtomcrypt\src\misc\zeromem.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_bit_string.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_boolean.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_choice.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_ia5_string.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_integer.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_object_identifier.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_octet_string.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_printable_string.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_sequence_ex.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_sequence_flexi.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_sequence_multi.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_short_integer.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_utctime.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_utf8_string.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_length_bit_string.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_length_boolean.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_length_ia5_string.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_length_integer.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_length_object_identifier.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_length_octet_string.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_length_printable_string.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_length_sequence.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_length_short_integer.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_length_utctime.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_length_utf8_string.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_sequence_free.c" />
<ClCompile Include="src\libtomcrypt\src\pk\ecc\ltc_ecc_map.c" />
<ClCompile Include="src\libtomcrypt\src\pk\ecc\ltc_ecc_mul2add.c" />
<ClCompile Include="src\libtomcrypt\src\pk\ecc\ltc_ecc_mulmod.c" />
<ClCompile Include="src\libtomcrypt\src\pk\ecc\ltc_ecc_points.c" />
<ClCompile Include="src\libtomcrypt\src\pk\ecc\ltc_ecc_projective_add_point.c" />
<ClCompile Include="src\libtomcrypt\src\pk\ecc\ltc_ecc_projective_dbl_point.c" />
<ClCompile Include="src\libtomcrypt\src\pk\pkcs1\pkcs_1_mgf1.c" />
<ClCompile Include="src\libtomcrypt\src\pk\pkcs1\pkcs_1_oaep_decode.c" />
<ClCompile Include="src\libtomcrypt\src\pk\pkcs1\pkcs_1_pss_decode.c" />
<ClCompile Include="src\libtomcrypt\src\pk\pkcs1\pkcs_1_v1_5_decode.c" />
<ClCompile Include="src\libtomcrypt\src\pk\rsa\rsa_exptmod.c" />
<ClCompile Include="src\libtomcrypt\src\pk\rsa\rsa_free.c" />
<ClCompile Include="src\libtomcrypt\src\pk\rsa\rsa_import.c" />
<ClCompile Include="src\libtomcrypt\src\pk\rsa\rsa_make_key.c" />
<ClCompile Include="src\libtomcrypt\src\pk\rsa\rsa_verify_hash.c" />
<ClCompile Include="src\libtomcrypt\src\pk\rsa\rsa_verify_simple.c" />
<ClCompile Include="src\libtommath\bn_fast_mp_invmod.c" />
<ClCompile Include="src\libtommath\bn_fast_mp_montgomery_reduce.c" />
<ClCompile Include="src\libtommath\bn_fast_s_mp_mul_digs.c" />
<ClCompile Include="src\libtommath\bn_fast_s_mp_mul_high_digs.c" />
<ClCompile Include="src\libtommath\bn_fast_s_mp_sqr.c" />
<ClCompile Include="src\libtommath\bn_mp_2expt.c" />
<ClCompile Include="src\libtommath\bn_mp_abs.c" />
<ClCompile Include="src\libtommath\bn_mp_add.c" />
<ClCompile Include="src\libtommath\bn_mp_add_d.c" />
<ClCompile Include="src\libtommath\bn_mp_addmod.c" />
<ClCompile Include="src\libtommath\bn_mp_and.c" />
<ClCompile Include="src\libtommath\bn_mp_clamp.c" />
<ClCompile Include="src\libtommath\bn_mp_clear.c" />
<ClCompile Include="src\libtommath\bn_mp_clear_multi.c" />
<ClCompile Include="src\libtommath\bn_mp_cmp.c" />
<ClCompile Include="src\libtommath\bn_mp_cmp_d.c" />
<ClCompile Include="src\libtommath\bn_mp_cmp_mag.c" />
<ClCompile Include="src\libtommath\bn_mp_cnt_lsb.c" />
<ClCompile Include="src\libtommath\bn_mp_copy.c" />
<ClCompile Include="src\libtommath\bn_mp_count_bits.c" />
<ClCompile Include="src\libtommath\bn_mp_div.c" />
<ClCompile Include="src\libtommath\bn_mp_div_2.c" />
<ClCompile Include="src\libtommath\bn_mp_div_2d.c" />
<ClCompile Include="src\libtommath\bn_mp_div_3.c" />
<ClCompile Include="src\libtommath\bn_mp_div_d.c" />
<ClCompile Include="src\libtommath\bn_mp_dr_is_modulus.c" />
<ClCompile Include="src\libtommath\bn_mp_dr_reduce.c" />
<ClCompile Include="src\libtommath\bn_mp_dr_setup.c" />
<ClCompile Include="src\libtommath\bn_mp_exch.c" />
<ClCompile Include="src\libtommath\bn_mp_expt_d.c" />
<ClCompile Include="src\libtommath\bn_mp_exptmod.c" />
<ClCompile Include="src\libtommath\bn_mp_exptmod_fast.c" />
<ClCompile Include="src\libtommath\bn_mp_exteuclid.c" />
<ClCompile Include="src\libtommath\bn_mp_fread.c" />
<ClCompile Include="src\libtommath\bn_mp_fwrite.c" />
<ClCompile Include="src\libtommath\bn_mp_gcd.c" />
<ClCompile Include="src\libtommath\bn_mp_get_int.c" />
<ClCompile Include="src\libtommath\bn_mp_grow.c" />
<ClCompile Include="src\libtommath\bn_mp_init.c" />
<ClCompile Include="src\libtommath\bn_mp_init_copy.c" />
<ClCompile Include="src\libtommath\bn_mp_init_multi.c" />
<ClCompile Include="src\libtommath\bn_mp_init_set.c" />
<ClCompile Include="src\libtommath\bn_mp_init_set_int.c" />
<ClCompile Include="src\libtommath\bn_mp_init_size.c" />
<ClCompile Include="src\libtommath\bn_mp_invmod.c" />
<ClCompile Include="src\libtommath\bn_mp_invmod_slow.c" />
<ClCompile Include="src\libtommath\bn_mp_is_square.c" />
<ClCompile Include="src\libtommath\bn_mp_jacobi.c" />
<ClCompile Include="src\libtommath\bn_mp_karatsuba_mul.c" />
<ClCompile Include="src\libtommath\bn_mp_karatsuba_sqr.c" />
<ClCompile Include="src\libtommath\bn_mp_lcm.c" />
<ClCompile Include="src\libtommath\bn_mp_lshd.c" />
<ClCompile Include="src\libtommath\bn_mp_mod.c" />
<ClCompile Include="src\libtommath\bn_mp_mod_2d.c" />
<ClCompile Include="src\libtommath\bn_mp_mod_d.c" />
<ClCompile Include="src\libtommath\bn_mp_montgomery_calc_normalization.c" />
<ClCompile Include="src\libtommath\bn_mp_montgomery_reduce.c" />
<ClCompile Include="src\libtommath\bn_mp_montgomery_setup.c" />
<ClCompile Include="src\libtommath\bn_mp_mul.c" />
<ClCompile Include="src\libtommath\bn_mp_mul_2.c" />
<ClCompile Include="src\libtommath\bn_mp_mul_2d.c" />
<ClCompile Include="src\libtommath\bn_mp_mul_d.c" />
<ClCompile Include="src\libtommath\bn_mp_mulmod.c" />
<ClCompile Include="src\libtommath\bn_mp_n_root.c" />
<ClCompile Include="src\libtommath\bn_mp_neg.c" />
<ClCompile Include="src\libtommath\bn_mp_or.c" />
<ClCompile Include="src\libtommath\bn_mp_prime_fermat.c" />
<ClCompile Include="src\libtommath\bn_mp_prime_is_divisible.c" />
<ClCompile Include="src\libtommath\bn_mp_prime_is_prime.c" />
<ClCompile Include="src\libtommath\bn_mp_prime_miller_rabin.c" />
<ClCompile Include="src\libtommath\bn_mp_prime_next_prime.c" />
<ClCompile Include="src\libtommath\bn_mp_prime_rabin_miller_trials.c" />
<ClCompile Include="src\libtommath\bn_mp_prime_random_ex.c" />
<ClCompile Include="src\libtommath\bn_mp_radix_size.c" />
<ClCompile Include="src\libtommath\bn_mp_radix_smap.c" />
<ClCompile Include="src\libtommath\bn_mp_rand.c" />
<ClCompile Include="src\libtommath\bn_mp_read_radix.c" />
<ClCompile Include="src\libtommath\bn_mp_read_signed_bin.c" />
<ClCompile Include="src\libtommath\bn_mp_read_unsigned_bin.c" />
<ClCompile Include="src\libtommath\bn_mp_reduce.c" />
<ClCompile Include="src\libtommath\bn_mp_reduce_2k.c" />
<ClCompile Include="src\libtommath\bn_mp_reduce_2k_l.c" />
<ClCompile Include="src\libtommath\bn_mp_reduce_2k_setup.c" />
<ClCompile Include="src\libtommath\bn_mp_reduce_2k_setup_l.c" />
<ClCompile Include="src\libtommath\bn_mp_reduce_is_2k.c" />
<ClCompile Include="src\libtommath\bn_mp_reduce_is_2k_l.c" />
<ClCompile Include="src\libtommath\bn_mp_reduce_setup.c" />
<ClCompile Include="src\libtommath\bn_mp_rshd.c" />
<ClCompile Include="src\libtommath\bn_mp_set.c" />
<ClCompile Include="src\libtommath\bn_mp_set_int.c" />
<ClCompile Include="src\libtommath\bn_mp_shrink.c" />
<ClCompile Include="src\libtommath\bn_mp_signed_bin_size.c" />
<ClCompile Include="src\libtommath\bn_mp_sqr.c" />
<ClCompile Include="src\libtommath\bn_mp_sqrmod.c" />
<ClCompile Include="src\libtommath\bn_mp_sqrt.c" />
<ClCompile Include="src\libtommath\bn_mp_sub.c" />
<ClCompile Include="src\libtommath\bn_mp_sub_d.c" />
<ClCompile Include="src\libtommath\bn_mp_submod.c" />
<ClCompile Include="src\libtommath\bn_mp_to_signed_bin.c" />
<ClCompile Include="src\libtommath\bn_mp_to_signed_bin_n.c" />
<ClCompile Include="src\libtommath\bn_mp_to_unsigned_bin.c" />
<ClCompile Include="src\libtommath\bn_mp_to_unsigned_bin_n.c" />
<ClCompile Include="src\libtommath\bn_mp_toom_mul.c" />
<ClCompile Include="src\libtommath\bn_mp_toom_sqr.c" />
<ClCompile Include="src\libtommath\bn_mp_toradix.c" />
<ClCompile Include="src\libtommath\bn_mp_toradix_n.c" />
<ClCompile Include="src\libtommath\bn_mp_unsigned_bin_size.c" />
<ClCompile Include="src\libtommath\bn_mp_xor.c" />
<ClCompile Include="src\libtommath\bn_mp_zero.c" />
<ClCompile Include="src\libtommath\bn_prime_tab.c" />
<ClCompile Include="src\libtommath\bn_reverse.c" />
<ClCompile Include="src\libtommath\bn_s_mp_add.c" />
<ClCompile Include="src\libtommath\bn_s_mp_exptmod.c" />
<ClCompile Include="src\libtommath\bn_s_mp_mul_digs.c" />
<ClCompile Include="src\libtommath\bn_s_mp_mul_high_digs.c" />
<ClCompile Include="src\libtommath\bn_s_mp_sqr.c" />
<ClCompile Include="src\libtommath\bn_s_mp_sub.c" />
<ClCompile Include="src\libtommath\bncore.c" />
<ClCompile Include="src\lzma\C\LzFind.c" />
<ClCompile Include="src\lzma\C\LzFindMt.c" />
<ClCompile Include="src\lzma\C\LzmaDec.c" />
<ClCompile Include="src\lzma\C\LzmaEnc.c" />
<ClCompile Include="src\lzma\C\Threads.c" />
<ClCompile Include="src\pklib\explode.c" />
<ClCompile Include="src\pklib\implode.c" />
<ClCompile Include="src\sparse\sparse.cpp" />
<ClCompile Include="src\zlib\adler32.c" />
<ClCompile Include="src\zlib\compress2.c" />
<ClCompile Include="src\zlib\crc32.c" />
<ClCompile Include="src\zlib\deflate.c" />
<ClCompile Include="src\zlib\inffast.c" />
<ClCompile Include="src\zlib\inflate.c" />
<ClCompile Include="src\zlib\inftrees.c" />
<ClCompile Include="src\zlib\trees.c" />
<ClCompile Include="src\zlib\zutil.c" />
<ClCompile Include="src\jenkins\lookup3.c" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View file

@ -1,773 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Doc Files">
<UniqueIdentifier>{effa28bb-96bc-4993-9585-b693f1b43fed}</UniqueIdentifier>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{7286f457-bd1b-48bb-a3db-f0578efc1599}</UniqueIdentifier>
</Filter>
<Filter Include="Source Files">
<UniqueIdentifier>{d600e869-3d0d-4e8c-a7a1-3d8e197a2221}</UniqueIdentifier>
</Filter>
<Filter Include="Source Files\adpcm">
<UniqueIdentifier>{ebdeaea5-c32f-45d5-8f90-3eaa095c6718}</UniqueIdentifier>
</Filter>
<Filter Include="Source Files\bzip2">
<UniqueIdentifier>{7dec5e6c-4b3a-4b2e-a101-be989834099d}</UniqueIdentifier>
</Filter>
<Filter Include="Source Files\huffman">
<UniqueIdentifier>{1bfbfc3e-5dc4-4b0c-854b-e89d6640a2fc}</UniqueIdentifier>
</Filter>
<Filter Include="Source Files\libtomcrypt">
<UniqueIdentifier>{47adf465-3887-4876-bf83-d37b4a985aaa}</UniqueIdentifier>
</Filter>
<Filter Include="Source Files\libtomcrypt\hashes">
<UniqueIdentifier>{790545bb-38f9-4912-bbe3-12df58f4baa5}</UniqueIdentifier>
</Filter>
<Filter Include="Source Files\libtomcrypt\math">
<UniqueIdentifier>{94bebdeb-9e41-4035-86f0-7f6ae11e2554}</UniqueIdentifier>
</Filter>
<Filter Include="Source Files\libtomcrypt\misc">
<UniqueIdentifier>{ede5853a-1e68-4ece-a685-92c8332c3f14}</UniqueIdentifier>
</Filter>
<Filter Include="Source Files\libtomcrypt\pk">
<UniqueIdentifier>{a51db59f-9173-4695-a630-f0cd4a681a01}</UniqueIdentifier>
</Filter>
<Filter Include="Source Files\libtomcrypt\pk\asn1">
<UniqueIdentifier>{c031a94e-2744-4a55-8816-ace1bf00100b}</UniqueIdentifier>
</Filter>
<Filter Include="Source Files\libtomcrypt\pk\ecc">
<UniqueIdentifier>{2f21719f-6b7b-4030-8ecf-3d78c206aeed}</UniqueIdentifier>
</Filter>
<Filter Include="Source Files\libtomcrypt\pk\pkcs1">
<UniqueIdentifier>{78e6bf7d-7caf-4e0f-a6fb-6b47a29829e2}</UniqueIdentifier>
</Filter>
<Filter Include="Source Files\libtomcrypt\pk\rsa">
<UniqueIdentifier>{cc4ee160-f0fc-4b20-b407-321a736eef53}</UniqueIdentifier>
</Filter>
<Filter Include="Source Files\libtommath">
<UniqueIdentifier>{6e6e1703-0f73-4c7f-8ec7-43e54dc41686}</UniqueIdentifier>
</Filter>
<Filter Include="Source Files\lzma">
<UniqueIdentifier>{1ca211be-0681-4c87-a79f-a0d642e712b4}</UniqueIdentifier>
</Filter>
<Filter Include="Source Files\pklib">
<UniqueIdentifier>{528999a0-8a83-4e92-8464-def8777926e9}</UniqueIdentifier>
</Filter>
<Filter Include="Source Files\sparse">
<UniqueIdentifier>{13b274dc-aaf6-464c-ab6a-ce8043d293d7}</UniqueIdentifier>
</Filter>
<Filter Include="Source Files\zlib">
<UniqueIdentifier>{4e915cd1-6776-4950-af15-16692935d179}</UniqueIdentifier>
</Filter>
<Filter Include="Source Files\jenkins">
<UniqueIdentifier>{9e077595-7d70-423c-90ce-aa5ec68eac06}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<None Include="doc\History.txt">
<Filter>Doc Files</Filter>
</None>
<None Include="doc\The MoPaQ File Format 0.9.txt">
<Filter>Doc Files</Filter>
</None>
<None Include="doc\The MoPaQ File Format 1.0.txt">
<Filter>Doc Files</Filter>
</None>
</ItemGroup>
<ItemGroup>
<ClInclude Include="src\StormCommon.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="src\StormLib.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="src\StormPort.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="src\adpcm\adpcm.h">
<Filter>Source Files\adpcm</Filter>
</ClInclude>
<ClInclude Include="src\huffman\huff.h">
<Filter>Source Files\huffman</Filter>
</ClInclude>
<ClInclude Include="src\pklib\pklib.h">
<Filter>Source Files\pklib</Filter>
</ClInclude>
<ClInclude Include="src\sparse\sparse.h">
<Filter>Source Files\sparse</Filter>
</ClInclude>
<ClInclude Include="src\jenkins\lookup.h">
<Filter>Source Files\jenkins</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="src\FileStream.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\SBaseCommon.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\SBaseFileTable.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\SCompression.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\SFileAddFile.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\SFileAttributes.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\SFileCompactArchive.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\SFileCreateArchive.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\SFileExtractFile.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\SFileFindFile.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\SFileListFile.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\SFileOpenArchive.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\SFileOpenFileEx.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\SFilePatchArchives.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\SFileReadFile.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\SFileVerify.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\adpcm\adpcm.cpp">
<Filter>Source Files\adpcm</Filter>
</ClCompile>
<ClCompile Include="src\bzip2\blocksort.c">
<Filter>Source Files\bzip2</Filter>
</ClCompile>
<ClCompile Include="src\bzip2\bzlib.c">
<Filter>Source Files\bzip2</Filter>
</ClCompile>
<ClCompile Include="src\bzip2\compress.c">
<Filter>Source Files\bzip2</Filter>
</ClCompile>
<ClCompile Include="src\bzip2\crctable.c">
<Filter>Source Files\bzip2</Filter>
</ClCompile>
<ClCompile Include="src\bzip2\decompress.c">
<Filter>Source Files\bzip2</Filter>
</ClCompile>
<ClCompile Include="src\bzip2\huffman.c">
<Filter>Source Files\bzip2</Filter>
</ClCompile>
<ClCompile Include="src\bzip2\randtable.c">
<Filter>Source Files\bzip2</Filter>
</ClCompile>
<ClCompile Include="src\huffman\huff.cpp">
<Filter>Source Files\huffman</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\hashes\hash_memory.c">
<Filter>Source Files\libtomcrypt\hashes</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\hashes\md5.c">
<Filter>Source Files\libtomcrypt\hashes</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\hashes\sha1.c">
<Filter>Source Files\libtomcrypt\hashes</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\math\ltm_desc.c">
<Filter>Source Files\libtomcrypt\math</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\math\multi.c">
<Filter>Source Files\libtomcrypt\math</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\math\rand_prime.c">
<Filter>Source Files\libtomcrypt\math</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\misc\base64_decode.c">
<Filter>Source Files\libtomcrypt\misc</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\misc\crypt_argchk.c">
<Filter>Source Files\libtomcrypt\misc</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\misc\crypt_find_hash.c">
<Filter>Source Files\libtomcrypt\misc</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\misc\crypt_find_prng.c">
<Filter>Source Files\libtomcrypt\misc</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\misc\crypt_hash_descriptor.c">
<Filter>Source Files\libtomcrypt\misc</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\misc\crypt_hash_is_valid.c">
<Filter>Source Files\libtomcrypt\misc</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\misc\crypt_libc.c">
<Filter>Source Files\libtomcrypt\misc</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\misc\crypt_ltc_mp_descriptor.c">
<Filter>Source Files\libtomcrypt\misc</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\misc\crypt_prng_descriptor.c">
<Filter>Source Files\libtomcrypt\misc</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\misc\crypt_prng_is_valid.c">
<Filter>Source Files\libtomcrypt\misc</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\misc\crypt_register_hash.c">
<Filter>Source Files\libtomcrypt\misc</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\misc\crypt_register_prng.c">
<Filter>Source Files\libtomcrypt\misc</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\misc\zeromem.c">
<Filter>Source Files\libtomcrypt\misc</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_bit_string.c">
<Filter>Source Files\libtomcrypt\pk\asn1</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_boolean.c">
<Filter>Source Files\libtomcrypt\pk\asn1</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_choice.c">
<Filter>Source Files\libtomcrypt\pk\asn1</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_ia5_string.c">
<Filter>Source Files\libtomcrypt\pk\asn1</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_integer.c">
<Filter>Source Files\libtomcrypt\pk\asn1</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_object_identifier.c">
<Filter>Source Files\libtomcrypt\pk\asn1</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_octet_string.c">
<Filter>Source Files\libtomcrypt\pk\asn1</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_printable_string.c">
<Filter>Source Files\libtomcrypt\pk\asn1</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_sequence_ex.c">
<Filter>Source Files\libtomcrypt\pk\asn1</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_sequence_flexi.c">
<Filter>Source Files\libtomcrypt\pk\asn1</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_sequence_multi.c">
<Filter>Source Files\libtomcrypt\pk\asn1</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_short_integer.c">
<Filter>Source Files\libtomcrypt\pk\asn1</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_utctime.c">
<Filter>Source Files\libtomcrypt\pk\asn1</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_utf8_string.c">
<Filter>Source Files\libtomcrypt\pk\asn1</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_length_bit_string.c">
<Filter>Source Files\libtomcrypt\pk\asn1</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_length_boolean.c">
<Filter>Source Files\libtomcrypt\pk\asn1</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_length_ia5_string.c">
<Filter>Source Files\libtomcrypt\pk\asn1</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_length_integer.c">
<Filter>Source Files\libtomcrypt\pk\asn1</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_length_object_identifier.c">
<Filter>Source Files\libtomcrypt\pk\asn1</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_length_octet_string.c">
<Filter>Source Files\libtomcrypt\pk\asn1</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_length_printable_string.c">
<Filter>Source Files\libtomcrypt\pk\asn1</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_length_sequence.c">
<Filter>Source Files\libtomcrypt\pk\asn1</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_length_short_integer.c">
<Filter>Source Files\libtomcrypt\pk\asn1</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_length_utctime.c">
<Filter>Source Files\libtomcrypt\pk\asn1</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_length_utf8_string.c">
<Filter>Source Files\libtomcrypt\pk\asn1</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_sequence_free.c">
<Filter>Source Files\libtomcrypt\pk\asn1</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\pk\ecc\ltc_ecc_map.c">
<Filter>Source Files\libtomcrypt\pk\ecc</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\pk\ecc\ltc_ecc_mul2add.c">
<Filter>Source Files\libtomcrypt\pk\ecc</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\pk\ecc\ltc_ecc_mulmod.c">
<Filter>Source Files\libtomcrypt\pk\ecc</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\pk\ecc\ltc_ecc_points.c">
<Filter>Source Files\libtomcrypt\pk\ecc</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\pk\ecc\ltc_ecc_projective_add_point.c">
<Filter>Source Files\libtomcrypt\pk\ecc</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\pk\ecc\ltc_ecc_projective_dbl_point.c">
<Filter>Source Files\libtomcrypt\pk\ecc</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\pk\pkcs1\pkcs_1_mgf1.c">
<Filter>Source Files\libtomcrypt\pk\pkcs1</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\pk\pkcs1\pkcs_1_oaep_decode.c">
<Filter>Source Files\libtomcrypt\pk\pkcs1</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\pk\pkcs1\pkcs_1_pss_decode.c">
<Filter>Source Files\libtomcrypt\pk\pkcs1</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\pk\pkcs1\pkcs_1_v1_5_decode.c">
<Filter>Source Files\libtomcrypt\pk\pkcs1</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\pk\rsa\rsa_exptmod.c">
<Filter>Source Files\libtomcrypt\pk\rsa</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\pk\rsa\rsa_free.c">
<Filter>Source Files\libtomcrypt\pk\rsa</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\pk\rsa\rsa_import.c">
<Filter>Source Files\libtomcrypt\pk\rsa</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\pk\rsa\rsa_make_key.c">
<Filter>Source Files\libtomcrypt\pk\rsa</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\pk\rsa\rsa_verify_hash.c">
<Filter>Source Files\libtomcrypt\pk\rsa</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\pk\rsa\rsa_verify_simple.c">
<Filter>Source Files\libtomcrypt\pk\rsa</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_fast_mp_invmod.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_fast_mp_montgomery_reduce.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_fast_s_mp_mul_digs.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_fast_s_mp_mul_high_digs.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_fast_s_mp_sqr.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_2expt.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_abs.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_add.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_add_d.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_addmod.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_and.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_clamp.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_clear.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_clear_multi.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_cmp.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_cmp_d.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_cmp_mag.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_cnt_lsb.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_copy.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_count_bits.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_div.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_div_2.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_div_2d.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_div_3.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_div_d.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_dr_is_modulus.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_dr_reduce.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_dr_setup.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_exch.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_expt_d.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_exptmod.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_exptmod_fast.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_exteuclid.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_fread.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_fwrite.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_gcd.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_get_int.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_grow.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_init.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_init_copy.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_init_multi.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_init_set.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_init_set_int.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_init_size.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_invmod.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_invmod_slow.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_is_square.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_jacobi.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_karatsuba_mul.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_karatsuba_sqr.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_lcm.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_lshd.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_mod.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_mod_2d.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_mod_d.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_montgomery_calc_normalization.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_montgomery_reduce.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_montgomery_setup.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_mul.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_mul_2.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_mul_2d.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_mul_d.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_mulmod.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_n_root.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_neg.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_or.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_prime_fermat.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_prime_is_divisible.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_prime_is_prime.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_prime_miller_rabin.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_prime_next_prime.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_prime_rabin_miller_trials.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_prime_random_ex.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_radix_size.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_radix_smap.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_rand.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_read_radix.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_read_signed_bin.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_read_unsigned_bin.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_reduce.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_reduce_2k.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_reduce_2k_l.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_reduce_2k_setup.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_reduce_2k_setup_l.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_reduce_is_2k.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_reduce_is_2k_l.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_reduce_setup.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_rshd.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_set.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_set_int.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_shrink.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_signed_bin_size.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_sqr.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_sqrmod.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_sqrt.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_sub.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_sub_d.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_submod.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_to_signed_bin.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_to_signed_bin_n.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_to_unsigned_bin.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_to_unsigned_bin_n.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_toom_mul.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_toom_sqr.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_toradix.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_toradix_n.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_unsigned_bin_size.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_xor.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_zero.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_prime_tab.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_reverse.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_s_mp_add.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_s_mp_exptmod.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_s_mp_mul_digs.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_s_mp_mul_high_digs.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_s_mp_sqr.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_s_mp_sub.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bncore.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\lzma\C\LzFind.c">
<Filter>Source Files\lzma</Filter>
</ClCompile>
<ClCompile Include="src\lzma\C\LzFindMt.c">
<Filter>Source Files\lzma</Filter>
</ClCompile>
<ClCompile Include="src\lzma\C\LzmaDec.c">
<Filter>Source Files\lzma</Filter>
</ClCompile>
<ClCompile Include="src\lzma\C\LzmaEnc.c">
<Filter>Source Files\lzma</Filter>
</ClCompile>
<ClCompile Include="src\lzma\C\Threads.c">
<Filter>Source Files\lzma</Filter>
</ClCompile>
<ClCompile Include="src\pklib\explode.c">
<Filter>Source Files\pklib</Filter>
</ClCompile>
<ClCompile Include="src\pklib\implode.c">
<Filter>Source Files\pklib</Filter>
</ClCompile>
<ClCompile Include="src\sparse\sparse.cpp">
<Filter>Source Files\sparse</Filter>
</ClCompile>
<ClCompile Include="src\zlib\adler32.c">
<Filter>Source Files\zlib</Filter>
</ClCompile>
<ClCompile Include="src\zlib\compress2.c">
<Filter>Source Files\zlib</Filter>
</ClCompile>
<ClCompile Include="src\zlib\crc32.c">
<Filter>Source Files\zlib</Filter>
</ClCompile>
<ClCompile Include="src\zlib\deflate.c">
<Filter>Source Files\zlib</Filter>
</ClCompile>
<ClCompile Include="src\zlib\inffast.c">
<Filter>Source Files\zlib</Filter>
</ClCompile>
<ClCompile Include="src\zlib\inflate.c">
<Filter>Source Files\zlib</Filter>
</ClCompile>
<ClCompile Include="src\zlib\inftrees.c">
<Filter>Source Files\zlib</Filter>
</ClCompile>
<ClCompile Include="src\zlib\trees.c">
<Filter>Source Files\zlib</Filter>
</ClCompile>
<ClCompile Include="src\zlib\zutil.c">
<Filter>Source Files\zlib</Filter>
</ClCompile>
<ClCompile Include="src\jenkins\lookup3.c">
<Filter>Source Files\jenkins</Filter>
</ClCompile>
</ItemGroup>
</Project>

File diff suppressed because it is too large Load diff

View file

@ -1,696 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="DebugAD|Win32">
<Configuration>DebugAD</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="DebugAD|x64">
<Configuration>DebugAD</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="DebugAS|Win32">
<Configuration>DebugAS</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="DebugAS|x64">
<Configuration>DebugAS</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="ReleaseAD|Win32">
<Configuration>ReleaseAD</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="ReleaseAD|x64">
<Configuration>ReleaseAD</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="ReleaseAS|Win32">
<Configuration>ReleaseAS</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="ReleaseAS|x64">
<Configuration>ReleaseAS</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectName>StormLib</ProjectName>
<ProjectGuid>{78424708-1F6E-4D4B-920C-FB6D26847055}</ProjectGuid>
<RootNamespace>StormLib</RootNamespace>
<Keyword>Win32Proj</Keyword>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v110</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v110</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugAS|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v110</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugAD|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v110</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v110</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v110</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugAS|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v110</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugAD|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v110</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugAS|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugAD|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugAS|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugAD|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>
<OutDir Condition="'$(Configuration)|$(Platform)'=='DebugAD|Win32'">./bin/$(ProjectName)/$(Platform)/$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='DebugAD|Win32'">./bin/$(ProjectName)/$(Platform)/$(Configuration)\</IntDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='DebugAD|x64'">./bin/$(ProjectName)/$(Platform)/$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='DebugAD|x64'">./bin/$(ProjectName)/$(Platform)/$(Configuration)\</IntDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='DebugAS|Win32'">./bin/$(ProjectName)/$(Platform)/$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='DebugAS|Win32'">./bin/$(ProjectName)/$(Platform)/$(Configuration)\</IntDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='DebugAS|x64'">./bin/$(ProjectName)/$(Platform)/$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='DebugAS|x64'">./bin/$(ProjectName)/$(Platform)/$(Configuration)\</IntDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|Win32'">./bin/$(ProjectName)/$(Platform)/$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|Win32'">./bin/$(ProjectName)/$(Platform)/$(Configuration)\</IntDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|x64'">./bin/$(ProjectName)/$(Platform)/$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|x64'">./bin/$(ProjectName)/$(Platform)/$(Configuration)\</IntDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|Win32'">./bin/$(ProjectName)/$(Platform)/$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|Win32'">./bin/$(ProjectName)/$(Platform)/$(Configuration)\</IntDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|x64'">./bin/$(ProjectName)/$(Platform)/$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|x64'">./bin/$(ProjectName)/$(Platform)/$(Configuration)\</IntDir>
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='DebugAD|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='DebugAD|Win32'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='DebugAD|Win32'" />
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='DebugAD|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='DebugAD|x64'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='DebugAD|x64'" />
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='DebugAS|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='DebugAS|Win32'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='DebugAS|Win32'" />
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='DebugAS|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='DebugAS|x64'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='DebugAS|x64'" />
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|Win32'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|Win32'" />
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|x64'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|x64'" />
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|Win32'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|Win32'" />
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|x64'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|x64'" />
<TargetName Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|Win32'">$(ProjectName)RAS</TargetName>
<TargetName Condition="'$(Configuration)|$(Platform)'=='DebugAD|Win32'">$(ProjectName)DAD</TargetName>
<TargetName Condition="'$(Configuration)|$(Platform)'=='DebugAS|Win32'">$(ProjectName)DAS</TargetName>
<TargetName Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|Win32'">$(ProjectName)RAD</TargetName>
<TargetName Condition="'$(Configuration)|$(Platform)'=='DebugAD|x64'">$(ProjectName)DAD</TargetName>
<TargetName Condition="'$(Configuration)|$(Platform)'=='DebugAS|x64'">$(ProjectName)DAS</TargetName>
<TargetName Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|x64'">$(ProjectName)RAD</TargetName>
<TargetName Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|x64'">$(ProjectName)RAS</TargetName>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugAD|Win32'">
<ClCompile>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>false</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level1</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Lib>
<OutputFile>$(OutDir)$(ProjectName)DAD.lib</OutputFile>
</Lib>
<PostBuildEvent>
<Command>StormLib.bat $(Platform) $(Configuration)</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugAD|x64'">
<Midl>
<TargetEnvironment>X64</TargetEnvironment>
</Midl>
<ClCompile>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>false</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level1</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Lib>
<OutputFile>$(OutDir)$(ProjectName)DAD.lib</OutputFile>
</Lib>
<PostBuildEvent>
<Command>StormLib.bat $(Platform) $(Configuration)</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugAS|Win32'">
<ClCompile>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>false</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level1</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Lib>
<OutputFile>$(OutDir)$(ProjectName)DAS.lib</OutputFile>
</Lib>
<PostBuildEvent>
<Command>StormLib.bat $(Platform) $(Configuration)</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugAS|x64'">
<Midl>
<TargetEnvironment>X64</TargetEnvironment>
</Midl>
<ClCompile>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>false</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level1</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Lib>
<OutputFile>$(OutDir)$(ProjectName)DAS.lib</OutputFile>
</Lib>
<PostBuildEvent>
<Command>StormLib.bat $(Platform) $(Configuration)</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|Win32'">
<ClCompile>
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level1</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Lib>
<OutputFile>$(OutDir)$(ProjectName)RAD.lib</OutputFile>
</Lib>
<PostBuildEvent>
<Command>StormLib.bat $(Platform) $(Configuration)</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|x64'">
<Midl>
<TargetEnvironment>X64</TargetEnvironment>
</Midl>
<ClCompile>
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level1</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Lib>
<OutputFile>$(OutDir)$(ProjectName)RAD.lib</OutputFile>
</Lib>
<PostBuildEvent>
<Command>StormLib.bat $(Platform) $(Configuration)</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|Win32'">
<ClCompile>
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level1</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Lib>
<OutputFile>$(OutDir)$(ProjectName)RAS.lib</OutputFile>
</Lib>
<PostBuildEvent>
<Command>StormLib.bat $(Platform) $(Configuration)</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|x64'">
<Midl>
<TargetEnvironment>X64</TargetEnvironment>
</Midl>
<ClCompile>
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level1</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Lib>
<OutputFile>$(OutDir)$(ProjectName)RAS.lib</OutputFile>
</Lib>
<PostBuildEvent>
<Command>StormLib.bat $(Platform) $(Configuration)</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemGroup>
<None Include="doc\History.txt" />
<None Include="doc\The MoPaQ File Format 0.9.txt" />
<None Include="doc\The MoPaQ File Format 1.0.txt" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="src\StormCommon.h" />
<ClInclude Include="src\StormLib.h" />
<ClInclude Include="src\StormPort.h" />
<ClInclude Include="src\adpcm\adpcm.h" />
<ClInclude Include="src\huffman\huff.h" />
<ClInclude Include="src\pklib\pklib.h" />
<ClInclude Include="src\sparse\sparse.h" />
<ClInclude Include="src\jenkins\lookup.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="src\FileStream.cpp">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|x64'">Level4</WarningLevel>
</ClCompile>
<ClCompile Include="src\SBaseCommon.cpp">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|x64'">Level4</WarningLevel>
</ClCompile>
<ClCompile Include="src\SBaseFileTable.cpp">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|x64'">Level4</WarningLevel>
</ClCompile>
<ClCompile Include="src\SCompression.cpp">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|x64'">Level4</WarningLevel>
</ClCompile>
<ClCompile Include="src\SFileAddFile.cpp">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|x64'">Level4</WarningLevel>
</ClCompile>
<ClCompile Include="src\SFileAttributes.cpp">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|x64'">Level4</WarningLevel>
</ClCompile>
<ClCompile Include="src\SFileCompactArchive.cpp">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|x64'">Level4</WarningLevel>
</ClCompile>
<ClCompile Include="src\SFileCreateArchive.cpp">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|x64'">Level4</WarningLevel>
</ClCompile>
<ClCompile Include="src\SFileExtractFile.cpp">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|x64'">Level4</WarningLevel>
</ClCompile>
<ClCompile Include="src\SFileFindFile.cpp">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|x64'">Level4</WarningLevel>
</ClCompile>
<ClCompile Include="src\SFileListFile.cpp">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|x64'">Level4</WarningLevel>
</ClCompile>
<ClCompile Include="src\SFileOpenArchive.cpp">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|x64'">Level4</WarningLevel>
</ClCompile>
<ClCompile Include="src\SFileOpenFileEx.cpp">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|x64'">Level4</WarningLevel>
</ClCompile>
<ClCompile Include="src\SFilePatchArchives.cpp" />
<ClCompile Include="src\SFileReadFile.cpp">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|x64'">Level4</WarningLevel>
</ClCompile>
<ClCompile Include="src\SFileVerify.cpp">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|x64'">Level4</WarningLevel>
</ClCompile>
<ClCompile Include="src\adpcm\adpcm.cpp" />
<ClCompile Include="src\bzip2\blocksort.c" />
<ClCompile Include="src\bzip2\bzlib.c" />
<ClCompile Include="src\bzip2\compress.c" />
<ClCompile Include="src\bzip2\crctable.c" />
<ClCompile Include="src\bzip2\decompress.c" />
<ClCompile Include="src\bzip2\huffman.c" />
<ClCompile Include="src\bzip2\randtable.c" />
<ClCompile Include="src\huffman\huff.cpp" />
<ClCompile Include="src\libtomcrypt\src\hashes\hash_memory.c" />
<ClCompile Include="src\libtomcrypt\src\hashes\md5.c" />
<ClCompile Include="src\libtomcrypt\src\hashes\sha1.c" />
<ClCompile Include="src\libtomcrypt\src\math\ltm_desc.c" />
<ClCompile Include="src\libtomcrypt\src\math\multi.c" />
<ClCompile Include="src\libtomcrypt\src\math\rand_prime.c" />
<ClCompile Include="src\libtomcrypt\src\misc\base64_decode.c" />
<ClCompile Include="src\libtomcrypt\src\misc\crypt_argchk.c" />
<ClCompile Include="src\libtomcrypt\src\misc\crypt_find_hash.c" />
<ClCompile Include="src\libtomcrypt\src\misc\crypt_find_prng.c" />
<ClCompile Include="src\libtomcrypt\src\misc\crypt_hash_descriptor.c" />
<ClCompile Include="src\libtomcrypt\src\misc\crypt_hash_is_valid.c" />
<ClCompile Include="src\libtomcrypt\src\misc\crypt_libc.c" />
<ClCompile Include="src\libtomcrypt\src\misc\crypt_ltc_mp_descriptor.c" />
<ClCompile Include="src\libtomcrypt\src\misc\crypt_prng_descriptor.c" />
<ClCompile Include="src\libtomcrypt\src\misc\crypt_prng_is_valid.c" />
<ClCompile Include="src\libtomcrypt\src\misc\crypt_register_hash.c" />
<ClCompile Include="src\libtomcrypt\src\misc\crypt_register_prng.c" />
<ClCompile Include="src\libtomcrypt\src\misc\zeromem.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_bit_string.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_boolean.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_choice.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_ia5_string.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_integer.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_object_identifier.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_octet_string.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_printable_string.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_sequence_ex.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_sequence_flexi.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_sequence_multi.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_short_integer.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_utctime.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_utf8_string.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_length_bit_string.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_length_boolean.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_length_ia5_string.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_length_integer.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_length_object_identifier.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_length_octet_string.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_length_printable_string.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_length_sequence.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_length_short_integer.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_length_utctime.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_length_utf8_string.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_sequence_free.c" />
<ClCompile Include="src\libtomcrypt\src\pk\ecc\ltc_ecc_map.c" />
<ClCompile Include="src\libtomcrypt\src\pk\ecc\ltc_ecc_mul2add.c" />
<ClCompile Include="src\libtomcrypt\src\pk\ecc\ltc_ecc_mulmod.c" />
<ClCompile Include="src\libtomcrypt\src\pk\ecc\ltc_ecc_points.c" />
<ClCompile Include="src\libtomcrypt\src\pk\ecc\ltc_ecc_projective_add_point.c" />
<ClCompile Include="src\libtomcrypt\src\pk\ecc\ltc_ecc_projective_dbl_point.c" />
<ClCompile Include="src\libtomcrypt\src\pk\pkcs1\pkcs_1_mgf1.c" />
<ClCompile Include="src\libtomcrypt\src\pk\pkcs1\pkcs_1_oaep_decode.c" />
<ClCompile Include="src\libtomcrypt\src\pk\pkcs1\pkcs_1_pss_decode.c" />
<ClCompile Include="src\libtomcrypt\src\pk\pkcs1\pkcs_1_v1_5_decode.c" />
<ClCompile Include="src\libtomcrypt\src\pk\rsa\rsa_exptmod.c" />
<ClCompile Include="src\libtomcrypt\src\pk\rsa\rsa_free.c" />
<ClCompile Include="src\libtomcrypt\src\pk\rsa\rsa_import.c" />
<ClCompile Include="src\libtomcrypt\src\pk\rsa\rsa_make_key.c" />
<ClCompile Include="src\libtomcrypt\src\pk\rsa\rsa_verify_hash.c" />
<ClCompile Include="src\libtomcrypt\src\pk\rsa\rsa_verify_simple.c" />
<ClCompile Include="src\libtommath\bn_fast_mp_invmod.c" />
<ClCompile Include="src\libtommath\bn_fast_mp_montgomery_reduce.c" />
<ClCompile Include="src\libtommath\bn_fast_s_mp_mul_digs.c" />
<ClCompile Include="src\libtommath\bn_fast_s_mp_mul_high_digs.c" />
<ClCompile Include="src\libtommath\bn_fast_s_mp_sqr.c" />
<ClCompile Include="src\libtommath\bn_mp_2expt.c" />
<ClCompile Include="src\libtommath\bn_mp_abs.c" />
<ClCompile Include="src\libtommath\bn_mp_add.c" />
<ClCompile Include="src\libtommath\bn_mp_add_d.c" />
<ClCompile Include="src\libtommath\bn_mp_addmod.c" />
<ClCompile Include="src\libtommath\bn_mp_and.c" />
<ClCompile Include="src\libtommath\bn_mp_clamp.c" />
<ClCompile Include="src\libtommath\bn_mp_clear.c" />
<ClCompile Include="src\libtommath\bn_mp_clear_multi.c" />
<ClCompile Include="src\libtommath\bn_mp_cmp.c" />
<ClCompile Include="src\libtommath\bn_mp_cmp_d.c" />
<ClCompile Include="src\libtommath\bn_mp_cmp_mag.c" />
<ClCompile Include="src\libtommath\bn_mp_cnt_lsb.c" />
<ClCompile Include="src\libtommath\bn_mp_copy.c" />
<ClCompile Include="src\libtommath\bn_mp_count_bits.c" />
<ClCompile Include="src\libtommath\bn_mp_div.c" />
<ClCompile Include="src\libtommath\bn_mp_div_2.c" />
<ClCompile Include="src\libtommath\bn_mp_div_2d.c" />
<ClCompile Include="src\libtommath\bn_mp_div_3.c" />
<ClCompile Include="src\libtommath\bn_mp_div_d.c" />
<ClCompile Include="src\libtommath\bn_mp_dr_is_modulus.c" />
<ClCompile Include="src\libtommath\bn_mp_dr_reduce.c" />
<ClCompile Include="src\libtommath\bn_mp_dr_setup.c" />
<ClCompile Include="src\libtommath\bn_mp_exch.c" />
<ClCompile Include="src\libtommath\bn_mp_expt_d.c" />
<ClCompile Include="src\libtommath\bn_mp_exptmod.c" />
<ClCompile Include="src\libtommath\bn_mp_exptmod_fast.c" />
<ClCompile Include="src\libtommath\bn_mp_exteuclid.c" />
<ClCompile Include="src\libtommath\bn_mp_fread.c" />
<ClCompile Include="src\libtommath\bn_mp_fwrite.c" />
<ClCompile Include="src\libtommath\bn_mp_gcd.c" />
<ClCompile Include="src\libtommath\bn_mp_get_int.c" />
<ClCompile Include="src\libtommath\bn_mp_grow.c" />
<ClCompile Include="src\libtommath\bn_mp_init.c" />
<ClCompile Include="src\libtommath\bn_mp_init_copy.c" />
<ClCompile Include="src\libtommath\bn_mp_init_multi.c" />
<ClCompile Include="src\libtommath\bn_mp_init_set.c" />
<ClCompile Include="src\libtommath\bn_mp_init_set_int.c" />
<ClCompile Include="src\libtommath\bn_mp_init_size.c" />
<ClCompile Include="src\libtommath\bn_mp_invmod.c" />
<ClCompile Include="src\libtommath\bn_mp_invmod_slow.c" />
<ClCompile Include="src\libtommath\bn_mp_is_square.c" />
<ClCompile Include="src\libtommath\bn_mp_jacobi.c" />
<ClCompile Include="src\libtommath\bn_mp_karatsuba_mul.c" />
<ClCompile Include="src\libtommath\bn_mp_karatsuba_sqr.c" />
<ClCompile Include="src\libtommath\bn_mp_lcm.c" />
<ClCompile Include="src\libtommath\bn_mp_lshd.c" />
<ClCompile Include="src\libtommath\bn_mp_mod.c" />
<ClCompile Include="src\libtommath\bn_mp_mod_2d.c" />
<ClCompile Include="src\libtommath\bn_mp_mod_d.c" />
<ClCompile Include="src\libtommath\bn_mp_montgomery_calc_normalization.c" />
<ClCompile Include="src\libtommath\bn_mp_montgomery_reduce.c" />
<ClCompile Include="src\libtommath\bn_mp_montgomery_setup.c" />
<ClCompile Include="src\libtommath\bn_mp_mul.c" />
<ClCompile Include="src\libtommath\bn_mp_mul_2.c" />
<ClCompile Include="src\libtommath\bn_mp_mul_2d.c" />
<ClCompile Include="src\libtommath\bn_mp_mul_d.c" />
<ClCompile Include="src\libtommath\bn_mp_mulmod.c" />
<ClCompile Include="src\libtommath\bn_mp_n_root.c" />
<ClCompile Include="src\libtommath\bn_mp_neg.c" />
<ClCompile Include="src\libtommath\bn_mp_or.c" />
<ClCompile Include="src\libtommath\bn_mp_prime_fermat.c" />
<ClCompile Include="src\libtommath\bn_mp_prime_is_divisible.c" />
<ClCompile Include="src\libtommath\bn_mp_prime_is_prime.c" />
<ClCompile Include="src\libtommath\bn_mp_prime_miller_rabin.c" />
<ClCompile Include="src\libtommath\bn_mp_prime_next_prime.c" />
<ClCompile Include="src\libtommath\bn_mp_prime_rabin_miller_trials.c" />
<ClCompile Include="src\libtommath\bn_mp_prime_random_ex.c" />
<ClCompile Include="src\libtommath\bn_mp_radix_size.c" />
<ClCompile Include="src\libtommath\bn_mp_radix_smap.c" />
<ClCompile Include="src\libtommath\bn_mp_rand.c" />
<ClCompile Include="src\libtommath\bn_mp_read_radix.c" />
<ClCompile Include="src\libtommath\bn_mp_read_signed_bin.c" />
<ClCompile Include="src\libtommath\bn_mp_read_unsigned_bin.c" />
<ClCompile Include="src\libtommath\bn_mp_reduce.c" />
<ClCompile Include="src\libtommath\bn_mp_reduce_2k.c" />
<ClCompile Include="src\libtommath\bn_mp_reduce_2k_l.c" />
<ClCompile Include="src\libtommath\bn_mp_reduce_2k_setup.c" />
<ClCompile Include="src\libtommath\bn_mp_reduce_2k_setup_l.c" />
<ClCompile Include="src\libtommath\bn_mp_reduce_is_2k.c" />
<ClCompile Include="src\libtommath\bn_mp_reduce_is_2k_l.c" />
<ClCompile Include="src\libtommath\bn_mp_reduce_setup.c" />
<ClCompile Include="src\libtommath\bn_mp_rshd.c" />
<ClCompile Include="src\libtommath\bn_mp_set.c" />
<ClCompile Include="src\libtommath\bn_mp_set_int.c" />
<ClCompile Include="src\libtommath\bn_mp_shrink.c" />
<ClCompile Include="src\libtommath\bn_mp_signed_bin_size.c" />
<ClCompile Include="src\libtommath\bn_mp_sqr.c" />
<ClCompile Include="src\libtommath\bn_mp_sqrmod.c" />
<ClCompile Include="src\libtommath\bn_mp_sqrt.c" />
<ClCompile Include="src\libtommath\bn_mp_sub.c" />
<ClCompile Include="src\libtommath\bn_mp_sub_d.c" />
<ClCompile Include="src\libtommath\bn_mp_submod.c" />
<ClCompile Include="src\libtommath\bn_mp_to_signed_bin.c" />
<ClCompile Include="src\libtommath\bn_mp_to_signed_bin_n.c" />
<ClCompile Include="src\libtommath\bn_mp_to_unsigned_bin.c" />
<ClCompile Include="src\libtommath\bn_mp_to_unsigned_bin_n.c" />
<ClCompile Include="src\libtommath\bn_mp_toom_mul.c" />
<ClCompile Include="src\libtommath\bn_mp_toom_sqr.c" />
<ClCompile Include="src\libtommath\bn_mp_toradix.c" />
<ClCompile Include="src\libtommath\bn_mp_toradix_n.c" />
<ClCompile Include="src\libtommath\bn_mp_unsigned_bin_size.c" />
<ClCompile Include="src\libtommath\bn_mp_xor.c" />
<ClCompile Include="src\libtommath\bn_mp_zero.c" />
<ClCompile Include="src\libtommath\bn_prime_tab.c" />
<ClCompile Include="src\libtommath\bn_reverse.c" />
<ClCompile Include="src\libtommath\bn_s_mp_add.c" />
<ClCompile Include="src\libtommath\bn_s_mp_exptmod.c" />
<ClCompile Include="src\libtommath\bn_s_mp_mul_digs.c" />
<ClCompile Include="src\libtommath\bn_s_mp_mul_high_digs.c" />
<ClCompile Include="src\libtommath\bn_s_mp_sqr.c" />
<ClCompile Include="src\libtommath\bn_s_mp_sub.c" />
<ClCompile Include="src\libtommath\bncore.c" />
<ClCompile Include="src\lzma\C\LzFind.c" />
<ClCompile Include="src\lzma\C\LzFindMt.c" />
<ClCompile Include="src\lzma\C\LzmaDec.c" />
<ClCompile Include="src\lzma\C\LzmaEnc.c" />
<ClCompile Include="src\lzma\C\Threads.c" />
<ClCompile Include="src\pklib\explode.c" />
<ClCompile Include="src\pklib\implode.c" />
<ClCompile Include="src\sparse\sparse.cpp" />
<ClCompile Include="src\zlib\adler32.c" />
<ClCompile Include="src\zlib\compress2.c" />
<ClCompile Include="src\zlib\crc32.c" />
<ClCompile Include="src\zlib\deflate.c" />
<ClCompile Include="src\zlib\inffast.c" />
<ClCompile Include="src\zlib\inflate.c" />
<ClCompile Include="src\zlib\inftrees.c" />
<ClCompile Include="src\zlib\trees.c" />
<ClCompile Include="src\zlib\zutil.c" />
<ClCompile Include="src\jenkins\lookup3.c" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View file

@ -1,696 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="DebugAD|Win32">
<Configuration>DebugAD</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="DebugAD|x64">
<Configuration>DebugAD</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="DebugAS|Win32">
<Configuration>DebugAS</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="DebugAS|x64">
<Configuration>DebugAS</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="ReleaseAD|Win32">
<Configuration>ReleaseAD</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="ReleaseAD|x64">
<Configuration>ReleaseAD</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="ReleaseAS|Win32">
<Configuration>ReleaseAS</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="ReleaseAS|x64">
<Configuration>ReleaseAS</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectName>StormLib</ProjectName>
<ProjectGuid>{78424708-1F6E-4D4B-920C-FB6D26847055}</ProjectGuid>
<RootNamespace>StormLib</RootNamespace>
<Keyword>Win32Proj</Keyword>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v110</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v110</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugAS|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v110</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugAD|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v110</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v110</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v110</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugAS|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v110</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugAD|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v110</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugAS|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugAD|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugAS|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugAD|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>
<OutDir Condition="'$(Configuration)|$(Platform)'=='DebugAD|Win32'">./bin/$(ProjectName)/$(Platform)/$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='DebugAD|Win32'">./bin/$(ProjectName)/$(Platform)/$(Configuration)\</IntDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='DebugAD|x64'">./bin/$(ProjectName)/$(Platform)/$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='DebugAD|x64'">./bin/$(ProjectName)/$(Platform)/$(Configuration)\</IntDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='DebugAS|Win32'">./bin/$(ProjectName)/$(Platform)/$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='DebugAS|Win32'">./bin/$(ProjectName)/$(Platform)/$(Configuration)\</IntDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='DebugAS|x64'">./bin/$(ProjectName)/$(Platform)/$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='DebugAS|x64'">./bin/$(ProjectName)/$(Platform)/$(Configuration)\</IntDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|Win32'">./bin/$(ProjectName)/$(Platform)/$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|Win32'">./bin/$(ProjectName)/$(Platform)/$(Configuration)\</IntDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|x64'">./bin/$(ProjectName)/$(Platform)/$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|x64'">./bin/$(ProjectName)/$(Platform)/$(Configuration)\</IntDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|Win32'">./bin/$(ProjectName)/$(Platform)/$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|Win32'">./bin/$(ProjectName)/$(Platform)/$(Configuration)\</IntDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|x64'">./bin/$(ProjectName)/$(Platform)/$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|x64'">./bin/$(ProjectName)/$(Platform)/$(Configuration)\</IntDir>
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='DebugAD|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='DebugAD|Win32'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='DebugAD|Win32'" />
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='DebugAD|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='DebugAD|x64'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='DebugAD|x64'" />
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='DebugAS|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='DebugAS|Win32'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='DebugAS|Win32'" />
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='DebugAS|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='DebugAS|x64'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='DebugAS|x64'" />
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|Win32'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|Win32'" />
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|x64'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|x64'" />
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|Win32'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|Win32'" />
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|x64'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|x64'" />
<TargetName Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|Win32'">$(ProjectName)RAS</TargetName>
<TargetName Condition="'$(Configuration)|$(Platform)'=='DebugAD|Win32'">$(ProjectName)DAD</TargetName>
<TargetName Condition="'$(Configuration)|$(Platform)'=='DebugAS|Win32'">$(ProjectName)DAS</TargetName>
<TargetName Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|Win32'">$(ProjectName)RAD</TargetName>
<TargetName Condition="'$(Configuration)|$(Platform)'=='DebugAD|x64'">$(ProjectName)DAD</TargetName>
<TargetName Condition="'$(Configuration)|$(Platform)'=='DebugAS|x64'">$(ProjectName)DAS</TargetName>
<TargetName Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|x64'">$(ProjectName)RAD</TargetName>
<TargetName Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|x64'">$(ProjectName)RAS</TargetName>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugAD|Win32'">
<ClCompile>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>false</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level1</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Lib>
<OutputFile>$(OutDir)$(ProjectName)DAD.lib</OutputFile>
</Lib>
<PostBuildEvent>
<Command>StormLib.bat $(Platform) $(Configuration)</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugAD|x64'">
<Midl>
<TargetEnvironment>X64</TargetEnvironment>
</Midl>
<ClCompile>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>false</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level1</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Lib>
<OutputFile>$(OutDir)$(ProjectName)DAD.lib</OutputFile>
</Lib>
<PostBuildEvent>
<Command>StormLib.bat $(Platform) $(Configuration)</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugAS|Win32'">
<ClCompile>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>false</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level1</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Lib>
<OutputFile>$(OutDir)$(ProjectName)DAS.lib</OutputFile>
</Lib>
<PostBuildEvent>
<Command>StormLib.bat $(Platform) $(Configuration)</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugAS|x64'">
<Midl>
<TargetEnvironment>X64</TargetEnvironment>
</Midl>
<ClCompile>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>false</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level1</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Lib>
<OutputFile>$(OutDir)$(ProjectName)DAS.lib</OutputFile>
</Lib>
<PostBuildEvent>
<Command>StormLib.bat $(Platform) $(Configuration)</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|Win32'">
<ClCompile>
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level1</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Lib>
<OutputFile>$(OutDir)$(ProjectName)RAD.lib</OutputFile>
</Lib>
<PostBuildEvent>
<Command>StormLib.bat $(Platform) $(Configuration)</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|x64'">
<Midl>
<TargetEnvironment>X64</TargetEnvironment>
</Midl>
<ClCompile>
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level1</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Lib>
<OutputFile>$(OutDir)$(ProjectName)RAD.lib</OutputFile>
</Lib>
<PostBuildEvent>
<Command>StormLib.bat $(Platform) $(Configuration)</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|Win32'">
<ClCompile>
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level1</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Lib>
<OutputFile>$(OutDir)$(ProjectName)RAS.lib</OutputFile>
</Lib>
<PostBuildEvent>
<Command>StormLib.bat $(Platform) $(Configuration)</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|x64'">
<Midl>
<TargetEnvironment>X64</TargetEnvironment>
</Midl>
<ClCompile>
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level1</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Lib>
<OutputFile>$(OutDir)$(ProjectName)RAS.lib</OutputFile>
</Lib>
<PostBuildEvent>
<Command>StormLib.bat $(Platform) $(Configuration)</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemGroup>
<None Include="doc\History.txt" />
<None Include="doc\The MoPaQ File Format 0.9.txt" />
<None Include="doc\The MoPaQ File Format 1.0.txt" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="src\StormCommon.h" />
<ClInclude Include="src\StormLib.h" />
<ClInclude Include="src\StormPort.h" />
<ClInclude Include="src\adpcm\adpcm.h" />
<ClInclude Include="src\huffman\huff.h" />
<ClInclude Include="src\pklib\pklib.h" />
<ClInclude Include="src\sparse\sparse.h" />
<ClInclude Include="src\jenkins\lookup.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="src\FileStream.cpp">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|x64'">Level4</WarningLevel>
</ClCompile>
<ClCompile Include="src\SBaseCommon.cpp">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|x64'">Level4</WarningLevel>
</ClCompile>
<ClCompile Include="src\SBaseFileTable.cpp">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|x64'">Level4</WarningLevel>
</ClCompile>
<ClCompile Include="src\SCompression.cpp">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|x64'">Level4</WarningLevel>
</ClCompile>
<ClCompile Include="src\SFileAddFile.cpp">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|x64'">Level4</WarningLevel>
</ClCompile>
<ClCompile Include="src\SFileAttributes.cpp">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|x64'">Level4</WarningLevel>
</ClCompile>
<ClCompile Include="src\SFileCompactArchive.cpp">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|x64'">Level4</WarningLevel>
</ClCompile>
<ClCompile Include="src\SFileCreateArchive.cpp">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|x64'">Level4</WarningLevel>
</ClCompile>
<ClCompile Include="src\SFileExtractFile.cpp">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|x64'">Level4</WarningLevel>
</ClCompile>
<ClCompile Include="src\SFileFindFile.cpp">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|x64'">Level4</WarningLevel>
</ClCompile>
<ClCompile Include="src\SFileListFile.cpp">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|x64'">Level4</WarningLevel>
</ClCompile>
<ClCompile Include="src\SFileOpenArchive.cpp">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|x64'">Level4</WarningLevel>
</ClCompile>
<ClCompile Include="src\SFileOpenFileEx.cpp">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|x64'">Level4</WarningLevel>
</ClCompile>
<ClCompile Include="src\SFilePatchArchives.cpp" />
<ClCompile Include="src\SFileReadFile.cpp">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|x64'">Level4</WarningLevel>
</ClCompile>
<ClCompile Include="src\SFileVerify.cpp">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|x64'">Level4</WarningLevel>
</ClCompile>
<ClCompile Include="src\adpcm\adpcm.cpp" />
<ClCompile Include="src\bzip2\blocksort.c" />
<ClCompile Include="src\bzip2\bzlib.c" />
<ClCompile Include="src\bzip2\compress.c" />
<ClCompile Include="src\bzip2\crctable.c" />
<ClCompile Include="src\bzip2\decompress.c" />
<ClCompile Include="src\bzip2\huffman.c" />
<ClCompile Include="src\bzip2\randtable.c" />
<ClCompile Include="src\huffman\huff.cpp" />
<ClCompile Include="src\libtomcrypt\src\hashes\hash_memory.c" />
<ClCompile Include="src\libtomcrypt\src\hashes\md5.c" />
<ClCompile Include="src\libtomcrypt\src\hashes\sha1.c" />
<ClCompile Include="src\libtomcrypt\src\math\ltm_desc.c" />
<ClCompile Include="src\libtomcrypt\src\math\multi.c" />
<ClCompile Include="src\libtomcrypt\src\math\rand_prime.c" />
<ClCompile Include="src\libtomcrypt\src\misc\base64_decode.c" />
<ClCompile Include="src\libtomcrypt\src\misc\crypt_argchk.c" />
<ClCompile Include="src\libtomcrypt\src\misc\crypt_find_hash.c" />
<ClCompile Include="src\libtomcrypt\src\misc\crypt_find_prng.c" />
<ClCompile Include="src\libtomcrypt\src\misc\crypt_hash_descriptor.c" />
<ClCompile Include="src\libtomcrypt\src\misc\crypt_hash_is_valid.c" />
<ClCompile Include="src\libtomcrypt\src\misc\crypt_libc.c" />
<ClCompile Include="src\libtomcrypt\src\misc\crypt_ltc_mp_descriptor.c" />
<ClCompile Include="src\libtomcrypt\src\misc\crypt_prng_descriptor.c" />
<ClCompile Include="src\libtomcrypt\src\misc\crypt_prng_is_valid.c" />
<ClCompile Include="src\libtomcrypt\src\misc\crypt_register_hash.c" />
<ClCompile Include="src\libtomcrypt\src\misc\crypt_register_prng.c" />
<ClCompile Include="src\libtomcrypt\src\misc\zeromem.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_bit_string.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_boolean.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_choice.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_ia5_string.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_integer.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_object_identifier.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_octet_string.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_printable_string.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_sequence_ex.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_sequence_flexi.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_sequence_multi.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_short_integer.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_utctime.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_utf8_string.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_length_bit_string.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_length_boolean.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_length_ia5_string.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_length_integer.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_length_object_identifier.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_length_octet_string.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_length_printable_string.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_length_sequence.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_length_short_integer.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_length_utctime.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_length_utf8_string.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_sequence_free.c" />
<ClCompile Include="src\libtomcrypt\src\pk\ecc\ltc_ecc_map.c" />
<ClCompile Include="src\libtomcrypt\src\pk\ecc\ltc_ecc_mul2add.c" />
<ClCompile Include="src\libtomcrypt\src\pk\ecc\ltc_ecc_mulmod.c" />
<ClCompile Include="src\libtomcrypt\src\pk\ecc\ltc_ecc_points.c" />
<ClCompile Include="src\libtomcrypt\src\pk\ecc\ltc_ecc_projective_add_point.c" />
<ClCompile Include="src\libtomcrypt\src\pk\ecc\ltc_ecc_projective_dbl_point.c" />
<ClCompile Include="src\libtomcrypt\src\pk\pkcs1\pkcs_1_mgf1.c" />
<ClCompile Include="src\libtomcrypt\src\pk\pkcs1\pkcs_1_oaep_decode.c" />
<ClCompile Include="src\libtomcrypt\src\pk\pkcs1\pkcs_1_pss_decode.c" />
<ClCompile Include="src\libtomcrypt\src\pk\pkcs1\pkcs_1_v1_5_decode.c" />
<ClCompile Include="src\libtomcrypt\src\pk\rsa\rsa_exptmod.c" />
<ClCompile Include="src\libtomcrypt\src\pk\rsa\rsa_free.c" />
<ClCompile Include="src\libtomcrypt\src\pk\rsa\rsa_import.c" />
<ClCompile Include="src\libtomcrypt\src\pk\rsa\rsa_make_key.c" />
<ClCompile Include="src\libtomcrypt\src\pk\rsa\rsa_verify_hash.c" />
<ClCompile Include="src\libtomcrypt\src\pk\rsa\rsa_verify_simple.c" />
<ClCompile Include="src\libtommath\bn_fast_mp_invmod.c" />
<ClCompile Include="src\libtommath\bn_fast_mp_montgomery_reduce.c" />
<ClCompile Include="src\libtommath\bn_fast_s_mp_mul_digs.c" />
<ClCompile Include="src\libtommath\bn_fast_s_mp_mul_high_digs.c" />
<ClCompile Include="src\libtommath\bn_fast_s_mp_sqr.c" />
<ClCompile Include="src\libtommath\bn_mp_2expt.c" />
<ClCompile Include="src\libtommath\bn_mp_abs.c" />
<ClCompile Include="src\libtommath\bn_mp_add.c" />
<ClCompile Include="src\libtommath\bn_mp_add_d.c" />
<ClCompile Include="src\libtommath\bn_mp_addmod.c" />
<ClCompile Include="src\libtommath\bn_mp_and.c" />
<ClCompile Include="src\libtommath\bn_mp_clamp.c" />
<ClCompile Include="src\libtommath\bn_mp_clear.c" />
<ClCompile Include="src\libtommath\bn_mp_clear_multi.c" />
<ClCompile Include="src\libtommath\bn_mp_cmp.c" />
<ClCompile Include="src\libtommath\bn_mp_cmp_d.c" />
<ClCompile Include="src\libtommath\bn_mp_cmp_mag.c" />
<ClCompile Include="src\libtommath\bn_mp_cnt_lsb.c" />
<ClCompile Include="src\libtommath\bn_mp_copy.c" />
<ClCompile Include="src\libtommath\bn_mp_count_bits.c" />
<ClCompile Include="src\libtommath\bn_mp_div.c" />
<ClCompile Include="src\libtommath\bn_mp_div_2.c" />
<ClCompile Include="src\libtommath\bn_mp_div_2d.c" />
<ClCompile Include="src\libtommath\bn_mp_div_3.c" />
<ClCompile Include="src\libtommath\bn_mp_div_d.c" />
<ClCompile Include="src\libtommath\bn_mp_dr_is_modulus.c" />
<ClCompile Include="src\libtommath\bn_mp_dr_reduce.c" />
<ClCompile Include="src\libtommath\bn_mp_dr_setup.c" />
<ClCompile Include="src\libtommath\bn_mp_exch.c" />
<ClCompile Include="src\libtommath\bn_mp_expt_d.c" />
<ClCompile Include="src\libtommath\bn_mp_exptmod.c" />
<ClCompile Include="src\libtommath\bn_mp_exptmod_fast.c" />
<ClCompile Include="src\libtommath\bn_mp_exteuclid.c" />
<ClCompile Include="src\libtommath\bn_mp_fread.c" />
<ClCompile Include="src\libtommath\bn_mp_fwrite.c" />
<ClCompile Include="src\libtommath\bn_mp_gcd.c" />
<ClCompile Include="src\libtommath\bn_mp_get_int.c" />
<ClCompile Include="src\libtommath\bn_mp_grow.c" />
<ClCompile Include="src\libtommath\bn_mp_init.c" />
<ClCompile Include="src\libtommath\bn_mp_init_copy.c" />
<ClCompile Include="src\libtommath\bn_mp_init_multi.c" />
<ClCompile Include="src\libtommath\bn_mp_init_set.c" />
<ClCompile Include="src\libtommath\bn_mp_init_set_int.c" />
<ClCompile Include="src\libtommath\bn_mp_init_size.c" />
<ClCompile Include="src\libtommath\bn_mp_invmod.c" />
<ClCompile Include="src\libtommath\bn_mp_invmod_slow.c" />
<ClCompile Include="src\libtommath\bn_mp_is_square.c" />
<ClCompile Include="src\libtommath\bn_mp_jacobi.c" />
<ClCompile Include="src\libtommath\bn_mp_karatsuba_mul.c" />
<ClCompile Include="src\libtommath\bn_mp_karatsuba_sqr.c" />
<ClCompile Include="src\libtommath\bn_mp_lcm.c" />
<ClCompile Include="src\libtommath\bn_mp_lshd.c" />
<ClCompile Include="src\libtommath\bn_mp_mod.c" />
<ClCompile Include="src\libtommath\bn_mp_mod_2d.c" />
<ClCompile Include="src\libtommath\bn_mp_mod_d.c" />
<ClCompile Include="src\libtommath\bn_mp_montgomery_calc_normalization.c" />
<ClCompile Include="src\libtommath\bn_mp_montgomery_reduce.c" />
<ClCompile Include="src\libtommath\bn_mp_montgomery_setup.c" />
<ClCompile Include="src\libtommath\bn_mp_mul.c" />
<ClCompile Include="src\libtommath\bn_mp_mul_2.c" />
<ClCompile Include="src\libtommath\bn_mp_mul_2d.c" />
<ClCompile Include="src\libtommath\bn_mp_mul_d.c" />
<ClCompile Include="src\libtommath\bn_mp_mulmod.c" />
<ClCompile Include="src\libtommath\bn_mp_n_root.c" />
<ClCompile Include="src\libtommath\bn_mp_neg.c" />
<ClCompile Include="src\libtommath\bn_mp_or.c" />
<ClCompile Include="src\libtommath\bn_mp_prime_fermat.c" />
<ClCompile Include="src\libtommath\bn_mp_prime_is_divisible.c" />
<ClCompile Include="src\libtommath\bn_mp_prime_is_prime.c" />
<ClCompile Include="src\libtommath\bn_mp_prime_miller_rabin.c" />
<ClCompile Include="src\libtommath\bn_mp_prime_next_prime.c" />
<ClCompile Include="src\libtommath\bn_mp_prime_rabin_miller_trials.c" />
<ClCompile Include="src\libtommath\bn_mp_prime_random_ex.c" />
<ClCompile Include="src\libtommath\bn_mp_radix_size.c" />
<ClCompile Include="src\libtommath\bn_mp_radix_smap.c" />
<ClCompile Include="src\libtommath\bn_mp_rand.c" />
<ClCompile Include="src\libtommath\bn_mp_read_radix.c" />
<ClCompile Include="src\libtommath\bn_mp_read_signed_bin.c" />
<ClCompile Include="src\libtommath\bn_mp_read_unsigned_bin.c" />
<ClCompile Include="src\libtommath\bn_mp_reduce.c" />
<ClCompile Include="src\libtommath\bn_mp_reduce_2k.c" />
<ClCompile Include="src\libtommath\bn_mp_reduce_2k_l.c" />
<ClCompile Include="src\libtommath\bn_mp_reduce_2k_setup.c" />
<ClCompile Include="src\libtommath\bn_mp_reduce_2k_setup_l.c" />
<ClCompile Include="src\libtommath\bn_mp_reduce_is_2k.c" />
<ClCompile Include="src\libtommath\bn_mp_reduce_is_2k_l.c" />
<ClCompile Include="src\libtommath\bn_mp_reduce_setup.c" />
<ClCompile Include="src\libtommath\bn_mp_rshd.c" />
<ClCompile Include="src\libtommath\bn_mp_set.c" />
<ClCompile Include="src\libtommath\bn_mp_set_int.c" />
<ClCompile Include="src\libtommath\bn_mp_shrink.c" />
<ClCompile Include="src\libtommath\bn_mp_signed_bin_size.c" />
<ClCompile Include="src\libtommath\bn_mp_sqr.c" />
<ClCompile Include="src\libtommath\bn_mp_sqrmod.c" />
<ClCompile Include="src\libtommath\bn_mp_sqrt.c" />
<ClCompile Include="src\libtommath\bn_mp_sub.c" />
<ClCompile Include="src\libtommath\bn_mp_sub_d.c" />
<ClCompile Include="src\libtommath\bn_mp_submod.c" />
<ClCompile Include="src\libtommath\bn_mp_to_signed_bin.c" />
<ClCompile Include="src\libtommath\bn_mp_to_signed_bin_n.c" />
<ClCompile Include="src\libtommath\bn_mp_to_unsigned_bin.c" />
<ClCompile Include="src\libtommath\bn_mp_to_unsigned_bin_n.c" />
<ClCompile Include="src\libtommath\bn_mp_toom_mul.c" />
<ClCompile Include="src\libtommath\bn_mp_toom_sqr.c" />
<ClCompile Include="src\libtommath\bn_mp_toradix.c" />
<ClCompile Include="src\libtommath\bn_mp_toradix_n.c" />
<ClCompile Include="src\libtommath\bn_mp_unsigned_bin_size.c" />
<ClCompile Include="src\libtommath\bn_mp_xor.c" />
<ClCompile Include="src\libtommath\bn_mp_zero.c" />
<ClCompile Include="src\libtommath\bn_prime_tab.c" />
<ClCompile Include="src\libtommath\bn_reverse.c" />
<ClCompile Include="src\libtommath\bn_s_mp_add.c" />
<ClCompile Include="src\libtommath\bn_s_mp_exptmod.c" />
<ClCompile Include="src\libtommath\bn_s_mp_mul_digs.c" />
<ClCompile Include="src\libtommath\bn_s_mp_mul_high_digs.c" />
<ClCompile Include="src\libtommath\bn_s_mp_sqr.c" />
<ClCompile Include="src\libtommath\bn_s_mp_sub.c" />
<ClCompile Include="src\libtommath\bncore.c" />
<ClCompile Include="src\lzma\C\LzFind.c" />
<ClCompile Include="src\lzma\C\LzFindMt.c" />
<ClCompile Include="src\lzma\C\LzmaDec.c" />
<ClCompile Include="src\lzma\C\LzmaEnc.c" />
<ClCompile Include="src\lzma\C\Threads.c" />
<ClCompile Include="src\pklib\explode.c" />
<ClCompile Include="src\pklib\implode.c" />
<ClCompile Include="src\sparse\sparse.cpp" />
<ClCompile Include="src\zlib\adler32.c" />
<ClCompile Include="src\zlib\compress2.c" />
<ClCompile Include="src\zlib\crc32.c" />
<ClCompile Include="src\zlib\deflate.c" />
<ClCompile Include="src\zlib\inffast.c" />
<ClCompile Include="src\zlib\inflate.c" />
<ClCompile Include="src\zlib\inftrees.c" />
<ClCompile Include="src\zlib\trees.c" />
<ClCompile Include="src\zlib\zutil.c" />
<ClCompile Include="src\jenkins\lookup3.c" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

File diff suppressed because it is too large Load diff

View file

@ -1,511 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectName>StormLib_dll</ProjectName>
<ProjectGuid>{CB385198-50B1-4CF4-883B-11F042DED6AA}</ProjectGuid>
<RootNamespace>StormLib_dll</RootNamespace>
<Keyword>Win32Proj</Keyword>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">./bin/$(ProjectName)/$(Platform)/$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">./bin/$(ProjectName)/$(Platform)/$(Configuration)\</IntDir>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">./bin/$(ProjectName)/$(Platform)/$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">./bin/$(ProjectName)/$(Platform)/$(Configuration)\</IntDir>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">./bin/$(ProjectName)/$(Platform)/$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">./bin/$(ProjectName)/$(Platform)/$(Configuration)\</IntDir>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">./bin/$(ProjectName)/$(Platform)/$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">./bin/$(ProjectName)/$(Platform)/$(Configuration)\</IntDir>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>true</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level1</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<OutputFile>$(OutDir)StormLib.dll</OutputFile>
<ModuleDefinitionFile>.\StormLib_dll\StormLib.def</ModuleDefinitionFile>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<DataExecutionPrevention>
</DataExecutionPrevention>
<TargetMachine>MachineX86</TargetMachine>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Midl>
<TargetEnvironment>X64</TargetEnvironment>
</Midl>
<ClCompile>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>true</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level1</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<OutputFile>$(OutDir)StormLib.dll</OutputFile>
<ModuleDefinitionFile>.\StormLib_dll\StormLib.def</ModuleDefinitionFile>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<DataExecutionPrevention>
</DataExecutionPrevention>
<TargetMachine>MachineX64</TargetMachine>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level1</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<OutputFile>$(OutDir)StormLib.dll</OutputFile>
<ModuleDefinitionFile>.\StormLib_dll\StormLib.def</ModuleDefinitionFile>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<DataExecutionPrevention>
</DataExecutionPrevention>
<TargetMachine>MachineX86</TargetMachine>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Midl>
<TargetEnvironment>X64</TargetEnvironment>
</Midl>
<ClCompile>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level1</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<OutputFile>$(OutDir)StormLib.dll</OutputFile>
<ModuleDefinitionFile>.\StormLib_dll\StormLib.def</ModuleDefinitionFile>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<DataExecutionPrevention>
</DataExecutionPrevention>
<TargetMachine>MachineX64</TargetMachine>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<None Include="doc\History.txt" />
<None Include="doc\The MoPaQ File Format 0.9.txt" />
<None Include="doc\The MoPaQ File Format 1.0.txt" />
<None Include="stormlib_dll\StormLib.def" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="src\StormCommon.h" />
<ClInclude Include="src\StormLib.h" />
<ClInclude Include="src\StormPort.h" />
<ClInclude Include="src\adpcm\adpcm.h" />
<ClInclude Include="src\huffman\huff.h" />
<ClInclude Include="src\pklib\pklib.h" />
<ClInclude Include="src\sparse\sparse.h" />
<ClInclude Include="src\jenkins\lookup.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="stormlib_dll\DllMain.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Level4</WarningLevel>
</ClCompile>
<ClCompile Include="src\FileStream.cpp">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Level4</WarningLevel>
</ClCompile>
<ClCompile Include="src\SBaseCommon.cpp">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Level4</WarningLevel>
</ClCompile>
<ClCompile Include="src\SBaseFileTable.cpp">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Level4</WarningLevel>
</ClCompile>
<ClCompile Include="src\SCompression.cpp">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Level4</WarningLevel>
</ClCompile>
<ClCompile Include="src\SFileAddFile.cpp">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Level4</WarningLevel>
</ClCompile>
<ClCompile Include="src\SFileAttributes.cpp">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Level4</WarningLevel>
</ClCompile>
<ClCompile Include="src\SFileCompactArchive.cpp">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Level4</WarningLevel>
</ClCompile>
<ClCompile Include="src\SFileCreateArchive.cpp">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Level4</WarningLevel>
</ClCompile>
<ClCompile Include="src\SFileExtractFile.cpp">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Level4</WarningLevel>
</ClCompile>
<ClCompile Include="src\SFileFindFile.cpp">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Level4</WarningLevel>
</ClCompile>
<ClCompile Include="src\SFileListFile.cpp">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Level4</WarningLevel>
</ClCompile>
<ClCompile Include="src\SFileOpenArchive.cpp">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Level4</WarningLevel>
</ClCompile>
<ClCompile Include="src\SFileOpenFileEx.cpp">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Level4</WarningLevel>
</ClCompile>
<ClCompile Include="src\SFilePatchArchives.cpp">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Level4</WarningLevel>
</ClCompile>
<ClCompile Include="src\SFileReadFile.cpp">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Level4</WarningLevel>
</ClCompile>
<ClCompile Include="src\SFileVerify.cpp">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Level4</WarningLevel>
</ClCompile>
<ClCompile Include="src\adpcm\adpcm.cpp" />
<ClCompile Include="src\bzip2\blocksort.c" />
<ClCompile Include="src\bzip2\bzlib.c" />
<ClCompile Include="src\bzip2\compress.c" />
<ClCompile Include="src\bzip2\crctable.c" />
<ClCompile Include="src\bzip2\decompress.c" />
<ClCompile Include="src\bzip2\huffman.c" />
<ClCompile Include="src\bzip2\randtable.c" />
<ClCompile Include="src\huffman\huff.cpp" />
<ClCompile Include="src\libtomcrypt\src\hashes\hash_memory.c" />
<ClCompile Include="src\libtomcrypt\src\hashes\md5.c" />
<ClCompile Include="src\libtomcrypt\src\hashes\sha1.c" />
<ClCompile Include="src\libtomcrypt\src\math\ltm_desc.c" />
<ClCompile Include="src\libtomcrypt\src\math\multi.c" />
<ClCompile Include="src\libtomcrypt\src\math\rand_prime.c" />
<ClCompile Include="src\libtomcrypt\src\misc\base64_decode.c" />
<ClCompile Include="src\libtomcrypt\src\misc\crypt_argchk.c" />
<ClCompile Include="src\libtomcrypt\src\misc\crypt_find_hash.c" />
<ClCompile Include="src\libtomcrypt\src\misc\crypt_find_prng.c" />
<ClCompile Include="src\libtomcrypt\src\misc\crypt_hash_descriptor.c" />
<ClCompile Include="src\libtomcrypt\src\misc\crypt_hash_is_valid.c" />
<ClCompile Include="src\libtomcrypt\src\misc\crypt_libc.c" />
<ClCompile Include="src\libtomcrypt\src\misc\crypt_ltc_mp_descriptor.c" />
<ClCompile Include="src\libtomcrypt\src\misc\crypt_prng_descriptor.c" />
<ClCompile Include="src\libtomcrypt\src\misc\crypt_prng_is_valid.c" />
<ClCompile Include="src\libtomcrypt\src\misc\crypt_register_hash.c" />
<ClCompile Include="src\libtomcrypt\src\misc\crypt_register_prng.c" />
<ClCompile Include="src\libtomcrypt\src\misc\zeromem.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_bit_string.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_boolean.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_choice.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_ia5_string.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_integer.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_object_identifier.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_octet_string.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_printable_string.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_sequence_ex.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_sequence_flexi.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_sequence_multi.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_short_integer.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_utctime.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_utf8_string.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_length_bit_string.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_length_boolean.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_length_ia5_string.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_length_integer.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_length_object_identifier.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_length_octet_string.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_length_printable_string.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_length_sequence.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_length_short_integer.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_length_utctime.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_length_utf8_string.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_sequence_free.c" />
<ClCompile Include="src\libtomcrypt\src\pk\ecc\ltc_ecc_map.c" />
<ClCompile Include="src\libtomcrypt\src\pk\ecc\ltc_ecc_mul2add.c" />
<ClCompile Include="src\libtomcrypt\src\pk\ecc\ltc_ecc_mulmod.c" />
<ClCompile Include="src\libtomcrypt\src\pk\ecc\ltc_ecc_points.c" />
<ClCompile Include="src\libtomcrypt\src\pk\ecc\ltc_ecc_projective_add_point.c" />
<ClCompile Include="src\libtomcrypt\src\pk\ecc\ltc_ecc_projective_dbl_point.c" />
<ClCompile Include="src\libtomcrypt\src\pk\pkcs1\pkcs_1_mgf1.c" />
<ClCompile Include="src\libtomcrypt\src\pk\pkcs1\pkcs_1_oaep_decode.c" />
<ClCompile Include="src\libtomcrypt\src\pk\pkcs1\pkcs_1_pss_decode.c" />
<ClCompile Include="src\libtomcrypt\src\pk\pkcs1\pkcs_1_v1_5_decode.c" />
<ClCompile Include="src\libtomcrypt\src\pk\rsa\rsa_exptmod.c" />
<ClCompile Include="src\libtomcrypt\src\pk\rsa\rsa_free.c" />
<ClCompile Include="src\libtomcrypt\src\pk\rsa\rsa_import.c" />
<ClCompile Include="src\libtomcrypt\src\pk\rsa\rsa_make_key.c" />
<ClCompile Include="src\libtomcrypt\src\pk\rsa\rsa_verify_hash.c" />
<ClCompile Include="src\libtomcrypt\src\pk\rsa\rsa_verify_simple.c" />
<ClCompile Include="src\libtommath\bn_fast_mp_invmod.c" />
<ClCompile Include="src\libtommath\bn_fast_mp_montgomery_reduce.c" />
<ClCompile Include="src\libtommath\bn_fast_s_mp_mul_digs.c" />
<ClCompile Include="src\libtommath\bn_fast_s_mp_mul_high_digs.c" />
<ClCompile Include="src\libtommath\bn_fast_s_mp_sqr.c" />
<ClCompile Include="src\libtommath\bn_mp_2expt.c" />
<ClCompile Include="src\libtommath\bn_mp_abs.c" />
<ClCompile Include="src\libtommath\bn_mp_add.c" />
<ClCompile Include="src\libtommath\bn_mp_add_d.c" />
<ClCompile Include="src\libtommath\bn_mp_addmod.c" />
<ClCompile Include="src\libtommath\bn_mp_and.c" />
<ClCompile Include="src\libtommath\bn_mp_clamp.c" />
<ClCompile Include="src\libtommath\bn_mp_clear.c" />
<ClCompile Include="src\libtommath\bn_mp_clear_multi.c" />
<ClCompile Include="src\libtommath\bn_mp_cmp.c" />
<ClCompile Include="src\libtommath\bn_mp_cmp_d.c" />
<ClCompile Include="src\libtommath\bn_mp_cmp_mag.c" />
<ClCompile Include="src\libtommath\bn_mp_cnt_lsb.c" />
<ClCompile Include="src\libtommath\bn_mp_copy.c" />
<ClCompile Include="src\libtommath\bn_mp_count_bits.c" />
<ClCompile Include="src\libtommath\bn_mp_div.c" />
<ClCompile Include="src\libtommath\bn_mp_div_2.c" />
<ClCompile Include="src\libtommath\bn_mp_div_2d.c" />
<ClCompile Include="src\libtommath\bn_mp_div_3.c" />
<ClCompile Include="src\libtommath\bn_mp_div_d.c" />
<ClCompile Include="src\libtommath\bn_mp_dr_is_modulus.c" />
<ClCompile Include="src\libtommath\bn_mp_dr_reduce.c" />
<ClCompile Include="src\libtommath\bn_mp_dr_setup.c" />
<ClCompile Include="src\libtommath\bn_mp_exch.c" />
<ClCompile Include="src\libtommath\bn_mp_expt_d.c" />
<ClCompile Include="src\libtommath\bn_mp_exptmod.c" />
<ClCompile Include="src\libtommath\bn_mp_exptmod_fast.c" />
<ClCompile Include="src\libtommath\bn_mp_exteuclid.c" />
<ClCompile Include="src\libtommath\bn_mp_fread.c" />
<ClCompile Include="src\libtommath\bn_mp_fwrite.c" />
<ClCompile Include="src\libtommath\bn_mp_gcd.c" />
<ClCompile Include="src\libtommath\bn_mp_get_int.c" />
<ClCompile Include="src\libtommath\bn_mp_grow.c" />
<ClCompile Include="src\libtommath\bn_mp_init.c" />
<ClCompile Include="src\libtommath\bn_mp_init_copy.c" />
<ClCompile Include="src\libtommath\bn_mp_init_multi.c" />
<ClCompile Include="src\libtommath\bn_mp_init_set.c" />
<ClCompile Include="src\libtommath\bn_mp_init_set_int.c" />
<ClCompile Include="src\libtommath\bn_mp_init_size.c" />
<ClCompile Include="src\libtommath\bn_mp_invmod.c" />
<ClCompile Include="src\libtommath\bn_mp_invmod_slow.c" />
<ClCompile Include="src\libtommath\bn_mp_is_square.c" />
<ClCompile Include="src\libtommath\bn_mp_jacobi.c" />
<ClCompile Include="src\libtommath\bn_mp_karatsuba_mul.c" />
<ClCompile Include="src\libtommath\bn_mp_karatsuba_sqr.c" />
<ClCompile Include="src\libtommath\bn_mp_lcm.c" />
<ClCompile Include="src\libtommath\bn_mp_lshd.c" />
<ClCompile Include="src\libtommath\bn_mp_mod.c" />
<ClCompile Include="src\libtommath\bn_mp_mod_2d.c" />
<ClCompile Include="src\libtommath\bn_mp_mod_d.c" />
<ClCompile Include="src\libtommath\bn_mp_montgomery_calc_normalization.c" />
<ClCompile Include="src\libtommath\bn_mp_montgomery_reduce.c" />
<ClCompile Include="src\libtommath\bn_mp_montgomery_setup.c" />
<ClCompile Include="src\libtommath\bn_mp_mul.c" />
<ClCompile Include="src\libtommath\bn_mp_mul_2.c" />
<ClCompile Include="src\libtommath\bn_mp_mul_2d.c" />
<ClCompile Include="src\libtommath\bn_mp_mul_d.c" />
<ClCompile Include="src\libtommath\bn_mp_mulmod.c" />
<ClCompile Include="src\libtommath\bn_mp_n_root.c" />
<ClCompile Include="src\libtommath\bn_mp_neg.c" />
<ClCompile Include="src\libtommath\bn_mp_or.c" />
<ClCompile Include="src\libtommath\bn_mp_prime_fermat.c" />
<ClCompile Include="src\libtommath\bn_mp_prime_is_divisible.c" />
<ClCompile Include="src\libtommath\bn_mp_prime_is_prime.c" />
<ClCompile Include="src\libtommath\bn_mp_prime_miller_rabin.c" />
<ClCompile Include="src\libtommath\bn_mp_prime_next_prime.c" />
<ClCompile Include="src\libtommath\bn_mp_prime_rabin_miller_trials.c" />
<ClCompile Include="src\libtommath\bn_mp_prime_random_ex.c" />
<ClCompile Include="src\libtommath\bn_mp_radix_size.c" />
<ClCompile Include="src\libtommath\bn_mp_radix_smap.c" />
<ClCompile Include="src\libtommath\bn_mp_rand.c" />
<ClCompile Include="src\libtommath\bn_mp_read_radix.c" />
<ClCompile Include="src\libtommath\bn_mp_read_signed_bin.c" />
<ClCompile Include="src\libtommath\bn_mp_read_unsigned_bin.c" />
<ClCompile Include="src\libtommath\bn_mp_reduce.c" />
<ClCompile Include="src\libtommath\bn_mp_reduce_2k.c" />
<ClCompile Include="src\libtommath\bn_mp_reduce_2k_l.c" />
<ClCompile Include="src\libtommath\bn_mp_reduce_2k_setup.c" />
<ClCompile Include="src\libtommath\bn_mp_reduce_2k_setup_l.c" />
<ClCompile Include="src\libtommath\bn_mp_reduce_is_2k.c" />
<ClCompile Include="src\libtommath\bn_mp_reduce_is_2k_l.c" />
<ClCompile Include="src\libtommath\bn_mp_reduce_setup.c" />
<ClCompile Include="src\libtommath\bn_mp_rshd.c" />
<ClCompile Include="src\libtommath\bn_mp_set.c" />
<ClCompile Include="src\libtommath\bn_mp_set_int.c" />
<ClCompile Include="src\libtommath\bn_mp_shrink.c" />
<ClCompile Include="src\libtommath\bn_mp_signed_bin_size.c" />
<ClCompile Include="src\libtommath\bn_mp_sqr.c" />
<ClCompile Include="src\libtommath\bn_mp_sqrmod.c" />
<ClCompile Include="src\libtommath\bn_mp_sqrt.c" />
<ClCompile Include="src\libtommath\bn_mp_sub.c" />
<ClCompile Include="src\libtommath\bn_mp_sub_d.c" />
<ClCompile Include="src\libtommath\bn_mp_submod.c" />
<ClCompile Include="src\libtommath\bn_mp_to_signed_bin.c" />
<ClCompile Include="src\libtommath\bn_mp_to_signed_bin_n.c" />
<ClCompile Include="src\libtommath\bn_mp_to_unsigned_bin.c" />
<ClCompile Include="src\libtommath\bn_mp_to_unsigned_bin_n.c" />
<ClCompile Include="src\libtommath\bn_mp_toom_mul.c" />
<ClCompile Include="src\libtommath\bn_mp_toom_sqr.c" />
<ClCompile Include="src\libtommath\bn_mp_toradix.c" />
<ClCompile Include="src\libtommath\bn_mp_toradix_n.c" />
<ClCompile Include="src\libtommath\bn_mp_unsigned_bin_size.c" />
<ClCompile Include="src\libtommath\bn_mp_xor.c" />
<ClCompile Include="src\libtommath\bn_mp_zero.c" />
<ClCompile Include="src\libtommath\bn_prime_tab.c" />
<ClCompile Include="src\libtommath\bn_reverse.c" />
<ClCompile Include="src\libtommath\bn_s_mp_add.c" />
<ClCompile Include="src\libtommath\bn_s_mp_exptmod.c" />
<ClCompile Include="src\libtommath\bn_s_mp_mul_digs.c" />
<ClCompile Include="src\libtommath\bn_s_mp_mul_high_digs.c" />
<ClCompile Include="src\libtommath\bn_s_mp_sqr.c" />
<ClCompile Include="src\libtommath\bn_s_mp_sub.c" />
<ClCompile Include="src\libtommath\bncore.c" />
<ClCompile Include="src\lzma\C\LzFind.c" />
<ClCompile Include="src\lzma\C\LzFindMt.c" />
<ClCompile Include="src\lzma\C\LzmaDec.c" />
<ClCompile Include="src\lzma\C\LzmaEnc.c" />
<ClCompile Include="src\lzma\C\Threads.c" />
<ClCompile Include="src\pklib\explode.c" />
<ClCompile Include="src\pklib\implode.c" />
<ClCompile Include="src\sparse\sparse.cpp" />
<ClCompile Include="src\zlib\adler32.c" />
<ClCompile Include="src\zlib\compress2.c" />
<ClCompile Include="src\zlib\crc32.c" />
<ClCompile Include="src\zlib\deflate.c" />
<ClCompile Include="src\zlib\inffast.c" />
<ClCompile Include="src\zlib\inflate.c" />
<ClCompile Include="src\zlib\inftrees.c" />
<ClCompile Include="src\zlib\trees.c" />
<ClCompile Include="src\zlib\zutil.c" />
<ClCompile Include="src\jenkins\lookup3.c" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View file

@ -1,779 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Doc Files">
<UniqueIdentifier>{4c9205db-fd84-4138-bf99-9762053fad24}</UniqueIdentifier>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{c46bb1be-e2ee-44ed-8ccf-277792e674a5}</UniqueIdentifier>
</Filter>
<Filter Include="Source Files">
<UniqueIdentifier>{f14302d2-8c36-4dd9-aa65-ada246a32592}</UniqueIdentifier>
</Filter>
<Filter Include="Source Files\adpcm">
<UniqueIdentifier>{0402bd47-a1d1-47d5-b192-c30d6c9fc00f}</UniqueIdentifier>
</Filter>
<Filter Include="Source Files\bzip2">
<UniqueIdentifier>{821a4034-910a-4ee0-beda-3716d7e0d4e7}</UniqueIdentifier>
</Filter>
<Filter Include="Source Files\huffman">
<UniqueIdentifier>{ac0040f0-0b8f-477a-928d-b159162ddabc}</UniqueIdentifier>
</Filter>
<Filter Include="Source Files\libtomcrypt">
<UniqueIdentifier>{490bdd04-2b51-4cd9-a48a-804a6c5c2e66}</UniqueIdentifier>
</Filter>
<Filter Include="Source Files\libtomcrypt\hashes">
<UniqueIdentifier>{f26bb75a-155e-4230-aefb-bc9797199ff2}</UniqueIdentifier>
</Filter>
<Filter Include="Source Files\libtomcrypt\math">
<UniqueIdentifier>{76f65750-18e0-40d9-ba7b-7fd6e864abd9}</UniqueIdentifier>
</Filter>
<Filter Include="Source Files\libtomcrypt\misc">
<UniqueIdentifier>{9f4ea0eb-a4cc-4425-8762-1530b05002a8}</UniqueIdentifier>
</Filter>
<Filter Include="Source Files\libtomcrypt\pk">
<UniqueIdentifier>{7345615c-9ea6-4f79-ad9d-bfba3678e2df}</UniqueIdentifier>
</Filter>
<Filter Include="Source Files\libtomcrypt\pk\asn1">
<UniqueIdentifier>{d100666f-35f0-4465-b5f0-48614229b2b7}</UniqueIdentifier>
</Filter>
<Filter Include="Source Files\libtomcrypt\pk\ecc">
<UniqueIdentifier>{a08914e6-844f-4dcc-8867-b38b8f55df64}</UniqueIdentifier>
</Filter>
<Filter Include="Source Files\libtomcrypt\pk\pkcs1">
<UniqueIdentifier>{e2ea2efd-8853-40e6-aeee-af7a67e1dbec}</UniqueIdentifier>
</Filter>
<Filter Include="Source Files\libtomcrypt\pk\rsa">
<UniqueIdentifier>{5a8af9f4-dc43-4d8d-8fea-1d24f9615100}</UniqueIdentifier>
</Filter>
<Filter Include="Source Files\libtommath">
<UniqueIdentifier>{1e741e95-ab82-47d4-8faa-47e03780c4ee}</UniqueIdentifier>
</Filter>
<Filter Include="Source Files\lzma">
<UniqueIdentifier>{261ff9dd-b1eb-4662-99b1-9a18d82c644a}</UniqueIdentifier>
</Filter>
<Filter Include="Source Files\pklib">
<UniqueIdentifier>{d6033939-9a98-4c26-a158-8226dbbbc1a6}</UniqueIdentifier>
</Filter>
<Filter Include="Source Files\sparse">
<UniqueIdentifier>{e36b055a-1636-4850-b7c8-4170a94fb162}</UniqueIdentifier>
</Filter>
<Filter Include="Source Files\zlib">
<UniqueIdentifier>{65341005-077a-4f02-a4af-0bb63fad4c30}</UniqueIdentifier>
</Filter>
<Filter Include="Source Files\jenkins">
<UniqueIdentifier>{c33670da-5145-4e1d-b7a5-762b85b9e63a}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<None Include="doc\History.txt">
<Filter>Doc Files</Filter>
</None>
<None Include="doc\The MoPaQ File Format 0.9.txt">
<Filter>Doc Files</Filter>
</None>
<None Include="doc\The MoPaQ File Format 1.0.txt">
<Filter>Doc Files</Filter>
</None>
<None Include="stormlib_dll\StormLib.def">
<Filter>Source Files</Filter>
</None>
</ItemGroup>
<ItemGroup>
<ClInclude Include="src\StormCommon.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="src\StormLib.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="src\StormPort.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="src\adpcm\adpcm.h">
<Filter>Source Files\adpcm</Filter>
</ClInclude>
<ClInclude Include="src\huffman\huff.h">
<Filter>Source Files\huffman</Filter>
</ClInclude>
<ClInclude Include="src\pklib\pklib.h">
<Filter>Source Files\pklib</Filter>
</ClInclude>
<ClInclude Include="src\sparse\sparse.h">
<Filter>Source Files\sparse</Filter>
</ClInclude>
<ClInclude Include="src\jenkins\lookup.h">
<Filter>Source Files\jenkins</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="stormlib_dll\DllMain.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\FileStream.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\SBaseCommon.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\SBaseFileTable.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\SCompression.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\SFileAddFile.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\SFileAttributes.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\SFileCompactArchive.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\SFileCreateArchive.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\SFileExtractFile.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\SFileFindFile.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\SFileListFile.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\SFileOpenArchive.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\SFileOpenFileEx.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\SFilePatchArchives.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\SFileReadFile.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\SFileVerify.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\adpcm\adpcm.cpp">
<Filter>Source Files\adpcm</Filter>
</ClCompile>
<ClCompile Include="src\bzip2\blocksort.c">
<Filter>Source Files\bzip2</Filter>
</ClCompile>
<ClCompile Include="src\bzip2\bzlib.c">
<Filter>Source Files\bzip2</Filter>
</ClCompile>
<ClCompile Include="src\bzip2\compress.c">
<Filter>Source Files\bzip2</Filter>
</ClCompile>
<ClCompile Include="src\bzip2\crctable.c">
<Filter>Source Files\bzip2</Filter>
</ClCompile>
<ClCompile Include="src\bzip2\decompress.c">
<Filter>Source Files\bzip2</Filter>
</ClCompile>
<ClCompile Include="src\bzip2\huffman.c">
<Filter>Source Files\bzip2</Filter>
</ClCompile>
<ClCompile Include="src\bzip2\randtable.c">
<Filter>Source Files\bzip2</Filter>
</ClCompile>
<ClCompile Include="src\huffman\huff.cpp">
<Filter>Source Files\huffman</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\hashes\hash_memory.c">
<Filter>Source Files\libtomcrypt\hashes</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\hashes\md5.c">
<Filter>Source Files\libtomcrypt\hashes</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\hashes\sha1.c">
<Filter>Source Files\libtomcrypt\hashes</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\math\ltm_desc.c">
<Filter>Source Files\libtomcrypt\math</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\math\multi.c">
<Filter>Source Files\libtomcrypt\math</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\math\rand_prime.c">
<Filter>Source Files\libtomcrypt\math</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\misc\base64_decode.c">
<Filter>Source Files\libtomcrypt\misc</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\misc\crypt_argchk.c">
<Filter>Source Files\libtomcrypt\misc</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\misc\crypt_find_hash.c">
<Filter>Source Files\libtomcrypt\misc</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\misc\crypt_find_prng.c">
<Filter>Source Files\libtomcrypt\misc</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\misc\crypt_hash_descriptor.c">
<Filter>Source Files\libtomcrypt\misc</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\misc\crypt_hash_is_valid.c">
<Filter>Source Files\libtomcrypt\misc</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\misc\crypt_libc.c">
<Filter>Source Files\libtomcrypt\misc</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\misc\crypt_ltc_mp_descriptor.c">
<Filter>Source Files\libtomcrypt\misc</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\misc\crypt_prng_descriptor.c">
<Filter>Source Files\libtomcrypt\misc</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\misc\crypt_prng_is_valid.c">
<Filter>Source Files\libtomcrypt\misc</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\misc\crypt_register_hash.c">
<Filter>Source Files\libtomcrypt\misc</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\misc\crypt_register_prng.c">
<Filter>Source Files\libtomcrypt\misc</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\misc\zeromem.c">
<Filter>Source Files\libtomcrypt\misc</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_bit_string.c">
<Filter>Source Files\libtomcrypt\pk\asn1</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_boolean.c">
<Filter>Source Files\libtomcrypt\pk\asn1</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_choice.c">
<Filter>Source Files\libtomcrypt\pk\asn1</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_ia5_string.c">
<Filter>Source Files\libtomcrypt\pk\asn1</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_integer.c">
<Filter>Source Files\libtomcrypt\pk\asn1</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_object_identifier.c">
<Filter>Source Files\libtomcrypt\pk\asn1</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_octet_string.c">
<Filter>Source Files\libtomcrypt\pk\asn1</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_printable_string.c">
<Filter>Source Files\libtomcrypt\pk\asn1</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_sequence_ex.c">
<Filter>Source Files\libtomcrypt\pk\asn1</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_sequence_flexi.c">
<Filter>Source Files\libtomcrypt\pk\asn1</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_sequence_multi.c">
<Filter>Source Files\libtomcrypt\pk\asn1</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_short_integer.c">
<Filter>Source Files\libtomcrypt\pk\asn1</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_utctime.c">
<Filter>Source Files\libtomcrypt\pk\asn1</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_utf8_string.c">
<Filter>Source Files\libtomcrypt\pk\asn1</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_length_bit_string.c">
<Filter>Source Files\libtomcrypt\pk\asn1</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_length_boolean.c">
<Filter>Source Files\libtomcrypt\pk\asn1</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_length_ia5_string.c">
<Filter>Source Files\libtomcrypt\pk\asn1</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_length_integer.c">
<Filter>Source Files\libtomcrypt\pk\asn1</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_length_object_identifier.c">
<Filter>Source Files\libtomcrypt\pk\asn1</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_length_octet_string.c">
<Filter>Source Files\libtomcrypt\pk\asn1</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_length_printable_string.c">
<Filter>Source Files\libtomcrypt\pk\asn1</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_length_sequence.c">
<Filter>Source Files\libtomcrypt\pk\asn1</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_length_short_integer.c">
<Filter>Source Files\libtomcrypt\pk\asn1</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_length_utctime.c">
<Filter>Source Files\libtomcrypt\pk\asn1</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_length_utf8_string.c">
<Filter>Source Files\libtomcrypt\pk\asn1</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_sequence_free.c">
<Filter>Source Files\libtomcrypt\pk\asn1</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\pk\ecc\ltc_ecc_map.c">
<Filter>Source Files\libtomcrypt\pk\ecc</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\pk\ecc\ltc_ecc_mul2add.c">
<Filter>Source Files\libtomcrypt\pk\ecc</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\pk\ecc\ltc_ecc_mulmod.c">
<Filter>Source Files\libtomcrypt\pk\ecc</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\pk\ecc\ltc_ecc_points.c">
<Filter>Source Files\libtomcrypt\pk\ecc</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\pk\ecc\ltc_ecc_projective_add_point.c">
<Filter>Source Files\libtomcrypt\pk\ecc</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\pk\ecc\ltc_ecc_projective_dbl_point.c">
<Filter>Source Files\libtomcrypt\pk\ecc</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\pk\pkcs1\pkcs_1_mgf1.c">
<Filter>Source Files\libtomcrypt\pk\pkcs1</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\pk\pkcs1\pkcs_1_oaep_decode.c">
<Filter>Source Files\libtomcrypt\pk\pkcs1</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\pk\pkcs1\pkcs_1_pss_decode.c">
<Filter>Source Files\libtomcrypt\pk\pkcs1</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\pk\pkcs1\pkcs_1_v1_5_decode.c">
<Filter>Source Files\libtomcrypt\pk\pkcs1</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\pk\rsa\rsa_exptmod.c">
<Filter>Source Files\libtomcrypt\pk\rsa</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\pk\rsa\rsa_free.c">
<Filter>Source Files\libtomcrypt\pk\rsa</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\pk\rsa\rsa_import.c">
<Filter>Source Files\libtomcrypt\pk\rsa</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\pk\rsa\rsa_make_key.c">
<Filter>Source Files\libtomcrypt\pk\rsa</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\pk\rsa\rsa_verify_hash.c">
<Filter>Source Files\libtomcrypt\pk\rsa</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\pk\rsa\rsa_verify_simple.c">
<Filter>Source Files\libtomcrypt\pk\rsa</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_fast_mp_invmod.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_fast_mp_montgomery_reduce.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_fast_s_mp_mul_digs.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_fast_s_mp_mul_high_digs.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_fast_s_mp_sqr.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_2expt.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_abs.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_add.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_add_d.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_addmod.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_and.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_clamp.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_clear.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_clear_multi.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_cmp.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_cmp_d.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_cmp_mag.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_cnt_lsb.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_copy.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_count_bits.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_div.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_div_2.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_div_2d.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_div_3.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_div_d.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_dr_is_modulus.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_dr_reduce.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_dr_setup.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_exch.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_expt_d.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_exptmod.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_exptmod_fast.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_exteuclid.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_fread.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_fwrite.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_gcd.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_get_int.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_grow.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_init.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_init_copy.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_init_multi.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_init_set.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_init_set_int.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_init_size.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_invmod.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_invmod_slow.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_is_square.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_jacobi.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_karatsuba_mul.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_karatsuba_sqr.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_lcm.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_lshd.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_mod.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_mod_2d.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_mod_d.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_montgomery_calc_normalization.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_montgomery_reduce.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_montgomery_setup.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_mul.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_mul_2.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_mul_2d.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_mul_d.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_mulmod.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_n_root.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_neg.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_or.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_prime_fermat.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_prime_is_divisible.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_prime_is_prime.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_prime_miller_rabin.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_prime_next_prime.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_prime_rabin_miller_trials.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_prime_random_ex.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_radix_size.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_radix_smap.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_rand.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_read_radix.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_read_signed_bin.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_read_unsigned_bin.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_reduce.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_reduce_2k.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_reduce_2k_l.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_reduce_2k_setup.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_reduce_2k_setup_l.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_reduce_is_2k.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_reduce_is_2k_l.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_reduce_setup.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_rshd.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_set.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_set_int.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_shrink.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_signed_bin_size.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_sqr.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_sqrmod.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_sqrt.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_sub.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_sub_d.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_submod.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_to_signed_bin.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_to_signed_bin_n.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_to_unsigned_bin.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_to_unsigned_bin_n.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_toom_mul.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_toom_sqr.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_toradix.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_toradix_n.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_unsigned_bin_size.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_xor.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_zero.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_prime_tab.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_reverse.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_s_mp_add.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_s_mp_exptmod.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_s_mp_mul_digs.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_s_mp_mul_high_digs.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_s_mp_sqr.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_s_mp_sub.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bncore.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\lzma\C\LzFind.c">
<Filter>Source Files\lzma</Filter>
</ClCompile>
<ClCompile Include="src\lzma\C\LzFindMt.c">
<Filter>Source Files\lzma</Filter>
</ClCompile>
<ClCompile Include="src\lzma\C\LzmaDec.c">
<Filter>Source Files\lzma</Filter>
</ClCompile>
<ClCompile Include="src\lzma\C\LzmaEnc.c">
<Filter>Source Files\lzma</Filter>
</ClCompile>
<ClCompile Include="src\lzma\C\Threads.c">
<Filter>Source Files\lzma</Filter>
</ClCompile>
<ClCompile Include="src\pklib\explode.c">
<Filter>Source Files\pklib</Filter>
</ClCompile>
<ClCompile Include="src\pklib\implode.c">
<Filter>Source Files\pklib</Filter>
</ClCompile>
<ClCompile Include="src\sparse\sparse.cpp">
<Filter>Source Files\sparse</Filter>
</ClCompile>
<ClCompile Include="src\zlib\adler32.c">
<Filter>Source Files\zlib</Filter>
</ClCompile>
<ClCompile Include="src\zlib\compress2.c">
<Filter>Source Files\zlib</Filter>
</ClCompile>
<ClCompile Include="src\zlib\crc32.c">
<Filter>Source Files\zlib</Filter>
</ClCompile>
<ClCompile Include="src\zlib\deflate.c">
<Filter>Source Files\zlib</Filter>
</ClCompile>
<ClCompile Include="src\zlib\inffast.c">
<Filter>Source Files\zlib</Filter>
</ClCompile>
<ClCompile Include="src\zlib\inflate.c">
<Filter>Source Files\zlib</Filter>
</ClCompile>
<ClCompile Include="src\zlib\inftrees.c">
<Filter>Source Files\zlib</Filter>
</ClCompile>
<ClCompile Include="src\zlib\trees.c">
<Filter>Source Files\zlib</Filter>
</ClCompile>
<ClCompile Include="src\zlib\zutil.c">
<Filter>Source Files\zlib</Filter>
</ClCompile>
<ClCompile Include="src\jenkins\lookup3.c">
<Filter>Source Files\jenkins</Filter>
</ClCompile>
</ItemGroup>
</Project>

View file

@ -1,4 +0,0 @@
[Project]
Name=StormLib_test
Manager=KDevCMakeManager
VersionControl=

File diff suppressed because it is too large Load diff

View file

@ -1,385 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectName>StormLib_test</ProjectName>
<ProjectGuid>{AA561A7B-26EA-49AF-90E8-C53C1FA2965D}</ProjectGuid>
<RootNamespace>StormLib_test</RootNamespace>
<Keyword>Win32Proj</Keyword>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
<Import Project="$(VCTargetsPath)\BuildCustomizations\masm.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">./bin/$(ProjectName)/$(Platform)/$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">./bin/$(ProjectName)/$(Platform)/$(Configuration)\</IntDir>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">./bin/$(ProjectName)/$(Platform)/$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">./bin/$(ProjectName)/$(Platform)/$(Configuration)\</IntDir>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>./src/libtomcrypt/src/headers;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;__STORMLIB_TEST__;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>true</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level1</WarningLevel>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<DataExecutionPrevention>
</DataExecutionPrevention>
<TargetMachine>MachineX86</TargetMachine>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<AdditionalIncludeDirectories>./src/libtomcrypt/src/headers;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;__STORMLIB_TEST__;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level1</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<DataExecutionPrevention>
</DataExecutionPrevention>
<TargetMachine>MachineX86</TargetMachine>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<None Include="doc\History.txt" />
<None Include="doc\The MoPaQ File Format 0.9.txt" />
<None Include="doc\The MoPaQ File Format 1.0.txt" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="src\StormCommon.h" />
<ClInclude Include="src\StormLib.h" />
<ClInclude Include="src\StormPort.h" />
<ClInclude Include="src\adpcm\adpcm.h" />
<ClInclude Include="src\huffman\huff.h" />
<ClInclude Include="src\pklib\pklib.h" />
<ClInclude Include="src\sparse\sparse.h" />
<ClInclude Include="src\jenkins\lookup.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="src\FileStream.cpp">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Level4</WarningLevel>
</ClCompile>
<ClCompile Include="src\SBaseCommon.cpp">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Level4</WarningLevel>
</ClCompile>
<ClCompile Include="src\SBaseDumpData.cpp" />
<ClCompile Include="src\SBaseFileTable.cpp">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Level4</WarningLevel>
</ClCompile>
<ClCompile Include="src\SCompression.cpp">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Level4</WarningLevel>
</ClCompile>
<ClCompile Include="src\SFileAddFile.cpp">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Level4</WarningLevel>
</ClCompile>
<ClCompile Include="src\SFileAttributes.cpp">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Level4</WarningLevel>
</ClCompile>
<ClCompile Include="src\SFileCompactArchive.cpp">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Level4</WarningLevel>
</ClCompile>
<ClCompile Include="src\SFileCreateArchive.cpp">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Level4</WarningLevel>
</ClCompile>
<ClCompile Include="src\SFileExtractFile.cpp">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Level4</WarningLevel>
</ClCompile>
<ClCompile Include="src\SFileFindFile.cpp">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Level4</WarningLevel>
</ClCompile>
<ClCompile Include="src\SFileListFile.cpp">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Level4</WarningLevel>
</ClCompile>
<ClCompile Include="src\SFileOpenArchive.cpp">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Level4</WarningLevel>
</ClCompile>
<ClCompile Include="src\SFileOpenFileEx.cpp">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Level4</WarningLevel>
</ClCompile>
<ClCompile Include="src\SFilePatchArchives.cpp">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Level4</WarningLevel>
</ClCompile>
<ClCompile Include="src\SFileReadFile.cpp">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Level4</WarningLevel>
</ClCompile>
<ClCompile Include="src\SFileVerify.cpp">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Level4</WarningLevel>
</ClCompile>
<ClCompile Include="test\Test.cpp">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Level4</WarningLevel>
</ClCompile>
<ClCompile Include="src\adpcm\adpcm.cpp" />
<ClCompile Include="src\bzip2\blocksort.c" />
<ClCompile Include="src\bzip2\bzlib.c" />
<ClCompile Include="src\bzip2\compress.c" />
<ClCompile Include="src\bzip2\crctable.c" />
<ClCompile Include="src\bzip2\decompress.c" />
<ClCompile Include="src\bzip2\huffman.c" />
<ClCompile Include="src\bzip2\randtable.c" />
<ClCompile Include="src\huffman\huff.cpp" />
<ClCompile Include="src\libtomcrypt\src\hashes\hash_memory.c" />
<ClCompile Include="src\libtomcrypt\src\hashes\md5.c" />
<ClCompile Include="src\libtomcrypt\src\hashes\sha1.c" />
<ClCompile Include="src\libtomcrypt\src\math\ltm_desc.c" />
<ClCompile Include="src\libtomcrypt\src\math\multi.c" />
<ClCompile Include="src\libtomcrypt\src\math\rand_prime.c" />
<ClCompile Include="src\libtomcrypt\src\misc\base64_decode.c" />
<ClCompile Include="src\libtomcrypt\src\misc\crypt_argchk.c" />
<ClCompile Include="src\libtomcrypt\src\misc\crypt_find_hash.c" />
<ClCompile Include="src\libtomcrypt\src\misc\crypt_find_prng.c" />
<ClCompile Include="src\libtomcrypt\src\misc\crypt_hash_descriptor.c" />
<ClCompile Include="src\libtomcrypt\src\misc\crypt_hash_is_valid.c" />
<ClCompile Include="src\libtomcrypt\src\misc\crypt_libc.c" />
<ClCompile Include="src\libtomcrypt\src\misc\crypt_ltc_mp_descriptor.c" />
<ClCompile Include="src\libtomcrypt\src\misc\crypt_prng_descriptor.c" />
<ClCompile Include="src\libtomcrypt\src\misc\crypt_prng_is_valid.c" />
<ClCompile Include="src\libtomcrypt\src\misc\crypt_register_hash.c" />
<ClCompile Include="src\libtomcrypt\src\misc\crypt_register_prng.c" />
<ClCompile Include="src\libtomcrypt\src\misc\zeromem.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_bit_string.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_boolean.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_choice.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_ia5_string.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_integer.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_object_identifier.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_octet_string.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_printable_string.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_sequence_ex.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_sequence_flexi.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_sequence_multi.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_short_integer.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_utctime.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_utf8_string.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_length_bit_string.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_length_boolean.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_length_ia5_string.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_length_integer.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_length_object_identifier.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_length_octet_string.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_length_printable_string.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_length_sequence.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_length_short_integer.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_length_utctime.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_length_utf8_string.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_sequence_free.c" />
<ClCompile Include="src\libtomcrypt\src\pk\ecc\ltc_ecc_map.c" />
<ClCompile Include="src\libtomcrypt\src\pk\ecc\ltc_ecc_mul2add.c" />
<ClCompile Include="src\libtomcrypt\src\pk\ecc\ltc_ecc_mulmod.c" />
<ClCompile Include="src\libtomcrypt\src\pk\ecc\ltc_ecc_points.c" />
<ClCompile Include="src\libtomcrypt\src\pk\ecc\ltc_ecc_projective_add_point.c" />
<ClCompile Include="src\libtomcrypt\src\pk\ecc\ltc_ecc_projective_dbl_point.c" />
<ClCompile Include="src\libtomcrypt\src\pk\pkcs1\pkcs_1_mgf1.c" />
<ClCompile Include="src\libtomcrypt\src\pk\pkcs1\pkcs_1_oaep_decode.c" />
<ClCompile Include="src\libtomcrypt\src\pk\pkcs1\pkcs_1_pss_decode.c" />
<ClCompile Include="src\libtomcrypt\src\pk\pkcs1\pkcs_1_v1_5_decode.c" />
<ClCompile Include="src\libtomcrypt\src\pk\rsa\rsa_exptmod.c" />
<ClCompile Include="src\libtomcrypt\src\pk\rsa\rsa_free.c" />
<ClCompile Include="src\libtomcrypt\src\pk\rsa\rsa_import.c" />
<ClCompile Include="src\libtomcrypt\src\pk\rsa\rsa_make_key.c" />
<ClCompile Include="src\libtomcrypt\src\pk\rsa\rsa_verify_hash.c" />
<ClCompile Include="src\libtomcrypt\src\pk\rsa\rsa_verify_simple.c" />
<ClCompile Include="src\libtommath\bn_fast_mp_invmod.c" />
<ClCompile Include="src\libtommath\bn_fast_mp_montgomery_reduce.c" />
<ClCompile Include="src\libtommath\bn_fast_s_mp_mul_digs.c" />
<ClCompile Include="src\libtommath\bn_fast_s_mp_mul_high_digs.c" />
<ClCompile Include="src\libtommath\bn_fast_s_mp_sqr.c" />
<ClCompile Include="src\libtommath\bn_mp_2expt.c" />
<ClCompile Include="src\libtommath\bn_mp_abs.c" />
<ClCompile Include="src\libtommath\bn_mp_add.c" />
<ClCompile Include="src\libtommath\bn_mp_add_d.c" />
<ClCompile Include="src\libtommath\bn_mp_addmod.c" />
<ClCompile Include="src\libtommath\bn_mp_and.c" />
<ClCompile Include="src\libtommath\bn_mp_clamp.c" />
<ClCompile Include="src\libtommath\bn_mp_clear.c" />
<ClCompile Include="src\libtommath\bn_mp_clear_multi.c" />
<ClCompile Include="src\libtommath\bn_mp_cmp.c" />
<ClCompile Include="src\libtommath\bn_mp_cmp_d.c" />
<ClCompile Include="src\libtommath\bn_mp_cmp_mag.c" />
<ClCompile Include="src\libtommath\bn_mp_cnt_lsb.c" />
<ClCompile Include="src\libtommath\bn_mp_copy.c" />
<ClCompile Include="src\libtommath\bn_mp_count_bits.c" />
<ClCompile Include="src\libtommath\bn_mp_div.c" />
<ClCompile Include="src\libtommath\bn_mp_div_2.c" />
<ClCompile Include="src\libtommath\bn_mp_div_2d.c" />
<ClCompile Include="src\libtommath\bn_mp_div_3.c" />
<ClCompile Include="src\libtommath\bn_mp_div_d.c" />
<ClCompile Include="src\libtommath\bn_mp_dr_is_modulus.c" />
<ClCompile Include="src\libtommath\bn_mp_dr_reduce.c" />
<ClCompile Include="src\libtommath\bn_mp_dr_setup.c" />
<ClCompile Include="src\libtommath\bn_mp_exch.c" />
<ClCompile Include="src\libtommath\bn_mp_expt_d.c" />
<ClCompile Include="src\libtommath\bn_mp_exptmod.c" />
<ClCompile Include="src\libtommath\bn_mp_exptmod_fast.c" />
<ClCompile Include="src\libtommath\bn_mp_exteuclid.c" />
<ClCompile Include="src\libtommath\bn_mp_fread.c" />
<ClCompile Include="src\libtommath\bn_mp_fwrite.c" />
<ClCompile Include="src\libtommath\bn_mp_gcd.c" />
<ClCompile Include="src\libtommath\bn_mp_get_int.c" />
<ClCompile Include="src\libtommath\bn_mp_grow.c" />
<ClCompile Include="src\libtommath\bn_mp_init.c" />
<ClCompile Include="src\libtommath\bn_mp_init_copy.c" />
<ClCompile Include="src\libtommath\bn_mp_init_multi.c" />
<ClCompile Include="src\libtommath\bn_mp_init_set.c" />
<ClCompile Include="src\libtommath\bn_mp_init_set_int.c" />
<ClCompile Include="src\libtommath\bn_mp_init_size.c" />
<ClCompile Include="src\libtommath\bn_mp_invmod.c" />
<ClCompile Include="src\libtommath\bn_mp_invmod_slow.c" />
<ClCompile Include="src\libtommath\bn_mp_is_square.c" />
<ClCompile Include="src\libtommath\bn_mp_jacobi.c" />
<ClCompile Include="src\libtommath\bn_mp_karatsuba_mul.c" />
<ClCompile Include="src\libtommath\bn_mp_karatsuba_sqr.c" />
<ClCompile Include="src\libtommath\bn_mp_lcm.c" />
<ClCompile Include="src\libtommath\bn_mp_lshd.c" />
<ClCompile Include="src\libtommath\bn_mp_mod.c" />
<ClCompile Include="src\libtommath\bn_mp_mod_2d.c" />
<ClCompile Include="src\libtommath\bn_mp_mod_d.c" />
<ClCompile Include="src\libtommath\bn_mp_montgomery_calc_normalization.c" />
<ClCompile Include="src\libtommath\bn_mp_montgomery_reduce.c" />
<ClCompile Include="src\libtommath\bn_mp_montgomery_setup.c" />
<ClCompile Include="src\libtommath\bn_mp_mul.c" />
<ClCompile Include="src\libtommath\bn_mp_mul_2.c" />
<ClCompile Include="src\libtommath\bn_mp_mul_2d.c" />
<ClCompile Include="src\libtommath\bn_mp_mul_d.c" />
<ClCompile Include="src\libtommath\bn_mp_mulmod.c" />
<ClCompile Include="src\libtommath\bn_mp_n_root.c" />
<ClCompile Include="src\libtommath\bn_mp_neg.c" />
<ClCompile Include="src\libtommath\bn_mp_or.c" />
<ClCompile Include="src\libtommath\bn_mp_prime_fermat.c" />
<ClCompile Include="src\libtommath\bn_mp_prime_is_divisible.c" />
<ClCompile Include="src\libtommath\bn_mp_prime_is_prime.c" />
<ClCompile Include="src\libtommath\bn_mp_prime_miller_rabin.c" />
<ClCompile Include="src\libtommath\bn_mp_prime_next_prime.c" />
<ClCompile Include="src\libtommath\bn_mp_prime_rabin_miller_trials.c" />
<ClCompile Include="src\libtommath\bn_mp_prime_random_ex.c" />
<ClCompile Include="src\libtommath\bn_mp_radix_size.c" />
<ClCompile Include="src\libtommath\bn_mp_radix_smap.c" />
<ClCompile Include="src\libtommath\bn_mp_rand.c" />
<ClCompile Include="src\libtommath\bn_mp_read_radix.c" />
<ClCompile Include="src\libtommath\bn_mp_read_signed_bin.c" />
<ClCompile Include="src\libtommath\bn_mp_read_unsigned_bin.c" />
<ClCompile Include="src\libtommath\bn_mp_reduce.c" />
<ClCompile Include="src\libtommath\bn_mp_reduce_2k.c" />
<ClCompile Include="src\libtommath\bn_mp_reduce_2k_l.c" />
<ClCompile Include="src\libtommath\bn_mp_reduce_2k_setup.c" />
<ClCompile Include="src\libtommath\bn_mp_reduce_2k_setup_l.c" />
<ClCompile Include="src\libtommath\bn_mp_reduce_is_2k.c" />
<ClCompile Include="src\libtommath\bn_mp_reduce_is_2k_l.c" />
<ClCompile Include="src\libtommath\bn_mp_reduce_setup.c" />
<ClCompile Include="src\libtommath\bn_mp_rshd.c" />
<ClCompile Include="src\libtommath\bn_mp_set.c" />
<ClCompile Include="src\libtommath\bn_mp_set_int.c" />
<ClCompile Include="src\libtommath\bn_mp_shrink.c" />
<ClCompile Include="src\libtommath\bn_mp_signed_bin_size.c" />
<ClCompile Include="src\libtommath\bn_mp_sqr.c" />
<ClCompile Include="src\libtommath\bn_mp_sqrmod.c" />
<ClCompile Include="src\libtommath\bn_mp_sqrt.c" />
<ClCompile Include="src\libtommath\bn_mp_sub.c" />
<ClCompile Include="src\libtommath\bn_mp_sub_d.c" />
<ClCompile Include="src\libtommath\bn_mp_submod.c" />
<ClCompile Include="src\libtommath\bn_mp_to_signed_bin.c" />
<ClCompile Include="src\libtommath\bn_mp_to_signed_bin_n.c" />
<ClCompile Include="src\libtommath\bn_mp_to_unsigned_bin.c" />
<ClCompile Include="src\libtommath\bn_mp_to_unsigned_bin_n.c" />
<ClCompile Include="src\libtommath\bn_mp_toom_mul.c" />
<ClCompile Include="src\libtommath\bn_mp_toom_sqr.c" />
<ClCompile Include="src\libtommath\bn_mp_toradix.c" />
<ClCompile Include="src\libtommath\bn_mp_toradix_n.c" />
<ClCompile Include="src\libtommath\bn_mp_unsigned_bin_size.c" />
<ClCompile Include="src\libtommath\bn_mp_xor.c" />
<ClCompile Include="src\libtommath\bn_mp_zero.c" />
<ClCompile Include="src\libtommath\bn_prime_tab.c" />
<ClCompile Include="src\libtommath\bn_reverse.c" />
<ClCompile Include="src\libtommath\bn_s_mp_add.c" />
<ClCompile Include="src\libtommath\bn_s_mp_exptmod.c" />
<ClCompile Include="src\libtommath\bn_s_mp_mul_digs.c" />
<ClCompile Include="src\libtommath\bn_s_mp_mul_high_digs.c" />
<ClCompile Include="src\libtommath\bn_s_mp_sqr.c" />
<ClCompile Include="src\libtommath\bn_s_mp_sub.c" />
<ClCompile Include="src\libtommath\bncore.c" />
<ClCompile Include="src\lzma\C\LzFind.c" />
<ClCompile Include="src\lzma\C\LzFindMt.c" />
<ClCompile Include="src\lzma\C\LzmaDec.c" />
<ClCompile Include="src\lzma\C\LzmaEnc.c" />
<ClCompile Include="src\lzma\C\Threads.c" />
<ClCompile Include="src\pklib\explode.c" />
<ClCompile Include="src\pklib\implode.c" />
<ClCompile Include="src\sparse\sparse.cpp" />
<ClCompile Include="src\zlib\adler32.c" />
<ClCompile Include="src\zlib\compress2.c" />
<ClCompile Include="src\zlib\crc32.c" />
<ClCompile Include="src\zlib\deflate.c" />
<ClCompile Include="src\zlib\inffast.c" />
<ClCompile Include="src\zlib\inflate.c" />
<ClCompile Include="src\zlib\inftrees.c" />
<ClCompile Include="src\zlib\trees.c" />
<ClCompile Include="src\zlib\zutil.c" />
<ClCompile Include="src\jenkins\lookup3.c" />
</ItemGroup>
<ItemGroup>
<MASM Include="test\x86_ripped_code.asm" />
<MASM Include="test\x86_starcraft_lzma.asm">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
</MASM>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
<Import Project="$(VCTargetsPath)\BuildCustomizations\masm.targets" />
</ImportGroup>
</Project>

View file

@ -1,787 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Doc Files">
<UniqueIdentifier>{0521b37a-df0c-4809-92ee-5c21b80735f5}</UniqueIdentifier>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{3f337e66-2467-48f8-a358-c81ed372f252}</UniqueIdentifier>
</Filter>
<Filter Include="Source Files">
<UniqueIdentifier>{6babe236-18ee-471b-8a62-d03a22e90198}</UniqueIdentifier>
</Filter>
<Filter Include="Source Files\adpcm">
<UniqueIdentifier>{f0a0e8e3-b2c2-4d1c-879d-a43f03ea5a61}</UniqueIdentifier>
</Filter>
<Filter Include="Source Files\bzip2">
<UniqueIdentifier>{2aaefdc1-9d77-4a38-9f4c-5e870ec44945}</UniqueIdentifier>
</Filter>
<Filter Include="Source Files\huffman">
<UniqueIdentifier>{4e9f5c7f-af4c-4fd4-830f-3a2da5d7206c}</UniqueIdentifier>
</Filter>
<Filter Include="Source Files\libtomcrypt">
<UniqueIdentifier>{4d3becbb-eec3-45b8-a125-02d94d150a33}</UniqueIdentifier>
</Filter>
<Filter Include="Source Files\libtomcrypt\hashes">
<UniqueIdentifier>{0ab926c1-a33f-4c11-8c1a-101256e167f0}</UniqueIdentifier>
</Filter>
<Filter Include="Source Files\libtomcrypt\math">
<UniqueIdentifier>{5085a0e7-4e7e-4676-91d5-7b4e2fbb0664}</UniqueIdentifier>
</Filter>
<Filter Include="Source Files\libtomcrypt\misc">
<UniqueIdentifier>{8a3caff1-3400-424c-807f-2ed016789093}</UniqueIdentifier>
</Filter>
<Filter Include="Source Files\libtomcrypt\pk">
<UniqueIdentifier>{bea80b25-7db8-4811-a8e6-8032eb386539}</UniqueIdentifier>
</Filter>
<Filter Include="Source Files\libtomcrypt\pk\asn1">
<UniqueIdentifier>{ffe3f691-7640-4d6d-a972-62b8885c7b1a}</UniqueIdentifier>
</Filter>
<Filter Include="Source Files\libtomcrypt\pk\ecc">
<UniqueIdentifier>{213deedd-9a1e-400d-b023-68e8fba78e18}</UniqueIdentifier>
</Filter>
<Filter Include="Source Files\libtomcrypt\pk\pkcs1">
<UniqueIdentifier>{816de789-6cb1-4be0-864d-e1171bc8e138}</UniqueIdentifier>
</Filter>
<Filter Include="Source Files\libtomcrypt\pk\rsa">
<UniqueIdentifier>{20df7a5a-581d-4f4c-b676-6698f2ff15f1}</UniqueIdentifier>
</Filter>
<Filter Include="Source Files\libtommath">
<UniqueIdentifier>{a385691f-2a7f-4e22-93ab-7d46e356a858}</UniqueIdentifier>
</Filter>
<Filter Include="Source Files\lzma">
<UniqueIdentifier>{0f30053a-90ce-4d0c-bbd8-f209eba9bd42}</UniqueIdentifier>
</Filter>
<Filter Include="Source Files\pklib">
<UniqueIdentifier>{16f73278-7a0c-44ce-9e4a-1d82fa474f10}</UniqueIdentifier>
</Filter>
<Filter Include="Source Files\sparse">
<UniqueIdentifier>{a7380b86-f5f2-4f08-97e8-80d9be6aa833}</UniqueIdentifier>
</Filter>
<Filter Include="Source Files\zlib">
<UniqueIdentifier>{efee3853-4625-4137-b32a-ff3a14b3ad38}</UniqueIdentifier>
</Filter>
<Filter Include="Source Files\jenkins">
<UniqueIdentifier>{248420f6-1bae-41ff-9f20-6bf0cf804ef8}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<None Include="doc\History.txt">
<Filter>Doc Files</Filter>
</None>
<None Include="doc\The MoPaQ File Format 0.9.txt">
<Filter>Doc Files</Filter>
</None>
<None Include="doc\The MoPaQ File Format 1.0.txt">
<Filter>Doc Files</Filter>
</None>
</ItemGroup>
<ItemGroup>
<ClInclude Include="src\StormCommon.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="src\StormLib.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="src\StormPort.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="src\adpcm\adpcm.h">
<Filter>Source Files\adpcm</Filter>
</ClInclude>
<ClInclude Include="src\huffman\huff.h">
<Filter>Source Files\huffman</Filter>
</ClInclude>
<ClInclude Include="src\pklib\pklib.h">
<Filter>Source Files\pklib</Filter>
</ClInclude>
<ClInclude Include="src\sparse\sparse.h">
<Filter>Source Files\sparse</Filter>
</ClInclude>
<ClInclude Include="src\jenkins\lookup.h">
<Filter>Source Files\jenkins</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="src\FileStream.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\SBaseCommon.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\SBaseDumpData.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\SBaseFileTable.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\SCompression.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\SFileAddFile.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\SFileAttributes.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\SFileCompactArchive.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\SFileCreateArchive.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\SFileExtractFile.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\SFileFindFile.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\SFileListFile.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\SFileOpenArchive.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\SFileOpenFileEx.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\SFilePatchArchives.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\SFileReadFile.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\SFileVerify.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="test\Test.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\adpcm\adpcm.cpp">
<Filter>Source Files\adpcm</Filter>
</ClCompile>
<ClCompile Include="src\bzip2\blocksort.c">
<Filter>Source Files\bzip2</Filter>
</ClCompile>
<ClCompile Include="src\bzip2\bzlib.c">
<Filter>Source Files\bzip2</Filter>
</ClCompile>
<ClCompile Include="src\bzip2\compress.c">
<Filter>Source Files\bzip2</Filter>
</ClCompile>
<ClCompile Include="src\bzip2\crctable.c">
<Filter>Source Files\bzip2</Filter>
</ClCompile>
<ClCompile Include="src\bzip2\decompress.c">
<Filter>Source Files\bzip2</Filter>
</ClCompile>
<ClCompile Include="src\bzip2\huffman.c">
<Filter>Source Files\bzip2</Filter>
</ClCompile>
<ClCompile Include="src\bzip2\randtable.c">
<Filter>Source Files\bzip2</Filter>
</ClCompile>
<ClCompile Include="src\huffman\huff.cpp">
<Filter>Source Files\huffman</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\hashes\hash_memory.c">
<Filter>Source Files\libtomcrypt\hashes</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\hashes\md5.c">
<Filter>Source Files\libtomcrypt\hashes</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\hashes\sha1.c">
<Filter>Source Files\libtomcrypt\hashes</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\math\ltm_desc.c">
<Filter>Source Files\libtomcrypt\math</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\math\multi.c">
<Filter>Source Files\libtomcrypt\math</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\math\rand_prime.c">
<Filter>Source Files\libtomcrypt\math</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\misc\base64_decode.c">
<Filter>Source Files\libtomcrypt\misc</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\misc\crypt_argchk.c">
<Filter>Source Files\libtomcrypt\misc</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\misc\crypt_find_hash.c">
<Filter>Source Files\libtomcrypt\misc</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\misc\crypt_find_prng.c">
<Filter>Source Files\libtomcrypt\misc</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\misc\crypt_hash_descriptor.c">
<Filter>Source Files\libtomcrypt\misc</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\misc\crypt_hash_is_valid.c">
<Filter>Source Files\libtomcrypt\misc</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\misc\crypt_libc.c">
<Filter>Source Files\libtomcrypt\misc</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\misc\crypt_ltc_mp_descriptor.c">
<Filter>Source Files\libtomcrypt\misc</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\misc\crypt_prng_descriptor.c">
<Filter>Source Files\libtomcrypt\misc</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\misc\crypt_prng_is_valid.c">
<Filter>Source Files\libtomcrypt\misc</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\misc\crypt_register_hash.c">
<Filter>Source Files\libtomcrypt\misc</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\misc\crypt_register_prng.c">
<Filter>Source Files\libtomcrypt\misc</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\misc\zeromem.c">
<Filter>Source Files\libtomcrypt\misc</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_bit_string.c">
<Filter>Source Files\libtomcrypt\pk\asn1</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_boolean.c">
<Filter>Source Files\libtomcrypt\pk\asn1</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_choice.c">
<Filter>Source Files\libtomcrypt\pk\asn1</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_ia5_string.c">
<Filter>Source Files\libtomcrypt\pk\asn1</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_integer.c">
<Filter>Source Files\libtomcrypt\pk\asn1</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_object_identifier.c">
<Filter>Source Files\libtomcrypt\pk\asn1</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_octet_string.c">
<Filter>Source Files\libtomcrypt\pk\asn1</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_printable_string.c">
<Filter>Source Files\libtomcrypt\pk\asn1</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_sequence_ex.c">
<Filter>Source Files\libtomcrypt\pk\asn1</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_sequence_flexi.c">
<Filter>Source Files\libtomcrypt\pk\asn1</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_sequence_multi.c">
<Filter>Source Files\libtomcrypt\pk\asn1</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_short_integer.c">
<Filter>Source Files\libtomcrypt\pk\asn1</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_utctime.c">
<Filter>Source Files\libtomcrypt\pk\asn1</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_utf8_string.c">
<Filter>Source Files\libtomcrypt\pk\asn1</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_length_bit_string.c">
<Filter>Source Files\libtomcrypt\pk\asn1</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_length_boolean.c">
<Filter>Source Files\libtomcrypt\pk\asn1</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_length_ia5_string.c">
<Filter>Source Files\libtomcrypt\pk\asn1</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_length_integer.c">
<Filter>Source Files\libtomcrypt\pk\asn1</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_length_object_identifier.c">
<Filter>Source Files\libtomcrypt\pk\asn1</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_length_octet_string.c">
<Filter>Source Files\libtomcrypt\pk\asn1</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_length_printable_string.c">
<Filter>Source Files\libtomcrypt\pk\asn1</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_length_sequence.c">
<Filter>Source Files\libtomcrypt\pk\asn1</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_length_short_integer.c">
<Filter>Source Files\libtomcrypt\pk\asn1</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_length_utctime.c">
<Filter>Source Files\libtomcrypt\pk\asn1</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_length_utf8_string.c">
<Filter>Source Files\libtomcrypt\pk\asn1</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_sequence_free.c">
<Filter>Source Files\libtomcrypt\pk\asn1</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\pk\ecc\ltc_ecc_map.c">
<Filter>Source Files\libtomcrypt\pk\ecc</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\pk\ecc\ltc_ecc_mul2add.c">
<Filter>Source Files\libtomcrypt\pk\ecc</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\pk\ecc\ltc_ecc_mulmod.c">
<Filter>Source Files\libtomcrypt\pk\ecc</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\pk\ecc\ltc_ecc_points.c">
<Filter>Source Files\libtomcrypt\pk\ecc</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\pk\ecc\ltc_ecc_projective_add_point.c">
<Filter>Source Files\libtomcrypt\pk\ecc</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\pk\ecc\ltc_ecc_projective_dbl_point.c">
<Filter>Source Files\libtomcrypt\pk\ecc</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\pk\pkcs1\pkcs_1_mgf1.c">
<Filter>Source Files\libtomcrypt\pk\pkcs1</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\pk\pkcs1\pkcs_1_oaep_decode.c">
<Filter>Source Files\libtomcrypt\pk\pkcs1</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\pk\pkcs1\pkcs_1_pss_decode.c">
<Filter>Source Files\libtomcrypt\pk\pkcs1</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\pk\pkcs1\pkcs_1_v1_5_decode.c">
<Filter>Source Files\libtomcrypt\pk\pkcs1</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\pk\rsa\rsa_exptmod.c">
<Filter>Source Files\libtomcrypt\pk\rsa</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\pk\rsa\rsa_free.c">
<Filter>Source Files\libtomcrypt\pk\rsa</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\pk\rsa\rsa_import.c">
<Filter>Source Files\libtomcrypt\pk\rsa</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\pk\rsa\rsa_make_key.c">
<Filter>Source Files\libtomcrypt\pk\rsa</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\pk\rsa\rsa_verify_hash.c">
<Filter>Source Files\libtomcrypt\pk\rsa</Filter>
</ClCompile>
<ClCompile Include="src\libtomcrypt\src\pk\rsa\rsa_verify_simple.c">
<Filter>Source Files\libtomcrypt\pk\rsa</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_fast_mp_invmod.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_fast_mp_montgomery_reduce.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_fast_s_mp_mul_digs.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_fast_s_mp_mul_high_digs.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_fast_s_mp_sqr.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_2expt.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_abs.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_add.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_add_d.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_addmod.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_and.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_clamp.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_clear.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_clear_multi.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_cmp.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_cmp_d.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_cmp_mag.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_cnt_lsb.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_copy.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_count_bits.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_div.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_div_2.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_div_2d.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_div_3.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_div_d.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_dr_is_modulus.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_dr_reduce.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_dr_setup.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_exch.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_expt_d.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_exptmod.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_exptmod_fast.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_exteuclid.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_fread.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_fwrite.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_gcd.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_get_int.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_grow.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_init.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_init_copy.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_init_multi.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_init_set.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_init_set_int.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_init_size.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_invmod.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_invmod_slow.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_is_square.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_jacobi.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_karatsuba_mul.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_karatsuba_sqr.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_lcm.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_lshd.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_mod.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_mod_2d.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_mod_d.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_montgomery_calc_normalization.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_montgomery_reduce.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_montgomery_setup.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_mul.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_mul_2.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_mul_2d.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_mul_d.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_mulmod.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_n_root.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_neg.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_or.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_prime_fermat.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_prime_is_divisible.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_prime_is_prime.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_prime_miller_rabin.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_prime_next_prime.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_prime_rabin_miller_trials.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_prime_random_ex.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_radix_size.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_radix_smap.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_rand.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_read_radix.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_read_signed_bin.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_read_unsigned_bin.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_reduce.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_reduce_2k.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_reduce_2k_l.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_reduce_2k_setup.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_reduce_2k_setup_l.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_reduce_is_2k.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_reduce_is_2k_l.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_reduce_setup.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_rshd.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_set.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_set_int.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_shrink.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_signed_bin_size.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_sqr.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_sqrmod.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_sqrt.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_sub.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_sub_d.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_submod.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_to_signed_bin.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_to_signed_bin_n.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_to_unsigned_bin.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_to_unsigned_bin_n.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_toom_mul.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_toom_sqr.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_toradix.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_toradix_n.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_unsigned_bin_size.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_xor.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_mp_zero.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_prime_tab.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_reverse.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_s_mp_add.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_s_mp_exptmod.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_s_mp_mul_digs.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_s_mp_mul_high_digs.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_s_mp_sqr.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bn_s_mp_sub.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\libtommath\bncore.c">
<Filter>Source Files\libtommath</Filter>
</ClCompile>
<ClCompile Include="src\lzma\C\LzFind.c">
<Filter>Source Files\lzma</Filter>
</ClCompile>
<ClCompile Include="src\lzma\C\LzFindMt.c">
<Filter>Source Files\lzma</Filter>
</ClCompile>
<ClCompile Include="src\lzma\C\LzmaDec.c">
<Filter>Source Files\lzma</Filter>
</ClCompile>
<ClCompile Include="src\lzma\C\LzmaEnc.c">
<Filter>Source Files\lzma</Filter>
</ClCompile>
<ClCompile Include="src\lzma\C\Threads.c">
<Filter>Source Files\lzma</Filter>
</ClCompile>
<ClCompile Include="src\pklib\explode.c">
<Filter>Source Files\pklib</Filter>
</ClCompile>
<ClCompile Include="src\pklib\implode.c">
<Filter>Source Files\pklib</Filter>
</ClCompile>
<ClCompile Include="src\sparse\sparse.cpp">
<Filter>Source Files\sparse</Filter>
</ClCompile>
<ClCompile Include="src\zlib\adler32.c">
<Filter>Source Files\zlib</Filter>
</ClCompile>
<ClCompile Include="src\zlib\compress2.c">
<Filter>Source Files\zlib</Filter>
</ClCompile>
<ClCompile Include="src\zlib\crc32.c">
<Filter>Source Files\zlib</Filter>
</ClCompile>
<ClCompile Include="src\zlib\deflate.c">
<Filter>Source Files\zlib</Filter>
</ClCompile>
<ClCompile Include="src\zlib\inffast.c">
<Filter>Source Files\zlib</Filter>
</ClCompile>
<ClCompile Include="src\zlib\inflate.c">
<Filter>Source Files\zlib</Filter>
</ClCompile>
<ClCompile Include="src\zlib\inftrees.c">
<Filter>Source Files\zlib</Filter>
</ClCompile>
<ClCompile Include="src\zlib\trees.c">
<Filter>Source Files\zlib</Filter>
</ClCompile>
<ClCompile Include="src\zlib\zutil.c">
<Filter>Source Files\zlib</Filter>
</ClCompile>
<ClCompile Include="src\jenkins\lookup3.c">
<Filter>Source Files\jenkins</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<MASM Include="test\x86_ripped_code.asm">
<Filter>Source Files</Filter>
</MASM>
<MASM Include="test\x86_starcraft_lzma.asm">
<Filter>Source Files</Filter>
</MASM>
</ItemGroup>
</Project>

View file

@ -1,110 +0,0 @@

Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "StormLib_dll", "StormLib_dll.vcxproj", "{CB385198-50B1-4CF4-883B-11F042DED6AA}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "StormLib_test", "StormLib_test.vcxproj", "{AA561A7B-26EA-49AF-90E8-C53C1FA2965D}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Storm_dll", "Storm_dll.vcxproj", "{BD600973-C6FA-4CE3-8821-67F6418B7F9C}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "StormLib", "StormLib.vcxproj", "{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
Release|Win32 = Release|Win32
Release|x64 = Release|x64
ReleaseAD|Win32 = ReleaseAD|Win32
ReleaseAD|x64 = ReleaseAD|x64
ReleaseAS|Win32 = ReleaseAS|Win32
ReleaseAS|x64 = ReleaseAS|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}.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
{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}.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
{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}.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
{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}.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
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

View file

@ -1,696 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="DebugAD|Win32">
<Configuration>DebugAD</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="DebugAD|x64">
<Configuration>DebugAD</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="DebugAS|Win32">
<Configuration>DebugAS</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="DebugAS|x64">
<Configuration>DebugAS</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="ReleaseAD|Win32">
<Configuration>ReleaseAD</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="ReleaseAD|x64">
<Configuration>ReleaseAD</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="ReleaseAS|Win32">
<Configuration>ReleaseAS</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="ReleaseAS|x64">
<Configuration>ReleaseAS</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectName>StormLib</ProjectName>
<ProjectGuid>{78424708-1F6E-4D4B-920C-FB6D26847055}</ProjectGuid>
<RootNamespace>StormLib</RootNamespace>
<Keyword>Win32Proj</Keyword>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v110</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v110</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugAS|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v110</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugAD|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v110</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v110</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v110</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugAS|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v110</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugAD|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v110</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugAS|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugAD|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugAS|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugAD|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>
<OutDir Condition="'$(Configuration)|$(Platform)'=='DebugAD|Win32'">./bin/$(ProjectName)/$(Platform)/$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='DebugAD|Win32'">./bin/$(ProjectName)/$(Platform)/$(Configuration)\</IntDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='DebugAD|x64'">./bin/$(ProjectName)/$(Platform)/$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='DebugAD|x64'">./bin/$(ProjectName)/$(Platform)/$(Configuration)\</IntDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='DebugAS|Win32'">./bin/$(ProjectName)/$(Platform)/$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='DebugAS|Win32'">./bin/$(ProjectName)/$(Platform)/$(Configuration)\</IntDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='DebugAS|x64'">./bin/$(ProjectName)/$(Platform)/$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='DebugAS|x64'">./bin/$(ProjectName)/$(Platform)/$(Configuration)\</IntDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|Win32'">./bin/$(ProjectName)/$(Platform)/$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|Win32'">./bin/$(ProjectName)/$(Platform)/$(Configuration)\</IntDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|x64'">./bin/$(ProjectName)/$(Platform)/$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|x64'">./bin/$(ProjectName)/$(Platform)/$(Configuration)\</IntDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|Win32'">./bin/$(ProjectName)/$(Platform)/$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|Win32'">./bin/$(ProjectName)/$(Platform)/$(Configuration)\</IntDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|x64'">./bin/$(ProjectName)/$(Platform)/$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|x64'">./bin/$(ProjectName)/$(Platform)/$(Configuration)\</IntDir>
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='DebugAD|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='DebugAD|Win32'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='DebugAD|Win32'" />
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='DebugAD|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='DebugAD|x64'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='DebugAD|x64'" />
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='DebugAS|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='DebugAS|Win32'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='DebugAS|Win32'" />
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='DebugAS|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='DebugAS|x64'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='DebugAS|x64'" />
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|Win32'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|Win32'" />
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|x64'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|x64'" />
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|Win32'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|Win32'" />
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|x64'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|x64'" />
<TargetName Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|Win32'">$(ProjectName)RAS</TargetName>
<TargetName Condition="'$(Configuration)|$(Platform)'=='DebugAD|Win32'">$(ProjectName)DAD</TargetName>
<TargetName Condition="'$(Configuration)|$(Platform)'=='DebugAS|Win32'">$(ProjectName)DAS</TargetName>
<TargetName Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|Win32'">$(ProjectName)RAD</TargetName>
<TargetName Condition="'$(Configuration)|$(Platform)'=='DebugAD|x64'">$(ProjectName)DAD</TargetName>
<TargetName Condition="'$(Configuration)|$(Platform)'=='DebugAS|x64'">$(ProjectName)DAS</TargetName>
<TargetName Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|x64'">$(ProjectName)RAD</TargetName>
<TargetName Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|x64'">$(ProjectName)RAS</TargetName>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugAD|Win32'">
<ClCompile>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>false</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level1</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Lib>
<OutputFile>$(OutDir)$(ProjectName)DAD.lib</OutputFile>
</Lib>
<PostBuildEvent>
<Command>StormLib.bat $(Platform) $(Configuration)</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugAD|x64'">
<Midl>
<TargetEnvironment>X64</TargetEnvironment>
</Midl>
<ClCompile>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>false</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level1</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Lib>
<OutputFile>$(OutDir)$(ProjectName)DAD.lib</OutputFile>
</Lib>
<PostBuildEvent>
<Command>StormLib.bat $(Platform) $(Configuration)</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugAS|Win32'">
<ClCompile>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>false</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level1</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Lib>
<OutputFile>$(OutDir)$(ProjectName)DAS.lib</OutputFile>
</Lib>
<PostBuildEvent>
<Command>StormLib.bat $(Platform) $(Configuration)</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugAS|x64'">
<Midl>
<TargetEnvironment>X64</TargetEnvironment>
</Midl>
<ClCompile>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>false</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level1</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Lib>
<OutputFile>$(OutDir)$(ProjectName)DAS.lib</OutputFile>
</Lib>
<PostBuildEvent>
<Command>StormLib.bat $(Platform) $(Configuration)</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|Win32'">
<ClCompile>
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level1</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Lib>
<OutputFile>$(OutDir)$(ProjectName)RAD.lib</OutputFile>
</Lib>
<PostBuildEvent>
<Command>StormLib.bat $(Platform) $(Configuration)</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|x64'">
<Midl>
<TargetEnvironment>X64</TargetEnvironment>
</Midl>
<ClCompile>
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level1</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Lib>
<OutputFile>$(OutDir)$(ProjectName)RAD.lib</OutputFile>
</Lib>
<PostBuildEvent>
<Command>StormLib.bat $(Platform) $(Configuration)</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|Win32'">
<ClCompile>
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level1</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Lib>
<OutputFile>$(OutDir)$(ProjectName)RAS.lib</OutputFile>
</Lib>
<PostBuildEvent>
<Command>StormLib.bat $(Platform) $(Configuration)</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|x64'">
<Midl>
<TargetEnvironment>X64</TargetEnvironment>
</Midl>
<ClCompile>
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level1</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Lib>
<OutputFile>$(OutDir)$(ProjectName)RAS.lib</OutputFile>
</Lib>
<PostBuildEvent>
<Command>StormLib.bat $(Platform) $(Configuration)</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemGroup>
<None Include="doc\History.txt" />
<None Include="doc\The MoPaQ File Format 0.9.txt" />
<None Include="doc\The MoPaQ File Format 1.0.txt" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="src\StormCommon.h" />
<ClInclude Include="src\StormLib.h" />
<ClInclude Include="src\StormPort.h" />
<ClInclude Include="src\adpcm\adpcm.h" />
<ClInclude Include="src\huffman\huff.h" />
<ClInclude Include="src\pklib\pklib.h" />
<ClInclude Include="src\sparse\sparse.h" />
<ClInclude Include="src\jenkins\lookup.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="src\FileStream.cpp">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|x64'">Level4</WarningLevel>
</ClCompile>
<ClCompile Include="src\SBaseCommon.cpp">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|x64'">Level4</WarningLevel>
</ClCompile>
<ClCompile Include="src\SBaseFileTable.cpp">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|x64'">Level4</WarningLevel>
</ClCompile>
<ClCompile Include="src\SCompression.cpp">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|x64'">Level4</WarningLevel>
</ClCompile>
<ClCompile Include="src\SFileAddFile.cpp">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|x64'">Level4</WarningLevel>
</ClCompile>
<ClCompile Include="src\SFileAttributes.cpp">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|x64'">Level4</WarningLevel>
</ClCompile>
<ClCompile Include="src\SFileCompactArchive.cpp">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|x64'">Level4</WarningLevel>
</ClCompile>
<ClCompile Include="src\SFileCreateArchive.cpp">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|x64'">Level4</WarningLevel>
</ClCompile>
<ClCompile Include="src\SFileExtractFile.cpp">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|x64'">Level4</WarningLevel>
</ClCompile>
<ClCompile Include="src\SFileFindFile.cpp">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|x64'">Level4</WarningLevel>
</ClCompile>
<ClCompile Include="src\SFileListFile.cpp">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|x64'">Level4</WarningLevel>
</ClCompile>
<ClCompile Include="src\SFileOpenArchive.cpp">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|x64'">Level4</WarningLevel>
</ClCompile>
<ClCompile Include="src\SFileOpenFileEx.cpp">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|x64'">Level4</WarningLevel>
</ClCompile>
<ClCompile Include="src\SFilePatchArchives.cpp" />
<ClCompile Include="src\SFileReadFile.cpp">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|x64'">Level4</WarningLevel>
</ClCompile>
<ClCompile Include="src\SFileVerify.cpp">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|x64'">Level4</WarningLevel>
</ClCompile>
<ClCompile Include="src\adpcm\adpcm.cpp" />
<ClCompile Include="src\bzip2\blocksort.c" />
<ClCompile Include="src\bzip2\bzlib.c" />
<ClCompile Include="src\bzip2\compress.c" />
<ClCompile Include="src\bzip2\crctable.c" />
<ClCompile Include="src\bzip2\decompress.c" />
<ClCompile Include="src\bzip2\huffman.c" />
<ClCompile Include="src\bzip2\randtable.c" />
<ClCompile Include="src\huffman\huff.cpp" />
<ClCompile Include="src\libtomcrypt\src\hashes\hash_memory.c" />
<ClCompile Include="src\libtomcrypt\src\hashes\md5.c" />
<ClCompile Include="src\libtomcrypt\src\hashes\sha1.c" />
<ClCompile Include="src\libtomcrypt\src\math\ltm_desc.c" />
<ClCompile Include="src\libtomcrypt\src\math\multi.c" />
<ClCompile Include="src\libtomcrypt\src\math\rand_prime.c" />
<ClCompile Include="src\libtomcrypt\src\misc\base64_decode.c" />
<ClCompile Include="src\libtomcrypt\src\misc\crypt_argchk.c" />
<ClCompile Include="src\libtomcrypt\src\misc\crypt_find_hash.c" />
<ClCompile Include="src\libtomcrypt\src\misc\crypt_find_prng.c" />
<ClCompile Include="src\libtomcrypt\src\misc\crypt_hash_descriptor.c" />
<ClCompile Include="src\libtomcrypt\src\misc\crypt_hash_is_valid.c" />
<ClCompile Include="src\libtomcrypt\src\misc\crypt_libc.c" />
<ClCompile Include="src\libtomcrypt\src\misc\crypt_ltc_mp_descriptor.c" />
<ClCompile Include="src\libtomcrypt\src\misc\crypt_prng_descriptor.c" />
<ClCompile Include="src\libtomcrypt\src\misc\crypt_prng_is_valid.c" />
<ClCompile Include="src\libtomcrypt\src\misc\crypt_register_hash.c" />
<ClCompile Include="src\libtomcrypt\src\misc\crypt_register_prng.c" />
<ClCompile Include="src\libtomcrypt\src\misc\zeromem.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_bit_string.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_boolean.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_choice.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_ia5_string.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_integer.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_object_identifier.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_octet_string.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_printable_string.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_sequence_ex.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_sequence_flexi.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_sequence_multi.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_short_integer.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_utctime.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_utf8_string.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_length_bit_string.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_length_boolean.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_length_ia5_string.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_length_integer.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_length_object_identifier.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_length_octet_string.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_length_printable_string.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_length_sequence.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_length_short_integer.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_length_utctime.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_length_utf8_string.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_sequence_free.c" />
<ClCompile Include="src\libtomcrypt\src\pk\ecc\ltc_ecc_map.c" />
<ClCompile Include="src\libtomcrypt\src\pk\ecc\ltc_ecc_mul2add.c" />
<ClCompile Include="src\libtomcrypt\src\pk\ecc\ltc_ecc_mulmod.c" />
<ClCompile Include="src\libtomcrypt\src\pk\ecc\ltc_ecc_points.c" />
<ClCompile Include="src\libtomcrypt\src\pk\ecc\ltc_ecc_projective_add_point.c" />
<ClCompile Include="src\libtomcrypt\src\pk\ecc\ltc_ecc_projective_dbl_point.c" />
<ClCompile Include="src\libtomcrypt\src\pk\pkcs1\pkcs_1_mgf1.c" />
<ClCompile Include="src\libtomcrypt\src\pk\pkcs1\pkcs_1_oaep_decode.c" />
<ClCompile Include="src\libtomcrypt\src\pk\pkcs1\pkcs_1_pss_decode.c" />
<ClCompile Include="src\libtomcrypt\src\pk\pkcs1\pkcs_1_v1_5_decode.c" />
<ClCompile Include="src\libtomcrypt\src\pk\rsa\rsa_exptmod.c" />
<ClCompile Include="src\libtomcrypt\src\pk\rsa\rsa_free.c" />
<ClCompile Include="src\libtomcrypt\src\pk\rsa\rsa_import.c" />
<ClCompile Include="src\libtomcrypt\src\pk\rsa\rsa_make_key.c" />
<ClCompile Include="src\libtomcrypt\src\pk\rsa\rsa_verify_hash.c" />
<ClCompile Include="src\libtomcrypt\src\pk\rsa\rsa_verify_simple.c" />
<ClCompile Include="src\libtommath\bn_fast_mp_invmod.c" />
<ClCompile Include="src\libtommath\bn_fast_mp_montgomery_reduce.c" />
<ClCompile Include="src\libtommath\bn_fast_s_mp_mul_digs.c" />
<ClCompile Include="src\libtommath\bn_fast_s_mp_mul_high_digs.c" />
<ClCompile Include="src\libtommath\bn_fast_s_mp_sqr.c" />
<ClCompile Include="src\libtommath\bn_mp_2expt.c" />
<ClCompile Include="src\libtommath\bn_mp_abs.c" />
<ClCompile Include="src\libtommath\bn_mp_add.c" />
<ClCompile Include="src\libtommath\bn_mp_add_d.c" />
<ClCompile Include="src\libtommath\bn_mp_addmod.c" />
<ClCompile Include="src\libtommath\bn_mp_and.c" />
<ClCompile Include="src\libtommath\bn_mp_clamp.c" />
<ClCompile Include="src\libtommath\bn_mp_clear.c" />
<ClCompile Include="src\libtommath\bn_mp_clear_multi.c" />
<ClCompile Include="src\libtommath\bn_mp_cmp.c" />
<ClCompile Include="src\libtommath\bn_mp_cmp_d.c" />
<ClCompile Include="src\libtommath\bn_mp_cmp_mag.c" />
<ClCompile Include="src\libtommath\bn_mp_cnt_lsb.c" />
<ClCompile Include="src\libtommath\bn_mp_copy.c" />
<ClCompile Include="src\libtommath\bn_mp_count_bits.c" />
<ClCompile Include="src\libtommath\bn_mp_div.c" />
<ClCompile Include="src\libtommath\bn_mp_div_2.c" />
<ClCompile Include="src\libtommath\bn_mp_div_2d.c" />
<ClCompile Include="src\libtommath\bn_mp_div_3.c" />
<ClCompile Include="src\libtommath\bn_mp_div_d.c" />
<ClCompile Include="src\libtommath\bn_mp_dr_is_modulus.c" />
<ClCompile Include="src\libtommath\bn_mp_dr_reduce.c" />
<ClCompile Include="src\libtommath\bn_mp_dr_setup.c" />
<ClCompile Include="src\libtommath\bn_mp_exch.c" />
<ClCompile Include="src\libtommath\bn_mp_expt_d.c" />
<ClCompile Include="src\libtommath\bn_mp_exptmod.c" />
<ClCompile Include="src\libtommath\bn_mp_exptmod_fast.c" />
<ClCompile Include="src\libtommath\bn_mp_exteuclid.c" />
<ClCompile Include="src\libtommath\bn_mp_fread.c" />
<ClCompile Include="src\libtommath\bn_mp_fwrite.c" />
<ClCompile Include="src\libtommath\bn_mp_gcd.c" />
<ClCompile Include="src\libtommath\bn_mp_get_int.c" />
<ClCompile Include="src\libtommath\bn_mp_grow.c" />
<ClCompile Include="src\libtommath\bn_mp_init.c" />
<ClCompile Include="src\libtommath\bn_mp_init_copy.c" />
<ClCompile Include="src\libtommath\bn_mp_init_multi.c" />
<ClCompile Include="src\libtommath\bn_mp_init_set.c" />
<ClCompile Include="src\libtommath\bn_mp_init_set_int.c" />
<ClCompile Include="src\libtommath\bn_mp_init_size.c" />
<ClCompile Include="src\libtommath\bn_mp_invmod.c" />
<ClCompile Include="src\libtommath\bn_mp_invmod_slow.c" />
<ClCompile Include="src\libtommath\bn_mp_is_square.c" />
<ClCompile Include="src\libtommath\bn_mp_jacobi.c" />
<ClCompile Include="src\libtommath\bn_mp_karatsuba_mul.c" />
<ClCompile Include="src\libtommath\bn_mp_karatsuba_sqr.c" />
<ClCompile Include="src\libtommath\bn_mp_lcm.c" />
<ClCompile Include="src\libtommath\bn_mp_lshd.c" />
<ClCompile Include="src\libtommath\bn_mp_mod.c" />
<ClCompile Include="src\libtommath\bn_mp_mod_2d.c" />
<ClCompile Include="src\libtommath\bn_mp_mod_d.c" />
<ClCompile Include="src\libtommath\bn_mp_montgomery_calc_normalization.c" />
<ClCompile Include="src\libtommath\bn_mp_montgomery_reduce.c" />
<ClCompile Include="src\libtommath\bn_mp_montgomery_setup.c" />
<ClCompile Include="src\libtommath\bn_mp_mul.c" />
<ClCompile Include="src\libtommath\bn_mp_mul_2.c" />
<ClCompile Include="src\libtommath\bn_mp_mul_2d.c" />
<ClCompile Include="src\libtommath\bn_mp_mul_d.c" />
<ClCompile Include="src\libtommath\bn_mp_mulmod.c" />
<ClCompile Include="src\libtommath\bn_mp_n_root.c" />
<ClCompile Include="src\libtommath\bn_mp_neg.c" />
<ClCompile Include="src\libtommath\bn_mp_or.c" />
<ClCompile Include="src\libtommath\bn_mp_prime_fermat.c" />
<ClCompile Include="src\libtommath\bn_mp_prime_is_divisible.c" />
<ClCompile Include="src\libtommath\bn_mp_prime_is_prime.c" />
<ClCompile Include="src\libtommath\bn_mp_prime_miller_rabin.c" />
<ClCompile Include="src\libtommath\bn_mp_prime_next_prime.c" />
<ClCompile Include="src\libtommath\bn_mp_prime_rabin_miller_trials.c" />
<ClCompile Include="src\libtommath\bn_mp_prime_random_ex.c" />
<ClCompile Include="src\libtommath\bn_mp_radix_size.c" />
<ClCompile Include="src\libtommath\bn_mp_radix_smap.c" />
<ClCompile Include="src\libtommath\bn_mp_rand.c" />
<ClCompile Include="src\libtommath\bn_mp_read_radix.c" />
<ClCompile Include="src\libtommath\bn_mp_read_signed_bin.c" />
<ClCompile Include="src\libtommath\bn_mp_read_unsigned_bin.c" />
<ClCompile Include="src\libtommath\bn_mp_reduce.c" />
<ClCompile Include="src\libtommath\bn_mp_reduce_2k.c" />
<ClCompile Include="src\libtommath\bn_mp_reduce_2k_l.c" />
<ClCompile Include="src\libtommath\bn_mp_reduce_2k_setup.c" />
<ClCompile Include="src\libtommath\bn_mp_reduce_2k_setup_l.c" />
<ClCompile Include="src\libtommath\bn_mp_reduce_is_2k.c" />
<ClCompile Include="src\libtommath\bn_mp_reduce_is_2k_l.c" />
<ClCompile Include="src\libtommath\bn_mp_reduce_setup.c" />
<ClCompile Include="src\libtommath\bn_mp_rshd.c" />
<ClCompile Include="src\libtommath\bn_mp_set.c" />
<ClCompile Include="src\libtommath\bn_mp_set_int.c" />
<ClCompile Include="src\libtommath\bn_mp_shrink.c" />
<ClCompile Include="src\libtommath\bn_mp_signed_bin_size.c" />
<ClCompile Include="src\libtommath\bn_mp_sqr.c" />
<ClCompile Include="src\libtommath\bn_mp_sqrmod.c" />
<ClCompile Include="src\libtommath\bn_mp_sqrt.c" />
<ClCompile Include="src\libtommath\bn_mp_sub.c" />
<ClCompile Include="src\libtommath\bn_mp_sub_d.c" />
<ClCompile Include="src\libtommath\bn_mp_submod.c" />
<ClCompile Include="src\libtommath\bn_mp_to_signed_bin.c" />
<ClCompile Include="src\libtommath\bn_mp_to_signed_bin_n.c" />
<ClCompile Include="src\libtommath\bn_mp_to_unsigned_bin.c" />
<ClCompile Include="src\libtommath\bn_mp_to_unsigned_bin_n.c" />
<ClCompile Include="src\libtommath\bn_mp_toom_mul.c" />
<ClCompile Include="src\libtommath\bn_mp_toom_sqr.c" />
<ClCompile Include="src\libtommath\bn_mp_toradix.c" />
<ClCompile Include="src\libtommath\bn_mp_toradix_n.c" />
<ClCompile Include="src\libtommath\bn_mp_unsigned_bin_size.c" />
<ClCompile Include="src\libtommath\bn_mp_xor.c" />
<ClCompile Include="src\libtommath\bn_mp_zero.c" />
<ClCompile Include="src\libtommath\bn_prime_tab.c" />
<ClCompile Include="src\libtommath\bn_reverse.c" />
<ClCompile Include="src\libtommath\bn_s_mp_add.c" />
<ClCompile Include="src\libtommath\bn_s_mp_exptmod.c" />
<ClCompile Include="src\libtommath\bn_s_mp_mul_digs.c" />
<ClCompile Include="src\libtommath\bn_s_mp_mul_high_digs.c" />
<ClCompile Include="src\libtommath\bn_s_mp_sqr.c" />
<ClCompile Include="src\libtommath\bn_s_mp_sub.c" />
<ClCompile Include="src\libtommath\bncore.c" />
<ClCompile Include="src\lzma\C\LzFind.c" />
<ClCompile Include="src\lzma\C\LzFindMt.c" />
<ClCompile Include="src\lzma\C\LzmaDec.c" />
<ClCompile Include="src\lzma\C\LzmaEnc.c" />
<ClCompile Include="src\lzma\C\Threads.c" />
<ClCompile Include="src\pklib\explode.c" />
<ClCompile Include="src\pklib\implode.c" />
<ClCompile Include="src\sparse\sparse.cpp" />
<ClCompile Include="src\zlib\adler32.c" />
<ClCompile Include="src\zlib\compress2.c" />
<ClCompile Include="src\zlib\crc32.c" />
<ClCompile Include="src\zlib\deflate.c" />
<ClCompile Include="src\zlib\inffast.c" />
<ClCompile Include="src\zlib\inflate.c" />
<ClCompile Include="src\zlib\inftrees.c" />
<ClCompile Include="src\zlib\trees.c" />
<ClCompile Include="src\zlib\zutil.c" />
<ClCompile Include="src\jenkins\lookup3.c" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View file

@ -1,696 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="DebugAD|Win32">
<Configuration>DebugAD</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="DebugAD|x64">
<Configuration>DebugAD</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="DebugAS|Win32">
<Configuration>DebugAS</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="DebugAS|x64">
<Configuration>DebugAS</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="ReleaseAD|Win32">
<Configuration>ReleaseAD</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="ReleaseAD|x64">
<Configuration>ReleaseAD</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="ReleaseAS|Win32">
<Configuration>ReleaseAS</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="ReleaseAS|x64">
<Configuration>ReleaseAS</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectName>StormLib</ProjectName>
<ProjectGuid>{78424708-1F6E-4D4B-920C-FB6D26847055}</ProjectGuid>
<RootNamespace>StormLib</RootNamespace>
<Keyword>Win32Proj</Keyword>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v120</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v120</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugAS|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v120</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugAD|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v120</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v120</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v120</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugAS|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v120</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugAD|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v120</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugAS|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugAD|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugAS|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugAD|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>
<OutDir Condition="'$(Configuration)|$(Platform)'=='DebugAD|Win32'">./bin/$(ProjectName)/$(Platform)/$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='DebugAD|Win32'">./bin/$(ProjectName)/$(Platform)/$(Configuration)\</IntDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='DebugAD|x64'">./bin/$(ProjectName)/$(Platform)/$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='DebugAD|x64'">./bin/$(ProjectName)/$(Platform)/$(Configuration)\</IntDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='DebugAS|Win32'">./bin/$(ProjectName)/$(Platform)/$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='DebugAS|Win32'">./bin/$(ProjectName)/$(Platform)/$(Configuration)\</IntDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='DebugAS|x64'">./bin/$(ProjectName)/$(Platform)/$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='DebugAS|x64'">./bin/$(ProjectName)/$(Platform)/$(Configuration)\</IntDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|Win32'">./bin/$(ProjectName)/$(Platform)/$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|Win32'">./bin/$(ProjectName)/$(Platform)/$(Configuration)\</IntDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|x64'">./bin/$(ProjectName)/$(Platform)/$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|x64'">./bin/$(ProjectName)/$(Platform)/$(Configuration)\</IntDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|Win32'">./bin/$(ProjectName)/$(Platform)/$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|Win32'">./bin/$(ProjectName)/$(Platform)/$(Configuration)\</IntDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|x64'">./bin/$(ProjectName)/$(Platform)/$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|x64'">./bin/$(ProjectName)/$(Platform)/$(Configuration)\</IntDir>
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='DebugAD|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='DebugAD|Win32'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='DebugAD|Win32'" />
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='DebugAD|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='DebugAD|x64'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='DebugAD|x64'" />
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='DebugAS|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='DebugAS|Win32'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='DebugAS|Win32'" />
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='DebugAS|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='DebugAS|x64'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='DebugAS|x64'" />
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|Win32'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|Win32'" />
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|x64'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|x64'" />
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|Win32'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|Win32'" />
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|x64'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|x64'" />
<TargetName Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|Win32'">$(ProjectName)RAS</TargetName>
<TargetName Condition="'$(Configuration)|$(Platform)'=='DebugAD|Win32'">$(ProjectName)DAD</TargetName>
<TargetName Condition="'$(Configuration)|$(Platform)'=='DebugAS|Win32'">$(ProjectName)DAS</TargetName>
<TargetName Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|Win32'">$(ProjectName)RAD</TargetName>
<TargetName Condition="'$(Configuration)|$(Platform)'=='DebugAD|x64'">$(ProjectName)DAD</TargetName>
<TargetName Condition="'$(Configuration)|$(Platform)'=='DebugAS|x64'">$(ProjectName)DAS</TargetName>
<TargetName Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|x64'">$(ProjectName)RAD</TargetName>
<TargetName Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|x64'">$(ProjectName)RAS</TargetName>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugAD|Win32'">
<ClCompile>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>false</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level1</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Lib>
<OutputFile>$(OutDir)$(ProjectName)DAD.lib</OutputFile>
</Lib>
<PostBuildEvent>
<Command>StormLib.bat $(Platform) $(Configuration)</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugAD|x64'">
<Midl>
<TargetEnvironment>X64</TargetEnvironment>
</Midl>
<ClCompile>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>false</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level1</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Lib>
<OutputFile>$(OutDir)$(ProjectName)DAD.lib</OutputFile>
</Lib>
<PostBuildEvent>
<Command>StormLib.bat $(Platform) $(Configuration)</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugAS|Win32'">
<ClCompile>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>false</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level1</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Lib>
<OutputFile>$(OutDir)$(ProjectName)DAS.lib</OutputFile>
</Lib>
<PostBuildEvent>
<Command>StormLib.bat $(Platform) $(Configuration)</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugAS|x64'">
<Midl>
<TargetEnvironment>X64</TargetEnvironment>
</Midl>
<ClCompile>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>false</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level1</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Lib>
<OutputFile>$(OutDir)$(ProjectName)DAS.lib</OutputFile>
</Lib>
<PostBuildEvent>
<Command>StormLib.bat $(Platform) $(Configuration)</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|Win32'">
<ClCompile>
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level1</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Lib>
<OutputFile>$(OutDir)$(ProjectName)RAD.lib</OutputFile>
</Lib>
<PostBuildEvent>
<Command>StormLib.bat $(Platform) $(Configuration)</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|x64'">
<Midl>
<TargetEnvironment>X64</TargetEnvironment>
</Midl>
<ClCompile>
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level1</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Lib>
<OutputFile>$(OutDir)$(ProjectName)RAD.lib</OutputFile>
</Lib>
<PostBuildEvent>
<Command>StormLib.bat $(Platform) $(Configuration)</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|Win32'">
<ClCompile>
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level1</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Lib>
<OutputFile>$(OutDir)$(ProjectName)RAS.lib</OutputFile>
</Lib>
<PostBuildEvent>
<Command>StormLib.bat $(Platform) $(Configuration)</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|x64'">
<Midl>
<TargetEnvironment>X64</TargetEnvironment>
</Midl>
<ClCompile>
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level1</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Lib>
<OutputFile>$(OutDir)$(ProjectName)RAS.lib</OutputFile>
</Lib>
<PostBuildEvent>
<Command>StormLib.bat $(Platform) $(Configuration)</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemGroup>
<None Include="doc\History.txt" />
<None Include="doc\The MoPaQ File Format 0.9.txt" />
<None Include="doc\The MoPaQ File Format 1.0.txt" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="src\StormCommon.h" />
<ClInclude Include="src\StormLib.h" />
<ClInclude Include="src\StormPort.h" />
<ClInclude Include="src\adpcm\adpcm.h" />
<ClInclude Include="src\huffman\huff.h" />
<ClInclude Include="src\pklib\pklib.h" />
<ClInclude Include="src\sparse\sparse.h" />
<ClInclude Include="src\jenkins\lookup.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="src\FileStream.cpp">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|x64'">Level4</WarningLevel>
</ClCompile>
<ClCompile Include="src\SBaseCommon.cpp">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|x64'">Level4</WarningLevel>
</ClCompile>
<ClCompile Include="src\SBaseFileTable.cpp">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|x64'">Level4</WarningLevel>
</ClCompile>
<ClCompile Include="src\SCompression.cpp">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|x64'">Level4</WarningLevel>
</ClCompile>
<ClCompile Include="src\SFileAddFile.cpp">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|x64'">Level4</WarningLevel>
</ClCompile>
<ClCompile Include="src\SFileAttributes.cpp">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|x64'">Level4</WarningLevel>
</ClCompile>
<ClCompile Include="src\SFileCompactArchive.cpp">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|x64'">Level4</WarningLevel>
</ClCompile>
<ClCompile Include="src\SFileCreateArchive.cpp">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|x64'">Level4</WarningLevel>
</ClCompile>
<ClCompile Include="src\SFileExtractFile.cpp">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|x64'">Level4</WarningLevel>
</ClCompile>
<ClCompile Include="src\SFileFindFile.cpp">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|x64'">Level4</WarningLevel>
</ClCompile>
<ClCompile Include="src\SFileListFile.cpp">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|x64'">Level4</WarningLevel>
</ClCompile>
<ClCompile Include="src\SFileOpenArchive.cpp">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|x64'">Level4</WarningLevel>
</ClCompile>
<ClCompile Include="src\SFileOpenFileEx.cpp">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|x64'">Level4</WarningLevel>
</ClCompile>
<ClCompile Include="src\SFilePatchArchives.cpp" />
<ClCompile Include="src\SFileReadFile.cpp">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|x64'">Level4</WarningLevel>
</ClCompile>
<ClCompile Include="src\SFileVerify.cpp">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|x64'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|Win32'">Level4</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|x64'">Level4</WarningLevel>
</ClCompile>
<ClCompile Include="src\adpcm\adpcm.cpp" />
<ClCompile Include="src\bzip2\blocksort.c" />
<ClCompile Include="src\bzip2\bzlib.c" />
<ClCompile Include="src\bzip2\compress.c" />
<ClCompile Include="src\bzip2\crctable.c" />
<ClCompile Include="src\bzip2\decompress.c" />
<ClCompile Include="src\bzip2\huffman.c" />
<ClCompile Include="src\bzip2\randtable.c" />
<ClCompile Include="src\huffman\huff.cpp" />
<ClCompile Include="src\libtomcrypt\src\hashes\hash_memory.c" />
<ClCompile Include="src\libtomcrypt\src\hashes\md5.c" />
<ClCompile Include="src\libtomcrypt\src\hashes\sha1.c" />
<ClCompile Include="src\libtomcrypt\src\math\ltm_desc.c" />
<ClCompile Include="src\libtomcrypt\src\math\multi.c" />
<ClCompile Include="src\libtomcrypt\src\math\rand_prime.c" />
<ClCompile Include="src\libtomcrypt\src\misc\base64_decode.c" />
<ClCompile Include="src\libtomcrypt\src\misc\crypt_argchk.c" />
<ClCompile Include="src\libtomcrypt\src\misc\crypt_find_hash.c" />
<ClCompile Include="src\libtomcrypt\src\misc\crypt_find_prng.c" />
<ClCompile Include="src\libtomcrypt\src\misc\crypt_hash_descriptor.c" />
<ClCompile Include="src\libtomcrypt\src\misc\crypt_hash_is_valid.c" />
<ClCompile Include="src\libtomcrypt\src\misc\crypt_libc.c" />
<ClCompile Include="src\libtomcrypt\src\misc\crypt_ltc_mp_descriptor.c" />
<ClCompile Include="src\libtomcrypt\src\misc\crypt_prng_descriptor.c" />
<ClCompile Include="src\libtomcrypt\src\misc\crypt_prng_is_valid.c" />
<ClCompile Include="src\libtomcrypt\src\misc\crypt_register_hash.c" />
<ClCompile Include="src\libtomcrypt\src\misc\crypt_register_prng.c" />
<ClCompile Include="src\libtomcrypt\src\misc\zeromem.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_bit_string.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_boolean.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_choice.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_ia5_string.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_integer.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_object_identifier.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_octet_string.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_printable_string.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_sequence_ex.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_sequence_flexi.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_sequence_multi.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_short_integer.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_utctime.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_utf8_string.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_length_bit_string.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_length_boolean.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_length_ia5_string.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_length_integer.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_length_object_identifier.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_length_octet_string.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_length_printable_string.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_length_sequence.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_length_short_integer.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_length_utctime.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_length_utf8_string.c" />
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_sequence_free.c" />
<ClCompile Include="src\libtomcrypt\src\pk\ecc\ltc_ecc_map.c" />
<ClCompile Include="src\libtomcrypt\src\pk\ecc\ltc_ecc_mul2add.c" />
<ClCompile Include="src\libtomcrypt\src\pk\ecc\ltc_ecc_mulmod.c" />
<ClCompile Include="src\libtomcrypt\src\pk\ecc\ltc_ecc_points.c" />
<ClCompile Include="src\libtomcrypt\src\pk\ecc\ltc_ecc_projective_add_point.c" />
<ClCompile Include="src\libtomcrypt\src\pk\ecc\ltc_ecc_projective_dbl_point.c" />
<ClCompile Include="src\libtomcrypt\src\pk\pkcs1\pkcs_1_mgf1.c" />
<ClCompile Include="src\libtomcrypt\src\pk\pkcs1\pkcs_1_oaep_decode.c" />
<ClCompile Include="src\libtomcrypt\src\pk\pkcs1\pkcs_1_pss_decode.c" />
<ClCompile Include="src\libtomcrypt\src\pk\pkcs1\pkcs_1_v1_5_decode.c" />
<ClCompile Include="src\libtomcrypt\src\pk\rsa\rsa_exptmod.c" />
<ClCompile Include="src\libtomcrypt\src\pk\rsa\rsa_free.c" />
<ClCompile Include="src\libtomcrypt\src\pk\rsa\rsa_import.c" />
<ClCompile Include="src\libtomcrypt\src\pk\rsa\rsa_make_key.c" />
<ClCompile Include="src\libtomcrypt\src\pk\rsa\rsa_verify_hash.c" />
<ClCompile Include="src\libtomcrypt\src\pk\rsa\rsa_verify_simple.c" />
<ClCompile Include="src\libtommath\bn_fast_mp_invmod.c" />
<ClCompile Include="src\libtommath\bn_fast_mp_montgomery_reduce.c" />
<ClCompile Include="src\libtommath\bn_fast_s_mp_mul_digs.c" />
<ClCompile Include="src\libtommath\bn_fast_s_mp_mul_high_digs.c" />
<ClCompile Include="src\libtommath\bn_fast_s_mp_sqr.c" />
<ClCompile Include="src\libtommath\bn_mp_2expt.c" />
<ClCompile Include="src\libtommath\bn_mp_abs.c" />
<ClCompile Include="src\libtommath\bn_mp_add.c" />
<ClCompile Include="src\libtommath\bn_mp_add_d.c" />
<ClCompile Include="src\libtommath\bn_mp_addmod.c" />
<ClCompile Include="src\libtommath\bn_mp_and.c" />
<ClCompile Include="src\libtommath\bn_mp_clamp.c" />
<ClCompile Include="src\libtommath\bn_mp_clear.c" />
<ClCompile Include="src\libtommath\bn_mp_clear_multi.c" />
<ClCompile Include="src\libtommath\bn_mp_cmp.c" />
<ClCompile Include="src\libtommath\bn_mp_cmp_d.c" />
<ClCompile Include="src\libtommath\bn_mp_cmp_mag.c" />
<ClCompile Include="src\libtommath\bn_mp_cnt_lsb.c" />
<ClCompile Include="src\libtommath\bn_mp_copy.c" />
<ClCompile Include="src\libtommath\bn_mp_count_bits.c" />
<ClCompile Include="src\libtommath\bn_mp_div.c" />
<ClCompile Include="src\libtommath\bn_mp_div_2.c" />
<ClCompile Include="src\libtommath\bn_mp_div_2d.c" />
<ClCompile Include="src\libtommath\bn_mp_div_3.c" />
<ClCompile Include="src\libtommath\bn_mp_div_d.c" />
<ClCompile Include="src\libtommath\bn_mp_dr_is_modulus.c" />
<ClCompile Include="src\libtommath\bn_mp_dr_reduce.c" />
<ClCompile Include="src\libtommath\bn_mp_dr_setup.c" />
<ClCompile Include="src\libtommath\bn_mp_exch.c" />
<ClCompile Include="src\libtommath\bn_mp_expt_d.c" />
<ClCompile Include="src\libtommath\bn_mp_exptmod.c" />
<ClCompile Include="src\libtommath\bn_mp_exptmod_fast.c" />
<ClCompile Include="src\libtommath\bn_mp_exteuclid.c" />
<ClCompile Include="src\libtommath\bn_mp_fread.c" />
<ClCompile Include="src\libtommath\bn_mp_fwrite.c" />
<ClCompile Include="src\libtommath\bn_mp_gcd.c" />
<ClCompile Include="src\libtommath\bn_mp_get_int.c" />
<ClCompile Include="src\libtommath\bn_mp_grow.c" />
<ClCompile Include="src\libtommath\bn_mp_init.c" />
<ClCompile Include="src\libtommath\bn_mp_init_copy.c" />
<ClCompile Include="src\libtommath\bn_mp_init_multi.c" />
<ClCompile Include="src\libtommath\bn_mp_init_set.c" />
<ClCompile Include="src\libtommath\bn_mp_init_set_int.c" />
<ClCompile Include="src\libtommath\bn_mp_init_size.c" />
<ClCompile Include="src\libtommath\bn_mp_invmod.c" />
<ClCompile Include="src\libtommath\bn_mp_invmod_slow.c" />
<ClCompile Include="src\libtommath\bn_mp_is_square.c" />
<ClCompile Include="src\libtommath\bn_mp_jacobi.c" />
<ClCompile Include="src\libtommath\bn_mp_karatsuba_mul.c" />
<ClCompile Include="src\libtommath\bn_mp_karatsuba_sqr.c" />
<ClCompile Include="src\libtommath\bn_mp_lcm.c" />
<ClCompile Include="src\libtommath\bn_mp_lshd.c" />
<ClCompile Include="src\libtommath\bn_mp_mod.c" />
<ClCompile Include="src\libtommath\bn_mp_mod_2d.c" />
<ClCompile Include="src\libtommath\bn_mp_mod_d.c" />
<ClCompile Include="src\libtommath\bn_mp_montgomery_calc_normalization.c" />
<ClCompile Include="src\libtommath\bn_mp_montgomery_reduce.c" />
<ClCompile Include="src\libtommath\bn_mp_montgomery_setup.c" />
<ClCompile Include="src\libtommath\bn_mp_mul.c" />
<ClCompile Include="src\libtommath\bn_mp_mul_2.c" />
<ClCompile Include="src\libtommath\bn_mp_mul_2d.c" />
<ClCompile Include="src\libtommath\bn_mp_mul_d.c" />
<ClCompile Include="src\libtommath\bn_mp_mulmod.c" />
<ClCompile Include="src\libtommath\bn_mp_n_root.c" />
<ClCompile Include="src\libtommath\bn_mp_neg.c" />
<ClCompile Include="src\libtommath\bn_mp_or.c" />
<ClCompile Include="src\libtommath\bn_mp_prime_fermat.c" />
<ClCompile Include="src\libtommath\bn_mp_prime_is_divisible.c" />
<ClCompile Include="src\libtommath\bn_mp_prime_is_prime.c" />
<ClCompile Include="src\libtommath\bn_mp_prime_miller_rabin.c" />
<ClCompile Include="src\libtommath\bn_mp_prime_next_prime.c" />
<ClCompile Include="src\libtommath\bn_mp_prime_rabin_miller_trials.c" />
<ClCompile Include="src\libtommath\bn_mp_prime_random_ex.c" />
<ClCompile Include="src\libtommath\bn_mp_radix_size.c" />
<ClCompile Include="src\libtommath\bn_mp_radix_smap.c" />
<ClCompile Include="src\libtommath\bn_mp_rand.c" />
<ClCompile Include="src\libtommath\bn_mp_read_radix.c" />
<ClCompile Include="src\libtommath\bn_mp_read_signed_bin.c" />
<ClCompile Include="src\libtommath\bn_mp_read_unsigned_bin.c" />
<ClCompile Include="src\libtommath\bn_mp_reduce.c" />
<ClCompile Include="src\libtommath\bn_mp_reduce_2k.c" />
<ClCompile Include="src\libtommath\bn_mp_reduce_2k_l.c" />
<ClCompile Include="src\libtommath\bn_mp_reduce_2k_setup.c" />
<ClCompile Include="src\libtommath\bn_mp_reduce_2k_setup_l.c" />
<ClCompile Include="src\libtommath\bn_mp_reduce_is_2k.c" />
<ClCompile Include="src\libtommath\bn_mp_reduce_is_2k_l.c" />
<ClCompile Include="src\libtommath\bn_mp_reduce_setup.c" />
<ClCompile Include="src\libtommath\bn_mp_rshd.c" />
<ClCompile Include="src\libtommath\bn_mp_set.c" />
<ClCompile Include="src\libtommath\bn_mp_set_int.c" />
<ClCompile Include="src\libtommath\bn_mp_shrink.c" />
<ClCompile Include="src\libtommath\bn_mp_signed_bin_size.c" />
<ClCompile Include="src\libtommath\bn_mp_sqr.c" />
<ClCompile Include="src\libtommath\bn_mp_sqrmod.c" />
<ClCompile Include="src\libtommath\bn_mp_sqrt.c" />
<ClCompile Include="src\libtommath\bn_mp_sub.c" />
<ClCompile Include="src\libtommath\bn_mp_sub_d.c" />
<ClCompile Include="src\libtommath\bn_mp_submod.c" />
<ClCompile Include="src\libtommath\bn_mp_to_signed_bin.c" />
<ClCompile Include="src\libtommath\bn_mp_to_signed_bin_n.c" />
<ClCompile Include="src\libtommath\bn_mp_to_unsigned_bin.c" />
<ClCompile Include="src\libtommath\bn_mp_to_unsigned_bin_n.c" />
<ClCompile Include="src\libtommath\bn_mp_toom_mul.c" />
<ClCompile Include="src\libtommath\bn_mp_toom_sqr.c" />
<ClCompile Include="src\libtommath\bn_mp_toradix.c" />
<ClCompile Include="src\libtommath\bn_mp_toradix_n.c" />
<ClCompile Include="src\libtommath\bn_mp_unsigned_bin_size.c" />
<ClCompile Include="src\libtommath\bn_mp_xor.c" />
<ClCompile Include="src\libtommath\bn_mp_zero.c" />
<ClCompile Include="src\libtommath\bn_prime_tab.c" />
<ClCompile Include="src\libtommath\bn_reverse.c" />
<ClCompile Include="src\libtommath\bn_s_mp_add.c" />
<ClCompile Include="src\libtommath\bn_s_mp_exptmod.c" />
<ClCompile Include="src\libtommath\bn_s_mp_mul_digs.c" />
<ClCompile Include="src\libtommath\bn_s_mp_mul_high_digs.c" />
<ClCompile Include="src\libtommath\bn_s_mp_sqr.c" />
<ClCompile Include="src\libtommath\bn_s_mp_sub.c" />
<ClCompile Include="src\libtommath\bncore.c" />
<ClCompile Include="src\lzma\C\LzFind.c" />
<ClCompile Include="src\lzma\C\LzFindMt.c" />
<ClCompile Include="src\lzma\C\LzmaDec.c" />
<ClCompile Include="src\lzma\C\LzmaEnc.c" />
<ClCompile Include="src\lzma\C\Threads.c" />
<ClCompile Include="src\pklib\explode.c" />
<ClCompile Include="src\pklib\implode.c" />
<ClCompile Include="src\sparse\sparse.cpp" />
<ClCompile Include="src\zlib\adler32.c" />
<ClCompile Include="src\zlib\compress2.c" />
<ClCompile Include="src\zlib\crc32.c" />
<ClCompile Include="src\zlib\deflate.c" />
<ClCompile Include="src\zlib\inffast.c" />
<ClCompile Include="src\zlib\inflate.c" />
<ClCompile Include="src\zlib\inftrees.c" />
<ClCompile Include="src\zlib\trees.c" />
<ClCompile Include="src\zlib\zutil.c" />
<ClCompile Include="src\jenkins\lookup3.c" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View file

@ -1,18 +0,0 @@
@echo off
rem Post-build batch for StormDll project
rem Called as StormDll.bat $(PlatformName) $(ConfigurationName)
rem Example: StormDll.bat x64 Debug
if x%1 == xWin32 goto PlatformWin32
if x%1 == xx64 goto PlatformWin64
goto exit
:PlatformWin32
copy .\bin\Storm_dll\%1\%2\*.lib .
goto exit
:PlatformWin64
copy .\bin\Storm_dll\%1\%2\*.lib .
goto exit
:exit

Binary file not shown.

View file

@ -1,206 +0,0 @@
<?xml version="1.0" encoding="windows-1250"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="9,00"
Name="Storm_dll"
ProjectGUID="{BD600973-C6FA-4CE3-8821-67F6418B7F9C}"
RootNamespace="Storm_dll"
Keyword="Win32Proj"
TargetFrameworkVersion="131072"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory=".\bin\Storm_dll\$(PlatformName)\$(ConfigurationName)"
IntermediateDirectory=".\bin\Storm_dll\$(PlatformName)\$(ConfigurationName)"
ConfigurationType="2"
CharacterSet="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;Storm_dll_EXPORTS"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
UsePrecompiledHeader="0"
WarningLevel="3"
DebugInformationFormat="4"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
OutputFile="$(OutDir)\storm.dll"
LinkIncremental="2"
GenerateManifest="false"
ModuleDefinitionFile=".\Storm_dll\Storm_dll.def"
GenerateDebugInformation="true"
SubSystem="2"
BaseAddress="0x15000000"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
CommandLine="Storm_dll.bat $(PlatformName) $(ConfigurationName)"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory=".\bin\Storm_dll\$(PlatformName)\$(ConfigurationName)"
IntermediateDirectory=".\bin\Storm_dll\$(PlatformName)\$(ConfigurationName)"
ConfigurationType="2"
CharacterSet="1"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;Storm_dll_EXPORTS"
RuntimeLibrary="2"
UsePrecompiledHeader="0"
WarningLevel="3"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
OutputFile="$(OutDir)\storm.dll"
LinkIncremental="1"
GenerateManifest="false"
ModuleDefinitionFile=".\Storm_dll\storm_dll.def"
GenerateDebugInformation="true"
SubSystem="2"
OptimizeReferences="2"
EnableCOMDATFolding="2"
BaseAddress="0x15000000"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
CommandLine="Storm_dll.bat $(PlatformName) $(ConfigurationName)"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
RelativePath=".\Storm_dll\storm_dll.cpp"
>
</File>
<File
RelativePath=".\storm_dll\storm_dll.def"
>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
<File
RelativePath=".\Storm_dll\storm_dll.h"
>
</File>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View file

@ -1,121 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectName>Storm_dll</ProjectName>
<ProjectGuid>{BD600973-C6FA-4CE3-8821-67F6418B7F9C}</ProjectGuid>
<RootNamespace>Storm_dll</RootNamespace>
<Keyword>Win32Proj</Keyword>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">.\bin\Storm_dll\$(Platform)\$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">.\bin\Storm_dll\$(Platform)\$(Configuration)\</IntDir>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
<GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</GenerateManifest>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">.\bin\Storm_dll\$(Platform)\$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">.\bin\Storm_dll\$(Platform)\$(Configuration)\</IntDir>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
<GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</GenerateManifest>
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;Storm_dll_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>true</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
</ClCompile>
<Link>
<OutputFile>$(OutDir)storm.dll</OutputFile>
<ModuleDefinitionFile>.\Storm_dll\Storm_dll.def</ModuleDefinitionFile>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
<BaseAddress>0x15000000</BaseAddress>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<DataExecutionPrevention>
</DataExecutionPrevention>
<TargetMachine>MachineX86</TargetMachine>
</Link>
<PostBuildEvent>
<Command>Storm_dll.bat $(Platform) $(Configuration)</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;Storm_dll_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<OutputFile>$(OutDir)storm.dll</OutputFile>
<ModuleDefinitionFile>.\Storm_dll\storm_dll.def</ModuleDefinitionFile>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<BaseAddress>0x15000000</BaseAddress>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<DataExecutionPrevention>
</DataExecutionPrevention>
<TargetMachine>MachineX86</TargetMachine>
</Link>
<PostBuildEvent>
<Command>Storm_dll.bat $(Platform) $(Configuration)</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="Storm_dll\storm_dll.cpp" />
</ItemGroup>
<ItemGroup>
<None Include="storm_dll\storm_dll.def" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="Storm_dll\storm_dll.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View file

@ -1,28 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="Storm_dll\storm_dll.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<None Include="storm_dll\storm_dll.def">
<Filter>Source Files</Filter>
</None>
</ItemGroup>
<ItemGroup>
<ClInclude Include="Storm_dll\storm_dll.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
</Project>

View file

@ -1,62 +0,0 @@
StormLib history
================
Version 8.02
- Support for UNICODE encoding for on-disk files
- Optimized file deleting
Version 8.01
- SFileFindFirstFile and SFileFindNextFile no longer find files that have
patch file in the oldest MPQ in the patch chain
- Write support for MPQs version 4
Version 8.00
- Updated support for protected maps from Warcraft III
Version 7.11
- Support for MPQs v 3.0 (WOW-Cataclysm BETA)
- StormLib now deals properly with files that have MPQ_SECTOR_CHECKSUM missing,
but have sector checksum entry present in the sector offset table
Version 7.10
- Support for partial MPQs ("interface.MPQ.part")
- The only operation that is externally allowed to do with internal files
("(listfile)", "(attributes)" and "(signature)") is reading. Attempt to modify any of the file
fails and GetLastError returns ERROR_INTERNAL_FILE
- Fixed memory leak that has occured when writing more than one sector to the file at once
Version 7.01
- Support for adding files from memory
- Fixed improper validation of handles to MPQ file and MPQ archive
- Fixed bug where StormLib didn't save CRC32 of the file when added to archive
Version 7.00
- Properly deals with MPQs protected by w3xMaster
- Major rewrite
- Fixed support for (attributes)
- Added file verification
- Added MPQ signature verification
Version 6.22
- Properly deals with MPQs protected by w3xMaster
Version 6.21
- SFileRenameFile now properly re-crypts the file if necessary.
- SFileFindFirstFile correctly deals with deleted files
Version 6.20
- Fixed lots of bugs when processing files with same names but different locales
- Fixed bugs when repeately extracts the same file with MPQ_FILE_SINGLE_UNIT flag
- Added SFileFlushArchive
- Fixed issue opening AVI files renamed to MPQ using SFileCreateArchiveEx

View file

@ -1,25 +0,0 @@
After sector offset table
=========================
FileSize CmpSize DWORDs
00007588 000075A4 0x01
0000A9EA 000095EC 0x01
0000E51D 0000E20D 0x02
00015C00 00015C40 0x02
0001C578 000186C4 0x02
0002A9D4 0002A9EA 0x04
00037BAC 00037A42 0x06
0003C3C1 00034084 0x06
0003D224 0003B30F 0x06
00045105 0004195A 0x07
00045D9C 0003D87D 0x07
0004AAB8 0004860A 0x08
0004D18E 00048E0C 0x07
00056B4C 00056BDD 0x09
0005DC08 00059426 0x09
00061EC0 00057711 0x0A
0006CEC4 00062561 0x0B
000778EE 00066736 0x0C
000AD0CB 0007F32E 0x11
00327EAC 00303395 0x53

View file

@ -1,318 +0,0 @@
THE MOPAQ ARCHIVE FORMAT
v0.9 (Thursday, June 30, 2005)
by Justin Olbrantz(Quantam)
Distribution and reproduction of this specification are allowed without limitation, as long as it is not altered. Quoting
in other works is freely allowed, as long as the source and author of the quote is stated.
TABLE OF CONTENTS
1. Introduction to the MoPaQ Format
2. The MoPaQ Format
2.1 General Archive Layout
2.2 Archive Header
2.3 Block Table
2.4 Hash Table
2.5 File Data
2.6 Listfile
2.7 Extended Attributes
2.8 Weak (Old) Digital Signature
2.9 Strong (New) Digital Signature
3. Algorithm Source Code
3.1 Encryption/Decryption
3.2 Hashing
3.3 Conversion of FILETIME and time_t
1. INTRODUCTION TO THE MOPAQ FORMAT
The MoPaQ (or MPQ) format is an archive file format designed by Mike O'Brien (hence the name Mike O'brien PaCK) at Blizzard
Entertainment. The format has been used in all Blizzard games since (and including) Diablo. It is heavily optimized to be
a read-only game archive format, and excels at this role.
The Blizzard MoPaQ-reading functions are contained in the Storm module, which my be either statically or dynamically linked.
The Blizzard MoPaQ-writing functions are contained in the MPQAPI module, which is always statically linked.
2. THE MOPAQ FORMAT
All numbers in the MoPaQ format are in little endian. Data types are listed either as int (integer, the number of bits specified),
byte (8 bits), and char (bytes which contain ASCII characters). All sizes and offsets are in bytes, unless specified otherwise.
Structure members are listed in the following general form:
offset from the beginning of the structure: data type(array size) member name : member description
2.1 GENERAL ARCHIVE LAYOUT
- Archive Header
- File Data
- File Data - Special Files
- Hash Table
- Block Table
- Strong Digital signature
This is the usual archive format, and is not absolutely essential. Some archives have been observed placing the hash table
and file table after the archive header, and before the file data.
2.2 ARCHIVE HEADER
00h: char(4) Magic : Indicates that the file is a MoPaQ archive. Must be ASCII "MPQ" 1Ah.
04h: int32 HeaderSize : Size of the archive header. Should be 32.
08h: int32 ArchiveSize : Size of the whole archive, including the header. Does not include the strong digital signature, if present.
This size is used, among other things, for determining the region to hash in computing the digital signature.
0Ch: int16 Unknown : Unknown
0Eh: int8 SectorSizeShift : 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 the archive is 512 * 2^SectorSizeShift. Bugs in the Storm library dictate
that this should always be 3 (4096 byte sectors).
10h: int32 HashTableOffset : Offset to the beginning of the hash table, relative to the beginning of the archive.
14h: int32 BlockTableOffset : Offset to the beginning of the block table, relative to the beginning of the archive.
18h: int32 HashTableEntries : Number of entries in the hash table. Must be a power of two, and must be less than 2^16.
1Ch: int32 BlockTableEntries : Number of entries in the block table.
The archive header is the first structure in the archive, at archive offset 0, but the archive does not need to be at offset
0 of the containing file. The offset of the archive in the file is referred to here as ArchiveOffset. If the archive is not
at the beginning of the file, it must begin at a disk sector boundary (512 bytes). Early versions of Storm require that the
archive be at the end of the containing file (ArchiveOffset + ArchiveSize = file size), but this is not required in newer
versions (due to the strong digital signature not being considered a part of the archive).
2.3 BLOCK TABLE
The block table contains entries for each region in the archive. Regions may be either files or empty space, which may be
overwritten by new files (typically this space is from deleted file data). The block table is encrypted, using the hash
of "(block table)" as the key. Each entry is structured as follows:
00h: int32 BlockOffset : Offset of the beginning of the block, relative to the beginning of the archive. Meaningless if the block size is 0.
04h: int32 BlockSize : Size of the block in the archive.
08h: int32 FileSize : Size of the file data stored in the block. 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.
0Ch: int32 Flags : Bit mask of the flags for the block. The following values are conclusively identified:
80000000h: Block is a file, and follows the file data format; otherwise, block is free space, and may be overwritten. If the block is not a file, all other flags should be cleared.
01000000h: File is stored as a single unit, rather than split into sectors.
00020000h: The file's encryption key is adjusted by the block offset and file size (explained in detail in the File Data section). File must be encrypted.
00010000h: File is encrypted.
00000200h: File is compressed. Mutually exclusive to file imploded.
00000100h: File is imploded. Mutually exclusive to file compressed.
2.4 HASH TABLE
Instead of storing file names, for quick access MoPaQs use a fixed, power of two-size hash table of files in the archive. A file is uniquely identified by its file path, its language, and its platform. The home entry for a file in the hash table is computed as a hash of the file path. In the event of a collision (the home entry is occupied by another file), progressive overflow is used, and the file is placed in the next available hash table entry. Searches for a desired file in the hash table proceed from the home entry for the file until either the file is found, the entire hash table is searched, or an empty hash table entry (FileBlockIndex of FFFFFFFFh) is encountered. The hash table is encrypted using the hash of "(hash table)" as the key. Each entry is structured as follows:
00h: int32 FilePathHashA : The hash of the file path, using method A.
04h: int32 FilePathHashB : The hash of the file path, using method B.
08h: int16 Language : 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.
0Ah: int8 Platform : The platform the file is used for. 0 indicates the default platform. No other values have been observed.
0Ch: int32 FileBlockIndex : 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 (in other words, the file was deleted). Does not terminate searches for a given file.
2.5 FILE DATA
00h: int32(SectorsInFile + 1) SectorOffsetTable : Offsets to the start of each sector's data, relative to the beginning of the file data. Not present if this information is calculatable (see details below).
immediately following SectorOffsetTable: SectorData : Data of each sector in the file, packed end to end (see details below).
Normally, file data is split up into sectors, for simple streaming. All sectors, save for the last, will contain as many bytes of file data as specified in the archive header's SectorSizeShift; the last sector may be smaller than this, depending on the size of the file data. This sector size is the size of the raw file data; if the file is compressed, the compressed sector will be smaller or the same size as the uncompressed sector size. Individual sectors in a compressed file may be stored uncompressed; this occurs if and only if the sector could not be compressed by the algorithm used (if the compressed sector size was greater than or equal to the size of the raw data), and is indicated by the sector's compressed size in SectorOffsetTable being equal to the uncompressed size of the sector (which may be calculated from the FileSize).
If the sector is compressed (but not imploded), a bit mask byte of the compression algorithm(s) used to compress the sector is appended to the beginning of the compressed sector data. This additional byte counts towards the total size of the sector; if the size of the sector (including this byte) exceeds or matches the uncompressed size of the sector data, the sector will be stored uncompressed, and this byte omitted. Multiple compression algorithms may be used on the same sector; in this case, successive compression occurs in the order the algorithms are listed below, and decompression occurs in the opposite order. For implimentations of all of these algorithms, see StormLib.
40h: IMA ADPCM mono
80h: IMA ADPCM stereo
01h: Huffman encoded
02h: Deflated (see ZLib)
08h: Imploded (see PKWare Data Compression Library)
10h: BZip2 compressed (see BZip2)
If the file is stored as a single unit (indicated in the file's Flags), there is effectively only a single sector, which
contains the entire file.
If the file is encrypted, each sector (after compression and appendage of the compression type byte, if applicable)
is encrypted with the file's key. The base key for a file is determined by a hash of the file name stripped of the
directory (i.e. the key for a file named "directory\file" would be computed as the hash of "file"). If this key is
adjusted, as indicated in the file's Flags, the final key is calculated as ((base key + BlockOffset - ArchiveOffset)
XOR FileSize) (StormLib - an open-source implementation of the MoPaQ reading and writing functions,
by Ladislav Zezula - incorrectly uses an AND in place of the XOR). Each sector is encrypted using the key + the
0-based index of the sector in the file. The SectorOffsetTable, if present, is encrypted using the key - 1.
The SectorOffsetTable is omitted when the sizes and offsets of all sectors in the file are calculatable from the FileSize.
This can happen in several circumstances. If the file is not compressed/imploded, then the size and offset of all sectors
is known, based on the archive's SectorSizeShift. If the file is stored as a single unit compressed/imploded, then the
SectorOffsetTable is omitted, as the single file "sector" corresponds to BlockSize and FileSize, as mentioned previously.
Note that the SectorOffsetTable will always be present if the file is compressed/imploded and the file is not stored as
a single unit, even if there is only a single sector in the file (the size of the file is less than or equal to the
archive's sector size).
2.6 LISTFILE
The listfile is a very simple extension to the MoPaQ format that contains the file paths of (most) files in the archive.
The languages and platforms of the files are not stored in the listfile. The listfile is contained in the file "(listfile)",
and is simply a non-Unix-style text file with one file path on each line, lines terminated with the bytes 0Dh 0Ah. The file
"(listfile)" may not be listed in the listfile.
2.7 EXTENDED ATTRIBUTES
The extended attributes are optional file attributes for files in the block table. These attributes were added at times after
the MoPaQ format was already finalized, and it is not necessary for every archive to have all (or any) of the extended attributes.
If an archive contains a given attribute, there will be an instance of that attribute for every block in the block table, although
the attribute will be meaningless if the block is not a file. The order of the attributes for blocks correspond to the order of the
blocks in the block table, and are of the same number. The attributes are stored in parallel arrays in the "(attributes)" file,
in the archive. The attributes corresponding to this file need not be valid (and logically cannot be). Unlike all the other
structures in the MoPaQ format, entries in the extended attributes are NOT guaranteed to be aligned. Also note that in some
archives, malicious zeroing of the attributes has been observed, perhaps with the intent of breaking archive viewers. This
file is structured as follows:
00h: int32 Version : Specifies the extended attributes format version. For now, must be 100.
04h: int32 AttributesPresent : Bit mask of the extended attributes present in the archive:
00000001h: File CRC32s.
00000002h: File timestamps.
00000004h: File MD5s.
08h: int32(BlockTableEntries) CRC32s : CRC32s of the (uncompressed) file data for each block in the archive. Omitted if the
archive does not have CRC32s. immediately after CRC32s: FILETIME(BlockTableEntries) Timestamps : Timestamps for each block
in the archive. The format is that of the Windows FILETIME structure. Omitted if the archive does not have timestamps.
immediately after Timestamps: MD5(BlockTableEntries) MD5s : MD5s of the (uncompressed) file data for each block in the archive.
Omitted if the archive does not have MD5s.
2.8 WEAK DIGITAL SIGNATURE
The weak digital signature is a digital signature using Microsoft CryptoAPI. It is an implimentation of the RSASSA-PKCS1-v1_5
digital signature protocol, using the MD5 hashing algorithm and a 512-bit (weak) RSA key (for more information about this
protocol, see the RSA Labs PKCS1 specification). The public key and exponent are stored in a resource in Storm. The signature
is stored uncompressed, unencrypted in the file "(signature)" in the archive. The archive is hashed from the beginning of the
archive (ArchiveOffset in the containing file) to the end of the archive (the length indicated by ArchiveSize); the signature
file is added to the archive before signing, and the space occupied by the file is considered to be all binary 0s during
signing/verification. This file is structured as follows:
00h: int32 Unknown : Must be 0.
04h: int32 Unknown : must be 0.
08h: int512 Signature : The digital signature. Like all other numbers in the MoPaQ format, this is stored in little-endian order.
2.9 STRONG DIGITAL SIGNATURE
The strong digital signature uses a simple proprietary implementation of RSA signing, using the SHA-1 hashing algorithm and
a 2048-bit (strong) RSA key. The default public key and exponent are stored in Storm, but other keys may be used as well.
The strong digital signature is stored immediately after the archive, in the containing file; the entire archive (ArchiveSize
bytes, starting at ArchiveOffset in the containing file) is hashed as a single block. The signature has the following format:
00h: char(4) Magic : Indicates the presence of a digital signature. Must be "NGIS" ("SIGN" backwards).
04h: int2048 Signature : The digital signature, stored in little-endian format.
When the Signature field is decrypted with the public key and exponent, and the result stored in little-endian order, it is structured as follows:
00h: byte Padding : Must be 0Bh.
01h: byte(235) Padding : Must be BBh.
ECh: byte(20) SHA-1 : SHA-1 hash of the archive, in standard SHA-1 format.
3. ALGORITHM SOURCE CODE
3.1 ENCRYPTION/DECRYPTION
I believe this was derived at some point from code in StormLib. Assumes the long type to be 32 bits, and the machine to be little endian order.
unsigned long dwCryptTable[0x500];
void InitializeCryptTable()
{
unsigned long seed = 0x00100001;
unsigned long index1 = 0;
unsigned long index2 = 0;
int i;
for (index1 = 0; index1 < 0x100; index1++)
{
for (index2 = index1, i = 0; i < 5; i++, index2 += 0x100)
{
unsigned long temp1, temp2;
seed = (seed * 125 + 3) % 0x2AAAAB;
temp1 = (seed & 0xFFFF) << 0x10;
seed = (seed * 125 + 3) % 0x2AAAAB;
temp2 = (seed & 0xFFFF);
dwCryptTable[index2] = (temp1 | temp2);
}
}
}
void EncryptData(void *lpbyBuffer, unsigned long dwLength, unsigned long dwKey)
{
unsigned long *lpdwBuffer = (unsigned long *)lpbyBuffer;
unsigned long seed = 0xEEEEEEEE;
unsigned long ch;
assert(lpbyBuffer);
dwLength /= sizeof(unsigned long);
while(dwLength-- > 0)
{
seed += dwCryptTable[0x400 + (dwKey & 0xFF)];
ch = *lpdwBuffer ^ (dwKey + seed);
dwKey = ((~dwKey << 0x15) + 0x11111111) | (dwKey >> 0x0B);
seed = *lpdwBuffer + seed + (seed << 5) + 3;
*lpdwBuffer++ = ch;
}
}
void DecryptData(void *lpbyBuffer, unsigned long dwLength, unsigned long dwKey)
{
unsigned long *lpdwBuffer = (unsigned long *)lpbyBuffer;
unsigned long seed = 0xEEEEEEEE;
unsigned long ch;
assert(lpbyBuffer);
dwLength /= sizeof(unsigned long);
while(dwLength-- > 0)
{
seed += dwCryptTable[0x400 + (dwKey & 0xFF)];
ch = *lpdwBuffer ^ (dwKey + seed);
dwKey = ((~dwKey << 0x15) + 0x11111111) | (dwKey >> 0x0B);
seed = ch + seed + (seed << 5) + 3;
*lpdwBuffer++ = ch;
}
}
3.2 HASHING
Based on code from StormLib.
// Different types of hashes to make with HashString
#define MPQ_HASH_TABLE_OFFSET 0
#define MPQ_HASH_NAME_A 1
#define MPQ_HASH_NAME_B 2
#define MPQ_HASH_FILE_KEY 3
unsigned long HashString(const char *lpszString, unsigned long dwHashType)
{
unsigned long seed1 = 0x7FED7FED;
unsigned long seed2 = 0xEEEEEEEE;
int ch;
while (*lpszString != 0)
{
ch = toupper(*lpszString++);
seed1 = dwCryptTable[(dwHashType * 0xFF) + ch] ^ (seed1 + seed2);
seed2 = ch + seed1 + seed2 + (seed2 << 5) + 3;
}
return seed1;
}
3.3 CONVERSION OF FILETIME AND time_t
#define EPOCH_OFFSET 116444736000000000ULL // Number of 100 ns units between 01/01/1601 and 01/01/1970
bool GetTimeFromFileTime(FILETIME &fileTime, time_t &time)
{
// The FILETIME represents a 64-bit integer: the number of 100 ns units since January 1, 1601
unsigned long long nTime = ((unsigned long long)fileTime.dwHighDateTime << 32) + fileTime.dwLowDateTime;
if (nTime < EPOCH_OFFSET)
return false;
nTime -= EPOCH_OFFSET; // Convert the time base from 01/01/1601 to 01/01/1970
nTime /= 10000000ULL; // Convert 100 ns to sec
time = (time_t)nTime;
// Test for overflow (FILETIME is 64 bits, time_t is 32 bits)
if ((nTime - (unsigned long long)time) > 0)
return false;
return true;
}
void GetFileTimeFromTime(time_t &time, FILETIME &fileTime)
{
unsigned long long nTime = (unsigned long long)time;
nTime *= 10000000ULL;
nTime += EPOCH_OFFSET;
fileTime.dwLowDateTime = (DWORD)nTime;
fileTime.dwHighDateTime = (DWORD)(nTime >> 32);
}

View file

@ -1,433 +0,0 @@
THE MOPAQ ARCHIVE FORMAT
v1.0 (Friday, September 1, 2006)
by Justin Olbrantz(Quantam)
Distribution and reproduction of this specification are allowed without limitation, as long as it is not altered. Quotation in other works is freely allowed, as long as the source and author of the quote are stated.
TABLE OF CONTENTS
1. Introduction to the MoPaQ Format
2. The MoPaQ Format
2.1 General Archive Layout
2.2 Archive Header
2.3 Block Table
2.4 Extended Block Table
2.5 Hash Table
2.6 File Data
2.7 Listfile
2.8 Extended Attributes
2.9 Weak (Old) Digital Signature
2.10 Strong (New) Digital Signature
3. Algorithm Source Code
3.1 Encryption/Decryption
3.2 Hashing and File Key Computation
3.3 Finding Files
3.4 Deleting Files
3.5 Conversion of FILETIME and time_t
3.6 Forming a 64-bit Large Archive Offset from 32-bit and 16-bit Components
4. Revision History
1. INTRODUCTION TO THE MOPAQ FORMAT
The MoPaQ (or MPQ) format is an archive file format designed by Mike O'Brien (hence the name Mike O'brien PaCK) at Blizzard Entertainment. The format has been used in all Blizzard games since (and including) Diablo. It is heavily optimized to be a read-only game archive format, and excels at this role.
The Blizzard MoPaQ-reading functions are contained in the Storm module, which my be either statically or dynamically linked. The Blizzard MoPaQ-writing functions are contained in the MPQAPI module, which is always statically linked.
StormLib - mentioned several times in this specification - is an open-source MoPaQ reading and writing library written by Ladislav Zezula (no affiliation with Blizzard Entertainment). While it's a bit dated, and does not support all of the newer MoPaQ features, it contains source code to the more exotic compression methods used by MoPaQ, such as the PKWare implode algorithm, MoPaQ's huffman compression algorithm, and the IMA ADPCM compression used by MoPaQ.
2. THE MOPAQ FORMAT
All numbers in the MoPaQ format are in little endian byte order; signed numbers use the two's complement system. Data types are listed either as int (integer, the number of bits specified), byte (8 bits), or char (bytes which contain ASCII characters). All sizes and offsets are in bytes, unless specified otherwise. Structure members are listed in the following general form:
offset from the beginning of the structure: data type(array size) member name : member description
2.1 GENERAL ARCHIVE LAYOUT
- Archive Header
- File Data
- File Data - Special Files
- Hash Table
- Block Table
- Extended Block Table
- Strong Digital signature
This is the usual archive format, but it is not mandatory. Some archives have been observed placing the hash table and file table after the archive header, and before the file data.
2.2 ARCHIVE HEADER
00h: char(4) Magic : Indicates that the file is a MoPaQ archive. Must be ASCII "MPQ" 1Ah.
04h: int32 HeaderSize : Size of the archive header.
08h: int32 ArchiveSize : Size of the whole archive, including the header. Does not include the strong digital signature, if present. This size is used, among other things, for determining the region to hash in computing the digital signature. 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).
0Ch: int16 FormatVersion : MoPaQ format version. MPQAPI will not open archives where this is negative. Known versions:
0000h: Original format. HeaderSize should be 20h, and large archives are not supported.
0001h: Burning Crusade format. Header size should be 2Ch, and large archives are supported.
0Eh: int8 SectorSizeShift : 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).
10h: int32 HashTableOffset : Offset to the beginning of the hash table, relative to the beginning of the archive.
14h: int32 BlockTableOffset : Offset to the beginning of the block table, relative to the beginning of the archive.
18h: int32 HashTableEntries : 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.
1Ch: int32 BlockTableEntries : Number of entries in the block table.
Fields only present in the Burning Crusade format and later:
20h: int64 ExtendedBlockTableOffset : Offset to the beginning of the extended block table, relative to the beginning of the archive.
28h: int16 HashTableOffsetHigh : High 16 bits of the hash table offset for large archives.
2Ah: int16 BlockTableOffsetHigh : High 16 bits of the block table offset for large archives.
The archive header is the first structure in the archive, at archive offset 0; however, the archive does not need to be at offset 0 of the containing file. The offset of the archive in the file is referred to here as ArchiveOffset. If the archive is not at the beginning of the file, it must begin at a disk sector boundary (512 bytes). Early versions of Storm require that the archive be at the end of the containing file (ArchiveOffset + ArchiveSize = file size), but this is not required in newer versions (due to the strong digital signature not being considered a part of the archive).
2.3 BLOCK TABLE
The block table contains entries for each region in the archive. Regions may be either files, empty space, which may be overwritten by new files (typically this space is from deleted file data), or unused block table entries. Empty space entries should have BlockOffset and BlockSize nonzero, and FileSize and Flags zero; unused block table entries should have BlockSize, FileSize, and Flags zero. The block table is encrypted, using the hash of "(block table)" as the key. Each entry is structured as follows:
00h: int32 BlockOffset : Offset of the beginning of the block, relative to the beginning of the archive.
04h: int32 BlockSize : Size of the block in the archive.
08h: int32 FileSize : Size of the file data stored in the block. 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.
0Ch: int32 Flags : Bit mask of the flags for the block. The following values are conclusively identified:
80000000h: Block is a file, and follows the file data format; otherwise, block is free space or unused. If the block is not a file, all other flags should be cleared, and FileSize should be 0.
01000000h: File is stored as a single unit, rather than split into sectors.
00020000h: The file's encryption key is adjusted by the block offset and file size (explained in detail in the File Data section). File must be encrypted.
00010000h: File is encrypted.
00000200h: File is compressed. File cannot be imploded.
00000100h: File is imploded. File cannot be compressed.
2.4 EXTENDED BLOCK TABLE
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.
As of the Burning Crusade Friends and Family beta, this table is not encrypted.
2.5 HASH TABLE
Instead of storing file names, for quick access MoPaQs use a fixed, power of two-size hash table of files in the archive. A file is uniquely identified by its file path, its language, and its platform. The home entry for a file in the hash table is computed as a hash of the file path. In the event of a collision (the home entry is occupied by another file), progressive overflow is used, and the file is placed in the next available hash table entry. Searches for a desired file in the hash table proceed from the home entry for the file until either the file is found, the entire hash table is searched, or an empty hash table entry (FileBlockIndex of FFFFFFFFh) is encountered. The hash table is encrypted using the hash of "(hash table)" as the key. Each entry is structured as follows:
00h: int32 FilePathHashA : The hash of the file path, using method A.
04h: int32 FilePathHashB : The hash of the file path, using method B.
08h: int16 Language : 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.
0Ah: int8 Platform : The platform the file is used for. 0 indicates the default platform. No other values have been observed.
0Ch: int32 FileBlockIndex : 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 (in other words, the file was deleted). Does not terminate searches for a given file.
2.6 FILE DATA
The data for each file is composed of the following structure:
00h: int32(SectorsInFile + 1) SectorOffsetTable : Offsets to the start of each sector, relative to the beginning of the file data. The last entry contains the file size, making it possible to easily calculate the size of any given sector. This table is not present if this information can be calculated (see details below).
immediately following SectorOffsetTable: SECTOR Sectors(SectorsInFile) : Data of each sector in the file, packed end to end (see details below).
Normally, file data is split up into sectors, for simple streaming. All sectors, save for the last, will contain as many bytes of file data as specified in the archive header's SectorSizeShift; the last sector may contain less than this, depending on the size of the entire file's data. If the file is compressed or imploded, the sector will be smaller or the same size as the file data it contains. Individual sectors in a compressed or imploded file may be stored uncompressed; this occurs if and only if the file data the sector contains could not be compressed by the algorithm(s) used (if the compressed sector size was greater than or equal to the size of the file data), and is indicated by the sector's size in SectorOffsetTable being equal to the size of the file data in the sector (which may be calculated from the FileSize).
The format of each sector depends on the kind of sector it is. Uncompressed sectors are simply the the raw file data contained in the sector. Imploded sectors are the raw compressed data following compression with the implode algorithm (these sectors can only be in imploded files). Compressed sectors (only found in compressed - not imploded - files) are compressed with one or more compression algorithms, and have the following structure:
00h: byte CompressionMask : Mask of the compression types applied to this sector. If multiple compression types are used, they are applied in the order listed below, and decompression is performed in the opposite order. This byte counts towards the total sector size, meaning that the sector will be stored uncompressed if the data cannot be compressed by at least two bytes; as well, this byte is encrypted with the sector data, if applicable. The following compression types are defined (for implementations of these algorithms, see StormLib):
40h: IMA ADPCM mono
80h: IMA ADPCM stereo
01h: Huffman encoded
02h: Deflated (see ZLib)
08h: Imploded (see PKWare Data Compression Library)
10h: BZip2 compressed (see BZip2)
01h: byte(SectorSize - 1) SectorData : The compressed data for the sector.
If the file is stored as a single unit (indicated in the file's Flags), there is effectively only a single sector, which contains the entire file data.
If the file is encrypted, each sector (after compression/implosion, if applicable) is encrypted with the file's key. The base key for a file is determined by a hash of the file name stripped of the directory (i.e. the key for a file named "directory\file" would be computed as the hash of "file"). If this key is adjusted, as indicated in the file's Flags, the final key is calculated as ((base key + BlockOffset - ArchiveOffset) XOR FileSize) (StormLib incorrectly uses an AND in place of the XOR). Each sector is encrypted using the key + the 0-based index of the sector in the file. The SectorOffsetTable, if present, is encrypted using the key - 1.
The SectorOffsetTable is omitted when the sizes and offsets of all sectors in the file are calculatable from the FileSize. This can happen in several circumstances. If the file is not compressed/imploded, then the size and offset of all sectors is known, based on the archive's SectorSizeShift. If the file is stored as a single unit compressed/imploded, then the SectorOffsetTable is omitted, as the single file "sector" corresponds to BlockSize and FileSize, as mentioned previously. However, the SectorOffsetTable will be present if the file is compressed/imploded and the file is not stored as a single unit, even if there is only a single sector in the file (the size of the file is less than or equal to the archive's sector size).
2.7 LISTFILE
The listfile is a very simple extension to the MoPaQ format that contains the file paths of (most) files in the archive. The languages and platforms of the files are not stored in the listfile. The listfile is contained in the file "(listfile)" (default language and platform), and is simply a text file with file paths separated by ';', 0Dh, 0Ah, or some combination of these. The file "(listfile)" may not be listed in the listfile.
2.8 EXTENDED ATTRIBUTES
The extended attributes are optional file attributes for files in the block table. These attributes were added at times after the MoPaQ format was already finalized, and it is not necessary for every archive to have all (or any) of the extended attributes. If an archive contains a given attribute, there will be an instance of that attribute for every block in the block table, although the attribute will be meaningless if the block is not a file. The order of the attributes for blocks correspond to the order of the blocks in the block table, and are of the same number. The attributes are stored in parallel arrays in the "(attributes)" file (default language and platform), in the archive. The attributes corresponding to this file need not be valid (and logically cannot be). Unlike all the other structures in the MoPaQ format, entries in the extended attributes are NOT guaranteed to be aligned. Also note that in some archives, malicious zeroing of the attributes has been observed, perhaps with the intent of breaking archive viewers. This file is structured as follows:
00h: int32 Version : Specifies the extended attributes format version. For now, must be 100.
04h: int32 AttributesPresent : Bit mask of the extended attributes present in the archive:
00000001h: File CRC32s.
00000002h: File timestamps.
00000004h: File MD5s.
08h: int32(BlockTableEntries) CRC32s : CRC32s of the (uncompressed) file data for each block in the archive. Omitted if the archive does not have CRC32s.
immediately after CRC32s: FILETIME(BlockTableEntries) Timestamps : Timestamps for each block in the archive. The format is that of the Windows FILETIME structure. Omitted if the archive does not have timestamps.
immediately after Timestamps: MD5(BlockTableEntries) MD5s : MD5s of the (uncompressed) file data for each block in the archive. Omitted if the archive does not have MD5s.
2.9 WEAK DIGITAL SIGNATURE
The weak digital signature is a digital signature using Microsoft CryptoAPI. It is an implimentation
of the RSASSA-PKCS1-v1_5 digital signature protocol, using the MD5 hashing algorithm and a 512-bit (weak)
RSA key (for more information about this protocol, see the RSA Labs PKCS1 specification). The public key
and exponent are stored in a resource in Storm, the private key is stored in a separate file, whose filename
is passed to MPQAPI (the private key is not stored in MPQAPI). The signature is stored uncompressed,
unencrypted in the file "(signature)" (default language and platform) in the archive. The archive
is hashed from the beginning of the archive (ArchiveOffset in the containing file) to the end of
the archive (the length indicated by ArchiveSize, or calculated in the Burning Crusade MoPaQ format);
the signature file is added to the archive before signing, and the space occupied by the file is considered
to be all binary 0s during signing/verification. This file is structured as follows:
00h: int32 Unknown : Must be 0.
04h: int32 Unknown : Must be 0.
08h: int512 Signature : The digital signature. Like all other numbers in the MoPaQ format, this is stored
in little-endian order. The structure of this, when decrypted, follows the RSASSA-PKCS1-v1_5 specification;
this format is rather icky to work with (I wrote a program to verify this signature using nothing but an MD5
function and huge integer functions; it wasn't pleasant), and best left to an encryption library such as Cryto++.
2.10 STRONG DIGITAL SIGNATURE
The strong digital signature uses a simple proprietary implementation of RSA signing, using the SHA-1 hashing algorithm and a 2048-bit (strong) RSA key. The default public key and exponent are stored in Storm, but other keys may be used as well. The strong digital signature is stored immediately after the archive, in the containing file; the entire archive (ArchiveSize bytes, starting at ArchiveOffset in the containing file) is hashed as a single block. The signature has the following format:
00h: char(4) Magic : Indicates the presence of a digital signature. Must be "NGIS" ("SIGN" backwards).
04h: int2048 Signature : The digital signature, stored in little-endian format.
When the Signature field is decrypted with the public key and exponent, and the resulting large integer is stored in little-endian order, it is structured as follows:
00h: byte Padding : Must be 0Bh.
01h: byte(235) Padding : Must be BBh.
ECh: byte(20) SHA-1 : SHA-1 hash of the archive, in standard SHA-1 byte order.
3. ALGORITHM SOURCE CODE
All of the sample code here assumes little endian machine byte order, that the short type is 16 bits, that the long type is 32 bits, and that the long long type is 64 bits. Adjustments must be made if these assumptions are not correct on a given platform. All code not credited otherwise was written by myself in the writing of this specification.
3.1 ENCRYPTION/DECRYPTION
Based on code from StormLib.
unsigned long dwCryptTable[0x500];
// The encryption and hashing functions use a number table in their procedures. This table must be initialized before the functions are called the first time.
void InitializeCryptTable()
{
unsigned long seed = 0x00100001;
unsigned long index1 = 0;
unsigned long index2 = 0;
int i;
for (index1 = 0; index1 < 0x100; index1++)
{
for (index2 = index1, i = 0; i < 5; i++, index2 += 0x100)
{
unsigned long temp1, temp2;
seed = (seed * 125 + 3) % 0x2AAAAB;
temp1 = (seed & 0xFFFF) << 0x10;
seed = (seed * 125 + 3) % 0x2AAAAB;
temp2 = (seed & 0xFFFF);
dwCryptTable[index2] = (temp1 | temp2);
}
}
}
void EncryptData(void *lpbyBuffer, unsigned long dwLength, unsigned long dwKey)
{
assert(lpbyBuffer);
unsigned long *lpdwBuffer = (unsigned long *)lpbyBuffer;
unsigned long seed = 0xEEEEEEEE;
unsigned long ch;
dwLength /= sizeof(unsigned long);
while(dwLength-- > 0)
{
seed += dwCryptTable[0x400 + (dwKey & 0xFF)];
ch = *lpdwBuffer ^ (dwKey + seed);
dwKey = ((~dwKey << 0x15) + 0x11111111) | (dwKey >> 0x0B);
seed = *lpdwBuffer + seed + (seed << 5) + 3;
*lpdwBuffer++ = ch;
}
}
void DecryptData(void *lpbyBuffer, unsigned long dwLength, unsigned long dwKey)
{
assert(lpbyBuffer);
unsigned long *lpdwBuffer = (unsigned long *)lpbyBuffer;
unsigned long seed = 0xEEEEEEEEL;
unsigned long ch;
dwLength /= sizeof(unsigned long);
while(dwLength-- > 0)
{
seed += dwCryptTable[0x400 + (dwKey & 0xFF)];
ch = *lpdwBuffer ^ (dwKey + seed);
dwKey = ((~dwKey << 0x15) + 0x11111111L) | (dwKey >> 0x0B);
seed = ch + seed + (seed << 5) + 3;
*lpdwBuffer++ = ch;
}
}
3.2 HASHING AND FILE KEY COMPUTATION
These functions may have been derived from StormLib code at some point in the very distant past. It was so long ago that I don't remember for certain.
// Different types of hashes to make with HashString
#define MPQ_HASH_TABLE_OFFSET 0
#define MPQ_HASH_NAME_A 1
#define MPQ_HASH_NAME_B 2
#define MPQ_HASH_FILE_KEY 3
// Based on code from StormLib.
unsigned long HashString(const char *lpszString, unsigned long dwHashType)
{
assert(lpszString);
assert(dwHashType <= MPQ_HASH_FILE_KEY);
unsigned long seed1 = 0x7FED7FEDL;
unsigned long seed2 = 0xEEEEEEEEL;
int ch;
while (*lpszString != 0)
{
ch = toupper(*lpszString++);
seed1 = dwCryptTable[(dwHashType * 0x100) + ch] ^ (seed1 + seed2);
seed2 = ch + seed1 + seed2 + (seed2 << 5) + 3;
}
return seed1;
}
#define BLOCK_OFFSET_ADJUSTED_KEY 0x00020000L
unsigned long ComputeFileKey(const char *lpszFilePath, const BlockTableEntry &blockEntry, unsigned long nArchiveOffset)
{
assert(lpszFilePath);
// Find the file name part of the path
const char *lpszFileName = strrchr(lpszFilePath, '\\');
if (lpszFileName)
lpszFileName++; // Skip the \
else
lpszFileName = lpszFilePath;
// Hash the name to get the base key
unsigned long nFileKey = HashString(lpszFileName, MPQ_HASH_FILE_KEY);
// Offset-adjust the key if necessary
if (blockEntry.Flags & BLOCK_OFFSET_ADJUSTED_KEY)
nFileKey = (nFileKey + blockEntry.BlockOffset) ^ blockEntry.FileSize;
return nFileKey;
}
3.3 FINDING FILES
#define MPQ_HASH_ENTRY_EMPTY 0xFFFFFFFFL
#define MPQ_HASH_ENTRY_DELETED 0xFFFFFFFEL
bool FindFileInHashTable(const HashTableEntry *lpHashTable, unsigned long nHashTableSize, const char *lpszFilePath, unsigned short nLang, unsigned char nPlatform, unsigned long &iFileHashEntry)
{
assert(lpHashTable);
assert(nHashTableSize);
assert(lpszFilePath);
// Find the home entry in the hash table for the file
unsigned long iInitEntry = HashString(lpszFilePath, MPQ_HASH_TABLE_OFFSET) & (nHashTableSize - 1);
// Is there anything there at all?
if (lpHashTable[iInitEntry].FileBlockIndex == MPQ_HASH_ENTRY_EMPTY)
return false;
// Compute the hashes to compare the hash table entry against
unsigned long nNameHashA = HashString(lpszFilePath, MPQ_HASH_NAME_A),
nNameHashB = HashString(lpszFilePath, MPQ_HASH_NAME_B),
iCurEntry = iInitEntry;
// Check each entry in the hash table till a termination point is reached
do
{
if (lpHashTable[iCurEntry].FileBlockIndex != MPQ_HASH_ENTRY_DELETED)
{
if (lpHashTable[iCurEntry].FilePathHashA == nNameHashA
&& lpHashTable[iCurEntry].FilePathHashB == nNameHashB
&& lpHashTable[iCurEntry].Language == nLang
&& lpHashTable[iCurEntry].Platform == nPlatform)
{
iFileHashEntry = iCurEntry;
return true;
}
}
iCurEntry = (iCurEntry + 1) & (nHashTableSize - 1);
} while (iCurEntry != iInitEntry && lpHashTable[iCurEntry].FileBlockIndex != MPQ_HASH_ENTRY_EMPTY);
return false;
}
3.4 DELETING FILES
bool DeleteFile(HashTableEntry *lpHashTable, unsigned long nHashTableSize, BlockTableEntry *lpBlockTable, const char *lpszFilePath, unsigned short nLang, unsigned char nPlatform)
{
assert(lpHashTable);
assert(nHashTableSize);
assert(lpBlockTable);
// Find the file in the hash table
unsigned long iFileHashEntry;
if (!FindFileInHashTable(lpHashTable, nHashTableSize, lpszFilePath, nLang, nPlatform, iFileHashEntry))
return false;
// Get the block table index before we nuke the hash table entry
unsigned long iFileBlockEntry = lpHashTable[iFileHashEntry].FileBlockIndex;
// Delete the file's entry in the hash table
memset(&lpHashTable[iFileHashEntry], 0xFF, sizeof(HashTableEntry));
// If the next entry is empty, mark this one as empty; otherwise, mark this as deleted.
if (lpHashTable[(iFileHashEntry + 1) & (nHashTableSize - 1)].FileBlockIndex == MPQ_HASH_ENTRY_EMPTY)
lpHashTable[iFileHashEntry].FileBlockIndex = MPQ_HASH_ENTRY_EMPTY;
else
lpHashTable[iFileHashEntry].FileBlockIndex = MPQ_HASH_ENTRY_DELETED;
// If the block occupies space, mark the block as free space; otherwise, clear the block table entry.
if (lpBlockTable[iFileBlockEntry].BlockSize > 0)
{
lpBlockTable[iFileBlockEntry].FileSize = 0;
lpBlockTable[iFileBlockEntry].Flags = 0;
}
else
memset(&lpBlockTable[iFileBlockEntry], 0, sizeof(BlockTableEntry);
return true;
}
3.5 CONVERSION OF FILETIME AND time_t
This code assumes that the base ("zero") date for time_t is 01/01/1970. This is true on Windows, Unix System V systems, and Mac OS X. It is unknown whether this is true on all other platforms. You'll need to research this yourself, if you plan on porting it somewhere else.
#define EPOCH_OFFSET 116444736000000000ULL // Number of 100 ns units between 01/01/1601 and 01/01/1970
bool GetTimeFromFileTime(const FILETIME &fileTime, time_t &time)
{
// The FILETIME represents a 64-bit integer: the number of 100 ns units since January 1, 1601
unsigned long long nTime = ((unsigned long long)fileTime.dwHighDateTime << 32) + fileTime.dwLowDateTime;
if (nTime < EPOCH_OFFSET)
return false;
nTime -= EPOCH_OFFSET; // Convert the time base from 01/01/1601 to 01/01/1970
nTime /= 10000000ULL; // Convert 100 ns to sec
time = (time_t)nTime;
// Test for overflow (FILETIME is 64 bits, time_t is 32 bits)
if ((nTime - (unsigned long long)time) > 0)
return false;
return true;
}
void GetFileTimeFromTime(const time_t &time, FILETIME &fileTime)
{
unsigned long long nTime = (unsigned long long)time;
nTime *= 10000000ULL;
nTime += EPOCH_OFFSET;
fileTime.dwLowDateTime = (DWORD)nTime;
fileTime.dwHighDateTime = (DWORD)(nTime >> 32);
}
3.6 FORMING A 64-BIT LARGE ARCHIVE OFFSET FROM 32-BIT AND 16-BIT COMPONENTS
unsigned long long MakeLargeArchiveOffset(unsigned long nOffsetLow, unsigned short nOffsetHigh)
{
return ((unsigned long long)nOffsetHigh << 32) + (unsigned long long)nOffsetLow;
}
4. REVISION HISTORY
1.0
- Updated to include most of the changes found in the Burning Crusade Friends and Family beta
0.91.
- Updated several structure member descriptions
- Listed the full set of characters that can separate list file entries
- Noted that (attributes), (listfile), and (signature) use the default language and platform codes
- Redid part of the file data specs to clarify the format of sectors
- Enhanced descriptions of the different kinds of block table entries
- Added ComputeFileKey, FindFileInHashTable, and DeleteFile source

View file

@ -1 +0,0 @@
UCMXF6EJY352EFH4XFRXCFH2XC9MQRZK

Some files were not shown because too many files have changed in this diff Show more