update to fex github.com/kode54/File_Extractor/commit/e9e7560df9ca9b25348e0bfb4012f6e570711bb3
should fix new format RARs that dont work, but havent tested it
This commit is contained in:
parent
66e314ec65
commit
e0aa9eb56b
|
@ -55,7 +55,7 @@
|
||||||
FavorSizeOrSpeed="0"
|
FavorSizeOrSpeed="0"
|
||||||
EnableFiberSafeOptimizations="false"
|
EnableFiberSafeOptimizations="false"
|
||||||
WholeProgramOptimization="false"
|
WholeProgramOptimization="false"
|
||||||
AdditionalIncludeDirectories=".;..;lua\include;"glib-2.20.1\build";"glib-2.20.1\build\glib";.\zlib123;.\zziplib;.\winpcap;userconfig;defaultconfig;.\agg\include;.\agg\examples;directx"
|
AdditionalIncludeDirectories=".;..;lua\include;"glib-2.20.1\build";"glib-2.20.1\build\glib";.\zlib123;.\zziplib;.\winpcap;userconfig;defaultconfig;.\agg\include;.\agg\examples;directx;File_Extractor;stdint"
|
||||||
PreprocessorDefinitions="_CRT_NONSTDC_NO_DEPRECATE;DEBUG;_CRT_SECURE_NO_DEPRECATE;GLIB_STATIC_COMPILATION;WIN32;HAVE_LIBZ;NOMINMAX;_WIN32_WINNT=0x0501;_CRTDBG_MAPALLOC "
|
PreprocessorDefinitions="_CRT_NONSTDC_NO_DEPRECATE;DEBUG;_CRT_SECURE_NO_DEPRECATE;GLIB_STATIC_COMPILATION;WIN32;HAVE_LIBZ;NOMINMAX;_WIN32_WINNT=0x0501;_CRTDBG_MAPALLOC "
|
||||||
ExceptionHandling="1"
|
ExceptionHandling="1"
|
||||||
BasicRuntimeChecks="0"
|
BasicRuntimeChecks="0"
|
||||||
|
@ -247,7 +247,7 @@
|
||||||
OmitFramePointers="true"
|
OmitFramePointers="true"
|
||||||
EnableFiberSafeOptimizations="true"
|
EnableFiberSafeOptimizations="true"
|
||||||
WholeProgramOptimization="true"
|
WholeProgramOptimization="true"
|
||||||
AdditionalIncludeDirectories=".;..;lua\include;"glib-2.20.1\build";"glib-2.20.1\build\glib";.\zlib123;.\zziplib;.\winpcap;userconfig;defaultconfig;.\agg\include;.\agg\examples;directx"
|
AdditionalIncludeDirectories=".;..;lua\include;"glib-2.20.1\build";"glib-2.20.1\build\glib";.\zlib123;.\zziplib;.\winpcap;userconfig;defaultconfig;.\agg\include;.\agg\examples;directx;File_Extractor;stdint"
|
||||||
PreprocessorDefinitions="_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;GLIB_STATIC_COMPILATION;WIN32;HAVE_LIBZ;NOMINMAX;NDEBUG;RELEASE;_WIN32_WINNT=0x0501"
|
PreprocessorDefinitions="_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;GLIB_STATIC_COMPILATION;WIN32;HAVE_LIBZ;NOMINMAX;NDEBUG;RELEASE;_WIN32_WINNT=0x0501"
|
||||||
StringPooling="true"
|
StringPooling="true"
|
||||||
ExceptionHandling="1"
|
ExceptionHandling="1"
|
||||||
|
@ -446,7 +446,7 @@
|
||||||
OmitFramePointers="true"
|
OmitFramePointers="true"
|
||||||
EnableFiberSafeOptimizations="true"
|
EnableFiberSafeOptimizations="true"
|
||||||
WholeProgramOptimization="false"
|
WholeProgramOptimization="false"
|
||||||
AdditionalIncludeDirectories=".;..;lua\include;"glib-2.20.1\build";"glib-2.20.1\build\glib";.\zlib123;.\zziplib;.\winpcap;userconfig;defaultconfig;.\agg\include;.\agg\examples;directx"
|
AdditionalIncludeDirectories=".;..;lua\include;"glib-2.20.1\build";"glib-2.20.1\build\glib";.\zlib123;.\zziplib;.\winpcap;userconfig;defaultconfig;.\agg\include;.\agg\examples;directx;File_Extractor;stdint"
|
||||||
PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;GLIB_STATIC_COMPILATION;WIN32;HAVE_LIBZ;NOMINMAX;NDEBUG;RELEASE;_WIN32_WINNT=0x0501;FASTBUILD"
|
PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;GLIB_STATIC_COMPILATION;WIN32;HAVE_LIBZ;NOMINMAX;NDEBUG;RELEASE;_WIN32_WINNT=0x0501;FASTBUILD"
|
||||||
StringPooling="true"
|
StringPooling="true"
|
||||||
ExceptionHandling="1"
|
ExceptionHandling="1"
|
||||||
|
@ -689,6 +689,10 @@
|
||||||
RelativePath=".\FEX_Interface.cpp"
|
RelativePath=".\FEX_Interface.cpp"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\FEX_Interface.h"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\FirmConfig.cpp"
|
RelativePath=".\FirmConfig.cpp"
|
||||||
>
|
>
|
||||||
|
@ -961,80 +965,52 @@
|
||||||
Name="File_Extractor"
|
Name="File_Extractor"
|
||||||
>
|
>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\File_Extractor\fex\Binary_Extractor.cpp"
|
RelativePath=".\File_Extractor\7z_C\7zIn.c"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\File_Extractor\fex\blargg_common.cpp"
|
RelativePath=".\File_Extractor\7z_C\7zIn.h"
|
||||||
>
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\File_Extractor\fex\blargg_errors.cpp"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\File_Extractor\fex\Data_Reader.cpp"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\File_Extractor\fex\fex.cpp"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\File_Extractor\fex\fex.h"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\File_Extractor\fex\File_Extractor.cpp"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\File_Extractor\fex\Gzip_Extractor.cpp"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\File_Extractor\fex\Gzip_Reader.cpp"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\File_Extractor\fex\Rar_Extractor.cpp"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\File_Extractor\fex\Zip7_Extractor.cpp"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\File_Extractor\fex\Zip_Extractor.cpp"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\File_Extractor\fex\Zip_Extractor.h"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\File_Extractor\fex\Zlib_Inflater.cpp"
|
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
<Filter
|
<Filter
|
||||||
Name="7-Zip"
|
Name="7z_C"
|
||||||
>
|
>
|
||||||
|
<File
|
||||||
|
RelativePath=".\File_Extractor\7z_C\7z.h"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\File_Extractor\7z_C\7zAlloc.c"
|
RelativePath=".\File_Extractor\7z_C\7zAlloc.c"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\File_Extractor\7z_C\7zAlloc.h"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\File_Extractor\7z_C\7zBuf.c"
|
RelativePath=".\File_Extractor\7z_C\7zBuf.c"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\File_Extractor\7z_C\7zBuf.h"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\File_Extractor\7z_C\7zBuf2.c"
|
RelativePath=".\File_Extractor\7z_C\7zBuf2.c"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\File_Extractor\7z_C\7zC.txt"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\File_Extractor\7z_C\7zCrc.c"
|
RelativePath=".\File_Extractor\7z_C\7zCrc.c"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\File_Extractor\7z_C\7zCrc.h"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\File_Extractor\7z_C\7zCrcOpt.c"
|
RelativePath=".\File_Extractor\7z_C\7zCrcOpt.c"
|
||||||
>
|
>
|
||||||
|
@ -1043,30 +1019,66 @@
|
||||||
RelativePath=".\File_Extractor\7z_C\7zDec.c"
|
RelativePath=".\File_Extractor\7z_C\7zDec.c"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\File_Extractor\7z_C\7zDecode.c"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\File_Extractor\7z_C\7zDecode.h"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\File_Extractor\7z_C\7zExtract.c"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\File_Extractor\7z_C\7zExtract.h"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\File_Extractor\7z_C\7zFile.c"
|
RelativePath=".\File_Extractor\7z_C\7zFile.c"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\File_Extractor\7z_C\7zIn.c"
|
RelativePath=".\File_Extractor\7z_C\7zFile.h"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\File_Extractor\7z_C\7zStream.c"
|
RelativePath=".\File_Extractor\7z_C\7zStream.c"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\File_Extractor\7z_C\7zTypes.h"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\File_Extractor\7z_C\7zVersion.h"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\File_Extractor\7z_C\Alloc.c"
|
RelativePath=".\File_Extractor\7z_C\Alloc.c"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\File_Extractor\7z_C\Alloc.h"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\File_Extractor\7z_C\Bcj2.c"
|
RelativePath=".\File_Extractor\7z_C\Bcj2.c"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\File_Extractor\7z_C\Bcj2.h"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\File_Extractor\7z_C\Bra.c"
|
RelativePath=".\File_Extractor\7z_C\Bra.c"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\File_Extractor\7z_C\Bra.h"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\File_Extractor\7z_C\Bra86.c"
|
RelativePath=".\File_Extractor\7z_C\Bra86.c"
|
||||||
>
|
>
|
||||||
|
@ -1075,30 +1087,70 @@
|
||||||
RelativePath=".\File_Extractor\7z_C\BraIA64.c"
|
RelativePath=".\File_Extractor\7z_C\BraIA64.c"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\File_Extractor\7z_C\changes.txt"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\File_Extractor\7z_C\CpuArch.c"
|
RelativePath=".\File_Extractor\7z_C\CpuArch.c"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\File_Extractor\7z_C\CpuArch.h"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\File_Extractor\7z_C\Delta.c"
|
RelativePath=".\File_Extractor\7z_C\Delta.c"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\File_Extractor\7z_C\Delta.h"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\File_Extractor\7z_C\LzFind.c"
|
RelativePath=".\File_Extractor\7z_C\LzFind.c"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\File_Extractor\7z_C\LzFind.h"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\File_Extractor\7z_C\LzFindMt.c"
|
RelativePath=".\File_Extractor\7z_C\LzFindMt.c"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\File_Extractor\7z_C\LzFindMt.h"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\File_Extractor\7z_C\LzHash.h"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\File_Extractor\7z_C\lzma.txt"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\File_Extractor\7z_C\Lzma2Dec.c"
|
RelativePath=".\File_Extractor\7z_C\Lzma2Dec.c"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\File_Extractor\7z_C\Lzma2Dec.h"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\File_Extractor\7z_C\Lzma2Enc.c"
|
RelativePath=".\File_Extractor\7z_C\Lzma2Enc.c"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\File_Extractor\7z_C\Lzma2Enc.h"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\File_Extractor\7z_C\Lzma86.h"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\File_Extractor\7z_C\Lzma86Dec.c"
|
RelativePath=".\File_Extractor\7z_C\Lzma86Dec.c"
|
||||||
>
|
>
|
||||||
|
@ -1111,22 +1163,50 @@
|
||||||
RelativePath=".\File_Extractor\7z_C\LzmaDec.c"
|
RelativePath=".\File_Extractor\7z_C\LzmaDec.c"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\File_Extractor\7z_C\LzmaDec.h"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\File_Extractor\7z_C\LzmaEnc.c"
|
RelativePath=".\File_Extractor\7z_C\LzmaEnc.c"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\File_Extractor\7z_C\LzmaEnc.h"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\File_Extractor\7z_C\LzmaLib.c"
|
RelativePath=".\File_Extractor\7z_C\LzmaLib.c"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\File_Extractor\7z_C\LzmaLib.h"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\File_Extractor\7z_C\LzmaTypes.h"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\File_Extractor\7z_C\MtCoder.c"
|
RelativePath=".\File_Extractor\7z_C\MtCoder.c"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\File_Extractor\7z_C\MtCoder.h"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\File_Extractor\7z_C\Ppmd.h"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\File_Extractor\7z_C\Ppmd7.c"
|
RelativePath=".\File_Extractor\7z_C\Ppmd7.c"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\File_Extractor\7z_C\Ppmd7.h"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\File_Extractor\7z_C\Ppmd7Dec.c"
|
RelativePath=".\File_Extractor\7z_C\Ppmd7Dec.c"
|
||||||
>
|
>
|
||||||
|
@ -1136,9 +1216,29 @@
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\File_Extractor\7z_C\Threads.c"
|
RelativePath=".\File_Extractor\7z_C\RotateDefs.h"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\File_Extractor\7z_C\Threads.h"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\File_Extractor\7z_C\Types.h"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<Filter
|
||||||
|
Name="win32"
|
||||||
|
>
|
||||||
|
<File
|
||||||
|
RelativePath=".\File_Extractor\7z_C\win32\Threads.c"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\File_Extractor\7z_C\win32\Threads.h"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
</Filter>
|
||||||
</Filter>
|
</Filter>
|
||||||
<Filter
|
<Filter
|
||||||
Name="unrar"
|
Name="unrar"
|
||||||
|
@ -1151,6 +1251,22 @@
|
||||||
RelativePath=".\File_Extractor\unrar\arcread.cpp"
|
RelativePath=".\File_Extractor\unrar\arcread.cpp"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\File_Extractor\unrar\blake2s.cpp"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\File_Extractor\unrar\blake2s.hpp"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\File_Extractor\unrar\blake2s_sse.cpp"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\File_Extractor\unrar\blake2sp.cpp"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\File_Extractor\unrar\coder.cpp"
|
RelativePath=".\File_Extractor\unrar\coder.cpp"
|
||||||
>
|
>
|
||||||
|
@ -1171,10 +1287,30 @@
|
||||||
RelativePath=".\File_Extractor\unrar\getbits.cpp"
|
RelativePath=".\File_Extractor\unrar\getbits.cpp"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\File_Extractor\unrar\hash.cpp"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\File_Extractor\unrar\hash.hpp"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\File_Extractor\unrar\headers.cpp"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\File_Extractor\unrar\headers5.hpp"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\File_Extractor\unrar\model.cpp"
|
RelativePath=".\File_Extractor\unrar\model.cpp"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\File_Extractor\unrar\pathfn.cpp"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\File_Extractor\unrar\rarvm.cpp"
|
RelativePath=".\File_Extractor\unrar\rarvm.cpp"
|
||||||
>
|
>
|
||||||
|
@ -1187,10 +1323,30 @@
|
||||||
RelativePath=".\File_Extractor\unrar\rawread.cpp"
|
RelativePath=".\File_Extractor\unrar\rawread.cpp"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\File_Extractor\unrar\secpassword.cpp"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\File_Extractor\unrar\strfn.cpp"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\File_Extractor\unrar\strfn.hpp"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\File_Extractor\unrar\suballoc.cpp"
|
RelativePath=".\File_Extractor\unrar\suballoc.cpp"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\File_Extractor\unrar\timefn.cpp"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\File_Extractor\unrar\timefn.hpp"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\File_Extractor\unrar\unicode.cpp"
|
RelativePath=".\File_Extractor\unrar\unicode.cpp"
|
||||||
>
|
>
|
||||||
|
@ -1207,6 +1363,22 @@
|
||||||
RelativePath=".\File_Extractor\unrar\unpack20.cpp"
|
RelativePath=".\File_Extractor\unrar\unpack20.cpp"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\File_Extractor\unrar\unpack30.cpp"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\File_Extractor\unrar\unpack50.cpp"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\File_Extractor\unrar\unpack50frag.cpp"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\File_Extractor\unrar\unpackinline.cpp"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\File_Extractor\unrar\unrar.cpp"
|
RelativePath=".\File_Extractor\unrar\unrar.cpp"
|
||||||
>
|
>
|
||||||
|
@ -1220,6 +1392,118 @@
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
</Filter>
|
</Filter>
|
||||||
|
<Filter
|
||||||
|
Name="fex"
|
||||||
|
>
|
||||||
|
<File
|
||||||
|
RelativePath=".\File_Extractor\fex\Binary_Extractor.cpp"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\File_Extractor\fex\Binary_Extractor.h"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\File_Extractor\fex\blargg_common.cpp"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\File_Extractor\fex\blargg_common.h"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\File_Extractor\fex\blargg_config.h"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\File_Extractor\fex\blargg_endian.h"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\File_Extractor\fex\blargg_errors.cpp"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\File_Extractor\fex\blargg_errors.h"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\File_Extractor\fex\blargg_source.h"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\File_Extractor\fex\Data_Reader.cpp"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\File_Extractor\fex\Data_Reader.h"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\File_Extractor\fex\fex.cpp"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\File_Extractor\fex\fex.h"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\File_Extractor\fex\File_Extractor.cpp"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\File_Extractor\fex\File_Extractor.h"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\File_Extractor\fex\Gzip_Extractor.cpp"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\File_Extractor\fex\Gzip_Extractor.h"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\File_Extractor\fex\Gzip_Reader.cpp"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\File_Extractor\fex\Gzip_Reader.h"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\File_Extractor\fex\Rar_Extractor.cpp"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\File_Extractor\fex\Rar_Extractor.h"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\File_Extractor\fex\Zip7_Extractor.cpp"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\File_Extractor\fex\Zip7_Extractor.h"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\File_Extractor\fex\Zip_Extractor.cpp"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\File_Extractor\fex\Zip_Extractor.h"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\File_Extractor\fex\Zlib_Inflater.cpp"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\File_Extractor\fex\Zlib_Inflater.h"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
</Filter>
|
||||||
</Filter>
|
</Filter>
|
||||||
<Filter
|
<Filter
|
||||||
Name="userconfig"
|
Name="userconfig"
|
||||||
|
|
|
@ -56,7 +56,7 @@
|
||||||
FavorSizeOrSpeed="0"
|
FavorSizeOrSpeed="0"
|
||||||
EnableFiberSafeOptimizations="false"
|
EnableFiberSafeOptimizations="false"
|
||||||
WholeProgramOptimization="false"
|
WholeProgramOptimization="false"
|
||||||
AdditionalIncludeDirectories=".;..;lua\include;"glib-2.20.1\build";"glib-2.20.1\build\glib";.\zlib123;.\zziplib;.\winpcap;userconfig;defaultconfig;.\agg\include;.\agg\examples;directx"
|
AdditionalIncludeDirectories=".;..;lua\include;"glib-2.20.1\build";"glib-2.20.1\build\glib";.\zlib123;.\zziplib;.\winpcap;userconfig;defaultconfig;.\agg\include;.\agg\examples;directx;File_Extractor"
|
||||||
PreprocessorDefinitions="DEBUG;_CRT_SECURE_NO_DEPRECATE;GLIB_STATIC_COMPILATION;WIN32;BETA_VERSION;NOMINMAX;HAVE_LIBZ"
|
PreprocessorDefinitions="DEBUG;_CRT_SECURE_NO_DEPRECATE;GLIB_STATIC_COMPILATION;WIN32;BETA_VERSION;NOMINMAX;HAVE_LIBZ"
|
||||||
ExceptionHandling="1"
|
ExceptionHandling="1"
|
||||||
BasicRuntimeChecks="3"
|
BasicRuntimeChecks="3"
|
||||||
|
@ -238,7 +238,7 @@
|
||||||
OmitFramePointers="true"
|
OmitFramePointers="true"
|
||||||
EnableFiberSafeOptimizations="true"
|
EnableFiberSafeOptimizations="true"
|
||||||
WholeProgramOptimization="true"
|
WholeProgramOptimization="true"
|
||||||
AdditionalIncludeDirectories=".;..;lua\include;"glib-2.20.1\build";"glib-2.20.1\build\glib";.\zlib123;.\zziplib;.\winpcap;userconfig;defaultconfig;.\agg\include;.\agg\examples;directx"
|
AdditionalIncludeDirectories=".;..;lua\include;"glib-2.20.1\build";"glib-2.20.1\build\glib";.\zlib123;.\zziplib;.\winpcap;userconfig;defaultconfig;.\agg\include;.\agg\examples;directx;File_Extractor"
|
||||||
PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;GLIB_STATIC_COMPILATION;WIN32;HAVE_LIBZ;NOMINMAX;RELEASE;NDEBUG"
|
PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;GLIB_STATIC_COMPILATION;WIN32;HAVE_LIBZ;NOMINMAX;RELEASE;NDEBUG"
|
||||||
StringPooling="true"
|
StringPooling="true"
|
||||||
ExceptionHandling="1"
|
ExceptionHandling="1"
|
||||||
|
@ -428,7 +428,7 @@
|
||||||
OmitFramePointers="true"
|
OmitFramePointers="true"
|
||||||
EnableFiberSafeOptimizations="true"
|
EnableFiberSafeOptimizations="true"
|
||||||
WholeProgramOptimization="false"
|
WholeProgramOptimization="false"
|
||||||
AdditionalIncludeDirectories=".;..;lua\include;"glib-2.20.1\build";"glib-2.20.1\build\glib";.\zlib123;.\zziplib;.\winpcap;userconfig;defaultconfig;.\agg\include;.\agg\examples;directx"
|
AdditionalIncludeDirectories=".;..;lua\include;"glib-2.20.1\build";"glib-2.20.1\build\glib";.\zlib123;.\zziplib;.\winpcap;userconfig;defaultconfig;.\agg\include;.\agg\examples;directx;File_Extractor"
|
||||||
PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;GLIB_STATIC_COMPILATION;WIN32;HAVE_LIBZ;NOMINMAX;RELEASE;NDEBUG;FASTBUILD;DEVELOPER"
|
PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;GLIB_STATIC_COMPILATION;WIN32;HAVE_LIBZ;NOMINMAX;RELEASE;NDEBUG;FASTBUILD;DEVELOPER"
|
||||||
StringPooling="true"
|
StringPooling="true"
|
||||||
ExceptionHandling="1"
|
ExceptionHandling="1"
|
||||||
|
|
|
@ -125,7 +125,7 @@
|
||||||
<FavorSizeOrSpeed>Neither</FavorSizeOrSpeed>
|
<FavorSizeOrSpeed>Neither</FavorSizeOrSpeed>
|
||||||
<EnableFiberSafeOptimizations>false</EnableFiberSafeOptimizations>
|
<EnableFiberSafeOptimizations>false</EnableFiberSafeOptimizations>
|
||||||
<WholeProgramOptimization>false</WholeProgramOptimization>
|
<WholeProgramOptimization>false</WholeProgramOptimization>
|
||||||
<AdditionalIncludeDirectories>.;..;lua\include;glib-2.20.1\build;glib-2.20.1\build\glib;.\zlib123;.\zziplib;.\winpcap;userconfig;defaultconfig;.\agg\include;.\agg\examples;directx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
<AdditionalIncludeDirectories>.;..;lua\include;glib-2.20.1\build;glib-2.20.1\build\glib;.\zlib123;.\zziplib;.\winpcap;userconfig;defaultconfig;.\agg\include;.\agg\examples;directx;File_Extractor;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
<PreprocessorDefinitions>DEBUG;_CRT_SECURE_NO_DEPRECATE;GLIB_STATIC_COMPILATION;WIN32;BETA_VERSION;NOMINMAX;HAVE_LIBZ;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
<PreprocessorDefinitions>DEBUG;_CRT_SECURE_NO_DEPRECATE;GLIB_STATIC_COMPILATION;WIN32;BETA_VERSION;NOMINMAX;HAVE_LIBZ;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
<ExceptionHandling>Sync</ExceptionHandling>
|
<ExceptionHandling>Sync</ExceptionHandling>
|
||||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||||
|
@ -164,7 +164,7 @@
|
||||||
<OmitFramePointers>true</OmitFramePointers>
|
<OmitFramePointers>true</OmitFramePointers>
|
||||||
<EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>
|
<EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>
|
||||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||||
<AdditionalIncludeDirectories>.;..;lua\include;glib-2.20.1\build;glib-2.20.1\build\glib;.\zlib123;.\zziplib;.\winpcap;userconfig;defaultconfig;.\agg\include;.\agg\examples;directx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
<AdditionalIncludeDirectories>.;..;lua\include;glib-2.20.1\build;glib-2.20.1\build\glib;.\zlib123;.\zziplib;.\winpcap;userconfig;defaultconfig;.\agg\include;.\agg\examples;directx;File_Extractor;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
<PreprocessorDefinitions>_CRT_SECURE_NO_DEPRECATE;GLIB_STATIC_COMPILATION;WIN32;HAVE_LIBZ;NOMINMAX;RELEASE;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
<PreprocessorDefinitions>_CRT_SECURE_NO_DEPRECATE;GLIB_STATIC_COMPILATION;WIN32;HAVE_LIBZ;NOMINMAX;RELEASE;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
<StringPooling>true</StringPooling>
|
<StringPooling>true</StringPooling>
|
||||||
<ExceptionHandling>Sync</ExceptionHandling>
|
<ExceptionHandling>Sync</ExceptionHandling>
|
||||||
|
@ -204,7 +204,7 @@
|
||||||
<OmitFramePointers>true</OmitFramePointers>
|
<OmitFramePointers>true</OmitFramePointers>
|
||||||
<EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>
|
<EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>
|
||||||
<WholeProgramOptimization>false</WholeProgramOptimization>
|
<WholeProgramOptimization>false</WholeProgramOptimization>
|
||||||
<AdditionalIncludeDirectories>.;..;lua\include;glib-2.20.1\build;glib-2.20.1\build\glib;.\zlib123;.\zziplib;.\winpcap;userconfig;defaultconfig;.\agg\include;.\agg\examples;directx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
<AdditionalIncludeDirectories>.;..;lua\include;glib-2.20.1\build;glib-2.20.1\build\glib;.\zlib123;.\zziplib;.\winpcap;userconfig;defaultconfig;.\agg\include;.\agg\examples;directx;File_Extractor;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
<PreprocessorDefinitions>_CRT_SECURE_NO_DEPRECATE;GLIB_STATIC_COMPILATION;WIN32;HAVE_LIBZ;NOMINMAX;RELEASE;NDEBUG;FASTBUILD;DEVELOPER;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
<PreprocessorDefinitions>_CRT_SECURE_NO_DEPRECATE;GLIB_STATIC_COMPILATION;WIN32;HAVE_LIBZ;NOMINMAX;RELEASE;NDEBUG;FASTBUILD;DEVELOPER;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
<StringPooling>true</StringPooling>
|
<StringPooling>true</StringPooling>
|
||||||
<ExceptionHandling>Sync</ExceptionHandling>
|
<ExceptionHandling>Sync</ExceptionHandling>
|
||||||
|
@ -536,40 +536,10 @@
|
||||||
<ClCompile Include="File_Extractor\7z_C\7zCrc.c" />
|
<ClCompile Include="File_Extractor\7z_C\7zCrc.c" />
|
||||||
<ClCompile Include="File_Extractor\7z_C\7zCrcOpt.c" />
|
<ClCompile Include="File_Extractor\7z_C\7zCrcOpt.c" />
|
||||||
<ClCompile Include="File_Extractor\7z_C\7zDec.c" />
|
<ClCompile Include="File_Extractor\7z_C\7zDec.c" />
|
||||||
<ClCompile Include="File_Extractor\7z_C\7zDecode.c">
|
<ClCompile Include="File_Extractor\7z_C\7zDecode.c" />
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
<ClCompile Include="File_Extractor\7z_C\7zExtract.c" />
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Dev+|Win32'">true</ExcludedFromBuild>
|
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Dev+|x64'">true</ExcludedFromBuild>
|
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\7z_C\7zExtract.c">
|
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Dev+|Win32'">true</ExcludedFromBuild>
|
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Dev+|x64'">true</ExcludedFromBuild>
|
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\7z_C\7zFile.c" />
|
<ClCompile Include="File_Extractor\7z_C\7zFile.c" />
|
||||||
<ClCompile Include="File_Extractor\7z_C\7zHeader.c">
|
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Dev+|Win32'">true</ExcludedFromBuild>
|
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Dev+|x64'">true</ExcludedFromBuild>
|
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\7z_C\7zIn.c" />
|
<ClCompile Include="File_Extractor\7z_C\7zIn.c" />
|
||||||
<ClCompile Include="File_Extractor\7z_C\7zItem.c">
|
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Dev+|Win32'">true</ExcludedFromBuild>
|
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Dev+|x64'">true</ExcludedFromBuild>
|
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\7z_C\7zStream.c" />
|
<ClCompile Include="File_Extractor\7z_C\7zStream.c" />
|
||||||
<ClCompile Include="File_Extractor\7z_C\Alloc.c" />
|
<ClCompile Include="File_Extractor\7z_C\Alloc.c" />
|
||||||
<ClCompile Include="File_Extractor\7z_C\Bcj2.c" />
|
<ClCompile Include="File_Extractor\7z_C\Bcj2.c" />
|
||||||
|
@ -591,7 +561,7 @@
|
||||||
<ClCompile Include="File_Extractor\7z_C\Ppmd7.c" />
|
<ClCompile Include="File_Extractor\7z_C\Ppmd7.c" />
|
||||||
<ClCompile Include="File_Extractor\7z_C\Ppmd7Dec.c" />
|
<ClCompile Include="File_Extractor\7z_C\Ppmd7Dec.c" />
|
||||||
<ClCompile Include="File_Extractor\7z_C\Ppmd7Enc.c" />
|
<ClCompile Include="File_Extractor\7z_C\Ppmd7Enc.c" />
|
||||||
<ClCompile Include="File_Extractor\7z_C\Threads.c" />
|
<ClCompile Include="File_Extractor\7z_C\win32\Threads.c" />
|
||||||
<ClCompile Include="File_Extractor\fex\Binary_Extractor.cpp" />
|
<ClCompile Include="File_Extractor\fex\Binary_Extractor.cpp" />
|
||||||
<ClCompile Include="File_Extractor\fex\blargg_common.cpp" />
|
<ClCompile Include="File_Extractor\fex\blargg_common.cpp" />
|
||||||
<ClCompile Include="File_Extractor\fex\blargg_errors.cpp" />
|
<ClCompile Include="File_Extractor\fex\blargg_errors.cpp" />
|
||||||
|
@ -606,20 +576,33 @@
|
||||||
<ClCompile Include="File_Extractor\fex\Zlib_Inflater.cpp" />
|
<ClCompile Include="File_Extractor\fex\Zlib_Inflater.cpp" />
|
||||||
<ClCompile Include="File_Extractor\unrar\archive.cpp" />
|
<ClCompile Include="File_Extractor\unrar\archive.cpp" />
|
||||||
<ClCompile Include="File_Extractor\unrar\arcread.cpp" />
|
<ClCompile Include="File_Extractor\unrar\arcread.cpp" />
|
||||||
|
<ClCompile Include="File_Extractor\unrar\blake2s.cpp" />
|
||||||
|
<ClCompile Include="File_Extractor\unrar\blake2sp.cpp" />
|
||||||
|
<ClCompile Include="File_Extractor\unrar\blake2s_sse.cpp" />
|
||||||
<ClCompile Include="File_Extractor\unrar\coder.cpp" />
|
<ClCompile Include="File_Extractor\unrar\coder.cpp" />
|
||||||
<ClCompile Include="File_Extractor\unrar\crc.cpp" />
|
<ClCompile Include="File_Extractor\unrar\crc.cpp" />
|
||||||
<ClCompile Include="File_Extractor\unrar\encname.cpp" />
|
<ClCompile Include="File_Extractor\unrar\encname.cpp" />
|
||||||
<ClCompile Include="File_Extractor\unrar\extract.cpp" />
|
<ClCompile Include="File_Extractor\unrar\extract.cpp" />
|
||||||
<ClCompile Include="File_Extractor\unrar\getbits.cpp" />
|
<ClCompile Include="File_Extractor\unrar\getbits.cpp" />
|
||||||
|
<ClCompile Include="File_Extractor\unrar\hash.cpp" />
|
||||||
|
<ClCompile Include="File_Extractor\unrar\headers.cpp" />
|
||||||
<ClCompile Include="File_Extractor\unrar\model.cpp" />
|
<ClCompile Include="File_Extractor\unrar\model.cpp" />
|
||||||
|
<ClCompile Include="File_Extractor\unrar\pathfn.cpp" />
|
||||||
<ClCompile Include="File_Extractor\unrar\rarvm.cpp" />
|
<ClCompile Include="File_Extractor\unrar\rarvm.cpp" />
|
||||||
<ClCompile Include="File_Extractor\unrar\rarvmtbl.cpp" />
|
<ClCompile Include="File_Extractor\unrar\rarvmtbl.cpp" />
|
||||||
<ClCompile Include="File_Extractor\unrar\rawread.cpp" />
|
<ClCompile Include="File_Extractor\unrar\rawread.cpp" />
|
||||||
|
<ClCompile Include="File_Extractor\unrar\secpassword.cpp" />
|
||||||
|
<ClCompile Include="File_Extractor\unrar\strfn.cpp" />
|
||||||
<ClCompile Include="File_Extractor\unrar\suballoc.cpp" />
|
<ClCompile Include="File_Extractor\unrar\suballoc.cpp" />
|
||||||
|
<ClCompile Include="File_Extractor\unrar\timefn.cpp" />
|
||||||
<ClCompile Include="File_Extractor\unrar\unicode.cpp" />
|
<ClCompile Include="File_Extractor\unrar\unicode.cpp" />
|
||||||
<ClCompile Include="File_Extractor\unrar\unpack.cpp" />
|
<ClCompile Include="File_Extractor\unrar\unpack.cpp" />
|
||||||
<ClCompile Include="File_Extractor\unrar\unpack15.cpp" />
|
<ClCompile Include="File_Extractor\unrar\unpack15.cpp" />
|
||||||
<ClCompile Include="File_Extractor\unrar\unpack20.cpp" />
|
<ClCompile Include="File_Extractor\unrar\unpack20.cpp" />
|
||||||
|
<ClCompile Include="File_Extractor\unrar\unpack30.cpp" />
|
||||||
|
<ClCompile Include="File_Extractor\unrar\unpack50.cpp" />
|
||||||
|
<ClCompile Include="File_Extractor\unrar\unpack50frag.cpp" />
|
||||||
|
<ClCompile Include="File_Extractor\unrar\unpackinline.cpp" />
|
||||||
<ClCompile Include="File_Extractor\unrar\unrar.cpp" />
|
<ClCompile Include="File_Extractor\unrar\unrar.cpp" />
|
||||||
<ClCompile Include="File_Extractor\unrar\unrar_misc.cpp" />
|
<ClCompile Include="File_Extractor\unrar\unrar_misc.cpp" />
|
||||||
<ClCompile Include="File_Extractor\unrar\unrar_open.cpp" />
|
<ClCompile Include="File_Extractor\unrar\unrar_open.cpp" />
|
||||||
|
@ -671,7 +654,6 @@
|
||||||
<ClInclude Include="..\debug.h" />
|
<ClInclude Include="..\debug.h" />
|
||||||
<ClInclude Include="..\Disassembler.h" />
|
<ClInclude Include="..\Disassembler.h" />
|
||||||
<ClInclude Include="..\driver.h" />
|
<ClInclude Include="..\driver.h" />
|
||||||
<ClInclude Include="..\emufat_types.h" />
|
|
||||||
<ClInclude Include="..\emufile.h" />
|
<ClInclude Include="..\emufile.h" />
|
||||||
<ClInclude Include="..\encrypt.h" />
|
<ClInclude Include="..\encrypt.h" />
|
||||||
<ClInclude Include="..\fat.h" />
|
<ClInclude Include="..\fat.h" />
|
||||||
|
@ -817,9 +799,7 @@
|
||||||
<ClInclude Include="File_Extractor\7z_C\7zDecode.h" />
|
<ClInclude Include="File_Extractor\7z_C\7zDecode.h" />
|
||||||
<ClInclude Include="File_Extractor\7z_C\7zExtract.h" />
|
<ClInclude Include="File_Extractor\7z_C\7zExtract.h" />
|
||||||
<ClInclude Include="File_Extractor\7z_C\7zFile.h" />
|
<ClInclude Include="File_Extractor\7z_C\7zFile.h" />
|
||||||
<ClInclude Include="File_Extractor\7z_C\7zHeader.h" />
|
|
||||||
<ClInclude Include="File_Extractor\7z_C\7zIn.h" />
|
<ClInclude Include="File_Extractor\7z_C\7zIn.h" />
|
||||||
<ClInclude Include="File_Extractor\7z_C\7zItem.h" />
|
|
||||||
<ClInclude Include="File_Extractor\7z_C\7zTypes.h" />
|
<ClInclude Include="File_Extractor\7z_C\7zTypes.h" />
|
||||||
<ClInclude Include="File_Extractor\7z_C\7zVersion.h" />
|
<ClInclude Include="File_Extractor\7z_C\7zVersion.h" />
|
||||||
<ClInclude Include="File_Extractor\7z_C\Alloc.h" />
|
<ClInclude Include="File_Extractor\7z_C\Alloc.h" />
|
||||||
|
@ -843,6 +823,7 @@
|
||||||
<ClInclude Include="File_Extractor\7z_C\RotateDefs.h" />
|
<ClInclude Include="File_Extractor\7z_C\RotateDefs.h" />
|
||||||
<ClInclude Include="File_Extractor\7z_C\Threads.h" />
|
<ClInclude Include="File_Extractor\7z_C\Threads.h" />
|
||||||
<ClInclude Include="File_Extractor\7z_C\Types.h" />
|
<ClInclude Include="File_Extractor\7z_C\Types.h" />
|
||||||
|
<ClInclude Include="File_Extractor\7z_C\win32\Threads.h" />
|
||||||
<ClInclude Include="File_Extractor\fex\Binary_Extractor.h" />
|
<ClInclude Include="File_Extractor\fex\Binary_Extractor.h" />
|
||||||
<ClInclude Include="File_Extractor\fex\blargg_common.h" />
|
<ClInclude Include="File_Extractor\fex\blargg_common.h" />
|
||||||
<ClInclude Include="File_Extractor\fex\blargg_config.h" />
|
<ClInclude Include="File_Extractor\fex\blargg_config.h" />
|
||||||
|
@ -860,22 +841,24 @@
|
||||||
<ClInclude Include="File_Extractor\fex\Zlib_Inflater.h" />
|
<ClInclude Include="File_Extractor\fex\Zlib_Inflater.h" />
|
||||||
<ClInclude Include="File_Extractor\unrar\archive.hpp" />
|
<ClInclude Include="File_Extractor\unrar\archive.hpp" />
|
||||||
<ClInclude Include="File_Extractor\unrar\array.hpp" />
|
<ClInclude Include="File_Extractor\unrar\array.hpp" />
|
||||||
|
<ClInclude Include="File_Extractor\unrar\blake2s.hpp" />
|
||||||
<ClInclude Include="File_Extractor\unrar\coder.hpp" />
|
<ClInclude Include="File_Extractor\unrar\coder.hpp" />
|
||||||
<ClInclude Include="File_Extractor\unrar\compress.hpp" />
|
<ClInclude Include="File_Extractor\unrar\compress.hpp" />
|
||||||
<ClInclude Include="File_Extractor\unrar\encname.hpp" />
|
<ClInclude Include="File_Extractor\unrar\encname.hpp" />
|
||||||
<ClInclude Include="File_Extractor\unrar\getbits.hpp" />
|
<ClInclude Include="File_Extractor\unrar\getbits.hpp" />
|
||||||
|
<ClInclude Include="File_Extractor\unrar\hash.hpp" />
|
||||||
<ClInclude Include="File_Extractor\unrar\headers.hpp" />
|
<ClInclude Include="File_Extractor\unrar\headers.hpp" />
|
||||||
|
<ClInclude Include="File_Extractor\unrar\headers5.hpp" />
|
||||||
<ClInclude Include="File_Extractor\unrar\model.hpp" />
|
<ClInclude Include="File_Extractor\unrar\model.hpp" />
|
||||||
<ClInclude Include="File_Extractor\unrar\rar.hpp" />
|
<ClInclude Include="File_Extractor\unrar\rar.hpp" />
|
||||||
<ClInclude Include="File_Extractor\unrar\rarvm.hpp" />
|
<ClInclude Include="File_Extractor\unrar\rarvm.hpp" />
|
||||||
<ClInclude Include="File_Extractor\unrar\rawread.hpp" />
|
<ClInclude Include="File_Extractor\unrar\rawread.hpp" />
|
||||||
|
<ClInclude Include="File_Extractor\unrar\strfn.hpp" />
|
||||||
<ClInclude Include="File_Extractor\unrar\suballoc.hpp" />
|
<ClInclude Include="File_Extractor\unrar\suballoc.hpp" />
|
||||||
|
<ClInclude Include="File_Extractor\unrar\timefn.hpp" />
|
||||||
<ClInclude Include="File_Extractor\unrar\unicode.hpp" />
|
<ClInclude Include="File_Extractor\unrar\unicode.hpp" />
|
||||||
<ClInclude Include="File_Extractor\unrar\unpack.hpp" />
|
<ClInclude Include="File_Extractor\unrar\unpack.hpp" />
|
||||||
<ClInclude Include="File_Extractor\unrar\unrar.h" />
|
<ClInclude Include="File_Extractor\unrar\unrar.h" />
|
||||||
<ClInclude Include="filter\hq2x.h" />
|
|
||||||
<ClInclude Include="filter\interp.h" />
|
|
||||||
<ClInclude Include="filter\lq2x.h" />
|
|
||||||
<ClInclude Include="FirmConfig.h" />
|
<ClInclude Include="FirmConfig.h" />
|
||||||
<ClInclude Include="fsnitroView.h" />
|
<ClInclude Include="fsnitroView.h" />
|
||||||
<ClInclude Include="gbaslot_config.h" />
|
<ClInclude Include="gbaslot_config.h" />
|
||||||
|
@ -984,6 +967,7 @@
|
||||||
<None Include="File_Extractor\7z_C\changes.txt" />
|
<None Include="File_Extractor\7z_C\changes.txt" />
|
||||||
<None Include="File_Extractor\7z_C\lzma.txt" />
|
<None Include="File_Extractor\7z_C\lzma.txt" />
|
||||||
<None Include="File_Extractor\7z_C\readme.txt" />
|
<None Include="File_Extractor\7z_C\readme.txt" />
|
||||||
|
<None Include="File_Extractor\unrar\acknow.txt" />
|
||||||
<None Include="File_Extractor\unrar\changes.txt" />
|
<None Include="File_Extractor\unrar\changes.txt" />
|
||||||
<None Include="File_Extractor\unrar\license.txt" />
|
<None Include="File_Extractor\unrar\license.txt" />
|
||||||
<None Include="File_Extractor\unrar\readme.txt" />
|
<None Include="File_Extractor\unrar\readme.txt" />
|
||||||
|
|
|
@ -52,21 +52,24 @@
|
||||||
<Filter Include="Core\utils\AsmJit">
|
<Filter Include="Core\utils\AsmJit">
|
||||||
<UniqueIdentifier>{faa7804e-deb3-482f-b348-921cb7dacca7}</UniqueIdentifier>
|
<UniqueIdentifier>{faa7804e-deb3-482f-b348-921cb7dacca7}</UniqueIdentifier>
|
||||||
</Filter>
|
</Filter>
|
||||||
<Filter Include="Windows\fex">
|
|
||||||
<UniqueIdentifier>{d2287daf-de85-4c64-8eef-2198f501904a}</UniqueIdentifier>
|
|
||||||
</Filter>
|
|
||||||
<Filter Include="Windows\fex\7z">
|
|
||||||
<UniqueIdentifier>{fddf8c65-a8f4-41ed-ab58-cd268c3a12da}</UniqueIdentifier>
|
|
||||||
</Filter>
|
|
||||||
<Filter Include="Windows\fex\unrar">
|
|
||||||
<UniqueIdentifier>{24398c49-4650-412e-b46f-4725ad4f5b11}</UniqueIdentifier>
|
|
||||||
</Filter>
|
|
||||||
<Filter Include="Core\utils\AsmJit\core">
|
<Filter Include="Core\utils\AsmJit\core">
|
||||||
<UniqueIdentifier>{82c38db3-d06d-44b5-a9a4-be3c002d0db0}</UniqueIdentifier>
|
<UniqueIdentifier>{82c38db3-d06d-44b5-a9a4-be3c002d0db0}</UniqueIdentifier>
|
||||||
</Filter>
|
</Filter>
|
||||||
<Filter Include="Core\utils\AsmJit\x86">
|
<Filter Include="Core\utils\AsmJit\x86">
|
||||||
<UniqueIdentifier>{0d620905-0dcf-47a4-bac2-91f307aa9994}</UniqueIdentifier>
|
<UniqueIdentifier>{0d620905-0dcf-47a4-bac2-91f307aa9994}</UniqueIdentifier>
|
||||||
</Filter>
|
</Filter>
|
||||||
|
<Filter Include="Windows\File_Extractor">
|
||||||
|
<UniqueIdentifier>{d2287daf-de85-4c64-8eef-2198f501904a}</UniqueIdentifier>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="Windows\File_Extractor\7z_C">
|
||||||
|
<UniqueIdentifier>{a6326bbe-afb7-4dd5-ae76-a7436bc8f7db}</UniqueIdentifier>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="Windows\File_Extractor\fex">
|
||||||
|
<UniqueIdentifier>{5f6c8f8e-0d1d-41a6-bd1f-0c7e51175b0f}</UniqueIdentifier>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="Windows\File_Extractor\unrar">
|
||||||
|
<UniqueIdentifier>{6e0c9a80-56da-436a-a32d-d64cf6323ac7}</UniqueIdentifier>
|
||||||
|
</Filter>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClCompile Include="..\aggdraw.cpp">
|
<ClCompile Include="..\aggdraw.cpp">
|
||||||
|
@ -480,204 +483,9 @@
|
||||||
<ClCompile Include="..\arm_jit.cpp">
|
<ClCompile Include="..\arm_jit.cpp">
|
||||||
<Filter>Core</Filter>
|
<Filter>Core</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="File_Extractor\fex\Binary_Extractor.cpp">
|
|
||||||
<Filter>Windows\fex</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\fex\blargg_common.cpp">
|
|
||||||
<Filter>Windows\fex</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\fex\blargg_errors.cpp">
|
|
||||||
<Filter>Windows\fex</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\fex\Data_Reader.cpp">
|
|
||||||
<Filter>Windows\fex</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\fex\fex.cpp">
|
|
||||||
<Filter>Windows\fex</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\fex\Gzip_Extractor.cpp">
|
|
||||||
<Filter>Windows\fex</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\fex\Gzip_Reader.cpp">
|
|
||||||
<Filter>Windows\fex</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\fex\Rar_Extractor.cpp">
|
|
||||||
<Filter>Windows\fex</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\fex\Zip_Extractor.cpp">
|
|
||||||
<Filter>Windows\fex</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\fex\Zip7_Extractor.cpp">
|
|
||||||
<Filter>Windows\fex</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\fex\Zlib_Inflater.cpp">
|
|
||||||
<Filter>Windows\fex</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\7z_C\7zAlloc.c">
|
|
||||||
<Filter>Windows\fex\7z</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\7z_C\7zBuf.c">
|
|
||||||
<Filter>Windows\fex\7z</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\7z_C\7zBuf2.c">
|
|
||||||
<Filter>Windows\fex\7z</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\7z_C\7zCrc.c">
|
|
||||||
<Filter>Windows\fex\7z</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\7z_C\7zCrcOpt.c">
|
|
||||||
<Filter>Windows\fex\7z</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\7z_C\7zDec.c">
|
|
||||||
<Filter>Windows\fex\7z</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\7z_C\7zDecode.c">
|
|
||||||
<Filter>Windows\fex\7z</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\7z_C\7zExtract.c">
|
|
||||||
<Filter>Windows\fex\7z</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\7z_C\7zFile.c">
|
|
||||||
<Filter>Windows\fex\7z</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\7z_C\7zHeader.c">
|
|
||||||
<Filter>Windows\fex\7z</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\7z_C\7zIn.c">
|
|
||||||
<Filter>Windows\fex\7z</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\7z_C\7zItem.c">
|
|
||||||
<Filter>Windows\fex\7z</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\7z_C\7zStream.c">
|
|
||||||
<Filter>Windows\fex\7z</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\7z_C\Alloc.c">
|
|
||||||
<Filter>Windows\fex\7z</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\7z_C\Bcj2.c">
|
|
||||||
<Filter>Windows\fex\7z</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\7z_C\Bra.c">
|
|
||||||
<Filter>Windows\fex\7z</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\7z_C\Bra86.c">
|
|
||||||
<Filter>Windows\fex\7z</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\7z_C\BraIA64.c">
|
|
||||||
<Filter>Windows\fex\7z</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\7z_C\CpuArch.c">
|
|
||||||
<Filter>Windows\fex\7z</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\7z_C\Delta.c">
|
|
||||||
<Filter>Windows\fex\7z</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\7z_C\LzFind.c">
|
|
||||||
<Filter>Windows\fex\7z</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\7z_C\LzFindMt.c">
|
|
||||||
<Filter>Windows\fex\7z</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\7z_C\Lzma2Dec.c">
|
|
||||||
<Filter>Windows\fex\7z</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\7z_C\Lzma2Enc.c">
|
|
||||||
<Filter>Windows\fex\7z</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\7z_C\Lzma86Dec.c">
|
|
||||||
<Filter>Windows\fex\7z</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\7z_C\Lzma86Enc.c">
|
|
||||||
<Filter>Windows\fex\7z</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\7z_C\LzmaDec.c">
|
|
||||||
<Filter>Windows\fex\7z</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\7z_C\LzmaEnc.c">
|
|
||||||
<Filter>Windows\fex\7z</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\7z_C\LzmaLib.c">
|
|
||||||
<Filter>Windows\fex\7z</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\7z_C\MtCoder.c">
|
|
||||||
<Filter>Windows\fex\7z</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\7z_C\Ppmd7.c">
|
|
||||||
<Filter>Windows\fex\7z</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\7z_C\Ppmd7Dec.c">
|
|
||||||
<Filter>Windows\fex\7z</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\7z_C\Ppmd7Enc.c">
|
|
||||||
<Filter>Windows\fex\7z</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\7z_C\Threads.c">
|
|
||||||
<Filter>Windows\fex\7z</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\unrar\archive.cpp">
|
|
||||||
<Filter>Windows\fex\unrar</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\unrar\arcread.cpp">
|
|
||||||
<Filter>Windows\fex\unrar</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\unrar\coder.cpp">
|
|
||||||
<Filter>Windows\fex\unrar</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\unrar\encname.cpp">
|
|
||||||
<Filter>Windows\fex\unrar</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\unrar\extract.cpp">
|
|
||||||
<Filter>Windows\fex\unrar</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\unrar\getbits.cpp">
|
|
||||||
<Filter>Windows\fex\unrar</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\unrar\model.cpp">
|
|
||||||
<Filter>Windows\fex\unrar</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\unrar\rarvm.cpp">
|
|
||||||
<Filter>Windows\fex\unrar</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\unrar\rarvmtbl.cpp">
|
|
||||||
<Filter>Windows\fex\unrar</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\unrar\rawread.cpp">
|
|
||||||
<Filter>Windows\fex\unrar</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\unrar\suballoc.cpp">
|
|
||||||
<Filter>Windows\fex\unrar</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\unrar\unicode.cpp">
|
|
||||||
<Filter>Windows\fex\unrar</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\unrar\unpack.cpp">
|
|
||||||
<Filter>Windows\fex\unrar</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\unrar\unpack15.cpp">
|
|
||||||
<Filter>Windows\fex\unrar</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\unrar\unpack20.cpp">
|
|
||||||
<Filter>Windows\fex\unrar</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\unrar\unrar.cpp">
|
|
||||||
<Filter>Windows\fex\unrar</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\unrar\unrar_misc.cpp">
|
|
||||||
<Filter>Windows\fex\unrar</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\unrar\unrar_open.cpp">
|
|
||||||
<Filter>Windows\fex\unrar</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\fex\File_Extractor.cpp">
|
|
||||||
<Filter>Windows\fex</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="FEX_Interface.cpp">
|
<ClCompile Include="FEX_Interface.cpp">
|
||||||
<Filter>Windows</Filter>
|
<Filter>Windows</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="File_Extractor\unrar\crc.cpp">
|
|
||||||
<Filter>Windows\fex\unrar</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="..\utils\AsmJit\core\assembler.cpp">
|
<ClCompile Include="..\utils\AsmJit\core\assembler.cpp">
|
||||||
<Filter>Core\utils\AsmJit\core</Filter>
|
<Filter>Core\utils\AsmJit\core</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
@ -810,6 +618,234 @@
|
||||||
<ClCompile Include="..\filter\xbrz.cpp">
|
<ClCompile Include="..\filter\xbrz.cpp">
|
||||||
<Filter>Core\filter</Filter>
|
<Filter>Core\filter</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\7z_C\win32\Threads.c">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\7z_C\7zAlloc.c">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\7z_C\7zBuf.c">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\7z_C\7zBuf2.c">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\7z_C\7zCrc.c">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\7z_C\7zCrcOpt.c">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\7z_C\7zDec.c">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\7z_C\7zDecode.c">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\7z_C\7zExtract.c">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\7z_C\7zFile.c">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\7z_C\7zIn.c">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\7z_C\7zStream.c">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\7z_C\Alloc.c">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\7z_C\Bcj2.c">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\7z_C\Bra.c">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\7z_C\Bra86.c">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\7z_C\BraIA64.c">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\7z_C\CpuArch.c">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\7z_C\Delta.c">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\7z_C\LzFind.c">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\7z_C\LzFindMt.c">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\7z_C\Lzma2Dec.c">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\7z_C\Lzma2Enc.c">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\7z_C\Lzma86Dec.c">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\7z_C\Lzma86Enc.c">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\7z_C\LzmaDec.c">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\7z_C\LzmaEnc.c">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\7z_C\LzmaLib.c">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\7z_C\MtCoder.c">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\7z_C\Ppmd7.c">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\7z_C\Ppmd7Dec.c">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\7z_C\Ppmd7Enc.c">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\fex\blargg_common.cpp">
|
||||||
|
<Filter>Windows\File_Extractor\fex</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\fex\blargg_errors.cpp">
|
||||||
|
<Filter>Windows\File_Extractor\fex</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\fex\Data_Reader.cpp">
|
||||||
|
<Filter>Windows\File_Extractor\fex</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\fex\fex.cpp">
|
||||||
|
<Filter>Windows\File_Extractor\fex</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\fex\File_Extractor.cpp">
|
||||||
|
<Filter>Windows\File_Extractor\fex</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\fex\Gzip_Extractor.cpp">
|
||||||
|
<Filter>Windows\File_Extractor\fex</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\fex\Gzip_Reader.cpp">
|
||||||
|
<Filter>Windows\File_Extractor\fex</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\fex\Rar_Extractor.cpp">
|
||||||
|
<Filter>Windows\File_Extractor\fex</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\fex\Zip_Extractor.cpp">
|
||||||
|
<Filter>Windows\File_Extractor\fex</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\fex\Zip7_Extractor.cpp">
|
||||||
|
<Filter>Windows\File_Extractor\fex</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\fex\Zlib_Inflater.cpp">
|
||||||
|
<Filter>Windows\File_Extractor\fex</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\fex\Binary_Extractor.cpp">
|
||||||
|
<Filter>Windows\File_Extractor\fex</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\unrar\arcread.cpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\unrar\blake2s.cpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\unrar\blake2s_sse.cpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\unrar\blake2sp.cpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\unrar\coder.cpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\unrar\crc.cpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\unrar\encname.cpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\unrar\extract.cpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\unrar\getbits.cpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\unrar\hash.cpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\unrar\headers.cpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\unrar\model.cpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\unrar\pathfn.cpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\unrar\rarvm.cpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\unrar\rarvmtbl.cpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\unrar\rawread.cpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\unrar\secpassword.cpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\unrar\strfn.cpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\unrar\suballoc.cpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\unrar\timefn.cpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\unrar\unicode.cpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\unrar\unpack.cpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\unrar\unpack15.cpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\unrar\unpack20.cpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\unrar\unpack30.cpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\unrar\unpack50.cpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\unrar\unpack50frag.cpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\unrar\unpackinline.cpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\unrar\unrar.cpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\unrar\unrar_misc.cpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\unrar\unrar_open.cpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\unrar\archive.cpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClCompile>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClInclude Include="..\armcpu.h">
|
<ClInclude Include="..\armcpu.h">
|
||||||
|
@ -1211,195 +1247,6 @@
|
||||||
<ClInclude Include="..\instructions.h">
|
<ClInclude Include="..\instructions.h">
|
||||||
<Filter>Core</Filter>
|
<Filter>Core</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClInclude Include="File_Extractor\fex\Binary_Extractor.h">
|
|
||||||
<Filter>Windows\fex</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="File_Extractor\fex\blargg_common.h">
|
|
||||||
<Filter>Windows\fex</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="File_Extractor\fex\blargg_config.h">
|
|
||||||
<Filter>Windows\fex</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="File_Extractor\fex\blargg_endian.h">
|
|
||||||
<Filter>Windows\fex</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="File_Extractor\fex\blargg_errors.h">
|
|
||||||
<Filter>Windows\fex</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="File_Extractor\fex\blargg_source.h">
|
|
||||||
<Filter>Windows\fex</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="File_Extractor\fex\Data_Reader.h">
|
|
||||||
<Filter>Windows\fex</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="File_Extractor\fex\fex.h">
|
|
||||||
<Filter>Windows\fex</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="File_Extractor\fex\Gzip_Extractor.h">
|
|
||||||
<Filter>Windows\fex</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="File_Extractor\fex\Gzip_Reader.h">
|
|
||||||
<Filter>Windows\fex</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="File_Extractor\fex\Rar_Extractor.h">
|
|
||||||
<Filter>Windows\fex</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="File_Extractor\fex\Zip_Extractor.h">
|
|
||||||
<Filter>Windows\fex</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="File_Extractor\fex\Zip7_Extractor.h">
|
|
||||||
<Filter>Windows\fex</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="File_Extractor\fex\Zlib_Inflater.h">
|
|
||||||
<Filter>Windows\fex</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="File_Extractor\7z_C\7z.h">
|
|
||||||
<Filter>Windows\fex\7z</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="File_Extractor\7z_C\7zAlloc.h">
|
|
||||||
<Filter>Windows\fex\7z</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="File_Extractor\7z_C\7zBuf.h">
|
|
||||||
<Filter>Windows\fex\7z</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="File_Extractor\7z_C\7zCrc.h">
|
|
||||||
<Filter>Windows\fex\7z</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="File_Extractor\7z_C\7zDecode.h">
|
|
||||||
<Filter>Windows\fex\7z</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="File_Extractor\7z_C\7zExtract.h">
|
|
||||||
<Filter>Windows\fex\7z</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="File_Extractor\7z_C\7zFile.h">
|
|
||||||
<Filter>Windows\fex\7z</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="File_Extractor\7z_C\7zHeader.h">
|
|
||||||
<Filter>Windows\fex\7z</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="File_Extractor\7z_C\7zIn.h">
|
|
||||||
<Filter>Windows\fex\7z</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="File_Extractor\7z_C\7zItem.h">
|
|
||||||
<Filter>Windows\fex\7z</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="File_Extractor\7z_C\7zTypes.h">
|
|
||||||
<Filter>Windows\fex\7z</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="File_Extractor\7z_C\7zVersion.h">
|
|
||||||
<Filter>Windows\fex\7z</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="File_Extractor\7z_C\Alloc.h">
|
|
||||||
<Filter>Windows\fex\7z</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="File_Extractor\7z_C\Bcj2.h">
|
|
||||||
<Filter>Windows\fex\7z</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="File_Extractor\7z_C\Bra.h">
|
|
||||||
<Filter>Windows\fex\7z</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="File_Extractor\7z_C\CpuArch.h">
|
|
||||||
<Filter>Windows\fex\7z</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="File_Extractor\7z_C\Delta.h">
|
|
||||||
<Filter>Windows\fex\7z</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="File_Extractor\7z_C\LzFind.h">
|
|
||||||
<Filter>Windows\fex\7z</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="File_Extractor\7z_C\LzFindMt.h">
|
|
||||||
<Filter>Windows\fex\7z</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="File_Extractor\7z_C\LzHash.h">
|
|
||||||
<Filter>Windows\fex\7z</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="File_Extractor\7z_C\Lzma2Dec.h">
|
|
||||||
<Filter>Windows\fex\7z</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="File_Extractor\7z_C\Lzma2Enc.h">
|
|
||||||
<Filter>Windows\fex\7z</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="File_Extractor\7z_C\Lzma86.h">
|
|
||||||
<Filter>Windows\fex\7z</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="File_Extractor\7z_C\LzmaDec.h">
|
|
||||||
<Filter>Windows\fex\7z</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="File_Extractor\7z_C\LzmaEnc.h">
|
|
||||||
<Filter>Windows\fex\7z</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="File_Extractor\7z_C\LzmaLib.h">
|
|
||||||
<Filter>Windows\fex\7z</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="File_Extractor\7z_C\LzmaTypes.h">
|
|
||||||
<Filter>Windows\fex\7z</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="File_Extractor\7z_C\MtCoder.h">
|
|
||||||
<Filter>Windows\fex\7z</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="File_Extractor\7z_C\Ppmd.h">
|
|
||||||
<Filter>Windows\fex\7z</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="File_Extractor\7z_C\Ppmd7.h">
|
|
||||||
<Filter>Windows\fex\7z</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="File_Extractor\7z_C\RotateDefs.h">
|
|
||||||
<Filter>Windows\fex\7z</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="File_Extractor\7z_C\Threads.h">
|
|
||||||
<Filter>Windows\fex\7z</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="File_Extractor\7z_C\Types.h">
|
|
||||||
<Filter>Windows\fex\7z</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="File_Extractor\unrar\archive.hpp">
|
|
||||||
<Filter>Windows\fex\unrar</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="File_Extractor\unrar\array.hpp">
|
|
||||||
<Filter>Windows\fex\unrar</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="File_Extractor\unrar\coder.hpp">
|
|
||||||
<Filter>Windows\fex\unrar</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="File_Extractor\unrar\compress.hpp">
|
|
||||||
<Filter>Windows\fex\unrar</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="File_Extractor\unrar\encname.hpp">
|
|
||||||
<Filter>Windows\fex\unrar</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="File_Extractor\unrar\getbits.hpp">
|
|
||||||
<Filter>Windows\fex\unrar</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="File_Extractor\unrar\headers.hpp">
|
|
||||||
<Filter>Windows\fex\unrar</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="File_Extractor\unrar\model.hpp">
|
|
||||||
<Filter>Windows\fex\unrar</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="File_Extractor\unrar\rar.hpp">
|
|
||||||
<Filter>Windows\fex\unrar</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="File_Extractor\unrar\rarvm.hpp">
|
|
||||||
<Filter>Windows\fex\unrar</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="File_Extractor\unrar\rawread.hpp">
|
|
||||||
<Filter>Windows\fex\unrar</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="File_Extractor\unrar\suballoc.hpp">
|
|
||||||
<Filter>Windows\fex\unrar</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="File_Extractor\unrar\unicode.hpp">
|
|
||||||
<Filter>Windows\fex\unrar</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="File_Extractor\unrar\unpack.hpp">
|
|
||||||
<Filter>Windows\fex\unrar</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="File_Extractor\unrar\unrar.h">
|
|
||||||
<Filter>Windows\fex\unrar</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="File_Extractor\fex\File_Extractor.h">
|
|
||||||
<Filter>Windows\fex</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="FEX_Interface.h">
|
<ClInclude Include="FEX_Interface.h">
|
||||||
<Filter>Windows</Filter>
|
<Filter>Windows</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
|
@ -1553,6 +1400,207 @@
|
||||||
<ClInclude Include="..\filter\xbrz.h">
|
<ClInclude Include="..\filter\xbrz.h">
|
||||||
<Filter>Core\filter</Filter>
|
<Filter>Core\filter</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\7z_C\win32\Threads.h">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\7z_C\7z.h">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\7z_C\7zAlloc.h">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\7z_C\7zBuf.h">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\7z_C\7zCrc.h">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\7z_C\7zDecode.h">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\7z_C\7zExtract.h">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\7z_C\7zFile.h">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\7z_C\7zIn.h">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\7z_C\7zTypes.h">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\7z_C\7zVersion.h">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\7z_C\Alloc.h">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\7z_C\Bcj2.h">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\7z_C\Bra.h">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\7z_C\CpuArch.h">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\7z_C\Delta.h">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\7z_C\LzFind.h">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\7z_C\LzFindMt.h">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\7z_C\LzHash.h">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\7z_C\Lzma2Dec.h">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\7z_C\Lzma2Enc.h">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\7z_C\Lzma86.h">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\7z_C\LzmaDec.h">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\7z_C\LzmaEnc.h">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\7z_C\LzmaLib.h">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\7z_C\LzmaTypes.h">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\7z_C\MtCoder.h">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\7z_C\Ppmd.h">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\7z_C\Ppmd7.h">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\7z_C\RotateDefs.h">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\7z_C\Threads.h">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\7z_C\Types.h">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\fex\blargg_common.h">
|
||||||
|
<Filter>Windows\File_Extractor\fex</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\fex\blargg_config.h">
|
||||||
|
<Filter>Windows\File_Extractor\fex</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\fex\blargg_endian.h">
|
||||||
|
<Filter>Windows\File_Extractor\fex</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\fex\blargg_errors.h">
|
||||||
|
<Filter>Windows\File_Extractor\fex</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\fex\blargg_source.h">
|
||||||
|
<Filter>Windows\File_Extractor\fex</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\fex\Data_Reader.h">
|
||||||
|
<Filter>Windows\File_Extractor\fex</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\fex\fex.h">
|
||||||
|
<Filter>Windows\File_Extractor\fex</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\fex\File_Extractor.h">
|
||||||
|
<Filter>Windows\File_Extractor\fex</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\fex\Gzip_Extractor.h">
|
||||||
|
<Filter>Windows\File_Extractor\fex</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\fex\Gzip_Reader.h">
|
||||||
|
<Filter>Windows\File_Extractor\fex</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\fex\Rar_Extractor.h">
|
||||||
|
<Filter>Windows\File_Extractor\fex</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\fex\Zip_Extractor.h">
|
||||||
|
<Filter>Windows\File_Extractor\fex</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\fex\Zip7_Extractor.h">
|
||||||
|
<Filter>Windows\File_Extractor\fex</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\fex\Zlib_Inflater.h">
|
||||||
|
<Filter>Windows\File_Extractor\fex</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\fex\Binary_Extractor.h">
|
||||||
|
<Filter>Windows\File_Extractor\fex</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\unrar\array.hpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\unrar\blake2s.hpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\unrar\coder.hpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\unrar\compress.hpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\unrar\encname.hpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\unrar\getbits.hpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\unrar\hash.hpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\unrar\headers.hpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\unrar\headers5.hpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\unrar\model.hpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\unrar\rar.hpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\unrar\rarvm.hpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\unrar\rawread.hpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\unrar\strfn.hpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\unrar\suballoc.hpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\unrar\timefn.hpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\unrar\unicode.hpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\unrar\unpack.hpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\unrar\unrar.h">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\unrar\archive.hpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClInclude>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Include="..\instruction_tabdef.inc">
|
<None Include="..\instruction_tabdef.inc">
|
||||||
|
@ -1570,36 +1618,39 @@
|
||||||
<None Include="..\filter\hq4x.dat">
|
<None Include="..\filter\hq4x.dat">
|
||||||
<Filter>Core\filter</Filter>
|
<Filter>Core\filter</Filter>
|
||||||
</None>
|
</None>
|
||||||
<None Include="File_Extractor\7z_C\7zC.txt">
|
|
||||||
<Filter>Windows\fex\7z</Filter>
|
|
||||||
</None>
|
|
||||||
<None Include="File_Extractor\7z_C\changes.txt">
|
|
||||||
<Filter>Windows\fex\7z</Filter>
|
|
||||||
</None>
|
|
||||||
<None Include="File_Extractor\7z_C\lzma.txt">
|
|
||||||
<Filter>Windows\fex\7z</Filter>
|
|
||||||
</None>
|
|
||||||
<None Include="File_Extractor\7z_C\readme.txt">
|
|
||||||
<Filter>Windows\fex\7z</Filter>
|
|
||||||
</None>
|
|
||||||
<None Include="File_Extractor\unrar\changes.txt">
|
|
||||||
<Filter>Windows\fex\unrar</Filter>
|
|
||||||
</None>
|
|
||||||
<None Include="File_Extractor\unrar\license.txt">
|
|
||||||
<Filter>Windows\fex\unrar</Filter>
|
|
||||||
</None>
|
|
||||||
<None Include="File_Extractor\unrar\readme.txt">
|
|
||||||
<Filter>Windows\fex\unrar</Filter>
|
|
||||||
</None>
|
|
||||||
<None Include="File_Extractor\unrar\technote.txt">
|
|
||||||
<Filter>Windows\fex\unrar</Filter>
|
|
||||||
</None>
|
|
||||||
<None Include="File_Extractor\unrar\whatsnew.txt">
|
|
||||||
<Filter>Windows\fex\unrar</Filter>
|
|
||||||
</None>
|
|
||||||
<None Include="..\utils\AsmJit\COPYING.txt">
|
<None Include="..\utils\AsmJit\COPYING.txt">
|
||||||
<Filter>Core\utils\AsmJit</Filter>
|
<Filter>Core\utils\AsmJit</Filter>
|
||||||
</None>
|
</None>
|
||||||
|
<None Include="File_Extractor\7z_C\7zC.txt">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</None>
|
||||||
|
<None Include="File_Extractor\7z_C\changes.txt">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</None>
|
||||||
|
<None Include="File_Extractor\7z_C\lzma.txt">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</None>
|
||||||
|
<None Include="File_Extractor\7z_C\readme.txt">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</None>
|
||||||
|
<None Include="File_Extractor\unrar\changes.txt">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</None>
|
||||||
|
<None Include="File_Extractor\unrar\license.txt">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</None>
|
||||||
|
<None Include="File_Extractor\unrar\readme.txt">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</None>
|
||||||
|
<None Include="File_Extractor\unrar\technote.txt">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</None>
|
||||||
|
<None Include="File_Extractor\unrar\whatsnew.txt">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</None>
|
||||||
|
<None Include="File_Extractor\unrar\acknow.txt">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</None>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ResourceCompile Include="resources.rc">
|
<ResourceCompile Include="resources.rc">
|
||||||
|
|
|
@ -553,40 +553,10 @@
|
||||||
<ClCompile Include="File_Extractor\7z_C\7zCrc.c" />
|
<ClCompile Include="File_Extractor\7z_C\7zCrc.c" />
|
||||||
<ClCompile Include="File_Extractor\7z_C\7zCrcOpt.c" />
|
<ClCompile Include="File_Extractor\7z_C\7zCrcOpt.c" />
|
||||||
<ClCompile Include="File_Extractor\7z_C\7zDec.c" />
|
<ClCompile Include="File_Extractor\7z_C\7zDec.c" />
|
||||||
<ClCompile Include="File_Extractor\7z_C\7zDecode.c">
|
<ClCompile Include="File_Extractor\7z_C\7zDecode.c" />
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
<ClCompile Include="File_Extractor\7z_C\7zExtract.c" />
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Dev+|Win32'">true</ExcludedFromBuild>
|
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Dev+|x64'">true</ExcludedFromBuild>
|
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\7z_C\7zExtract.c">
|
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Dev+|Win32'">true</ExcludedFromBuild>
|
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Dev+|x64'">true</ExcludedFromBuild>
|
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\7z_C\7zFile.c" />
|
<ClCompile Include="File_Extractor\7z_C\7zFile.c" />
|
||||||
<ClCompile Include="File_Extractor\7z_C\7zHeader.c">
|
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Dev+|Win32'">true</ExcludedFromBuild>
|
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Dev+|x64'">true</ExcludedFromBuild>
|
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\7z_C\7zIn.c" />
|
<ClCompile Include="File_Extractor\7z_C\7zIn.c" />
|
||||||
<ClCompile Include="File_Extractor\7z_C\7zItem.c">
|
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Dev+|Win32'">true</ExcludedFromBuild>
|
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Dev+|x64'">true</ExcludedFromBuild>
|
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\7z_C\7zStream.c" />
|
<ClCompile Include="File_Extractor\7z_C\7zStream.c" />
|
||||||
<ClCompile Include="File_Extractor\7z_C\Alloc.c" />
|
<ClCompile Include="File_Extractor\7z_C\Alloc.c" />
|
||||||
<ClCompile Include="File_Extractor\7z_C\Bcj2.c" />
|
<ClCompile Include="File_Extractor\7z_C\Bcj2.c" />
|
||||||
|
@ -608,7 +578,7 @@
|
||||||
<ClCompile Include="File_Extractor\7z_C\Ppmd7.c" />
|
<ClCompile Include="File_Extractor\7z_C\Ppmd7.c" />
|
||||||
<ClCompile Include="File_Extractor\7z_C\Ppmd7Dec.c" />
|
<ClCompile Include="File_Extractor\7z_C\Ppmd7Dec.c" />
|
||||||
<ClCompile Include="File_Extractor\7z_C\Ppmd7Enc.c" />
|
<ClCompile Include="File_Extractor\7z_C\Ppmd7Enc.c" />
|
||||||
<ClCompile Include="File_Extractor\7z_C\Threads.c" />
|
<ClCompile Include="File_Extractor\7z_C\win32\Threads.c" />
|
||||||
<ClCompile Include="File_Extractor\fex\Binary_Extractor.cpp" />
|
<ClCompile Include="File_Extractor\fex\Binary_Extractor.cpp" />
|
||||||
<ClCompile Include="File_Extractor\fex\blargg_common.cpp" />
|
<ClCompile Include="File_Extractor\fex\blargg_common.cpp" />
|
||||||
<ClCompile Include="File_Extractor\fex\blargg_errors.cpp" />
|
<ClCompile Include="File_Extractor\fex\blargg_errors.cpp" />
|
||||||
|
@ -623,20 +593,33 @@
|
||||||
<ClCompile Include="File_Extractor\fex\Zlib_Inflater.cpp" />
|
<ClCompile Include="File_Extractor\fex\Zlib_Inflater.cpp" />
|
||||||
<ClCompile Include="File_Extractor\unrar\archive.cpp" />
|
<ClCompile Include="File_Extractor\unrar\archive.cpp" />
|
||||||
<ClCompile Include="File_Extractor\unrar\arcread.cpp" />
|
<ClCompile Include="File_Extractor\unrar\arcread.cpp" />
|
||||||
|
<ClCompile Include="File_Extractor\unrar\blake2s.cpp" />
|
||||||
|
<ClCompile Include="File_Extractor\unrar\blake2sp.cpp" />
|
||||||
|
<ClCompile Include="File_Extractor\unrar\blake2s_sse.cpp" />
|
||||||
<ClCompile Include="File_Extractor\unrar\coder.cpp" />
|
<ClCompile Include="File_Extractor\unrar\coder.cpp" />
|
||||||
<ClCompile Include="File_Extractor\unrar\crc.cpp" />
|
<ClCompile Include="File_Extractor\unrar\crc.cpp" />
|
||||||
<ClCompile Include="File_Extractor\unrar\encname.cpp" />
|
<ClCompile Include="File_Extractor\unrar\encname.cpp" />
|
||||||
<ClCompile Include="File_Extractor\unrar\extract.cpp" />
|
<ClCompile Include="File_Extractor\unrar\extract.cpp" />
|
||||||
<ClCompile Include="File_Extractor\unrar\getbits.cpp" />
|
<ClCompile Include="File_Extractor\unrar\getbits.cpp" />
|
||||||
|
<ClCompile Include="File_Extractor\unrar\hash.cpp" />
|
||||||
|
<ClCompile Include="File_Extractor\unrar\headers.cpp" />
|
||||||
<ClCompile Include="File_Extractor\unrar\model.cpp" />
|
<ClCompile Include="File_Extractor\unrar\model.cpp" />
|
||||||
|
<ClCompile Include="File_Extractor\unrar\pathfn.cpp" />
|
||||||
<ClCompile Include="File_Extractor\unrar\rarvm.cpp" />
|
<ClCompile Include="File_Extractor\unrar\rarvm.cpp" />
|
||||||
<ClCompile Include="File_Extractor\unrar\rarvmtbl.cpp" />
|
<ClCompile Include="File_Extractor\unrar\rarvmtbl.cpp" />
|
||||||
<ClCompile Include="File_Extractor\unrar\rawread.cpp" />
|
<ClCompile Include="File_Extractor\unrar\rawread.cpp" />
|
||||||
|
<ClCompile Include="File_Extractor\unrar\secpassword.cpp" />
|
||||||
|
<ClCompile Include="File_Extractor\unrar\strfn.cpp" />
|
||||||
<ClCompile Include="File_Extractor\unrar\suballoc.cpp" />
|
<ClCompile Include="File_Extractor\unrar\suballoc.cpp" />
|
||||||
|
<ClCompile Include="File_Extractor\unrar\timefn.cpp" />
|
||||||
<ClCompile Include="File_Extractor\unrar\unicode.cpp" />
|
<ClCompile Include="File_Extractor\unrar\unicode.cpp" />
|
||||||
<ClCompile Include="File_Extractor\unrar\unpack.cpp" />
|
<ClCompile Include="File_Extractor\unrar\unpack.cpp" />
|
||||||
<ClCompile Include="File_Extractor\unrar\unpack15.cpp" />
|
<ClCompile Include="File_Extractor\unrar\unpack15.cpp" />
|
||||||
<ClCompile Include="File_Extractor\unrar\unpack20.cpp" />
|
<ClCompile Include="File_Extractor\unrar\unpack20.cpp" />
|
||||||
|
<ClCompile Include="File_Extractor\unrar\unpack30.cpp" />
|
||||||
|
<ClCompile Include="File_Extractor\unrar\unpack50.cpp" />
|
||||||
|
<ClCompile Include="File_Extractor\unrar\unpack50frag.cpp" />
|
||||||
|
<ClCompile Include="File_Extractor\unrar\unpackinline.cpp" />
|
||||||
<ClCompile Include="File_Extractor\unrar\unrar.cpp" />
|
<ClCompile Include="File_Extractor\unrar\unrar.cpp" />
|
||||||
<ClCompile Include="File_Extractor\unrar\unrar_misc.cpp" />
|
<ClCompile Include="File_Extractor\unrar\unrar_misc.cpp" />
|
||||||
<ClCompile Include="File_Extractor\unrar\unrar_open.cpp" />
|
<ClCompile Include="File_Extractor\unrar\unrar_open.cpp" />
|
||||||
|
@ -688,7 +671,6 @@
|
||||||
<ClInclude Include="..\debug.h" />
|
<ClInclude Include="..\debug.h" />
|
||||||
<ClInclude Include="..\Disassembler.h" />
|
<ClInclude Include="..\Disassembler.h" />
|
||||||
<ClInclude Include="..\driver.h" />
|
<ClInclude Include="..\driver.h" />
|
||||||
<ClInclude Include="..\emufat_types.h" />
|
|
||||||
<ClInclude Include="..\emufile.h" />
|
<ClInclude Include="..\emufile.h" />
|
||||||
<ClInclude Include="..\encrypt.h" />
|
<ClInclude Include="..\encrypt.h" />
|
||||||
<ClInclude Include="..\fat.h" />
|
<ClInclude Include="..\fat.h" />
|
||||||
|
@ -773,7 +755,6 @@
|
||||||
<ClInclude Include="..\utils\AsmJit\x86\x86util.h" />
|
<ClInclude Include="..\utils\AsmJit\x86\x86util.h" />
|
||||||
<ClInclude Include="..\utils\datetime.h" />
|
<ClInclude Include="..\utils\datetime.h" />
|
||||||
<ClInclude Include="..\utils\emufat.h" />
|
<ClInclude Include="..\utils\emufat.h" />
|
||||||
<ClInclude Include="..\utils\emufat_types.h" />
|
|
||||||
<ClInclude Include="..\utils\fsnitro.h" />
|
<ClInclude Include="..\utils\fsnitro.h" />
|
||||||
<ClInclude Include="..\utils\libfat\bit_ops.h" />
|
<ClInclude Include="..\utils\libfat\bit_ops.h" />
|
||||||
<ClInclude Include="..\utils\libfat\cache.h" />
|
<ClInclude Include="..\utils\libfat\cache.h" />
|
||||||
|
@ -834,9 +815,7 @@
|
||||||
<ClInclude Include="File_Extractor\7z_C\7zDecode.h" />
|
<ClInclude Include="File_Extractor\7z_C\7zDecode.h" />
|
||||||
<ClInclude Include="File_Extractor\7z_C\7zExtract.h" />
|
<ClInclude Include="File_Extractor\7z_C\7zExtract.h" />
|
||||||
<ClInclude Include="File_Extractor\7z_C\7zFile.h" />
|
<ClInclude Include="File_Extractor\7z_C\7zFile.h" />
|
||||||
<ClInclude Include="File_Extractor\7z_C\7zHeader.h" />
|
|
||||||
<ClInclude Include="File_Extractor\7z_C\7zIn.h" />
|
<ClInclude Include="File_Extractor\7z_C\7zIn.h" />
|
||||||
<ClInclude Include="File_Extractor\7z_C\7zItem.h" />
|
|
||||||
<ClInclude Include="File_Extractor\7z_C\7zTypes.h" />
|
<ClInclude Include="File_Extractor\7z_C\7zTypes.h" />
|
||||||
<ClInclude Include="File_Extractor\7z_C\7zVersion.h" />
|
<ClInclude Include="File_Extractor\7z_C\7zVersion.h" />
|
||||||
<ClInclude Include="File_Extractor\7z_C\Alloc.h" />
|
<ClInclude Include="File_Extractor\7z_C\Alloc.h" />
|
||||||
|
@ -860,6 +839,7 @@
|
||||||
<ClInclude Include="File_Extractor\7z_C\RotateDefs.h" />
|
<ClInclude Include="File_Extractor\7z_C\RotateDefs.h" />
|
||||||
<ClInclude Include="File_Extractor\7z_C\Threads.h" />
|
<ClInclude Include="File_Extractor\7z_C\Threads.h" />
|
||||||
<ClInclude Include="File_Extractor\7z_C\Types.h" />
|
<ClInclude Include="File_Extractor\7z_C\Types.h" />
|
||||||
|
<ClInclude Include="File_Extractor\7z_C\win32\Threads.h" />
|
||||||
<ClInclude Include="File_Extractor\fex\Binary_Extractor.h" />
|
<ClInclude Include="File_Extractor\fex\Binary_Extractor.h" />
|
||||||
<ClInclude Include="File_Extractor\fex\blargg_common.h" />
|
<ClInclude Include="File_Extractor\fex\blargg_common.h" />
|
||||||
<ClInclude Include="File_Extractor\fex\blargg_config.h" />
|
<ClInclude Include="File_Extractor\fex\blargg_config.h" />
|
||||||
|
@ -877,22 +857,24 @@
|
||||||
<ClInclude Include="File_Extractor\fex\Zlib_Inflater.h" />
|
<ClInclude Include="File_Extractor\fex\Zlib_Inflater.h" />
|
||||||
<ClInclude Include="File_Extractor\unrar\archive.hpp" />
|
<ClInclude Include="File_Extractor\unrar\archive.hpp" />
|
||||||
<ClInclude Include="File_Extractor\unrar\array.hpp" />
|
<ClInclude Include="File_Extractor\unrar\array.hpp" />
|
||||||
|
<ClInclude Include="File_Extractor\unrar\blake2s.hpp" />
|
||||||
<ClInclude Include="File_Extractor\unrar\coder.hpp" />
|
<ClInclude Include="File_Extractor\unrar\coder.hpp" />
|
||||||
<ClInclude Include="File_Extractor\unrar\compress.hpp" />
|
<ClInclude Include="File_Extractor\unrar\compress.hpp" />
|
||||||
<ClInclude Include="File_Extractor\unrar\encname.hpp" />
|
<ClInclude Include="File_Extractor\unrar\encname.hpp" />
|
||||||
<ClInclude Include="File_Extractor\unrar\getbits.hpp" />
|
<ClInclude Include="File_Extractor\unrar\getbits.hpp" />
|
||||||
|
<ClInclude Include="File_Extractor\unrar\hash.hpp" />
|
||||||
<ClInclude Include="File_Extractor\unrar\headers.hpp" />
|
<ClInclude Include="File_Extractor\unrar\headers.hpp" />
|
||||||
|
<ClInclude Include="File_Extractor\unrar\headers5.hpp" />
|
||||||
<ClInclude Include="File_Extractor\unrar\model.hpp" />
|
<ClInclude Include="File_Extractor\unrar\model.hpp" />
|
||||||
<ClInclude Include="File_Extractor\unrar\rar.hpp" />
|
<ClInclude Include="File_Extractor\unrar\rar.hpp" />
|
||||||
<ClInclude Include="File_Extractor\unrar\rarvm.hpp" />
|
<ClInclude Include="File_Extractor\unrar\rarvm.hpp" />
|
||||||
<ClInclude Include="File_Extractor\unrar\rawread.hpp" />
|
<ClInclude Include="File_Extractor\unrar\rawread.hpp" />
|
||||||
|
<ClInclude Include="File_Extractor\unrar\strfn.hpp" />
|
||||||
<ClInclude Include="File_Extractor\unrar\suballoc.hpp" />
|
<ClInclude Include="File_Extractor\unrar\suballoc.hpp" />
|
||||||
|
<ClInclude Include="File_Extractor\unrar\timefn.hpp" />
|
||||||
<ClInclude Include="File_Extractor\unrar\unicode.hpp" />
|
<ClInclude Include="File_Extractor\unrar\unicode.hpp" />
|
||||||
<ClInclude Include="File_Extractor\unrar\unpack.hpp" />
|
<ClInclude Include="File_Extractor\unrar\unpack.hpp" />
|
||||||
<ClInclude Include="File_Extractor\unrar\unrar.h" />
|
<ClInclude Include="File_Extractor\unrar\unrar.h" />
|
||||||
<ClInclude Include="filter\hq2x.h" />
|
|
||||||
<ClInclude Include="filter\interp.h" />
|
|
||||||
<ClInclude Include="filter\lq2x.h" />
|
|
||||||
<ClInclude Include="FirmConfig.h" />
|
<ClInclude Include="FirmConfig.h" />
|
||||||
<ClInclude Include="fsnitroView.h" />
|
<ClInclude Include="fsnitroView.h" />
|
||||||
<ClInclude Include="gbaslot_config.h" />
|
<ClInclude Include="gbaslot_config.h" />
|
||||||
|
@ -930,9 +912,6 @@
|
||||||
<None Include="..\filter\hq4x.dat" />
|
<None Include="..\filter\hq4x.dat" />
|
||||||
<None Include="..\instruction_tabdef.inc" />
|
<None Include="..\instruction_tabdef.inc" />
|
||||||
<None Include="..\thumb_tabdef.inc" />
|
<None Include="..\thumb_tabdef.inc" />
|
||||||
<None Include="..\utils\AsmJit\COPYING.txt" />
|
|
||||||
<None Include="bitmap1.bmp" />
|
|
||||||
<None Include="DeSmuME.ico" />
|
|
||||||
<CustomBuild Include="directx\directx.7z">
|
<CustomBuild Include="directx\directx.7z">
|
||||||
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">call un7z_and_touch.bat directx\directx.7z .libs\directx*
|
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">call un7z_and_touch.bat directx\directx.7z .libs\directx*
|
||||||
</Command>
|
</Command>
|
||||||
|
@ -997,19 +976,22 @@
|
||||||
<Outputs Condition="'$(Configuration)|$(Platform)'=='Dev+|x64'">.libs\lua.tag;</Outputs>
|
<Outputs Condition="'$(Configuration)|$(Platform)'=='Dev+|x64'">.libs\lua.tag;</Outputs>
|
||||||
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Dev+|x64'">7z.exe;un7z_and_touch.bat</AdditionalInputs>
|
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Dev+|x64'">7z.exe;un7z_and_touch.bat</AdditionalInputs>
|
||||||
</CustomBuild>
|
</CustomBuild>
|
||||||
<None Include="File_Extractor\7z_C\7zC.txt" />
|
|
||||||
<None Include="File_Extractor\7z_C\changes.txt" />
|
|
||||||
<None Include="File_Extractor\7z_C\lzma.txt" />
|
|
||||||
<None Include="File_Extractor\7z_C\readme.txt" />
|
|
||||||
<None Include="File_Extractor\unrar\changes.txt" />
|
|
||||||
<None Include="File_Extractor\unrar\license.txt" />
|
|
||||||
<None Include="File_Extractor\unrar\readme.txt" />
|
|
||||||
<None Include="File_Extractor\unrar\technote.txt" />
|
|
||||||
<None Include="File_Extractor\unrar\whatsnew.txt" />
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ResourceCompile Include="resources.rc" />
|
<ResourceCompile Include="resources.rc" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Text Include="File_Extractor\7z_C\7zC.txt" />
|
||||||
|
<Text Include="File_Extractor\7z_C\changes.txt" />
|
||||||
|
<Text Include="File_Extractor\7z_C\lzma.txt" />
|
||||||
|
<Text Include="File_Extractor\7z_C\readme.txt" />
|
||||||
|
<Text Include="File_Extractor\unrar\acknow.txt" />
|
||||||
|
<Text Include="File_Extractor\unrar\changes.txt" />
|
||||||
|
<Text Include="File_Extractor\unrar\license.txt" />
|
||||||
|
<Text Include="File_Extractor\unrar\readme.txt" />
|
||||||
|
<Text Include="File_Extractor\unrar\technote.txt" />
|
||||||
|
<Text Include="File_Extractor\unrar\whatsnew.txt" />
|
||||||
|
</ItemGroup>
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||||
<ImportGroup Label="ExtensionTargets">
|
<ImportGroup Label="ExtensionTargets">
|
||||||
<Import Project="$(VCTargetsPath)\BuildCustomizations\masm.targets" />
|
<Import Project="$(VCTargetsPath)\BuildCustomizations\masm.targets" />
|
||||||
|
|
|
@ -49,12 +49,6 @@
|
||||||
<Filter Include="Windows\File_Extractor">
|
<Filter Include="Windows\File_Extractor">
|
||||||
<UniqueIdentifier>{ec682647-9bb7-4315-99a4-4f9398db61ad}</UniqueIdentifier>
|
<UniqueIdentifier>{ec682647-9bb7-4315-99a4-4f9398db61ad}</UniqueIdentifier>
|
||||||
</Filter>
|
</Filter>
|
||||||
<Filter Include="Windows\File_Extractor\7-Zip">
|
|
||||||
<UniqueIdentifier>{321e6567-acbd-4dc4-a5c6-6cd8fe445d53}</UniqueIdentifier>
|
|
||||||
</Filter>
|
|
||||||
<Filter Include="Windows\File_Extractor\unrar">
|
|
||||||
<UniqueIdentifier>{4c97f223-843f-4975-b774-4d0c887cfd37}</UniqueIdentifier>
|
|
||||||
</Filter>
|
|
||||||
<Filter Include="Windows\userconfig">
|
<Filter Include="Windows\userconfig">
|
||||||
<UniqueIdentifier>{4d7483df-e22e-4e77-9ae8-8446c04d335d}</UniqueIdentifier>
|
<UniqueIdentifier>{4d7483df-e22e-4e77-9ae8-8446c04d335d}</UniqueIdentifier>
|
||||||
</Filter>
|
</Filter>
|
||||||
|
@ -67,6 +61,18 @@
|
||||||
<Filter Include="Windows\libs">
|
<Filter Include="Windows\libs">
|
||||||
<UniqueIdentifier>{191da306-49b9-43b4-a4d9-d91dd3a18db8}</UniqueIdentifier>
|
<UniqueIdentifier>{191da306-49b9-43b4-a4d9-d91dd3a18db8}</UniqueIdentifier>
|
||||||
</Filter>
|
</Filter>
|
||||||
|
<Filter Include="Windows\File_Extractor\7z_C">
|
||||||
|
<UniqueIdentifier>{dca5253d-1a55-4e81-8605-bf389a113e5e}</UniqueIdentifier>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="Windows\File_Extractor\7z_C\win32">
|
||||||
|
<UniqueIdentifier>{10a34cfb-f98c-4878-a918-de5ff0b23abf}</UniqueIdentifier>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="Windows\File_Extractor\fex">
|
||||||
|
<UniqueIdentifier>{217b886d-4d87-4690-b66d-88d57b966c3f}</UniqueIdentifier>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="Windows\File_Extractor\unrar">
|
||||||
|
<UniqueIdentifier>{f6fdb39c-754f-4b71-986e-5ecbbee3e476}</UniqueIdentifier>
|
||||||
|
</Filter>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClCompile Include="..\aggdraw.cpp">
|
<ClCompile Include="..\aggdraw.cpp">
|
||||||
|
@ -531,189 +537,6 @@
|
||||||
<ClCompile Include="winutil.cpp">
|
<ClCompile Include="winutil.cpp">
|
||||||
<Filter>Windows</Filter>
|
<Filter>Windows</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="File_Extractor\fex\Binary_Extractor.cpp">
|
|
||||||
<Filter>Windows\File_Extractor</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\fex\blargg_common.cpp">
|
|
||||||
<Filter>Windows\File_Extractor</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\fex\blargg_errors.cpp">
|
|
||||||
<Filter>Windows\File_Extractor</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\fex\Data_Reader.cpp">
|
|
||||||
<Filter>Windows\File_Extractor</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\fex\fex.cpp">
|
|
||||||
<Filter>Windows\File_Extractor</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\fex\File_Extractor.cpp">
|
|
||||||
<Filter>Windows\File_Extractor</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\fex\Gzip_Extractor.cpp">
|
|
||||||
<Filter>Windows\File_Extractor</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\fex\Gzip_Reader.cpp">
|
|
||||||
<Filter>Windows\File_Extractor</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\fex\Rar_Extractor.cpp">
|
|
||||||
<Filter>Windows\File_Extractor</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\fex\Zip7_Extractor.cpp">
|
|
||||||
<Filter>Windows\File_Extractor</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\fex\Zip_Extractor.cpp">
|
|
||||||
<Filter>Windows\File_Extractor</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\fex\Zlib_Inflater.cpp">
|
|
||||||
<Filter>Windows\File_Extractor</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\7z_C\7zAlloc.c">
|
|
||||||
<Filter>Windows\File_Extractor\7-Zip</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\7z_C\7zBuf.c">
|
|
||||||
<Filter>Windows\File_Extractor\7-Zip</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\7z_C\7zBuf2.c">
|
|
||||||
<Filter>Windows\File_Extractor\7-Zip</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\7z_C\7zCrc.c">
|
|
||||||
<Filter>Windows\File_Extractor\7-Zip</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\7z_C\7zCrcOpt.c">
|
|
||||||
<Filter>Windows\File_Extractor\7-Zip</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\7z_C\7zDec.c">
|
|
||||||
<Filter>Windows\File_Extractor\7-Zip</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\7z_C\7zFile.c">
|
|
||||||
<Filter>Windows\File_Extractor\7-Zip</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\7z_C\7zIn.c">
|
|
||||||
<Filter>Windows\File_Extractor\7-Zip</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\7z_C\7zStream.c">
|
|
||||||
<Filter>Windows\File_Extractor\7-Zip</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\7z_C\Alloc.c">
|
|
||||||
<Filter>Windows\File_Extractor\7-Zip</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\7z_C\Bcj2.c">
|
|
||||||
<Filter>Windows\File_Extractor\7-Zip</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\7z_C\Bra.c">
|
|
||||||
<Filter>Windows\File_Extractor\7-Zip</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\7z_C\Bra86.c">
|
|
||||||
<Filter>Windows\File_Extractor\7-Zip</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\7z_C\BraIA64.c">
|
|
||||||
<Filter>Windows\File_Extractor\7-Zip</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\7z_C\CpuArch.c">
|
|
||||||
<Filter>Windows\File_Extractor\7-Zip</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\7z_C\Delta.c">
|
|
||||||
<Filter>Windows\File_Extractor\7-Zip</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\7z_C\LzFind.c">
|
|
||||||
<Filter>Windows\File_Extractor\7-Zip</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\7z_C\LzFindMt.c">
|
|
||||||
<Filter>Windows\File_Extractor\7-Zip</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\7z_C\Lzma2Dec.c">
|
|
||||||
<Filter>Windows\File_Extractor\7-Zip</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\7z_C\Lzma2Enc.c">
|
|
||||||
<Filter>Windows\File_Extractor\7-Zip</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\7z_C\Lzma86Dec.c">
|
|
||||||
<Filter>Windows\File_Extractor\7-Zip</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\7z_C\Lzma86Enc.c">
|
|
||||||
<Filter>Windows\File_Extractor\7-Zip</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\7z_C\LzmaDec.c">
|
|
||||||
<Filter>Windows\File_Extractor\7-Zip</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\7z_C\LzmaEnc.c">
|
|
||||||
<Filter>Windows\File_Extractor\7-Zip</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\7z_C\LzmaLib.c">
|
|
||||||
<Filter>Windows\File_Extractor\7-Zip</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\7z_C\MtCoder.c">
|
|
||||||
<Filter>Windows\File_Extractor\7-Zip</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\7z_C\Ppmd7.c">
|
|
||||||
<Filter>Windows\File_Extractor\7-Zip</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\7z_C\Ppmd7Dec.c">
|
|
||||||
<Filter>Windows\File_Extractor\7-Zip</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\7z_C\Ppmd7Enc.c">
|
|
||||||
<Filter>Windows\File_Extractor\7-Zip</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\7z_C\Threads.c">
|
|
||||||
<Filter>Windows\File_Extractor\7-Zip</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\unrar\archive.cpp">
|
|
||||||
<Filter>Windows\File_Extractor\unrar</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\unrar\arcread.cpp">
|
|
||||||
<Filter>Windows\File_Extractor\unrar</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\unrar\coder.cpp">
|
|
||||||
<Filter>Windows\File_Extractor\unrar</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\unrar\crc.cpp">
|
|
||||||
<Filter>Windows\File_Extractor\unrar</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\unrar\encname.cpp">
|
|
||||||
<Filter>Windows\File_Extractor\unrar</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\unrar\extract.cpp">
|
|
||||||
<Filter>Windows\File_Extractor\unrar</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\unrar\getbits.cpp">
|
|
||||||
<Filter>Windows\File_Extractor\unrar</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\unrar\model.cpp">
|
|
||||||
<Filter>Windows\File_Extractor\unrar</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\unrar\rarvm.cpp">
|
|
||||||
<Filter>Windows\File_Extractor\unrar</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\unrar\rarvmtbl.cpp">
|
|
||||||
<Filter>Windows\File_Extractor\unrar</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\unrar\rawread.cpp">
|
|
||||||
<Filter>Windows\File_Extractor\unrar</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\unrar\suballoc.cpp">
|
|
||||||
<Filter>Windows\File_Extractor\unrar</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\unrar\unicode.cpp">
|
|
||||||
<Filter>Windows\File_Extractor\unrar</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\unrar\unpack.cpp">
|
|
||||||
<Filter>Windows\File_Extractor\unrar</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\unrar\unpack15.cpp">
|
|
||||||
<Filter>Windows\File_Extractor\unrar</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\unrar\unpack20.cpp">
|
|
||||||
<Filter>Windows\File_Extractor\unrar</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\unrar\unrar.cpp">
|
|
||||||
<Filter>Windows\File_Extractor\unrar</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\unrar\unrar_misc.cpp">
|
|
||||||
<Filter>Windows\File_Extractor\unrar</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\unrar\unrar_open.cpp">
|
|
||||||
<Filter>Windows\File_Extractor\unrar</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="disView.cpp">
|
<ClCompile Include="disView.cpp">
|
||||||
<Filter>Windows\tools</Filter>
|
<Filter>Windows\tools</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
@ -759,10 +582,6 @@
|
||||||
<ClCompile Include="sndxa2.cpp">
|
<ClCompile Include="sndxa2.cpp">
|
||||||
<Filter>Windows</Filter>
|
<Filter>Windows</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="File_Extractor\7z_C\7zDecode.c" />
|
|
||||||
<ClCompile Include="File_Extractor\7z_C\7zExtract.c" />
|
|
||||||
<ClCompile Include="File_Extractor\7z_C\7zHeader.c" />
|
|
||||||
<ClCompile Include="File_Extractor\7z_C\7zItem.c" />
|
|
||||||
<ClCompile Include="..\encrypt.cpp">
|
<ClCompile Include="..\encrypt.cpp">
|
||||||
<Filter>Core</Filter>
|
<Filter>Core</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
@ -802,6 +621,234 @@
|
||||||
<ClCompile Include="..\filter\xbrz.cpp">
|
<ClCompile Include="..\filter\xbrz.cpp">
|
||||||
<Filter>Core\filter</Filter>
|
<Filter>Core\filter</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\7z_C\win32\Threads.c">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C\win32</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\7z_C\7zAlloc.c">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\7z_C\7zBuf.c">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\7z_C\7zBuf2.c">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\7z_C\7zCrc.c">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\7z_C\7zCrcOpt.c">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\7z_C\7zDec.c">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\7z_C\7zDecode.c">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\7z_C\7zExtract.c">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\7z_C\7zFile.c">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\7z_C\7zIn.c">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\7z_C\7zStream.c">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\7z_C\Alloc.c">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\7z_C\Bcj2.c">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\7z_C\Bra.c">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\7z_C\Bra86.c">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\7z_C\BraIA64.c">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\7z_C\CpuArch.c">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\7z_C\Delta.c">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\7z_C\LzFind.c">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\7z_C\LzFindMt.c">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\7z_C\Lzma2Dec.c">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\7z_C\Lzma2Enc.c">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\7z_C\Lzma86Dec.c">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\7z_C\Lzma86Enc.c">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\7z_C\LzmaDec.c">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\7z_C\LzmaEnc.c">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\7z_C\LzmaLib.c">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\7z_C\MtCoder.c">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\7z_C\Ppmd7.c">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\7z_C\Ppmd7Dec.c">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\7z_C\Ppmd7Enc.c">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\fex\Binary_Extractor.cpp">
|
||||||
|
<Filter>Windows\File_Extractor\fex</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\fex\blargg_common.cpp">
|
||||||
|
<Filter>Windows\File_Extractor\fex</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\fex\blargg_errors.cpp">
|
||||||
|
<Filter>Windows\File_Extractor\fex</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\fex\Data_Reader.cpp">
|
||||||
|
<Filter>Windows\File_Extractor\fex</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\fex\fex.cpp">
|
||||||
|
<Filter>Windows\File_Extractor\fex</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\fex\File_Extractor.cpp">
|
||||||
|
<Filter>Windows\File_Extractor\fex</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\fex\Gzip_Extractor.cpp">
|
||||||
|
<Filter>Windows\File_Extractor\fex</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\fex\Gzip_Reader.cpp">
|
||||||
|
<Filter>Windows\File_Extractor\fex</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\fex\Rar_Extractor.cpp">
|
||||||
|
<Filter>Windows\File_Extractor\fex</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\fex\Zip_Extractor.cpp">
|
||||||
|
<Filter>Windows\File_Extractor\fex</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\fex\Zip7_Extractor.cpp">
|
||||||
|
<Filter>Windows\File_Extractor\fex</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\fex\Zlib_Inflater.cpp">
|
||||||
|
<Filter>Windows\File_Extractor\fex</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\unrar\archive.cpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\unrar\arcread.cpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\unrar\blake2s.cpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\unrar\blake2s_sse.cpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\unrar\blake2sp.cpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\unrar\coder.cpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\unrar\crc.cpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\unrar\encname.cpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\unrar\extract.cpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\unrar\getbits.cpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\unrar\hash.cpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\unrar\headers.cpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\unrar\model.cpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\unrar\pathfn.cpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\unrar\rarvm.cpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\unrar\rarvmtbl.cpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\unrar\rawread.cpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\unrar\secpassword.cpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\unrar\strfn.cpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\unrar\suballoc.cpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\unrar\timefn.cpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\unrar\unicode.cpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\unrar\unpack.cpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\unrar\unpack15.cpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\unrar\unpack20.cpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\unrar\unpack30.cpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\unrar\unpack50.cpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\unrar\unpack50frag.cpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\unrar\unpackinline.cpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\unrar\unrar.cpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\unrar\unrar_misc.cpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\unrar\unrar_open.cpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClCompile>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClInclude Include="..\arm_jit.h">
|
<ClInclude Include="..\arm_jit.h">
|
||||||
|
@ -1326,75 +1373,6 @@
|
||||||
<ClInclude Include="sndxa2.h">
|
<ClInclude Include="sndxa2.h">
|
||||||
<Filter>Windows</Filter>
|
<Filter>Windows</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClInclude Include="..\emufat_types.h" />
|
|
||||||
<ClInclude Include="..\utils\emufat_types.h" />
|
|
||||||
<ClInclude Include="FEX_Interface.h" />
|
|
||||||
<ClInclude Include="File_Extractor\7z_C\7z.h" />
|
|
||||||
<ClInclude Include="File_Extractor\7z_C\7zAlloc.h" />
|
|
||||||
<ClInclude Include="File_Extractor\7z_C\7zBuf.h" />
|
|
||||||
<ClInclude Include="File_Extractor\7z_C\7zCrc.h" />
|
|
||||||
<ClInclude Include="File_Extractor\7z_C\7zDecode.h" />
|
|
||||||
<ClInclude Include="File_Extractor\7z_C\7zExtract.h" />
|
|
||||||
<ClInclude Include="File_Extractor\7z_C\7zFile.h" />
|
|
||||||
<ClInclude Include="File_Extractor\7z_C\7zHeader.h" />
|
|
||||||
<ClInclude Include="File_Extractor\7z_C\7zIn.h" />
|
|
||||||
<ClInclude Include="File_Extractor\7z_C\7zItem.h" />
|
|
||||||
<ClInclude Include="File_Extractor\7z_C\7zTypes.h" />
|
|
||||||
<ClInclude Include="File_Extractor\7z_C\7zVersion.h" />
|
|
||||||
<ClInclude Include="File_Extractor\7z_C\Alloc.h" />
|
|
||||||
<ClInclude Include="File_Extractor\7z_C\Bcj2.h" />
|
|
||||||
<ClInclude Include="File_Extractor\7z_C\Bra.h" />
|
|
||||||
<ClInclude Include="File_Extractor\7z_C\CpuArch.h" />
|
|
||||||
<ClInclude Include="File_Extractor\7z_C\Delta.h" />
|
|
||||||
<ClInclude Include="File_Extractor\7z_C\LzFind.h" />
|
|
||||||
<ClInclude Include="File_Extractor\7z_C\LzFindMt.h" />
|
|
||||||
<ClInclude Include="File_Extractor\7z_C\LzHash.h" />
|
|
||||||
<ClInclude Include="File_Extractor\7z_C\Lzma2Dec.h" />
|
|
||||||
<ClInclude Include="File_Extractor\7z_C\Lzma2Enc.h" />
|
|
||||||
<ClInclude Include="File_Extractor\7z_C\Lzma86.h" />
|
|
||||||
<ClInclude Include="File_Extractor\7z_C\LzmaDec.h" />
|
|
||||||
<ClInclude Include="File_Extractor\7z_C\LzmaEnc.h" />
|
|
||||||
<ClInclude Include="File_Extractor\7z_C\LzmaLib.h" />
|
|
||||||
<ClInclude Include="File_Extractor\7z_C\LzmaTypes.h" />
|
|
||||||
<ClInclude Include="File_Extractor\7z_C\MtCoder.h" />
|
|
||||||
<ClInclude Include="File_Extractor\7z_C\Ppmd.h" />
|
|
||||||
<ClInclude Include="File_Extractor\7z_C\Ppmd7.h" />
|
|
||||||
<ClInclude Include="File_Extractor\7z_C\RotateDefs.h" />
|
|
||||||
<ClInclude Include="File_Extractor\7z_C\Threads.h" />
|
|
||||||
<ClInclude Include="File_Extractor\7z_C\Types.h" />
|
|
||||||
<ClInclude Include="File_Extractor\fex\Binary_Extractor.h" />
|
|
||||||
<ClInclude Include="File_Extractor\fex\blargg_common.h" />
|
|
||||||
<ClInclude Include="File_Extractor\fex\blargg_config.h" />
|
|
||||||
<ClInclude Include="File_Extractor\fex\blargg_endian.h" />
|
|
||||||
<ClInclude Include="File_Extractor\fex\blargg_errors.h" />
|
|
||||||
<ClInclude Include="File_Extractor\fex\blargg_source.h" />
|
|
||||||
<ClInclude Include="File_Extractor\fex\Data_Reader.h" />
|
|
||||||
<ClInclude Include="File_Extractor\fex\fex.h" />
|
|
||||||
<ClInclude Include="File_Extractor\fex\File_Extractor.h" />
|
|
||||||
<ClInclude Include="File_Extractor\fex\Gzip_Extractor.h" />
|
|
||||||
<ClInclude Include="File_Extractor\fex\Gzip_Reader.h" />
|
|
||||||
<ClInclude Include="File_Extractor\fex\Rar_Extractor.h" />
|
|
||||||
<ClInclude Include="File_Extractor\fex\Zip7_Extractor.h" />
|
|
||||||
<ClInclude Include="File_Extractor\fex\Zip_Extractor.h" />
|
|
||||||
<ClInclude Include="File_Extractor\fex\Zlib_Inflater.h" />
|
|
||||||
<ClInclude Include="File_Extractor\unrar\archive.hpp" />
|
|
||||||
<ClInclude Include="File_Extractor\unrar\array.hpp" />
|
|
||||||
<ClInclude Include="File_Extractor\unrar\coder.hpp" />
|
|
||||||
<ClInclude Include="File_Extractor\unrar\compress.hpp" />
|
|
||||||
<ClInclude Include="File_Extractor\unrar\encname.hpp" />
|
|
||||||
<ClInclude Include="File_Extractor\unrar\getbits.hpp" />
|
|
||||||
<ClInclude Include="File_Extractor\unrar\headers.hpp" />
|
|
||||||
<ClInclude Include="File_Extractor\unrar\model.hpp" />
|
|
||||||
<ClInclude Include="File_Extractor\unrar\rar.hpp" />
|
|
||||||
<ClInclude Include="File_Extractor\unrar\rarvm.hpp" />
|
|
||||||
<ClInclude Include="File_Extractor\unrar\rawread.hpp" />
|
|
||||||
<ClInclude Include="File_Extractor\unrar\suballoc.hpp" />
|
|
||||||
<ClInclude Include="File_Extractor\unrar\unicode.hpp" />
|
|
||||||
<ClInclude Include="File_Extractor\unrar\unpack.hpp" />
|
|
||||||
<ClInclude Include="File_Extractor\unrar\unrar.h" />
|
|
||||||
<ClInclude Include="filter\hq2x.h" />
|
|
||||||
<ClInclude Include="filter\interp.h" />
|
|
||||||
<ClInclude Include="filter\lq2x.h" />
|
|
||||||
<ClInclude Include="..\encrypt.h">
|
<ClInclude Include="..\encrypt.h">
|
||||||
<Filter>Core</Filter>
|
<Filter>Core</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
|
@ -1419,6 +1397,210 @@
|
||||||
<ClInclude Include="..\filter\xbrz.h">
|
<ClInclude Include="..\filter\xbrz.h">
|
||||||
<Filter>Core\filter</Filter>
|
<Filter>Core\filter</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\7z_C\win32\Threads.h">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C\win32</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\7z_C\7z.h">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\7z_C\7zAlloc.h">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\7z_C\7zBuf.h">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\7z_C\7zCrc.h">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\7z_C\7zDecode.h">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\7z_C\7zExtract.h">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\7z_C\7zFile.h">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\7z_C\7zIn.h">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\7z_C\7zTypes.h">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\7z_C\7zVersion.h">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\7z_C\Alloc.h">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\7z_C\Bcj2.h">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\7z_C\Bra.h">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\7z_C\CpuArch.h">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\7z_C\Delta.h">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\7z_C\LzFind.h">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\7z_C\LzFindMt.h">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\7z_C\LzHash.h">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\7z_C\Lzma2Dec.h">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\7z_C\Lzma2Enc.h">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\7z_C\Lzma86.h">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\7z_C\LzmaDec.h">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\7z_C\LzmaEnc.h">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\7z_C\LzmaLib.h">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\7z_C\LzmaTypes.h">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\7z_C\MtCoder.h">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\7z_C\Ppmd.h">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\7z_C\Ppmd7.h">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\7z_C\RotateDefs.h">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\7z_C\Threads.h">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\7z_C\Types.h">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\fex\Binary_Extractor.h">
|
||||||
|
<Filter>Windows\File_Extractor\fex</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\fex\blargg_common.h">
|
||||||
|
<Filter>Windows\File_Extractor\fex</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\fex\blargg_config.h">
|
||||||
|
<Filter>Windows\File_Extractor\fex</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\fex\blargg_endian.h">
|
||||||
|
<Filter>Windows\File_Extractor\fex</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\fex\blargg_errors.h">
|
||||||
|
<Filter>Windows\File_Extractor\fex</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\fex\blargg_source.h">
|
||||||
|
<Filter>Windows\File_Extractor\fex</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\fex\Data_Reader.h">
|
||||||
|
<Filter>Windows\File_Extractor\fex</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\fex\fex.h">
|
||||||
|
<Filter>Windows\File_Extractor\fex</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\fex\File_Extractor.h">
|
||||||
|
<Filter>Windows\File_Extractor\fex</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\fex\Gzip_Extractor.h">
|
||||||
|
<Filter>Windows\File_Extractor\fex</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\fex\Gzip_Reader.h">
|
||||||
|
<Filter>Windows\File_Extractor\fex</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\fex\Rar_Extractor.h">
|
||||||
|
<Filter>Windows\File_Extractor\fex</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\fex\Zip_Extractor.h">
|
||||||
|
<Filter>Windows\File_Extractor\fex</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\fex\Zip7_Extractor.h">
|
||||||
|
<Filter>Windows\File_Extractor\fex</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\fex\Zlib_Inflater.h">
|
||||||
|
<Filter>Windows\File_Extractor\fex</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\unrar\archive.hpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\unrar\array.hpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\unrar\blake2s.hpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\unrar\coder.hpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\unrar\compress.hpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\unrar\encname.hpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\unrar\getbits.hpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\unrar\hash.hpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\unrar\headers.hpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\unrar\headers5.hpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\unrar\model.hpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\unrar\rar.hpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\unrar\rarvm.hpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\unrar\rawread.hpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\unrar\strfn.hpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\unrar\suballoc.hpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\unrar\timefn.hpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\unrar\unicode.hpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\unrar\unpack.hpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\unrar\unrar.h">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="FEX_Interface.h">
|
||||||
|
<Filter>Windows</Filter>
|
||||||
|
</ClInclude>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Include="..\instruction_tabdef.inc">
|
<None Include="..\instruction_tabdef.inc">
|
||||||
|
@ -1430,18 +1612,6 @@
|
||||||
<None Include="..\filter\hq4x.dat">
|
<None Include="..\filter\hq4x.dat">
|
||||||
<Filter>Core\filter</Filter>
|
<Filter>Core\filter</Filter>
|
||||||
</None>
|
</None>
|
||||||
<None Include="..\utils\AsmJit\COPYING.txt" />
|
|
||||||
<None Include="bitmap1.bmp" />
|
|
||||||
<None Include="DeSmuME.ico" />
|
|
||||||
<None Include="File_Extractor\7z_C\7zC.txt" />
|
|
||||||
<None Include="File_Extractor\7z_C\changes.txt" />
|
|
||||||
<None Include="File_Extractor\7z_C\lzma.txt" />
|
|
||||||
<None Include="File_Extractor\7z_C\readme.txt" />
|
|
||||||
<None Include="File_Extractor\unrar\changes.txt" />
|
|
||||||
<None Include="File_Extractor\unrar\license.txt" />
|
|
||||||
<None Include="File_Extractor\unrar\readme.txt" />
|
|
||||||
<None Include="File_Extractor\unrar\technote.txt" />
|
|
||||||
<None Include="File_Extractor\unrar\whatsnew.txt" />
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ResourceCompile Include="resources.rc">
|
<ResourceCompile Include="resources.rc">
|
||||||
|
@ -1459,4 +1629,36 @@
|
||||||
<Filter>Windows\libs</Filter>
|
<Filter>Windows\libs</Filter>
|
||||||
</CustomBuild>
|
</CustomBuild>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Text Include="File_Extractor\7z_C\7zC.txt">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</Text>
|
||||||
|
<Text Include="File_Extractor\7z_C\changes.txt">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</Text>
|
||||||
|
<Text Include="File_Extractor\7z_C\lzma.txt">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</Text>
|
||||||
|
<Text Include="File_Extractor\7z_C\readme.txt">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</Text>
|
||||||
|
<Text Include="File_Extractor\unrar\acknow.txt">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</Text>
|
||||||
|
<Text Include="File_Extractor\unrar\changes.txt">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</Text>
|
||||||
|
<Text Include="File_Extractor\unrar\license.txt">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</Text>
|
||||||
|
<Text Include="File_Extractor\unrar\readme.txt">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</Text>
|
||||||
|
<Text Include="File_Extractor\unrar\technote.txt">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</Text>
|
||||||
|
<Text Include="File_Extractor\unrar\whatsnew.txt">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</Text>
|
||||||
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
|
@ -133,7 +133,7 @@
|
||||||
<FavorSizeOrSpeed>Neither</FavorSizeOrSpeed>
|
<FavorSizeOrSpeed>Neither</FavorSizeOrSpeed>
|
||||||
<EnableFiberSafeOptimizations>false</EnableFiberSafeOptimizations>
|
<EnableFiberSafeOptimizations>false</EnableFiberSafeOptimizations>
|
||||||
<WholeProgramOptimization>false</WholeProgramOptimization>
|
<WholeProgramOptimization>false</WholeProgramOptimization>
|
||||||
<AdditionalIncludeDirectories>.;..;lua\include;glib-2.20.1\build;glib-2.20.1\build\glib;.\zlib123;.\zziplib;.\winpcap;userconfig;defaultconfig;.\agg\include;.\agg\examples;directx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
<AdditionalIncludeDirectories>.;..;lua\include;glib-2.20.1\build;glib-2.20.1\build\glib;.\zlib123;.\zziplib;.\winpcap;userconfig;defaultconfig;.\agg\include;.\agg\examples;directx;File_Extractor;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
<PreprocessorDefinitions>_MSC_PLATFORM_TOOLSET=$(PlatformToolsetVersion) ;DEBUG;_CRT_SECURE_NO_DEPRECATE;GLIB_STATIC_COMPILATION;WIN32;BETA_VERSION;NOMINMAX;HAVE_LIBZ;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
<PreprocessorDefinitions>_MSC_PLATFORM_TOOLSET=$(PlatformToolsetVersion) ;DEBUG;_CRT_SECURE_NO_DEPRECATE;GLIB_STATIC_COMPILATION;WIN32;BETA_VERSION;NOMINMAX;HAVE_LIBZ;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
<ExceptionHandling>Sync</ExceptionHandling>
|
<ExceptionHandling>Sync</ExceptionHandling>
|
||||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||||
|
@ -174,7 +174,7 @@
|
||||||
<OmitFramePointers>true</OmitFramePointers>
|
<OmitFramePointers>true</OmitFramePointers>
|
||||||
<EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>
|
<EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>
|
||||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||||
<AdditionalIncludeDirectories>.;..;lua\include;glib-2.20.1\build;glib-2.20.1\build\glib;.\zlib123;.\zziplib;.\winpcap;userconfig;defaultconfig;.\agg\include;.\agg\examples;directx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
<AdditionalIncludeDirectories>.;..;lua\include;glib-2.20.1\build;glib-2.20.1\build\glib;.\zlib123;.\zziplib;.\winpcap;userconfig;defaultconfig;.\agg\include;.\agg\examples;directx;File_Extractor;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
<PreprocessorDefinitions>_MSC_PLATFORM_TOOLSET=$(PlatformToolsetVersion) ;_CRT_SECURE_NO_DEPRECATE;GLIB_STATIC_COMPILATION;WIN32;HAVE_LIBZ;NOMINMAX;RELEASE;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
<PreprocessorDefinitions>_MSC_PLATFORM_TOOLSET=$(PlatformToolsetVersion) ;_CRT_SECURE_NO_DEPRECATE;GLIB_STATIC_COMPILATION;WIN32;HAVE_LIBZ;NOMINMAX;RELEASE;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
<StringPooling>true</StringPooling>
|
<StringPooling>true</StringPooling>
|
||||||
<ExceptionHandling>Sync</ExceptionHandling>
|
<ExceptionHandling>Sync</ExceptionHandling>
|
||||||
|
@ -216,7 +216,7 @@
|
||||||
<OmitFramePointers>true</OmitFramePointers>
|
<OmitFramePointers>true</OmitFramePointers>
|
||||||
<EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>
|
<EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>
|
||||||
<WholeProgramOptimization>false</WholeProgramOptimization>
|
<WholeProgramOptimization>false</WholeProgramOptimization>
|
||||||
<AdditionalIncludeDirectories>.;..;lua\include;glib-2.20.1\build;glib-2.20.1\build\glib;.\zlib123;.\zziplib;.\winpcap;userconfig;defaultconfig;.\agg\include;.\agg\examples;directx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
<AdditionalIncludeDirectories>.;..;lua\include;glib-2.20.1\build;glib-2.20.1\build\glib;.\zlib123;.\zziplib;.\winpcap;userconfig;defaultconfig;.\agg\include;.\agg\examples;directx;File_Extractor;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
<PreprocessorDefinitions>_MSC_PLATFORM_TOOLSET=$(PlatformToolsetVersion) ;_CRT_SECURE_NO_DEPRECATE;GLIB_STATIC_COMPILATION;WIN32;HAVE_LIBZ;NOMINMAX;RELEASE;NDEBUG;FASTBUILD;DEVELOPER;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
<PreprocessorDefinitions>_MSC_PLATFORM_TOOLSET=$(PlatformToolsetVersion) ;_CRT_SECURE_NO_DEPRECATE;GLIB_STATIC_COMPILATION;WIN32;HAVE_LIBZ;NOMINMAX;RELEASE;NDEBUG;FASTBUILD;DEVELOPER;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
<StringPooling>true</StringPooling>
|
<StringPooling>true</StringPooling>
|
||||||
<ExceptionHandling>Sync</ExceptionHandling>
|
<ExceptionHandling>Sync</ExceptionHandling>
|
||||||
|
@ -553,40 +553,10 @@
|
||||||
<ClCompile Include="File_Extractor\7z_C\7zCrc.c" />
|
<ClCompile Include="File_Extractor\7z_C\7zCrc.c" />
|
||||||
<ClCompile Include="File_Extractor\7z_C\7zCrcOpt.c" />
|
<ClCompile Include="File_Extractor\7z_C\7zCrcOpt.c" />
|
||||||
<ClCompile Include="File_Extractor\7z_C\7zDec.c" />
|
<ClCompile Include="File_Extractor\7z_C\7zDec.c" />
|
||||||
<ClCompile Include="File_Extractor\7z_C\7zDecode.c">
|
<ClCompile Include="File_Extractor\7z_C\7zDecode.c" />
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
<ClCompile Include="File_Extractor\7z_C\7zExtract.c" />
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Dev+|Win32'">true</ExcludedFromBuild>
|
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Dev+|x64'">true</ExcludedFromBuild>
|
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\7z_C\7zExtract.c">
|
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Dev+|Win32'">true</ExcludedFromBuild>
|
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Dev+|x64'">true</ExcludedFromBuild>
|
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\7z_C\7zFile.c" />
|
<ClCompile Include="File_Extractor\7z_C\7zFile.c" />
|
||||||
<ClCompile Include="File_Extractor\7z_C\7zHeader.c">
|
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Dev+|Win32'">true</ExcludedFromBuild>
|
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Dev+|x64'">true</ExcludedFromBuild>
|
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\7z_C\7zIn.c" />
|
<ClCompile Include="File_Extractor\7z_C\7zIn.c" />
|
||||||
<ClCompile Include="File_Extractor\7z_C\7zItem.c">
|
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Dev+|Win32'">true</ExcludedFromBuild>
|
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Dev+|x64'">true</ExcludedFromBuild>
|
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\7z_C\7zStream.c" />
|
<ClCompile Include="File_Extractor\7z_C\7zStream.c" />
|
||||||
<ClCompile Include="File_Extractor\7z_C\Alloc.c" />
|
<ClCompile Include="File_Extractor\7z_C\Alloc.c" />
|
||||||
<ClCompile Include="File_Extractor\7z_C\Bcj2.c" />
|
<ClCompile Include="File_Extractor\7z_C\Bcj2.c" />
|
||||||
|
@ -608,7 +578,7 @@
|
||||||
<ClCompile Include="File_Extractor\7z_C\Ppmd7.c" />
|
<ClCompile Include="File_Extractor\7z_C\Ppmd7.c" />
|
||||||
<ClCompile Include="File_Extractor\7z_C\Ppmd7Dec.c" />
|
<ClCompile Include="File_Extractor\7z_C\Ppmd7Dec.c" />
|
||||||
<ClCompile Include="File_Extractor\7z_C\Ppmd7Enc.c" />
|
<ClCompile Include="File_Extractor\7z_C\Ppmd7Enc.c" />
|
||||||
<ClCompile Include="File_Extractor\7z_C\Threads.c" />
|
<ClCompile Include="File_Extractor\7z_C\win32\Threads.c" />
|
||||||
<ClCompile Include="File_Extractor\fex\Binary_Extractor.cpp" />
|
<ClCompile Include="File_Extractor\fex\Binary_Extractor.cpp" />
|
||||||
<ClCompile Include="File_Extractor\fex\blargg_common.cpp" />
|
<ClCompile Include="File_Extractor\fex\blargg_common.cpp" />
|
||||||
<ClCompile Include="File_Extractor\fex\blargg_errors.cpp" />
|
<ClCompile Include="File_Extractor\fex\blargg_errors.cpp" />
|
||||||
|
@ -623,20 +593,33 @@
|
||||||
<ClCompile Include="File_Extractor\fex\Zlib_Inflater.cpp" />
|
<ClCompile Include="File_Extractor\fex\Zlib_Inflater.cpp" />
|
||||||
<ClCompile Include="File_Extractor\unrar\archive.cpp" />
|
<ClCompile Include="File_Extractor\unrar\archive.cpp" />
|
||||||
<ClCompile Include="File_Extractor\unrar\arcread.cpp" />
|
<ClCompile Include="File_Extractor\unrar\arcread.cpp" />
|
||||||
|
<ClCompile Include="File_Extractor\unrar\blake2s.cpp" />
|
||||||
|
<ClCompile Include="File_Extractor\unrar\blake2sp.cpp" />
|
||||||
|
<ClCompile Include="File_Extractor\unrar\blake2s_sse.cpp" />
|
||||||
<ClCompile Include="File_Extractor\unrar\coder.cpp" />
|
<ClCompile Include="File_Extractor\unrar\coder.cpp" />
|
||||||
<ClCompile Include="File_Extractor\unrar\crc.cpp" />
|
<ClCompile Include="File_Extractor\unrar\crc.cpp" />
|
||||||
<ClCompile Include="File_Extractor\unrar\encname.cpp" />
|
<ClCompile Include="File_Extractor\unrar\encname.cpp" />
|
||||||
<ClCompile Include="File_Extractor\unrar\extract.cpp" />
|
<ClCompile Include="File_Extractor\unrar\extract.cpp" />
|
||||||
<ClCompile Include="File_Extractor\unrar\getbits.cpp" />
|
<ClCompile Include="File_Extractor\unrar\getbits.cpp" />
|
||||||
|
<ClCompile Include="File_Extractor\unrar\hash.cpp" />
|
||||||
|
<ClCompile Include="File_Extractor\unrar\headers.cpp" />
|
||||||
<ClCompile Include="File_Extractor\unrar\model.cpp" />
|
<ClCompile Include="File_Extractor\unrar\model.cpp" />
|
||||||
|
<ClCompile Include="File_Extractor\unrar\pathfn.cpp" />
|
||||||
<ClCompile Include="File_Extractor\unrar\rarvm.cpp" />
|
<ClCompile Include="File_Extractor\unrar\rarvm.cpp" />
|
||||||
<ClCompile Include="File_Extractor\unrar\rarvmtbl.cpp" />
|
<ClCompile Include="File_Extractor\unrar\rarvmtbl.cpp" />
|
||||||
<ClCompile Include="File_Extractor\unrar\rawread.cpp" />
|
<ClCompile Include="File_Extractor\unrar\rawread.cpp" />
|
||||||
|
<ClCompile Include="File_Extractor\unrar\secpassword.cpp" />
|
||||||
|
<ClCompile Include="File_Extractor\unrar\strfn.cpp" />
|
||||||
<ClCompile Include="File_Extractor\unrar\suballoc.cpp" />
|
<ClCompile Include="File_Extractor\unrar\suballoc.cpp" />
|
||||||
|
<ClCompile Include="File_Extractor\unrar\timefn.cpp" />
|
||||||
<ClCompile Include="File_Extractor\unrar\unicode.cpp" />
|
<ClCompile Include="File_Extractor\unrar\unicode.cpp" />
|
||||||
<ClCompile Include="File_Extractor\unrar\unpack.cpp" />
|
<ClCompile Include="File_Extractor\unrar\unpack.cpp" />
|
||||||
<ClCompile Include="File_Extractor\unrar\unpack15.cpp" />
|
<ClCompile Include="File_Extractor\unrar\unpack15.cpp" />
|
||||||
<ClCompile Include="File_Extractor\unrar\unpack20.cpp" />
|
<ClCompile Include="File_Extractor\unrar\unpack20.cpp" />
|
||||||
|
<ClCompile Include="File_Extractor\unrar\unpack30.cpp" />
|
||||||
|
<ClCompile Include="File_Extractor\unrar\unpack50.cpp" />
|
||||||
|
<ClCompile Include="File_Extractor\unrar\unpack50frag.cpp" />
|
||||||
|
<ClCompile Include="File_Extractor\unrar\unpackinline.cpp" />
|
||||||
<ClCompile Include="File_Extractor\unrar\unrar.cpp" />
|
<ClCompile Include="File_Extractor\unrar\unrar.cpp" />
|
||||||
<ClCompile Include="File_Extractor\unrar\unrar_misc.cpp" />
|
<ClCompile Include="File_Extractor\unrar\unrar_misc.cpp" />
|
||||||
<ClCompile Include="File_Extractor\unrar\unrar_open.cpp" />
|
<ClCompile Include="File_Extractor\unrar\unrar_open.cpp" />
|
||||||
|
@ -688,7 +671,6 @@
|
||||||
<ClInclude Include="..\debug.h" />
|
<ClInclude Include="..\debug.h" />
|
||||||
<ClInclude Include="..\Disassembler.h" />
|
<ClInclude Include="..\Disassembler.h" />
|
||||||
<ClInclude Include="..\driver.h" />
|
<ClInclude Include="..\driver.h" />
|
||||||
<ClInclude Include="..\emufat_types.h" />
|
|
||||||
<ClInclude Include="..\emufile.h" />
|
<ClInclude Include="..\emufile.h" />
|
||||||
<ClInclude Include="..\encrypt.h" />
|
<ClInclude Include="..\encrypt.h" />
|
||||||
<ClInclude Include="..\fat.h" />
|
<ClInclude Include="..\fat.h" />
|
||||||
|
@ -773,7 +755,6 @@
|
||||||
<ClInclude Include="..\utils\AsmJit\x86\x86util.h" />
|
<ClInclude Include="..\utils\AsmJit\x86\x86util.h" />
|
||||||
<ClInclude Include="..\utils\datetime.h" />
|
<ClInclude Include="..\utils\datetime.h" />
|
||||||
<ClInclude Include="..\utils\emufat.h" />
|
<ClInclude Include="..\utils\emufat.h" />
|
||||||
<ClInclude Include="..\utils\emufat_types.h" />
|
|
||||||
<ClInclude Include="..\utils\fsnitro.h" />
|
<ClInclude Include="..\utils\fsnitro.h" />
|
||||||
<ClInclude Include="..\utils\libfat\bit_ops.h" />
|
<ClInclude Include="..\utils\libfat\bit_ops.h" />
|
||||||
<ClInclude Include="..\utils\libfat\cache.h" />
|
<ClInclude Include="..\utils\libfat\cache.h" />
|
||||||
|
@ -834,9 +815,7 @@
|
||||||
<ClInclude Include="File_Extractor\7z_C\7zDecode.h" />
|
<ClInclude Include="File_Extractor\7z_C\7zDecode.h" />
|
||||||
<ClInclude Include="File_Extractor\7z_C\7zExtract.h" />
|
<ClInclude Include="File_Extractor\7z_C\7zExtract.h" />
|
||||||
<ClInclude Include="File_Extractor\7z_C\7zFile.h" />
|
<ClInclude Include="File_Extractor\7z_C\7zFile.h" />
|
||||||
<ClInclude Include="File_Extractor\7z_C\7zHeader.h" />
|
|
||||||
<ClInclude Include="File_Extractor\7z_C\7zIn.h" />
|
<ClInclude Include="File_Extractor\7z_C\7zIn.h" />
|
||||||
<ClInclude Include="File_Extractor\7z_C\7zItem.h" />
|
|
||||||
<ClInclude Include="File_Extractor\7z_C\7zTypes.h" />
|
<ClInclude Include="File_Extractor\7z_C\7zTypes.h" />
|
||||||
<ClInclude Include="File_Extractor\7z_C\7zVersion.h" />
|
<ClInclude Include="File_Extractor\7z_C\7zVersion.h" />
|
||||||
<ClInclude Include="File_Extractor\7z_C\Alloc.h" />
|
<ClInclude Include="File_Extractor\7z_C\Alloc.h" />
|
||||||
|
@ -860,6 +839,7 @@
|
||||||
<ClInclude Include="File_Extractor\7z_C\RotateDefs.h" />
|
<ClInclude Include="File_Extractor\7z_C\RotateDefs.h" />
|
||||||
<ClInclude Include="File_Extractor\7z_C\Threads.h" />
|
<ClInclude Include="File_Extractor\7z_C\Threads.h" />
|
||||||
<ClInclude Include="File_Extractor\7z_C\Types.h" />
|
<ClInclude Include="File_Extractor\7z_C\Types.h" />
|
||||||
|
<ClInclude Include="File_Extractor\7z_C\win32\Threads.h" />
|
||||||
<ClInclude Include="File_Extractor\fex\Binary_Extractor.h" />
|
<ClInclude Include="File_Extractor\fex\Binary_Extractor.h" />
|
||||||
<ClInclude Include="File_Extractor\fex\blargg_common.h" />
|
<ClInclude Include="File_Extractor\fex\blargg_common.h" />
|
||||||
<ClInclude Include="File_Extractor\fex\blargg_config.h" />
|
<ClInclude Include="File_Extractor\fex\blargg_config.h" />
|
||||||
|
@ -877,22 +857,24 @@
|
||||||
<ClInclude Include="File_Extractor\fex\Zlib_Inflater.h" />
|
<ClInclude Include="File_Extractor\fex\Zlib_Inflater.h" />
|
||||||
<ClInclude Include="File_Extractor\unrar\archive.hpp" />
|
<ClInclude Include="File_Extractor\unrar\archive.hpp" />
|
||||||
<ClInclude Include="File_Extractor\unrar\array.hpp" />
|
<ClInclude Include="File_Extractor\unrar\array.hpp" />
|
||||||
|
<ClInclude Include="File_Extractor\unrar\blake2s.hpp" />
|
||||||
<ClInclude Include="File_Extractor\unrar\coder.hpp" />
|
<ClInclude Include="File_Extractor\unrar\coder.hpp" />
|
||||||
<ClInclude Include="File_Extractor\unrar\compress.hpp" />
|
<ClInclude Include="File_Extractor\unrar\compress.hpp" />
|
||||||
<ClInclude Include="File_Extractor\unrar\encname.hpp" />
|
<ClInclude Include="File_Extractor\unrar\encname.hpp" />
|
||||||
<ClInclude Include="File_Extractor\unrar\getbits.hpp" />
|
<ClInclude Include="File_Extractor\unrar\getbits.hpp" />
|
||||||
|
<ClInclude Include="File_Extractor\unrar\hash.hpp" />
|
||||||
<ClInclude Include="File_Extractor\unrar\headers.hpp" />
|
<ClInclude Include="File_Extractor\unrar\headers.hpp" />
|
||||||
|
<ClInclude Include="File_Extractor\unrar\headers5.hpp" />
|
||||||
<ClInclude Include="File_Extractor\unrar\model.hpp" />
|
<ClInclude Include="File_Extractor\unrar\model.hpp" />
|
||||||
<ClInclude Include="File_Extractor\unrar\rar.hpp" />
|
<ClInclude Include="File_Extractor\unrar\rar.hpp" />
|
||||||
<ClInclude Include="File_Extractor\unrar\rarvm.hpp" />
|
<ClInclude Include="File_Extractor\unrar\rarvm.hpp" />
|
||||||
<ClInclude Include="File_Extractor\unrar\rawread.hpp" />
|
<ClInclude Include="File_Extractor\unrar\rawread.hpp" />
|
||||||
|
<ClInclude Include="File_Extractor\unrar\strfn.hpp" />
|
||||||
<ClInclude Include="File_Extractor\unrar\suballoc.hpp" />
|
<ClInclude Include="File_Extractor\unrar\suballoc.hpp" />
|
||||||
|
<ClInclude Include="File_Extractor\unrar\timefn.hpp" />
|
||||||
<ClInclude Include="File_Extractor\unrar\unicode.hpp" />
|
<ClInclude Include="File_Extractor\unrar\unicode.hpp" />
|
||||||
<ClInclude Include="File_Extractor\unrar\unpack.hpp" />
|
<ClInclude Include="File_Extractor\unrar\unpack.hpp" />
|
||||||
<ClInclude Include="File_Extractor\unrar\unrar.h" />
|
<ClInclude Include="File_Extractor\unrar\unrar.h" />
|
||||||
<ClInclude Include="filter\hq2x.h" />
|
|
||||||
<ClInclude Include="filter\interp.h" />
|
|
||||||
<ClInclude Include="filter\lq2x.h" />
|
|
||||||
<ClInclude Include="FirmConfig.h" />
|
<ClInclude Include="FirmConfig.h" />
|
||||||
<ClInclude Include="fsnitroView.h" />
|
<ClInclude Include="fsnitroView.h" />
|
||||||
<ClInclude Include="gbaslot_config.h" />
|
<ClInclude Include="gbaslot_config.h" />
|
||||||
|
@ -930,9 +912,6 @@
|
||||||
<None Include="..\filter\hq4x.dat" />
|
<None Include="..\filter\hq4x.dat" />
|
||||||
<None Include="..\instruction_tabdef.inc" />
|
<None Include="..\instruction_tabdef.inc" />
|
||||||
<None Include="..\thumb_tabdef.inc" />
|
<None Include="..\thumb_tabdef.inc" />
|
||||||
<None Include="..\utils\AsmJit\COPYING.txt" />
|
|
||||||
<None Include="bitmap1.bmp" />
|
|
||||||
<None Include="DeSmuME.ico" />
|
|
||||||
<CustomBuild Include="directx\directx.7z">
|
<CustomBuild Include="directx\directx.7z">
|
||||||
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">call un7z_and_touch.bat directx\directx.7z .libs\directx*
|
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">call un7z_and_touch.bat directx\directx.7z .libs\directx*
|
||||||
</Command>
|
</Command>
|
||||||
|
@ -1001,6 +980,7 @@
|
||||||
<None Include="File_Extractor\7z_C\changes.txt" />
|
<None Include="File_Extractor\7z_C\changes.txt" />
|
||||||
<None Include="File_Extractor\7z_C\lzma.txt" />
|
<None Include="File_Extractor\7z_C\lzma.txt" />
|
||||||
<None Include="File_Extractor\7z_C\readme.txt" />
|
<None Include="File_Extractor\7z_C\readme.txt" />
|
||||||
|
<None Include="File_Extractor\unrar\acknow.txt" />
|
||||||
<None Include="File_Extractor\unrar\changes.txt" />
|
<None Include="File_Extractor\unrar\changes.txt" />
|
||||||
<None Include="File_Extractor\unrar\license.txt" />
|
<None Include="File_Extractor\unrar\license.txt" />
|
||||||
<None Include="File_Extractor\unrar\readme.txt" />
|
<None Include="File_Extractor\unrar\readme.txt" />
|
||||||
|
|
|
@ -49,12 +49,6 @@
|
||||||
<Filter Include="Windows\File_Extractor">
|
<Filter Include="Windows\File_Extractor">
|
||||||
<UniqueIdentifier>{ec682647-9bb7-4315-99a4-4f9398db61ad}</UniqueIdentifier>
|
<UniqueIdentifier>{ec682647-9bb7-4315-99a4-4f9398db61ad}</UniqueIdentifier>
|
||||||
</Filter>
|
</Filter>
|
||||||
<Filter Include="Windows\File_Extractor\7-Zip">
|
|
||||||
<UniqueIdentifier>{321e6567-acbd-4dc4-a5c6-6cd8fe445d53}</UniqueIdentifier>
|
|
||||||
</Filter>
|
|
||||||
<Filter Include="Windows\File_Extractor\unrar">
|
|
||||||
<UniqueIdentifier>{4c97f223-843f-4975-b774-4d0c887cfd37}</UniqueIdentifier>
|
|
||||||
</Filter>
|
|
||||||
<Filter Include="Windows\userconfig">
|
<Filter Include="Windows\userconfig">
|
||||||
<UniqueIdentifier>{4d7483df-e22e-4e77-9ae8-8446c04d335d}</UniqueIdentifier>
|
<UniqueIdentifier>{4d7483df-e22e-4e77-9ae8-8446c04d335d}</UniqueIdentifier>
|
||||||
</Filter>
|
</Filter>
|
||||||
|
@ -67,6 +61,18 @@
|
||||||
<Filter Include="Windows\libs">
|
<Filter Include="Windows\libs">
|
||||||
<UniqueIdentifier>{191da306-49b9-43b4-a4d9-d91dd3a18db8}</UniqueIdentifier>
|
<UniqueIdentifier>{191da306-49b9-43b4-a4d9-d91dd3a18db8}</UniqueIdentifier>
|
||||||
</Filter>
|
</Filter>
|
||||||
|
<Filter Include="Windows\File_Extractor\7z_C">
|
||||||
|
<UniqueIdentifier>{cd842cb5-7e8f-4265-b893-f44eb7f52c00}</UniqueIdentifier>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="Windows\File_Extractor\fex">
|
||||||
|
<UniqueIdentifier>{4604012a-be54-4537-827b-65c44969f012}</UniqueIdentifier>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="Windows\File_Extractor\unrar">
|
||||||
|
<UniqueIdentifier>{553c2a14-1f94-4468-9667-56bdc454cb04}</UniqueIdentifier>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="Windows\File_Extractor\7z_C\win32">
|
||||||
|
<UniqueIdentifier>{bb7018b5-f7ad-45e8-8179-8cc0ce8a6a20}</UniqueIdentifier>
|
||||||
|
</Filter>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClCompile Include="..\aggdraw.cpp">
|
<ClCompile Include="..\aggdraw.cpp">
|
||||||
|
@ -531,189 +537,6 @@
|
||||||
<ClCompile Include="winutil.cpp">
|
<ClCompile Include="winutil.cpp">
|
||||||
<Filter>Windows</Filter>
|
<Filter>Windows</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="File_Extractor\fex\Binary_Extractor.cpp">
|
|
||||||
<Filter>Windows\File_Extractor</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\fex\blargg_common.cpp">
|
|
||||||
<Filter>Windows\File_Extractor</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\fex\blargg_errors.cpp">
|
|
||||||
<Filter>Windows\File_Extractor</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\fex\Data_Reader.cpp">
|
|
||||||
<Filter>Windows\File_Extractor</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\fex\fex.cpp">
|
|
||||||
<Filter>Windows\File_Extractor</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\fex\File_Extractor.cpp">
|
|
||||||
<Filter>Windows\File_Extractor</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\fex\Gzip_Extractor.cpp">
|
|
||||||
<Filter>Windows\File_Extractor</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\fex\Gzip_Reader.cpp">
|
|
||||||
<Filter>Windows\File_Extractor</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\fex\Rar_Extractor.cpp">
|
|
||||||
<Filter>Windows\File_Extractor</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\fex\Zip7_Extractor.cpp">
|
|
||||||
<Filter>Windows\File_Extractor</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\fex\Zip_Extractor.cpp">
|
|
||||||
<Filter>Windows\File_Extractor</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\fex\Zlib_Inflater.cpp">
|
|
||||||
<Filter>Windows\File_Extractor</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\7z_C\7zAlloc.c">
|
|
||||||
<Filter>Windows\File_Extractor\7-Zip</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\7z_C\7zBuf.c">
|
|
||||||
<Filter>Windows\File_Extractor\7-Zip</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\7z_C\7zBuf2.c">
|
|
||||||
<Filter>Windows\File_Extractor\7-Zip</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\7z_C\7zCrc.c">
|
|
||||||
<Filter>Windows\File_Extractor\7-Zip</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\7z_C\7zCrcOpt.c">
|
|
||||||
<Filter>Windows\File_Extractor\7-Zip</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\7z_C\7zDec.c">
|
|
||||||
<Filter>Windows\File_Extractor\7-Zip</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\7z_C\7zFile.c">
|
|
||||||
<Filter>Windows\File_Extractor\7-Zip</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\7z_C\7zIn.c">
|
|
||||||
<Filter>Windows\File_Extractor\7-Zip</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\7z_C\7zStream.c">
|
|
||||||
<Filter>Windows\File_Extractor\7-Zip</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\7z_C\Alloc.c">
|
|
||||||
<Filter>Windows\File_Extractor\7-Zip</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\7z_C\Bcj2.c">
|
|
||||||
<Filter>Windows\File_Extractor\7-Zip</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\7z_C\Bra.c">
|
|
||||||
<Filter>Windows\File_Extractor\7-Zip</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\7z_C\Bra86.c">
|
|
||||||
<Filter>Windows\File_Extractor\7-Zip</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\7z_C\BraIA64.c">
|
|
||||||
<Filter>Windows\File_Extractor\7-Zip</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\7z_C\CpuArch.c">
|
|
||||||
<Filter>Windows\File_Extractor\7-Zip</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\7z_C\Delta.c">
|
|
||||||
<Filter>Windows\File_Extractor\7-Zip</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\7z_C\LzFind.c">
|
|
||||||
<Filter>Windows\File_Extractor\7-Zip</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\7z_C\LzFindMt.c">
|
|
||||||
<Filter>Windows\File_Extractor\7-Zip</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\7z_C\Lzma2Dec.c">
|
|
||||||
<Filter>Windows\File_Extractor\7-Zip</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\7z_C\Lzma2Enc.c">
|
|
||||||
<Filter>Windows\File_Extractor\7-Zip</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\7z_C\Lzma86Dec.c">
|
|
||||||
<Filter>Windows\File_Extractor\7-Zip</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\7z_C\Lzma86Enc.c">
|
|
||||||
<Filter>Windows\File_Extractor\7-Zip</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\7z_C\LzmaDec.c">
|
|
||||||
<Filter>Windows\File_Extractor\7-Zip</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\7z_C\LzmaEnc.c">
|
|
||||||
<Filter>Windows\File_Extractor\7-Zip</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\7z_C\LzmaLib.c">
|
|
||||||
<Filter>Windows\File_Extractor\7-Zip</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\7z_C\MtCoder.c">
|
|
||||||
<Filter>Windows\File_Extractor\7-Zip</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\7z_C\Ppmd7.c">
|
|
||||||
<Filter>Windows\File_Extractor\7-Zip</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\7z_C\Ppmd7Dec.c">
|
|
||||||
<Filter>Windows\File_Extractor\7-Zip</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\7z_C\Ppmd7Enc.c">
|
|
||||||
<Filter>Windows\File_Extractor\7-Zip</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\7z_C\Threads.c">
|
|
||||||
<Filter>Windows\File_Extractor\7-Zip</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\unrar\archive.cpp">
|
|
||||||
<Filter>Windows\File_Extractor\unrar</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\unrar\arcread.cpp">
|
|
||||||
<Filter>Windows\File_Extractor\unrar</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\unrar\coder.cpp">
|
|
||||||
<Filter>Windows\File_Extractor\unrar</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\unrar\crc.cpp">
|
|
||||||
<Filter>Windows\File_Extractor\unrar</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\unrar\encname.cpp">
|
|
||||||
<Filter>Windows\File_Extractor\unrar</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\unrar\extract.cpp">
|
|
||||||
<Filter>Windows\File_Extractor\unrar</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\unrar\getbits.cpp">
|
|
||||||
<Filter>Windows\File_Extractor\unrar</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\unrar\model.cpp">
|
|
||||||
<Filter>Windows\File_Extractor\unrar</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\unrar\rarvm.cpp">
|
|
||||||
<Filter>Windows\File_Extractor\unrar</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\unrar\rarvmtbl.cpp">
|
|
||||||
<Filter>Windows\File_Extractor\unrar</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\unrar\rawread.cpp">
|
|
||||||
<Filter>Windows\File_Extractor\unrar</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\unrar\suballoc.cpp">
|
|
||||||
<Filter>Windows\File_Extractor\unrar</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\unrar\unicode.cpp">
|
|
||||||
<Filter>Windows\File_Extractor\unrar</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\unrar\unpack.cpp">
|
|
||||||
<Filter>Windows\File_Extractor\unrar</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\unrar\unpack15.cpp">
|
|
||||||
<Filter>Windows\File_Extractor\unrar</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\unrar\unpack20.cpp">
|
|
||||||
<Filter>Windows\File_Extractor\unrar</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\unrar\unrar.cpp">
|
|
||||||
<Filter>Windows\File_Extractor\unrar</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\unrar\unrar_misc.cpp">
|
|
||||||
<Filter>Windows\File_Extractor\unrar</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="File_Extractor\unrar\unrar_open.cpp">
|
|
||||||
<Filter>Windows\File_Extractor\unrar</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="disView.cpp">
|
<ClCompile Include="disView.cpp">
|
||||||
<Filter>Windows\tools</Filter>
|
<Filter>Windows\tools</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
@ -759,10 +582,6 @@
|
||||||
<ClCompile Include="sndxa2.cpp">
|
<ClCompile Include="sndxa2.cpp">
|
||||||
<Filter>Windows</Filter>
|
<Filter>Windows</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="File_Extractor\7z_C\7zDecode.c" />
|
|
||||||
<ClCompile Include="File_Extractor\7z_C\7zExtract.c" />
|
|
||||||
<ClCompile Include="File_Extractor\7z_C\7zHeader.c" />
|
|
||||||
<ClCompile Include="File_Extractor\7z_C\7zItem.c" />
|
|
||||||
<ClCompile Include="..\encrypt.cpp">
|
<ClCompile Include="..\encrypt.cpp">
|
||||||
<Filter>Core</Filter>
|
<Filter>Core</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
@ -802,6 +621,234 @@
|
||||||
<ClCompile Include="..\filter\xbrz.cpp">
|
<ClCompile Include="..\filter\xbrz.cpp">
|
||||||
<Filter>Core\filter</Filter>
|
<Filter>Core\filter</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\7z_C\win32\Threads.c">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C\win32</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\fex\blargg_common.cpp">
|
||||||
|
<Filter>Windows\File_Extractor\fex</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\fex\blargg_errors.cpp">
|
||||||
|
<Filter>Windows\File_Extractor\fex</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\fex\Data_Reader.cpp">
|
||||||
|
<Filter>Windows\File_Extractor\fex</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\fex\fex.cpp">
|
||||||
|
<Filter>Windows\File_Extractor\fex</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\fex\File_Extractor.cpp">
|
||||||
|
<Filter>Windows\File_Extractor\fex</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\fex\Gzip_Extractor.cpp">
|
||||||
|
<Filter>Windows\File_Extractor\fex</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\fex\Gzip_Reader.cpp">
|
||||||
|
<Filter>Windows\File_Extractor\fex</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\fex\Rar_Extractor.cpp">
|
||||||
|
<Filter>Windows\File_Extractor\fex</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\fex\Zip_Extractor.cpp">
|
||||||
|
<Filter>Windows\File_Extractor\fex</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\fex\Zip7_Extractor.cpp">
|
||||||
|
<Filter>Windows\File_Extractor\fex</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\fex\Zlib_Inflater.cpp">
|
||||||
|
<Filter>Windows\File_Extractor\fex</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\fex\Binary_Extractor.cpp">
|
||||||
|
<Filter>Windows\File_Extractor\fex</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\unrar\arcread.cpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\unrar\blake2s.cpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\unrar\blake2s_sse.cpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\unrar\blake2sp.cpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\unrar\coder.cpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\unrar\crc.cpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\unrar\encname.cpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\unrar\extract.cpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\unrar\getbits.cpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\unrar\hash.cpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\unrar\headers.cpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\unrar\model.cpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\unrar\pathfn.cpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\unrar\rarvm.cpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\unrar\rarvmtbl.cpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\unrar\rawread.cpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\unrar\secpassword.cpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\unrar\strfn.cpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\unrar\suballoc.cpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\unrar\timefn.cpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\unrar\unicode.cpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\unrar\unpack.cpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\unrar\unpack15.cpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\unrar\unpack20.cpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\unrar\unpack30.cpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\unrar\unpack50.cpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\unrar\unpack50frag.cpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\unrar\unpackinline.cpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\unrar\unrar.cpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\unrar\unrar_misc.cpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\unrar\unrar_open.cpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\unrar\archive.cpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\7z_C\7zAlloc.c">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\7z_C\7zBuf.c">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\7z_C\7zBuf2.c">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\7z_C\7zCrc.c">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\7z_C\7zCrcOpt.c">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\7z_C\7zDec.c">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\7z_C\7zDecode.c">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\7z_C\7zExtract.c">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\7z_C\7zFile.c">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\7z_C\7zIn.c">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\7z_C\7zStream.c">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\7z_C\Alloc.c">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\7z_C\Bcj2.c">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\7z_C\Bra.c">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\7z_C\Bra86.c">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\7z_C\BraIA64.c">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\7z_C\CpuArch.c">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\7z_C\Delta.c">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\7z_C\LzFind.c">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\7z_C\LzFindMt.c">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\7z_C\Lzma2Dec.c">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\7z_C\Lzma2Enc.c">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\7z_C\Lzma86Dec.c">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\7z_C\Lzma86Enc.c">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\7z_C\LzmaDec.c">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\7z_C\LzmaEnc.c">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\7z_C\LzmaLib.c">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\7z_C\MtCoder.c">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\7z_C\Ppmd7.c">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\7z_C\Ppmd7Dec.c">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="File_Extractor\7z_C\Ppmd7Enc.c">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClCompile>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClInclude Include="..\arm_jit.h">
|
<ClInclude Include="..\arm_jit.h">
|
||||||
|
@ -1326,75 +1373,6 @@
|
||||||
<ClInclude Include="sndxa2.h">
|
<ClInclude Include="sndxa2.h">
|
||||||
<Filter>Windows</Filter>
|
<Filter>Windows</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClInclude Include="..\emufat_types.h" />
|
|
||||||
<ClInclude Include="..\utils\emufat_types.h" />
|
|
||||||
<ClInclude Include="FEX_Interface.h" />
|
|
||||||
<ClInclude Include="File_Extractor\7z_C\7z.h" />
|
|
||||||
<ClInclude Include="File_Extractor\7z_C\7zAlloc.h" />
|
|
||||||
<ClInclude Include="File_Extractor\7z_C\7zBuf.h" />
|
|
||||||
<ClInclude Include="File_Extractor\7z_C\7zCrc.h" />
|
|
||||||
<ClInclude Include="File_Extractor\7z_C\7zDecode.h" />
|
|
||||||
<ClInclude Include="File_Extractor\7z_C\7zExtract.h" />
|
|
||||||
<ClInclude Include="File_Extractor\7z_C\7zFile.h" />
|
|
||||||
<ClInclude Include="File_Extractor\7z_C\7zHeader.h" />
|
|
||||||
<ClInclude Include="File_Extractor\7z_C\7zIn.h" />
|
|
||||||
<ClInclude Include="File_Extractor\7z_C\7zItem.h" />
|
|
||||||
<ClInclude Include="File_Extractor\7z_C\7zTypes.h" />
|
|
||||||
<ClInclude Include="File_Extractor\7z_C\7zVersion.h" />
|
|
||||||
<ClInclude Include="File_Extractor\7z_C\Alloc.h" />
|
|
||||||
<ClInclude Include="File_Extractor\7z_C\Bcj2.h" />
|
|
||||||
<ClInclude Include="File_Extractor\7z_C\Bra.h" />
|
|
||||||
<ClInclude Include="File_Extractor\7z_C\CpuArch.h" />
|
|
||||||
<ClInclude Include="File_Extractor\7z_C\Delta.h" />
|
|
||||||
<ClInclude Include="File_Extractor\7z_C\LzFind.h" />
|
|
||||||
<ClInclude Include="File_Extractor\7z_C\LzFindMt.h" />
|
|
||||||
<ClInclude Include="File_Extractor\7z_C\LzHash.h" />
|
|
||||||
<ClInclude Include="File_Extractor\7z_C\Lzma2Dec.h" />
|
|
||||||
<ClInclude Include="File_Extractor\7z_C\Lzma2Enc.h" />
|
|
||||||
<ClInclude Include="File_Extractor\7z_C\Lzma86.h" />
|
|
||||||
<ClInclude Include="File_Extractor\7z_C\LzmaDec.h" />
|
|
||||||
<ClInclude Include="File_Extractor\7z_C\LzmaEnc.h" />
|
|
||||||
<ClInclude Include="File_Extractor\7z_C\LzmaLib.h" />
|
|
||||||
<ClInclude Include="File_Extractor\7z_C\LzmaTypes.h" />
|
|
||||||
<ClInclude Include="File_Extractor\7z_C\MtCoder.h" />
|
|
||||||
<ClInclude Include="File_Extractor\7z_C\Ppmd.h" />
|
|
||||||
<ClInclude Include="File_Extractor\7z_C\Ppmd7.h" />
|
|
||||||
<ClInclude Include="File_Extractor\7z_C\RotateDefs.h" />
|
|
||||||
<ClInclude Include="File_Extractor\7z_C\Threads.h" />
|
|
||||||
<ClInclude Include="File_Extractor\7z_C\Types.h" />
|
|
||||||
<ClInclude Include="File_Extractor\fex\Binary_Extractor.h" />
|
|
||||||
<ClInclude Include="File_Extractor\fex\blargg_common.h" />
|
|
||||||
<ClInclude Include="File_Extractor\fex\blargg_config.h" />
|
|
||||||
<ClInclude Include="File_Extractor\fex\blargg_endian.h" />
|
|
||||||
<ClInclude Include="File_Extractor\fex\blargg_errors.h" />
|
|
||||||
<ClInclude Include="File_Extractor\fex\blargg_source.h" />
|
|
||||||
<ClInclude Include="File_Extractor\fex\Data_Reader.h" />
|
|
||||||
<ClInclude Include="File_Extractor\fex\fex.h" />
|
|
||||||
<ClInclude Include="File_Extractor\fex\File_Extractor.h" />
|
|
||||||
<ClInclude Include="File_Extractor\fex\Gzip_Extractor.h" />
|
|
||||||
<ClInclude Include="File_Extractor\fex\Gzip_Reader.h" />
|
|
||||||
<ClInclude Include="File_Extractor\fex\Rar_Extractor.h" />
|
|
||||||
<ClInclude Include="File_Extractor\fex\Zip7_Extractor.h" />
|
|
||||||
<ClInclude Include="File_Extractor\fex\Zip_Extractor.h" />
|
|
||||||
<ClInclude Include="File_Extractor\fex\Zlib_Inflater.h" />
|
|
||||||
<ClInclude Include="File_Extractor\unrar\archive.hpp" />
|
|
||||||
<ClInclude Include="File_Extractor\unrar\array.hpp" />
|
|
||||||
<ClInclude Include="File_Extractor\unrar\coder.hpp" />
|
|
||||||
<ClInclude Include="File_Extractor\unrar\compress.hpp" />
|
|
||||||
<ClInclude Include="File_Extractor\unrar\encname.hpp" />
|
|
||||||
<ClInclude Include="File_Extractor\unrar\getbits.hpp" />
|
|
||||||
<ClInclude Include="File_Extractor\unrar\headers.hpp" />
|
|
||||||
<ClInclude Include="File_Extractor\unrar\model.hpp" />
|
|
||||||
<ClInclude Include="File_Extractor\unrar\rar.hpp" />
|
|
||||||
<ClInclude Include="File_Extractor\unrar\rarvm.hpp" />
|
|
||||||
<ClInclude Include="File_Extractor\unrar\rawread.hpp" />
|
|
||||||
<ClInclude Include="File_Extractor\unrar\suballoc.hpp" />
|
|
||||||
<ClInclude Include="File_Extractor\unrar\unicode.hpp" />
|
|
||||||
<ClInclude Include="File_Extractor\unrar\unpack.hpp" />
|
|
||||||
<ClInclude Include="File_Extractor\unrar\unrar.h" />
|
|
||||||
<ClInclude Include="filter\hq2x.h" />
|
|
||||||
<ClInclude Include="filter\interp.h" />
|
|
||||||
<ClInclude Include="filter\lq2x.h" />
|
|
||||||
<ClInclude Include="..\encrypt.h">
|
<ClInclude Include="..\encrypt.h">
|
||||||
<Filter>Core</Filter>
|
<Filter>Core</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
|
@ -1419,6 +1397,210 @@
|
||||||
<ClInclude Include="..\filter\xbrz.h">
|
<ClInclude Include="..\filter\xbrz.h">
|
||||||
<Filter>Core\filter</Filter>
|
<Filter>Core\filter</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\7z_C\win32\Threads.h">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C\win32</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\fex\Binary_Extractor.h">
|
||||||
|
<Filter>Windows\File_Extractor\fex</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\fex\blargg_common.h">
|
||||||
|
<Filter>Windows\File_Extractor\fex</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\fex\blargg_config.h">
|
||||||
|
<Filter>Windows\File_Extractor\fex</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\fex\blargg_endian.h">
|
||||||
|
<Filter>Windows\File_Extractor\fex</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\fex\blargg_errors.h">
|
||||||
|
<Filter>Windows\File_Extractor\fex</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\fex\blargg_source.h">
|
||||||
|
<Filter>Windows\File_Extractor\fex</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\fex\Data_Reader.h">
|
||||||
|
<Filter>Windows\File_Extractor\fex</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\fex\fex.h">
|
||||||
|
<Filter>Windows\File_Extractor\fex</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\fex\File_Extractor.h">
|
||||||
|
<Filter>Windows\File_Extractor\fex</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\fex\Gzip_Extractor.h">
|
||||||
|
<Filter>Windows\File_Extractor\fex</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\fex\Gzip_Reader.h">
|
||||||
|
<Filter>Windows\File_Extractor\fex</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\fex\Rar_Extractor.h">
|
||||||
|
<Filter>Windows\File_Extractor\fex</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\fex\Zip_Extractor.h">
|
||||||
|
<Filter>Windows\File_Extractor\fex</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\fex\Zip7_Extractor.h">
|
||||||
|
<Filter>Windows\File_Extractor\fex</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\fex\Zlib_Inflater.h">
|
||||||
|
<Filter>Windows\File_Extractor\fex</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\unrar\archive.hpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\unrar\array.hpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\unrar\blake2s.hpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\unrar\coder.hpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\unrar\compress.hpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\unrar\encname.hpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\unrar\getbits.hpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\unrar\hash.hpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\unrar\headers.hpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\unrar\headers5.hpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\unrar\model.hpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\unrar\rar.hpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\unrar\rarvm.hpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\unrar\rawread.hpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\unrar\strfn.hpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\unrar\suballoc.hpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\unrar\timefn.hpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\unrar\unicode.hpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\unrar\unpack.hpp">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\unrar\unrar.h">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\7z_C\7z.h">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\7z_C\7zAlloc.h">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\7z_C\7zBuf.h">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\7z_C\7zCrc.h">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\7z_C\7zDecode.h">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\7z_C\7zExtract.h">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\7z_C\7zFile.h">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\7z_C\7zIn.h">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\7z_C\7zTypes.h">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\7z_C\7zVersion.h">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\7z_C\Alloc.h">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\7z_C\Bcj2.h">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\7z_C\Bra.h">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\7z_C\CpuArch.h">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\7z_C\Delta.h">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\7z_C\LzFind.h">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\7z_C\LzFindMt.h">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\7z_C\LzHash.h">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\7z_C\Lzma2Dec.h">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\7z_C\Lzma2Enc.h">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\7z_C\Lzma86.h">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\7z_C\LzmaDec.h">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\7z_C\LzmaEnc.h">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\7z_C\LzmaLib.h">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\7z_C\LzmaTypes.h">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\7z_C\MtCoder.h">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\7z_C\Ppmd.h">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\7z_C\Ppmd7.h">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\7z_C\RotateDefs.h">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\7z_C\Threads.h">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="File_Extractor\7z_C\Types.h">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="FEX_Interface.h">
|
||||||
|
<Filter>Windows</Filter>
|
||||||
|
</ClInclude>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Include="..\instruction_tabdef.inc">
|
<None Include="..\instruction_tabdef.inc">
|
||||||
|
@ -1430,18 +1612,36 @@
|
||||||
<None Include="..\filter\hq4x.dat">
|
<None Include="..\filter\hq4x.dat">
|
||||||
<Filter>Core\filter</Filter>
|
<Filter>Core\filter</Filter>
|
||||||
</None>
|
</None>
|
||||||
<None Include="..\utils\AsmJit\COPYING.txt" />
|
<None Include="File_Extractor\unrar\changes.txt">
|
||||||
<None Include="bitmap1.bmp" />
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
<None Include="DeSmuME.ico" />
|
</None>
|
||||||
<None Include="File_Extractor\7z_C\7zC.txt" />
|
<None Include="File_Extractor\unrar\license.txt">
|
||||||
<None Include="File_Extractor\7z_C\changes.txt" />
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
<None Include="File_Extractor\7z_C\lzma.txt" />
|
</None>
|
||||||
<None Include="File_Extractor\7z_C\readme.txt" />
|
<None Include="File_Extractor\unrar\readme.txt">
|
||||||
<None Include="File_Extractor\unrar\changes.txt" />
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
<None Include="File_Extractor\unrar\license.txt" />
|
</None>
|
||||||
<None Include="File_Extractor\unrar\readme.txt" />
|
<None Include="File_Extractor\unrar\technote.txt">
|
||||||
<None Include="File_Extractor\unrar\technote.txt" />
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
<None Include="File_Extractor\unrar\whatsnew.txt" />
|
</None>
|
||||||
|
<None Include="File_Extractor\unrar\whatsnew.txt">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</None>
|
||||||
|
<None Include="File_Extractor\unrar\acknow.txt">
|
||||||
|
<Filter>Windows\File_Extractor\unrar</Filter>
|
||||||
|
</None>
|
||||||
|
<None Include="File_Extractor\7z_C\7zC.txt">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</None>
|
||||||
|
<None Include="File_Extractor\7z_C\changes.txt">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</None>
|
||||||
|
<None Include="File_Extractor\7z_C\lzma.txt">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</None>
|
||||||
|
<None Include="File_Extractor\7z_C\readme.txt">
|
||||||
|
<Filter>Windows\File_Extractor\7z_C</Filter>
|
||||||
|
</None>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ResourceCompile Include="resources.rc">
|
<ResourceCompile Include="resources.rc">
|
||||||
|
|
|
@ -31,7 +31,6 @@ struct ArchiveFormatInfo
|
||||||
{
|
{
|
||||||
std::string name;
|
std::string name;
|
||||||
std::vector<std::string> extensions;
|
std::vector<std::string> extensions;
|
||||||
std::vector<std::string> signatures;
|
|
||||||
fex_type_t type;
|
fex_type_t type;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -101,13 +100,6 @@ void InitDecoder()
|
||||||
|
|
||||||
info.type = type_list[i];
|
info.type = type_list[i];
|
||||||
|
|
||||||
const char ** signatures = fex_type_signatures(type_list[i]);
|
|
||||||
|
|
||||||
for (unsigned int j = 0; signatures[j]; j++)
|
|
||||||
{
|
|
||||||
info.signatures.push_back(signatures[j]);
|
|
||||||
}
|
|
||||||
|
|
||||||
s_formatInfos.push_back(info);
|
s_formatInfos.push_back(info);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -122,7 +114,7 @@ ArchiveFile::ArchiveFile(const char* filename)
|
||||||
{
|
{
|
||||||
assert(!s_formatInfos.empty());
|
assert(!s_formatInfos.empty());
|
||||||
|
|
||||||
m_typeIndex = -1;
|
archiveType = NULL;
|
||||||
m_numItems = 0;
|
m_numItems = 0;
|
||||||
m_items = NULL;
|
m_items = NULL;
|
||||||
m_filename = NULL;
|
m_filename = NULL;
|
||||||
|
@ -144,52 +136,18 @@ ArchiveFile::ArchiveFile(const char* filename)
|
||||||
m_filename = new char[strlen(filename_utf8)+1];
|
m_filename = new char[strlen(filename_utf8)+1];
|
||||||
strcpy(m_filename, filename_utf8);
|
strcpy(m_filename, filename_utf8);
|
||||||
|
|
||||||
// detect archive type using format signature in file
|
fex_err_t err = fex_identify_file(&archiveType, filename);
|
||||||
for(size_t i = 0; i < s_formatInfos.size() && m_typeIndex < 0; i++)
|
|
||||||
|
//handle uncompressed files specially
|
||||||
|
if(!err)
|
||||||
{
|
{
|
||||||
for (size_t j = 0; j < s_formatInfos[i].signatures.size(); j++)
|
if(!strcmp(fex_type_name(archiveType),"file"))
|
||||||
{
|
archiveType = NULL;
|
||||||
fseek(file, 0, SEEK_SET);
|
|
||||||
|
|
||||||
std::string& formatSig = s_formatInfos[i].signatures[j];
|
|
||||||
int len = formatSig.size();
|
|
||||||
|
|
||||||
if(len == 0)
|
|
||||||
continue; // because some formats have no signature
|
|
||||||
|
|
||||||
char* fileSig = (char*)_alloca(len);
|
|
||||||
fread(fileSig, 1, len, file);
|
|
||||||
|
|
||||||
if(!memcmp(formatSig.c_str(), fileSig, len))
|
|
||||||
m_typeIndex = i;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// if no signature match has been found, detect archive type using filename.
|
if (err || archiveType == NULL)
|
||||||
// this is only for signature-less formats
|
|
||||||
const char* fileExt = strrchr(filename, '.');
|
|
||||||
if(fileExt++)
|
|
||||||
{
|
{
|
||||||
for(size_t i = 0; i < s_formatInfos.size() && m_typeIndex < 0; i++)
|
// uncompressed, we guess
|
||||||
{
|
|
||||||
if(s_formatInfos[i].signatures.empty())
|
|
||||||
{
|
|
||||||
std::vector<std::string>& formatExts = s_formatInfos[i].extensions;
|
|
||||||
for(size_t j = 0; j < formatExts.size(); j++)
|
|
||||||
{
|
|
||||||
if(!_stricmp(formatExts[j].c_str(), fileExt))
|
|
||||||
{
|
|
||||||
m_typeIndex = i;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(m_typeIndex < 0)
|
|
||||||
{
|
|
||||||
// uncompressed
|
|
||||||
|
|
||||||
m_numItems = 1;
|
m_numItems = 1;
|
||||||
m_items = new ArchiveItem[m_numItems];
|
m_items = new ArchiveItem[m_numItems];
|
||||||
|
@ -205,7 +163,7 @@ ArchiveFile::ArchiveFile(const char* filename)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
fex_t * object;
|
fex_t * object;
|
||||||
fex_err_t err = fex_open_type( &object, m_filename, s_formatInfos[m_typeIndex].type );
|
fex_err_t err = fex_open_type( &object, m_filename, archiveType );
|
||||||
if ( !err )
|
if ( !err )
|
||||||
{
|
{
|
||||||
int numItems = 0;
|
int numItems = 0;
|
||||||
|
@ -279,10 +237,10 @@ const char* ArchiveFile::GetArchiveTypeName()
|
||||||
{
|
{
|
||||||
assert(!s_formatInfos.empty());
|
assert(!s_formatInfos.empty());
|
||||||
|
|
||||||
if((size_t)m_typeIndex >= s_formatInfos.size())
|
if(archiveType == NULL)
|
||||||
return "";
|
return "";
|
||||||
|
|
||||||
return s_formatInfos[m_typeIndex].name.c_str();
|
return fex_type_name(archiveType);
|
||||||
}
|
}
|
||||||
|
|
||||||
int ArchiveFile::GetNumItems()
|
int ArchiveFile::GetNumItems()
|
||||||
|
@ -314,7 +272,7 @@ const wchar_t* ArchiveFile::GetItemNameW(int item)
|
||||||
|
|
||||||
bool ArchiveFile::IsCompressed()
|
bool ArchiveFile::IsCompressed()
|
||||||
{
|
{
|
||||||
return (m_typeIndex >= 0);
|
return archiveType != NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
int ArchiveFile::ExtractItem(int index, unsigned char* outBuffer, int bufSize) const
|
int ArchiveFile::ExtractItem(int index, unsigned char* outBuffer, int bufSize) const
|
||||||
|
@ -328,7 +286,7 @@ int ArchiveFile::ExtractItem(int index, unsigned char* outBuffer, int bufSize) c
|
||||||
if(bufSize < item.size)
|
if(bufSize < item.size)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if(m_typeIndex < 0)
|
if(archiveType == NULL)
|
||||||
{
|
{
|
||||||
// uncompressed
|
// uncompressed
|
||||||
FILE* file = fopen(m_filename, "rb");
|
FILE* file = fopen(m_filename, "rb");
|
||||||
|
@ -338,7 +296,7 @@ int ArchiveFile::ExtractItem(int index, unsigned char* outBuffer, int bufSize) c
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
fex_t * object;
|
fex_t * object;
|
||||||
fex_err_t err = fex_open_type( &object, m_filename, s_formatInfos[m_typeIndex].type );
|
fex_err_t err = fex_open_type( &object, m_filename, archiveType );
|
||||||
if ( !err )
|
if ( !err )
|
||||||
{
|
{
|
||||||
if ( index != 0 ) err = fex_seek_arc( object, item.offset );
|
if ( index != 0 ) err = fex_seek_arc( object, item.offset );
|
||||||
|
@ -375,7 +333,7 @@ int ArchiveFile::ExtractItem(int index, const char* outFilename) const
|
||||||
if(outAttributes & FILE_ATTRIBUTE_READONLY)
|
if(outAttributes & FILE_ATTRIBUTE_READONLY)
|
||||||
SetFileAttributes(outFilename, outAttributes & ~FILE_ATTRIBUTE_READONLY); // temporarily remove read-only attribute so we can decompress to there
|
SetFileAttributes(outFilename, outAttributes & ~FILE_ATTRIBUTE_READONLY); // temporarily remove read-only attribute so we can decompress to there
|
||||||
|
|
||||||
if(m_typeIndex < 0)
|
if(archiveType == NULL)
|
||||||
{
|
{
|
||||||
// uncompressed
|
// uncompressed
|
||||||
if(!CopyFile(m_filename, outFilename, false))
|
if(!CopyFile(m_filename, outFilename, false))
|
||||||
|
@ -384,7 +342,7 @@ int ArchiveFile::ExtractItem(int index, const char* outFilename) const
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
fex_t * object;
|
fex_t * object;
|
||||||
fex_err_t err = fex_open_type( &object, m_filename, s_formatInfos[m_typeIndex].type );
|
fex_err_t err = fex_open_type( &object, m_filename, archiveType );
|
||||||
if ( !err )
|
if ( !err )
|
||||||
{
|
{
|
||||||
if ( index != 0 ) err = fex_seek_arc( object, item.offset );
|
if ( index != 0 ) err = fex_seek_arc( object, item.offset );
|
||||||
|
|
|
@ -24,6 +24,8 @@
|
||||||
// NOTE: if you want to add support for opening files within archives to some part of DeSmuME,
|
// NOTE: if you want to add support for opening files within archives to some part of DeSmuME,
|
||||||
// consider using the higher-level interface provided by OpenArchive.h instead
|
// consider using the higher-level interface provided by OpenArchive.h instead
|
||||||
|
|
||||||
|
typedef const struct fex_type_t_* fex_type_t;
|
||||||
|
|
||||||
void InitDecoder();
|
void InitDecoder();
|
||||||
void CleanupDecoder();
|
void CleanupDecoder();
|
||||||
const char* GetSupportedFormatsFilter();
|
const char* GetSupportedFormatsFilter();
|
||||||
|
@ -56,7 +58,7 @@ protected:
|
||||||
};
|
};
|
||||||
ArchiveItem* m_items;
|
ArchiveItem* m_items;
|
||||||
int m_numItems;
|
int m_numItems;
|
||||||
int m_typeIndex;
|
fex_type_t archiveType;
|
||||||
char* m_filename;
|
char* m_filename;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -175,7 +175,7 @@ size_t SzArEx_GetFileNameUtf16(const CSzArEx *p, size_t fileIndex, UInt16 *dest)
|
||||||
SRes SzArEx_Extract(
|
SRes SzArEx_Extract(
|
||||||
const CSzArEx *db,
|
const CSzArEx *db,
|
||||||
ILookInStream *inStream,
|
ILookInStream *inStream,
|
||||||
UInt32 fileIndex, /* index of file */
|
UInt64 fileIndex, /* index of file */
|
||||||
UInt32 *blockIndex, /* index of solid block */
|
UInt32 *blockIndex, /* index of solid block */
|
||||||
Byte **outBuffer, /* pointer to pointer to output buffer (allocated with allocMain) */
|
Byte **outBuffer, /* pointer to pointer to output buffer (allocated with allocMain) */
|
||||||
size_t *outBufferSize, /* buffer size for output buffer */
|
size_t *outBufferSize, /* buffer size for output buffer */
|
||||||
|
|
|
@ -1322,7 +1322,7 @@ SRes SzArEx_Open(CSzArEx *p, ILookInStream *inStream, ISzAlloc *allocMain, ISzAl
|
||||||
SRes SzArEx_Extract(
|
SRes SzArEx_Extract(
|
||||||
const CSzArEx *p,
|
const CSzArEx *p,
|
||||||
ILookInStream *inStream,
|
ILookInStream *inStream,
|
||||||
UInt32 fileIndex,
|
UInt64 fileIndex,
|
||||||
UInt32 *blockIndex,
|
UInt32 *blockIndex,
|
||||||
Byte **outBuffer,
|
Byte **outBuffer,
|
||||||
size_t *outBufferSize,
|
size_t *outBufferSize,
|
||||||
|
|
|
@ -97,7 +97,7 @@ void MtSync_Destruct(CMtSync *p)
|
||||||
|
|
||||||
#define RINOK_THREAD(x) { if ((x) != 0) return SZ_ERROR_THREAD; }
|
#define RINOK_THREAD(x) { if ((x) != 0) return SZ_ERROR_THREAD; }
|
||||||
|
|
||||||
static SRes MtSync_Create2(CMtSync *p, unsigned (MY_STD_CALL *startAddress)(void *), void *obj, UInt32 numBlocks)
|
static SRes MtSync_Create2(CMtSync *p, THREAD_FUNC_RET_TYPE (MY_STD_CALL *startAddress)(void *), void *obj, UInt32 numBlocks)
|
||||||
{
|
{
|
||||||
if (p->wasCreated)
|
if (p->wasCreated)
|
||||||
return SZ_OK;
|
return SZ_OK;
|
||||||
|
@ -119,7 +119,7 @@ static SRes MtSync_Create2(CMtSync *p, unsigned (MY_STD_CALL *startAddress)(void
|
||||||
return SZ_OK;
|
return SZ_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
static SRes MtSync_Create(CMtSync *p, unsigned (MY_STD_CALL *startAddress)(void *), void *obj, UInt32 numBlocks)
|
static SRes MtSync_Create(CMtSync *p, THREAD_FUNC_RET_TYPE (MY_STD_CALL *startAddress)(void *), void *obj, UInt32 numBlocks)
|
||||||
{
|
{
|
||||||
SRes res = MtSync_Create2(p, startAddress, obj, numBlocks);
|
SRes res = MtSync_Create2(p, startAddress, obj, numBlocks);
|
||||||
if (res != SZ_OK)
|
if (res != SZ_OK)
|
||||||
|
@ -451,8 +451,8 @@ void MatchFinderMt_Destruct(CMatchFinderMt *p, ISzAlloc *alloc)
|
||||||
#define kHashBufferSize (kMtHashBlockSize * kMtHashNumBlocks)
|
#define kHashBufferSize (kMtHashBlockSize * kMtHashNumBlocks)
|
||||||
#define kBtBufferSize (kMtBtBlockSize * kMtBtNumBlocks)
|
#define kBtBufferSize (kMtBtBlockSize * kMtBtNumBlocks)
|
||||||
|
|
||||||
static unsigned MY_STD_CALL HashThreadFunc2(void *p) { HashThreadFunc((CMatchFinderMt *)p); return 0; }
|
static THREAD_FUNC_RET_TYPE MY_STD_CALL HashThreadFunc2(void *p) { HashThreadFunc((CMatchFinderMt *)p); return 0; }
|
||||||
static unsigned MY_STD_CALL BtThreadFunc2(void *p)
|
static THREAD_FUNC_RET_TYPE MY_STD_CALL BtThreadFunc2(void *p)
|
||||||
{
|
{
|
||||||
Byte allocaDummy[0x180];
|
Byte allocaDummy[0x180];
|
||||||
int i = 0;
|
int i = 0;
|
||||||
|
|
|
@ -25,12 +25,12 @@ static THREAD_FUNC_RET_TYPE THREAD_FUNC_CALL_TYPE LoopThreadFunc(void *pp)
|
||||||
for (;;)
|
for (;;)
|
||||||
{
|
{
|
||||||
if (Event_Wait(&p->startEvent) != 0)
|
if (Event_Wait(&p->startEvent) != 0)
|
||||||
return SZ_ERROR_THREAD;
|
return (THREAD_FUNC_RET_TYPE) SZ_ERROR_THREAD;
|
||||||
if (p->stop)
|
if (p->stop)
|
||||||
return 0;
|
return 0;
|
||||||
p->res = p->func(p->param);
|
p->res = p->func(p->param);
|
||||||
if (Event_Set(&p->finishedEvent) != 0)
|
if (Event_Set(&p->finishedEvent) != 0)
|
||||||
return SZ_ERROR_THREAD;
|
return (THREAD_FUNC_RET_TYPE) SZ_ERROR_THREAD;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -239,7 +239,7 @@ static THREAD_FUNC_RET_TYPE THREAD_FUNC_CALL_TYPE ThreadFunc(void *pp)
|
||||||
next->stopWriting = True;
|
next->stopWriting = True;
|
||||||
Event_Set(&next->canRead);
|
Event_Set(&next->canRead);
|
||||||
Event_Set(&next->canWrite);
|
Event_Set(&next->canWrite);
|
||||||
return res;
|
return (THREAD_FUNC_RET_TYPE) (long) res;
|
||||||
}
|
}
|
||||||
if (stop)
|
if (stop)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -1,59 +1,5 @@
|
||||||
/* Threads.h -- multithreading library
|
#ifdef _WIN32
|
||||||
2009-03-27 : Igor Pavlov : Public domain */
|
#include "win32/Threads.h"
|
||||||
|
#else
|
||||||
#ifndef __7Z_THREADS_H
|
#include "posix/Threads.h"
|
||||||
#define __7Z_THREADS_H
|
|
||||||
|
|
||||||
#include "Types.h"
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
WRes HandlePtr_Close(HANDLE *h);
|
|
||||||
WRes Handle_WaitObject(HANDLE h);
|
|
||||||
|
|
||||||
typedef HANDLE CThread;
|
|
||||||
#define Thread_Construct(p) *(p) = NULL
|
|
||||||
#define Thread_WasCreated(p) (*(p) != NULL)
|
|
||||||
#define Thread_Close(p) HandlePtr_Close(p)
|
|
||||||
#define Thread_Wait(p) Handle_WaitObject(*(p))
|
|
||||||
typedef unsigned THREAD_FUNC_RET_TYPE;
|
|
||||||
#define THREAD_FUNC_CALL_TYPE MY_STD_CALL
|
|
||||||
#define THREAD_FUNC_DECL THREAD_FUNC_RET_TYPE THREAD_FUNC_CALL_TYPE
|
|
||||||
typedef THREAD_FUNC_RET_TYPE (THREAD_FUNC_CALL_TYPE * THREAD_FUNC_TYPE)(void *);
|
|
||||||
WRes Thread_Create(CThread *p, THREAD_FUNC_TYPE func, LPVOID param);
|
|
||||||
|
|
||||||
typedef HANDLE CEvent;
|
|
||||||
typedef CEvent CAutoResetEvent;
|
|
||||||
typedef CEvent CManualResetEvent;
|
|
||||||
#define Event_Construct(p) *(p) = NULL
|
|
||||||
#define Event_IsCreated(p) (*(p) != NULL)
|
|
||||||
#define Event_Close(p) HandlePtr_Close(p)
|
|
||||||
#define Event_Wait(p) Handle_WaitObject(*(p))
|
|
||||||
WRes Event_Set(CEvent *p);
|
|
||||||
WRes Event_Reset(CEvent *p);
|
|
||||||
WRes ManualResetEvent_Create(CManualResetEvent *p, int signaled);
|
|
||||||
WRes ManualResetEvent_CreateNotSignaled(CManualResetEvent *p);
|
|
||||||
WRes AutoResetEvent_Create(CAutoResetEvent *p, int signaled);
|
|
||||||
WRes AutoResetEvent_CreateNotSignaled(CAutoResetEvent *p);
|
|
||||||
|
|
||||||
typedef HANDLE CSemaphore;
|
|
||||||
#define Semaphore_Construct(p) (*p) = NULL
|
|
||||||
#define Semaphore_Close(p) HandlePtr_Close(p)
|
|
||||||
#define Semaphore_Wait(p) Handle_WaitObject(*(p))
|
|
||||||
WRes Semaphore_Create(CSemaphore *p, UInt32 initCount, UInt32 maxCount);
|
|
||||||
WRes Semaphore_ReleaseN(CSemaphore *p, UInt32 num);
|
|
||||||
WRes Semaphore_Release1(CSemaphore *p);
|
|
||||||
|
|
||||||
typedef CRITICAL_SECTION CCriticalSection;
|
|
||||||
WRes CriticalSection_Init(CCriticalSection *p);
|
|
||||||
#define CriticalSection_Delete(p) DeleteCriticalSection(p)
|
|
||||||
#define CriticalSection_Enter(p) EnterCriticalSection(p)
|
|
||||||
#define CriticalSection_Leave(p) LeaveCriticalSection(p)
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -8,6 +8,16 @@
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
#else
|
||||||
|
|
||||||
|
typedef unsigned char BOOL;
|
||||||
|
#define FALSE 0
|
||||||
|
#define TRUE 1
|
||||||
|
|
||||||
|
typedef long LONG;
|
||||||
|
|
||||||
|
typedef void *LPVOID;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef EXTERN_C_BEGIN
|
#ifndef EXTERN_C_BEGIN
|
||||||
|
|
|
@ -0,0 +1,84 @@
|
||||||
|
/* Threads.c -- multithreading library
|
||||||
|
2009-09-20 : Igor Pavlov : Public domain */
|
||||||
|
|
||||||
|
#ifndef _WIN32_WCE
|
||||||
|
#include <process.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include "Threads.h"
|
||||||
|
|
||||||
|
static WRes GetError()
|
||||||
|
{
|
||||||
|
DWORD res = GetLastError();
|
||||||
|
return (res) ? (WRes)(res) : 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
WRes HandleToWRes(HANDLE h) { return (h != 0) ? 0 : GetError(); }
|
||||||
|
WRes BOOLToWRes(BOOL v) { return v ? 0 : GetError(); }
|
||||||
|
|
||||||
|
WRes HandlePtr_Close(HANDLE *p)
|
||||||
|
{
|
||||||
|
if (*p != NULL)
|
||||||
|
if (!CloseHandle(*p))
|
||||||
|
return GetError();
|
||||||
|
*p = NULL;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
WRes Handle_WaitObject(HANDLE h) { return (WRes)WaitForSingleObject(h, INFINITE); }
|
||||||
|
|
||||||
|
WRes Thread_Create(CThread *p, THREAD_FUNC_TYPE func, LPVOID param)
|
||||||
|
{
|
||||||
|
unsigned threadId; /* Windows Me/98/95: threadId parameter may not be NULL in _beginthreadex/CreateThread functions */
|
||||||
|
*p =
|
||||||
|
#ifdef UNDER_CE
|
||||||
|
CreateThread(0, 0, func, param, 0, &threadId);
|
||||||
|
#else
|
||||||
|
(HANDLE)_beginthreadex(NULL, 0, func, param, 0, &threadId);
|
||||||
|
#endif
|
||||||
|
/* maybe we must use errno here, but probably GetLastError() is also OK. */
|
||||||
|
return HandleToWRes(*p);
|
||||||
|
}
|
||||||
|
|
||||||
|
WRes Event_Create(CEvent *p, BOOL manualReset, int signaled)
|
||||||
|
{
|
||||||
|
*p = CreateEvent(NULL, manualReset, (signaled ? TRUE : FALSE), NULL);
|
||||||
|
return HandleToWRes(*p);
|
||||||
|
}
|
||||||
|
|
||||||
|
WRes Event_Set(CEvent *p) { return BOOLToWRes(SetEvent(*p)); }
|
||||||
|
WRes Event_Reset(CEvent *p) { return BOOLToWRes(ResetEvent(*p)); }
|
||||||
|
|
||||||
|
WRes ManualResetEvent_Create(CManualResetEvent *p, int signaled) { return Event_Create(p, TRUE, signaled); }
|
||||||
|
WRes AutoResetEvent_Create(CAutoResetEvent *p, int signaled) { return Event_Create(p, FALSE, signaled); }
|
||||||
|
WRes ManualResetEvent_CreateNotSignaled(CManualResetEvent *p) { return ManualResetEvent_Create(p, 0); }
|
||||||
|
WRes AutoResetEvent_CreateNotSignaled(CAutoResetEvent *p) { return AutoResetEvent_Create(p, 0); }
|
||||||
|
|
||||||
|
|
||||||
|
WRes Semaphore_Create(CSemaphore *p, UInt32 initCount, UInt32 maxCount)
|
||||||
|
{
|
||||||
|
*p = CreateSemaphore(NULL, (LONG)initCount, (LONG)maxCount, NULL);
|
||||||
|
return HandleToWRes(*p);
|
||||||
|
}
|
||||||
|
|
||||||
|
static WRes Semaphore_Release(CSemaphore *p, LONG releaseCount, LONG *previousCount)
|
||||||
|
{ return BOOLToWRes(ReleaseSemaphore(*p, releaseCount, previousCount)); }
|
||||||
|
WRes Semaphore_ReleaseN(CSemaphore *p, UInt32 num)
|
||||||
|
{ return Semaphore_Release(p, (LONG)num, NULL); }
|
||||||
|
WRes Semaphore_Release1(CSemaphore *p) { return Semaphore_ReleaseN(p, 1); }
|
||||||
|
|
||||||
|
WRes CriticalSection_Init(CCriticalSection *p)
|
||||||
|
{
|
||||||
|
/* InitializeCriticalSection can raise only STATUS_NO_MEMORY exception */
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
__try
|
||||||
|
#endif
|
||||||
|
{
|
||||||
|
InitializeCriticalSection(p);
|
||||||
|
/* InitializeCriticalSectionAndSpinCount(p, 0); */
|
||||||
|
}
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
__except (EXCEPTION_EXECUTE_HANDLER) { return 1; }
|
||||||
|
#endif
|
||||||
|
return 0;
|
||||||
|
}
|
|
@ -0,0 +1,59 @@
|
||||||
|
/* Threads.h -- multithreading library
|
||||||
|
2009-03-27 : Igor Pavlov : Public domain */
|
||||||
|
|
||||||
|
#ifndef __7Z_THREADS_H
|
||||||
|
#define __7Z_THREADS_H
|
||||||
|
|
||||||
|
#include "../Types.h"
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
WRes HandlePtr_Close(HANDLE *h);
|
||||||
|
WRes Handle_WaitObject(HANDLE h);
|
||||||
|
|
||||||
|
typedef HANDLE CThread;
|
||||||
|
#define Thread_Construct(p) *(p) = NULL
|
||||||
|
#define Thread_WasCreated(p) (*(p) != NULL)
|
||||||
|
#define Thread_Close(p) HandlePtr_Close(p)
|
||||||
|
#define Thread_Wait(p) Handle_WaitObject(*(p))
|
||||||
|
typedef unsigned THREAD_FUNC_RET_TYPE;
|
||||||
|
#define THREAD_FUNC_CALL_TYPE MY_STD_CALL
|
||||||
|
#define THREAD_FUNC_DECL THREAD_FUNC_RET_TYPE THREAD_FUNC_CALL_TYPE
|
||||||
|
typedef THREAD_FUNC_RET_TYPE (THREAD_FUNC_CALL_TYPE * THREAD_FUNC_TYPE)(void *);
|
||||||
|
WRes Thread_Create(CThread *p, THREAD_FUNC_TYPE func, LPVOID param);
|
||||||
|
|
||||||
|
typedef HANDLE CEvent;
|
||||||
|
typedef CEvent CAutoResetEvent;
|
||||||
|
typedef CEvent CManualResetEvent;
|
||||||
|
#define Event_Construct(p) *(p) = NULL
|
||||||
|
#define Event_IsCreated(p) (*(p) != NULL)
|
||||||
|
#define Event_Close(p) HandlePtr_Close(p)
|
||||||
|
#define Event_Wait(p) Handle_WaitObject(*(p))
|
||||||
|
WRes Event_Set(CEvent *p);
|
||||||
|
WRes Event_Reset(CEvent *p);
|
||||||
|
WRes ManualResetEvent_Create(CManualResetEvent *p, int signaled);
|
||||||
|
WRes ManualResetEvent_CreateNotSignaled(CManualResetEvent *p);
|
||||||
|
WRes AutoResetEvent_Create(CAutoResetEvent *p, int signaled);
|
||||||
|
WRes AutoResetEvent_CreateNotSignaled(CAutoResetEvent *p);
|
||||||
|
|
||||||
|
typedef HANDLE CSemaphore;
|
||||||
|
#define Semaphore_Construct(p) (*p) = NULL
|
||||||
|
#define Semaphore_Close(p) HandlePtr_Close(p)
|
||||||
|
#define Semaphore_Wait(p) Handle_WaitObject(*(p))
|
||||||
|
WRes Semaphore_Create(CSemaphore *p, UInt32 initCount, UInt32 maxCount);
|
||||||
|
WRes Semaphore_ReleaseN(CSemaphore *p, UInt32 num);
|
||||||
|
WRes Semaphore_Release1(CSemaphore *p);
|
||||||
|
|
||||||
|
typedef CRITICAL_SECTION CCriticalSection;
|
||||||
|
WRes CriticalSection_Init(CCriticalSection *p);
|
||||||
|
#define CriticalSection_Delete(p) DeleteCriticalSection(p)
|
||||||
|
#define CriticalSection_Enter(p) EnterCriticalSection(p)
|
||||||
|
#define CriticalSection_Leave(p) LeaveCriticalSection(p)
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif
|
|
@ -24,7 +24,6 @@ static File_Extractor* new_binary()
|
||||||
|
|
||||||
fex_type_t_ const fex_bin_type [1] = {{
|
fex_type_t_ const fex_bin_type [1] = {{
|
||||||
"",
|
"",
|
||||||
{ NULL },
|
|
||||||
&new_binary,
|
&new_binary,
|
||||||
"file",
|
"file",
|
||||||
NULL
|
NULL
|
||||||
|
@ -72,7 +71,7 @@ blargg_err_t Binary_Extractor::stat_v()
|
||||||
return open_v();
|
return open_v();
|
||||||
}
|
}
|
||||||
|
|
||||||
blargg_err_t Binary_Extractor::extract_v( void* p, int n )
|
blargg_err_t Binary_Extractor::extract_v( void* p, long n )
|
||||||
{
|
{
|
||||||
return arc().read( p, n );
|
return arc().read( p, n );
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,7 +20,7 @@ protected:
|
||||||
virtual blargg_err_t rewind_v();
|
virtual blargg_err_t rewind_v();
|
||||||
|
|
||||||
virtual blargg_err_t stat_v();
|
virtual blargg_err_t stat_v();
|
||||||
virtual blargg_err_t extract_v( void*, int );
|
virtual blargg_err_t extract_v( void*, long );
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -6,10 +6,6 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|
||||||
#if BLARGG_UTF8_PATHS
|
|
||||||
#include <windows.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Copyright (C) 2005-2009 Shay Green. This module is free software; you
|
/* Copyright (C) 2005-2009 Shay Green. This module is free software; you
|
||||||
can redistribute it and/or modify it under the terms of the GNU Lesser
|
can redistribute it and/or modify it under the terms of the GNU Lesser
|
||||||
General Public License as published by the Free Software Foundation; either
|
General Public License as published by the Free Software Foundation; either
|
||||||
|
@ -25,7 +21,7 @@ Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */
|
||||||
|
|
||||||
// Data_Reader
|
// Data_Reader
|
||||||
|
|
||||||
blargg_err_t Data_Reader::read( void* p, int n )
|
blargg_err_t Data_Reader::read( void* p, long n )
|
||||||
{
|
{
|
||||||
assert( n >= 0 );
|
assert( n >= 0 );
|
||||||
|
|
||||||
|
@ -49,7 +45,7 @@ blargg_err_t Data_Reader::read_avail( void* p, int* n_ )
|
||||||
{
|
{
|
||||||
assert( *n_ >= 0 );
|
assert( *n_ >= 0 );
|
||||||
|
|
||||||
int n = min( (BOOST::uint64_t)(*n_), remain() );
|
long n = (long) min( (BOOST::uint64_t)(*n_), remain() );
|
||||||
*n_ = 0;
|
*n_ = 0;
|
||||||
|
|
||||||
if ( n < 0 )
|
if ( n < 0 )
|
||||||
|
@ -62,7 +58,7 @@ blargg_err_t Data_Reader::read_avail( void* p, int* n_ )
|
||||||
if ( !err )
|
if ( !err )
|
||||||
{
|
{
|
||||||
remain_ -= n;
|
remain_ -= n;
|
||||||
*n_ = n;
|
*n_ = (int) n;
|
||||||
}
|
}
|
||||||
|
|
||||||
return err;
|
return err;
|
||||||
|
@ -76,19 +72,19 @@ blargg_err_t Data_Reader::read_avail( void* p, long* n )
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
blargg_err_t Data_Reader::skip_v( int count )
|
blargg_err_t Data_Reader::skip_v( BOOST::uint64_t count )
|
||||||
{
|
{
|
||||||
char buf [512];
|
char buf [512];
|
||||||
while ( count )
|
while ( count )
|
||||||
{
|
{
|
||||||
int n = min( count, (int) sizeof buf );
|
BOOST::uint64_t n = min( count, (BOOST::uint64_t) sizeof buf );
|
||||||
count -= n;
|
count -= n;
|
||||||
RETURN_ERR( read_v( buf, n ) );
|
RETURN_ERR( read_v( buf, (long)n ) );
|
||||||
}
|
}
|
||||||
return blargg_ok;
|
return blargg_ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
blargg_err_t Data_Reader::skip( int n )
|
blargg_err_t Data_Reader::skip( long n )
|
||||||
{
|
{
|
||||||
assert( n >= 0 );
|
assert( n >= 0 );
|
||||||
|
|
||||||
|
@ -115,9 +111,6 @@ blargg_err_t File_Reader::seek( BOOST::uint64_t n )
|
||||||
{
|
{
|
||||||
assert( n >= 0 );
|
assert( n >= 0 );
|
||||||
|
|
||||||
if ( n < 0 )
|
|
||||||
return blargg_err_caller;
|
|
||||||
|
|
||||||
if ( n == tell() )
|
if ( n == tell() )
|
||||||
return blargg_ok;
|
return blargg_ok;
|
||||||
|
|
||||||
|
@ -145,7 +138,7 @@ Subset_Reader::Subset_Reader( Data_Reader* dr, BOOST::uint64_t size ) :
|
||||||
set_remain( min( size, dr->remain() ) );
|
set_remain( min( size, dr->remain() ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
blargg_err_t Subset_Reader::read_v( void* p, int s )
|
blargg_err_t Subset_Reader::read_v( void* p, long s )
|
||||||
{
|
{
|
||||||
return in->read( p, s );
|
return in->read( p, s );
|
||||||
}
|
}
|
||||||
|
@ -162,9 +155,9 @@ Remaining_Reader::Remaining_Reader( void const* h, int size, Data_Reader* r ) :
|
||||||
set_remain( size + r->remain() );
|
set_remain( size + r->remain() );
|
||||||
}
|
}
|
||||||
|
|
||||||
blargg_err_t Remaining_Reader::read_v( void* out, int count )
|
blargg_err_t Remaining_Reader::read_v( void* out, long count )
|
||||||
{
|
{
|
||||||
int first = min( count, header_remain );
|
long first = min( count, header_remain );
|
||||||
if ( first )
|
if ( first )
|
||||||
{
|
{
|
||||||
memcpy( out, header, first );
|
memcpy( out, header, first );
|
||||||
|
@ -184,13 +177,13 @@ Mem_File_Reader::Mem_File_Reader( const void* p, long s ) :
|
||||||
set_size( s );
|
set_size( s );
|
||||||
}
|
}
|
||||||
|
|
||||||
blargg_err_t Mem_File_Reader::read_v( void* p, int s )
|
blargg_err_t Mem_File_Reader::read_v( void* p, long s )
|
||||||
{
|
{
|
||||||
memcpy( p, begin + tell(), s );
|
memcpy( p, begin + tell(), s );
|
||||||
return blargg_ok;
|
return blargg_ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
blargg_err_t Mem_File_Reader::seek_v( int )
|
blargg_err_t Mem_File_Reader::seek_v( BOOST::uint64_t )
|
||||||
{
|
{
|
||||||
return blargg_ok;
|
return blargg_ok;
|
||||||
}
|
}
|
||||||
|
@ -205,7 +198,7 @@ Callback_Reader::Callback_Reader( callback_t c, BOOST::uint64_t s, void* d ) :
|
||||||
set_remain( s );
|
set_remain( s );
|
||||||
}
|
}
|
||||||
|
|
||||||
blargg_err_t Callback_Reader::read_v( void* out, int count )
|
blargg_err_t Callback_Reader::read_v( void* out, long count )
|
||||||
{
|
{
|
||||||
return callback( user_data, out, count );
|
return callback( user_data, out, count );
|
||||||
}
|
}
|
||||||
|
@ -220,12 +213,12 @@ Callback_File_Reader::Callback_File_Reader( callback_t c, BOOST::uint64_t s, voi
|
||||||
set_size( s );
|
set_size( s );
|
||||||
}
|
}
|
||||||
|
|
||||||
blargg_err_t Callback_File_Reader::read_v( void* out, int count )
|
blargg_err_t Callback_File_Reader::read_v( void* out, long count )
|
||||||
{
|
{
|
||||||
return callback( user_data, out, count, tell() );
|
return callback( user_data, out, count, tell() );
|
||||||
}
|
}
|
||||||
|
|
||||||
blargg_err_t Callback_File_Reader::seek_v( int )
|
blargg_err_t Callback_File_Reader::seek_v( BOOST::uint64_t )
|
||||||
{
|
{
|
||||||
return blargg_ok;
|
return blargg_ok;
|
||||||
}
|
}
|
||||||
|
@ -236,8 +229,6 @@ static const BOOST::uint8_t val_tab[6]={0,0xC0,0xE0,0xF0,0xF8,0xFC};
|
||||||
|
|
||||||
size_t utf8_char_len_from_header( char p_c )
|
size_t utf8_char_len_from_header( char p_c )
|
||||||
{
|
{
|
||||||
BOOST::uint8_t c = (BOOST::uint8_t)p_c;
|
|
||||||
|
|
||||||
size_t cnt = 0;
|
size_t cnt = 0;
|
||||||
for(;;)
|
for(;;)
|
||||||
{
|
{
|
||||||
|
@ -349,11 +340,11 @@ size_t utf8_encode_char( unsigned wide, char * target )
|
||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t utf16_encode_char( unsigned cur_wchar, wchar_t * out )
|
size_t utf16_encode_char( unsigned cur_wchar, blargg_wchar_t * out )
|
||||||
{
|
{
|
||||||
if ( cur_wchar < 0x10000 )
|
if ( cur_wchar < 0x10000 )
|
||||||
{
|
{
|
||||||
if ( out ) *out = (wchar_t) cur_wchar; return 1;
|
if ( out ) *out = (blargg_wchar_t) cur_wchar; return 1;
|
||||||
}
|
}
|
||||||
else if ( cur_wchar < ( 1 << 20 ) )
|
else if ( cur_wchar < ( 1 << 20 ) )
|
||||||
{
|
{
|
||||||
|
@ -362,8 +353,8 @@ size_t utf16_encode_char( unsigned cur_wchar, wchar_t * out )
|
||||||
//The first (high) surrogate is a 16-bit code value in the range U+D800 to U+DBFF. The second (low) surrogate is a 16-bit code value in the range U+DC00 to U+DFFF. Using surrogates, Unicode can support over one million characters. For more details about surrogates, refer to The Unicode Standard, version 2.0.
|
//The first (high) surrogate is a 16-bit code value in the range U+D800 to U+DBFF. The second (low) surrogate is a 16-bit code value in the range U+DC00 to U+DFFF. Using surrogates, Unicode can support over one million characters. For more details about surrogates, refer to The Unicode Standard, version 2.0.
|
||||||
if ( out )
|
if ( out )
|
||||||
{
|
{
|
||||||
out[0] = ( wchar_t )( 0xD800 | ( 0x3FF & ( c >> 10 ) ) );
|
out[0] = ( blargg_wchar_t )( 0xD800 | ( 0x3FF & ( c >> 10 ) ) );
|
||||||
out[1] = ( wchar_t )( 0xDC00 | ( 0x3FF & c ) ) ;
|
out[1] = ( blargg_wchar_t )( 0xDC00 | ( 0x3FF & c ) ) ;
|
||||||
}
|
}
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
|
@ -373,7 +364,7 @@ size_t utf16_encode_char( unsigned cur_wchar, wchar_t * out )
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t utf16_decode_char( const wchar_t * p_source, unsigned * p_out, size_t p_source_length )
|
size_t utf16_decode_char( const blargg_wchar_t * p_source, unsigned * p_out, size_t p_source_length )
|
||||||
{
|
{
|
||||||
if ( p_source_length == 0 ) return 0;
|
if ( p_source_length == 0 ) return 0;
|
||||||
else if ( p_source_length == 1 )
|
else if ( p_source_length == 1 )
|
||||||
|
@ -404,13 +395,13 @@ size_t utf16_decode_char( const wchar_t * p_source, unsigned * p_out, size_t p_s
|
||||||
}
|
}
|
||||||
|
|
||||||
// Converts wide-character path to UTF-8. Free result with free(). Only supported on Windows.
|
// Converts wide-character path to UTF-8. Free result with free(). Only supported on Windows.
|
||||||
char* blargg_to_utf8( const wchar_t* wpath )
|
char* blargg_to_utf8( const blargg_wchar_t* wpath )
|
||||||
{
|
{
|
||||||
if ( wpath == NULL )
|
if ( wpath == NULL )
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
size_t needed = 0;
|
size_t needed = 0;
|
||||||
size_t mmax = wcslen( wpath );
|
size_t mmax = blargg_wcslen( wpath );
|
||||||
if ( mmax <= 0 )
|
if ( mmax <= 0 )
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
@ -452,7 +443,7 @@ char* blargg_to_utf8( const wchar_t* wpath )
|
||||||
}
|
}
|
||||||
|
|
||||||
// Converts UTF-8 path to wide-character. Free result with free() Only supported on Windows.
|
// Converts UTF-8 path to wide-character. Free result with free() Only supported on Windows.
|
||||||
wchar_t* blargg_to_wide( const char* path )
|
blargg_wchar_t* blargg_to_wide( const char* path )
|
||||||
{
|
{
|
||||||
if ( path == NULL )
|
if ( path == NULL )
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -474,7 +465,7 @@ wchar_t* blargg_to_wide( const char* path )
|
||||||
if ( needed <= 0 )
|
if ( needed <= 0 )
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
wchar_t* wpath = (wchar_t*) calloc( needed + 1, sizeof *wpath );
|
blargg_wchar_t* wpath = (blargg_wchar_t*) calloc( needed + 1, sizeof *wpath );
|
||||||
if ( wpath == NULL )
|
if ( wpath == NULL )
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
@ -503,15 +494,19 @@ wchar_t* blargg_to_wide( const char* path )
|
||||||
static FILE* blargg_fopen( const char path [], const char mode [] )
|
static FILE* blargg_fopen( const char path [], const char mode [] )
|
||||||
{
|
{
|
||||||
FILE* file = NULL;
|
FILE* file = NULL;
|
||||||
wchar_t* wmode = NULL;
|
blargg_wchar_t* wmode = NULL;
|
||||||
wchar_t* wpath = NULL;
|
blargg_wchar_t* wpath = NULL;
|
||||||
|
|
||||||
wpath = blargg_to_wide( path );
|
wpath = blargg_to_wide( path );
|
||||||
if ( wpath )
|
if ( wpath )
|
||||||
{
|
{
|
||||||
wmode = blargg_to_wide( mode );
|
wmode = blargg_to_wide( mode );
|
||||||
if (wmode)
|
if (wmode)
|
||||||
|
#if _MSC_VER >= 1300
|
||||||
|
errno = _wfopen_s(&file, wpath, wmode);
|
||||||
|
#else
|
||||||
file = _wfopen( wpath, wmode );
|
file = _wfopen( wpath, wmode );
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
// Save and restore errno in case free() clears it
|
// Save and restore errno in case free() clears it
|
||||||
|
@ -603,11 +598,21 @@ blargg_err_t Std_File_Reader::open( const char path [] )
|
||||||
|
|
||||||
void Std_File_Reader::make_unbuffered()
|
void Std_File_Reader::make_unbuffered()
|
||||||
{
|
{
|
||||||
|
#ifdef _WIN32
|
||||||
|
BOOST::uint64_t offset = _ftelli64( STATIC_CAST(FILE*, file_) );
|
||||||
|
#else
|
||||||
|
BOOST::uint64_t offset = ftello( STATIC_CAST(FILE*, file_) );
|
||||||
|
#endif
|
||||||
if ( setvbuf( STATIC_CAST(FILE*, file_), NULL, _IONBF, 0 ) )
|
if ( setvbuf( STATIC_CAST(FILE*, file_), NULL, _IONBF, 0 ) )
|
||||||
check( false ); // shouldn't fail, but OK if it does
|
check( false ); // shouldn't fail, but OK if it does
|
||||||
|
#ifdef _WIN32
|
||||||
|
_fseeki64( STATIC_CAST(FILE*, file_), offset, SEEK_SET );
|
||||||
|
#else
|
||||||
|
fseeko( STATIC_CAST(FILE*, file_), offset, SEEK_SET );
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
blargg_err_t Std_File_Reader::read_v( void* p, int s )
|
blargg_err_t Std_File_Reader::read_v( void* p, long s )
|
||||||
{
|
{
|
||||||
if ( (size_t) s != fread( p, 1, s, STATIC_CAST(FILE*, file_) ) )
|
if ( (size_t) s != fread( p, 1, s, STATIC_CAST(FILE*, file_) ) )
|
||||||
{
|
{
|
||||||
|
@ -622,7 +627,11 @@ blargg_err_t Std_File_Reader::read_v( void* p, int s )
|
||||||
|
|
||||||
blargg_err_t Std_File_Reader::seek_v( BOOST::uint64_t n )
|
blargg_err_t Std_File_Reader::seek_v( BOOST::uint64_t n )
|
||||||
{
|
{
|
||||||
|
#ifdef _WIN32
|
||||||
if ( _fseeki64( STATIC_CAST(FILE*, file_), n, SEEK_SET ) )
|
if ( _fseeki64( STATIC_CAST(FILE*, file_), n, SEEK_SET ) )
|
||||||
|
#else
|
||||||
|
if ( fseeko( STATIC_CAST(FILE*, file_), n, SEEK_SET ) )
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
// Data_Reader's wrapper should prevent EOF
|
// Data_Reader's wrapper should prevent EOF
|
||||||
check( !feof( STATIC_CAST(FILE*, file_) ) );
|
check( !feof( STATIC_CAST(FILE*, file_) ) );
|
||||||
|
@ -729,24 +738,30 @@ static blargg_err_t convert_gz_error( gzFile file )
|
||||||
return blargg_err_internal;
|
return blargg_err_internal;
|
||||||
}
|
}
|
||||||
|
|
||||||
blargg_err_t Gzip_File_Reader::read_v( void* p, int s )
|
blargg_err_t Gzip_File_Reader::read_v( void* p, long s )
|
||||||
{
|
{
|
||||||
int result = gzread( file_, p, s );
|
while ( s > 0 )
|
||||||
if ( result != s )
|
{
|
||||||
|
int s_i = (int)( s > INT_MAX ? INT_MAX : s );
|
||||||
|
int result = gzread( (gzFile) file_, p, s_i );
|
||||||
|
if ( result != s_i )
|
||||||
{
|
{
|
||||||
if ( result < 0 )
|
if ( result < 0 )
|
||||||
return convert_gz_error( file_ );
|
return convert_gz_error( (gzFile) file_ );
|
||||||
|
|
||||||
return blargg_err_file_corrupt;
|
return blargg_err_file_corrupt;
|
||||||
}
|
}
|
||||||
|
p = (char*)p + result;
|
||||||
|
s -= result;
|
||||||
|
}
|
||||||
|
|
||||||
return blargg_ok;
|
return blargg_ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
blargg_err_t Gzip_File_Reader::seek_v( int n )
|
blargg_err_t Gzip_File_Reader::seek_v( BOOST::uint64_t n )
|
||||||
{
|
{
|
||||||
if ( gzseek( file_, n, SEEK_SET ) < 0 )
|
if ( gzseek( (gzFile) file_, (long)n, SEEK_SET ) < 0 )
|
||||||
return convert_gz_error( file_ );
|
return convert_gz_error( (gzFile) file_ );
|
||||||
|
|
||||||
return blargg_ok;
|
return blargg_ok;
|
||||||
}
|
}
|
||||||
|
@ -755,7 +770,7 @@ void Gzip_File_Reader::close()
|
||||||
{
|
{
|
||||||
if ( file_ )
|
if ( file_ )
|
||||||
{
|
{
|
||||||
if ( gzclose( file_ ) )
|
if ( gzclose( (gzFile) file_ ) )
|
||||||
check( false );
|
check( false );
|
||||||
file_ = NULL;
|
file_ = NULL;
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,13 +26,13 @@ public:
|
||||||
|
|
||||||
// Reads exactly n bytes, or returns error if they couldn't ALL be read.
|
// Reads exactly n bytes, or returns error if they couldn't ALL be read.
|
||||||
// Reading past end of file results in blargg_err_file_eof.
|
// Reading past end of file results in blargg_err_file_eof.
|
||||||
blargg_err_t read( void* p, int n );
|
blargg_err_t read( void* p, long n );
|
||||||
|
|
||||||
// Number of bytes remaining until end of file
|
// Number of bytes remaining until end of file
|
||||||
BOOST::uint64_t remain() const { return remain_; }
|
BOOST::uint64_t remain() const { return remain_; }
|
||||||
|
|
||||||
// Reads and discards n bytes. Skipping past end of file results in blargg_err_file_eof.
|
// Reads and discards n bytes. Skipping past end of file results in blargg_err_file_eof.
|
||||||
blargg_err_t skip( int n );
|
blargg_err_t skip( long n );
|
||||||
|
|
||||||
virtual ~Data_Reader() { }
|
virtual ~Data_Reader() { }
|
||||||
|
|
||||||
|
@ -50,12 +50,12 @@ protected:
|
||||||
|
|
||||||
// Do same as read(). Guaranteed that 0 < n <= remain(). Value of remain() is updated
|
// Do same as read(). Guaranteed that 0 < n <= remain(). Value of remain() is updated
|
||||||
// AFTER this call succeeds, not before. set_remain() should NOT be called from this.
|
// AFTER this call succeeds, not before. set_remain() should NOT be called from this.
|
||||||
virtual blargg_err_t read_v( void*, int n ) BLARGG_PURE( { (void)n; return blargg_ok; } )
|
virtual blargg_err_t read_v( void*, long n ) BLARGG_PURE( { (void)n; return blargg_ok; } )
|
||||||
|
|
||||||
// Do same as skip(). Guaranteed that 0 < n <= remain(). Default just reads data
|
// Do same as skip(). Guaranteed that 0 < n <= remain(). Default just reads data
|
||||||
// and discards it. Value of remain() is updated AFTER this call succeeds, not
|
// and discards it. Value of remain() is updated AFTER this call succeeds, not
|
||||||
// before. set_remain() should NOT be called from this.
|
// before. set_remain() should NOT be called from this.
|
||||||
virtual blargg_err_t skip_v( int n );
|
virtual blargg_err_t skip_v( BOOST::uint64_t n );
|
||||||
|
|
||||||
// Implementation
|
// Implementation
|
||||||
public:
|
public:
|
||||||
|
@ -126,7 +126,7 @@ public:
|
||||||
virtual ~Std_File_Reader();
|
virtual ~Std_File_Reader();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual blargg_err_t read_v( void*, int );
|
virtual blargg_err_t read_v( void*, long );
|
||||||
virtual blargg_err_t seek_v( BOOST::uint64_t );
|
virtual blargg_err_t seek_v( BOOST::uint64_t );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -142,8 +142,8 @@ public:
|
||||||
|
|
||||||
// Implementation
|
// Implementation
|
||||||
protected:
|
protected:
|
||||||
virtual blargg_err_t read_v( void*, int );
|
virtual blargg_err_t read_v( void*, long );
|
||||||
virtual blargg_err_t seek_v( int );
|
virtual blargg_err_t seek_v( BOOST::uint64_t );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
const char* const begin;
|
const char* const begin;
|
||||||
|
@ -158,7 +158,7 @@ public:
|
||||||
|
|
||||||
// Implementation
|
// Implementation
|
||||||
protected:
|
protected:
|
||||||
virtual blargg_err_t read_v( void*, int );
|
virtual blargg_err_t read_v( void*, long );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Data_Reader* const in;
|
Data_Reader* const in;
|
||||||
|
@ -175,12 +175,12 @@ public:
|
||||||
|
|
||||||
// Implementation
|
// Implementation
|
||||||
protected:
|
protected:
|
||||||
virtual blargg_err_t read_v( void*, int );
|
virtual blargg_err_t read_v( void*, long );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Data_Reader* const in;
|
Data_Reader* const in;
|
||||||
void const* header;
|
void const* header;
|
||||||
int header_remain;
|
long header_remain;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -189,7 +189,7 @@ extern "C" { // necessary to be usable from C
|
||||||
typedef const char* (*callback_reader_func_t)(
|
typedef const char* (*callback_reader_func_t)(
|
||||||
void* user_data, // Same value passed to constructor
|
void* user_data, // Same value passed to constructor
|
||||||
void* out, // Buffer to place data into
|
void* out, // Buffer to place data into
|
||||||
int count // Number of bytes to read
|
long count // Number of bytes to read
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
class Callback_Reader : public Data_Reader {
|
class Callback_Reader : public Data_Reader {
|
||||||
|
@ -199,7 +199,7 @@ public:
|
||||||
|
|
||||||
// Implementation
|
// Implementation
|
||||||
protected:
|
protected:
|
||||||
virtual blargg_err_t read_v( void*, int );
|
virtual blargg_err_t read_v( void*, long );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
callback_t const callback;
|
callback_t const callback;
|
||||||
|
@ -212,7 +212,7 @@ extern "C" { // necessary to be usable from C
|
||||||
typedef const char* (*callback_file_reader_func_t)(
|
typedef const char* (*callback_file_reader_func_t)(
|
||||||
void* user_data, // Same value passed to constructor
|
void* user_data, // Same value passed to constructor
|
||||||
void* out, // Buffer to place data into
|
void* out, // Buffer to place data into
|
||||||
int count, // Number of bytes to read
|
long count, // Number of bytes to read
|
||||||
BOOST::uint64_t pos // Position in file to read from
|
BOOST::uint64_t pos // Position in file to read from
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -223,8 +223,8 @@ public:
|
||||||
|
|
||||||
// Implementation
|
// Implementation
|
||||||
protected:
|
protected:
|
||||||
virtual blargg_err_t read_v( void*, int );
|
virtual blargg_err_t read_v( void*, long );
|
||||||
virtual blargg_err_t seek_v( int );
|
virtual blargg_err_t seek_v( BOOST::uint64_t );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
callback_t const callback;
|
callback_t const callback;
|
||||||
|
@ -250,8 +250,8 @@ public:
|
||||||
~Gzip_File_Reader();
|
~Gzip_File_Reader();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual blargg_err_t read_v( void*, int );
|
virtual blargg_err_t read_v( void*, long );
|
||||||
virtual blargg_err_t seek_v( int );
|
virtual blargg_err_t seek_v( BOOST::uint64_t );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// void* so "zlib.h" doesn't have to be included here
|
// void* so "zlib.h" doesn't have to be included here
|
||||||
|
@ -259,7 +259,16 @@ private:
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
char* blargg_to_utf8( const wchar_t* );
|
#ifdef _WIN32
|
||||||
wchar_t* blargg_to_wide( const char* );
|
typedef wchar_t blargg_wchar_t;
|
||||||
|
#elif defined(HAVE_STDINT_H)
|
||||||
|
#include <stdint.h>
|
||||||
|
typedef uint16_t blargg_wchar_t;
|
||||||
|
#else
|
||||||
|
typedef unsigned short blargg_wchar_t;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
char* blargg_to_utf8( const blargg_wchar_t* );
|
||||||
|
blargg_wchar_t* blargg_to_wide( const char* );
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -152,7 +152,7 @@ void File_Extractor::clear_file()
|
||||||
clear_file_v();
|
clear_file_v();
|
||||||
}
|
}
|
||||||
|
|
||||||
void File_Extractor::set_name( const char new_name [], const wchar_t* new_wname )
|
void File_Extractor::set_name( const char new_name [], const blargg_wchar_t* new_wname )
|
||||||
{
|
{
|
||||||
name_ = new_name;
|
name_ = new_name;
|
||||||
wname_ = new_wname;
|
wname_ = new_wname;
|
||||||
|
@ -313,7 +313,7 @@ blargg_err_t File_Extractor::data( const void** data_out )
|
||||||
|
|
||||||
blargg_err_t File_Extractor::data_v( void const** out )
|
blargg_err_t File_Extractor::data_v( void const** out )
|
||||||
{
|
{
|
||||||
RETURN_ERR( own_data_.resize( size() ) );
|
RETURN_ERR( own_data_.resize( (size_t) size() ) );
|
||||||
*out = own_data_.begin();
|
*out = own_data_.begin();
|
||||||
|
|
||||||
blargg_err_t err = extract_v( own_data_.begin(), own_data_.size() );
|
blargg_err_t err = extract_v( own_data_.begin(), own_data_.size() );
|
||||||
|
@ -323,7 +323,7 @@ blargg_err_t File_Extractor::data_v( void const** out )
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
blargg_err_t File_Extractor::extract_v( void* out, int count )
|
blargg_err_t File_Extractor::extract_v( void* out, long count )
|
||||||
{
|
{
|
||||||
void const* p;
|
void const* p;
|
||||||
RETURN_ERR( data( &p ) );
|
RETURN_ERR( data( &p ) );
|
||||||
|
@ -332,7 +332,7 @@ blargg_err_t File_Extractor::extract_v( void* out, int count )
|
||||||
return blargg_ok;
|
return blargg_ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
blargg_err_t File_Extractor::read_v( void* out, int count )
|
blargg_err_t File_Extractor::read_v( void* out, long count )
|
||||||
{
|
{
|
||||||
if ( data_ptr_ )
|
if ( data_ptr_ )
|
||||||
return File_Extractor::extract_v( out, count );
|
return File_Extractor::extract_v( out, count );
|
||||||
|
|
|
@ -39,7 +39,7 @@ public:
|
||||||
|
|
||||||
// See fex.h
|
// See fex.h
|
||||||
const char* name() const { return name_; }
|
const char* name() const { return name_; }
|
||||||
const wchar_t* wname() const { return wname_; }
|
const blargg_wchar_t* wname() const { return wname_; }
|
||||||
blargg_err_t stat();
|
blargg_err_t stat();
|
||||||
BOOST::uint64_t size() const { assert( stat_called ); return size_; }
|
BOOST::uint64_t size() const { assert( stat_called ); return size_; }
|
||||||
unsigned int dos_date() const { return date_; }
|
unsigned int dos_date() const { return date_; }
|
||||||
|
@ -73,7 +73,7 @@ protected:
|
||||||
File_Reader& arc() const { return *reader_; }
|
File_Reader& arc() const { return *reader_; }
|
||||||
|
|
||||||
// Sets current file name
|
// Sets current file name
|
||||||
void set_name( const char name [], const wchar_t* wname = NULL );
|
void set_name( const char name [], const blargg_wchar_t* wname = NULL );
|
||||||
|
|
||||||
// Sets current file information
|
// Sets current file information
|
||||||
void set_info( BOOST::uint64_t size, unsigned date = 0, unsigned crc = 0 );
|
void set_info( BOOST::uint64_t size, unsigned date = 0, unsigned crc = 0 );
|
||||||
|
@ -118,7 +118,7 @@ protected:
|
||||||
virtual blargg_err_t data_v( const void** out );
|
virtual blargg_err_t data_v( const void** out );
|
||||||
|
|
||||||
// Extract next n bytes
|
// Extract next n bytes
|
||||||
virtual blargg_err_t extract_v( void* out, int n );
|
virtual blargg_err_t extract_v( void* out, long n );
|
||||||
|
|
||||||
// Implementation
|
// Implementation
|
||||||
public:
|
public:
|
||||||
|
@ -139,7 +139,7 @@ private:
|
||||||
|
|
||||||
// Info for current file in archive
|
// Info for current file in archive
|
||||||
const char* name_;
|
const char* name_;
|
||||||
const wchar_t* wname_;
|
const blargg_wchar_t* wname_;
|
||||||
unsigned date_;
|
unsigned date_;
|
||||||
unsigned crc32_;
|
unsigned crc32_;
|
||||||
BOOST::uint64_t size_;
|
BOOST::uint64_t size_;
|
||||||
|
@ -158,13 +158,12 @@ private:
|
||||||
|
|
||||||
// Data_Reader overrides
|
// Data_Reader overrides
|
||||||
// TODO: override skip_v?
|
// TODO: override skip_v?
|
||||||
virtual blargg_err_t read_v( void* out, int n );
|
virtual blargg_err_t read_v( void* out, long n );
|
||||||
};
|
};
|
||||||
|
|
||||||
struct fex_type_t_
|
struct fex_type_t_
|
||||||
{
|
{
|
||||||
const char* extension;
|
const char* extension;
|
||||||
const char** signatures;
|
|
||||||
File_Extractor* (*new_fex)();
|
File_Extractor* (*new_fex)();
|
||||||
const char* name;
|
const char* name;
|
||||||
blargg_err_t (*init)(); // Called by fex_init(). Can be NULL.
|
blargg_err_t (*init)(); // Called by fex_init(). Can be NULL.
|
||||||
|
|
|
@ -28,11 +28,8 @@ static File_Extractor* new_gzip()
|
||||||
return BLARGG_NEW Gzip_Extractor;
|
return BLARGG_NEW Gzip_Extractor;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const char * gz_signatures[] = { "\x1F\x8B", NULL };
|
|
||||||
|
|
||||||
fex_type_t_ const fex_gz_type [1] = {{
|
fex_type_t_ const fex_gz_type [1] = {{
|
||||||
".gz",
|
".gz",
|
||||||
gz_signatures,
|
|
||||||
&new_gzip,
|
&new_gzip,
|
||||||
"gzipped file",
|
"gzipped file",
|
||||||
&init_gzip_file
|
&init_gzip_file
|
||||||
|
@ -95,7 +92,7 @@ blargg_err_t Gzip_Extractor::rewind_v()
|
||||||
return blargg_ok;
|
return blargg_ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
blargg_err_t Gzip_Extractor::extract_v( void* p, int n )
|
blargg_err_t Gzip_Extractor::extract_v( void* p, long n )
|
||||||
{
|
{
|
||||||
return gr.read( p, n );
|
return gr.read( p, n );
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,7 +22,7 @@ protected:
|
||||||
virtual blargg_err_t rewind_v();
|
virtual blargg_err_t rewind_v();
|
||||||
|
|
||||||
virtual blargg_err_t stat_v();
|
virtual blargg_err_t stat_v();
|
||||||
virtual blargg_err_t extract_v( void*, int );
|
virtual blargg_err_t extract_v( void*, long );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Gzip_Reader gr;
|
Gzip_Reader gr;
|
||||||
|
|
|
@ -25,7 +25,7 @@ Gzip_Reader::Gzip_Reader()
|
||||||
Gzip_Reader::~Gzip_Reader()
|
Gzip_Reader::~Gzip_Reader()
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
static blargg_err_t gzip_reader_read( void* file, void* out, int* count )
|
static blargg_err_t gzip_reader_read( void* file, void* out, long* count )
|
||||||
{
|
{
|
||||||
return STATIC_CAST(File_Reader*,file)->read_avail( out, count );
|
return STATIC_CAST(File_Reader*,file)->read_avail( out, count );
|
||||||
}
|
}
|
||||||
|
@ -37,7 +37,7 @@ blargg_err_t Gzip_Reader::calc_size()
|
||||||
if ( inflater.deflated() )
|
if ( inflater.deflated() )
|
||||||
{
|
{
|
||||||
byte trailer [8];
|
byte trailer [8];
|
||||||
int old_pos = in->tell();
|
BOOST::uint64_t old_pos = in->tell();
|
||||||
RETURN_ERR( in->seek( size_ - sizeof trailer ) );
|
RETURN_ERR( in->seek( size_ - sizeof trailer ) );
|
||||||
RETURN_ERR( in->read( trailer, sizeof trailer ) );
|
RETURN_ERR( in->read( trailer, sizeof trailer ) );
|
||||||
RETURN_ERR( in->seek( old_pos ) );
|
RETURN_ERR( in->seek( old_pos ) );
|
||||||
|
@ -72,10 +72,10 @@ void Gzip_Reader::close()
|
||||||
inflater.end();
|
inflater.end();
|
||||||
}
|
}
|
||||||
|
|
||||||
blargg_err_t Gzip_Reader::read_v( void* out, int count )
|
blargg_err_t Gzip_Reader::read_v( void* out, long count )
|
||||||
{
|
{
|
||||||
assert( in );
|
assert( in );
|
||||||
int actual = count;
|
long actual = count;
|
||||||
RETURN_ERR( inflater.read( out, &actual ) );
|
RETURN_ERR( inflater.read( out, &actual ) );
|
||||||
|
|
||||||
if ( actual != count )
|
if ( actual != count )
|
||||||
|
|
|
@ -32,12 +32,12 @@ public:
|
||||||
virtual ~Gzip_Reader();
|
virtual ~Gzip_Reader();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual blargg_err_t read_v( void*, int );
|
virtual blargg_err_t read_v( void*, long );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
File_Reader* in;
|
File_Reader* in;
|
||||||
unsigned crc32_;
|
unsigned crc32_;
|
||||||
int size_;
|
BOOST::uint64_t size_;
|
||||||
Zlib_Inflater inflater;
|
Zlib_Inflater inflater;
|
||||||
|
|
||||||
blargg_err_t calc_size();
|
blargg_err_t calc_size();
|
||||||
|
|
|
@ -30,11 +30,8 @@ static File_Extractor* new_rar()
|
||||||
return BLARGG_NEW Rar_Extractor;
|
return BLARGG_NEW Rar_Extractor;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const char * rar_signatures[] = { "\x52\x45\x7E\x5E", "\x52\x61\x72\x21", NULL };
|
|
||||||
|
|
||||||
fex_type_t_ const fex_rar_type [1] = {{
|
fex_type_t_ const fex_rar_type [1] = {{
|
||||||
".rar",
|
".rar",
|
||||||
rar_signatures,
|
|
||||||
&new_rar,
|
&new_rar,
|
||||||
"RAR archive",
|
"RAR archive",
|
||||||
&init_rar
|
&init_rar
|
||||||
|
@ -86,8 +83,6 @@ extern "C"
|
||||||
{
|
{
|
||||||
static unrar_err_t my_unrar_read( void* data, void* out, int* count, unrar_pos_t pos )
|
static unrar_err_t my_unrar_read( void* data, void* out, int* count, unrar_pos_t pos )
|
||||||
{
|
{
|
||||||
// TODO: 64-bit file support
|
|
||||||
|
|
||||||
Rar_Extractor::read_callback_t* h = STATIC_CAST(Rar_Extractor::read_callback_t*,data);
|
Rar_Extractor::read_callback_t* h = STATIC_CAST(Rar_Extractor::read_callback_t*,data);
|
||||||
if ( h->pos != pos )
|
if ( h->pos != pos )
|
||||||
{
|
{
|
||||||
|
@ -148,7 +143,7 @@ blargg_err_t Rar_Extractor::skip_unextractables()
|
||||||
unrar_info_t const* info = unrar_info( unrar );
|
unrar_info_t const* info = unrar_info( unrar );
|
||||||
|
|
||||||
set_name( info->name, (info->name_w && *info->name_w) ? info->name_w : NULL );
|
set_name( info->name, (info->name_w && *info->name_w) ? info->name_w : NULL );
|
||||||
set_info( info->size, info->dos_date, (info->is_crc32 ? info->crc : 0) );
|
set_info( info->size, (unsigned int)info->dos_date, (unsigned int)(info->is_crc32 ? info->crc : 0) );
|
||||||
}
|
}
|
||||||
|
|
||||||
return blargg_ok;
|
return blargg_ok;
|
||||||
|
@ -187,7 +182,7 @@ blargg_err_t Rar_Extractor::data_v( void const** out )
|
||||||
return convert_err( unrar_extract_mem( unrar, out ) );
|
return convert_err( unrar_extract_mem( unrar, out ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
blargg_err_t Rar_Extractor::extract_v( void* out, int count )
|
blargg_err_t Rar_Extractor::extract_v( void* out, long count )
|
||||||
{
|
{
|
||||||
// We can read entire file directly into user buffer
|
// We can read entire file directly into user buffer
|
||||||
if ( count == size() )
|
if ( count == size() )
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
#define RAR_EXTRACTOR_H
|
#define RAR_EXTRACTOR_H
|
||||||
|
|
||||||
#include "File_Extractor.h"
|
#include "File_Extractor.h"
|
||||||
#include "../unrar/unrar.h"
|
#include "unrar/unrar.h"
|
||||||
|
|
||||||
class Rar_Extractor : public File_Extractor {
|
class Rar_Extractor : public File_Extractor {
|
||||||
public:
|
public:
|
||||||
|
@ -29,7 +29,7 @@ protected:
|
||||||
virtual blargg_err_t seek_arc_v( fex_pos_t );
|
virtual blargg_err_t seek_arc_v( fex_pos_t );
|
||||||
|
|
||||||
virtual blargg_err_t data_v( void const** );
|
virtual blargg_err_t data_v( void const** );
|
||||||
virtual blargg_err_t extract_v( void*, int );
|
virtual blargg_err_t extract_v( void*, long );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
unrar_t* unrar;
|
unrar_t* unrar;
|
||||||
|
|
|
@ -3,9 +3,9 @@
|
||||||
#include "Zip7_Extractor.h"
|
#include "Zip7_Extractor.h"
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#include "../7z_C/7z.h"
|
#include "7z_C/7z.h"
|
||||||
#include "../7z_C/7zAlloc.h"
|
#include "7z_C/7zAlloc.h"
|
||||||
#include "../7z_C/7zCrc.h"
|
#include "7z_C/7zCrc.h"
|
||||||
}
|
}
|
||||||
|
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
@ -143,11 +143,8 @@ static File_Extractor* new_7z()
|
||||||
return BLARGG_NEW Zip7_Extractor;
|
return BLARGG_NEW Zip7_Extractor;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const char * zip7_signatures[] = { "\x37\x7A\xBC\xAF", NULL };
|
|
||||||
|
|
||||||
fex_type_t_ const fex_7z_type [1] = {{
|
fex_type_t_ const fex_7z_type [1] = {{
|
||||||
".7z",
|
".7z",
|
||||||
zip7_signatures,
|
|
||||||
&new_7z,
|
&new_7z,
|
||||||
"7-zip archive",
|
"7-zip archive",
|
||||||
&init_7z
|
&init_7z
|
||||||
|
@ -228,9 +225,13 @@ blargg_err_t Zip7_Extractor::next_v()
|
||||||
|
|
||||||
time_t _time = time;
|
time_t _time = time;
|
||||||
|
|
||||||
|
#ifdef _WIN32
|
||||||
localtime_s( &tm, &_time );
|
localtime_s( &tm, &_time );
|
||||||
|
#else
|
||||||
|
localtime_r( &_time, &tm );
|
||||||
|
#endif
|
||||||
|
|
||||||
date = ( tm.tm_sec >> 1 ) & 0x1F |
|
date = (( tm.tm_sec >> 1 ) & 0x1F) |
|
||||||
(( tm.tm_min & 0x3F ) << 5 ) |
|
(( tm.tm_min & 0x3F ) << 5 ) |
|
||||||
(( tm.tm_hour & 0x1F ) << 11 ) |
|
(( tm.tm_hour & 0x1F ) << 11 ) |
|
||||||
(( tm.tm_mday & 0x1F ) << 16 ) |
|
(( tm.tm_mday & 0x1F ) << 16 ) |
|
||||||
|
@ -238,15 +239,16 @@ blargg_err_t Zip7_Extractor::next_v()
|
||||||
(( ( tm.tm_year - 80 ) & 0x7F ) << 25 );
|
(( ( tm.tm_year - 80 ) & 0x7F ) << 25 );
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t name_length = SzArEx_GetFileNameUtf16( &impl->db, index, 0 );
|
size_t name_length = SzArEx_GetFileNameUtf16( &impl->db, (size_t) index, 0 );
|
||||||
name16.resize( name_length );
|
name16.resize( name_length );
|
||||||
SzArEx_GetFileNameUtf16( &impl->db, index, ( UInt16 * ) name16.begin() );
|
SzArEx_GetFileNameUtf16( &impl->db, (size_t) index, ( UInt16 * ) name16.begin() );
|
||||||
char * temp = blargg_to_utf8( name16.begin() );
|
char * temp = blargg_to_utf8( name16.begin() );
|
||||||
if ( !temp ) temp = "";
|
const char * name_8 = temp;
|
||||||
size_t utf8_length = strlen( temp );
|
if ( !temp ) name_8 = "";
|
||||||
|
size_t utf8_length = strlen( name_8 );
|
||||||
name8.resize( utf8_length + 1 );
|
name8.resize( utf8_length + 1 );
|
||||||
memcpy( name8.begin(), temp, utf8_length + 1 );
|
memcpy( name8.begin(), name_8, utf8_length + 1 );
|
||||||
free( temp );
|
if ( temp ) free( temp );
|
||||||
set_name( name8.begin(), name16.begin() );
|
set_name( name8.begin(), name16.begin() );
|
||||||
set_info( item.Size, 0, (item.CrcDefined ? item.Crc : 0) );
|
set_info( item.Size, 0, (item.CrcDefined ? item.Crc : 0) );
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -26,9 +26,9 @@ protected:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Zip7_Extractor_Impl* impl;
|
Zip7_Extractor_Impl* impl;
|
||||||
int index;
|
fex_pos_t index;
|
||||||
blargg_vector<char> name8;
|
blargg_vector<char> name8;
|
||||||
blargg_vector<wchar_t> name16;
|
blargg_vector<blargg_wchar_t> name16;
|
||||||
|
|
||||||
blargg_err_t zip7_err( int err );
|
blargg_err_t zip7_err( int err );
|
||||||
};
|
};
|
||||||
|
|
|
@ -34,8 +34,6 @@ int const disk_block_size = 4 * 1024;
|
||||||
// Read buffer used for extracting file data
|
// Read buffer used for extracting file data
|
||||||
int const read_buf_size = 16 * 1024;
|
int const read_buf_size = 16 * 1024;
|
||||||
|
|
||||||
#include <string>
|
|
||||||
|
|
||||||
struct header_t
|
struct header_t
|
||||||
{
|
{
|
||||||
char type [4];
|
char type [4];
|
||||||
|
@ -102,11 +100,8 @@ static File_Extractor* new_zip()
|
||||||
return BLARGG_NEW Zip_Extractor;
|
return BLARGG_NEW Zip_Extractor;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const char * zip_signatures[] = { "\x50\x4B\x03\x04", "\x50\x4B\x05\x06", NULL };
|
|
||||||
|
|
||||||
fex_type_t_ const fex_zip_type [1] = {{
|
fex_type_t_ const fex_zip_type [1] = {{
|
||||||
".zip",
|
".zip",
|
||||||
zip_signatures,
|
|
||||||
&new_zip,
|
&new_zip,
|
||||||
"ZIP archive",
|
"ZIP archive",
|
||||||
&init_zip
|
&init_zip
|
||||||
|
@ -135,7 +130,7 @@ blargg_err_t Zip_Extractor::open_path_v()
|
||||||
}
|
}
|
||||||
|
|
||||||
inline
|
inline
|
||||||
void Zip_Extractor::reorder_entry_header( int offset )
|
void Zip_Extractor::reorder_entry_header( long offset )
|
||||||
{
|
{
|
||||||
catalog [offset + 0] = 0;
|
catalog [offset + 0] = 0;
|
||||||
catalog [offset + 4] = 'P';
|
catalog [offset + 4] = 'P';
|
||||||
|
@ -147,19 +142,19 @@ blargg_err_t Zip_Extractor::open_v()
|
||||||
return blargg_err_file_type;
|
return blargg_err_file_type;
|
||||||
|
|
||||||
// Read final end_read_size bytes of file
|
// Read final end_read_size bytes of file
|
||||||
BOOST::uint64_t file_pos = max( (BOOST::uint64_t) 0, arc().size() - end_read_size );
|
BOOST::int64_t file_pos = max( (BOOST::int64_t) 0, (BOOST::int64_t) arc().size() - end_read_size );
|
||||||
file_pos -= file_pos % disk_block_size;
|
file_pos -= file_pos % disk_block_size;
|
||||||
RETURN_ERR( catalog.resize( arc().size() - file_pos ) );
|
RETURN_ERR( catalog.resize( (size_t)(arc().size() - file_pos) ) );
|
||||||
RETURN_ERR( arc().seek( file_pos ) );
|
RETURN_ERR( arc().seek( file_pos ) );
|
||||||
RETURN_ERR( arc().read( catalog.begin(), catalog.size() ) );
|
RETURN_ERR( arc().read( catalog.begin(), catalog.size() ) );
|
||||||
|
|
||||||
// Find end-of-catalog entry
|
// Find end-of-catalog entry
|
||||||
BOOST::uint64_t end_pos = catalog.size() - end_entry_size;
|
BOOST::int64_t end_pos = catalog.size() - end_entry_size;
|
||||||
while ( end_pos >= 0 && memcmp( &catalog [end_pos], "PK\5\6", 4 ) )
|
while ( end_pos >= 0 && memcmp( &catalog [(size_t)end_pos], "PK\5\6", 4 ) )
|
||||||
end_pos--;
|
end_pos--;
|
||||||
if ( end_pos < 0 )
|
if ( end_pos < 0 )
|
||||||
return blargg_err_file_type;
|
return blargg_err_file_type;
|
||||||
end_entry_t const& end_entry = (end_entry_t&) catalog [end_pos];
|
end_entry_t const& end_entry = (end_entry_t&) catalog [(size_t)end_pos];
|
||||||
end_pos += file_pos;
|
end_pos += file_pos;
|
||||||
|
|
||||||
// some idiotic zip compressors add data to end of zip without setting comment len
|
// some idiotic zip compressors add data to end of zip without setting comment len
|
||||||
|
@ -167,17 +162,17 @@ blargg_err_t Zip_Extractor::open_v()
|
||||||
|
|
||||||
// Find file offset of beginning of catalog
|
// Find file offset of beginning of catalog
|
||||||
catalog_begin = get_le32( end_entry.dir_offset );
|
catalog_begin = get_le32( end_entry.dir_offset );
|
||||||
int catalog_size = end_pos - catalog_begin;
|
BOOST::int64_t catalog_size = end_pos - catalog_begin;
|
||||||
if ( catalog_size < 0 )
|
if ( catalog_size < 0 )
|
||||||
return blargg_err_file_corrupt;
|
return blargg_err_file_corrupt;
|
||||||
catalog_size += end_entry_size;
|
catalog_size += end_entry_size;
|
||||||
|
|
||||||
// See if catalog is entirely contained in bytes already read
|
// See if catalog is entirely contained in bytes already read
|
||||||
BOOST::uint64_t begin_offset = catalog_begin - file_pos;
|
BOOST::int64_t begin_offset = catalog_begin - file_pos;
|
||||||
if ( begin_offset >= 0 )
|
if ( begin_offset >= 0 )
|
||||||
memmove( catalog.begin(), &catalog [begin_offset], catalog_size );
|
memmove( catalog.begin(), &catalog [(size_t)begin_offset], (size_t)catalog_size );
|
||||||
|
|
||||||
RETURN_ERR( catalog.resize( catalog_size ) );
|
RETURN_ERR( catalog.resize( (size_t)catalog_size ) );
|
||||||
if ( begin_offset < 0 )
|
if ( begin_offset < 0 )
|
||||||
{
|
{
|
||||||
// Catalog begins before bytes read, so it needs to be read
|
// Catalog begins before bytes read, so it needs to be read
|
||||||
|
@ -233,7 +228,7 @@ blargg_err_t Zip_Extractor::update_info( bool advance_first )
|
||||||
{
|
{
|
||||||
while ( 1 )
|
while ( 1 )
|
||||||
{
|
{
|
||||||
entry_t& e = (entry_t&) catalog [catalog_pos];
|
entry_t& e = (entry_t&) catalog [(size_t)catalog_pos];
|
||||||
|
|
||||||
if ( memcmp( e.type, "\0K\1\2P", 5 ) && memcmp( e.type, "PK\1\2", 4 ) )
|
if ( memcmp( e.type, "\0K\1\2P", 5 ) && memcmp( e.type, "PK\1\2", 4 ) )
|
||||||
{
|
{
|
||||||
|
@ -242,74 +237,22 @@ blargg_err_t Zip_Extractor::update_info( bool advance_first )
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned len = get_le16( e.filename_len );
|
unsigned len = get_le16( e.filename_len );
|
||||||
int next_offset = catalog_pos + entry_size + len + get_le16( e.extra_len ) +
|
BOOST::int64_t next_offset = catalog_pos + entry_size + len + get_le16( e.extra_len ) +
|
||||||
get_le16( e.comment_len );
|
get_le16( e.comment_len );
|
||||||
if ( (unsigned) next_offset > catalog.size() - end_entry_size )
|
if ( (unsigned) next_offset > catalog.size() - end_entry_size )
|
||||||
return blargg_err_file_corrupt;
|
return blargg_err_file_corrupt;
|
||||||
|
|
||||||
if ( catalog [next_offset] == 'P' )
|
if ( catalog [(size_t)next_offset] == 'P' )
|
||||||
reorder_entry_header( next_offset );
|
reorder_entry_header( (long)next_offset );
|
||||||
|
|
||||||
if ( !advance_first )
|
if ( !advance_first )
|
||||||
{
|
{
|
||||||
char unterminate = e.filename[len];
|
|
||||||
e.filename [len] = 0; // terminate name
|
e.filename [len] = 0; // terminate name
|
||||||
std::string fname = e.filename;
|
|
||||||
|
|
||||||
if ( is_normal_file( e, len ) )
|
if ( is_normal_file( e, len ) )
|
||||||
{
|
{
|
||||||
e.filename[len] = unterminate;
|
set_name( e.filename );
|
||||||
name.resize(fname.size()+1);
|
|
||||||
if(len != 0)
|
|
||||||
{
|
|
||||||
memcpy(name.begin(),fname.c_str(),len);
|
|
||||||
name[name.size()-1] = 0;
|
|
||||||
}
|
|
||||||
set_name( name.begin() );
|
|
||||||
set_info( get_le32( e.size ), get_le32( e.date ), get_le32( e.crc ) );
|
set_info( get_le32( e.size ), get_le32( e.date ), get_le32( e.crc ) );
|
||||||
|
|
||||||
unsigned extra_len = get_le32(e.extra_len);
|
|
||||||
|
|
||||||
//walk over extra fields
|
|
||||||
unsigned i = len;
|
|
||||||
while(i < extra_len + len)
|
|
||||||
{
|
|
||||||
unsigned id = get_le16(e.filename + i);
|
|
||||||
i += 2;
|
|
||||||
unsigned exlen = get_le16(e.filename + i);
|
|
||||||
i += 2;
|
|
||||||
int exfield = i;
|
|
||||||
i += exlen;
|
|
||||||
if(id == 0x7075) //INFO-ZIP unicode path extra field (contains version, checksum, and utf-8 filename)
|
|
||||||
{
|
|
||||||
unsigned version = (unsigned char)*(e.filename + exfield);
|
|
||||||
if(version == 1)
|
|
||||||
{
|
|
||||||
exfield += 1; //skip version
|
|
||||||
exfield += 4; //skip crc
|
|
||||||
//the remainder is a utf-8 filename
|
|
||||||
int fnamelen = exlen-5;
|
|
||||||
char* tempbuf = (char*)malloc(fnamelen + 1);
|
|
||||||
memcpy(tempbuf,e.filename + exfield, fnamelen);
|
|
||||||
tempbuf[fnamelen] = 0;
|
|
||||||
wchar_t* wfname_buf = blargg_to_wide(tempbuf);
|
|
||||||
std::wstring wfname = wfname_buf;
|
|
||||||
free(tempbuf);
|
|
||||||
free(wfname_buf);
|
|
||||||
|
|
||||||
size_t wfname_len = wfname.size();
|
|
||||||
|
|
||||||
this->wname.resize(wfname_len+1);
|
|
||||||
if(wfname_len != 0)
|
|
||||||
{
|
|
||||||
memcpy(this->wname.begin(),wfname.c_str(),wfname_len*sizeof(wchar_t));
|
|
||||||
wname[wname.size()-1] = 0;
|
|
||||||
}
|
|
||||||
set_name( name.begin(), wname.begin() );
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -351,28 +294,28 @@ void Zip_Extractor::clear_file_v()
|
||||||
buf.end();
|
buf.end();
|
||||||
}
|
}
|
||||||
|
|
||||||
blargg_err_t Zip_Extractor::inflater_read( void* data, void* out, int* count )
|
blargg_err_t Zip_Extractor::inflater_read( void* data, void* out, long* count )
|
||||||
{
|
{
|
||||||
Zip_Extractor& self = *STATIC_CAST(Zip_Extractor*,data);
|
Zip_Extractor& self = *STATIC_CAST(Zip_Extractor*,data);
|
||||||
|
|
||||||
if ( *count > self.raw_remain )
|
if ( *count > self.raw_remain )
|
||||||
*count = self.raw_remain;
|
*count = (long)self.raw_remain;
|
||||||
|
|
||||||
self.raw_remain -= *count;
|
self.raw_remain -= *count;
|
||||||
|
|
||||||
return self.arc().read( out, *count );
|
return self.arc().read( out, *count );
|
||||||
}
|
}
|
||||||
|
|
||||||
blargg_err_t Zip_Extractor::fill_buf( int offset, int buf_size, int initial_read )
|
blargg_err_t Zip_Extractor::fill_buf( long offset, long buf_size, long initial_read )
|
||||||
{
|
{
|
||||||
raw_remain = arc().size() - offset;
|
raw_remain = arc().size() - offset;
|
||||||
RETURN_ERR( arc().seek( offset ) );
|
RETURN_ERR( arc().seek( offset ) );
|
||||||
return buf.begin( inflater_read, this, buf_size, initial_read );
|
return buf.begin( inflater_read, this, buf_size, initial_read );
|
||||||
}
|
}
|
||||||
|
|
||||||
blargg_err_t Zip_Extractor::first_read( int count )
|
blargg_err_t Zip_Extractor::first_read( long count )
|
||||||
{
|
{
|
||||||
entry_t const& e = (entry_t&) catalog [catalog_pos];
|
entry_t const& e = (entry_t&) catalog [(size_t)catalog_pos];
|
||||||
|
|
||||||
// Determine compression
|
// Determine compression
|
||||||
{
|
{
|
||||||
|
@ -429,17 +372,25 @@ blargg_err_t Zip_Extractor::first_read( int count )
|
||||||
return buf.set_mode( (file_deflated ? buf.mode_raw_deflate : buf.mode_copy), buf_offset );
|
return buf.set_mode( (file_deflated ? buf.mode_raw_deflate : buf.mode_copy), buf_offset );
|
||||||
}
|
}
|
||||||
|
|
||||||
blargg_err_t Zip_Extractor::extract_v( void* out, int count )
|
blargg_err_t Zip_Extractor::extract_v( void* out, long count )
|
||||||
{
|
{
|
||||||
if ( tell() == 0 )
|
if ( tell() == 0 )
|
||||||
RETURN_ERR( first_read( count ) );
|
RETURN_ERR( first_read( count ) );
|
||||||
|
|
||||||
int actual = count;
|
long actual = count;
|
||||||
RETURN_ERR( buf.read( out, &actual ) );
|
RETURN_ERR( buf.read( out, &actual ) );
|
||||||
if ( actual < count )
|
if ( actual < count )
|
||||||
return blargg_err_file_corrupt;
|
return blargg_err_file_corrupt;
|
||||||
|
|
||||||
crc = ::crc32( crc, (byte const*) out, count );
|
long count_crc = count;
|
||||||
|
const byte * out_crc = (const byte *) out;
|
||||||
|
while ( count_crc > 0 )
|
||||||
|
{
|
||||||
|
unsigned int count_i = (unsigned int)( count_crc > UINT_MAX ? UINT_MAX : count_crc );
|
||||||
|
crc = ::crc32( crc, out_crc, count_i );
|
||||||
|
out_crc += count_i;
|
||||||
|
count_crc -= count_i;
|
||||||
|
}
|
||||||
if ( count == reader().remain() && crc != correct_crc )
|
if ( count == reader().remain() && crc != correct_crc )
|
||||||
return blargg_err_file_corrupt;
|
return blargg_err_file_corrupt;
|
||||||
|
|
||||||
|
|
|
@ -23,26 +23,23 @@ protected:
|
||||||
virtual fex_pos_t tell_arc_v() const;
|
virtual fex_pos_t tell_arc_v() const;
|
||||||
virtual blargg_err_t seek_arc_v( fex_pos_t );
|
virtual blargg_err_t seek_arc_v( fex_pos_t );
|
||||||
|
|
||||||
virtual blargg_err_t extract_v( void*, int );
|
virtual blargg_err_t extract_v( void*, long );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
blargg_vector<char> catalog;
|
blargg_vector<char> catalog;
|
||||||
int catalog_begin; // offset of first catalog entry in file (to detect corruption)
|
BOOST::int64_t catalog_begin; // offset of first catalog entry in file (to detect corruption)
|
||||||
int catalog_pos; // position of current entry in catalog
|
BOOST::int64_t catalog_pos; // position of current entry in catalog
|
||||||
BOOST::uint64_t raw_remain; // bytes remaining to be read from zip file for current file
|
BOOST::uint64_t raw_remain; // bytes remaining to be read from zip file for current file
|
||||||
unsigned crc; // ongoing CRC of extracted bytes
|
unsigned long crc; // ongoing CRC of extracted bytes
|
||||||
unsigned correct_crc;
|
unsigned long correct_crc;
|
||||||
bool file_deflated;
|
bool file_deflated;
|
||||||
Zlib_Inflater buf;
|
Zlib_Inflater buf;
|
||||||
|
|
||||||
blargg_err_t fill_buf( int offset, int buf_size, int initial_read );
|
blargg_err_t fill_buf( long offset, long buf_size, long initial_read );
|
||||||
blargg_err_t update_info( bool advance_first );
|
blargg_err_t update_info( bool advance_first );
|
||||||
blargg_err_t first_read( int count );
|
blargg_err_t first_read( long count );
|
||||||
void reorder_entry_header( int offset );
|
void reorder_entry_header( long offset );
|
||||||
static blargg_err_t inflater_read( void* data, void* out, int* count );
|
static blargg_err_t inflater_read( void* data, void* out, long* count );
|
||||||
|
|
||||||
blargg_vector<char> name;
|
|
||||||
blargg_vector<wchar_t> wname;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -59,17 +59,17 @@ Zlib_Inflater::~Zlib_Inflater()
|
||||||
end();
|
end();
|
||||||
}
|
}
|
||||||
|
|
||||||
blargg_err_t Zlib_Inflater::fill_buf( int count )
|
blargg_err_t Zlib_Inflater::fill_buf( long count )
|
||||||
{
|
{
|
||||||
byte* out = buf.end() - count;
|
byte* out = buf.end() - count;
|
||||||
RETURN_ERR( callback( user_data, out, &count ) );
|
RETURN_ERR( callback( user_data, out, &count ) );
|
||||||
zbuf.avail_in = count;
|
zbuf.avail_in = (uInt) count;
|
||||||
zbuf.next_in = out;
|
zbuf.next_in = out;
|
||||||
return blargg_ok;
|
return blargg_ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
blargg_err_t Zlib_Inflater::begin( callback_t new_callback, void* new_user_data,
|
blargg_err_t Zlib_Inflater::begin( callback_t new_callback, void* new_user_data,
|
||||||
int new_buf_size, int initial_read )
|
long new_buf_size, long initial_read )
|
||||||
{
|
{
|
||||||
callback = new_callback;
|
callback = new_callback;
|
||||||
user_data = new_user_data;
|
user_data = new_user_data;
|
||||||
|
@ -163,15 +163,15 @@ blargg_err_t Zlib_Inflater::read_all( void* out, int count )
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
blargg_err_t Zlib_Inflater::read( void* out, int* count_io )
|
blargg_err_t Zlib_Inflater::read( void* out, long* count_io )
|
||||||
{
|
{
|
||||||
int remain = *count_io;
|
long remain = *count_io;
|
||||||
if ( remain && zbuf.next_in )
|
if ( remain && zbuf.next_in )
|
||||||
{
|
{
|
||||||
if ( deflated_ )
|
if ( deflated_ )
|
||||||
{
|
{
|
||||||
zbuf.next_out = (Bytef*) out;
|
zbuf.next_out = (Bytef*) out;
|
||||||
zbuf.avail_out = remain;
|
zbuf.avail_out = (uInt)( remain > UINT_MAX ? UINT_MAX : remain );
|
||||||
|
|
||||||
while ( 1 )
|
while ( 1 )
|
||||||
{
|
{
|
||||||
|
@ -232,7 +232,7 @@ blargg_err_t Zlib_Inflater::read( void* out, int* count_io )
|
||||||
// read large request directly
|
// read large request directly
|
||||||
if ( remain + zbuf.total_out % block_size >= buf.size() )
|
if ( remain + zbuf.total_out % block_size >= buf.size() )
|
||||||
{
|
{
|
||||||
int count = remain;
|
long count = remain;
|
||||||
RETURN_ERR( callback( user_data, out, &count ) );
|
RETURN_ERR( callback( user_data, out, &count ) );
|
||||||
zbuf.total_out += count;
|
zbuf.total_out += count;
|
||||||
out = (char*) out + count;
|
out = (char*) out + count;
|
||||||
|
|
|
@ -13,13 +13,13 @@ public:
|
||||||
|
|
||||||
// Reads at most min(*count,bytes_until_eof()) bytes into *out and set *count
|
// Reads at most min(*count,bytes_until_eof()) bytes into *out and set *count
|
||||||
// to that number, or returns error if that many can't be read.
|
// to that number, or returns error if that many can't be read.
|
||||||
typedef blargg_err_t (*callback_t)( void* user_data, void* out, int* count );
|
typedef blargg_err_t (*callback_t)( void* user_data, void* out, long* count );
|
||||||
|
|
||||||
// Begins by setting callback and filling buffer. Default buffer is 16K and
|
// Begins by setting callback and filling buffer. Default buffer is 16K and
|
||||||
// filled to 4K, or specify buf_size and initial_read for custom buffer size
|
// filled to 4K, or specify buf_size and initial_read for custom buffer size
|
||||||
// and how much to read initially.
|
// and how much to read initially.
|
||||||
blargg_err_t begin( callback_t, void* user_data,
|
blargg_err_t begin( callback_t, void* user_data,
|
||||||
int buf_size = 0, int initial_read = 0 );
|
long buf_size = 0, long initial_read = 0 );
|
||||||
|
|
||||||
// Data read into buffer by begin()
|
// Data read into buffer by begin()
|
||||||
const unsigned char* data() const { return zbuf.next_in; }
|
const unsigned char* data() const { return zbuf.next_in; }
|
||||||
|
@ -39,10 +39,10 @@ public:
|
||||||
// number of bytes read (less than requested if end of data was reached).
|
// number of bytes read (less than requested if end of data was reached).
|
||||||
// Buffers source data internally, even in copy mode, so input file can be
|
// Buffers source data internally, even in copy mode, so input file can be
|
||||||
// unbuffered without sacrificing performance.
|
// unbuffered without sacrificing performance.
|
||||||
blargg_err_t read( void* out, int* count_io );
|
blargg_err_t read( void* out, long* count_io );
|
||||||
|
|
||||||
// Total number of bytes read since begin()
|
// Total number of bytes read since begin()
|
||||||
int tell() const { return zbuf.total_out; }
|
long tell() const { return zbuf.total_out; }
|
||||||
|
|
||||||
// Ends inflation and frees memory
|
// Ends inflation and frees memory
|
||||||
void end();
|
void end();
|
||||||
|
@ -64,7 +64,7 @@ private:
|
||||||
callback_t callback;
|
callback_t callback;
|
||||||
void* user_data;
|
void* user_data;
|
||||||
|
|
||||||
blargg_err_t fill_buf( int count );
|
blargg_err_t fill_buf( long count );
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -6,13 +6,27 @@
|
||||||
#define BLARGG_COMMON_H
|
#define BLARGG_COMMON_H
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
#include <stdint.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
|
|
||||||
typedef const char* blargg_err_t; // 0 on success, otherwise error string
|
typedef const char* blargg_err_t; // 0 on success, otherwise error string
|
||||||
|
|
||||||
|
#ifdef _WIN32
|
||||||
|
typedef wchar_t blargg_wchar_t;
|
||||||
|
#else
|
||||||
|
typedef uint16_t blargg_wchar_t;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
inline size_t blargg_wcslen( const blargg_wchar_t* str )
|
||||||
|
{
|
||||||
|
size_t length = 0;
|
||||||
|
while ( *str++ ) length++;
|
||||||
|
return length;
|
||||||
|
}
|
||||||
|
|
||||||
// Success; no error
|
// Success; no error
|
||||||
int const blargg_ok = 0;
|
blargg_err_t const blargg_ok = 0;
|
||||||
|
|
||||||
// BLARGG_RESTRICT: equivalent to C99's restrict, where supported
|
// BLARGG_RESTRICT: equivalent to C99's restrict, where supported
|
||||||
#if __GNUC__ >= 3 || _MSC_VER >= 1100
|
#if __GNUC__ >= 3 || _MSC_VER >= 1100
|
||||||
|
|
|
@ -27,8 +27,7 @@
|
||||||
fex_zip_type,
|
fex_zip_type,
|
||||||
*/
|
*/
|
||||||
|
|
||||||
//old (any?) msvc doesnt have stdint.h so this better not be here.
|
#define HAVE_STDINT_H
|
||||||
//#define HAVE_STDINT_H
|
|
||||||
|
|
||||||
// Use standard config.h if present
|
// Use standard config.h if present
|
||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
|
|
|
@ -69,21 +69,8 @@ otherwise continues normally. */
|
||||||
return blargg_err_memory;\
|
return blargg_err_memory;\
|
||||||
} while ( 0 )
|
} while ( 0 )
|
||||||
|
|
||||||
/* The usual min/max functions for built-in types.
|
template<typename T> T blargg_min( T x, T y ) { return x < y ? x : y; }
|
||||||
|
template<typename T> T blargg_max( T x, T y ) { return x > y ? x : y; }
|
||||||
template<typename T> T min( T x, T y ) { return x < y ? x : y; }
|
|
||||||
template<typename T> T max( T x, T y ) { return x > y ? x : y; } */
|
|
||||||
#define BLARGG_DEF_MIN_MAX( type ) \
|
|
||||||
static inline type blargg_min( type x, type y ) { if ( y < x ) x = y; return x; }\
|
|
||||||
static inline type blargg_max( type x, type y ) { if ( x < y ) x = y; return x; }
|
|
||||||
|
|
||||||
BLARGG_DEF_MIN_MAX( int )
|
|
||||||
BLARGG_DEF_MIN_MAX( unsigned )
|
|
||||||
BLARGG_DEF_MIN_MAX( long )
|
|
||||||
BLARGG_DEF_MIN_MAX( unsigned long )
|
|
||||||
BLARGG_DEF_MIN_MAX( float )
|
|
||||||
BLARGG_DEF_MIN_MAX( double )
|
|
||||||
BLARGG_DEF_MIN_MAX( BOOST::uint64_t )
|
|
||||||
|
|
||||||
#undef min
|
#undef min
|
||||||
#define min blargg_min
|
#define min blargg_min
|
||||||
|
|
|
@ -235,7 +235,7 @@ BLARGG_EXPORT fex_err_t fex_open( fex_t** fe_out, const char path [] )
|
||||||
|
|
||||||
//// Wide paths
|
//// Wide paths
|
||||||
|
|
||||||
char* fex_wide_to_path( const wchar_t* wide )
|
char* fex_wide_to_path( const blargg_wchar_t* wide )
|
||||||
{
|
{
|
||||||
return blargg_to_utf8( wide );
|
return blargg_to_utf8( wide );
|
||||||
}
|
}
|
||||||
|
@ -295,28 +295,33 @@ BLARGG_EXPORT const char* fex_err_details( fex_err_t err )
|
||||||
|
|
||||||
//// Wrappers
|
//// Wrappers
|
||||||
|
|
||||||
BLARGG_EXPORT fex_err_t fex_read( fex_t* fe, void* out, int count )
|
BLARGG_EXPORT fex_err_t fex_read( fex_t* fe, void* out, long count )
|
||||||
{
|
{
|
||||||
RETURN_ERR( fe->stat() );
|
RETURN_ERR( fe->stat() );
|
||||||
return fe->reader().read( out, count );
|
return fe->reader().read( out, count );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BLARGG_EXPORT fex_err_t fex_skip( fex_t* fe, long count )
|
||||||
|
{
|
||||||
|
RETURN_ERR( fe->stat() );
|
||||||
|
return fe->reader().skip( count );
|
||||||
|
}
|
||||||
|
|
||||||
BLARGG_EXPORT void fex_close ( fex_t* fe ) { delete fe; }
|
BLARGG_EXPORT void fex_close ( fex_t* fe ) { delete fe; }
|
||||||
BLARGG_EXPORT fex_type_t fex_type ( const fex_t* fe ) { return fe->type(); }
|
BLARGG_EXPORT fex_type_t fex_type ( const fex_t* fe ) { return fe->type(); }
|
||||||
BLARGG_EXPORT int fex_done ( const fex_t* fe ) { return fe->done(); }
|
BLARGG_EXPORT int fex_done ( const fex_t* fe ) { return fe->done(); }
|
||||||
BLARGG_EXPORT const char* fex_name ( const fex_t* fe ) { return fe->name(); }
|
BLARGG_EXPORT const char* fex_name ( const fex_t* fe ) { return fe->name(); }
|
||||||
BLARGG_EXPORT const wchar_t* fex_wname ( const fex_t* fe ) { return fe->wname(); }
|
BLARGG_EXPORT const blargg_wchar_t* fex_wname ( const fex_t* fe ) { return fe->wname(); }
|
||||||
BLARGG_EXPORT __int64 fex_size ( const fex_t* fe ) { return fe->size(); }
|
BLARGG_EXPORT uint64_t fex_size ( const fex_t* fe ) { return fe->size(); }
|
||||||
BLARGG_EXPORT unsigned fex_dos_date ( const fex_t* fe ) { return fe->dos_date(); }
|
BLARGG_EXPORT unsigned fex_dos_date ( const fex_t* fe ) { return fe->dos_date(); }
|
||||||
BLARGG_EXPORT unsigned fex_crc32 ( const fex_t* fe ) { return fe->crc32(); }
|
BLARGG_EXPORT unsigned fex_crc32 ( const fex_t* fe ) { return fe->crc32(); }
|
||||||
BLARGG_EXPORT fex_err_t fex_stat ( fex_t* fe ) { return fe->stat(); }
|
BLARGG_EXPORT fex_err_t fex_stat ( fex_t* fe ) { return fe->stat(); }
|
||||||
BLARGG_EXPORT fex_err_t fex_next ( fex_t* fe ) { return fe->next(); }
|
BLARGG_EXPORT fex_err_t fex_next ( fex_t* fe ) { return fe->next(); }
|
||||||
BLARGG_EXPORT fex_err_t fex_rewind ( fex_t* fe ) { return fe->rewind(); }
|
BLARGG_EXPORT fex_err_t fex_rewind ( fex_t* fe ) { return fe->rewind(); }
|
||||||
BLARGG_EXPORT __int64 fex_tell ( const fex_t* fe ) { return fe->tell(); }
|
BLARGG_EXPORT uint64_t fex_tell ( const fex_t* fe ) { return fe->tell(); }
|
||||||
BLARGG_EXPORT fex_pos_t fex_tell_arc ( const fex_t* fe ) { return fe->tell_arc(); }
|
BLARGG_EXPORT fex_pos_t fex_tell_arc ( const fex_t* fe ) { return fe->tell_arc(); }
|
||||||
BLARGG_EXPORT fex_err_t fex_seek_arc ( fex_t* fe, fex_pos_t pos ) { return fe->seek_arc( pos ); }
|
BLARGG_EXPORT fex_err_t fex_seek_arc ( fex_t* fe, fex_pos_t pos ) { return fe->seek_arc( pos ); }
|
||||||
BLARGG_EXPORT const char* fex_type_extension ( fex_type_t t ) { return t->extension; }
|
BLARGG_EXPORT const char* fex_type_extension ( fex_type_t t ) { return t->extension; }
|
||||||
BLARGG_EXPORT const char**fex_type_signatures ( fex_type_t t ) { return t->signatures; }
|
|
||||||
BLARGG_EXPORT const char* fex_type_name ( fex_type_t t ) { return t->name; }
|
BLARGG_EXPORT const char* fex_type_name ( fex_type_t t ) { return t->name; }
|
||||||
BLARGG_EXPORT fex_err_t fex_data ( fex_t* fe, const void** data_out ) { return fe->data( data_out ); }
|
BLARGG_EXPORT fex_err_t fex_data ( fex_t* fe, const void** data_out ) { return fe->data( data_out ); }
|
||||||
BLARGG_EXPORT const char* fex_err_str ( fex_err_t err ) { return blargg_err_str( err ); }
|
BLARGG_EXPORT const char* fex_err_str ( fex_err_t err ) { return blargg_err_str( err ); }
|
||||||
|
|
|
@ -5,12 +5,18 @@
|
||||||
#define FEX_H
|
#define FEX_H
|
||||||
|
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
|
#ifdef _WIN32
|
||||||
|
typedef wchar_t blargg_wchar_t;
|
||||||
|
#else
|
||||||
|
typedef uint16_t blargg_wchar_t;
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/** First parameter of most functions is fex_t*, or const fex_t* if nothing is
|
/** First parameter of most functions is fex_t*, or const fex_t* if nothing is
|
||||||
changed. Once one of these functions returns an error, the archive should not
|
changed. Once one of these functions returns an error, the archive should not
|
||||||
be used any further, other than to close it. One exception is
|
be used any further, other than to close it. One exception is
|
||||||
|
@ -39,16 +45,11 @@ const char* fex_type_name( fex_type_t );
|
||||||
returns "", since it can open any file. */
|
returns "", since it can open any file. */
|
||||||
const char* fex_type_extension( fex_type_t );
|
const char* fex_type_extension( fex_type_t );
|
||||||
|
|
||||||
/** List of possible start bytes combinations for the file, ending with a NULL.
|
|
||||||
For binary file type, returns an empty list, since binary files have no applicable
|
|
||||||
signature. */
|
|
||||||
const char** fex_type_signatures( fex_type_t );
|
|
||||||
|
|
||||||
|
|
||||||
/**** Wide-character file paths ****/
|
/**** Wide-character file paths ****/
|
||||||
|
|
||||||
/** Converts wide-character path to form suitable for use with fex functions. */
|
/** Converts wide-character path to form suitable for use with fex functions. */
|
||||||
char* fex_wide_to_path( const wchar_t* wide );
|
char* fex_wide_to_path( const blargg_wchar_t* wide );
|
||||||
|
|
||||||
/** Frees converted path. OK to pass NULL. */
|
/** Frees converted path. OK to pass NULL. */
|
||||||
void fex_free_path( char* );
|
void fex_free_path( char* );
|
||||||
|
@ -112,7 +113,7 @@ fex_open() */
|
||||||
fex_err_t fex_rewind( fex_t* );
|
fex_err_t fex_rewind( fex_t* );
|
||||||
|
|
||||||
/** Saved position in archive. Can also store zero. */
|
/** Saved position in archive. Can also store zero. */
|
||||||
typedef __int64 fex_pos_t;
|
typedef uint64_t fex_pos_t;
|
||||||
|
|
||||||
/** Position of current file in archive. Never returns zero. */
|
/** Position of current file in archive. Never returns zero. */
|
||||||
fex_pos_t fex_tell_arc( const fex_t* );
|
fex_pos_t fex_tell_arc( const fex_t* );
|
||||||
|
@ -127,13 +128,13 @@ fex_err_t fex_seek_arc( fex_t*, fex_pos_t );
|
||||||
const char* fex_name( const fex_t* );
|
const char* fex_name( const fex_t* );
|
||||||
|
|
||||||
/** Wide-character name of current file, or NULL if unavailable */
|
/** Wide-character name of current file, or NULL if unavailable */
|
||||||
const wchar_t* fex_wname( const fex_t* );
|
const blargg_wchar_t* fex_wname( const fex_t* );
|
||||||
|
|
||||||
/** Makes further information available for file */
|
/** Makes further information available for file */
|
||||||
fex_err_t fex_stat( fex_t* );
|
fex_err_t fex_stat( fex_t* );
|
||||||
|
|
||||||
/** Size of current file. fex_stat() or fex_data() must have been called. */
|
/** Size of current file. fex_stat() or fex_data() must have been called. */
|
||||||
__int64 fex_size( const fex_t* );
|
uint64_t fex_size( const fex_t* );
|
||||||
|
|
||||||
/** Modification date of current file (MS-DOS format), or 0 if unavailable.
|
/** Modification date of current file (MS-DOS format), or 0 if unavailable.
|
||||||
fex_stat() must have been called. */
|
fex_stat() must have been called. */
|
||||||
|
@ -149,10 +150,13 @@ unsigned int fex_crc32( const fex_t* );
|
||||||
|
|
||||||
/** Reads n bytes from current file. Reading past end of file results in
|
/** Reads n bytes from current file. Reading past end of file results in
|
||||||
fex_err_file_eof. */
|
fex_err_file_eof. */
|
||||||
fex_err_t fex_read( fex_t*, void* out, int n );
|
fex_err_t fex_read( fex_t*, void* out, long n );
|
||||||
|
|
||||||
/** Number of bytes read from current file */
|
/** Number of bytes read from current file */
|
||||||
__int64 fex_tell( const fex_t* );
|
uint64_t fex_tell( const fex_t* );
|
||||||
|
|
||||||
|
/** Skips the specified number of bytes in the current file */
|
||||||
|
fex_err_t fex_skip( fex_t*, long n );
|
||||||
|
|
||||||
/** Points *out at current file's data in memory. Pointer is valid until
|
/** Points *out at current file's data in memory. Pointer is valid until
|
||||||
fex_next(), fex_rewind(), fex_seek_arc(), or fex_close() is called. Pointer
|
fex_next(), fex_rewind(), fex_seek_arc(), or fex_close() is called. Pointer
|
||||||
|
|
|
@ -0,0 +1,92 @@
|
||||||
|
ACKNOWLEDGMENTS
|
||||||
|
|
||||||
|
* We used "Screaming Fast Galois Field Arithmetic Using Intel
|
||||||
|
SIMD Instructions" paper by James S. Plank, Kevin M. Greenan
|
||||||
|
and Ethan L. Miller to improve Reed-Solomon coding performance.
|
||||||
|
Also we are grateful to Artem Drobanov and Bulat Ziganshin
|
||||||
|
for samples and ideas allowed to make Reed-Solomon coding
|
||||||
|
more efficient.
|
||||||
|
|
||||||
|
* RAR text compression algorithm is based on Dmitry Shkarin PPMII
|
||||||
|
and Dmitry Subbotin carryless rangecoder public domain source code.
|
||||||
|
You may find it in ftp.elf.stuba.sk/pub/pc/pack.
|
||||||
|
|
||||||
|
* RAR encryption includes parts of code from Szymon Stefanek
|
||||||
|
and Brian Gladman AES implementations also as Steve Reid SHA-1 source.
|
||||||
|
|
||||||
|
---------------------------------------------------------------------------
|
||||||
|
Copyright (c) 2002, Dr Brian Gladman < >, Worcester, UK.
|
||||||
|
All rights reserved.
|
||||||
|
|
||||||
|
LICENSE TERMS
|
||||||
|
|
||||||
|
The free distribution and use of this software in both source and binary
|
||||||
|
form is allowed (with or without changes) provided that:
|
||||||
|
|
||||||
|
1. distributions of this source code include the above copyright
|
||||||
|
notice, this list of conditions and the following disclaimer;
|
||||||
|
|
||||||
|
2. distributions in binary form include the above copyright
|
||||||
|
notice, this list of conditions and the following disclaimer
|
||||||
|
in the documentation and/or other associated materials;
|
||||||
|
|
||||||
|
3. the copyright holder's name is not used to endorse products
|
||||||
|
built using this software without specific written permission.
|
||||||
|
|
||||||
|
ALTERNATIVELY, provided that this notice is retained in full, this product
|
||||||
|
may be distributed under the terms of the GNU General Public License (GPL),
|
||||||
|
in which case the provisions of the GPL apply INSTEAD OF those given above.
|
||||||
|
|
||||||
|
DISCLAIMER
|
||||||
|
|
||||||
|
This software is provided 'as is' with no explicit or implied warranties
|
||||||
|
in respect of its properties, including, but not limited to, correctness
|
||||||
|
and/or fitness for purpose.
|
||||||
|
---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
Source code of this package also as other cryptographic technology
|
||||||
|
and computing project related links are available on Brian Gladman's
|
||||||
|
web site: http://www.gladman.me.uk
|
||||||
|
|
||||||
|
* RAR uses CRC32 function based on Intel Slicing-by-8 algorithm.
|
||||||
|
Original Intel Slicing-by-8 code is available here:
|
||||||
|
|
||||||
|
http://sourceforge.net/projects/slicing-by-8/
|
||||||
|
|
||||||
|
Original Intel Slicing-by-8 code is licensed under BSD License
|
||||||
|
available at http://www.opensource.org/licenses/bsd-license.html
|
||||||
|
|
||||||
|
Copyright (c) 2004-2006 Intel Corporation.
|
||||||
|
All Rights Reserved
|
||||||
|
|
||||||
|
Redistribution and use in source and binary forms, with or without
|
||||||
|
modification, are permitted provided that the following conditions
|
||||||
|
are met:
|
||||||
|
|
||||||
|
Redistributions of source code must retain the above copyright notice,
|
||||||
|
this list of conditions and the following disclaimer.
|
||||||
|
|
||||||
|
Redistributions in binary form must reproduce the above copyright
|
||||||
|
notice, this list of conditions and the following disclaimer
|
||||||
|
in the documentation and/or other materials provided with
|
||||||
|
the distribution.
|
||||||
|
|
||||||
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||||
|
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||||
|
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||||
|
FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||||
|
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||||
|
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||||
|
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||||
|
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||||
|
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||||
|
OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
|
SUCH DAMAGE.
|
||||||
|
|
||||||
|
* RAR archives may optionally include BLAKE2sp hash ( https://blake2.net ),
|
||||||
|
designed by Jean-Philippe Aumasson, Samuel Neves, Zooko Wilcox-O'Hearn
|
||||||
|
and Christian Winnerlein.
|
||||||
|
|
||||||
|
* Useful hints provided by Alexander Khoroshev and Bulat Ziganshin allowed
|
||||||
|
to significantly improve RAR compression and speed.
|
|
@ -5,88 +5,87 @@
|
||||||
|
|
||||||
Archive::Archive() : Raw( this )
|
Archive::Archive() : Raw( this )
|
||||||
{
|
{
|
||||||
OldFormat=false;
|
Format=RARFMT15;
|
||||||
Solid=false;
|
Solid=false;
|
||||||
|
|
||||||
CurBlockPos=0;
|
CurBlockPos=0;
|
||||||
NextBlockPos=0;
|
NextBlockPos=0;
|
||||||
|
|
||||||
memset(&NewMhd,0,sizeof(NewMhd));
|
memset(&MainHead,0,sizeof(MainHead));
|
||||||
NewMhd.HeadType=MAIN_HEAD;
|
memset(&EndArcHead,0,sizeof(EndArcHead));
|
||||||
NewMhd.HeadSize=SIZEOF_NEWMHD;
|
|
||||||
HeaderCRC=0;
|
HeaderCRC=0;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Archive::IsSignature(byte *D)
|
RARFORMAT Archive::IsSignature(const byte *D,size_t Size)
|
||||||
{
|
{
|
||||||
bool Valid=false;
|
RARFORMAT Type=RARFMT_NONE;
|
||||||
if (D[0]==0x52)
|
if (Size>=1 && D[0]==0x52)
|
||||||
#ifndef SFX_MODULE
|
#ifndef SFX_MODULE
|
||||||
if (D[1]==0x45 && D[2]==0x7e && D[3]==0x5e)
|
if (Size>=4 && D[1]==0x45 && D[2]==0x7e && D[3]==0x5e)
|
||||||
{
|
Type=RARFMT14;
|
||||||
OldFormat=true;
|
|
||||||
Valid=true;
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
if (D[1]==0x61 && D[2]==0x72 && D[3]==0x21 && D[4]==0x1a && D[5]==0x07 && D[6]==0x00)
|
if (Size>=7 && D[1]==0x61 && D[2]==0x72 && D[3]==0x21 && D[4]==0x1a && D[5]==0x07)
|
||||||
{
|
{
|
||||||
OldFormat=false;
|
// We check for non-zero last signature byte, so we can return
|
||||||
Valid=true;
|
// a sensible warning in case we'll want to change the archive
|
||||||
|
// format sometimes in the future.
|
||||||
|
if (D[6]==0)
|
||||||
|
Type=RARFMT15;
|
||||||
|
else if (D[6]==1)
|
||||||
|
Type=RARFMT50;
|
||||||
|
else if (D[6]==2)
|
||||||
|
Type=RARFMT_FUTURE;
|
||||||
}
|
}
|
||||||
return(Valid);
|
return Type;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
unrar_err_t Archive::IsArchive()
|
unrar_err_t Archive::IsArchive()
|
||||||
{
|
{
|
||||||
if (Read(MarkHead.Mark,SIZEOF_MARKHEAD)!=SIZEOF_MARKHEAD)
|
if (Read(MarkHead.Mark,SIZEOF_MARKHEAD3)!=SIZEOF_MARKHEAD3)
|
||||||
return unrar_err_not_arc;
|
return unrar_err_not_arc;
|
||||||
|
|
||||||
if (IsSignature(MarkHead.Mark))
|
RARFORMAT Type;
|
||||||
|
if ((Type=IsSignature(MarkHead.Mark,SIZEOF_MARKHEAD3))!=RARFMT_NONE)
|
||||||
{
|
{
|
||||||
if (OldFormat)
|
Format=Type;
|
||||||
Seek(0,SEEK_SET);
|
if (Format==RARFMT14)
|
||||||
|
Seek(Tell()-SIZEOF_MARKHEAD3,SEEK_SET);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (SFXSize==0)
|
if (SFXSize==0)
|
||||||
return unrar_err_not_arc;
|
return unrar_err_not_arc;
|
||||||
}
|
}
|
||||||
|
if (Format==RARFMT_FUTURE)
|
||||||
|
return unrar_err_new_algo;
|
||||||
|
if (Format==RARFMT50) // RAR 5.0 signature is one byte longer.
|
||||||
|
{
|
||||||
|
Read(MarkHead.Mark+SIZEOF_MARKHEAD3,1);
|
||||||
|
if (MarkHead.Mark[SIZEOF_MARKHEAD3]!=0)
|
||||||
|
return unrar_err_not_arc;
|
||||||
|
MarkHead.HeadSize=SIZEOF_MARKHEAD5;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
MarkHead.HeadSize=SIZEOF_MARKHEAD3;
|
||||||
|
|
||||||
unrar_err_t error =
|
unrar_err_t error;
|
||||||
ReadHeader();
|
size_t HeaderSize;
|
||||||
// (no need to seek to next)
|
while ((error=ReadHeader(&HeaderSize))==unrar_ok && HeaderSize!=0)
|
||||||
|
{
|
||||||
|
HEADER_TYPE Type=GetHeaderType();
|
||||||
|
// In RAR 5.0 we need to quit after reading HEAD_CRYPT if we wish to
|
||||||
|
// avoid the password prompt.
|
||||||
|
if (Type==HEAD_MAIN)
|
||||||
|
break;
|
||||||
|
SeekToNext();
|
||||||
|
}
|
||||||
if ( error != unrar_ok )
|
if ( error != unrar_ok )
|
||||||
return error;
|
return error;
|
||||||
|
|
||||||
#ifndef SFX_MODULE
|
SeekToNext();
|
||||||
if (OldFormat)
|
|
||||||
{
|
|
||||||
NewMhd.Flags=OldMhd.Flags & 0x3f;
|
|
||||||
NewMhd.HeadSize=OldMhd.HeadSize;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
#endif
|
|
||||||
{
|
|
||||||
if (HeaderCRC!=NewMhd.HeadCRC)
|
|
||||||
{
|
|
||||||
return unrar_err_corrupt;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
bool
|
|
||||||
Volume=(NewMhd.Flags & MHD_VOLUME);
|
|
||||||
Solid=(NewMhd.Flags & MHD_SOLID)!=0;
|
|
||||||
bool
|
|
||||||
Encrypted=(NewMhd.Flags & MHD_PASSWORD)!=0;
|
|
||||||
|
|
||||||
// (removed decryption and volume handling)
|
|
||||||
|
|
||||||
if ( Encrypted )
|
|
||||||
return unrar_err_encrypted;
|
|
||||||
|
|
||||||
if ( Volume )
|
|
||||||
return unrar_err_segmented;
|
|
||||||
|
|
||||||
return unrar_ok;
|
return unrar_ok;
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,39 +4,49 @@
|
||||||
typedef ComprDataIO File;
|
typedef ComprDataIO File;
|
||||||
#include "rawread.hpp"
|
#include "rawread.hpp"
|
||||||
|
|
||||||
|
enum RARFORMAT {RARFMT_NONE,RARFMT14,RARFMT15,RARFMT50,RARFMT_FUTURE};
|
||||||
|
|
||||||
class Archive:public File
|
class Archive:public File
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
bool IsSignature(byte *D);
|
void ConvertFileHeader(FileHeader *hd);
|
||||||
void ConvertUnknownHeader();
|
void WriteBlock50(HEADER_TYPE HeaderType,BaseBlock *wb,bool OnlySetSize,bool NonFinalWrite);
|
||||||
int ReadOldHeader();
|
unrar_err_t ReadHeader14(size_t *ReadSize);
|
||||||
|
unrar_err_t ReadHeader15(size_t *ReadSize);
|
||||||
|
unrar_err_t ReadHeader50(size_t *ReadSize);
|
||||||
|
unrar_err_t ProcessExtra50(RawRead *Raw,size_t ExtraSize,BaseBlock *bb);
|
||||||
|
|
||||||
RawRead Raw;
|
RawRead Raw;
|
||||||
|
|
||||||
MarkHeader MarkHead;
|
HEADER_TYPE CurHeaderType;
|
||||||
OldMainHeader OldMhd;
|
|
||||||
|
|
||||||
int CurHeaderType;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Archive();
|
Archive();
|
||||||
|
RARFORMAT IsSignature(const byte *D,size_t Size);
|
||||||
unrar_err_t IsArchive();
|
unrar_err_t IsArchive();
|
||||||
unrar_err_t ReadHeader();
|
size_t SearchBlock(HEADER_TYPE HeaderType);
|
||||||
|
size_t SearchSubBlock(const wchar *Type);
|
||||||
|
size_t SearchRR();
|
||||||
|
unrar_err_t ReadHeader(size_t *ReadSize);
|
||||||
void SeekToNext();
|
void SeekToNext();
|
||||||
bool IsArcDir();
|
bool IsArcDir();
|
||||||
bool IsArcLabel();
|
bool IsArcLabel();
|
||||||
int GetHeaderType() {return(CurHeaderType);};
|
int64 GetStartPos();
|
||||||
|
HEADER_TYPE GetHeaderType() {return(CurHeaderType);};
|
||||||
|
|
||||||
BaseBlock ShortBlock;
|
BaseBlock ShortBlock;
|
||||||
MainHeader NewMhd;
|
MarkHeader MarkHead;
|
||||||
FileHeader NewLhd;
|
MainHeader MainHead;
|
||||||
|
FileHeader FileHead;
|
||||||
|
EndArcHeader EndArcHead;
|
||||||
SubBlockHeader SubBlockHead;
|
SubBlockHeader SubBlockHead;
|
||||||
FileHeader SubHead;
|
FileHeader SubHead;
|
||||||
ProtectHeader ProtectHead;
|
ProtectHeader ProtectHead;
|
||||||
|
|
||||||
Int64 CurBlockPos;
|
int64 CurBlockPos;
|
||||||
Int64 NextBlockPos;
|
int64 NextBlockPos;
|
||||||
|
|
||||||
|
RARFORMAT Format;
|
||||||
bool Solid;
|
bool Solid;
|
||||||
enum { SFXSize = 0 }; // self-extracting not supported
|
enum { SFXSize = 0 }; // self-extracting not supported
|
||||||
ushort HeaderCRC;
|
ushort HeaderCRC;
|
||||||
|
|
|
@ -5,310 +5,731 @@
|
||||||
#include "encname.hpp"
|
#include "encname.hpp"
|
||||||
|
|
||||||
// arcread.cpp
|
// arcread.cpp
|
||||||
unrar_err_t Archive::ReadHeader()
|
unrar_err_t Archive::ReadHeader(size_t * ReadSize_)
|
||||||
{
|
{
|
||||||
CurBlockPos=Tell();
|
CurBlockPos=Tell();
|
||||||
|
|
||||||
#ifndef SFX_MODULE
|
unrar_err_t Error;
|
||||||
if (OldFormat)
|
size_t ReadSize;
|
||||||
|
switch(Format)
|
||||||
{
|
{
|
||||||
ReadOldHeader();
|
#ifndef SFX_MODULE
|
||||||
|
case RARFMT14:
|
||||||
|
Error=ReadHeader14(&ReadSize);
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
|
case RARFMT15:
|
||||||
|
Error=ReadHeader15(&ReadSize);
|
||||||
|
break;
|
||||||
|
case RARFMT50:
|
||||||
|
Error=ReadHeader50(&ReadSize);
|
||||||
|
break;
|
||||||
|
|
||||||
if ( Raw.Size() == 0 )
|
default: // unreachable
|
||||||
return unrar_err_arc_eof; // right at end of file
|
Error=unrar_err_corrupt;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
if ( Raw.PaddedSize() > 0 ) // added check
|
if (Error!=unrar_ok)
|
||||||
return unrar_err_corrupt; // missing data
|
return Error;
|
||||||
|
|
||||||
|
if (ReadSize>0 && NextBlockPos<=CurBlockPos)
|
||||||
|
return unrar_err_corrupt;
|
||||||
|
|
||||||
|
*ReadSize_ = ReadSize;
|
||||||
|
|
||||||
return unrar_ok;
|
return unrar_ok;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
|
unrar_err_t Archive::ReadHeader15(size_t *ReadSize)
|
||||||
|
{
|
||||||
Raw.Reset();
|
Raw.Reset();
|
||||||
|
|
||||||
// (removed decryption)
|
|
||||||
|
|
||||||
Raw.Read(SIZEOF_SHORTBLOCKHEAD);
|
Raw.Read(SIZEOF_SHORTBLOCKHEAD);
|
||||||
if (Raw.Size()==0)
|
if (Raw.Size()==0)
|
||||||
{
|
return unrar_err_corrupt;
|
||||||
return unrar_err_arc_eof; // right at end of file
|
|
||||||
}
|
|
||||||
|
|
||||||
Raw.Get(ShortBlock.HeadCRC);
|
ShortBlock.HeadCRC=Raw.Get2();
|
||||||
byte HeadType;
|
|
||||||
Raw.Get(HeadType);
|
ShortBlock.Reset();
|
||||||
ShortBlock.HeadType=(HEADER_TYPE)HeadType;
|
|
||||||
Raw.Get(ShortBlock.Flags);
|
uint HeaderType=Raw.Get1();
|
||||||
Raw.Get(ShortBlock.HeadSize);
|
ShortBlock.Flags=Raw.Get2();
|
||||||
|
ShortBlock.SkipIfUnknown=(ShortBlock.Flags & SKIP_IF_UNKNOWN)!=0;
|
||||||
|
ShortBlock.HeadSize=Raw.Get2();
|
||||||
|
|
||||||
|
ShortBlock.HeaderType=(HEADER_TYPE)HeaderType;
|
||||||
if (ShortBlock.HeadSize<SIZEOF_SHORTBLOCKHEAD)
|
if (ShortBlock.HeadSize<SIZEOF_SHORTBLOCKHEAD)
|
||||||
|
return unrar_err_corrupt;
|
||||||
|
|
||||||
|
// For simpler further processing we map header types common
|
||||||
|
// for RAR 1.5 and 5.0 formats to RAR 5.0 values. It does not include
|
||||||
|
// header types specific for RAR 1.5 - 4.x only.
|
||||||
|
switch(ShortBlock.HeaderType)
|
||||||
{
|
{
|
||||||
return unrar_err_corrupt; // invalid HeadSize
|
case HEAD3_MAIN: ShortBlock.HeaderType=HEAD_MAIN; break;
|
||||||
|
case HEAD3_FILE: ShortBlock.HeaderType=HEAD_FILE; break;
|
||||||
|
case HEAD3_SERVICE: ShortBlock.HeaderType=HEAD_SERVICE; break;
|
||||||
|
case HEAD3_ENDARC: ShortBlock.HeaderType=HEAD_ENDARC; break;
|
||||||
|
default: break;
|
||||||
}
|
}
|
||||||
|
CurHeaderType=ShortBlock.HeaderType;
|
||||||
|
|
||||||
// catches unknown block types and reading something that isn't even a header
|
if (ShortBlock.HeaderType==HEAD3_CMT)
|
||||||
check( MARK_HEAD <= ShortBlock.HeadType && ShortBlock.HeadType <= ENDARC_HEAD );
|
{
|
||||||
|
// Old style (up to RAR 2.9) comment header embedded into main
|
||||||
if (ShortBlock.HeadType==COMM_HEAD)
|
// or file header. We must not read the entire ShortBlock.HeadSize here
|
||||||
|
// to not break the comment processing logic later.
|
||||||
Raw.Read(SIZEOF_COMMHEAD-SIZEOF_SHORTBLOCKHEAD);
|
Raw.Read(SIZEOF_COMMHEAD-SIZEOF_SHORTBLOCKHEAD);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
if (ShortBlock.HeadType==MAIN_HEAD && (ShortBlock.Flags & MHD_COMMENT)!=0)
|
if (ShortBlock.HeaderType==HEAD_MAIN && (ShortBlock.Flags & MHD_COMMENT)!=0)
|
||||||
Raw.Read(SIZEOF_NEWMHD-SIZEOF_SHORTBLOCKHEAD);
|
{
|
||||||
|
// Old style (up to RAR 2.9) main archive comment embedded into
|
||||||
|
// the main archive header found. While we can read the entire
|
||||||
|
// ShortBlock.HeadSize here and remove this part of "if", it would be
|
||||||
|
// waste of memory, because we'll read and process this comment data
|
||||||
|
// in other function anyway and we do not need them here now.
|
||||||
|
Raw.Read(SIZEOF_MAINHEAD3-SIZEOF_SHORTBLOCKHEAD);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
Raw.Read(ShortBlock.HeadSize-SIZEOF_SHORTBLOCKHEAD);
|
Raw.Read(ShortBlock.HeadSize-SIZEOF_SHORTBLOCKHEAD);
|
||||||
|
|
||||||
if ( Raw.PaddedSize() > 0 ) // fewer than requested bytes read above?
|
|
||||||
return unrar_err_corrupt; // missing data
|
|
||||||
|
|
||||||
NextBlockPos=CurBlockPos+ShortBlock.HeadSize;
|
NextBlockPos=CurBlockPos+ShortBlock.HeadSize;
|
||||||
|
|
||||||
switch(ShortBlock.HeadType)
|
switch(ShortBlock.HeaderType)
|
||||||
{
|
{
|
||||||
case MAIN_HEAD:
|
case HEAD_MAIN:
|
||||||
*(BaseBlock *)&NewMhd=ShortBlock;
|
MainHead.Reset();
|
||||||
Raw.Get(NewMhd.HighPosAV);
|
*(BaseBlock *)&MainHead=ShortBlock;
|
||||||
Raw.Get(NewMhd.PosAV);
|
MainHead.HighPosAV=Raw.Get2();
|
||||||
check( Raw.ReadPos == Raw.DataSize ); // we should have read all fields
|
MainHead.PosAV=Raw.Get4();
|
||||||
|
|
||||||
|
Solid=(MainHead.Flags & MHD_SOLID)!=0;
|
||||||
|
MainHead.CommentInHeader=(MainHead.Flags & MHD_COMMENT)!=0;
|
||||||
break;
|
break;
|
||||||
case FILE_HEAD:
|
case HEAD_FILE:
|
||||||
case NEWSUB_HEAD:
|
case HEAD_SERVICE:
|
||||||
{
|
{
|
||||||
FileHeader *hd=ShortBlock.HeadType==FILE_HEAD ? &NewLhd:&SubHead;
|
bool FileBlock=ShortBlock.HeaderType==HEAD_FILE;
|
||||||
|
FileHeader *hd=FileBlock ? &FileHead:&SubHead;
|
||||||
|
hd->Reset();
|
||||||
|
|
||||||
*(BaseBlock *)hd=ShortBlock;
|
*(BaseBlock *)hd=ShortBlock;
|
||||||
Raw.Get(hd->PackSize);
|
|
||||||
Raw.Get(hd->UnpSize);
|
hd->SplitBefore=(hd->Flags & LHD_SPLIT_BEFORE)!=0;
|
||||||
Raw.Get(hd->HostOS);
|
hd->SplitAfter=(hd->Flags & LHD_SPLIT_AFTER)!=0;
|
||||||
Raw.Get(hd->FileCRC);
|
hd->Encrypted=(hd->Flags & LHD_PASSWORD)!=0;
|
||||||
Raw.Get(hd->FileTime);
|
hd->Solid=FileBlock && (hd->Flags & LHD_SOLID)!=0;
|
||||||
Raw.Get(hd->UnpVer);
|
hd->SubBlock=!FileBlock && (hd->Flags & LHD_SOLID)!=0;
|
||||||
Raw.Get(hd->Method);
|
hd->Dir=(hd->Flags & LHD_WINDOWMASK)==LHD_DIRECTORY;
|
||||||
Raw.Get(hd->NameSize);
|
hd->WinSize=hd->Dir ? 0:0x10000<<((hd->Flags & LHD_WINDOWMASK)>>5);
|
||||||
Raw.Get(hd->FileAttr);
|
hd->CommentInHeader=(hd->Flags & LHD_COMMENT)!=0;
|
||||||
if (hd->Flags & LHD_LARGE)
|
hd->Version=(hd->Flags & LHD_VERSION)!=0;
|
||||||
|
|
||||||
|
hd->DataSize=Raw.Get4();
|
||||||
|
uint LowUnpSize=Raw.Get4();
|
||||||
|
hd->HostOS=Raw.Get1();
|
||||||
|
|
||||||
|
hd->FileHash.Type=HASH_CRC32;
|
||||||
|
hd->FileHash.CRC32=Raw.Get4();
|
||||||
|
|
||||||
|
uint FileTime=Raw.Get4();
|
||||||
|
hd->UnpVer=Raw.Get1();
|
||||||
|
hd->Method=Raw.Get1()-0x30;
|
||||||
|
size_t NameSize=Raw.Get2();
|
||||||
|
hd->FileAttr=Raw.Get4();
|
||||||
|
|
||||||
|
if (hd->Encrypted)
|
||||||
|
return unrar_err_encrypted;
|
||||||
|
|
||||||
|
hd->HSType=HSYS_UNKNOWN;
|
||||||
|
if (hd->HostOS==HOST_UNIX || hd->HostOS==HOST_BEOS)
|
||||||
|
hd->HSType=HSYS_UNIX;
|
||||||
|
else
|
||||||
|
if (hd->HostOS<HOST_MAX)
|
||||||
|
hd->HSType=HSYS_WINDOWS;
|
||||||
|
|
||||||
|
hd->RedirType=FSREDIR_NONE;
|
||||||
|
|
||||||
|
// RAR 4.x Unix symlink.
|
||||||
|
if (hd->HostOS==HOST_UNIX && (hd->FileAttr & 0xF000)==0xA000)
|
||||||
{
|
{
|
||||||
Raw.Get(hd->HighPackSize);
|
hd->RedirType=FSREDIR_UNIXSYMLINK;
|
||||||
Raw.Get(hd->HighUnpSize);
|
*hd->RedirName=0;
|
||||||
|
}
|
||||||
|
|
||||||
|
hd->Inherited=!FileBlock && (hd->SubFlags & SUBHEAD_FLAGS_INHERITED)!=0;
|
||||||
|
|
||||||
|
hd->LargeFile=(hd->Flags & LHD_LARGE)!=0;
|
||||||
|
|
||||||
|
uint HighPackSize,HighUnpSize;
|
||||||
|
if (hd->LargeFile)
|
||||||
|
{
|
||||||
|
HighPackSize=Raw.Get4();
|
||||||
|
HighUnpSize=Raw.Get4();
|
||||||
|
hd->UnknownUnpSize=(LowUnpSize==0xffffffff && HighUnpSize==0xffffffff);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
hd->HighPackSize=hd->HighUnpSize=0;
|
HighPackSize=HighUnpSize=0;
|
||||||
if (hd->UnpSize==0xffffffff)
|
// UnpSize equal to 0xffffffff without LHD_LARGE flag indicates
|
||||||
{
|
// that we do not know the unpacked file size and must unpack it
|
||||||
// TODO: what the heck is this for anyway?
|
// until we find the end of file marker in compressed data.
|
||||||
hd->UnpSize=0;
|
hd->UnknownUnpSize=(LowUnpSize==0xffffffff);
|
||||||
hd->HighUnpSize=0x7fffffff;
|
|
||||||
}
|
}
|
||||||
}
|
hd->PackSize=int32to64(HighPackSize,hd->DataSize);
|
||||||
hd->FullPackSize=int32to64(hd->HighPackSize,hd->PackSize);
|
hd->UnpSize=int32to64(HighUnpSize,LowUnpSize);
|
||||||
hd->FullUnpSize=int32to64(hd->HighUnpSize,hd->UnpSize);
|
if (hd->UnknownUnpSize)
|
||||||
|
hd->UnpSize=INT64NDF;
|
||||||
|
|
||||||
if ( int32to64( 1, 0 ) == 0 && (hd->HighPackSize || hd->HighUnpSize) )
|
char FileName[NM*4];
|
||||||
return unrar_err_huge;
|
size_t ReadNameSize=Min(NameSize,ASIZE(FileName)-1);
|
||||||
|
Raw.GetB((byte *)FileName,ReadNameSize);
|
||||||
|
FileName[ReadNameSize]=0;
|
||||||
|
|
||||||
char (&FileName) [sizeof hd->FileName] = hd->FileName; // eliminated local buffer
|
if (FileBlock)
|
||||||
int NameSize=Min(hd->NameSize,sizeof(FileName)-1);
|
|
||||||
Raw.Get((byte *)FileName,NameSize);
|
|
||||||
FileName[NameSize]=0;
|
|
||||||
|
|
||||||
if (hd->HeadType==NEWSUB_HEAD)
|
|
||||||
{
|
{
|
||||||
// have to adjust this, even through we're ignoring this block
|
if ((hd->Flags & LHD_UNICODE)!=0)
|
||||||
NextBlockPos+=hd->FullPackSize;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
if (hd->HeadType==FILE_HEAD)
|
|
||||||
{
|
|
||||||
if (hd->Flags & LHD_UNICODE)
|
|
||||||
{
|
{
|
||||||
EncodeFileName NameCoder;
|
EncodeFileName NameCoder;
|
||||||
int Length=strlen(FileName);
|
size_t Length=strlen(FileName);
|
||||||
if (Length==hd->NameSize)
|
|
||||||
{
|
|
||||||
UtfToWide(FileName,hd->FileNameW,sizeof(hd->FileNameW)/sizeof(hd->FileNameW[0])-1);
|
|
||||||
WideToChar(hd->FileNameW,hd->FileName,sizeof(hd->FileName)/sizeof(hd->FileName[0])-1);
|
|
||||||
ExtToInt(hd->FileName,hd->FileName);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Length++;
|
Length++;
|
||||||
NameCoder.Decode(FileName,(byte *)FileName+Length,
|
NameCoder.Decode(FileName,(byte *)FileName+Length,
|
||||||
hd->NameSize-Length,hd->FileNameW,
|
NameSize-Length,hd->FileName,
|
||||||
sizeof(hd->FileNameW)/sizeof(hd->FileNameW[0]));
|
ASIZE(hd->FileName));
|
||||||
}
|
|
||||||
if (*hd->FileNameW==0)
|
|
||||||
hd->Flags &= ~LHD_UNICODE;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
*hd->FileNameW=0;
|
*hd->FileName=0;
|
||||||
|
|
||||||
ConvertUnknownHeader();
|
char AnsiName[NM];
|
||||||
|
IntToExt(FileName,AnsiName,ASIZE(AnsiName));
|
||||||
|
GetWideName(AnsiName,hd->FileName,hd->FileName,ASIZE(hd->FileName));
|
||||||
|
|
||||||
|
ConvertFileHeader(hd);
|
||||||
}
|
}
|
||||||
if (hd->Flags & LHD_SALT)
|
else
|
||||||
Raw.Get(hd->Salt,SALT_SIZE);
|
|
||||||
hd->mtime.SetDos(hd->FileTime);
|
|
||||||
if (hd->Flags & LHD_EXTTIME)
|
|
||||||
{
|
{
|
||||||
ushort Flags;
|
CharToWide(FileName,hd->FileName,ASIZE(hd->FileName));
|
||||||
Raw.Get(Flags);
|
|
||||||
// Ignore additional time information
|
// Calculate the size of optional data.
|
||||||
|
int DataSize=int(hd->HeadSize-NameSize-SIZEOF_FILEHEAD3);
|
||||||
|
if ((hd->Flags & LHD_SALT)!=0)
|
||||||
|
return unrar_err_encrypted;
|
||||||
|
|
||||||
|
if (DataSize>0)
|
||||||
|
{
|
||||||
|
// Here we read optional additional fields for subheaders.
|
||||||
|
// They are stored after the file name and before salt.
|
||||||
|
hd->SubData.Alloc(DataSize);
|
||||||
|
Raw.GetB(&hd->SubData[0],DataSize);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ((hd->Flags & LHD_SALT)!=0)
|
||||||
|
return unrar_err_encrypted;
|
||||||
|
hd->mtime.SetDos(FileTime);
|
||||||
|
if ((hd->Flags & LHD_EXTTIME)!=0)
|
||||||
|
{
|
||||||
|
ushort Flags=Raw.Get2();
|
||||||
|
RarTime *tbl[4];
|
||||||
|
tbl[0]=&FileHead.mtime;
|
||||||
|
tbl[1]=&FileHead.ctime;
|
||||||
|
tbl[2]=&FileHead.atime;
|
||||||
|
tbl[3]=NULL; // Archive time is not used now.
|
||||||
for (int I=0;I<4;I++)
|
for (int I=0;I<4;I++)
|
||||||
{
|
{
|
||||||
|
RarTime *CurTime=tbl[I];
|
||||||
uint rmode=Flags>>(3-I)*4;
|
uint rmode=Flags>>(3-I)*4;
|
||||||
if ((rmode & 8)==0)
|
if ((rmode & 8)==0 || CurTime==NULL)
|
||||||
continue;
|
continue;
|
||||||
if (I!=0)
|
if (I!=0)
|
||||||
{
|
{
|
||||||
uint DosTime;
|
uint DosTime=Raw.Get4();
|
||||||
Raw.Get(DosTime);
|
CurTime->SetDos(DosTime);
|
||||||
}
|
}
|
||||||
|
RarLocalTime rlt;
|
||||||
// skip time info
|
CurTime->GetLocal(&rlt);
|
||||||
|
if (rmode & 4)
|
||||||
|
rlt.Second++;
|
||||||
|
rlt.Reminder=0;
|
||||||
int count=rmode&3;
|
int count=rmode&3;
|
||||||
for (int J=0;J<count;J++)
|
for (int J=0;J<count;J++)
|
||||||
{
|
{
|
||||||
byte CurByte;
|
byte CurByte=Raw.Get1();
|
||||||
Raw.Get(CurByte);
|
rlt.Reminder|=(((uint)CurByte)<<((J+3-count)*8));
|
||||||
|
}
|
||||||
|
CurTime->SetLocal(&rlt);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
NextBlockPos+=hd->PackSize;
|
||||||
NextBlockPos+=hd->FullPackSize;
|
bool CRCProcessedOnly=hd->CommentInHeader;
|
||||||
bool CRCProcessedOnly=(hd->Flags & LHD_COMMENT)!=0;
|
ushort HeaderCRC=Raw.GetCRC15(CRCProcessedOnly);
|
||||||
HeaderCRC=~Raw.GetCRC(CRCProcessedOnly)&0xffff;
|
|
||||||
if (hd->HeadCRC!=HeaderCRC)
|
if (hd->HeadCRC!=HeaderCRC)
|
||||||
return unrar_err_corrupt;
|
return unrar_err_corrupt;
|
||||||
check( CRCProcessedOnly == false ); // I need to test on archives where this doesn't hold
|
|
||||||
check( Raw.ReadPos == Raw.DataSize ); // we should have read all fields
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
#ifndef SFX_MODULE
|
case HEAD_ENDARC:
|
||||||
// Handle these block types just so we can adjust NextBlockPos properly
|
*(BaseBlock *)&EndArcHead=ShortBlock;
|
||||||
case PROTECT_HEAD:
|
EndArcHead.NextVolume=(EndArcHead.Flags & EARC_NEXT_VOLUME)!=0;
|
||||||
Raw.Get(ProtectHead.DataSize);
|
EndArcHead.DataCRC=(EndArcHead.Flags & EARC_DATACRC)!=0;
|
||||||
NextBlockPos+=ProtectHead.DataSize;
|
EndArcHead.RevSpace=(EndArcHead.Flags & EARC_REVSPACE)!=0;
|
||||||
|
EndArcHead.StoreVolNumber=(EndArcHead.Flags & EARC_VOLNUMBER)!=0;
|
||||||
|
if (EndArcHead.DataCRC)
|
||||||
|
EndArcHead.ArcDataCRC=Raw.Get4();
|
||||||
|
if (EndArcHead.StoreVolNumber)
|
||||||
|
return unrar_err_segmented;
|
||||||
break;
|
break;
|
||||||
case SUB_HEAD:
|
|
||||||
Raw.Get(SubBlockHead.DataSize);
|
|
||||||
NextBlockPos+=SubBlockHead.DataSize;
|
|
||||||
break;
|
|
||||||
#endif
|
|
||||||
default:
|
default:
|
||||||
if (ShortBlock.Flags & LONG_BLOCK)
|
if (ShortBlock.Flags & LONG_BLOCK)
|
||||||
|
NextBlockPos+=Raw.Get4();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
ushort HeaderCRC=Raw.GetCRC15(false);
|
||||||
|
|
||||||
|
// Old AV header does not have header CRC properly set.
|
||||||
|
if (ShortBlock.HeadCRC!=HeaderCRC && ShortBlock.HeaderType!=HEAD3_SIGN &&
|
||||||
|
ShortBlock.HeaderType!=HEAD3_AV)
|
||||||
|
return unrar_err_corrupt;
|
||||||
|
|
||||||
|
if (NextBlockPos<=CurBlockPos)
|
||||||
|
return unrar_err_corrupt;
|
||||||
|
|
||||||
|
*ReadSize=Raw.Size();
|
||||||
|
return unrar_ok;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
unrar_err_t Archive::ReadHeader50(size_t *ReadSize)
|
||||||
{
|
{
|
||||||
uint DataSize;
|
Raw.Reset();
|
||||||
Raw.Get(DataSize);
|
|
||||||
NextBlockPos+=DataSize;
|
// Header size must not occupy more than 3 variable length integer bytes
|
||||||
|
// resulting in 2 MB maximum header size, so here we read 4 byte CRC32
|
||||||
|
// followed by 3 bytes or less of header size.
|
||||||
|
const size_t FirstReadSize=7; // Smallest possible block size.
|
||||||
|
if (Raw.Read(FirstReadSize)<FirstReadSize)
|
||||||
|
return unrar_err_arc_eof;
|
||||||
|
|
||||||
|
ShortBlock.Reset();
|
||||||
|
ShortBlock.HeadCRC=Raw.Get4();
|
||||||
|
uint SizeBytes=Raw.GetVSize(4);
|
||||||
|
uint64 BlockSize=Raw.GetV();
|
||||||
|
|
||||||
|
if (BlockSize==0 || SizeBytes==0)
|
||||||
|
return unrar_err_corrupt;
|
||||||
|
|
||||||
|
int SizeToRead=int(BlockSize);
|
||||||
|
SizeToRead-=FirstReadSize-SizeBytes-4; // Adjust overread size bytes if any.
|
||||||
|
uint HeaderSize=4+SizeBytes+(uint)BlockSize;
|
||||||
|
|
||||||
|
if (SizeToRead<0 || HeaderSize<SIZEOF_SHORTBLOCKHEAD5)
|
||||||
|
return unrar_err_corrupt;
|
||||||
|
|
||||||
|
Raw.Read(SizeToRead);
|
||||||
|
|
||||||
|
if (Raw.Size()<HeaderSize)
|
||||||
|
return unrar_err_arc_eof;
|
||||||
|
|
||||||
|
uint HeaderCRC=Raw.GetCRC50();
|
||||||
|
|
||||||
|
ShortBlock.HeaderType=(HEADER_TYPE)Raw.GetV();
|
||||||
|
ShortBlock.Flags=(uint)Raw.GetV();
|
||||||
|
ShortBlock.SkipIfUnknown=(ShortBlock.Flags & HFL_SKIPIFUNKNOWN)!=0;
|
||||||
|
ShortBlock.HeadSize=HeaderSize;
|
||||||
|
|
||||||
|
CurHeaderType=ShortBlock.HeaderType;
|
||||||
|
|
||||||
|
bool BadCRC=(ShortBlock.HeadCRC!=HeaderCRC);
|
||||||
|
if (BadCRC)
|
||||||
|
return unrar_err_corrupt;
|
||||||
|
|
||||||
|
uint64 ExtraSize=0;
|
||||||
|
if ((ShortBlock.Flags & HFL_EXTRA)!=0)
|
||||||
|
{
|
||||||
|
ExtraSize=Raw.GetV();
|
||||||
|
if (ExtraSize>=ShortBlock.HeadSize)
|
||||||
|
return unrar_err_corrupt;
|
||||||
|
}
|
||||||
|
|
||||||
|
uint64 DataSize=0;
|
||||||
|
if ((ShortBlock.Flags & HFL_DATA)!=0)
|
||||||
|
DataSize=Raw.GetV();
|
||||||
|
|
||||||
|
NextBlockPos=CurBlockPos+ShortBlock.HeadSize+DataSize;
|
||||||
|
|
||||||
|
switch(ShortBlock.HeaderType)
|
||||||
|
{
|
||||||
|
case HEAD_CRYPT:
|
||||||
|
return unrar_err_encrypted;
|
||||||
|
case HEAD_MAIN:
|
||||||
|
{
|
||||||
|
MainHead.Reset();
|
||||||
|
*(BaseBlock *)&MainHead=ShortBlock;
|
||||||
|
uint ArcFlags=(uint)Raw.GetV();
|
||||||
|
|
||||||
|
Solid=(ArcFlags & MHFL_SOLID)!=0;
|
||||||
|
|
||||||
|
if (ExtraSize!=0)
|
||||||
|
{
|
||||||
|
unrar_err_t Error;
|
||||||
|
if ((Error=ProcessExtra50(&Raw,(size_t)ExtraSize,&MainHead))!=unrar_ok)
|
||||||
|
return Error;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case HEAD_FILE:
|
||||||
|
case HEAD_SERVICE:
|
||||||
|
{
|
||||||
|
FileHeader *hd=ShortBlock.HeaderType==HEAD_FILE ? &FileHead:&SubHead;
|
||||||
|
hd->Reset();
|
||||||
|
*(BaseBlock *)hd=ShortBlock;
|
||||||
|
|
||||||
|
bool FileBlock=ShortBlock.HeaderType==HEAD_FILE;
|
||||||
|
|
||||||
|
hd->LargeFile=true;
|
||||||
|
|
||||||
|
hd->PackSize=DataSize;
|
||||||
|
hd->FileFlags=(uint)Raw.GetV();
|
||||||
|
hd->UnpSize=Raw.GetV();
|
||||||
|
|
||||||
|
hd->UnknownUnpSize=(hd->FileFlags & FHFL_UNPUNKNOWN)!=0;
|
||||||
|
if (hd->UnknownUnpSize)
|
||||||
|
hd->UnpSize=INT64NDF;
|
||||||
|
|
||||||
|
hd->MaxSize=Max(hd->PackSize,hd->UnpSize);
|
||||||
|
hd->FileAttr=(uint)Raw.GetV();
|
||||||
|
if ((hd->FileFlags & FHFL_UTIME)!=0)
|
||||||
|
hd->mtime=(time_t)Raw.Get4();
|
||||||
|
|
||||||
|
hd->FileHash.Type=HASH_NONE;
|
||||||
|
if ((hd->FileFlags & FHFL_CRC32)!=0)
|
||||||
|
{
|
||||||
|
hd->FileHash.Type=HASH_CRC32;
|
||||||
|
hd->FileHash.CRC32=Raw.Get4();
|
||||||
|
}
|
||||||
|
|
||||||
|
hd->RedirType=FSREDIR_NONE;
|
||||||
|
|
||||||
|
uint CompInfo=(uint)Raw.GetV();
|
||||||
|
hd->Method=(CompInfo>>7) & 7;
|
||||||
|
hd->UnpVer=CompInfo & 0x3f;
|
||||||
|
|
||||||
|
hd->HostOS=(byte)Raw.GetV();
|
||||||
|
size_t NameSize=(size_t)Raw.GetV();
|
||||||
|
hd->Inherited=(ShortBlock.Flags & HFL_INHERITED)!=0;
|
||||||
|
|
||||||
|
hd->HSType=HSYS_UNKNOWN;
|
||||||
|
if (hd->HostOS==HOST5_UNIX)
|
||||||
|
hd->HSType=HSYS_UNIX;
|
||||||
|
else
|
||||||
|
if (hd->HostOS==HOST5_WINDOWS)
|
||||||
|
hd->HSType=HSYS_WINDOWS;
|
||||||
|
|
||||||
|
hd->SplitBefore=(hd->Flags & HFL_SPLITBEFORE)!=0;
|
||||||
|
hd->SplitAfter=(hd->Flags & HFL_SPLITAFTER)!=0;
|
||||||
|
hd->SubBlock=(hd->Flags & HFL_CHILD)!=0;
|
||||||
|
hd->Solid=FileBlock && (CompInfo & FCI_SOLID)!=0;
|
||||||
|
hd->Dir=(hd->FileFlags & FHFL_DIRECTORY)!=0;
|
||||||
|
hd->WinSize=hd->Dir ? 0:size_t(0x20000)<<((CompInfo>>10)&0xf);
|
||||||
|
|
||||||
|
if (hd->Encrypted)
|
||||||
|
return unrar_err_encrypted;
|
||||||
|
|
||||||
|
char FileName[NM*4];
|
||||||
|
size_t ReadNameSize=Min(NameSize,ASIZE(FileName)-1);
|
||||||
|
Raw.GetB((byte *)FileName,ReadNameSize);
|
||||||
|
FileName[ReadNameSize]=0;
|
||||||
|
|
||||||
|
UtfToWide(FileName,hd->FileName,ASIZE(hd->FileName)-1);
|
||||||
|
|
||||||
|
// Should do it before converting names, because extra fields can
|
||||||
|
// affect name processing, like in case of NTFS streams.
|
||||||
|
if (ExtraSize!=0)
|
||||||
|
ProcessExtra50(&Raw,(size_t)ExtraSize,hd);
|
||||||
|
|
||||||
|
if (FileBlock)
|
||||||
|
ConvertFileHeader(hd);
|
||||||
|
|
||||||
|
if (BadCRC) // Add the file name to broken header message displayed above.
|
||||||
|
return unrar_err_corrupt;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case HEAD_ENDARC:
|
||||||
|
{
|
||||||
|
*(BaseBlock *)&EndArcHead=ShortBlock;
|
||||||
|
uint ArcFlags=(uint)Raw.GetV();
|
||||||
|
EndArcHead.NextVolume=(ArcFlags & EHFL_NEXTVOLUME)!=0;
|
||||||
|
EndArcHead.StoreVolNumber=false;
|
||||||
|
EndArcHead.DataCRC=false;
|
||||||
|
EndArcHead.RevSpace=false;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
HeaderCRC=~Raw.GetCRC(false)&0xffff;
|
|
||||||
CurHeaderType=ShortBlock.HeadType;
|
|
||||||
// (removed decryption)
|
|
||||||
|
|
||||||
if (NextBlockPos<CurBlockPos+Raw.Size())
|
if (NextBlockPos<=CurBlockPos)
|
||||||
return unrar_err_corrupt; // next block isn't past end of current block's header
|
return unrar_err_corrupt;
|
||||||
|
|
||||||
// If pos went negative, then unrar_pos_t is only 32 bits and it overflowed
|
*ReadSize=Raw.Size();
|
||||||
if ( NextBlockPos < 0 )
|
|
||||||
return unrar_err_huge;
|
|
||||||
|
|
||||||
return unrar_ok;
|
return unrar_ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Rar.Read()s are checked by caller of ReadOldHeader() (see above)
|
|
||||||
|
unrar_err_t Archive::ProcessExtra50(RawRead *Raw,size_t ExtraSize,BaseBlock *bb)
|
||||||
|
{
|
||||||
|
// Read extra data from the end of block skipping any fields before it.
|
||||||
|
size_t ExtraStart=Raw->Size()-ExtraSize;
|
||||||
|
if (ExtraStart<Raw->GetPos())
|
||||||
|
return unrar_err_corrupt;
|
||||||
|
Raw->SetPos(ExtraStart);
|
||||||
|
while (Raw->DataLeft()>=2)
|
||||||
|
{
|
||||||
|
int64 FieldSize=Raw->GetV();
|
||||||
|
if (FieldSize==0 || Raw->DataLeft()==0 || FieldSize>(int64)Raw->DataLeft())
|
||||||
|
break;
|
||||||
|
size_t NextPos=size_t(Raw->GetPos()+FieldSize);
|
||||||
|
uint64 FieldType=Raw->GetV();
|
||||||
|
|
||||||
|
FieldSize=Raw->DataLeft(); // Field size without size and type fields.
|
||||||
|
|
||||||
|
if (bb->HeaderType==HEAD_MAIN)
|
||||||
|
{
|
||||||
|
MainHeader *hd=(MainHeader *)bb;
|
||||||
|
if (FieldType==MHEXTRA_LOCATOR)
|
||||||
|
{
|
||||||
|
hd->Locator=true;
|
||||||
|
uint Flags=(uint)Raw->GetV();
|
||||||
|
if ((Flags & MHEXTRA_LOCATOR_QLIST)!=0)
|
||||||
|
{
|
||||||
|
uint64 Offset=Raw->GetV();
|
||||||
|
if (Offset!=0) // 0 means that reserved space was not enough to write the offset.
|
||||||
|
hd->QOpenOffset=Offset+CurBlockPos;
|
||||||
|
}
|
||||||
|
if ((Flags & MHEXTRA_LOCATOR_RR)!=0)
|
||||||
|
{
|
||||||
|
uint64 Offset=Raw->GetV();
|
||||||
|
if (Offset!=0) // 0 means that reserved space was not enough to write the offset.
|
||||||
|
hd->RROffset=Offset+CurBlockPos;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (bb->HeaderType==HEAD_FILE || bb->HeaderType==HEAD_SERVICE)
|
||||||
|
{
|
||||||
|
FileHeader *hd=(FileHeader *)bb;
|
||||||
|
switch(FieldType)
|
||||||
|
{
|
||||||
|
case FHEXTRA_CRYPT:
|
||||||
|
return unrar_err_encrypted;
|
||||||
|
case FHEXTRA_HASH:
|
||||||
|
{
|
||||||
|
FileHeader *hd=(FileHeader *)bb;
|
||||||
|
uint Type=(uint)Raw->GetV();
|
||||||
|
if (Type==FHEXTRA_HASH_BLAKE2)
|
||||||
|
{
|
||||||
|
hd->FileHash.Type=HASH_BLAKE2;
|
||||||
|
Raw->GetB(hd->FileHash.Digest,BLAKE2_DIGEST_SIZE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case FHEXTRA_HTIME:
|
||||||
|
if (FieldSize>=9)
|
||||||
|
{
|
||||||
|
byte Flags=(byte)Raw->GetV();
|
||||||
|
bool UnixTime=(Flags & FHEXTRA_HTIME_UNIXTIME)!=0;
|
||||||
|
if ((Flags & FHEXTRA_HTIME_MTIME)!=0)
|
||||||
|
{
|
||||||
|
if (UnixTime)
|
||||||
|
hd->mtime=(time_t)Raw->Get4();
|
||||||
|
else
|
||||||
|
hd->mtime.SetRaw(Raw->Get8());
|
||||||
|
}
|
||||||
|
if ((Flags & FHEXTRA_HTIME_CTIME)!=0)
|
||||||
|
{
|
||||||
|
if (UnixTime)
|
||||||
|
hd->ctime=(time_t)Raw->Get4();
|
||||||
|
else
|
||||||
|
hd->ctime.SetRaw(Raw->Get8());
|
||||||
|
}
|
||||||
|
if ((Flags & FHEXTRA_HTIME_ATIME)!=0)
|
||||||
|
{
|
||||||
|
if (UnixTime)
|
||||||
|
hd->atime=(time_t)Raw->Get4();
|
||||||
|
else
|
||||||
|
hd->atime.SetRaw(Raw->Get8());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case FHEXTRA_REDIR:
|
||||||
|
{
|
||||||
|
hd->RedirType=(FILE_SYSTEM_REDIRECT)Raw->GetV();
|
||||||
|
uint Flags=(uint)Raw->GetV();
|
||||||
|
hd->DirTarget=(Flags & FHEXTRA_REDIR_DIR)!=0;
|
||||||
|
size_t NameSize=(size_t)Raw->GetV();
|
||||||
|
|
||||||
|
char UtfName[NM*4];
|
||||||
|
*UtfName=0;
|
||||||
|
if (NameSize<ASIZE(UtfName)-1)
|
||||||
|
{
|
||||||
|
Raw->GetB(UtfName,NameSize);
|
||||||
|
UtfName[NameSize]=0;
|
||||||
|
}
|
||||||
|
#ifdef _WIN_ALL
|
||||||
|
UnixSlashToDos(UtfName,UtfName,ASIZE(UtfName));
|
||||||
|
#endif
|
||||||
|
UtfToWide(UtfName,hd->RedirName,ASIZE(hd->RedirName));
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case FHEXTRA_UOWNER:
|
||||||
|
{
|
||||||
|
uint Flags=(uint)Raw->GetV();
|
||||||
|
hd->UnixOwnerNumeric=(Flags & FHEXTRA_UOWNER_NUMUID)!=0;
|
||||||
|
hd->UnixGroupNumeric=(Flags & FHEXTRA_UOWNER_NUMGID)!=0;
|
||||||
|
*hd->UnixOwnerName=*hd->UnixGroupName=0;
|
||||||
|
if ((Flags & FHEXTRA_UOWNER_UNAME)!=0)
|
||||||
|
{
|
||||||
|
size_t Length=(size_t)Raw->GetV();
|
||||||
|
Length=Min(Length,ASIZE(hd->UnixOwnerName)-1);
|
||||||
|
Raw->GetB(hd->UnixOwnerName,Length);
|
||||||
|
hd->UnixOwnerName[Length]=0;
|
||||||
|
}
|
||||||
|
if ((Flags & FHEXTRA_UOWNER_GNAME)!=0)
|
||||||
|
{
|
||||||
|
size_t Length=(size_t)Raw->GetV();
|
||||||
|
Length=Min(Length,ASIZE(hd->UnixGroupName)-1);
|
||||||
|
Raw->GetB(hd->UnixGroupName,Length);
|
||||||
|
hd->UnixGroupName[Length]=0;
|
||||||
|
}
|
||||||
|
#ifdef _UNIX
|
||||||
|
if (hd->UnixOwnerNumeric)
|
||||||
|
hd->UnixOwnerID=(uid_t)Raw->GetV();
|
||||||
|
if (hd->UnixGroupNumeric)
|
||||||
|
hd->UnixGroupID=(uid_t)Raw->GetV();
|
||||||
|
#else
|
||||||
|
// Need these fields in Windows too for 'list' command,
|
||||||
|
// but uid_t and gid_t are not defined.
|
||||||
|
if (hd->UnixOwnerNumeric)
|
||||||
|
hd->UnixOwnerID=(uint)Raw->GetV();
|
||||||
|
if (hd->UnixGroupNumeric)
|
||||||
|
hd->UnixGroupID=(uint)Raw->GetV();
|
||||||
|
#endif
|
||||||
|
hd->UnixOwnerSet=true;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case FHEXTRA_SUBDATA:
|
||||||
|
{
|
||||||
|
hd->SubData.Alloc((size_t)FieldSize);
|
||||||
|
Raw->GetB(hd->SubData.Addr(0),(size_t)FieldSize);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Raw->SetPos(NextPos);
|
||||||
|
}
|
||||||
|
|
||||||
|
return unrar_ok;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#ifndef SFX_MODULE
|
#ifndef SFX_MODULE
|
||||||
int Archive::ReadOldHeader()
|
unrar_err_t Archive::ReadHeader14(size_t *ReadSize)
|
||||||
{
|
{
|
||||||
Raw.Reset();
|
Raw.Reset();
|
||||||
if (CurBlockPos<=SFXSize)
|
|
||||||
|
if (CurBlockPos<=(int64)SFXSize)
|
||||||
{
|
{
|
||||||
Raw.Read(SIZEOF_OLDMHD);
|
Raw.Read(SIZEOF_MAINHEAD14);
|
||||||
Raw.Get(OldMhd.Mark,4);
|
MainHead.Reset();
|
||||||
Raw.Get(OldMhd.HeadSize);
|
byte Mark[4];
|
||||||
Raw.Get(OldMhd.Flags);
|
Raw.GetB(Mark,4);
|
||||||
NextBlockPos=CurBlockPos+OldMhd.HeadSize;
|
uint HeadSize=Raw.Get2();
|
||||||
CurHeaderType=MAIN_HEAD;
|
byte Flags=Raw.Get1();
|
||||||
|
NextBlockPos=CurBlockPos+HeadSize;
|
||||||
|
CurHeaderType=HEAD_MAIN;
|
||||||
|
|
||||||
|
Solid=(Flags & MHD_SOLID)!=0;
|
||||||
|
MainHead.CommentInHeader=(Flags & MHD_COMMENT)!=0;
|
||||||
|
MainHead.PackComment=(Flags & MHD_PACK_COMMENT)!=0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
OldFileHeader OldLhd;
|
Raw.Read(SIZEOF_FILEHEAD14);
|
||||||
Raw.Read(SIZEOF_OLDLHD);
|
FileHead.Reset();
|
||||||
NewLhd.HeadType=FILE_HEAD;
|
|
||||||
Raw.Get(NewLhd.PackSize);
|
|
||||||
Raw.Get(NewLhd.UnpSize);
|
|
||||||
Raw.Get(OldLhd.FileCRC);
|
|
||||||
Raw.Get(NewLhd.HeadSize);
|
|
||||||
Raw.Get(NewLhd.FileTime);
|
|
||||||
Raw.Get(OldLhd.FileAttr);
|
|
||||||
Raw.Get(OldLhd.Flags);
|
|
||||||
Raw.Get(OldLhd.UnpVer);
|
|
||||||
Raw.Get(OldLhd.NameSize);
|
|
||||||
Raw.Get(OldLhd.Method);
|
|
||||||
|
|
||||||
NewLhd.Flags=OldLhd.Flags|LONG_BLOCK;
|
FileHead.HeaderType=HEAD_FILE;
|
||||||
NewLhd.UnpVer=(OldLhd.UnpVer==2) ? 13 : 10;
|
FileHead.DataSize=Raw.Get4();
|
||||||
NewLhd.Method=OldLhd.Method+0x30;
|
FileHead.UnpSize=Raw.Get4();
|
||||||
NewLhd.NameSize=OldLhd.NameSize;
|
FileHead.FileHash.Type=HASH_RAR14;
|
||||||
NewLhd.FileAttr=OldLhd.FileAttr;
|
FileHead.FileHash.CRC32=Raw.Get2();
|
||||||
NewLhd.FileCRC=OldLhd.FileCRC;
|
FileHead.HeadSize=Raw.Get2();
|
||||||
NewLhd.FullPackSize=NewLhd.PackSize;
|
uint FileTime=Raw.Get4();
|
||||||
NewLhd.FullUnpSize=NewLhd.UnpSize;
|
FileHead.FileAttr=Raw.Get1();
|
||||||
|
FileHead.Flags=Raw.Get1()|LONG_BLOCK;
|
||||||
|
FileHead.UnpVer=(Raw.Get1()==2) ? 13 : 10;
|
||||||
|
size_t NameSize=Raw.Get1();
|
||||||
|
FileHead.Method=Raw.Get1();
|
||||||
|
|
||||||
NewLhd.mtime.SetDos(NewLhd.FileTime);
|
FileHead.SplitBefore=(FileHead.Flags & LHD_SPLIT_BEFORE)!=0;
|
||||||
// (removed other times)
|
FileHead.SplitAfter=(FileHead.Flags & LHD_SPLIT_AFTER)!=0;
|
||||||
|
FileHead.Encrypted=(FileHead.Flags & LHD_PASSWORD)!=0;
|
||||||
|
if (FileHead.Encrypted)
|
||||||
|
return unrar_err_encrypted;
|
||||||
|
|
||||||
Raw.Read(OldLhd.NameSize);
|
FileHead.PackSize=FileHead.DataSize;
|
||||||
Raw.Get((byte *)NewLhd.FileName,OldLhd.NameSize);
|
FileHead.WinSize=0x10000;
|
||||||
NewLhd.FileName[OldLhd.NameSize]=0;
|
|
||||||
// (removed name case conversion)
|
FileHead.mtime.SetDos(FileTime);
|
||||||
*NewLhd.FileNameW=0;
|
|
||||||
|
Raw.Read(NameSize);
|
||||||
|
|
||||||
|
char FileName[NM];
|
||||||
|
Raw.GetB((byte *)FileName,Min(NameSize,ASIZE(FileName)));
|
||||||
|
FileName[NameSize]=0;
|
||||||
|
IntToExt(FileName,FileName,ASIZE(FileName));
|
||||||
|
CharToWide(FileName,FileHead.FileName,ASIZE(FileHead.FileName));
|
||||||
|
|
||||||
if (Raw.Size()!=0)
|
if (Raw.Size()!=0)
|
||||||
NextBlockPos=CurBlockPos+NewLhd.HeadSize+NewLhd.PackSize;
|
NextBlockPos=CurBlockPos+FileHead.HeadSize+FileHead.PackSize;
|
||||||
CurHeaderType=FILE_HEAD;
|
CurHeaderType=HEAD_FILE;
|
||||||
}
|
}
|
||||||
return(NextBlockPos>CurBlockPos ? Raw.Size():0);
|
*ReadSize=(NextBlockPos>CurBlockPos ? Raw.Size():0);
|
||||||
|
return unrar_ok;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
// (removed name case and attribute conversion)
|
// (removed name case and attribute conversion)
|
||||||
|
|
||||||
bool Archive::IsArcDir()
|
bool Archive::IsArcDir()
|
||||||
{
|
{
|
||||||
return((NewLhd.Flags & LHD_WINDOWMASK)==LHD_DIRECTORY);
|
return FileHead.Dir;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool Archive::IsArcLabel()
|
bool Archive::IsArcLabel()
|
||||||
{
|
{
|
||||||
return(NewLhd.HostOS<=HOST_WIN32 && (NewLhd.FileAttr & 8));
|
return(FileHead.HostOS<=HOST_WIN32 && (FileHead.FileAttr & 8));
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: use '\\' on Windows?
|
|
||||||
char const CPATHDIVIDER = '/';
|
|
||||||
#define charnext(s) ((s)+1)
|
|
||||||
|
|
||||||
void Archive::ConvertUnknownHeader()
|
void Archive::ConvertFileHeader(FileHeader *hd)
|
||||||
{
|
{
|
||||||
if (NewLhd.UnpVer<20 && (NewLhd.FileAttr & 0x10))
|
if (Format==RARFMT15 && hd->UnpVer<20 && (hd->FileAttr & 0x10))
|
||||||
NewLhd.Flags|=LHD_DIRECTORY;
|
hd->Dir=true;
|
||||||
if (NewLhd.HostOS>=HOST_MAX)
|
if (hd->HSType==HSYS_UNKNOWN)
|
||||||
{
|
if (hd->Dir)
|
||||||
if ((NewLhd.Flags & LHD_WINDOWMASK)==LHD_DIRECTORY)
|
hd->FileAttr=0x10;
|
||||||
NewLhd.FileAttr=0x10;
|
|
||||||
else
|
else
|
||||||
NewLhd.FileAttr=0x20;
|
hd->FileAttr=0x20;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int64 Archive::GetStartPos()
|
||||||
{
|
{
|
||||||
for (char *s=NewLhd.FileName;*s!=0;s=charnext(s))
|
int64 StartPos=SFXSize+MarkHead.HeadSize;
|
||||||
{
|
StartPos+=MainHead.HeadSize;
|
||||||
if (*s=='/' || *s=='\\')
|
return StartPos;
|
||||||
*s=CPATHDIVIDER;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// (removed Apple Unicode handling)
|
|
||||||
for (wchar *s=NewLhd.FileNameW;*s!=0;s++)
|
|
||||||
{
|
|
||||||
if (*s=='/' || *s=='\\')
|
|
||||||
*s=CPATHDIVIDER;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,26 +1,33 @@
|
||||||
#ifndef _RAR_ARRAY_
|
#ifndef _RAR_ARRAY_
|
||||||
#define _RAR_ARRAY_
|
#define _RAR_ARRAY_
|
||||||
|
|
||||||
|
#include <new>
|
||||||
|
|
||||||
template <class T> class Array
|
template <class T> class Array
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
T *Buffer;
|
T *Buffer;
|
||||||
int BufSize;
|
size_t BufSize;
|
||||||
int AllocSize;
|
size_t AllocSize;
|
||||||
|
size_t MaxSize;
|
||||||
public:
|
public:
|
||||||
Rar_Error_Handler& ErrHandler;
|
Array();
|
||||||
Array(Rar_Error_Handler*);
|
Array(size_t Size);
|
||||||
Array(int Size,Rar_Error_Handler*);
|
Array(const Array &Src); // Copy constructor.
|
||||||
~Array();
|
~Array();
|
||||||
inline void CleanData();
|
inline void CleanData();
|
||||||
inline T& operator [](int Item);
|
inline T& operator [](size_t Item) const;
|
||||||
inline int Size();
|
inline T* operator + (size_t Pos);
|
||||||
void Add(int Items);
|
inline size_t Size();
|
||||||
void Alloc(int Items);
|
void Add(size_t Items);
|
||||||
|
void Alloc(size_t Items);
|
||||||
void Reset();
|
void Reset();
|
||||||
|
void SoftReset();
|
||||||
void operator = (Array<T> &Src);
|
void operator = (Array<T> &Src);
|
||||||
void Push(T Item);
|
void Push(T Item);
|
||||||
T* Addr() {return(Buffer);}
|
void Append(T *Item,size_t Count);
|
||||||
|
T* Addr(size_t Item) {return Buffer+Item;}
|
||||||
|
void SetMaxSize(size_t Size) {MaxSize=Size;}
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class T> void Array<T>::CleanData()
|
template <class T> void Array<T>::CleanData()
|
||||||
|
@ -28,22 +35,30 @@ template <class T> void Array<T>::CleanData()
|
||||||
Buffer=NULL;
|
Buffer=NULL;
|
||||||
BufSize=0;
|
BufSize=0;
|
||||||
AllocSize=0;
|
AllocSize=0;
|
||||||
|
MaxSize=0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
template <class T> Array<T>::Array(Rar_Error_Handler* eh) : ErrHandler( *eh )
|
template <class T> Array<T>::Array()
|
||||||
{
|
{
|
||||||
CleanData();
|
CleanData();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
template <class T> Array<T>::Array(int Size, Rar_Error_Handler* eh) : ErrHandler( *eh )
|
template <class T> Array<T>::Array(size_t Size)
|
||||||
{
|
{
|
||||||
Buffer=(T *)rarmalloc(sizeof(T)*Size);
|
CleanData();
|
||||||
if (Buffer==NULL && Size!=0)
|
Add(Size);
|
||||||
ErrHandler.MemoryError();
|
}
|
||||||
|
|
||||||
AllocSize=BufSize=Size;
|
|
||||||
|
// Copy constructor in case we need to pass an object as value.
|
||||||
|
template <class T> Array<T>::Array(const Array &Src)
|
||||||
|
{
|
||||||
|
CleanData();
|
||||||
|
Alloc(Src.BufSize);
|
||||||
|
if (Src.BufSize!=0)
|
||||||
|
memcpy((void *)Buffer,(void *)Src.Buffer,Src.BufSize*sizeof(T));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -54,41 +69,46 @@ template <class T> Array<T>::~Array()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
template <class T> inline T& Array<T>::operator [](int Item)
|
template <class T> inline T& Array<T>::operator [](size_t Item) const
|
||||||
{
|
{
|
||||||
return(Buffer[Item]);
|
return Buffer[Item];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
template <class T> inline int Array<T>::Size()
|
template <class T> inline T* Array<T>::operator +(size_t Pos)
|
||||||
{
|
{
|
||||||
return(BufSize);
|
return Buffer+Pos;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
template <class T> void Array<T>::Add(int Items)
|
template <class T> inline size_t Array<T>::Size()
|
||||||
{
|
{
|
||||||
int BufSize = this->BufSize; // don't change actual vars until alloc succeeds
|
return BufSize;
|
||||||
T* Buffer = this->Buffer;
|
}
|
||||||
|
|
||||||
BufSize+=Items;
|
|
||||||
if (BufSize>AllocSize)
|
template <class T> void Array<T>::Add(size_t Items)
|
||||||
{
|
{
|
||||||
int Suggested=AllocSize+AllocSize/4+32;
|
size_t NewBufSize=BufSize+Items;
|
||||||
int NewSize=Max(BufSize,Suggested);
|
if (NewBufSize>AllocSize)
|
||||||
|
{
|
||||||
|
if (MaxSize!=0 && NewBufSize>MaxSize)
|
||||||
|
throw std::bad_alloc();
|
||||||
|
|
||||||
Buffer=(T *)rarrealloc(Buffer,NewSize*sizeof(T));
|
size_t Suggested=AllocSize+AllocSize/4+32;
|
||||||
if (Buffer==NULL)
|
size_t NewSize=Max(NewBufSize,Suggested);
|
||||||
ErrHandler.MemoryError();
|
|
||||||
|
T *NewBuffer=(T *)rarrealloc(Buffer,NewSize*sizeof(T));
|
||||||
|
if (NewBuffer==NULL)
|
||||||
|
throw std::bad_alloc();
|
||||||
|
Buffer=NewBuffer;
|
||||||
AllocSize=NewSize;
|
AllocSize=NewSize;
|
||||||
}
|
}
|
||||||
|
BufSize=NewBufSize;
|
||||||
this->Buffer = Buffer;
|
|
||||||
this->BufSize = BufSize;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
template <class T> void Array<T>::Alloc(int Items)
|
template <class T> void Array<T>::Alloc(size_t Items)
|
||||||
{
|
{
|
||||||
if (Items>AllocSize)
|
if (Items>AllocSize)
|
||||||
Add(Items-BufSize);
|
Add(Items-BufSize);
|
||||||
|
@ -117,6 +137,14 @@ template <class T> void Array<T>::Reset()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Reset buffer size, but preserve already allocated memory if any,
|
||||||
|
// so we can reuse it without wasting time to allocation.
|
||||||
|
template <class T> void Array<T>::SoftReset()
|
||||||
|
{
|
||||||
|
BufSize=0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
template <class T> void Array<T>::operator =(Array<T> &Src)
|
template <class T> void Array<T>::operator =(Array<T> &Src)
|
||||||
{
|
{
|
||||||
Reset();
|
Reset();
|
||||||
|
@ -132,4 +160,12 @@ template <class T> void Array<T>::Push(T Item)
|
||||||
(*this)[Size()-1]=Item;
|
(*this)[Size()-1]=Item;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template <class T> void Array<T>::Append(T *Items,size_t Count)
|
||||||
|
{
|
||||||
|
size_t CurSize=Size();
|
||||||
|
Add(Count);
|
||||||
|
memcpy(Buffer+CurSize,Items,Count*sizeof(T));
|
||||||
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -0,0 +1,189 @@
|
||||||
|
// Based on public domain code written in 2012 by Samuel Neves
|
||||||
|
|
||||||
|
#include "rar.hpp"
|
||||||
|
|
||||||
|
#ifdef USE_SSE
|
||||||
|
#include "blake2s_sse.cpp"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
static void blake2s_init_param( blake2s_state *S, uint32 node_offset, uint32 node_depth);
|
||||||
|
static void blake2s_update( blake2s_state *S, const byte *in, size_t inlen );
|
||||||
|
static void blake2s_final( blake2s_state *S, byte *digest );
|
||||||
|
|
||||||
|
#include "blake2sp.cpp"
|
||||||
|
|
||||||
|
static const uint32 blake2s_IV[8] =
|
||||||
|
{
|
||||||
|
0x6A09E667UL, 0xBB67AE85UL, 0x3C6EF372UL, 0xA54FF53AUL,
|
||||||
|
0x510E527FUL, 0x9B05688CUL, 0x1F83D9ABUL, 0x5BE0CD19UL
|
||||||
|
};
|
||||||
|
|
||||||
|
static const byte blake2s_sigma[10][16] =
|
||||||
|
{
|
||||||
|
{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 } ,
|
||||||
|
{ 14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3 } ,
|
||||||
|
{ 11, 8, 12, 0, 5, 2, 15, 13, 10, 14, 3, 6, 7, 1, 9, 4 } ,
|
||||||
|
{ 7, 9, 3, 1, 13, 12, 11, 14, 2, 6, 5, 10, 4, 0, 15, 8 } ,
|
||||||
|
{ 9, 0, 5, 7, 2, 4, 10, 15, 14, 1, 11, 12, 6, 8, 3, 13 } ,
|
||||||
|
{ 2, 12, 6, 10, 0, 11, 8, 3, 4, 13, 7, 5, 15, 14, 1, 9 } ,
|
||||||
|
{ 12, 5, 1, 15, 14, 13, 4, 10, 0, 7, 6, 3, 9, 2, 8, 11 } ,
|
||||||
|
{ 13, 11, 7, 14, 12, 1, 3, 9, 5, 0, 15, 4, 8, 6, 2, 10 } ,
|
||||||
|
{ 6, 15, 14, 9, 11, 3, 0, 8, 12, 2, 13, 7, 1, 4, 10, 5 } ,
|
||||||
|
{ 10, 2, 8, 4, 7, 6, 1, 5, 15, 11, 9, 14, 3, 12, 13 , 0 } ,
|
||||||
|
};
|
||||||
|
|
||||||
|
static inline void blake2s_set_lastnode( blake2s_state *S )
|
||||||
|
{
|
||||||
|
S->f[1] = ~0U;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* Some helper functions, not necessarily useful */
|
||||||
|
static inline void blake2s_set_lastblock( blake2s_state *S )
|
||||||
|
{
|
||||||
|
if( S->last_node ) blake2s_set_lastnode( S );
|
||||||
|
|
||||||
|
S->f[0] = ~0U;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static inline void blake2s_increment_counter( blake2s_state *S, const uint32 inc )
|
||||||
|
{
|
||||||
|
S->t[0] += inc;
|
||||||
|
S->t[1] += ( S->t[0] < inc );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* init2 xors IV with input parameter block */
|
||||||
|
void blake2s_init_param( blake2s_state *S, uint32 node_offset, uint32 node_depth)
|
||||||
|
{
|
||||||
|
#ifdef USE_SSE
|
||||||
|
if (_SSE_Version>=SSE_SSE2)
|
||||||
|
blake2s_init_sse();
|
||||||
|
#endif
|
||||||
|
|
||||||
|
S->init(); // Clean data.
|
||||||
|
for( int i = 0; i < 8; ++i )
|
||||||
|
S->h[i] = blake2s_IV[i];
|
||||||
|
|
||||||
|
S->h[0] ^= 0x02080020; // We use BLAKE2sp parameters block.
|
||||||
|
S->h[2] ^= node_offset;
|
||||||
|
S->h[3] ^= (node_depth<<16)|0x20000000;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static inline uint32 rotr32( const uint32 w, const unsigned c )
|
||||||
|
{
|
||||||
|
return ( w >> c ) | ( w << ( 32 - c ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#define G(r,i,m,a,b,c,d) \
|
||||||
|
a = a + b + m[blake2s_sigma[r][2*i+0]]; \
|
||||||
|
d = rotr32(d ^ a, 16); \
|
||||||
|
c = c + d; \
|
||||||
|
b = rotr32(b ^ c, 12); \
|
||||||
|
a = a + b + m[blake2s_sigma[r][2*i+1]]; \
|
||||||
|
d = rotr32(d ^ a, 8); \
|
||||||
|
c = c + d; \
|
||||||
|
b = rotr32(b ^ c, 7);
|
||||||
|
|
||||||
|
|
||||||
|
static void blake2s_compress( blake2s_state *S, const byte block[BLAKE2S_BLOCKBYTES] )
|
||||||
|
{
|
||||||
|
uint32 m[16];
|
||||||
|
uint32 v[16];
|
||||||
|
|
||||||
|
for( size_t i = 0; i < 16; ++i )
|
||||||
|
m[i] = RawGet4( block + i * 4 );
|
||||||
|
|
||||||
|
for( size_t i = 0; i < 8; ++i )
|
||||||
|
v[i] = S->h[i];
|
||||||
|
|
||||||
|
v[ 8] = blake2s_IV[0];
|
||||||
|
v[ 9] = blake2s_IV[1];
|
||||||
|
v[10] = blake2s_IV[2];
|
||||||
|
v[11] = blake2s_IV[3];
|
||||||
|
v[12] = S->t[0] ^ blake2s_IV[4];
|
||||||
|
v[13] = S->t[1] ^ blake2s_IV[5];
|
||||||
|
v[14] = S->f[0] ^ blake2s_IV[6];
|
||||||
|
v[15] = S->f[1] ^ blake2s_IV[7];
|
||||||
|
|
||||||
|
for ( uint r = 0; r <= 9; ++r ) // No gain on i7 if unrolled, but exe size grows.
|
||||||
|
{
|
||||||
|
G(r,0,m,v[ 0],v[ 4],v[ 8],v[12]);
|
||||||
|
G(r,1,m,v[ 1],v[ 5],v[ 9],v[13]);
|
||||||
|
G(r,2,m,v[ 2],v[ 6],v[10],v[14]);
|
||||||
|
G(r,3,m,v[ 3],v[ 7],v[11],v[15]);
|
||||||
|
G(r,4,m,v[ 0],v[ 5],v[10],v[15]);
|
||||||
|
G(r,5,m,v[ 1],v[ 6],v[11],v[12]);
|
||||||
|
G(r,6,m,v[ 2],v[ 7],v[ 8],v[13]);
|
||||||
|
G(r,7,m,v[ 3],v[ 4],v[ 9],v[14]);
|
||||||
|
}
|
||||||
|
|
||||||
|
for( size_t i = 0; i < 8; ++i )
|
||||||
|
S->h[i] = S->h[i] ^ v[i] ^ v[i + 8];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void blake2s_update( blake2s_state *S, const byte *in, size_t inlen )
|
||||||
|
{
|
||||||
|
while( inlen > 0 )
|
||||||
|
{
|
||||||
|
size_t left = S->buflen;
|
||||||
|
size_t fill = 2 * BLAKE2S_BLOCKBYTES - left;
|
||||||
|
|
||||||
|
if( inlen > fill )
|
||||||
|
{
|
||||||
|
memcpy( S->buf + left, in, fill ); // Fill buffer
|
||||||
|
S->buflen += fill;
|
||||||
|
blake2s_increment_counter( S, BLAKE2S_BLOCKBYTES );
|
||||||
|
|
||||||
|
#ifdef USE_SSE
|
||||||
|
#ifdef _WIN_32 // We use SSSE3 _mm_shuffle_epi8 only in x64 mode.
|
||||||
|
if (_SSE_Version>=SSE_SSE2)
|
||||||
|
#else
|
||||||
|
if (_SSE_Version>=SSE_SSSE3)
|
||||||
|
#endif
|
||||||
|
blake2s_compress_sse( S, S->buf );
|
||||||
|
else
|
||||||
|
blake2s_compress( S, S->buf ); // Compress
|
||||||
|
#else
|
||||||
|
blake2s_compress( S, S->buf ); // Compress
|
||||||
|
#endif
|
||||||
|
|
||||||
|
memcpy( S->buf, S->buf + BLAKE2S_BLOCKBYTES, BLAKE2S_BLOCKBYTES ); // Shift buffer left
|
||||||
|
S->buflen -= BLAKE2S_BLOCKBYTES;
|
||||||
|
in += fill;
|
||||||
|
inlen -= fill;
|
||||||
|
}
|
||||||
|
else // inlen <= fill
|
||||||
|
{
|
||||||
|
memcpy( S->buf + left, in, (size_t)inlen );
|
||||||
|
S->buflen += (size_t)inlen; // Be lazy, do not compress
|
||||||
|
in += inlen;
|
||||||
|
inlen -= inlen;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void blake2s_final( blake2s_state *S, byte *digest )
|
||||||
|
{
|
||||||
|
if( S->buflen > BLAKE2S_BLOCKBYTES )
|
||||||
|
{
|
||||||
|
blake2s_increment_counter( S, BLAKE2S_BLOCKBYTES );
|
||||||
|
blake2s_compress( S, S->buf );
|
||||||
|
S->buflen -= BLAKE2S_BLOCKBYTES;
|
||||||
|
memcpy( S->buf, S->buf + BLAKE2S_BLOCKBYTES, S->buflen );
|
||||||
|
}
|
||||||
|
|
||||||
|
blake2s_increment_counter( S, ( uint32 )S->buflen );
|
||||||
|
blake2s_set_lastblock( S );
|
||||||
|
memset( S->buf + S->buflen, 0, 2 * BLAKE2S_BLOCKBYTES - S->buflen ); /* Padding */
|
||||||
|
blake2s_compress( S, S->buf );
|
||||||
|
|
||||||
|
for( int i = 0; i < 8; ++i ) /* Output full hash */
|
||||||
|
RawPut4( S->h[i], digest + 4 * i );
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,101 @@
|
||||||
|
// Based on public domain code written in 2012 by Samuel Neves
|
||||||
|
#ifndef _RAR_BLAKE2_
|
||||||
|
#define _RAR_BLAKE2_
|
||||||
|
|
||||||
|
#define BLAKE2_DIGEST_SIZE 32
|
||||||
|
|
||||||
|
enum blake2s_constant
|
||||||
|
{
|
||||||
|
BLAKE2S_BLOCKBYTES = 64,
|
||||||
|
BLAKE2S_OUTBYTES = 32
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// Alignment to 64 improves performance of both SSE and non-SSE versions.
|
||||||
|
// Alignment to n*16 is required for SSE version, so we selected 64.
|
||||||
|
// We use the custom alignment scheme instead of __declspec(align(x)),
|
||||||
|
// because it is less compiler dependent. Also the compiler directive
|
||||||
|
// does not help if structure is a member of class allocated through
|
||||||
|
// 'new' operator.
|
||||||
|
struct blake2s_state
|
||||||
|
{
|
||||||
|
enum { BLAKE_ALIGNMENT = 64 };
|
||||||
|
|
||||||
|
// buffer and uint32 h[8], t[2], f[2];
|
||||||
|
enum { BLAKE_DATA_SIZE = 48 + 2 * BLAKE2S_BLOCKBYTES };
|
||||||
|
|
||||||
|
byte ubuf[BLAKE_DATA_SIZE + BLAKE_ALIGNMENT];
|
||||||
|
|
||||||
|
byte *buf; // byte buf[2 * BLAKE2S_BLOCKBYTES].
|
||||||
|
uint32 *h, *t, *f; // uint32 h[8], t[2], f[2].
|
||||||
|
|
||||||
|
size_t buflen;
|
||||||
|
byte last_node;
|
||||||
|
|
||||||
|
blake2s_state()
|
||||||
|
{
|
||||||
|
set_pointers();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Required when we declare and assign in the same command.
|
||||||
|
blake2s_state(blake2s_state &st)
|
||||||
|
{
|
||||||
|
set_pointers();
|
||||||
|
*this=st;
|
||||||
|
}
|
||||||
|
|
||||||
|
void set_pointers()
|
||||||
|
{
|
||||||
|
// Set aligned pointers. Must be done in constructor, not in Init(),
|
||||||
|
// so assignments like 'blake2sp_state res=blake2ctx' work correctly
|
||||||
|
// even if blake2sp_init is not called for 'res'.
|
||||||
|
buf = (byte *) ALIGN_VALUE(ubuf, BLAKE_ALIGNMENT);
|
||||||
|
h = (uint32 *) (buf + 2 * BLAKE2S_BLOCKBYTES);
|
||||||
|
t = h + 8;
|
||||||
|
f = t + 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
void init()
|
||||||
|
{
|
||||||
|
memset( ubuf, 0, sizeof( ubuf ) );
|
||||||
|
buflen = 0;
|
||||||
|
last_node = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Since we use pointers, the default = would work incorrectly.
|
||||||
|
blake2s_state& operator = (blake2s_state &st)
|
||||||
|
{
|
||||||
|
if (this != &st)
|
||||||
|
{
|
||||||
|
memcpy(buf, st.buf, BLAKE_DATA_SIZE);
|
||||||
|
buflen = st.buflen;
|
||||||
|
last_node = st.last_node;
|
||||||
|
}
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef RAR_SMP
|
||||||
|
class ThreadPool;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
struct blake2sp_state
|
||||||
|
{
|
||||||
|
blake2s_state S[8];
|
||||||
|
blake2s_state R;
|
||||||
|
byte buf[8 * BLAKE2S_BLOCKBYTES];
|
||||||
|
size_t buflen;
|
||||||
|
|
||||||
|
#ifdef RAR_SMP
|
||||||
|
ThreadPool *ThPool;
|
||||||
|
uint MaxThreads;
|
||||||
|
#endif
|
||||||
|
};
|
||||||
|
|
||||||
|
void blake2sp_init( blake2sp_state *S );
|
||||||
|
void blake2sp_update( blake2sp_state *S, const byte *in, size_t inlen );
|
||||||
|
void blake2sp_final( blake2sp_state *S, byte *digest );
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
|
@ -0,0 +1,131 @@
|
||||||
|
// Based on public domain code written in 2012 by Samuel Neves
|
||||||
|
|
||||||
|
#ifdef RAR_COMMON_HPP
|
||||||
|
|
||||||
|
extern const byte blake2s_sigma[10][16];
|
||||||
|
|
||||||
|
// Initialization vector.
|
||||||
|
static __m128i blake2s_IV_0_3, blake2s_IV_4_7;
|
||||||
|
|
||||||
|
#ifdef _WIN_64
|
||||||
|
// Constants for cyclic rotation. Used in 64-bit mode in mm_rotr_epi32 macro.
|
||||||
|
static __m128i crotr8, crotr16;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
static void blake2s_init_sse()
|
||||||
|
{
|
||||||
|
// We cannot initialize these 128 bit variables in place when declaring
|
||||||
|
// them globally, because global scope initialization is performed before
|
||||||
|
// our SSE check and it would make code incompatible with older non-SSE2
|
||||||
|
// CPUs. Also we cannot initialize them as static inside of function
|
||||||
|
// using these variables, because SSE static initialization is not thread
|
||||||
|
// safe: first thread starts initialization and sets "init done" flag even
|
||||||
|
// if it is not done yet, second thread can attempt to access half-init
|
||||||
|
// SSE data. So we moved init code here.
|
||||||
|
|
||||||
|
blake2s_IV_0_3 = _mm_setr_epi32( 0x6A09E667, 0xBB67AE85, 0x3C6EF372, 0xA54FF53A );
|
||||||
|
blake2s_IV_4_7 = _mm_setr_epi32( 0x510E527F, 0x9B05688C, 0x1F83D9AB, 0x5BE0CD19 );
|
||||||
|
|
||||||
|
#ifdef _WIN_64
|
||||||
|
crotr8 = _mm_set_epi8( 12, 15, 14, 13, 8, 11, 10, 9, 4, 7, 6, 5, 0, 3, 2, 1 );
|
||||||
|
crotr16 = _mm_set_epi8( 13, 12, 15, 14, 9, 8, 11, 10, 5, 4, 7, 6, 1, 0, 3, 2 );
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#define LOAD(p) _mm_load_si128( (__m128i *)(p) )
|
||||||
|
#define STORE(p,r) _mm_store_si128((__m128i *)(p), r)
|
||||||
|
|
||||||
|
#ifdef _WIN_32
|
||||||
|
// 32-bit mode has less SSE2 registers and in MSVC2008 it is more efficient
|
||||||
|
// to not use _mm_shuffle_epi8 here.
|
||||||
|
#define mm_rotr_epi32(r, c) ( \
|
||||||
|
_mm_xor_si128(_mm_srli_epi32( (r), c ),_mm_slli_epi32( (r), 32-c )) )
|
||||||
|
#else
|
||||||
|
#define mm_rotr_epi32(r, c) ( \
|
||||||
|
c==8 ? _mm_shuffle_epi8(r,crotr8) \
|
||||||
|
: c==16 ? _mm_shuffle_epi8(r,crotr16) \
|
||||||
|
: _mm_xor_si128(_mm_srli_epi32( (r), c ),_mm_slli_epi32( (r), 32-c )) )
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#define G1(row1,row2,row3,row4,buf) \
|
||||||
|
row1 = _mm_add_epi32( _mm_add_epi32( row1, buf), row2 ); \
|
||||||
|
row4 = _mm_xor_si128( row4, row1 ); \
|
||||||
|
row4 = mm_rotr_epi32(row4, 16); \
|
||||||
|
row3 = _mm_add_epi32( row3, row4 ); \
|
||||||
|
row2 = _mm_xor_si128( row2, row3 ); \
|
||||||
|
row2 = mm_rotr_epi32(row2, 12);
|
||||||
|
|
||||||
|
#define G2(row1,row2,row3,row4,buf) \
|
||||||
|
row1 = _mm_add_epi32( _mm_add_epi32( row1, buf), row2 ); \
|
||||||
|
row4 = _mm_xor_si128( row4, row1 ); \
|
||||||
|
row4 = mm_rotr_epi32(row4, 8); \
|
||||||
|
row3 = _mm_add_epi32( row3, row4 ); \
|
||||||
|
row2 = _mm_xor_si128( row2, row3 ); \
|
||||||
|
row2 = mm_rotr_epi32(row2, 7);
|
||||||
|
|
||||||
|
#define DIAGONALIZE(row1,row2,row3,row4) \
|
||||||
|
row4 = _mm_shuffle_epi32( row4, _MM_SHUFFLE(2,1,0,3) ); \
|
||||||
|
row3 = _mm_shuffle_epi32( row3, _MM_SHUFFLE(1,0,3,2) ); \
|
||||||
|
row2 = _mm_shuffle_epi32( row2, _MM_SHUFFLE(0,3,2,1) );
|
||||||
|
|
||||||
|
#define UNDIAGONALIZE(row1,row2,row3,row4) \
|
||||||
|
row4 = _mm_shuffle_epi32( row4, _MM_SHUFFLE(0,3,2,1) ); \
|
||||||
|
row3 = _mm_shuffle_epi32( row3, _MM_SHUFFLE(1,0,3,2) ); \
|
||||||
|
row2 = _mm_shuffle_epi32( row2, _MM_SHUFFLE(2,1,0,3) );
|
||||||
|
|
||||||
|
#ifdef _WIN_64
|
||||||
|
// MSVC 2008 in x64 mode expands _mm_set_epi32 to store to stack and load
|
||||||
|
// from stack operations, which are slower than this code.
|
||||||
|
#define _mm_set_epi32(i3,i2,i1,i0) \
|
||||||
|
_mm_unpacklo_epi32(_mm_unpacklo_epi32(_mm_cvtsi32_si128(i0),_mm_cvtsi32_si128(i2)), \
|
||||||
|
_mm_unpacklo_epi32(_mm_cvtsi32_si128(i1),_mm_cvtsi32_si128(i3)))
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// Original BLAKE2 SSE4.1 message loading code was a little slower in x86 mode
|
||||||
|
// and about the same in x64 mode in our test. Perhaps depends on compiler.
|
||||||
|
#define SSE_ROUND(m,row,r) \
|
||||||
|
{ \
|
||||||
|
__m128i buf; \
|
||||||
|
buf=_mm_set_epi32(m[blake2s_sigma[r][6]],m[blake2s_sigma[r][4]],m[blake2s_sigma[r][2]],m[blake2s_sigma[r][0]]); \
|
||||||
|
G1(row[0],row[1],row[2],row[3],buf); \
|
||||||
|
buf=_mm_set_epi32(m[blake2s_sigma[r][7]],m[blake2s_sigma[r][5]],m[blake2s_sigma[r][3]],m[blake2s_sigma[r][1]]); \
|
||||||
|
G2(row[0],row[1],row[2],row[3],buf); \
|
||||||
|
DIAGONALIZE(row[0],row[1],row[2],row[3]); \
|
||||||
|
buf=_mm_set_epi32(m[blake2s_sigma[r][14]],m[blake2s_sigma[r][12]],m[blake2s_sigma[r][10]],m[blake2s_sigma[r][8]]); \
|
||||||
|
G1(row[0],row[1],row[2],row[3],buf); \
|
||||||
|
buf=_mm_set_epi32(m[blake2s_sigma[r][15]],m[blake2s_sigma[r][13]],m[blake2s_sigma[r][11]],m[blake2s_sigma[r][9]]); \
|
||||||
|
G2(row[0],row[1],row[2],row[3],buf); \
|
||||||
|
UNDIAGONALIZE(row[0],row[1],row[2],row[3]); \
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static int blake2s_compress_sse( blake2s_state *S, const byte block[BLAKE2S_BLOCKBYTES] )
|
||||||
|
{
|
||||||
|
__m128i row[4];
|
||||||
|
__m128i ff0, ff1;
|
||||||
|
|
||||||
|
const uint32 *m = ( uint32 * )block;
|
||||||
|
|
||||||
|
row[0] = ff0 = LOAD( &S->h[0] );
|
||||||
|
row[1] = ff1 = LOAD( &S->h[4] );
|
||||||
|
|
||||||
|
row[2] = blake2s_IV_0_3;
|
||||||
|
row[3] = _mm_xor_si128( blake2s_IV_4_7, LOAD( &S->t[0] ) );
|
||||||
|
SSE_ROUND( m, row, 0 );
|
||||||
|
SSE_ROUND( m, row, 1 );
|
||||||
|
SSE_ROUND( m, row, 2 );
|
||||||
|
SSE_ROUND( m, row, 3 );
|
||||||
|
SSE_ROUND( m, row, 4 );
|
||||||
|
SSE_ROUND( m, row, 5 );
|
||||||
|
SSE_ROUND( m, row, 6 );
|
||||||
|
SSE_ROUND( m, row, 7 );
|
||||||
|
SSE_ROUND( m, row, 8 );
|
||||||
|
SSE_ROUND( m, row, 9 );
|
||||||
|
STORE( &S->h[0], _mm_xor_si128( ff0, _mm_xor_si128( row[0], row[2] ) ) );
|
||||||
|
STORE( &S->h[4], _mm_xor_si128( ff1, _mm_xor_si128( row[1], row[3] ) ) );
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
|
@ -0,0 +1,157 @@
|
||||||
|
/*
|
||||||
|
BLAKE2 reference source code package - reference C implementations
|
||||||
|
|
||||||
|
Written in 2012 by Samuel Neves <sneves@dei.uc.pt>
|
||||||
|
|
||||||
|
To the extent possible under law, the author(s) have dedicated all copyright
|
||||||
|
and related and neighboring rights to this software to the public domain
|
||||||
|
worldwide. This software is distributed without any warranty.
|
||||||
|
|
||||||
|
You should have received a copy of the CC0 Public Domain Dedication along with
|
||||||
|
this software. If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifdef RAR_COMMON_HPP
|
||||||
|
|
||||||
|
#define PARALLELISM_DEGREE 8
|
||||||
|
|
||||||
|
void blake2sp_init( blake2sp_state *S )
|
||||||
|
{
|
||||||
|
memset( S->buf, 0, sizeof( S->buf ) );
|
||||||
|
S->buflen = 0;
|
||||||
|
|
||||||
|
blake2s_init_param( &S->R, 0, 1 ); // Init root.
|
||||||
|
|
||||||
|
for( uint i = 0; i < PARALLELISM_DEGREE; ++i )
|
||||||
|
blake2s_init_param( &S->S[i], i, 0 ); // Init leaf.
|
||||||
|
|
||||||
|
S->R.last_node = 1;
|
||||||
|
S->S[PARALLELISM_DEGREE - 1].last_node = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
struct Blake2ThreadData
|
||||||
|
{
|
||||||
|
void Update();
|
||||||
|
blake2s_state *S;
|
||||||
|
const byte *in;
|
||||||
|
size_t inlen;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
void Blake2ThreadData::Update()
|
||||||
|
{
|
||||||
|
size_t inlen__ = inlen;
|
||||||
|
const byte *in__ = ( const byte * )in;
|
||||||
|
|
||||||
|
while( inlen__ >= PARALLELISM_DEGREE * BLAKE2S_BLOCKBYTES )
|
||||||
|
{
|
||||||
|
#ifdef USE_SSE
|
||||||
|
// We gain 5% in i7 SSE mode by prefetching next data block.
|
||||||
|
if (_SSE_Version>=SSE_SSE && inlen__ >= 2 * PARALLELISM_DEGREE * BLAKE2S_BLOCKBYTES)
|
||||||
|
_mm_prefetch((char*)(in__ + PARALLELISM_DEGREE * BLAKE2S_BLOCKBYTES), _MM_HINT_T0);
|
||||||
|
#endif
|
||||||
|
blake2s_update( S, in__, BLAKE2S_BLOCKBYTES );
|
||||||
|
in__ += PARALLELISM_DEGREE * BLAKE2S_BLOCKBYTES;
|
||||||
|
inlen__ -= PARALLELISM_DEGREE * BLAKE2S_BLOCKBYTES;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef RAR_SMP
|
||||||
|
THREAD_PROC(Blake2Thread)
|
||||||
|
{
|
||||||
|
Blake2ThreadData *td=(Blake2ThreadData *)Data;
|
||||||
|
td->Update();
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
void blake2sp_update( blake2sp_state *S, const byte *in, size_t inlen )
|
||||||
|
{
|
||||||
|
size_t left = S->buflen;
|
||||||
|
size_t fill = sizeof( S->buf ) - left;
|
||||||
|
|
||||||
|
if( left && inlen >= fill )
|
||||||
|
{
|
||||||
|
memcpy( S->buf + left, in, fill );
|
||||||
|
|
||||||
|
for( size_t i = 0; i < PARALLELISM_DEGREE; ++i )
|
||||||
|
blake2s_update( &S->S[i], S->buf + i * BLAKE2S_BLOCKBYTES, BLAKE2S_BLOCKBYTES );
|
||||||
|
|
||||||
|
in += fill;
|
||||||
|
inlen -= fill;
|
||||||
|
left = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
Blake2ThreadData btd_array[PARALLELISM_DEGREE];
|
||||||
|
|
||||||
|
#ifdef RAR_SMP
|
||||||
|
uint ThreadNumber = inlen < 0x1000 ? 1 : S->MaxThreads;
|
||||||
|
|
||||||
|
if (ThreadNumber==6 || ThreadNumber==7) // 6 and 7 threads work slower than 4 here.
|
||||||
|
ThreadNumber=4;
|
||||||
|
#else
|
||||||
|
uint ThreadNumber=1;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
for (size_t id__=0;id__<PARALLELISM_DEGREE;)
|
||||||
|
{
|
||||||
|
for (uint Thread=0;Thread<ThreadNumber && id__<PARALLELISM_DEGREE;Thread++)
|
||||||
|
{
|
||||||
|
Blake2ThreadData *btd=btd_array+Thread;
|
||||||
|
|
||||||
|
btd->inlen = inlen;
|
||||||
|
btd->in = in + id__ * BLAKE2S_BLOCKBYTES;
|
||||||
|
btd->S = &S->S[id__];
|
||||||
|
|
||||||
|
#ifdef RAR_SMP
|
||||||
|
if (ThreadNumber>1)
|
||||||
|
S->ThPool->AddTask(Blake2Thread,(void*)btd);
|
||||||
|
else
|
||||||
|
btd->Update();
|
||||||
|
#else
|
||||||
|
btd->Update();
|
||||||
|
#endif
|
||||||
|
id__++;
|
||||||
|
}
|
||||||
|
#ifdef RAR_SMP
|
||||||
|
if (S->ThPool!=NULL) // Can be NULL in -mt1 mode.
|
||||||
|
S->ThPool->WaitDone();
|
||||||
|
#endif // RAR_SMP
|
||||||
|
}
|
||||||
|
|
||||||
|
in += inlen - inlen % ( PARALLELISM_DEGREE * BLAKE2S_BLOCKBYTES );
|
||||||
|
inlen %= PARALLELISM_DEGREE * BLAKE2S_BLOCKBYTES;
|
||||||
|
|
||||||
|
if( inlen > 0 )
|
||||||
|
memcpy( S->buf + left, in, (size_t)inlen );
|
||||||
|
|
||||||
|
S->buflen = left + (size_t)inlen;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void blake2sp_final( blake2sp_state *S, byte *digest )
|
||||||
|
{
|
||||||
|
byte hash[PARALLELISM_DEGREE][BLAKE2S_OUTBYTES];
|
||||||
|
|
||||||
|
for( size_t i = 0; i < PARALLELISM_DEGREE; ++i )
|
||||||
|
{
|
||||||
|
if( S->buflen > i * BLAKE2S_BLOCKBYTES )
|
||||||
|
{
|
||||||
|
size_t left = S->buflen - i * BLAKE2S_BLOCKBYTES;
|
||||||
|
|
||||||
|
if( left > BLAKE2S_BLOCKBYTES ) left = BLAKE2S_BLOCKBYTES;
|
||||||
|
|
||||||
|
blake2s_update( &S->S[i], S->buf + i * BLAKE2S_BLOCKBYTES, left );
|
||||||
|
}
|
||||||
|
|
||||||
|
blake2s_final( &S->S[i], hash[i] );
|
||||||
|
}
|
||||||
|
|
||||||
|
for( size_t i = 0; i < PARALLELISM_DEGREE; ++i )
|
||||||
|
blake2s_update( &S->R, hash[i], BLAKE2S_OUTBYTES );
|
||||||
|
|
||||||
|
blake2s_final( &S->R, digest );
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
|
@ -18,9 +18,10 @@ void RangeCoder::InitDecoder(Unpack *UnpackRead)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// (int) cast before "low" added only to suppress compiler warnings.
|
||||||
#define ARI_DEC_NORMALIZE(code,low,range,read) \
|
#define ARI_DEC_NORMALIZE(code,low,range,read) \
|
||||||
{ \
|
{ \
|
||||||
while ((low^(low+range))<TOP || range<BOT && ((range=-low&(BOT-1)),1)) \
|
while ((low^(low+range))<TOP || range<BOT && ((range=-(int)low&(BOT-1)),1)) \
|
||||||
{ \
|
{ \
|
||||||
code=(code << 8) | read->GetChar(); \
|
code=(code << 8) | read->GetChar(); \
|
||||||
range <<= 8; \
|
range <<= 8; \
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
* Contents: 'Carryless rangecoder' by Dmitry Subbotin *
|
* Contents: 'Carryless rangecoder' by Dmitry Subbotin *
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
const uint TOP=1 << 24, BOT=1 << 15;
|
|
||||||
|
|
||||||
class RangeCoder
|
class RangeCoder
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,36 +1,50 @@
|
||||||
#ifndef _RAR_COMPRESS_
|
#ifndef _RAR_COMPRESS_
|
||||||
#define _RAR_COMPRESS_
|
#define _RAR_COMPRESS_
|
||||||
|
|
||||||
class ComprDataIO;
|
// Combine pack and unpack constants to class to avoid polluting global
|
||||||
class PackingFileTable;
|
// namespace with numerous short names.
|
||||||
|
class PackDef
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
static const uint MAX_LZ_MATCH = 0x1001;
|
||||||
|
static const uint MAX3_LZ_MATCH = 0x101; // Maximum match length for RAR v3.
|
||||||
|
static const uint LOW_DIST_REP_COUNT = 16;
|
||||||
|
|
||||||
#define CODEBUFSIZE 0x4000
|
static const uint NC = 306; /* alphabet = {0, 1, 2, ..., NC - 1} */
|
||||||
#define MAXWINSIZE 0x400000
|
static const uint DC = 64;
|
||||||
#define MAXWINMASK (MAXWINSIZE-1)
|
static const uint LDC = 16;
|
||||||
|
static const uint RC = 44;
|
||||||
|
static const uint HUFF_TABLE_SIZE = NC + DC + RC + LDC;
|
||||||
|
static const uint BC = 20;
|
||||||
|
|
||||||
#define LOW_DIST_REP_COUNT 16
|
static const uint NC30 = 299; /* alphabet = {0, 1, 2, ..., NC - 1} */
|
||||||
|
static const uint DC30 = 60;
|
||||||
|
static const uint LDC30 = 17;
|
||||||
|
static const uint RC30 = 28;
|
||||||
|
static const uint BC30 = 20;
|
||||||
|
static const uint HUFF_TABLE_SIZE30 = NC30 + DC30 + RC30 + LDC30;
|
||||||
|
|
||||||
#define NC 299 /* alphabet = {0, 1, 2, ..., NC - 1} */
|
static const uint NC20 = 298; /* alphabet = {0, 1, 2, ..., NC - 1} */
|
||||||
#define DC 60
|
static const uint DC20 = 48;
|
||||||
#define LDC 17
|
static const uint RC20 = 28;
|
||||||
#define RC 28
|
static const uint BC20 = 19;
|
||||||
#define HUFF_TABLE_SIZE (NC+DC+RC+LDC)
|
static const uint MC20 = 257;
|
||||||
#define BC 20
|
|
||||||
|
|
||||||
#define NC20 298 /* alphabet = {0, 1, 2, ..., NC - 1} */
|
// Largest alphabet size among all values listed above.
|
||||||
#define DC20 48
|
static const uint LARGEST_TABLE_SIZE = 306;
|
||||||
#define RC20 28
|
|
||||||
#define BC20 19
|
|
||||||
#define MC20 257
|
|
||||||
|
|
||||||
enum {CODE_HUFFMAN,CODE_LZ,CODE_LZ2,CODE_REPEATLZ,CODE_CACHELZ,
|
enum {
|
||||||
CODE_STARTFILE,CODE_ENDFILE,CODE_VM,CODE_VMDATA};
|
CODE_HUFFMAN, CODE_LZ, CODE_REPEATLZ, CODE_CACHELZ, CODE_STARTFILE,
|
||||||
|
CODE_ENDFILE, CODE_FILTER, CODE_FILTERDATA
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
enum FilterType {
|
enum FilterType {
|
||||||
FILTER_NONE, FILTER_PPM /*dummy*/, FILTER_E8, FILTER_E8E9,
|
// These values must not be changed, because we use them directly
|
||||||
FILTER_UPCASETOLOW, FILTER_AUDIO, FILTER_RGB, FILTER_DELTA,
|
// in RAR5 compression and decompression code.
|
||||||
FILTER_ITANIUM, FILTER_E8E9V2
|
FILTER_DELTA=0, FILTER_E8, FILTER_E8E9, FILTER_ARM,
|
||||||
|
FILTER_AUDIO, FILTER_RGB, FILTER_ITANIUM, FILTER_PPM, FILTER_NONE
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -1,62 +1,90 @@
|
||||||
|
// This CRC function is based on Intel Slicing-by-8 algorithm.
|
||||||
|
//
|
||||||
|
// Original Intel Slicing-by-8 code is available here:
|
||||||
|
//
|
||||||
|
// http://sourceforge.net/projects/slicing-by-8/
|
||||||
|
//
|
||||||
|
// Original Intel Slicing-by-8 code is licensed as:
|
||||||
|
//
|
||||||
|
// Copyright (c) 2004-2006 Intel Corporation - All Rights Reserved
|
||||||
|
//
|
||||||
|
// This software program is licensed subject to the BSD License,
|
||||||
|
// available at http://www.opensource.org/licenses/bsd-license.html
|
||||||
|
|
||||||
|
|
||||||
#include "rar.hpp"
|
#include "rar.hpp"
|
||||||
|
|
||||||
uint CRCTab[256];
|
uint crc_tables[8][256]; // Tables for Slicing-by-8.
|
||||||
|
|
||||||
void InitCRC()
|
|
||||||
|
// Build the classic CRC32 lookup table.
|
||||||
|
// We also provide this function to legacy RAR and ZIP decryption code.
|
||||||
|
void InitCRC32(uint *CRCTab)
|
||||||
{
|
{
|
||||||
for (int I=0;I<256;I++)
|
if (CRCTab[1]!=0)
|
||||||
|
return;
|
||||||
|
for (uint I=0;I<256;I++)
|
||||||
{
|
{
|
||||||
uint C=I;
|
uint C=I;
|
||||||
for (int J=0;J<8;J++)
|
for (uint J=0;J<8;J++)
|
||||||
C=(C & 1) ? (C>>1)^0xEDB88320L : (C>>1);
|
C=(C & 1) ? (C>>1)^0xEDB88320 : (C>>1);
|
||||||
CRCTab[I]=C;
|
CRCTab[I]=C;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
uint CRC(uint StartCRC,const void *Addr,size_t Size)
|
void InitCRCTables()
|
||||||
|
{
|
||||||
|
InitCRC32(crc_tables[0]);
|
||||||
|
|
||||||
|
for (uint I=0;I<256;I++) // Build additional lookup tables.
|
||||||
|
{
|
||||||
|
uint C=crc_tables[0][I];
|
||||||
|
for (uint J=1;J<8;J++)
|
||||||
|
{
|
||||||
|
C=crc_tables[0][(byte)C]^(C>>8);
|
||||||
|
crc_tables[J][I]=C;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
uint CRC32(uint StartCRC,const void *Addr,size_t Size)
|
||||||
{
|
{
|
||||||
// Always initialized ahead of time, and this func call makes it a non-leaf func.
|
|
||||||
if (false)
|
|
||||||
if (CRCTab[1]==0)
|
|
||||||
InitCRC();
|
|
||||||
byte *Data=(byte *)Addr;
|
byte *Data=(byte *)Addr;
|
||||||
#if defined(LITTLE_ENDIAN) && defined(PRESENT_INT32) && defined(ALLOW_NOT_ALIGNED_INT)
|
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
// Align Data to 8 for better performance.
|
||||||
// avoid a warning about 'Data' pointer truncation in 64 bit mode
|
for (;Size>0 && ((size_t)Data & 7);Size--,Data++)
|
||||||
#pragma warning( disable : 4311 )
|
StartCRC=crc_tables[0][(byte)(StartCRC^Data[0])]^(StartCRC>>8);
|
||||||
#endif
|
|
||||||
|
|
||||||
while (Size>0 && ((long)Data & 7))
|
for (;Size>=8;Size-=8,Data+=8)
|
||||||
{
|
|
||||||
StartCRC=CRCTab[(byte)(StartCRC^Data[0])]^(StartCRC>>8);
|
|
||||||
Size--;
|
|
||||||
Data++;
|
|
||||||
}
|
|
||||||
while (Size>=8)
|
|
||||||
{
|
{
|
||||||
|
#ifdef BIG_ENDIAN
|
||||||
|
StartCRC ^= Data[0]|(Data[1] << 8)|(Data[2] << 16)|(Data[3] << 24);
|
||||||
|
uint NextData = Data[4]|(Data[5] << 8)|(Data[6] << 16)|(Data[7] << 24);
|
||||||
|
#else
|
||||||
StartCRC ^= *(uint32 *) Data;
|
StartCRC ^= *(uint32 *) Data;
|
||||||
StartCRC=CRCTab[(byte)StartCRC]^(StartCRC>>8);
|
uint NextData = *(uint32 *) (Data +4);
|
||||||
StartCRC=CRCTab[(byte)StartCRC]^(StartCRC>>8);
|
|
||||||
StartCRC=CRCTab[(byte)StartCRC]^(StartCRC>>8);
|
|
||||||
StartCRC=CRCTab[(byte)StartCRC]^(StartCRC>>8);
|
|
||||||
StartCRC^=*(uint32 *)(Data+4);
|
|
||||||
StartCRC=CRCTab[(byte)StartCRC]^(StartCRC>>8);
|
|
||||||
StartCRC=CRCTab[(byte)StartCRC]^(StartCRC>>8);
|
|
||||||
StartCRC=CRCTab[(byte)StartCRC]^(StartCRC>>8);
|
|
||||||
StartCRC=CRCTab[(byte)StartCRC]^(StartCRC>>8);
|
|
||||||
Data+=8;
|
|
||||||
Size-=8;
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
for (size_t I=0;I<Size;I++)
|
StartCRC = crc_tables[7][(byte) StartCRC ] ^
|
||||||
StartCRC=CRCTab[(byte)(StartCRC^Data[I])]^(StartCRC>>8);
|
crc_tables[6][(byte)(StartCRC >> 8) ] ^
|
||||||
return(StartCRC);
|
crc_tables[5][(byte)(StartCRC >> 16)] ^
|
||||||
|
crc_tables[4][(byte)(StartCRC >> 24)] ^
|
||||||
|
crc_tables[3][(byte) NextData ] ^
|
||||||
|
crc_tables[2][(byte)(NextData >>8 ) ] ^
|
||||||
|
crc_tables[1][(byte)(NextData >> 16)] ^
|
||||||
|
crc_tables[0][(byte)(NextData >> 24)];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (;Size>0;Size--,Data++) // Process left data.
|
||||||
|
StartCRC=crc_tables[0][(byte)(StartCRC^Data[0])]^(StartCRC>>8);
|
||||||
|
|
||||||
|
return StartCRC;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#ifndef SFX_MODULE
|
#ifndef SFX_MODULE
|
||||||
ushort OldCRC(ushort StartCRC,const void *Addr,size_t Size)
|
// For RAR 1.4 archives in case somebody still has them.
|
||||||
|
ushort Checksum14(ushort StartCRC,const void *Addr,size_t Size)
|
||||||
{
|
{
|
||||||
byte *Data=(byte *)Addr;
|
byte *Data=(byte *)Addr;
|
||||||
for (size_t I=0;I<Size;I++)
|
for (size_t I=0;I<Size;I++)
|
||||||
|
@ -64,6 +92,6 @@ ushort OldCRC(ushort StartCRC,const void *Addr,size_t Size)
|
||||||
StartCRC=(StartCRC+Data[I])&0xffff;
|
StartCRC=(StartCRC+Data[I])&0xffff;
|
||||||
StartCRC=((StartCRC<<1)|(StartCRC>>15))&0xffff;
|
StartCRC=((StartCRC<<1)|(StartCRC>>15))&0xffff;
|
||||||
}
|
}
|
||||||
return(StartCRC);
|
return StartCRC;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -11,10 +11,10 @@ EncodeFileName::EncodeFileName()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void EncodeFileName::Decode(char *Name,byte *EncName,int EncSize,wchar *NameW,
|
void EncodeFileName::Decode(char *Name,byte *EncName,size_t EncSize,wchar *NameW,
|
||||||
int MaxDecSize)
|
size_t MaxDecSize)
|
||||||
{
|
{
|
||||||
int EncPos=0,DecPos=0;
|
size_t EncPos=0,DecPos=0;
|
||||||
byte HighByte=EncName[EncPos++];
|
byte HighByte=EncName[EncPos++];
|
||||||
while (EncPos<EncSize && DecPos<MaxDecSize)
|
while (EncPos<EncSize && DecPos<MaxDecSize)
|
||||||
{
|
{
|
||||||
|
|
|
@ -8,13 +8,13 @@ class EncodeFileName
|
||||||
|
|
||||||
byte *EncName;
|
byte *EncName;
|
||||||
byte Flags;
|
byte Flags;
|
||||||
int FlagBits;
|
size_t FlagBits;
|
||||||
int FlagsPos;
|
size_t FlagsPos;
|
||||||
int DestSize;
|
size_t DestSize;
|
||||||
public:
|
public:
|
||||||
EncodeFileName();
|
EncodeFileName();
|
||||||
int Encode(char *Name,wchar *NameW,byte *EncName);
|
size_t Encode(char *Name,wchar *NameW,byte *EncName);
|
||||||
void Decode(char *Name,byte *EncName,int EncSize,wchar *NameW,int MaxDecSize);
|
void Decode(char *Name,byte *EncName,size_t EncSize,wchar *NameW,size_t MaxDecSize);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -9,28 +9,29 @@ unrar_err_t CmdExtract::ExtractCurrentFile( bool SkipSolid, bool check_compatibi
|
||||||
{
|
{
|
||||||
check( Arc.GetHeaderType() == FILE_HEAD );
|
check( Arc.GetHeaderType() == FILE_HEAD );
|
||||||
|
|
||||||
if ( Arc.NewLhd.Flags & (LHD_SPLIT_AFTER | LHD_SPLIT_BEFORE) )
|
if ( Arc.FileHead.SplitBefore || Arc.FileHead.SplitAfter )
|
||||||
return unrar_err_segmented;
|
return unrar_err_segmented;
|
||||||
|
|
||||||
if ( Arc.NewLhd.Flags & LHD_PASSWORD )
|
if ( Arc.FileHead.Encrypted )
|
||||||
return unrar_err_encrypted;
|
return unrar_err_encrypted;
|
||||||
|
|
||||||
if ( !check_compatibility_only )
|
if ( !check_compatibility_only )
|
||||||
{
|
{
|
||||||
check( Arc.NextBlockPos-Arc.NewLhd.FullPackSize == Arc.Tell() );
|
check( Arc.NextBlockPos-Arc.FileHead.PackSize == Arc.Tell() );
|
||||||
Arc.Seek(Arc.NextBlockPos-Arc.NewLhd.FullPackSize,SEEK_SET);
|
Arc.Seek(Arc.NextBlockPos-Arc.FileHead.PackSize,SEEK_SET);
|
||||||
}
|
}
|
||||||
|
|
||||||
// (removed lots of command-line handling)
|
// (removed lots of command-line handling)
|
||||||
|
|
||||||
#ifdef SFX_MODULE
|
#ifdef SFX_MODULE
|
||||||
if ((Arc.NewLhd.UnpVer!=UNP_VER && Arc.NewLhd.UnpVer!=29) &&
|
if ((Arc.FileHead.UnpVer!=UNP_VER && Arc.FileHead.UnpVer!=29) &&
|
||||||
Arc.NewLhd.Method!=0x30)
|
Arc.FileHead.Method!=0x30)
|
||||||
#else
|
#else
|
||||||
if (Arc.NewLhd.UnpVer<13 || Arc.NewLhd.UnpVer>UNP_VER)
|
if (Arc.FileHead.UnpVer!=VER_UNPACK5 &&
|
||||||
|
(Arc.FileHead.UnpVer<13 || Arc.FileHead.UnpVer>VER_UNPACK))
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
if (Arc.NewLhd.UnpVer>UNP_VER)
|
if (Arc.FileHead.UnpVer>VER_UNPACK)
|
||||||
return unrar_err_new_algo;
|
return unrar_err_new_algo;
|
||||||
return unrar_err_old_algo;
|
return unrar_err_old_algo;
|
||||||
}
|
}
|
||||||
|
@ -44,12 +45,15 @@ unrar_err_t CmdExtract::ExtractCurrentFile( bool SkipSolid, bool check_compatibi
|
||||||
FileCount++;
|
FileCount++;
|
||||||
DataIO.UnpFileCRC=Arc.OldFormat ? 0 : 0xffffffff;
|
DataIO.UnpFileCRC=Arc.OldFormat ? 0 : 0xffffffff;
|
||||||
// (removed decryption)
|
// (removed decryption)
|
||||||
DataIO.SetPackedSizeToRead(Arc.NewLhd.FullPackSize);
|
DataIO.UnpHash.Init(Arc.FileHead.FileHash.Type,1);
|
||||||
|
DataIO.PackedDataHash.Init(Arc.FileHead.FileHash.Type,1);
|
||||||
|
DataIO.SetPackedSizeToRead(Arc.FileHead.PackSize);
|
||||||
|
DataIO.SetSkipUnpCRC(SkipSolid);
|
||||||
// (removed command-line handling)
|
// (removed command-line handling)
|
||||||
DataIO.SetSkipUnpCRC(SkipSolid);
|
DataIO.SetSkipUnpCRC(SkipSolid);
|
||||||
|
|
||||||
if (Arc.NewLhd.Method==0x30)
|
if (Arc.FileHead.Method==0)
|
||||||
UnstoreFile(Arc.NewLhd.FullUnpSize);
|
UnstoreFile(Arc.FileHead.UnpSize);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Defer creation of Unpack until first extraction
|
// Defer creation of Unpack until first extraction
|
||||||
|
@ -58,25 +62,25 @@ unrar_err_t CmdExtract::ExtractCurrentFile( bool SkipSolid, bool check_compatibi
|
||||||
Unp = new Unpack( &Arc );
|
Unp = new Unpack( &Arc );
|
||||||
if ( !Unp )
|
if ( !Unp )
|
||||||
return unrar_err_memory;
|
return unrar_err_memory;
|
||||||
|
|
||||||
Unp->Init( NULL );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Unp->SetDestSize(Arc.NewLhd.FullUnpSize);
|
Unp->Init(Arc.FileHead.WinSize,Arc.FileHead.Solid);
|
||||||
|
Unp->SetDestSize(Arc.FileHead.UnpSize);
|
||||||
#ifndef SFX_MODULE
|
#ifndef SFX_MODULE
|
||||||
if (Arc.NewLhd.UnpVer<=15)
|
if (Arc.Format!=RARFMT50 && Arc.FileHead.UnpVer<=15)
|
||||||
Unp->DoUnpack(15,FileCount>1 && Arc.Solid);
|
Unp->DoUnpack(15,FileCount>1 && Arc.Solid);
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
Unp->DoUnpack(Arc.NewLhd.UnpVer,Arc.NewLhd.Flags & LHD_SOLID);
|
Unp->DoUnpack(Arc.FileHead.UnpVer,Arc.FileHead.Solid);
|
||||||
}
|
}
|
||||||
|
|
||||||
// (no need to seek to next file)
|
// (no need to seek to next file)
|
||||||
|
|
||||||
if (!SkipSolid)
|
if (!SkipSolid)
|
||||||
{
|
{
|
||||||
if (Arc.OldFormat && UINT32(DataIO.UnpFileCRC)==UINT32(Arc.NewLhd.FileCRC) ||
|
HashValue UnpHash;
|
||||||
!Arc.OldFormat && UINT32(DataIO.UnpFileCRC)==UINT32(Arc.NewLhd.FileCRC^0xffffffff))
|
DataIO.UnpHash.Result(&UnpHash);
|
||||||
|
if (UnpHash==Arc.FileHead.FileHash)
|
||||||
{
|
{
|
||||||
// CRC is correct
|
// CRC is correct
|
||||||
}
|
}
|
||||||
|
@ -93,12 +97,12 @@ unrar_err_t CmdExtract::ExtractCurrentFile( bool SkipSolid, bool check_compatibi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void CmdExtract::UnstoreFile(Int64 DestUnpSize)
|
void CmdExtract::UnstoreFile(int64 DestUnpSize)
|
||||||
{
|
{
|
||||||
Buffer.Alloc(Min(DestUnpSize,0x10000));
|
Buffer.Alloc((int)Min(DestUnpSize,0x10000));
|
||||||
while (1)
|
while (1)
|
||||||
{
|
{
|
||||||
unsigned int Code=DataIO.UnpRead(&Buffer[0],Buffer.Size());
|
unsigned int Code=DataIO.UnpRead(&Buffer[0],(uint)Buffer.Size());
|
||||||
if (Code==0 || (int)Code==-1)
|
if (Code==0 || (int)Code==-1)
|
||||||
break;
|
break;
|
||||||
Code=Code<DestUnpSize ? Code:int64to32(DestUnpSize);
|
Code=Code<DestUnpSize ? Code:int64to32(DestUnpSize);
|
||||||
|
|
|
@ -1,19 +1,29 @@
|
||||||
#include "rar.hpp"
|
#include "rar.hpp"
|
||||||
|
|
||||||
BitInput::BitInput()
|
BitInput::BitInput(bool AllocBuffer)
|
||||||
{
|
{
|
||||||
InBuf = (byte*) rarmalloc( MAX_SIZE );
|
ExternalBuffer=false;
|
||||||
|
if (AllocBuffer)
|
||||||
|
{
|
||||||
|
// getbits32 attempts to read data from InAddr, ... InAddr+3 positions.
|
||||||
|
// So let's allocate 3 additional bytes for situation, when we need to
|
||||||
|
// read only 1 byte from the last position of buffer and avoid a crash
|
||||||
|
// from access to next 3 bytes, which contents we do not need.
|
||||||
|
size_t BufSize=MAX_SIZE+3;
|
||||||
|
InBuf=new byte[BufSize];
|
||||||
|
|
||||||
// Otherwise getbits() reads uninitialized memory
|
// Ensure that we get predictable results when accessing bytes in area
|
||||||
// TODO: instead of clearing entire block, just clear last two
|
// not filled with read data.
|
||||||
// bytes after reading from file
|
memset(InBuf,0,BufSize);
|
||||||
if ( InBuf )
|
}
|
||||||
memset( InBuf, 0, MAX_SIZE );
|
else
|
||||||
|
InBuf=NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
BitInput::~BitInput()
|
BitInput::~BitInput()
|
||||||
{
|
{
|
||||||
rarfree( InBuf );
|
if (!ExternalBuffer)
|
||||||
|
delete[] InBuf;
|
||||||
}
|
}
|
||||||
|
|
||||||
void BitInput::handle_mem_error( Rar_Error_Handler& ErrHandler )
|
void BitInput::handle_mem_error( Rar_Error_Handler& ErrHandler )
|
||||||
|
@ -22,13 +32,25 @@ void BitInput::handle_mem_error( Rar_Error_Handler& ErrHandler )
|
||||||
ErrHandler.MemoryError();
|
ErrHandler.MemoryError();
|
||||||
}
|
}
|
||||||
|
|
||||||
void BitInput::faddbits(int Bits)
|
void BitInput::faddbits(uint Bits)
|
||||||
{
|
{
|
||||||
|
// Function wrapped version of inline addbits to save code size.
|
||||||
addbits(Bits);
|
addbits(Bits);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
unsigned int BitInput::fgetbits()
|
uint BitInput::fgetbits()
|
||||||
{
|
{
|
||||||
|
// Function wrapped version of inline getbits to save code size.
|
||||||
return(getbits());
|
return(getbits());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void BitInput::SetExternalBuffer(byte *Buf)
|
||||||
|
{
|
||||||
|
if (InBuf!=NULL && !ExternalBuffer)
|
||||||
|
delete[] InBuf;
|
||||||
|
InBuf=Buf;
|
||||||
|
ExternalBuffer=true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
@ -5,36 +5,66 @@ class BitInput
|
||||||
: public Rar_Allocator
|
: public Rar_Allocator
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
enum BufferSize {MAX_SIZE=0x8000};
|
enum BufferSize {MAX_SIZE=0x8000}; // Size of input buffer.
|
||||||
protected:
|
|
||||||
int InAddr,InBit;
|
int InAddr; // Curent byte position in the buffer.
|
||||||
|
int InBit; // Current bit position in the current byte.
|
||||||
|
|
||||||
|
bool ExternalBuffer;
|
||||||
public:
|
public:
|
||||||
BitInput();
|
BitInput(bool AllocBuffer);
|
||||||
~BitInput();
|
~BitInput();
|
||||||
void handle_mem_error( Rar_Error_Handler& );
|
void handle_mem_error( Rar_Error_Handler& );
|
||||||
|
|
||||||
byte *InBuf;
|
byte *InBuf; // Dynamically allocated input buffer.
|
||||||
|
|
||||||
void InitBitInput()
|
void InitBitInput()
|
||||||
{
|
{
|
||||||
InAddr=InBit=0;
|
InAddr=InBit=0;
|
||||||
}
|
}
|
||||||
void addbits(int Bits)
|
|
||||||
|
// Move forward by 'Bits' bits.
|
||||||
|
void addbits(uint Bits)
|
||||||
{
|
{
|
||||||
Bits+=InBit;
|
Bits+=InBit;
|
||||||
InAddr+=Bits>>3;
|
InAddr+=Bits>>3;
|
||||||
InBit=Bits&7;
|
InBit=Bits&7;
|
||||||
}
|
}
|
||||||
unsigned int getbits()
|
|
||||||
|
// Return 16 bits from current position in the buffer.
|
||||||
|
// Bit at (InAddr,InBit) has the highest position in returning data.
|
||||||
|
uint getbits()
|
||||||
{
|
{
|
||||||
unsigned int BitField=(uint)InBuf[InAddr] << 16;
|
uint BitField=(uint)InBuf[InAddr] << 16;
|
||||||
BitField|=(uint)InBuf[InAddr+1] << 8;
|
BitField|=(uint)InBuf[InAddr+1] << 8;
|
||||||
BitField|=(uint)InBuf[InAddr+2];
|
BitField|=(uint)InBuf[InAddr+2];
|
||||||
BitField >>= (8-InBit);
|
BitField >>= (8-InBit);
|
||||||
return(BitField & 0xffff);
|
return(BitField & 0xffff);
|
||||||
}
|
}
|
||||||
void faddbits(int Bits);
|
|
||||||
unsigned int fgetbits();
|
// Return 32 bits from current position in the buffer.
|
||||||
bool Overflow(int IncPtr) {return(InAddr+IncPtr>=MAX_SIZE);}
|
// Bit at (InAddr,InBit) has the highest position in returning data.
|
||||||
|
uint getbits32()
|
||||||
|
{
|
||||||
|
uint BitField=(uint)InBuf[InAddr] << 24;
|
||||||
|
BitField|=(uint)InBuf[InAddr+1] << 16;
|
||||||
|
BitField|=(uint)InBuf[InAddr+2] << 8;
|
||||||
|
BitField|=(uint)InBuf[InAddr+3];
|
||||||
|
BitField <<= InBit;
|
||||||
|
BitField|=(uint)InBuf[InAddr+4] >> (8-InBit);
|
||||||
|
return(BitField & 0xffffffff);
|
||||||
|
}
|
||||||
|
|
||||||
|
void faddbits(uint Bits);
|
||||||
|
uint fgetbits();
|
||||||
|
|
||||||
|
// Check if buffer has enough space for IncPtr bytes. Returns 'true'
|
||||||
|
// if buffer will be overflown.
|
||||||
|
bool Overflow(uint IncPtr)
|
||||||
|
{
|
||||||
|
return(InAddr+IncPtr>=MAX_SIZE);
|
||||||
|
}
|
||||||
|
|
||||||
|
void SetExternalBuffer(byte *Buf);
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -0,0 +1,118 @@
|
||||||
|
#include "rar.hpp"
|
||||||
|
|
||||||
|
void HashValue::Init(HASH_TYPE Type)
|
||||||
|
{
|
||||||
|
HashValue::Type=Type;
|
||||||
|
|
||||||
|
// Zero length data CRC32 is 0. It is important to set it when creating
|
||||||
|
// headers with no following data like directories or symlinks.
|
||||||
|
if (Type==HASH_RAR14 || Type==HASH_CRC32)
|
||||||
|
CRC32=0;
|
||||||
|
if (Type==HASH_BLAKE2)
|
||||||
|
{
|
||||||
|
// dd0e891776933f43c7d032b08a917e25741f8aa9a12c12e1cac8801500f2ca4f
|
||||||
|
// is BLAKE2sp hash of empty data. We init the structure to this value,
|
||||||
|
// so if we create a file or service header with no following data like
|
||||||
|
// "file copy" or "symlink", we set the checksum to proper value avoiding
|
||||||
|
// additional header type or size checks when extracting.
|
||||||
|
static byte EmptyHash[32]={
|
||||||
|
0xdd, 0x0e, 0x89, 0x17, 0x76, 0x93, 0x3f, 0x43,
|
||||||
|
0xc7, 0xd0, 0x32, 0xb0, 0x8a, 0x91, 0x7e, 0x25,
|
||||||
|
0x74, 0x1f, 0x8a, 0xa9, 0xa1, 0x2c, 0x12, 0xe1,
|
||||||
|
0xca, 0xc8, 0x80, 0x15, 0x00, 0xf2, 0xca, 0x4f
|
||||||
|
};
|
||||||
|
memcpy(Digest,EmptyHash,sizeof(Digest));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool HashValue::operator == (const HashValue &cmp)
|
||||||
|
{
|
||||||
|
if (Type==HASH_NONE || cmp.Type==HASH_NONE)
|
||||||
|
return true;
|
||||||
|
if ((Type==HASH_RAR14 && cmp.Type==HASH_RAR14) ||
|
||||||
|
(Type==HASH_CRC32 && cmp.Type==HASH_CRC32))
|
||||||
|
return CRC32==cmp.CRC32;
|
||||||
|
if (Type==HASH_BLAKE2 && cmp.Type==HASH_BLAKE2)
|
||||||
|
return memcmp(Digest,cmp.Digest,sizeof(Digest))==0;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
DataHash::DataHash()
|
||||||
|
{
|
||||||
|
HashType=HASH_NONE;
|
||||||
|
#ifdef RAR_SMP
|
||||||
|
ThPool=NULL;
|
||||||
|
MaxThreads=0;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
DataHash::~DataHash()
|
||||||
|
{
|
||||||
|
#ifdef RAR_SMP
|
||||||
|
DestroyThreadPool(ThPool);
|
||||||
|
#endif
|
||||||
|
cleandata(&blake2ctx, sizeof(blake2ctx));
|
||||||
|
cleandata(&CurCRC32, sizeof(CurCRC32));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void DataHash::Init(HASH_TYPE Type,uint MaxThreads)
|
||||||
|
{
|
||||||
|
HashType=Type;
|
||||||
|
if (Type==HASH_RAR14)
|
||||||
|
CurCRC32=0;
|
||||||
|
if (Type==HASH_CRC32)
|
||||||
|
CurCRC32=0xffffffff; // Initial CRC32 value.
|
||||||
|
if (Type==HASH_BLAKE2)
|
||||||
|
blake2sp_init( &blake2ctx );
|
||||||
|
#ifdef RAR_SMP
|
||||||
|
DataHash::MaxThreads=Min(MaxThreads,MaxHashThreads);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void DataHash::Update(const void *Data,size_t DataSize)
|
||||||
|
{
|
||||||
|
#ifndef SFX_MODULE
|
||||||
|
if (HashType==HASH_RAR14)
|
||||||
|
CurCRC32=Checksum14((ushort)CurCRC32,Data,DataSize);
|
||||||
|
#endif
|
||||||
|
if (HashType==HASH_CRC32)
|
||||||
|
CurCRC32=CRC32(CurCRC32,Data,DataSize);
|
||||||
|
|
||||||
|
if (HashType==HASH_BLAKE2)
|
||||||
|
{
|
||||||
|
#ifdef RAR_SMP
|
||||||
|
if (MaxThreads>1 && ThPool==NULL)
|
||||||
|
ThPool=CreateThreadPool();
|
||||||
|
blake2ctx.ThPool=ThPool;
|
||||||
|
blake2ctx.MaxThreads=MaxThreads;
|
||||||
|
#endif
|
||||||
|
blake2sp_update( &blake2ctx, (byte *)Data, DataSize);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void DataHash::Result(HashValue *Result)
|
||||||
|
{
|
||||||
|
Result->Type=HashType;
|
||||||
|
if (HashType==HASH_RAR14)
|
||||||
|
Result->CRC32=CurCRC32;
|
||||||
|
if (HashType==HASH_CRC32)
|
||||||
|
Result->CRC32=CurCRC32^0xffffffff;
|
||||||
|
if (HashType==HASH_BLAKE2)
|
||||||
|
{
|
||||||
|
// Preserve the original context, so we can continue hashing if necessary.
|
||||||
|
blake2sp_state res=blake2ctx;
|
||||||
|
blake2sp_final( &res, Result->Digest );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
uint DataHash::GetCRC32()
|
||||||
|
{
|
||||||
|
return HashType==HASH_CRC32 ? CurCRC32^0xffffffff : 0;
|
||||||
|
}
|
|
@ -0,0 +1,52 @@
|
||||||
|
#ifndef _RAR_DATAHASH_
|
||||||
|
#define _RAR_DATAHASH_
|
||||||
|
|
||||||
|
enum HASH_TYPE {HASH_NONE,HASH_RAR14,HASH_CRC32,HASH_BLAKE2};
|
||||||
|
|
||||||
|
struct HashValue
|
||||||
|
{
|
||||||
|
void Init(HASH_TYPE Type);
|
||||||
|
bool operator == (const HashValue &cmp);
|
||||||
|
bool operator != (const HashValue &cmp) {return !(*this==cmp);}
|
||||||
|
|
||||||
|
HASH_TYPE Type;
|
||||||
|
union
|
||||||
|
{
|
||||||
|
uint CRC32;
|
||||||
|
byte Digest[SHA256_DIGEST_SIZE];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef RAR_SMP
|
||||||
|
class ThreadPool;
|
||||||
|
class DataHash;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
class DataHash
|
||||||
|
{
|
||||||
|
private:
|
||||||
|
HASH_TYPE HashType;
|
||||||
|
uint CurCRC32;
|
||||||
|
blake2sp_state blake2ctx;
|
||||||
|
|
||||||
|
#ifdef RAR_SMP
|
||||||
|
ThreadPool *ThPool;
|
||||||
|
|
||||||
|
uint MaxThreads;
|
||||||
|
// Upper limit for maximum threads to prevent wasting threads in pool.
|
||||||
|
static const uint MaxHashThreads=8;
|
||||||
|
#endif
|
||||||
|
public:
|
||||||
|
DataHash();
|
||||||
|
~DataHash();
|
||||||
|
void Init(HASH_TYPE Type,uint MaxThreads);
|
||||||
|
void Update(const void *Data,size_t DataSize);
|
||||||
|
void Result(HashValue *Result);
|
||||||
|
uint GetCRC32();
|
||||||
|
bool Cmp(HashValue *CmpValue,byte *Key);
|
||||||
|
HASH_TYPE Type() {return HashType;}
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
|
@ -0,0 +1,60 @@
|
||||||
|
#include "rar.hpp"
|
||||||
|
|
||||||
|
void FileHeader::Reset(size_t SubDataSize)
|
||||||
|
{
|
||||||
|
SubData.Alloc(SubDataSize);
|
||||||
|
BaseBlock::Reset();
|
||||||
|
#ifndef SHELL_EXT
|
||||||
|
FileHash.Init(HASH_NONE);
|
||||||
|
#endif
|
||||||
|
mtime.Reset();
|
||||||
|
atime.Reset();
|
||||||
|
ctime.Reset();
|
||||||
|
SplitBefore=false;
|
||||||
|
SplitAfter=false;
|
||||||
|
|
||||||
|
UnknownUnpSize=0;
|
||||||
|
|
||||||
|
SubFlags=0; // Important for RAR 3.0 subhead.
|
||||||
|
|
||||||
|
Encrypted=false;
|
||||||
|
UsePswCheck=false;
|
||||||
|
UseHashKey=false;
|
||||||
|
Lg2Count=0;
|
||||||
|
|
||||||
|
Solid=false;
|
||||||
|
Dir=false;
|
||||||
|
WinSize=0;
|
||||||
|
Inherited=false;
|
||||||
|
SubBlock=false;
|
||||||
|
CommentInHeader=false;
|
||||||
|
Version=false;
|
||||||
|
LargeFile=false;
|
||||||
|
|
||||||
|
RedirType=FSREDIR_NONE;
|
||||||
|
UnixOwnerSet=false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
FileHeader& FileHeader::operator = (FileHeader &hd)
|
||||||
|
{
|
||||||
|
SubData.Reset();
|
||||||
|
memcpy(this,&hd,sizeof(*this));
|
||||||
|
SubData.CleanData();
|
||||||
|
SubData=hd.SubData;
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void MainHeader::Reset()
|
||||||
|
{
|
||||||
|
HighPosAV=0;
|
||||||
|
PosAV=0;
|
||||||
|
CommentInHeader=false;
|
||||||
|
PackComment=false;
|
||||||
|
Locator=false;
|
||||||
|
QOpenOffset=0;
|
||||||
|
QOpenMaxSize=0;
|
||||||
|
RROffset=0;
|
||||||
|
RRMaxSize=0;
|
||||||
|
}
|
|
@ -1,92 +1,161 @@
|
||||||
#ifndef _RAR_HEADERS_
|
#ifndef _RAR_HEADERS_
|
||||||
#define _RAR_HEADERS_
|
#define _RAR_HEADERS_
|
||||||
|
|
||||||
#define SIZEOF_MARKHEAD 7
|
#define SIZEOF_MARKHEAD3 7 // Size of RAR 4.x archive mark header.
|
||||||
#define SIZEOF_OLDMHD 7
|
#define SIZEOF_MAINHEAD14 7 // Size of RAR 1.4 main archive header.
|
||||||
#define SIZEOF_NEWMHD 13
|
#define SIZEOF_MAINHEAD3 13 // Size of RAR 4.x main archive header.
|
||||||
#define SIZEOF_OLDLHD 21
|
#define SIZEOF_FILEHEAD14 21 // Size of RAR 1.4 file header.
|
||||||
#define SIZEOF_NEWLHD 32
|
#define SIZEOF_FILEHEAD3 32 // Size of RAR 3.0 file header.
|
||||||
#define SIZEOF_SHORTBLOCKHEAD 7
|
#define SIZEOF_SHORTBLOCKHEAD 7
|
||||||
|
#define SIZEOF_LONGBLOCKHEAD 11
|
||||||
#define SIZEOF_SUBBLOCKHEAD 14
|
#define SIZEOF_SUBBLOCKHEAD 14
|
||||||
#define SIZEOF_COMMHEAD 13
|
#define SIZEOF_COMMHEAD 13
|
||||||
|
#define SIZEOF_PROTECTHEAD 26
|
||||||
|
#define SIZEOF_AVHEAD 14
|
||||||
|
#define SIZEOF_SIGNHEAD 15
|
||||||
|
#define SIZEOF_UOHEAD 18
|
||||||
|
#define SIZEOF_MACHEAD 22
|
||||||
|
#define SIZEOF_EAHEAD 24
|
||||||
|
#define SIZEOF_BEEAHEAD 24
|
||||||
|
#define SIZEOF_STREAMHEAD 26
|
||||||
|
|
||||||
#define UNP_VER 36
|
#define VER_PACK 29
|
||||||
|
#define VER_PACK5 0
|
||||||
|
#define VER_UNPACK 29
|
||||||
|
#define VER_UNPACK5 0
|
||||||
|
|
||||||
#define MHD_VOLUME 0x0001
|
#define MHD_VOLUME 0x0001U
|
||||||
#define MHD_COMMENT 0x0002
|
|
||||||
#define MHD_SOLID 0x0008
|
|
||||||
#define MHD_PASSWORD 0x0080
|
|
||||||
|
|
||||||
#define LHD_SPLIT_BEFORE 0x0001
|
// Old style main archive comment embed into main archive header. Must not
|
||||||
#define LHD_SPLIT_AFTER 0x0002
|
// be used in new archives anymore.
|
||||||
#define LHD_PASSWORD 0x0004
|
#define MHD_COMMENT 0x0002U
|
||||||
#define LHD_COMMENT 0x0008
|
|
||||||
#define LHD_SOLID 0x0010
|
|
||||||
|
|
||||||
#define LHD_WINDOWMASK 0x00e0
|
#define MHD_LOCK 0x0004U
|
||||||
#define LHD_DIRECTORY 0x00e0
|
#define MHD_SOLID 0x0008U
|
||||||
|
#define MHD_PACK_COMMENT 0x0010U
|
||||||
|
#define MHD_NEWNUMBERING 0x0010U
|
||||||
|
#define MHD_AV 0x0020U
|
||||||
|
#define MHD_PROTECT 0x0040U
|
||||||
|
#define MHD_PASSWORD 0x0080U
|
||||||
|
#define MHD_FIRSTVOLUME 0x0100U
|
||||||
|
|
||||||
#define LHD_LARGE 0x0100
|
#define LHD_SPLIT_BEFORE 0x0001U
|
||||||
#define LHD_UNICODE 0x0200
|
#define LHD_SPLIT_AFTER 0x0002U
|
||||||
#define LHD_SALT 0x0400
|
#define LHD_PASSWORD 0x0004U
|
||||||
#define LHD_EXTTIME 0x1000
|
|
||||||
|
|
||||||
#define LONG_BLOCK 0x8000
|
// Old style file comment embed into file header. Must not be used
|
||||||
|
// in new archives anymore.
|
||||||
|
#define LHD_COMMENT 0x0008U
|
||||||
|
|
||||||
|
// For non-file subheaders it denotes 'subblock having a parent file' flag.
|
||||||
|
#define LHD_SOLID 0x0010U
|
||||||
|
|
||||||
|
|
||||||
|
#define LHD_WINDOWMASK 0x00e0U
|
||||||
|
#define LHD_WINDOW64 0x0000U
|
||||||
|
#define LHD_WINDOW128 0x0020U
|
||||||
|
#define LHD_WINDOW256 0x0040U
|
||||||
|
#define LHD_WINDOW512 0x0060U
|
||||||
|
#define LHD_WINDOW1024 0x0080U
|
||||||
|
#define LHD_WINDOW2048 0x00a0U
|
||||||
|
#define LHD_WINDOW4096 0x00c0U
|
||||||
|
#define LHD_DIRECTORY 0x00e0U
|
||||||
|
|
||||||
|
#define LHD_LARGE 0x0100U
|
||||||
|
#define LHD_UNICODE 0x0200U
|
||||||
|
#define LHD_SALT 0x0400U
|
||||||
|
#define LHD_VERSION 0x0800U
|
||||||
|
#define LHD_EXTTIME 0x1000U
|
||||||
|
|
||||||
|
#define SKIP_IF_UNKNOWN 0x4000U
|
||||||
|
#define LONG_BLOCK 0x8000U
|
||||||
|
|
||||||
|
#define EARC_NEXT_VOLUME 0x0001U // Not last volume.
|
||||||
|
#define EARC_DATACRC 0x0002U // Store CRC32 of RAR archive (now is used only in volumes).
|
||||||
|
#define EARC_REVSPACE 0x0004U // Reserve space for end of REV file 7 byte record.
|
||||||
|
#define EARC_VOLNUMBER 0x0008U // Store a number of current volume.
|
||||||
|
|
||||||
enum HEADER_TYPE {
|
enum HEADER_TYPE {
|
||||||
MARK_HEAD=0x72,MAIN_HEAD=0x73,FILE_HEAD=0x74,COMM_HEAD=0x75,AV_HEAD=0x76,
|
// RAR 5.0 header types.
|
||||||
SUB_HEAD=0x77,PROTECT_HEAD=0x78,SIGN_HEAD=0x79,NEWSUB_HEAD=0x7a,
|
HEAD_MARK=0x00, HEAD_MAIN=0x01, HEAD_FILE=0x02, HEAD_SERVICE=0x03,
|
||||||
ENDARC_HEAD=0x7b
|
HEAD_CRYPT=0x04, HEAD_ENDARC=0x05, HEAD_UNKNOWN=0xff,
|
||||||
|
|
||||||
|
// RAR 1.5 - 4.x header types.
|
||||||
|
HEAD3_MARK=0x72,HEAD3_MAIN=0x73,HEAD3_FILE=0x74,HEAD3_CMT=0x75,
|
||||||
|
HEAD3_AV=0x76,HEAD3_OLDSERVICE=0x77,HEAD3_PROTECT=0x78,HEAD3_SIGN=0x79,
|
||||||
|
HEAD3_SERVICE=0x7a,HEAD3_ENDARC=0x7b
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enum { EA_HEAD=0x100,UO_HEAD=0x101,MAC_HEAD=0x102,BEEA_HEAD=0x103,
|
||||||
|
NTACL_HEAD=0x104,STREAM_HEAD=0x105 };
|
||||||
|
|
||||||
|
|
||||||
|
// Internal implementation, depends on archive format version.
|
||||||
enum HOST_SYSTEM {
|
enum HOST_SYSTEM {
|
||||||
|
// RAR 5.0 host OS
|
||||||
|
HOST5_WINDOWS=0,HOST5_UNIX=1,
|
||||||
|
|
||||||
|
// RAR 3.0 host OS.
|
||||||
HOST_MSDOS=0,HOST_OS2=1,HOST_WIN32=2,HOST_UNIX=3,HOST_MACOS=4,
|
HOST_MSDOS=0,HOST_OS2=1,HOST_WIN32=2,HOST_UNIX=3,HOST_MACOS=4,
|
||||||
HOST_BEOS=5,HOST_MAX
|
HOST_BEOS=5,HOST_MAX
|
||||||
};
|
};
|
||||||
|
|
||||||
struct OldMainHeader
|
// Unified archive format independent implementation.
|
||||||
{
|
enum HOST_SYSTEM_TYPE {
|
||||||
byte Mark[4];
|
HSYS_WINDOWS, HSYS_UNIX, HSYS_UNKNOWN
|
||||||
ushort HeadSize;
|
|
||||||
byte Flags;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
struct OldFileHeader
|
// We also use these values in extra field, so do not modify them.
|
||||||
{
|
enum FILE_SYSTEM_REDIRECT {
|
||||||
uint PackSize;
|
FSREDIR_NONE=0, FSREDIR_UNIXSYMLINK, FSREDIR_WINSYMLINK, FSREDIR_JUNCTION,
|
||||||
uint UnpSize;
|
FSREDIR_HARDLINK, FSREDIR_FILECOPY
|
||||||
ushort FileCRC;
|
|
||||||
ushort HeadSize;
|
|
||||||
uint FileTime;
|
|
||||||
byte FileAttr;
|
|
||||||
byte Flags;
|
|
||||||
byte UnpVer;
|
|
||||||
byte NameSize;
|
|
||||||
byte Method;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
static const wchar SUBHEAD_TYPE_CMT[] = {'C', 'M', 'T', 0};
|
||||||
|
static const wchar SUBHEAD_TYPE_QOPEN[] = {'Q', 'O', 0};
|
||||||
|
static const wchar SUBHEAD_TYPE_ACL[] = {'A', 'C', 'L', 0};
|
||||||
|
static const wchar SUBHEAD_TYPE_STREAM[] = {'S', 'T', 'M', 0};
|
||||||
|
static const wchar SUBHEAD_TYPE_UOWNER[] = {'U', 'O', 'W', 0};
|
||||||
|
static const wchar SUBHEAD_TYPE_AV[] = {'A', 'V', 0};
|
||||||
|
static const wchar SUBHEAD_TYPE_RR[] = {'R', 'R', 0};
|
||||||
|
static const wchar SUBHEAD_TYPE_OS2EA[] = {'E', 'A', '2', 0};
|
||||||
|
|
||||||
|
/* new file inherits a subblock when updating a host file */
|
||||||
|
#define SUBHEAD_FLAGS_INHERITED 0x80000000
|
||||||
|
|
||||||
|
#define SUBHEAD_FLAGS_CMT_UNICODE 0x00000001
|
||||||
|
|
||||||
|
|
||||||
struct MarkHeader
|
struct MarkHeader
|
||||||
{
|
{
|
||||||
byte Mark[7];
|
byte Mark[8];
|
||||||
|
|
||||||
|
// Following fields are virtual and not present in real blocks.
|
||||||
|
uint HeadSize;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
struct BaseBlock
|
struct BaseBlock
|
||||||
{
|
{
|
||||||
ushort HeadCRC;
|
uint HeadCRC; // 'ushort' for RAR 1.5.
|
||||||
HEADER_TYPE HeadType;//byte
|
HEADER_TYPE HeaderType; // 1 byte for RAR 1.5.
|
||||||
ushort Flags;
|
uint Flags; // 'ushort' for RAR 1.5.
|
||||||
ushort HeadSize;
|
uint HeadSize; // 'ushort' for RAR 1.5, up to 2 MB for RAR 5.0.
|
||||||
|
|
||||||
|
bool SkipIfUnknown;
|
||||||
|
|
||||||
|
void Reset()
|
||||||
|
{
|
||||||
|
SkipIfUnknown=false;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
struct BlockHeader:BaseBlock
|
struct BlockHeader:BaseBlock
|
||||||
{
|
{
|
||||||
union {
|
|
||||||
uint DataSize;
|
uint DataSize;
|
||||||
uint PackSize;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -94,46 +163,139 @@ struct MainHeader:BaseBlock
|
||||||
{
|
{
|
||||||
ushort HighPosAV;
|
ushort HighPosAV;
|
||||||
uint PosAV;
|
uint PosAV;
|
||||||
|
bool CommentInHeader;
|
||||||
|
bool PackComment; // For RAR 1.4 archive format only.
|
||||||
|
bool Locator;
|
||||||
|
uint64 QOpenOffset; // Offset of quick list record.
|
||||||
|
uint64 QOpenMaxSize; // Maximum size of QOpen offset in locator extra field.
|
||||||
|
uint64 RROffset; // Offset of recovery record.
|
||||||
|
uint64 RRMaxSize; // Maximum size of RR offset in locator extra field.
|
||||||
|
void Reset();
|
||||||
};
|
};
|
||||||
|
|
||||||
#define SALT_SIZE 8
|
|
||||||
|
|
||||||
struct FileHeader:BlockHeader
|
struct FileHeader:BlockHeader
|
||||||
{
|
{
|
||||||
uint UnpSize;
|
|
||||||
byte HostOS;
|
byte HostOS;
|
||||||
uint FileCRC;
|
|
||||||
uint FileTime;
|
|
||||||
byte UnpVer;
|
byte UnpVer;
|
||||||
byte Method;
|
byte Method;
|
||||||
ushort NameSize;
|
|
||||||
union {
|
union {
|
||||||
uint FileAttr;
|
uint FileAttr;
|
||||||
uint SubFlags;
|
uint SubFlags;
|
||||||
};
|
};
|
||||||
/* optional */
|
wchar FileName[NM];
|
||||||
uint HighPackSize;
|
|
||||||
uint HighUnpSize;
|
Array<byte> SubData;
|
||||||
/* names */
|
|
||||||
char FileName[NM*4]; // *4 to avoid using lots of stack in arcread
|
|
||||||
wchar FileNameW[NM];
|
|
||||||
/* optional */
|
|
||||||
byte Salt[SALT_SIZE];
|
|
||||||
|
|
||||||
RarTime mtime;
|
RarTime mtime;
|
||||||
/* dummy */
|
RarTime ctime;
|
||||||
Int64 FullPackSize;
|
RarTime atime;
|
||||||
Int64 FullUnpSize;
|
|
||||||
|
int64 PackSize;
|
||||||
|
int64 UnpSize;
|
||||||
|
int64 MaxSize; // Reserve size bytes for vint of this size.
|
||||||
|
|
||||||
|
HashValue FileHash;
|
||||||
|
|
||||||
|
uint FileFlags;
|
||||||
|
|
||||||
|
bool SplitBefore;
|
||||||
|
bool SplitAfter;
|
||||||
|
|
||||||
|
bool UnknownUnpSize;
|
||||||
|
|
||||||
|
bool Encrypted;
|
||||||
|
bool UsePswCheck;
|
||||||
|
|
||||||
|
// Use HMAC calculated from HashKey and checksum instead of plain checksum.
|
||||||
|
bool UseHashKey;
|
||||||
|
|
||||||
|
uint Lg2Count; // Log2 of PBKDF2 repetition count.
|
||||||
|
|
||||||
|
bool Solid;
|
||||||
|
bool Dir;
|
||||||
|
bool CommentInHeader; // RAR 2.0 file comment.
|
||||||
|
bool Version; // name.ext;ver file name containing the version number.
|
||||||
|
size_t WinSize;
|
||||||
|
bool Inherited; // New file inherits a subblock when updating a host file (for subblocks only).
|
||||||
|
|
||||||
|
// 'true' if file sizes use 8 bytes instead of 4. Not used in RAR 5.0.
|
||||||
|
bool LargeFile;
|
||||||
|
|
||||||
|
// 'true' for HEAD_SERVICE block, which is a child of preceding file block.
|
||||||
|
// RAR 4.x uses 'solid' flag to indicate child subheader blocks in archives.
|
||||||
|
bool SubBlock;
|
||||||
|
|
||||||
|
HOST_SYSTEM_TYPE HSType;
|
||||||
|
|
||||||
|
FILE_SYSTEM_REDIRECT RedirType;
|
||||||
|
wchar RedirName[NM];
|
||||||
|
bool DirTarget;
|
||||||
|
|
||||||
|
bool UnixOwnerSet,UnixOwnerNumeric,UnixGroupNumeric;
|
||||||
|
char UnixOwnerName[256],UnixGroupName[256];
|
||||||
|
#ifdef _UNIX
|
||||||
|
uid_t UnixOwnerID;
|
||||||
|
uid_t UnixGroupID;
|
||||||
|
#else // Need these Unix fields in Windows too for 'list' command.
|
||||||
|
uint UnixOwnerID;
|
||||||
|
uint UnixGroupID;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
void Reset(size_t SubDataSize=0);
|
||||||
|
|
||||||
|
bool CmpName(const wchar *Name)
|
||||||
|
{
|
||||||
|
return(my_wcscmp(FileName,Name)==0);
|
||||||
|
}
|
||||||
|
|
||||||
|
FileHeader& operator = (FileHeader &hd);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
struct EndArcHeader:BaseBlock
|
||||||
|
{
|
||||||
|
// Optional CRC32 of entire archive up to start of EndArcHeader block.
|
||||||
|
// Present in RAR 4.x archives if EARC_DATACRC flag is set.
|
||||||
|
uint ArcDataCRC;
|
||||||
|
|
||||||
|
uint VolNumber; // Optional number of current volume.
|
||||||
|
|
||||||
|
// 7 additional zero bytes can be stored here if EARC_REVSPACE is set.
|
||||||
|
|
||||||
|
bool NextVolume; // Not last volume.
|
||||||
|
bool DataCRC;
|
||||||
|
bool RevSpace;
|
||||||
|
bool StoreVolNumber;
|
||||||
|
void Reset()
|
||||||
|
{
|
||||||
|
BaseBlock::Reset();
|
||||||
|
NextVolume=false;
|
||||||
|
DataCRC=false;
|
||||||
|
RevSpace=false;
|
||||||
|
StoreVolNumber=false;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
// SubBlockHeader and its successors were used in RAR 2.x format.
|
// SubBlockHeader and its successors were used in RAR 2.x format.
|
||||||
// RAR 3.x uses FileHeader with NEWSUB_HEAD HeadType for subblocks.
|
// RAR 4.x uses FileHeader with HEAD_SERVICE HeaderType for subblocks.
|
||||||
struct SubBlockHeader:BlockHeader
|
struct SubBlockHeader:BlockHeader
|
||||||
{
|
{
|
||||||
ushort SubType;
|
ushort SubType;
|
||||||
byte Level;
|
byte Level;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
struct CommentHeader:BaseBlock
|
||||||
|
{
|
||||||
|
ushort UnpSize;
|
||||||
|
byte UnpVer;
|
||||||
|
byte Method;
|
||||||
|
ushort CommCRC;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
struct ProtectHeader:BlockHeader
|
struct ProtectHeader:BlockHeader
|
||||||
{
|
{
|
||||||
byte Version;
|
byte Version;
|
||||||
|
@ -142,4 +304,59 @@ struct ProtectHeader:BlockHeader
|
||||||
byte Mark[8];
|
byte Mark[8];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
struct AVHeader:BaseBlock
|
||||||
|
{
|
||||||
|
byte UnpVer;
|
||||||
|
byte Method;
|
||||||
|
byte AVVer;
|
||||||
|
uint AVInfoCRC;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
struct SignHeader:BaseBlock
|
||||||
|
{
|
||||||
|
uint CreationTime;
|
||||||
|
ushort ArcNameSize;
|
||||||
|
ushort UserNameSize;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
struct UnixOwnersHeader:SubBlockHeader
|
||||||
|
{
|
||||||
|
ushort OwnerNameSize;
|
||||||
|
ushort GroupNameSize;
|
||||||
|
/* dummy */
|
||||||
|
char OwnerName[256];
|
||||||
|
char GroupName[256];
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
struct EAHeader:SubBlockHeader
|
||||||
|
{
|
||||||
|
uint UnpSize;
|
||||||
|
byte UnpVer;
|
||||||
|
byte Method;
|
||||||
|
uint EACRC;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
struct StreamHeader:SubBlockHeader
|
||||||
|
{
|
||||||
|
uint UnpSize;
|
||||||
|
byte UnpVer;
|
||||||
|
byte Method;
|
||||||
|
uint StreamCRC;
|
||||||
|
ushort StreamNameSize;
|
||||||
|
char StreamName[260];
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
struct MacFInfoHeader:SubBlockHeader
|
||||||
|
{
|
||||||
|
uint fileType;
|
||||||
|
uint fileCreator;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -0,0 +1,99 @@
|
||||||
|
#ifndef _RAR_HEADERS5_
|
||||||
|
#define _RAR_HEADERS5_
|
||||||
|
|
||||||
|
#define SIZEOF_MARKHEAD5 8 // RAR 5.0 signature length.
|
||||||
|
#define SIZEOF_SHORTBLOCKHEAD5 7 // Smallest RAR 5.0 block size.
|
||||||
|
|
||||||
|
// RAR 5.0 block flags common for all blocks.
|
||||||
|
|
||||||
|
// Additional extra area is present in the end of block header.
|
||||||
|
#define HFL_EXTRA 0x0001
|
||||||
|
// Additional data area is present in the end of block header.
|
||||||
|
#define HFL_DATA 0x0002
|
||||||
|
// Unknown blocks with this flag must be skipped when updating an archive.
|
||||||
|
#define HFL_SKIPIFUNKNOWN 0x0004
|
||||||
|
// Data area of this block is continuing from previous volume.
|
||||||
|
#define HFL_SPLITBEFORE 0x0008
|
||||||
|
// Data area of this block is continuing in next volume.
|
||||||
|
#define HFL_SPLITAFTER 0x0010
|
||||||
|
// Block depends on preceding file block.
|
||||||
|
#define HFL_CHILD 0x0020
|
||||||
|
// Preserve a child block if host is modified.
|
||||||
|
#define HFL_INHERITED 0x0040
|
||||||
|
|
||||||
|
// RAR 5.0 main archive header specific flags.
|
||||||
|
#define MHFL_VOLUME 0x0001 // Volume.
|
||||||
|
#define MHFL_VOLNUMBER 0x0002 // Volume number field is present. True for all volumes except first.
|
||||||
|
#define MHFL_SOLID 0x0004 // Solid archive.
|
||||||
|
#define MHFL_PROTECT 0x0008 // Recovery record is present.
|
||||||
|
#define MHFL_LOCK 0x0010 // Locked archive.
|
||||||
|
|
||||||
|
// RAR 5.0 file header specific flags.
|
||||||
|
#define FHFL_DIRECTORY 0x0001 // Directory.
|
||||||
|
#define FHFL_UTIME 0x0002 // Time field in Unix format is present.
|
||||||
|
#define FHFL_CRC32 0x0004 // CRC32 field is present.
|
||||||
|
#define FHFL_UNPUNKNOWN 0x0008 // Unknown unpacked size.
|
||||||
|
|
||||||
|
// RAR 5.0 end of archive header specific flags.
|
||||||
|
#define EHFL_NEXTVOLUME 0x0001 // Not last volume.
|
||||||
|
|
||||||
|
// RAR 5.0 archive encryption header specific flags.
|
||||||
|
#define CHFL_CRYPT_PSWCHECK 0x0001 // Password check data is present.
|
||||||
|
|
||||||
|
|
||||||
|
// RAR 5.0 file compression flags.
|
||||||
|
#define FCI_ALGO_BIT0 0x0001 // Version of compression algorithm.
|
||||||
|
#define FCI_ALGO_BIT1 0x0002 // 0 .. 63.
|
||||||
|
#define FCI_ALGO_BIT2 0x0004
|
||||||
|
#define FCI_ALGO_BIT3 0x0008
|
||||||
|
#define FCI_ALGO_BIT4 0x0010
|
||||||
|
#define FCI_ALGO_BIT5 0x0020
|
||||||
|
#define FCI_SOLID 0x0040 // Solid flag.
|
||||||
|
#define FCI_METHOD_BIT0 0x0080 // Compression method.
|
||||||
|
#define FCI_METHOD_BIT1 0x0100 // 0 .. 5 (6 and 7 are not used).
|
||||||
|
#define FCI_METHOD_BIT2 0x0200
|
||||||
|
#define FCI_DICT_BIT0 0x0400 // Dictionary size.
|
||||||
|
#define FCI_DICT_BIT1 0x0800 // 128 KB .. 4 GB.
|
||||||
|
#define FCI_DICT_BIT2 0x1000
|
||||||
|
#define FCI_DICT_BIT3 0x2000
|
||||||
|
|
||||||
|
// Main header extra field values.
|
||||||
|
#define MHEXTRA_LOCATOR 0x01 // Position of quick list and other blocks.
|
||||||
|
|
||||||
|
// Flags for MHEXTRA_LOCATOR.
|
||||||
|
#define MHEXTRA_LOCATOR_QLIST 0x01 // Quick open offset is present.
|
||||||
|
#define MHEXTRA_LOCATOR_RR 0x02 // Recovery record offset is present.
|
||||||
|
|
||||||
|
// File and service header extra field values.
|
||||||
|
#define FHEXTRA_CRYPT 0x01 // Encryption parameters.
|
||||||
|
#define FHEXTRA_HASH 0x02 // File hash.
|
||||||
|
#define FHEXTRA_HTIME 0x03 // High precision file time.
|
||||||
|
#define FHEXTRA_VERSION 0x04 // File version information.
|
||||||
|
#define FHEXTRA_REDIR 0x05 // File system redirection (links, etc.).
|
||||||
|
#define FHEXTRA_UOWNER 0x06 // Unix owner and group information.
|
||||||
|
#define FHEXTRA_SUBDATA 0x07 // Service header subdata array.
|
||||||
|
|
||||||
|
|
||||||
|
// Hash type values for FHEXTRA_HASH.
|
||||||
|
#define FHEXTRA_HASH_BLAKE2 0x00
|
||||||
|
|
||||||
|
// Flags for FHEXTRA_HTIME.
|
||||||
|
#define FHEXTRA_HTIME_UNIXTIME 0x01 // Use Unix time_t format.
|
||||||
|
#define FHEXTRA_HTIME_MTIME 0x02 // mtime is present.
|
||||||
|
#define FHEXTRA_HTIME_CTIME 0x04 // ctime is present.
|
||||||
|
#define FHEXTRA_HTIME_ATIME 0x08 // atime is present.
|
||||||
|
|
||||||
|
// Flags for FHEXTRA_CRYPT.
|
||||||
|
#define FHEXTRA_CRYPT_PSWCHECK 0x01 // Store password check data.
|
||||||
|
#define FHEXTRA_CRYPT_HASHMAC 0x02 // Use MAC for unpacked data checksums.
|
||||||
|
|
||||||
|
// Flags for FHEXTRA_REDIR.
|
||||||
|
#define FHEXTRA_REDIR_DIR 0x01 // Link target is directory.
|
||||||
|
|
||||||
|
// Flags for FHEXTRA_UOWNER.
|
||||||
|
#define FHEXTRA_UOWNER_UNAME 0x01 // User name string is present.
|
||||||
|
#define FHEXTRA_UOWNER_GNAME 0x02 // Group name string is present.
|
||||||
|
#define FHEXTRA_UOWNER_NUMUID 0x04 // Numeric user ID is present.
|
||||||
|
#define FHEXTRA_UOWNER_NUMGID 0x08 // Numeric group ID is present.
|
||||||
|
|
||||||
|
#endif
|
|
@ -10,13 +10,15 @@
|
||||||
1. All copyrights to RAR and the utility UnRAR are exclusively
|
1. All copyrights to RAR and the utility UnRAR are exclusively
|
||||||
owned by the author - Alexander Roshal.
|
owned by the author - Alexander Roshal.
|
||||||
|
|
||||||
2. The UnRAR sources may be used in any software to handle RAR
|
2. UnRAR source code may be used in any software to handle
|
||||||
archives without limitations free of charge, but cannot be used
|
RAR archives without limitations free of charge, but cannot be
|
||||||
to re-create the RAR compression algorithm, which is proprietary.
|
used to develop RAR (WinRAR) compatible archiver and to
|
||||||
Distribution of modified UnRAR sources in separate form or as a
|
re-create RAR compression algorithm, which is proprietary.
|
||||||
part of other software is permitted, provided that it is clearly
|
Distribution of modified UnRAR source code in separate form
|
||||||
stated in the documentation and source comments that the code may
|
or as a part of other software is permitted, provided that
|
||||||
not be used to develop a RAR (WinRAR) compatible archiver.
|
full text of this paragraph, starting from "UnRAR source code"
|
||||||
|
words, is included in license, or in documentation if license
|
||||||
|
is not available, and in source code comments of resulting package.
|
||||||
|
|
||||||
3. The UnRAR utility may be freely distributed. It is allowed
|
3. The UnRAR utility may be freely distributed. It is allowed
|
||||||
to distribute UnRAR inside of other software packages.
|
to distribute UnRAR inside of other software packages.
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
// #included by unpack.cpp
|
|
||||||
#ifdef RAR_COMMON_HPP
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* This file is part of PPMd project *
|
* This file is part of PPMd project *
|
||||||
* Written and distributed to public domain by Dmitry Shkarin 1997, *
|
* Written and distributed to public domain by Dmitry Shkarin 1997, *
|
||||||
|
@ -7,10 +5,19 @@
|
||||||
* Contents: model description and encoding/decoding routines *
|
* Contents: model description and encoding/decoding routines *
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
inline PPM_CONTEXT* PPM_CONTEXT::createChild(ModelPPM *Model,STATE* pStats,
|
#ifdef RAR_COMMON_HPP
|
||||||
STATE& FirstState)
|
|
||||||
|
static const int MAX_O=64; /* maximum allowed model order */
|
||||||
|
const uint TOP=1 << 24, BOT=1 << 15;
|
||||||
|
|
||||||
|
template <class T>
|
||||||
|
inline void _PPMD_SWAP(T& t1,T& t2) { T tmp=t1; t1=t2; t2=tmp; }
|
||||||
|
|
||||||
|
|
||||||
|
inline RARPPM_CONTEXT* RARPPM_CONTEXT::createChild(ModelPPM *Model,RARPPM_STATE* pStats,
|
||||||
|
RARPPM_STATE& FirstState)
|
||||||
{
|
{
|
||||||
PPM_CONTEXT* pc = (PPM_CONTEXT*) Model->SubAlloc.AllocContext();
|
RARPPM_CONTEXT* pc = (RARPPM_CONTEXT*) Model->SubAlloc.AllocContext();
|
||||||
if ( pc )
|
if ( pc )
|
||||||
{
|
{
|
||||||
pc->NumStats=1;
|
pc->NumStats=1;
|
||||||
|
@ -36,11 +43,11 @@ void ModelPPM::RestartModelRare()
|
||||||
memset(CharMask,0,sizeof(CharMask));
|
memset(CharMask,0,sizeof(CharMask));
|
||||||
SubAlloc.InitSubAllocator();
|
SubAlloc.InitSubAllocator();
|
||||||
InitRL=-(MaxOrder < 12 ? MaxOrder:12)-1;
|
InitRL=-(MaxOrder < 12 ? MaxOrder:12)-1;
|
||||||
MinContext = MaxContext = (PPM_CONTEXT*) SubAlloc.AllocContext();
|
MinContext = MaxContext = (RARPPM_CONTEXT*) SubAlloc.AllocContext();
|
||||||
MinContext->Suffix=NULL;
|
MinContext->Suffix=NULL;
|
||||||
OrderFall=MaxOrder;
|
OrderFall=MaxOrder;
|
||||||
MinContext->U.SummFreq=(MinContext->NumStats=256)+1;
|
MinContext->U.SummFreq=(MinContext->NumStats=256)+1;
|
||||||
FoundState=MinContext->U.Stats=(STATE*)SubAlloc.AllocUnits(256/2);
|
FoundState=MinContext->U.Stats=(RARPPM_STATE*)SubAlloc.AllocUnits(256/2);
|
||||||
for (RunLength=InitRL, PrevSuccess=i=0;i < 256;i++)
|
for (RunLength=InitRL, PrevSuccess=i=0;i < 256;i++)
|
||||||
{
|
{
|
||||||
MinContext->U.Stats[i].Symbol=i;
|
MinContext->U.Stats[i].Symbol=i;
|
||||||
|
@ -107,10 +114,10 @@ void ModelPPM::StartModelRare(int MaxOrder)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void PPM_CONTEXT::rescale(ModelPPM *Model)
|
void RARPPM_CONTEXT::rescale(ModelPPM *Model)
|
||||||
{
|
{
|
||||||
int OldNS=NumStats, i=NumStats-1, Adder, EscFreq;
|
int OldNS=NumStats, i=NumStats-1, Adder, EscFreq;
|
||||||
STATE* p1, * p;
|
RARPPM_STATE* p1, * p;
|
||||||
for (p=Model->FoundState;p != U.Stats;p--)
|
for (p=Model->FoundState;p != U.Stats;p--)
|
||||||
_PPMD_SWAP(p[0],p[-1]);
|
_PPMD_SWAP(p[0],p[-1]);
|
||||||
U.Stats->Freq += 4;
|
U.Stats->Freq += 4;
|
||||||
|
@ -124,7 +131,7 @@ void PPM_CONTEXT::rescale(ModelPPM *Model)
|
||||||
U.SummFreq += (p->Freq=(p->Freq+Adder) >> 1);
|
U.SummFreq += (p->Freq=(p->Freq+Adder) >> 1);
|
||||||
if (p[0].Freq > p[-1].Freq)
|
if (p[0].Freq > p[-1].Freq)
|
||||||
{
|
{
|
||||||
STATE tmp=*(p1=p);
|
RARPPM_STATE tmp=*(p1=p);
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
p1[0]=p1[-1];
|
p1[0]=p1[-1];
|
||||||
|
@ -141,7 +148,7 @@ void PPM_CONTEXT::rescale(ModelPPM *Model)
|
||||||
EscFreq += i;
|
EscFreq += i;
|
||||||
if ((NumStats -= i) == 1)
|
if ((NumStats -= i) == 1)
|
||||||
{
|
{
|
||||||
STATE tmp=*U.Stats;
|
RARPPM_STATE tmp=*U.Stats;
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
tmp.Freq-=(tmp.Freq >> 1);
|
tmp.Freq-=(tmp.Freq >> 1);
|
||||||
|
@ -154,17 +161,19 @@ void PPM_CONTEXT::rescale(ModelPPM *Model)
|
||||||
U.SummFreq += (EscFreq -= (EscFreq >> 1));
|
U.SummFreq += (EscFreq -= (EscFreq >> 1));
|
||||||
int n0=(OldNS+1) >> 1, n1=(NumStats+1) >> 1;
|
int n0=(OldNS+1) >> 1, n1=(NumStats+1) >> 1;
|
||||||
if (n0 != n1)
|
if (n0 != n1)
|
||||||
U.Stats = (STATE*) Model->SubAlloc.ShrinkUnits(U.Stats,n0,n1);
|
U.Stats = (RARPPM_STATE*) Model->SubAlloc.ShrinkUnits(U.Stats,n0,n1);
|
||||||
Model->FoundState=U.Stats;
|
Model->FoundState=U.Stats;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
inline PPM_CONTEXT* ModelPPM::CreateSuccessors(bool Skip,STATE* p1)
|
inline RARPPM_CONTEXT* ModelPPM::CreateSuccessors(bool Skip,RARPPM_STATE* p1)
|
||||||
{
|
{
|
||||||
// (removed conditional static)
|
#ifdef __ICL
|
||||||
STATE UpState;
|
static
|
||||||
PPM_CONTEXT* pc=MinContext, * UpBranch=FoundState->Successor;
|
#endif
|
||||||
STATE * p, * ps[MAX_O], ** pps=ps;
|
RARPPM_STATE UpState;
|
||||||
|
RARPPM_CONTEXT* pc=MinContext, * UpBranch=FoundState->Successor;
|
||||||
|
RARPPM_STATE * p, * ps[MAX_O], ** pps=ps;
|
||||||
if ( !Skip )
|
if ( !Skip )
|
||||||
{
|
{
|
||||||
*pps++ = FoundState;
|
*pps++ = FoundState;
|
||||||
|
@ -202,7 +211,7 @@ NO_LOOP:
|
||||||
if (pps == ps)
|
if (pps == ps)
|
||||||
return pc;
|
return pc;
|
||||||
UpState.Symbol=*(byte*) UpBranch;
|
UpState.Symbol=*(byte*) UpBranch;
|
||||||
UpState.Successor=(PPM_CONTEXT*) (((byte*) UpBranch)+1);
|
UpState.Successor=(RARPPM_CONTEXT*) (((byte*) UpBranch)+1);
|
||||||
if (pc->NumStats != 1)
|
if (pc->NumStats != 1)
|
||||||
{
|
{
|
||||||
if ((byte*) pc <= SubAlloc.pText)
|
if ((byte*) pc <= SubAlloc.pText)
|
||||||
|
@ -230,8 +239,8 @@ NO_LOOP:
|
||||||
|
|
||||||
inline void ModelPPM::UpdateModel()
|
inline void ModelPPM::UpdateModel()
|
||||||
{
|
{
|
||||||
STATE fs = *FoundState, *p = NULL;
|
RARPPM_STATE fs = *FoundState, *p = NULL;
|
||||||
PPM_CONTEXT *pc, *Successor;
|
RARPPM_CONTEXT *pc, *Successor;
|
||||||
uint ns1, ns, cf, sf, s0;
|
uint ns1, ns, cf, sf, s0;
|
||||||
if (fs.Freq < MAX_FREQ/4 && (pc=MinContext->Suffix) != NULL)
|
if (fs.Freq < MAX_FREQ/4 && (pc=MinContext->Suffix) != NULL)
|
||||||
{
|
{
|
||||||
|
@ -263,19 +272,19 @@ inline void ModelPPM::UpdateModel()
|
||||||
}
|
}
|
||||||
if ( !OrderFall )
|
if ( !OrderFall )
|
||||||
{
|
{
|
||||||
MinContext=MaxContext=FoundState->Successor=CreateSuccessors(true,p);
|
MinContext=MaxContext=FoundState->Successor=CreateSuccessors(TRUE,p);
|
||||||
if ( !MinContext )
|
if ( !MinContext )
|
||||||
goto RESTART_MODEL;
|
goto RESTART_MODEL;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
*SubAlloc.pText++ = fs.Symbol;
|
*SubAlloc.pText++ = fs.Symbol;
|
||||||
Successor = (PPM_CONTEXT*) SubAlloc.pText;
|
Successor = (RARPPM_CONTEXT*) SubAlloc.pText;
|
||||||
if (SubAlloc.pText >= SubAlloc.FakeUnitsStart)
|
if (SubAlloc.pText >= SubAlloc.FakeUnitsStart)
|
||||||
goto RESTART_MODEL;
|
goto RESTART_MODEL;
|
||||||
if ( fs.Successor )
|
if ( fs.Successor )
|
||||||
{
|
{
|
||||||
if ((byte*) fs.Successor <= SubAlloc.pText &&
|
if ((byte*) fs.Successor <= SubAlloc.pText &&
|
||||||
(fs.Successor=CreateSuccessors(false,p)) == NULL)
|
(fs.Successor=CreateSuccessors(FALSE,p)) == NULL)
|
||||||
goto RESTART_MODEL;
|
goto RESTART_MODEL;
|
||||||
if ( !--OrderFall )
|
if ( !--OrderFall )
|
||||||
{
|
{
|
||||||
|
@ -295,7 +304,7 @@ inline void ModelPPM::UpdateModel()
|
||||||
{
|
{
|
||||||
if ((ns1 & 1) == 0)
|
if ((ns1 & 1) == 0)
|
||||||
{
|
{
|
||||||
pc->U.Stats=(STATE*) SubAlloc.ExpandUnits(pc->U.Stats,ns1 >> 1);
|
pc->U.Stats=(RARPPM_STATE*) SubAlloc.ExpandUnits(pc->U.Stats,ns1 >> 1);
|
||||||
if ( !pc->U.Stats )
|
if ( !pc->U.Stats )
|
||||||
goto RESTART_MODEL;
|
goto RESTART_MODEL;
|
||||||
}
|
}
|
||||||
|
@ -303,7 +312,7 @@ inline void ModelPPM::UpdateModel()
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
p=(STATE*) SubAlloc.AllocUnits(1);
|
p=(RARPPM_STATE*) SubAlloc.AllocUnits(1);
|
||||||
if ( !p )
|
if ( !p )
|
||||||
goto RESTART_MODEL;
|
goto RESTART_MODEL;
|
||||||
*p=pc->OneState;
|
*p=pc->OneState;
|
||||||
|
@ -346,9 +355,9 @@ static const byte ExpEscape[16]={ 25,14, 9, 7, 5, 5, 4, 4, 4, 3, 3, 3, 2, 2, 2,
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
inline void PPM_CONTEXT::decodeBinSymbol(ModelPPM *Model)
|
inline void RARPPM_CONTEXT::decodeBinSymbol(ModelPPM *Model)
|
||||||
{
|
{
|
||||||
STATE& rs=OneState;
|
RARPPM_STATE& rs=OneState;
|
||||||
Model->HiBitsFlag=Model->HB2Flag[Model->FoundState->Symbol];
|
Model->HiBitsFlag=Model->HB2Flag[Model->FoundState->Symbol];
|
||||||
ushort& bs=Model->BinSumm[rs.Freq-1][Model->PrevSuccess+
|
ushort& bs=Model->BinSumm[rs.Freq-1][Model->PrevSuccess+
|
||||||
Model->NS2BSIndx[Suffix->NumStats-1]+
|
Model->NS2BSIndx[Suffix->NumStats-1]+
|
||||||
|
@ -360,14 +369,14 @@ inline void PPM_CONTEXT::decodeBinSymbol(ModelPPM *Model)
|
||||||
rs.Freq += (rs.Freq < 128);
|
rs.Freq += (rs.Freq < 128);
|
||||||
Model->Coder.SubRange.LowCount=0;
|
Model->Coder.SubRange.LowCount=0;
|
||||||
Model->Coder.SubRange.HighCount=bs;
|
Model->Coder.SubRange.HighCount=bs;
|
||||||
bs = SHORT16(bs+INTERVAL-GET_MEAN(bs,PERIOD_BITS,2));
|
bs = GET_SHORT16(bs+INTERVAL-GET_MEAN(bs,PERIOD_BITS,2));
|
||||||
Model->PrevSuccess=1;
|
Model->PrevSuccess=1;
|
||||||
Model->RunLength++;
|
Model->RunLength++;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Model->Coder.SubRange.LowCount=bs;
|
Model->Coder.SubRange.LowCount=bs;
|
||||||
bs = SHORT16(bs-GET_MEAN(bs,PERIOD_BITS,2));
|
bs = GET_SHORT16(bs-GET_MEAN(bs,PERIOD_BITS,2));
|
||||||
Model->Coder.SubRange.HighCount=BIN_SCALE;
|
Model->Coder.SubRange.HighCount=BIN_SCALE;
|
||||||
Model->InitEsc=ExpEscape[bs >> 10];
|
Model->InitEsc=ExpEscape[bs >> 10];
|
||||||
Model->NumMasked=1;
|
Model->NumMasked=1;
|
||||||
|
@ -378,7 +387,7 @@ inline void PPM_CONTEXT::decodeBinSymbol(ModelPPM *Model)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
inline void PPM_CONTEXT::update1(ModelPPM *Model,STATE* p)
|
inline void RARPPM_CONTEXT::update1(ModelPPM *Model,RARPPM_STATE* p)
|
||||||
{
|
{
|
||||||
(Model->FoundState=p)->Freq += 4;
|
(Model->FoundState=p)->Freq += 4;
|
||||||
U.SummFreq += 4;
|
U.SummFreq += 4;
|
||||||
|
@ -394,13 +403,13 @@ inline void PPM_CONTEXT::update1(ModelPPM *Model,STATE* p)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
inline bool PPM_CONTEXT::decodeSymbol1(ModelPPM *Model)
|
inline bool RARPPM_CONTEXT::decodeSymbol1(ModelPPM *Model)
|
||||||
{
|
{
|
||||||
Model->Coder.SubRange.scale=U.SummFreq;
|
Model->Coder.SubRange.scale=U.SummFreq;
|
||||||
STATE* p=U.Stats;
|
RARPPM_STATE* p=U.Stats;
|
||||||
int i, HiCnt;
|
int i, HiCnt;
|
||||||
int count=Model->Coder.GetCurrentCount();
|
int count=Model->Coder.GetCurrentCount();
|
||||||
if (count>=Model->Coder.SubRange.scale)
|
if (count>=(int)Model->Coder.SubRange.scale)
|
||||||
return(false);
|
return(false);
|
||||||
if (count < (HiCnt=p->Freq))
|
if (count < (HiCnt=p->Freq))
|
||||||
{
|
{
|
||||||
|
@ -439,7 +448,7 @@ inline bool PPM_CONTEXT::decodeSymbol1(ModelPPM *Model)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
inline void PPM_CONTEXT::update2(ModelPPM *Model,STATE* p)
|
inline void RARPPM_CONTEXT::update2(ModelPPM *Model,RARPPM_STATE* p)
|
||||||
{
|
{
|
||||||
(Model->FoundState=p)->Freq += 4;
|
(Model->FoundState=p)->Freq += 4;
|
||||||
U.SummFreq += 4;
|
U.SummFreq += 4;
|
||||||
|
@ -450,9 +459,9 @@ inline void PPM_CONTEXT::update2(ModelPPM *Model,STATE* p)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
inline SEE2_CONTEXT* PPM_CONTEXT::makeEscFreq2(ModelPPM *Model,int Diff)
|
inline RARPPM_SEE2_CONTEXT* RARPPM_CONTEXT::makeEscFreq2(ModelPPM *Model,int Diff)
|
||||||
{
|
{
|
||||||
SEE2_CONTEXT* psee2c;
|
RARPPM_SEE2_CONTEXT* psee2c;
|
||||||
if (NumStats != 256)
|
if (NumStats != 256)
|
||||||
{
|
{
|
||||||
psee2c=Model->SEE2Cont[Model->NS2Indx[Diff-1]]+
|
psee2c=Model->SEE2Cont[Model->NS2Indx[Diff-1]]+
|
||||||
|
@ -472,11 +481,11 @@ inline SEE2_CONTEXT* PPM_CONTEXT::makeEscFreq2(ModelPPM *Model,int Diff)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
inline bool PPM_CONTEXT::decodeSymbol2(ModelPPM *Model)
|
inline bool RARPPM_CONTEXT::decodeSymbol2(ModelPPM *Model)
|
||||||
{
|
{
|
||||||
int count, HiCnt, i=NumStats-Model->NumMasked;
|
int count, HiCnt, i=NumStats-Model->NumMasked;
|
||||||
SEE2_CONTEXT* psee2c=makeEscFreq2(Model,i);
|
RARPPM_SEE2_CONTEXT* psee2c=makeEscFreq2(Model,i);
|
||||||
STATE* ps[256], ** pps=ps, * p=U.Stats-1;
|
RARPPM_STATE* ps[256], ** pps=ps, * p=U.Stats-1;
|
||||||
HiCnt=0;
|
HiCnt=0;
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
|
@ -489,7 +498,7 @@ inline bool PPM_CONTEXT::decodeSymbol2(ModelPPM *Model)
|
||||||
} while ( --i );
|
} while ( --i );
|
||||||
Model->Coder.SubRange.scale += HiCnt;
|
Model->Coder.SubRange.scale += HiCnt;
|
||||||
count=Model->Coder.GetCurrentCount();
|
count=Model->Coder.GetCurrentCount();
|
||||||
if (count>=Model->Coder.SubRange.scale)
|
if (count>=(int)Model->Coder.SubRange.scale)
|
||||||
return(false);
|
return(false);
|
||||||
p=*(pps=ps);
|
p=*(pps=ps);
|
||||||
if (count < HiCnt)
|
if (count < HiCnt)
|
||||||
|
@ -540,10 +549,9 @@ void ModelPPM::CleanUp()
|
||||||
bool ModelPPM::DecodeInit(Unpack *UnpackRead,int &EscChar)
|
bool ModelPPM::DecodeInit(Unpack *UnpackRead,int &EscChar)
|
||||||
{
|
{
|
||||||
int MaxOrder=UnpackRead->GetChar();
|
int MaxOrder=UnpackRead->GetChar();
|
||||||
bool Reset=MaxOrder & 0x20;
|
bool Reset=(MaxOrder & 0x20)!=0;
|
||||||
|
|
||||||
int MaxMB;
|
int MaxMB;
|
||||||
MaxMB = 0; // avoids warning of being uninitialized
|
|
||||||
if (Reset)
|
if (Reset)
|
||||||
MaxMB=UnpackRead->GetChar();
|
MaxMB=UnpackRead->GetChar();
|
||||||
else
|
else
|
||||||
|
@ -609,4 +617,5 @@ int ModelPPM::DecodeChar()
|
||||||
ARI_DEC_NORMALIZE(Coder.code,Coder.low,Coder.range,Coder.UnpackRead);
|
ARI_DEC_NORMALIZE(Coder.code,Coder.low,Coder.range,Coder.UnpackRead);
|
||||||
return(Symbol);
|
return(Symbol);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -4,16 +4,17 @@
|
||||||
#include "coder.hpp"
|
#include "coder.hpp"
|
||||||
#include "suballoc.hpp"
|
#include "suballoc.hpp"
|
||||||
|
|
||||||
const int MAX_O=64; /* maximum allowed model order */
|
#ifdef ALLOW_MISALIGNED
|
||||||
|
|
||||||
const int INT_BITS=7, PERIOD_BITS=7, TOT_BITS=INT_BITS+PERIOD_BITS,
|
|
||||||
INTERVAL=1 << INT_BITS, BIN_SCALE=1 << TOT_BITS, MAX_FREQ=124;
|
|
||||||
|
|
||||||
#ifndef STRICT_ALIGNMENT_REQUIRED
|
|
||||||
#pragma pack(1)
|
#pragma pack(1)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
struct SEE2_CONTEXT
|
struct RARPPM_DEF
|
||||||
|
{
|
||||||
|
static const int INT_BITS=7, PERIOD_BITS=7, TOT_BITS=INT_BITS+PERIOD_BITS,
|
||||||
|
INTERVAL=1 << INT_BITS, BIN_SCALE=1 << TOT_BITS, MAX_FREQ=124;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct RARPPM_SEE2_CONTEXT : RARPPM_DEF
|
||||||
{ // SEE-contexts for PPM-contexts with masked symbols
|
{ // SEE-contexts for PPM-contexts with masked symbols
|
||||||
ushort Summ;
|
ushort Summ;
|
||||||
byte Shift, Count;
|
byte Shift, Count;
|
||||||
|
@ -24,7 +25,7 @@ struct SEE2_CONTEXT
|
||||||
}
|
}
|
||||||
uint getMean()
|
uint getMean()
|
||||||
{
|
{
|
||||||
uint RetVal=SHORT16(Summ) >> Shift;
|
uint RetVal=GET_SHORT16(Summ) >> Shift;
|
||||||
Summ -= RetVal;
|
Summ -= RetVal;
|
||||||
return RetVal+(RetVal == 0);
|
return RetVal+(RetVal == 0);
|
||||||
}
|
}
|
||||||
|
@ -40,45 +41,47 @@ struct SEE2_CONTEXT
|
||||||
|
|
||||||
|
|
||||||
class ModelPPM;
|
class ModelPPM;
|
||||||
struct PPM_CONTEXT;
|
struct RARPPM_CONTEXT;
|
||||||
|
|
||||||
struct STATE
|
struct RARPPM_STATE
|
||||||
{
|
{
|
||||||
byte Symbol;
|
byte Symbol;
|
||||||
byte Freq;
|
byte Freq;
|
||||||
PPM_CONTEXT* Successor;
|
RARPPM_CONTEXT* Successor;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
struct RARPPM_CONTEXT : RARPPM_DEF
|
||||||
|
{
|
||||||
|
ushort NumStats;
|
||||||
|
|
||||||
struct FreqData
|
struct FreqData
|
||||||
{
|
{
|
||||||
ushort SummFreq;
|
ushort SummFreq;
|
||||||
STATE _PACK_ATTR * Stats;
|
RARPPM_STATE RARPPM_PACK_ATTR * Stats;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct PPM_CONTEXT
|
|
||||||
{
|
|
||||||
ushort NumStats;
|
|
||||||
union
|
union
|
||||||
{
|
{
|
||||||
FreqData U;
|
FreqData U;
|
||||||
STATE OneState;
|
RARPPM_STATE OneState;
|
||||||
};
|
};
|
||||||
|
|
||||||
PPM_CONTEXT* Suffix;
|
RARPPM_CONTEXT* Suffix;
|
||||||
inline void encodeBinSymbol(ModelPPM *Model,int symbol); // MaxOrder:
|
inline void encodeBinSymbol(ModelPPM *Model,int symbol); // MaxOrder:
|
||||||
inline void encodeSymbol1(ModelPPM *Model,int symbol); // ABCD context
|
inline void encodeSymbol1(ModelPPM *Model,int symbol); // ABCD context
|
||||||
inline void encodeSymbol2(ModelPPM *Model,int symbol); // BCD suffix
|
inline void encodeSymbol2(ModelPPM *Model,int symbol); // BCD suffix
|
||||||
inline void decodeBinSymbol(ModelPPM *Model); // BCDE successor
|
inline void decodeBinSymbol(ModelPPM *Model); // BCDE successor
|
||||||
inline bool decodeSymbol1(ModelPPM *Model); // other orders:
|
inline bool decodeSymbol1(ModelPPM *Model); // other orders:
|
||||||
inline bool decodeSymbol2(ModelPPM *Model); // BCD context
|
inline bool decodeSymbol2(ModelPPM *Model); // BCD context
|
||||||
inline void update1(ModelPPM *Model,STATE* p); // CD suffix
|
inline void update1(ModelPPM *Model,RARPPM_STATE* p); // CD suffix
|
||||||
inline void update2(ModelPPM *Model,STATE* p); // BCDE successor
|
inline void update2(ModelPPM *Model,RARPPM_STATE* p); // BCDE successor
|
||||||
void rescale(ModelPPM *Model);
|
void rescale(ModelPPM *Model);
|
||||||
inline PPM_CONTEXT* createChild(ModelPPM *Model,STATE* pStats,STATE& FirstState);
|
inline RARPPM_CONTEXT* createChild(ModelPPM *Model,RARPPM_STATE* pStats,RARPPM_STATE& FirstState);
|
||||||
inline SEE2_CONTEXT* makeEscFreq2(ModelPPM *Model,int Diff);
|
inline RARPPM_SEE2_CONTEXT* makeEscFreq2(ModelPPM *Model,int Diff);
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifndef STRICT_ALIGNMENT_REQUIRED
|
#ifdef ALLOW_MISALIGNED
|
||||||
#ifdef _AIX
|
#ifdef _AIX
|
||||||
#pragma pack(pop)
|
#pragma pack(pop)
|
||||||
#else
|
#else
|
||||||
|
@ -86,28 +89,15 @@ struct PPM_CONTEXT
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
const uint UNIT_SIZE=Max(sizeof(PPM_CONTEXT),sizeof(RAR_MEM_BLK));
|
class ModelPPM : RARPPM_DEF
|
||||||
const uint FIXED_UNIT_SIZE=12;
|
|
||||||
|
|
||||||
/*
|
|
||||||
inline PPM_CONTEXT::PPM_CONTEXT(STATE* pStats,PPM_CONTEXT* ShorterContext):
|
|
||||||
NumStats(1), Suffix(ShorterContext) { pStats->Successor=this; }
|
|
||||||
inline PPM_CONTEXT::PPM_CONTEXT(): NumStats(0) {}
|
|
||||||
*/
|
|
||||||
|
|
||||||
template <class T>
|
|
||||||
inline void _PPMD_SWAP(T& t1,T& t2) { T tmp=t1; t1=t2; t2=tmp; }
|
|
||||||
|
|
||||||
|
|
||||||
class ModelPPM
|
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
friend struct PPM_CONTEXT;
|
friend struct RARPPM_CONTEXT;
|
||||||
|
|
||||||
/*_PACK_ATTR*/ SEE2_CONTEXT SEE2Cont[25][16], DummySEE2Cont;
|
RARPPM_SEE2_CONTEXT SEE2Cont[25][16], DummySEE2Cont;
|
||||||
|
|
||||||
struct PPM_CONTEXT *MinContext, *MedContext, *MaxContext;
|
struct RARPPM_CONTEXT *MinContext, *MedContext, *MaxContext;
|
||||||
STATE* FoundState; // found next state transition
|
RARPPM_STATE* FoundState; // found next state transition
|
||||||
int NumMasked, InitEsc, OrderFall, MaxOrder, RunLength, InitRL;
|
int NumMasked, InitEsc, OrderFall, MaxOrder, RunLength, InitRL;
|
||||||
byte CharMask[256], NS2Indx[256], NS2BSIndx[256], HB2Flag[256];
|
byte CharMask[256], NS2Indx[256], NS2BSIndx[256], HB2Flag[256];
|
||||||
byte EscCount, PrevSuccess, HiBitsFlag;
|
byte EscCount, PrevSuccess, HiBitsFlag;
|
||||||
|
@ -118,11 +108,10 @@ class ModelPPM
|
||||||
|
|
||||||
void RestartModelRare();
|
void RestartModelRare();
|
||||||
void StartModelRare(int MaxOrder);
|
void StartModelRare(int MaxOrder);
|
||||||
inline PPM_CONTEXT* CreateSuccessors(bool Skip,STATE* p1);
|
inline RARPPM_CONTEXT* CreateSuccessors(bool Skip,RARPPM_STATE* p1);
|
||||||
|
|
||||||
inline void UpdateModel();
|
inline void UpdateModel();
|
||||||
inline void ClearMask();
|
inline void ClearMask();
|
||||||
friend class Unpack;
|
|
||||||
public:
|
public:
|
||||||
ModelPPM();
|
ModelPPM();
|
||||||
void CleanUp(); // reset PPM variables after data error
|
void CleanUp(); // reset PPM variables after data error
|
||||||
|
|
|
@ -0,0 +1,56 @@
|
||||||
|
#include "rar.hpp"
|
||||||
|
|
||||||
|
wchar* GetWideName(const char *Name,const wchar *NameW,wchar *DestW,size_t DestSize)
|
||||||
|
{
|
||||||
|
if (NameW!=NULL && *NameW!=0)
|
||||||
|
{
|
||||||
|
if (DestW!=NameW)
|
||||||
|
my_wcsncpy(DestW,NameW,DestSize);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
if (Name!=NULL)
|
||||||
|
CharToWide(Name,DestW,DestSize);
|
||||||
|
else
|
||||||
|
*DestW=0;
|
||||||
|
|
||||||
|
// Ensure that we return a zero terminate string for security reasons.
|
||||||
|
if (DestSize>0)
|
||||||
|
DestW[DestSize-1]=0;
|
||||||
|
|
||||||
|
return(DestW);
|
||||||
|
}
|
||||||
|
|
||||||
|
void UnixSlashToDos(const char *SrcName, char *DestName, size_t MaxLength)
|
||||||
|
{
|
||||||
|
size_t Copied = 0;
|
||||||
|
for (; Copied<MaxLength - 1 && SrcName[Copied] != 0; Copied++)
|
||||||
|
DestName[Copied] = SrcName[Copied] == '/' ? '\\' : SrcName[Copied];
|
||||||
|
DestName[Copied] = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void DosSlashToUnix(const char *SrcName, char *DestName, size_t MaxLength)
|
||||||
|
{
|
||||||
|
size_t Copied = 0;
|
||||||
|
for (; Copied<MaxLength - 1 && SrcName[Copied] != 0; Copied++)
|
||||||
|
DestName[Copied] = SrcName[Copied] == '\\' ? '/' : SrcName[Copied];
|
||||||
|
DestName[Copied] = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void UnixSlashToDos(const wchar *SrcName, wchar *DestName, size_t MaxLength)
|
||||||
|
{
|
||||||
|
size_t Copied = 0;
|
||||||
|
for (; Copied<MaxLength - 1 && SrcName[Copied] != 0; Copied++)
|
||||||
|
DestName[Copied] = SrcName[Copied] == '/' ? '\\' : SrcName[Copied];
|
||||||
|
DestName[Copied] = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void DosSlashToUnix(const wchar *SrcName, wchar *DestName, size_t MaxLength)
|
||||||
|
{
|
||||||
|
size_t Copied = 0;
|
||||||
|
for (; Copied<MaxLength - 1 && SrcName[Copied] != 0; Copied++)
|
||||||
|
DestName[Copied] = SrcName[Copied] == '\\' ? '/' : SrcName[Copied];
|
||||||
|
DestName[Copied] = 0;
|
||||||
|
}
|
|
@ -2,12 +2,13 @@
|
||||||
// It may NOT be used to develop a RAR (WinRAR) compatible archiver.
|
// It may NOT be used to develop a RAR (WinRAR) compatible archiver.
|
||||||
// See license.txt for copyright and licensing.
|
// See license.txt for copyright and licensing.
|
||||||
|
|
||||||
// unrar_core 3.8.5
|
// unrar_core 5.1.7
|
||||||
#ifndef RAR_COMMON_HPP
|
#ifndef RAR_COMMON_HPP
|
||||||
#define RAR_COMMON_HPP
|
#define RAR_COMMON_HPP
|
||||||
|
|
||||||
#include "unrar.h"
|
#include "unrar.h"
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <setjmp.h>
|
#include <setjmp.h>
|
||||||
|
@ -21,7 +22,7 @@
|
||||||
// These names are too generic and might clash (or have already, hmpf)
|
// These names are too generic and might clash (or have already, hmpf)
|
||||||
#define Array Rar_Array
|
#define Array Rar_Array
|
||||||
#define uint32 rar_uint32
|
#define uint32 rar_uint32
|
||||||
#define sint32 rar_sint32
|
#define int32 rar_int32
|
||||||
#define Unpack Rar_Unpack
|
#define Unpack Rar_Unpack
|
||||||
#define Archive Rar_Archive
|
#define Archive Rar_Archive
|
||||||
#define RawRead Rar_RawRead
|
#define RawRead Rar_RawRead
|
||||||
|
@ -73,6 +74,8 @@ struct Rar_Allocator
|
||||||
};
|
};
|
||||||
|
|
||||||
//// os.hpp
|
//// os.hpp
|
||||||
|
#define FALSE 0
|
||||||
|
#define TRUE 1
|
||||||
#undef STRICT_ALIGNMENT_REQUIRED
|
#undef STRICT_ALIGNMENT_REQUIRED
|
||||||
#undef LITTLE_ENDIAN
|
#undef LITTLE_ENDIAN
|
||||||
#define NM 1024
|
#define NM 1024
|
||||||
|
@ -92,7 +95,7 @@ struct Rar_Allocator
|
||||||
//// rartypes.hpp
|
//// rartypes.hpp
|
||||||
#if INT_MAX == 0x7FFFFFFF && UINT_MAX == 0xFFFFFFFF
|
#if INT_MAX == 0x7FFFFFFF && UINT_MAX == 0xFFFFFFFF
|
||||||
typedef unsigned int uint32; //32 bits exactly
|
typedef unsigned int uint32; //32 bits exactly
|
||||||
typedef int sint32; //signed 32 bits exactly
|
typedef int int32; //signed 32 bits exactly
|
||||||
#define PRESENT_INT32
|
#define PRESENT_INT32
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -100,36 +103,37 @@ typedef unsigned char byte; //8 bits
|
||||||
typedef unsigned short ushort; //preferably 16 bits, but can be more
|
typedef unsigned short ushort; //preferably 16 bits, but can be more
|
||||||
typedef unsigned int uint; //32 bits or more
|
typedef unsigned int uint; //32 bits or more
|
||||||
|
|
||||||
typedef wchar_t wchar;
|
typedef blargg_wchar_t wchar;
|
||||||
|
|
||||||
#define SHORT16(x) (sizeof(ushort)==2 ? (ushort)(x):((x)&0xffff))
|
#define GET_SHORT16(x) (sizeof(ushort)==2 ? (ushort)(x):((x)&0xffff))
|
||||||
#define UINT32(x) (sizeof(uint )==4 ? (uint )(x):((x)&0xffffffff))
|
#define GET_UINT32(x) (sizeof(uint )==4 ? (uint )(x):((x)&0xffffffff))
|
||||||
|
|
||||||
//// rardefs.hpp
|
//// rardefs.hpp
|
||||||
#define Min(x,y) (((x)<(y)) ? (x):(y))
|
#define Min(x,y) (((x)<(y)) ? (x):(y))
|
||||||
#define Max(x,y) (((x)>(y)) ? (x):(y))
|
#define Max(x,y) (((x)>(y)) ? (x):(y))
|
||||||
|
#define ALIGN_VALUE(v,a) (size_t(v) + ( (~size_t(v) + 1) & (a - 1) ) )
|
||||||
|
#define ASIZE(x) (sizeof(x)/sizeof(x[0]))
|
||||||
|
|
||||||
//// int64.hpp
|
//// int64.hpp
|
||||||
typedef unrar_long_long Int64;
|
typedef unrar_long_long int64;
|
||||||
|
typedef unrar_ulong_long uint64;
|
||||||
|
|
||||||
#define int64to32(x) ((uint)(x))
|
#define int64to32(x) ((uint)(x))
|
||||||
#define int32to64(high,low) ((((Int64)(high))<<31<<1)+(low))
|
#define int32to64(high,low) ((((int64)(high))<<31<<1)+(low))
|
||||||
#define is64plus(x) (x>=0)
|
#define is64plus(x) (x>=0)
|
||||||
|
|
||||||
#define INT64MAX int32to64(0x7fffffff,0)
|
#define INT64MAX int32to64(0x7fffffff,0)
|
||||||
|
#define INT64NDF int32to64(0x7fffffff,0x7fffffff)
|
||||||
|
|
||||||
//// crc.hpp
|
//// crc.hpp
|
||||||
extern uint CRCTab[256];
|
extern uint crc_tables[8][256];
|
||||||
void InitCRC();
|
void InitCRCTables();
|
||||||
uint CRC(uint StartCRC,const void *Addr,size_t Size);
|
uint CRC32(uint StartCRC,const void *Addr,size_t Size);
|
||||||
ushort OldCRC(ushort StartCRC,const void *Addr,size_t Size);
|
ushort Checksum14(ushort StartCRC,const void *Addr,size_t Size);
|
||||||
|
|
||||||
//// rartime.hpp
|
#define SHA256_DIGEST_SIZE 32
|
||||||
struct RarTime
|
#include "blake2s.hpp"
|
||||||
{
|
#include "hash.hpp"
|
||||||
unsigned time;
|
|
||||||
void SetDos(uint DosTime) { time = DosTime; }
|
|
||||||
};
|
|
||||||
|
|
||||||
//// rdwrfn.hpp
|
//// rdwrfn.hpp
|
||||||
class ComprDataIO
|
class ComprDataIO
|
||||||
|
@ -141,30 +145,47 @@ public:
|
||||||
void* user_read_data;
|
void* user_read_data;
|
||||||
void* user_write_data;
|
void* user_write_data;
|
||||||
unrar_err_t write_error; // once write error occurs, no more writes are made
|
unrar_err_t write_error; // once write error occurs, no more writes are made
|
||||||
Int64 Tell_;
|
int64 Tell_;
|
||||||
bool OldFormat;
|
bool OldFormat;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Int64 UnpPackedSize;
|
int64 UnpPackedSize;
|
||||||
bool SkipUnpCRC;
|
bool SkipUnpCRC;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
int UnpRead(byte *Addr,uint Count);
|
int UnpRead(byte *Addr,uint Count);
|
||||||
void UnpWrite(byte *Addr,uint Count);
|
void UnpWrite(byte *Addr,uint Count);
|
||||||
void SetSkipUnpCRC( bool b ) { SkipUnpCRC = b; }
|
void SetSkipUnpCRC( bool b ) { SkipUnpCRC = b; }
|
||||||
void SetPackedSizeToRead( Int64 n ) { UnpPackedSize = n; }
|
void SetPackedSizeToRead( int64 n ) { UnpPackedSize = n; }
|
||||||
|
|
||||||
uint UnpFileCRC;
|
uint UnpFileCRC;
|
||||||
|
|
||||||
void Seek(Int64 Offset, int Method = 0 ) { (void)Method; Tell_ = Offset; }
|
void Seek(int64 Offset, int Method = 0 ) { (void)Method; Tell_ = Offset; }
|
||||||
Int64 Tell() { return Tell_; }
|
int64 Tell() { return Tell_; }
|
||||||
int Read( void* p, int n );
|
int Read( void* p, int n );
|
||||||
|
|
||||||
|
DataHash PackedDataHash; // Packed write and unpack read hash.
|
||||||
|
DataHash PackHash; // Pack read hash.
|
||||||
|
DataHash UnpHash; // Unpack write hash.
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//// secpassword.hpp
|
||||||
|
void cleandata(void *data,size_t size);
|
||||||
|
|
||||||
|
//// pathfn.hpp
|
||||||
|
wchar* GetWideName(const char *Name,const wchar *NameW,wchar *DestW,size_t DestSize);
|
||||||
|
void UnixSlashToDos(const char *SrcName, char *DestName, size_t MaxLength);
|
||||||
|
void DosSlashToUnix(const char *SrcName, char *DestName, size_t MaxLength);
|
||||||
|
void UnixSlashToDos(const wchar *SrcName, wchar *DestName, size_t MaxLength);
|
||||||
|
void DosSlashToUnix(const wchar *SrcName, wchar *DestName, size_t MaxLength);
|
||||||
|
|
||||||
//// rar.hpp
|
//// rar.hpp
|
||||||
class Unpack;
|
class Unpack;
|
||||||
#include "array.hpp"
|
#include "array.hpp"
|
||||||
|
#include "unicode.hpp"
|
||||||
|
#include "timefn.hpp"
|
||||||
#include "headers.hpp"
|
#include "headers.hpp"
|
||||||
|
#include "headers5.hpp"
|
||||||
#include "getbits.hpp"
|
#include "getbits.hpp"
|
||||||
#include "archive.hpp"
|
#include "archive.hpp"
|
||||||
#include "rawread.hpp"
|
#include "rawread.hpp"
|
||||||
|
@ -172,8 +193,27 @@ class Unpack;
|
||||||
#include "compress.hpp"
|
#include "compress.hpp"
|
||||||
#include "rarvm.hpp"
|
#include "rarvm.hpp"
|
||||||
#include "model.hpp"
|
#include "model.hpp"
|
||||||
|
#include "strfn.hpp"
|
||||||
#include "unpack.hpp"
|
#include "unpack.hpp"
|
||||||
|
|
||||||
|
//// savepos.hpp
|
||||||
|
class SaveFilePos
|
||||||
|
{
|
||||||
|
private:
|
||||||
|
File *SaveFile;
|
||||||
|
int64 SavePos;
|
||||||
|
public:
|
||||||
|
SaveFilePos(File &Src)
|
||||||
|
{
|
||||||
|
SaveFile=&Src;
|
||||||
|
SavePos=Src.Tell();
|
||||||
|
}
|
||||||
|
~SaveFilePos()
|
||||||
|
{
|
||||||
|
SaveFile->Seek(SavePos,SEEK_SET);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
//// extract.hpp
|
//// extract.hpp
|
||||||
/** RAR archive */
|
/** RAR archive */
|
||||||
struct unrar_t
|
struct unrar_t
|
||||||
|
@ -195,7 +235,7 @@ struct unrar_t
|
||||||
|
|
||||||
unrar_t();
|
unrar_t();
|
||||||
~unrar_t();
|
~unrar_t();
|
||||||
void UnstoreFile( Int64 );
|
void UnstoreFile( int64 );
|
||||||
unrar_err_t ExtractCurrentFile( bool SkipSolid = false, bool check_compatibility_only = false );
|
unrar_err_t ExtractCurrentFile( bool SkipSolid = false, bool check_compatibility_only = false );
|
||||||
void update_first_file_pos()
|
void update_first_file_pos()
|
||||||
{
|
{
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
#define VM_FS ((unsigned) VM_FS)
|
#define VM_FS ((unsigned) VM_FS)
|
||||||
|
|
||||||
RarVM::RarVM()
|
RarVM::RarVM()
|
||||||
|
:BitInput(true)
|
||||||
{
|
{
|
||||||
Mem=NULL;
|
Mem=NULL;
|
||||||
}
|
}
|
||||||
|
@ -55,24 +56,24 @@ inline uint RarVM::GetValue(bool ByteMode,uint *Addr)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
#if defined(BIG_ENDIAN) || !defined(ALLOW_NOT_ALIGNED_INT)
|
#if defined(BIG_ENDIAN) || !defined(ALLOW_MISALIGNED)
|
||||||
if (IS_VM_MEM(Addr))
|
if (IS_VM_MEM(Addr))
|
||||||
{
|
{
|
||||||
byte *B=(byte *)Addr;
|
byte *B=(byte *)Addr;
|
||||||
return UINT32((uint)B[0]|((uint)B[1]<<8)|((uint)B[2]<<16)|((uint)B[3]<<24));
|
return GET_UINT32((uint)B[0]|((uint)B[1]<<8)|((uint)B[2]<<16)|((uint)B[3]<<24));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
return UINT32(*Addr);
|
return GET_UINT32(*Addr);
|
||||||
#else
|
#else
|
||||||
return UINT32(*Addr);
|
return GET_UINT32(*Addr);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(BIG_ENDIAN) || !defined(ALLOW_NOT_ALIGNED_INT)
|
#if defined(BIG_ENDIAN) || !defined(ALLOW_MISALIGNED)
|
||||||
#define GET_VALUE(ByteMode,Addr) GetValue(ByteMode,(uint *)Addr)
|
#define GET_VALUE(ByteMode,Addr) GetValue(ByteMode,(uint *)Addr)
|
||||||
#else
|
#else
|
||||||
#define GET_VALUE(ByteMode,Addr) ((ByteMode) ? (*(byte *)(Addr)):UINT32(*(uint *)(Addr)))
|
#define GET_VALUE(ByteMode,Addr) ((ByteMode) ? (*(byte *)(Addr)):GET_UINT32(*(uint *)(Addr)))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
@ -91,7 +92,7 @@ inline void RarVM::SetValue(bool ByteMode,uint *Addr,uint Value)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
#if defined(BIG_ENDIAN) || !defined(ALLOW_NOT_ALIGNED_INT) || !defined(PRESENT_INT32)
|
#if defined(BIG_ENDIAN) || !defined(ALLOW_MISALIGNED) || !defined(PRESENT_INT32)
|
||||||
if (IS_VM_MEM(Addr))
|
if (IS_VM_MEM(Addr))
|
||||||
{
|
{
|
||||||
((byte *)Addr)[0]=(byte)Value;
|
((byte *)Addr)[0]=(byte)Value;
|
||||||
|
@ -107,16 +108,16 @@ inline void RarVM::SetValue(bool ByteMode,uint *Addr,uint Value)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(BIG_ENDIAN) || !defined(ALLOW_NOT_ALIGNED_INT) || !defined(PRESENT_INT32)
|
#if defined(BIG_ENDIAN) || !defined(ALLOW_MISALIGNED) || !defined(PRESENT_INT32)
|
||||||
#define SET_VALUE(ByteMode,Addr,Value) SetValue(ByteMode,(uint *)Addr,Value)
|
#define SET_VALUE(ByteMode,Addr,Value) SetValue(ByteMode,(uint *)Addr,Value)
|
||||||
#else
|
#else
|
||||||
#define SET_VALUE(ByteMode,Addr,Value) ((ByteMode) ? (*(byte *)(Addr)=(Value)):(*(uint32 *)(Addr)=((uint32)(Value))))
|
#define SET_VALUE(ByteMode,Addr,Value) ((ByteMode) ? (*(byte *)(Addr)=((byte)(Value))):(*(uint32 *)(Addr)=((uint32)(Value))))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
void RarVM::SetLowEndianValue(uint *Addr,uint Value)
|
void RarVM::SetLowEndianValue(uint *Addr,uint Value)
|
||||||
{
|
{
|
||||||
#if defined(BIG_ENDIAN) || !defined(ALLOW_NOT_ALIGNED_INT) || !defined(PRESENT_INT32)
|
#if defined(BIG_ENDIAN) || !defined(ALLOW_MISALIGNED) || !defined(PRESENT_INT32)
|
||||||
((byte *)Addr)[0]=(byte)Value;
|
((byte *)Addr)[0]=(byte)Value;
|
||||||
((byte *)Addr)[1]=(byte)(Value>>8);
|
((byte *)Addr)[1]=(byte)(Value>>8);
|
||||||
((byte *)Addr)[2]=(byte)(Value>>16);
|
((byte *)Addr)[2]=(byte)(Value>>16);
|
||||||
|
@ -139,10 +140,10 @@ inline uint* RarVM::GetOperand(VM_PreparedOperand *CmdOp)
|
||||||
void RarVM::Execute(VM_PreparedProgram *Prg)
|
void RarVM::Execute(VM_PreparedProgram *Prg)
|
||||||
{
|
{
|
||||||
memcpy(R,Prg->InitR,sizeof(Prg->InitR));
|
memcpy(R,Prg->InitR,sizeof(Prg->InitR));
|
||||||
unsigned int GlobalSize=Min(Prg->GlobalData.Size(),VM_GLOBALMEMSIZE);
|
size_t GlobalSize=Min(Prg->GlobalData.Size(),VM_GLOBALMEMSIZE);
|
||||||
if (GlobalSize)
|
if (GlobalSize)
|
||||||
memcpy(Mem+VM_GLOBALMEMADDR,&Prg->GlobalData[0],GlobalSize);
|
memcpy(Mem+VM_GLOBALMEMADDR,&Prg->GlobalData[0],GlobalSize);
|
||||||
unsigned int StaticSize=Min(Prg->StaticData.Size(),VM_GLOBALMEMSIZE-GlobalSize);
|
size_t StaticSize=Min(Prg->StaticData.Size(),VM_GLOBALMEMSIZE-GlobalSize);
|
||||||
if (StaticSize)
|
if (StaticSize)
|
||||||
memcpy(Mem+VM_GLOBALMEMADDR+GlobalSize,&Prg->StaticData[0],StaticSize);
|
memcpy(Mem+VM_GLOBALMEMADDR+GlobalSize,&Prg->StaticData[0],StaticSize);
|
||||||
|
|
||||||
|
@ -150,8 +151,11 @@ void RarVM::Execute(VM_PreparedProgram *Prg)
|
||||||
Flags=0;
|
Flags=0;
|
||||||
|
|
||||||
VM_PreparedCommand *PreparedCode=Prg->AltCmd ? Prg->AltCmd:&Prg->Cmd[0];
|
VM_PreparedCommand *PreparedCode=Prg->AltCmd ? Prg->AltCmd:&Prg->Cmd[0];
|
||||||
if (!ExecuteCode(PreparedCode,Prg->CmdCount))
|
if (Prg->CmdCount>0 && !ExecuteCode(PreparedCode,Prg->CmdCount))
|
||||||
|
{
|
||||||
|
// Invalid VM program. Let's replace it with 'return' command.
|
||||||
PreparedCode[0].OpCode=VM_RET;
|
PreparedCode[0].OpCode=VM_RET;
|
||||||
|
}
|
||||||
uint NewBlockPos=GET_VALUE(false,&Mem[VM_GLOBALMEMADDR+0x20])&VM_MEMMASK;
|
uint NewBlockPos=GET_VALUE(false,&Mem[VM_GLOBALMEMADDR+0x20])&VM_MEMMASK;
|
||||||
uint NewBlockSize=GET_VALUE(false,&Mem[VM_GLOBALMEMADDR+0x1c])&VM_MEMMASK;
|
uint NewBlockSize=GET_VALUE(false,&Mem[VM_GLOBALMEMADDR+0x1c])&VM_MEMMASK;
|
||||||
if (NewBlockPos+NewBlockSize>=VM_MEMSIZE)
|
if (NewBlockPos+NewBlockSize>=VM_MEMSIZE)
|
||||||
|
@ -185,7 +189,7 @@ Note:
|
||||||
return(false); \
|
return(false); \
|
||||||
Cmd=PreparedCode+(IP);
|
Cmd=PreparedCode+(IP);
|
||||||
|
|
||||||
bool RarVM::ExecuteCode(VM_PreparedCommand *PreparedCode,int CodeSize)
|
bool RarVM::ExecuteCode(VM_PreparedCommand *PreparedCode,uint CodeSize)
|
||||||
{
|
{
|
||||||
int MaxOpCount=25000000;
|
int MaxOpCount=25000000;
|
||||||
VM_PreparedCommand *Cmd=PreparedCode;
|
VM_PreparedCommand *Cmd=PreparedCode;
|
||||||
|
@ -213,7 +217,7 @@ bool RarVM::ExecuteCode(VM_PreparedCommand *PreparedCode,int CodeSize)
|
||||||
case VM_CMP:
|
case VM_CMP:
|
||||||
{
|
{
|
||||||
uint Value1=GET_VALUE(Cmd->ByteMode,Op1);
|
uint Value1=GET_VALUE(Cmd->ByteMode,Op1);
|
||||||
uint Result=UINT32(Value1-GET_VALUE(Cmd->ByteMode,Op2));
|
uint Result=GET_UINT32(Value1-GET_VALUE(Cmd->ByteMode,Op2));
|
||||||
Flags=Result==0 ? VM_FZ:(Result>Value1)|(Result&VM_FS);
|
Flags=Result==0 ? VM_FZ:(Result>Value1)|(Result&VM_FS);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -221,14 +225,14 @@ bool RarVM::ExecuteCode(VM_PreparedCommand *PreparedCode,int CodeSize)
|
||||||
case VM_CMPB:
|
case VM_CMPB:
|
||||||
{
|
{
|
||||||
uint Value1=GET_VALUE(true,Op1);
|
uint Value1=GET_VALUE(true,Op1);
|
||||||
uint Result=UINT32(Value1-GET_VALUE(true,Op2));
|
uint Result=GET_UINT32(Value1-GET_VALUE(true,Op2));
|
||||||
Flags=Result==0 ? VM_FZ:(Result>Value1)|(Result&VM_FS);
|
Flags=Result==0 ? VM_FZ:(Result>Value1)|(Result&VM_FS);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case VM_CMPD:
|
case VM_CMPD:
|
||||||
{
|
{
|
||||||
uint Value1=GET_VALUE(false,Op1);
|
uint Value1=GET_VALUE(false,Op1);
|
||||||
uint Result=UINT32(Value1-GET_VALUE(false,Op2));
|
uint Result=GET_UINT32(Value1-GET_VALUE(false,Op2));
|
||||||
Flags=Result==0 ? VM_FZ:(Result>Value1)|(Result&VM_FS);
|
Flags=Result==0 ? VM_FZ:(Result>Value1)|(Result&VM_FS);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -236,7 +240,7 @@ bool RarVM::ExecuteCode(VM_PreparedCommand *PreparedCode,int CodeSize)
|
||||||
case VM_ADD:
|
case VM_ADD:
|
||||||
{
|
{
|
||||||
uint Value1=GET_VALUE(Cmd->ByteMode,Op1);
|
uint Value1=GET_VALUE(Cmd->ByteMode,Op1);
|
||||||
uint Result=UINT32(Value1+GET_VALUE(Cmd->ByteMode,Op2));
|
uint Result=GET_UINT32(Value1+GET_VALUE(Cmd->ByteMode,Op2));
|
||||||
if (Cmd->ByteMode)
|
if (Cmd->ByteMode)
|
||||||
{
|
{
|
||||||
Result&=0xff;
|
Result&=0xff;
|
||||||
|
@ -258,7 +262,7 @@ bool RarVM::ExecuteCode(VM_PreparedCommand *PreparedCode,int CodeSize)
|
||||||
case VM_SUB:
|
case VM_SUB:
|
||||||
{
|
{
|
||||||
uint Value1=GET_VALUE(Cmd->ByteMode,Op1);
|
uint Value1=GET_VALUE(Cmd->ByteMode,Op1);
|
||||||
uint Result=UINT32(Value1-GET_VALUE(Cmd->ByteMode,Op2));
|
uint Result=GET_UINT32(Value1-GET_VALUE(Cmd->ByteMode,Op2));
|
||||||
Flags=Result==0 ? VM_FZ:(Result>Value1)|(Result&VM_FS);
|
Flags=Result==0 ? VM_FZ:(Result>Value1)|(Result&VM_FS);
|
||||||
SET_VALUE(Cmd->ByteMode,Op1,Result);
|
SET_VALUE(Cmd->ByteMode,Op1,Result);
|
||||||
}
|
}
|
||||||
|
@ -287,7 +291,7 @@ bool RarVM::ExecuteCode(VM_PreparedCommand *PreparedCode,int CodeSize)
|
||||||
break;
|
break;
|
||||||
case VM_INC:
|
case VM_INC:
|
||||||
{
|
{
|
||||||
uint Result=UINT32(GET_VALUE(Cmd->ByteMode,Op1)+1);
|
uint Result=GET_UINT32(GET_VALUE(Cmd->ByteMode,Op1)+1);
|
||||||
if (Cmd->ByteMode)
|
if (Cmd->ByteMode)
|
||||||
Result&=0xff;
|
Result&=0xff;
|
||||||
SET_VALUE(Cmd->ByteMode,Op1,Result);
|
SET_VALUE(Cmd->ByteMode,Op1,Result);
|
||||||
|
@ -304,7 +308,7 @@ bool RarVM::ExecuteCode(VM_PreparedCommand *PreparedCode,int CodeSize)
|
||||||
#endif
|
#endif
|
||||||
case VM_DEC:
|
case VM_DEC:
|
||||||
{
|
{
|
||||||
uint Result=UINT32(GET_VALUE(Cmd->ByteMode,Op1)-1);
|
uint Result=GET_UINT32(GET_VALUE(Cmd->ByteMode,Op1)-1);
|
||||||
SET_VALUE(Cmd->ByteMode,Op1,Result);
|
SET_VALUE(Cmd->ByteMode,Op1,Result);
|
||||||
Flags=Result==0 ? VM_FZ:Result&VM_FS;
|
Flags=Result==0 ? VM_FZ:Result&VM_FS;
|
||||||
}
|
}
|
||||||
|
@ -322,28 +326,28 @@ bool RarVM::ExecuteCode(VM_PreparedCommand *PreparedCode,int CodeSize)
|
||||||
continue;
|
continue;
|
||||||
case VM_XOR:
|
case VM_XOR:
|
||||||
{
|
{
|
||||||
uint Result=UINT32(GET_VALUE(Cmd->ByteMode,Op1)^GET_VALUE(Cmd->ByteMode,Op2));
|
uint Result=GET_UINT32(GET_VALUE(Cmd->ByteMode,Op1)^GET_VALUE(Cmd->ByteMode,Op2));
|
||||||
Flags=Result==0 ? VM_FZ:Result&VM_FS;
|
Flags=Result==0 ? VM_FZ:Result&VM_FS;
|
||||||
SET_VALUE(Cmd->ByteMode,Op1,Result);
|
SET_VALUE(Cmd->ByteMode,Op1,Result);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case VM_AND:
|
case VM_AND:
|
||||||
{
|
{
|
||||||
uint Result=UINT32(GET_VALUE(Cmd->ByteMode,Op1)&GET_VALUE(Cmd->ByteMode,Op2));
|
uint Result=GET_UINT32(GET_VALUE(Cmd->ByteMode,Op1)&GET_VALUE(Cmd->ByteMode,Op2));
|
||||||
Flags=Result==0 ? VM_FZ:Result&VM_FS;
|
Flags=Result==0 ? VM_FZ:Result&VM_FS;
|
||||||
SET_VALUE(Cmd->ByteMode,Op1,Result);
|
SET_VALUE(Cmd->ByteMode,Op1,Result);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case VM_OR:
|
case VM_OR:
|
||||||
{
|
{
|
||||||
uint Result=UINT32(GET_VALUE(Cmd->ByteMode,Op1)|GET_VALUE(Cmd->ByteMode,Op2));
|
uint Result=GET_UINT32(GET_VALUE(Cmd->ByteMode,Op1)|GET_VALUE(Cmd->ByteMode,Op2));
|
||||||
Flags=Result==0 ? VM_FZ:Result&VM_FS;
|
Flags=Result==0 ? VM_FZ:Result&VM_FS;
|
||||||
SET_VALUE(Cmd->ByteMode,Op1,Result);
|
SET_VALUE(Cmd->ByteMode,Op1,Result);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case VM_TEST:
|
case VM_TEST:
|
||||||
{
|
{
|
||||||
uint Result=UINT32(GET_VALUE(Cmd->ByteMode,Op1)&GET_VALUE(Cmd->ByteMode,Op2));
|
uint Result=GET_UINT32(GET_VALUE(Cmd->ByteMode,Op1)&GET_VALUE(Cmd->ByteMode,Op2));
|
||||||
Flags=Result==0 ? VM_FZ:Result&VM_FS;
|
Flags=Result==0 ? VM_FZ:Result&VM_FS;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -399,7 +403,7 @@ bool RarVM::ExecuteCode(VM_PreparedCommand *PreparedCode,int CodeSize)
|
||||||
break;
|
break;
|
||||||
case VM_CALL:
|
case VM_CALL:
|
||||||
R[7]-=4;
|
R[7]-=4;
|
||||||
SET_VALUE(false,(uint *)&Mem[R[7]&VM_MEMMASK],Cmd-PreparedCode+1);
|
SET_VALUE(false,(uint *)&Mem[R[7]&VM_MEMMASK],(uint)(Cmd-PreparedCode+1));
|
||||||
SET_IP(GET_VALUE(false,Op1));
|
SET_IP(GET_VALUE(false,Op1));
|
||||||
continue;
|
continue;
|
||||||
case VM_NOT:
|
case VM_NOT:
|
||||||
|
@ -409,7 +413,7 @@ bool RarVM::ExecuteCode(VM_PreparedCommand *PreparedCode,int CodeSize)
|
||||||
{
|
{
|
||||||
uint Value1=GET_VALUE(Cmd->ByteMode,Op1);
|
uint Value1=GET_VALUE(Cmd->ByteMode,Op1);
|
||||||
uint Value2=GET_VALUE(Cmd->ByteMode,Op2);
|
uint Value2=GET_VALUE(Cmd->ByteMode,Op2);
|
||||||
uint Result=UINT32(Value1<<Value2);
|
uint Result=GET_UINT32(Value1<<Value2);
|
||||||
Flags=(Result==0 ? VM_FZ:(Result&VM_FS))|((Value1<<(Value2-1))&0x80000000 ? VM_FC:0);
|
Flags=(Result==0 ? VM_FZ:(Result&VM_FS))|((Value1<<(Value2-1))&0x80000000 ? VM_FC:0);
|
||||||
SET_VALUE(Cmd->ByteMode,Op1,Result);
|
SET_VALUE(Cmd->ByteMode,Op1,Result);
|
||||||
}
|
}
|
||||||
|
@ -418,7 +422,7 @@ bool RarVM::ExecuteCode(VM_PreparedCommand *PreparedCode,int CodeSize)
|
||||||
{
|
{
|
||||||
uint Value1=GET_VALUE(Cmd->ByteMode,Op1);
|
uint Value1=GET_VALUE(Cmd->ByteMode,Op1);
|
||||||
uint Value2=GET_VALUE(Cmd->ByteMode,Op2);
|
uint Value2=GET_VALUE(Cmd->ByteMode,Op2);
|
||||||
uint Result=UINT32(Value1>>Value2);
|
uint Result=GET_UINT32(Value1>>Value2);
|
||||||
Flags=(Result==0 ? VM_FZ:(Result&VM_FS))|((Value1>>(Value2-1))&VM_FC);
|
Flags=(Result==0 ? VM_FZ:(Result&VM_FS))|((Value1>>(Value2-1))&VM_FC);
|
||||||
SET_VALUE(Cmd->ByteMode,Op1,Result);
|
SET_VALUE(Cmd->ByteMode,Op1,Result);
|
||||||
}
|
}
|
||||||
|
@ -427,24 +431,26 @@ bool RarVM::ExecuteCode(VM_PreparedCommand *PreparedCode,int CodeSize)
|
||||||
{
|
{
|
||||||
uint Value1=GET_VALUE(Cmd->ByteMode,Op1);
|
uint Value1=GET_VALUE(Cmd->ByteMode,Op1);
|
||||||
uint Value2=GET_VALUE(Cmd->ByteMode,Op2);
|
uint Value2=GET_VALUE(Cmd->ByteMode,Op2);
|
||||||
uint Result=UINT32(((int)Value1)>>Value2);
|
uint Result=GET_UINT32(((int)Value1)>>Value2);
|
||||||
Flags=(Result==0 ? VM_FZ:(Result&VM_FS))|((Value1>>(Value2-1))&VM_FC);
|
Flags=(Result==0 ? VM_FZ:(Result&VM_FS))|((Value1>>(Value2-1))&VM_FC);
|
||||||
SET_VALUE(Cmd->ByteMode,Op1,Result);
|
SET_VALUE(Cmd->ByteMode,Op1,Result);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case VM_NEG:
|
case VM_NEG:
|
||||||
{
|
{
|
||||||
uint Result=UINT32(-GET_VALUE(Cmd->ByteMode,Op1));
|
// We use "0-value" expression to suppress "unary minus to unsigned"
|
||||||
|
// compiler warning.
|
||||||
|
uint Result=GET_UINT32(0-GET_VALUE(Cmd->ByteMode,Op1));
|
||||||
Flags=Result==0 ? VM_FZ:VM_FC|(Result&VM_FS);
|
Flags=Result==0 ? VM_FZ:VM_FC|(Result&VM_FS);
|
||||||
SET_VALUE(Cmd->ByteMode,Op1,Result);
|
SET_VALUE(Cmd->ByteMode,Op1,Result);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
#ifdef VM_OPTIMIZE
|
#ifdef VM_OPTIMIZE
|
||||||
case VM_NEGB:
|
case VM_NEGB:
|
||||||
SET_VALUE(true,Op1,-GET_VALUE(true,Op1));
|
SET_VALUE(true,Op1,0-GET_VALUE(true,Op1));
|
||||||
break;
|
break;
|
||||||
case VM_NEGD:
|
case VM_NEGD:
|
||||||
SET_VALUE(false,Op1,-GET_VALUE(false,Op1));
|
SET_VALUE(false,Op1,0-GET_VALUE(false,Op1));
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
case VM_PUSHA:
|
case VM_PUSHA:
|
||||||
|
@ -503,10 +509,10 @@ bool RarVM::ExecuteCode(VM_PreparedCommand *PreparedCode,int CodeSize)
|
||||||
{
|
{
|
||||||
uint Value1=GET_VALUE(Cmd->ByteMode,Op1);
|
uint Value1=GET_VALUE(Cmd->ByteMode,Op1);
|
||||||
uint FC=(Flags&VM_FC);
|
uint FC=(Flags&VM_FC);
|
||||||
uint Result=UINT32(Value1+GET_VALUE(Cmd->ByteMode,Op2)+FC);
|
uint Result=GET_UINT32(Value1+GET_VALUE(Cmd->ByteMode,Op2)+FC);
|
||||||
if (Cmd->ByteMode)
|
if (Cmd->ByteMode)
|
||||||
Result&=0xff;
|
Result&=0xff;
|
||||||
Flags=(Result<Value1 || Result==Value1 && FC)|(Result==0 ? VM_FZ:(Result&VM_FS));
|
Flags=(Result<Value1 || (Result==Value1 && FC))|(Result==0 ? VM_FZ:(Result&VM_FS));
|
||||||
SET_VALUE(Cmd->ByteMode,Op1,Result);
|
SET_VALUE(Cmd->ByteMode,Op1,Result);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -514,10 +520,10 @@ bool RarVM::ExecuteCode(VM_PreparedCommand *PreparedCode,int CodeSize)
|
||||||
{
|
{
|
||||||
uint Value1=GET_VALUE(Cmd->ByteMode,Op1);
|
uint Value1=GET_VALUE(Cmd->ByteMode,Op1);
|
||||||
uint FC=(Flags&VM_FC);
|
uint FC=(Flags&VM_FC);
|
||||||
uint Result=UINT32(Value1-GET_VALUE(Cmd->ByteMode,Op2)-FC);
|
uint Result=GET_UINT32(Value1-GET_VALUE(Cmd->ByteMode,Op2)-FC);
|
||||||
if (Cmd->ByteMode)
|
if (Cmd->ByteMode)
|
||||||
Result&=0xff;
|
Result&=0xff;
|
||||||
Flags=(Result>Value1 || Result==Value1 && FC)|(Result==0 ? VM_FZ:(Result&VM_FS));
|
Flags=(Result>Value1 || (Result==Value1 && FC))|(Result==0 ? VM_FZ:(Result&VM_FS));
|
||||||
SET_VALUE(Cmd->ByteMode,Op1,Result);
|
SET_VALUE(Cmd->ByteMode,Op1,Result);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -531,7 +537,7 @@ bool RarVM::ExecuteCode(VM_PreparedCommand *PreparedCode,int CodeSize)
|
||||||
#ifdef VM_STANDARDFILTERS
|
#ifdef VM_STANDARDFILTERS
|
||||||
case VM_STANDARD:
|
case VM_STANDARD:
|
||||||
ExecuteStandardFilter((VM_StandardFilters)Cmd->Op1.Data);
|
ExecuteStandardFilter((VM_StandardFilters)Cmd->Op1.Data);
|
||||||
break;
|
return true;
|
||||||
#endif
|
#endif
|
||||||
case VM_PRINT:
|
case VM_PRINT:
|
||||||
break;
|
break;
|
||||||
|
@ -544,7 +550,7 @@ bool RarVM::ExecuteCode(VM_PreparedCommand *PreparedCode,int CodeSize)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void RarVM::Prepare(byte *Code,int CodeSize,VM_PreparedProgram *Prg)
|
void RarVM::Prepare(byte *Code,uint CodeSize,VM_PreparedProgram *Prg)
|
||||||
{
|
{
|
||||||
InitBitInput();
|
InitBitInput();
|
||||||
memcpy(InBuf,Code,Min(CodeSize,BitInput::MAX_SIZE));
|
memcpy(InBuf,Code,Min(CodeSize,BitInput::MAX_SIZE));
|
||||||
|
@ -552,7 +558,7 @@ void RarVM::Prepare(byte *Code,int CodeSize,VM_PreparedProgram *Prg)
|
||||||
// Calculate the single byte XOR checksum to check validity of VM code.
|
// Calculate the single byte XOR checksum to check validity of VM code.
|
||||||
byte XorSum=0;
|
byte XorSum=0;
|
||||||
{
|
{
|
||||||
for (int I=1;I<CodeSize;I++)
|
for (uint I=1;I<CodeSize;I++)
|
||||||
XorSum^=Code[I];
|
XorSum^=Code[I];
|
||||||
}
|
}
|
||||||
faddbits(8);
|
faddbits(8);
|
||||||
|
@ -573,6 +579,7 @@ void RarVM::Prepare(byte *Code,int CodeSize,VM_PreparedProgram *Prg)
|
||||||
CurCmd->Op2.Addr=&CurCmd->Op2.Data;
|
CurCmd->Op2.Addr=&CurCmd->Op2.Data;
|
||||||
CurCmd->Op1.Type=CurCmd->Op2.Type=VM_OPNONE;
|
CurCmd->Op1.Type=CurCmd->Op2.Type=VM_OPNONE;
|
||||||
CodeSize=0;
|
CodeSize=0;
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
uint DataFlag=fgetbits();
|
uint DataFlag=fgetbits();
|
||||||
|
@ -583,8 +590,8 @@ void RarVM::Prepare(byte *Code,int CodeSize,VM_PreparedProgram *Prg)
|
||||||
|
|
||||||
if (DataFlag&0x8000)
|
if (DataFlag&0x8000)
|
||||||
{
|
{
|
||||||
int DataSize=ReadData(*this)+1;
|
uint DataSize=ReadData(*this)+1;
|
||||||
for (int I=0;InAddr<CodeSize && I<DataSize;I++)
|
for (uint I=0;(uint)InAddr<CodeSize && I<DataSize;I++)
|
||||||
{
|
{
|
||||||
Prg->StaticData.Add(1);
|
Prg->StaticData.Add(1);
|
||||||
Prg->StaticData[I]=fgetbits()>>8;
|
Prg->StaticData[I]=fgetbits()>>8;
|
||||||
|
@ -592,7 +599,7 @@ void RarVM::Prepare(byte *Code,int CodeSize,VM_PreparedProgram *Prg)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
while (InAddr<CodeSize)
|
while ((uint)InAddr<CodeSize)
|
||||||
{
|
{
|
||||||
Prg->Cmd.Add(1);
|
Prg->Cmd.Add(1);
|
||||||
VM_PreparedCommand *CurCmd=&Prg->Cmd[Prg->CmdCount];
|
VM_PreparedCommand *CurCmd=&Prg->Cmd[Prg->CmdCount];
|
||||||
|
@ -609,7 +616,7 @@ void RarVM::Prepare(byte *Code,int CodeSize,VM_PreparedProgram *Prg)
|
||||||
}
|
}
|
||||||
if (VM_CmdFlags[CurCmd->OpCode] & VMCF_BYTEMODE)
|
if (VM_CmdFlags[CurCmd->OpCode] & VMCF_BYTEMODE)
|
||||||
{
|
{
|
||||||
CurCmd->ByteMode=fgetbits()>>15;
|
CurCmd->ByteMode=(fgetbits()>>15)!=0;
|
||||||
faddbits(1);
|
faddbits(1);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -773,7 +780,7 @@ uint RarVM::ReadData(BitInput &Inp)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void RarVM::SetMemory(unsigned int Pos,byte *Data,unsigned int DataSize)
|
void RarVM::SetMemory(size_t Pos,byte *Data,size_t DataSize)
|
||||||
{
|
{
|
||||||
if (Pos<VM_MEMSIZE && Data!=Mem+Pos)
|
if (Pos<VM_MEMSIZE && Data!=Mem+Pos)
|
||||||
memmove(Mem+Pos,Data,Min(DataSize,VM_MEMSIZE-Pos));
|
memmove(Mem+Pos,Data,Min(DataSize,VM_MEMSIZE-Pos));
|
||||||
|
@ -784,9 +791,9 @@ void RarVM::SetMemory(unsigned int Pos,byte *Data,unsigned int DataSize)
|
||||||
void RarVM::Optimize(VM_PreparedProgram *Prg)
|
void RarVM::Optimize(VM_PreparedProgram *Prg)
|
||||||
{
|
{
|
||||||
VM_PreparedCommand *Code=&Prg->Cmd[0];
|
VM_PreparedCommand *Code=&Prg->Cmd[0];
|
||||||
int CodeSize=Prg->CmdCount;
|
uint CodeSize=Prg->CmdCount;
|
||||||
|
|
||||||
for (int I=0;I<CodeSize;I++)
|
for (uint I=0;I<CodeSize;I++)
|
||||||
{
|
{
|
||||||
VM_PreparedCommand *Cmd=Code+I;
|
VM_PreparedCommand *Cmd=Code+I;
|
||||||
|
|
||||||
|
@ -800,6 +807,8 @@ void RarVM::Optimize(VM_PreparedProgram *Prg)
|
||||||
case VM_CMP:
|
case VM_CMP:
|
||||||
Cmd->OpCode=Cmd->ByteMode ? VM_CMPB:VM_CMPD;
|
Cmd->OpCode=Cmd->ByteMode ? VM_CMPB:VM_CMPD;
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
default: break;
|
||||||
}
|
}
|
||||||
if ((VM_CmdFlags[Cmd->OpCode] & VMCF_CHFLAGS)==0)
|
if ((VM_CmdFlags[Cmd->OpCode] & VMCF_CHFLAGS)==0)
|
||||||
continue;
|
continue;
|
||||||
|
@ -809,7 +818,7 @@ void RarVM::Optimize(VM_PreparedProgram *Prg)
|
||||||
// the current command with faster version which does not need to
|
// the current command with faster version which does not need to
|
||||||
// modify flags.
|
// modify flags.
|
||||||
bool FlagsRequired=false;
|
bool FlagsRequired=false;
|
||||||
for (int J=I+1;J<CodeSize;J++)
|
for (uint J=I+1;J<CodeSize;J++)
|
||||||
{
|
{
|
||||||
int Flags=VM_CmdFlags[Code[J].OpCode];
|
int Flags=VM_CmdFlags[Code[J].OpCode];
|
||||||
if (Flags & (VMCF_JUMP|VMCF_PROC|VMCF_USEFLAGS))
|
if (Flags & (VMCF_JUMP|VMCF_PROC|VMCF_USEFLAGS))
|
||||||
|
@ -843,6 +852,8 @@ void RarVM::Optimize(VM_PreparedProgram *Prg)
|
||||||
case VM_NEG:
|
case VM_NEG:
|
||||||
Cmd->OpCode=Cmd->ByteMode ? VM_NEGB:VM_NEGD;
|
Cmd->OpCode=Cmd->ByteMode ? VM_NEGB:VM_NEGD;
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
default: break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -850,7 +861,7 @@ void RarVM::Optimize(VM_PreparedProgram *Prg)
|
||||||
|
|
||||||
|
|
||||||
#ifdef VM_STANDARDFILTERS
|
#ifdef VM_STANDARDFILTERS
|
||||||
VM_StandardFilters RarVM::IsStandardFilter(byte *Code,int CodeSize)
|
VM_StandardFilters RarVM::IsStandardFilter(byte *Code,uint CodeSize)
|
||||||
{
|
{
|
||||||
static const
|
static const
|
||||||
struct StandardFilterSignature
|
struct StandardFilterSignature
|
||||||
|
@ -871,12 +882,10 @@ VM_StandardFilters RarVM::IsStandardFilter(byte *Code,int CodeSize)
|
||||||
149, 0x1c2c5dc8, VMSF_RGB,
|
149, 0x1c2c5dc8, VMSF_RGB,
|
||||||
},{
|
},{
|
||||||
216, 0xbc85e701, VMSF_AUDIO,
|
216, 0xbc85e701, VMSF_AUDIO,
|
||||||
},{
|
|
||||||
40, 0x46b9c560, VMSF_UPCASE
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
uint CodeCRC=CRC(0xffffffff,Code,CodeSize)^0xffffffff;
|
uint CodeCRC=CRC32(0xffffffff,Code,CodeSize)^0xffffffff;
|
||||||
for (int I=0;I<sizeof(StdList)/sizeof(StdList[0]);I++)
|
for (uint I=0;I<ASIZE(StdList);I++)
|
||||||
if (StdList[I].CRC==CodeCRC && StdList[I].Length==CodeSize)
|
if (StdList[I].CRC==CodeCRC && StdList[I].Length==CodeSize)
|
||||||
return(StdList[I].Type);
|
return(StdList[I].Type);
|
||||||
return(VMSF_NONE);
|
return(VMSF_NONE);
|
||||||
|
@ -894,7 +903,7 @@ void RarVM::ExecuteStandardFilter(VM_StandardFilters FilterType)
|
||||||
int DataSize=R[4];
|
int DataSize=R[4];
|
||||||
uint FileOffset=R[6];
|
uint FileOffset=R[6];
|
||||||
|
|
||||||
if (DataSize>=VM_GLOBALMEMADDR || DataSize<4)
|
if ((uint)DataSize>=VM_GLOBALMEMADDR || DataSize<4)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
const int FileSize=0x1000000;
|
const int FileSize=0x1000000;
|
||||||
|
@ -906,8 +915,8 @@ void RarVM::ExecuteStandardFilter(VM_StandardFilters FilterType)
|
||||||
if (CurByte==0xe8 || CurByte==CmpByte2)
|
if (CurByte==0xe8 || CurByte==CmpByte2)
|
||||||
{
|
{
|
||||||
#ifdef PRESENT_INT32
|
#ifdef PRESENT_INT32
|
||||||
sint32 Offset=CurPos+FileOffset;
|
int32 Offset=CurPos+FileOffset;
|
||||||
sint32 Addr=GET_VALUE(false,Data);
|
int32 Addr=GET_VALUE(false,Data);
|
||||||
if (Addr<0)
|
if (Addr<0)
|
||||||
{
|
{
|
||||||
if (Addr+Offset>=0)
|
if (Addr+Offset>=0)
|
||||||
|
@ -940,7 +949,7 @@ void RarVM::ExecuteStandardFilter(VM_StandardFilters FilterType)
|
||||||
int DataSize=R[4];
|
int DataSize=R[4];
|
||||||
uint FileOffset=R[6];
|
uint FileOffset=R[6];
|
||||||
|
|
||||||
if (DataSize>=VM_GLOBALMEMADDR || DataSize<21)
|
if ((uint)DataSize>=VM_GLOBALMEMADDR || DataSize<21)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
int CurPos=0;
|
int CurPos=0;
|
||||||
|
@ -978,7 +987,7 @@ void RarVM::ExecuteStandardFilter(VM_StandardFilters FilterType)
|
||||||
{
|
{
|
||||||
int DataSize=R[4],Channels=R[0],SrcPos=0,Border=DataSize*2;
|
int DataSize=R[4],Channels=R[0],SrcPos=0,Border=DataSize*2;
|
||||||
SET_VALUE(false,&Mem[VM_GLOBALMEMADDR+0x20],DataSize);
|
SET_VALUE(false,&Mem[VM_GLOBALMEMADDR+0x20],DataSize);
|
||||||
if (DataSize>=VM_GLOBALMEMADDR/2)
|
if ((uint)DataSize>=VM_GLOBALMEMADDR/2)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// Bytes from same channels are grouped to continual data blocks,
|
// Bytes from same channels are grouped to continual data blocks,
|
||||||
|
@ -997,21 +1006,21 @@ void RarVM::ExecuteStandardFilter(VM_StandardFilters FilterType)
|
||||||
byte *SrcData=Mem,*DestData=SrcData+DataSize;
|
byte *SrcData=Mem,*DestData=SrcData+DataSize;
|
||||||
const int Channels=3;
|
const int Channels=3;
|
||||||
SET_VALUE(false,&Mem[VM_GLOBALMEMADDR+0x20],DataSize);
|
SET_VALUE(false,&Mem[VM_GLOBALMEMADDR+0x20],DataSize);
|
||||||
if (DataSize>=VM_GLOBALMEMADDR/2 || PosR<0)
|
if ((uint)DataSize>=VM_GLOBALMEMADDR/2 || Width<0 || PosR<0)
|
||||||
break;
|
break;
|
||||||
for (int CurChannel=0;CurChannel<Channels;CurChannel++)
|
for (int CurChannel=0;CurChannel<Channels;CurChannel++)
|
||||||
{
|
{
|
||||||
unsigned int PrevByte=0;
|
uint PrevByte=0;
|
||||||
|
|
||||||
for (int I=CurChannel;I<DataSize;I+=Channels)
|
for (int I=CurChannel;I<DataSize;I+=Channels)
|
||||||
{
|
{
|
||||||
unsigned int Predicted;
|
uint Predicted;
|
||||||
int UpperPos=I-Width;
|
int UpperPos=I-Width;
|
||||||
if (UpperPos>=3)
|
if (UpperPos>=3)
|
||||||
{
|
{
|
||||||
byte *UpperData=DestData+UpperPos;
|
byte *UpperData=DestData+UpperPos;
|
||||||
unsigned int UpperByte=*UpperData;
|
uint UpperByte=*UpperData;
|
||||||
unsigned int UpperLeftByte=*(UpperData-3);
|
uint UpperLeftByte=*(UpperData-3);
|
||||||
Predicted=PrevByte+UpperByte-UpperLeftByte;
|
Predicted=PrevByte+UpperByte-UpperLeftByte;
|
||||||
int pa=abs((int)(Predicted-PrevByte));
|
int pa=abs((int)(Predicted-PrevByte));
|
||||||
int pb=abs((int)(Predicted-UpperByte));
|
int pb=abs((int)(Predicted-UpperByte));
|
||||||
|
@ -1042,11 +1051,11 @@ void RarVM::ExecuteStandardFilter(VM_StandardFilters FilterType)
|
||||||
int DataSize=R[4],Channels=R[0];
|
int DataSize=R[4],Channels=R[0];
|
||||||
byte *SrcData=Mem,*DestData=SrcData+DataSize;
|
byte *SrcData=Mem,*DestData=SrcData+DataSize;
|
||||||
SET_VALUE(false,&Mem[VM_GLOBALMEMADDR+0x20],DataSize);
|
SET_VALUE(false,&Mem[VM_GLOBALMEMADDR+0x20],DataSize);
|
||||||
if (DataSize>=VM_GLOBALMEMADDR/2)
|
if ((uint)DataSize>=VM_GLOBALMEMADDR/2)
|
||||||
break;
|
break;
|
||||||
for (int CurChannel=0;CurChannel<Channels;CurChannel++)
|
for (int CurChannel=0;CurChannel<Channels;CurChannel++)
|
||||||
{
|
{
|
||||||
unsigned int PrevByte=0,PrevDelta=0,Dif[7];
|
uint PrevByte=0,PrevDelta=0,Dif[7];
|
||||||
int D1=0,D2=0,D3;
|
int D1=0,D2=0,D3;
|
||||||
int K1=0,K2=0,K3=0;
|
int K1=0,K2=0,K3=0;
|
||||||
memset(Dif,0,sizeof(Dif));
|
memset(Dif,0,sizeof(Dif));
|
||||||
|
@ -1057,10 +1066,10 @@ void RarVM::ExecuteStandardFilter(VM_StandardFilters FilterType)
|
||||||
D2=PrevDelta-D1;
|
D2=PrevDelta-D1;
|
||||||
D1=PrevDelta;
|
D1=PrevDelta;
|
||||||
|
|
||||||
unsigned int Predicted=8*PrevByte+K1*D1+K2*D2+K3*D3;
|
uint Predicted=8*PrevByte+K1*D1+K2*D2+K3*D3;
|
||||||
Predicted=(Predicted>>3) & 0xff;
|
Predicted=(Predicted>>3) & 0xff;
|
||||||
|
|
||||||
unsigned int CurByte=*(SrcData++);
|
uint CurByte=*(SrcData++);
|
||||||
|
|
||||||
Predicted-=CurByte;
|
Predicted-=CurByte;
|
||||||
DestData[I]=Predicted;
|
DestData[I]=Predicted;
|
||||||
|
@ -1079,7 +1088,7 @@ void RarVM::ExecuteStandardFilter(VM_StandardFilters FilterType)
|
||||||
|
|
||||||
if ((ByteCount & 0x1f)==0)
|
if ((ByteCount & 0x1f)==0)
|
||||||
{
|
{
|
||||||
unsigned int MinDif=Dif[0],NumMinDif=0;
|
uint MinDif=Dif[0],NumMinDif=0;
|
||||||
Dif[0]=0;
|
Dif[0]=0;
|
||||||
for (int J=1;J<sizeof(Dif)/sizeof(Dif[0]);J++)
|
for (int J=1;J<sizeof(Dif)/sizeof(Dif[0]);J++)
|
||||||
{
|
{
|
||||||
|
@ -1104,31 +1113,15 @@ void RarVM::ExecuteStandardFilter(VM_StandardFilters FilterType)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case VMSF_UPCASE:
|
|
||||||
{
|
|
||||||
int DataSize=R[4],SrcPos=0,DestPos=DataSize;
|
|
||||||
if (DataSize>=VM_GLOBALMEMADDR/2)
|
|
||||||
break;
|
|
||||||
while (SrcPos<DataSize)
|
|
||||||
{
|
|
||||||
byte CurByte=Mem[SrcPos++];
|
|
||||||
if (CurByte==2 && (CurByte=Mem[SrcPos++])!=2)
|
|
||||||
CurByte-=32;
|
|
||||||
Mem[DestPos++]=CurByte;
|
|
||||||
}
|
|
||||||
SET_VALUE(false,&Mem[VM_GLOBALMEMADDR+0x1c],DestPos-DataSize);
|
|
||||||
SET_VALUE(false,&Mem[VM_GLOBALMEMADDR+0x20],DataSize);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
unsigned int RarVM::FilterItanium_GetBits(byte *Data,int BitPos,int BitCount)
|
uint RarVM::FilterItanium_GetBits(byte *Data,int BitPos,int BitCount)
|
||||||
{
|
{
|
||||||
int InAddr=BitPos/8;
|
int InAddr=BitPos/8;
|
||||||
int InBit=BitPos&7;
|
int InBit=BitPos&7;
|
||||||
unsigned int BitField=(uint)Data[InAddr++];
|
uint BitField=(uint)Data[InAddr++];
|
||||||
BitField|=(uint)Data[InAddr++] << 8;
|
BitField|=(uint)Data[InAddr++] << 8;
|
||||||
BitField|=(uint)Data[InAddr++] << 16;
|
BitField|=(uint)Data[InAddr++] << 16;
|
||||||
BitField|=(uint)Data[InAddr] << 24;
|
BitField|=(uint)Data[InAddr] << 24;
|
||||||
|
@ -1137,17 +1130,16 @@ unsigned int RarVM::FilterItanium_GetBits(byte *Data,int BitPos,int BitCount)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void RarVM::FilterItanium_SetBits(byte *Data,unsigned int BitField,int BitPos,
|
void RarVM::FilterItanium_SetBits(byte *Data,uint BitField,int BitPos,int BitCount)
|
||||||
int BitCount)
|
|
||||||
{
|
{
|
||||||
int InAddr=BitPos/8;
|
int InAddr=BitPos/8;
|
||||||
int InBit=BitPos&7;
|
int InBit=BitPos&7;
|
||||||
unsigned int AndMask=0xffffffff>>(32-BitCount);
|
uint AndMask=0xffffffff>>(32-BitCount);
|
||||||
AndMask=~(AndMask<<InBit);
|
AndMask=~(AndMask<<InBit);
|
||||||
|
|
||||||
BitField<<=InBit;
|
BitField<<=InBit;
|
||||||
|
|
||||||
for (int I=0;I<4;I++)
|
for (uint I=0;I<4;I++)
|
||||||
{
|
{
|
||||||
Data[InAddr+I]&=AndMask;
|
Data[InAddr+I]&=AndMask;
|
||||||
Data[InAddr+I]|=BitField;
|
Data[InAddr+I]|=BitField;
|
||||||
|
|
|
@ -34,7 +34,7 @@ enum VM_Commands
|
||||||
|
|
||||||
enum VM_StandardFilters {
|
enum VM_StandardFilters {
|
||||||
VMSF_NONE, VMSF_E8, VMSF_E8E9, VMSF_ITANIUM, VMSF_RGB, VMSF_AUDIO,
|
VMSF_NONE, VMSF_E8, VMSF_E8E9, VMSF_ITANIUM, VMSF_RGB, VMSF_AUDIO,
|
||||||
VMSF_DELTA, VMSF_UPCASE
|
VMSF_DELTA
|
||||||
};
|
};
|
||||||
|
|
||||||
enum VM_Flags {VM_FC=1,VM_FZ=2,VM_FS=0x80000000};
|
enum VM_Flags {VM_FC=1,VM_FZ=2,VM_FS=0x80000000};
|
||||||
|
@ -59,8 +59,12 @@ struct VM_PreparedCommand
|
||||||
|
|
||||||
struct VM_PreparedProgram
|
struct VM_PreparedProgram
|
||||||
{
|
{
|
||||||
VM_PreparedProgram( Rar_Error_Handler* eh ) : Cmd( eh ), GlobalData( eh ), StaticData( eh )
|
VM_PreparedProgram()
|
||||||
{AltCmd=NULL;}
|
{
|
||||||
|
AltCmd=NULL;
|
||||||
|
FilteredDataSize=0;
|
||||||
|
CmdCount=0;
|
||||||
|
}
|
||||||
|
|
||||||
Array<VM_PreparedCommand> Cmd;
|
Array<VM_PreparedCommand> Cmd;
|
||||||
VM_PreparedCommand *AltCmd;
|
VM_PreparedCommand *AltCmd;
|
||||||
|
@ -71,7 +75,7 @@ struct VM_PreparedProgram
|
||||||
uint InitR[7];
|
uint InitR[7];
|
||||||
|
|
||||||
byte *FilteredData;
|
byte *FilteredData;
|
||||||
unsigned int FilteredDataSize;
|
uint FilteredDataSize;
|
||||||
};
|
};
|
||||||
|
|
||||||
class RarVM:private BitInput
|
class RarVM:private BitInput
|
||||||
|
@ -84,13 +88,12 @@ class RarVM:private BitInput
|
||||||
#ifdef VM_OPTIMIZE
|
#ifdef VM_OPTIMIZE
|
||||||
void Optimize(VM_PreparedProgram *Prg);
|
void Optimize(VM_PreparedProgram *Prg);
|
||||||
#endif
|
#endif
|
||||||
bool ExecuteCode(VM_PreparedCommand *PreparedCode,int CodeSize);
|
bool ExecuteCode(VM_PreparedCommand *PreparedCode,uint CodeSize);
|
||||||
#ifdef VM_STANDARDFILTERS
|
#ifdef VM_STANDARDFILTERS
|
||||||
VM_StandardFilters IsStandardFilter(byte *Code,int CodeSize);
|
VM_StandardFilters IsStandardFilter(byte *Code,uint CodeSize);
|
||||||
void ExecuteStandardFilter(VM_StandardFilters FilterType);
|
void ExecuteStandardFilter(VM_StandardFilters FilterType);
|
||||||
unsigned int FilterItanium_GetBits(byte *Data,int BitPos,int BitCount);
|
unsigned int FilterItanium_GetBits(byte *Data,int BitPos,int BitCount);
|
||||||
void FilterItanium_SetBits(byte *Data,unsigned int BitField,int BitPos,
|
void FilterItanium_SetBits(byte *Data,uint BitField,int BitPos,int BitCount);
|
||||||
int BitCount);
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
byte *Mem;
|
byte *Mem;
|
||||||
|
@ -102,10 +105,10 @@ class RarVM:private BitInput
|
||||||
void Init();
|
void Init();
|
||||||
void handle_mem_error( Rar_Error_Handler& );
|
void handle_mem_error( Rar_Error_Handler& );
|
||||||
friend class Unpack;
|
friend class Unpack;
|
||||||
void Prepare(byte *Code,int CodeSize,VM_PreparedProgram *Prg);
|
void Prepare(byte *Code,uint CodeSize,VM_PreparedProgram *Prg);
|
||||||
void Execute(VM_PreparedProgram *Prg);
|
void Execute(VM_PreparedProgram *Prg);
|
||||||
void SetLowEndianValue(uint *Addr,uint Value);
|
void SetLowEndianValue(uint *Addr,uint Value);
|
||||||
void SetMemory(unsigned int Pos,byte *Data,unsigned int DataSize);
|
void SetMemory(size_t Pos,byte *Data,size_t DataSize);
|
||||||
static uint ReadData(BitInput &Inp);
|
static uint ReadData(BitInput &Inp);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,9 @@
|
||||||
#include "rar.hpp"
|
#include "rar.hpp"
|
||||||
|
|
||||||
RawRead::RawRead(ComprDataIO *SrcFile) : Data( SrcFile )
|
RawRead::RawRead(ComprDataIO *SrcFile)
|
||||||
{
|
{
|
||||||
RawRead::SrcFile=SrcFile;
|
RawRead::SrcFile=SrcFile;
|
||||||
ReadPos=0;
|
Reset();
|
||||||
DataSize=0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void RawRead::Reset()
|
void RawRead::Reset()
|
||||||
|
@ -14,73 +13,147 @@ void RawRead::Reset()
|
||||||
Data.Reset();
|
Data.Reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
void RawRead::Read(int Size)
|
size_t RawRead::Read(size_t Size)
|
||||||
{
|
{
|
||||||
|
size_t ReadSize=0;
|
||||||
// (removed decryption)
|
// (removed decryption)
|
||||||
if (Size!=0)
|
if (Size!=0)
|
||||||
{
|
{
|
||||||
Data.Add(Size);
|
Data.Add(Size);
|
||||||
DataSize+=SrcFile->Read(&Data[DataSize],Size);
|
ReadSize=SrcFile->Read(&Data[DataSize],Size);
|
||||||
|
DataSize+=ReadSize;
|
||||||
}
|
}
|
||||||
|
return ReadSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void RawRead::Read(byte *SrcData,size_t Size)
|
||||||
|
|
||||||
void RawRead::Get(byte &Field)
|
|
||||||
{
|
{
|
||||||
if (ReadPos<DataSize)
|
if (Size!=0)
|
||||||
{
|
{
|
||||||
Field=Data[ReadPos];
|
Data.Add(Size);
|
||||||
ReadPos++;
|
memcpy(&Data[DataSize],SrcData,Size);
|
||||||
|
DataSize+=Size;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
Field=0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void RawRead::Get(ushort &Field)
|
byte RawRead::Get1()
|
||||||
|
{
|
||||||
|
return ReadPos<DataSize ? Data[ReadPos++]:0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
ushort RawRead::Get2()
|
||||||
{
|
{
|
||||||
if (ReadPos+1<DataSize)
|
if (ReadPos+1<DataSize)
|
||||||
{
|
{
|
||||||
Field=Data[ReadPos]+(Data[ReadPos+1]<<8);
|
ushort Result=Data[ReadPos]+(Data[ReadPos+1]<<8);
|
||||||
ReadPos+=2;
|
ReadPos+=2;
|
||||||
|
return Result;
|
||||||
}
|
}
|
||||||
else
|
return 0;
|
||||||
Field=0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void RawRead::Get(uint &Field)
|
uint RawRead::Get4()
|
||||||
{
|
{
|
||||||
if (ReadPos+3<DataSize)
|
if (ReadPos+3<DataSize)
|
||||||
{
|
{
|
||||||
Field=Data[ReadPos]+(Data[ReadPos+1]<<8)+(Data[ReadPos+2]<<16)+
|
uint Result=Data[ReadPos]+(Data[ReadPos+1]<<8)+(Data[ReadPos+2]<<16)+
|
||||||
(Data[ReadPos+3]<<24);
|
(Data[ReadPos+3]<<24);
|
||||||
ReadPos+=4;
|
ReadPos+=4;
|
||||||
|
return Result;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
uint64 RawRead::Get8()
|
||||||
|
{
|
||||||
|
uint Low=Get4(),High=Get4();
|
||||||
|
return int32to64(High,Low);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
uint64 RawRead::GetV()
|
||||||
|
{
|
||||||
|
uint64 Result=0;
|
||||||
|
for (uint Shift=0;ReadPos<DataSize;Shift+=7)
|
||||||
|
{
|
||||||
|
byte CurByte=Data[ReadPos++];
|
||||||
|
Result+=uint64(CurByte & 0x7f)<<Shift;
|
||||||
|
if ((CurByte & 0x80)==0)
|
||||||
|
return Result; // Decoded successfully.
|
||||||
|
}
|
||||||
|
return 0; // Out of buffer border.
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Return a number of bytes in current variable length integer.
|
||||||
|
uint RawRead::GetVSize(size_t Pos)
|
||||||
|
{
|
||||||
|
for (size_t CurPos=Pos;CurPos<DataSize;CurPos++)
|
||||||
|
if ((Data[CurPos] & 0x80)==0)
|
||||||
|
return int(CurPos-Pos+1);
|
||||||
|
return 0; // Buffer overflow.
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
size_t RawRead::GetB(void *Field,size_t Size)
|
||||||
|
{
|
||||||
|
byte *F=(byte *)Field;
|
||||||
|
size_t CopySize=Min(DataSize-ReadPos,Size);
|
||||||
|
if (CopySize>0)
|
||||||
|
memcpy(F,&Data[ReadPos],CopySize);
|
||||||
|
if (Size>CopySize)
|
||||||
|
memset(F+CopySize,0,Size-CopySize);
|
||||||
|
ReadPos+=CopySize;
|
||||||
|
return CopySize;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void RawRead::GetW(wchar *Field,size_t Size)
|
||||||
|
{
|
||||||
|
if (ReadPos+2*Size-1<DataSize)
|
||||||
|
{
|
||||||
|
RawToWide(&Data[ReadPos],Field,Size);
|
||||||
|
ReadPos+=sizeof(wchar)*Size;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
Field=0;
|
memset(Field,0,sizeof(wchar)*Size);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
uint RawRead::GetCRC15(bool ProcessedOnly) // RAR 1.5 block CRC.
|
||||||
|
|
||||||
void RawRead::Get(byte *Field,int Size)
|
|
||||||
{
|
{
|
||||||
if (ReadPos+Size-1<DataSize)
|
if (DataSize<=2)
|
||||||
|
return 0;
|
||||||
|
uint HeaderCRC=CRC32(0xffffffff,&Data[2],(ProcessedOnly ? ReadPos:DataSize)-2);
|
||||||
|
return ~HeaderCRC & 0xffff;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
uint RawRead::GetCRC50() // RAR 5.0 block CRC.
|
||||||
{
|
{
|
||||||
memcpy(Field,&Data[ReadPos],Size);
|
if (DataSize<=4)
|
||||||
ReadPos+=Size;
|
return 0xffffffff;
|
||||||
}
|
return CRC32(0xffffffff,&Data[4],DataSize-4) ^ 0xffffffff;
|
||||||
else
|
|
||||||
memset(Field,0,Size);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Read vint from arbitrary byte array.
|
||||||
|
uint64 RawGetV(const byte *Data,uint &ReadPos,uint DataSize,bool &Overflow)
|
||||||
uint RawRead::GetCRC(bool ProcessedOnly)
|
|
||||||
{
|
{
|
||||||
return(DataSize>2 ? CRC(0xffffffff,&Data[2],(ProcessedOnly ? ReadPos:DataSize)-2):0xffffffff);
|
Overflow=false;
|
||||||
|
uint64 Result=0;
|
||||||
|
for (uint Shift=0;ReadPos<DataSize;Shift+=7)
|
||||||
|
{
|
||||||
|
byte CurByte=Data[ReadPos++];
|
||||||
|
Result+=uint64(CurByte & 0x7f)<<Shift;
|
||||||
|
if ((CurByte & 0x80)==0)
|
||||||
|
return Result; // Decoded successfully.
|
||||||
|
}
|
||||||
|
Overflow=true;
|
||||||
|
return 0; // Out of buffer border.
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,20 +6,93 @@ class RawRead
|
||||||
private:
|
private:
|
||||||
Array<byte> Data;
|
Array<byte> Data;
|
||||||
File *SrcFile;
|
File *SrcFile;
|
||||||
int DataSize;
|
size_t DataSize;
|
||||||
int ReadPos;
|
size_t ReadPos;
|
||||||
friend class Archive;
|
|
||||||
public:
|
public:
|
||||||
RawRead(File *SrcFile);
|
RawRead(File *SrcFile);
|
||||||
void Reset();
|
void Reset();
|
||||||
void Read(int Size);
|
size_t Read(size_t Size);
|
||||||
void Get(byte &Field);
|
void Read(byte *SrcData,size_t Size);
|
||||||
void Get(ushort &Field);
|
byte Get1();
|
||||||
void Get(uint &Field);
|
ushort Get2();
|
||||||
void Get(byte *Field,int Size);
|
uint Get4();
|
||||||
uint GetCRC(bool ProcessedOnly);
|
uint64 Get8();
|
||||||
int Size() {return DataSize;}
|
uint64 GetV();
|
||||||
int PaddedSize() {return Data.Size()-DataSize;}
|
uint GetVSize(size_t Pos);
|
||||||
|
size_t GetB(void *Field,size_t Size);
|
||||||
|
void GetW(wchar *Field,size_t Size);
|
||||||
|
uint GetCRC15(bool ProcessedOnly);
|
||||||
|
uint GetCRC50();
|
||||||
|
byte* GetDataPtr() {return &Data[0];}
|
||||||
|
size_t Size() {return DataSize;}
|
||||||
|
size_t PaddedSize() {return Data.Size()-DataSize;}
|
||||||
|
size_t DataLeft() {return DataSize-ReadPos;}
|
||||||
|
size_t GetPos() {return ReadPos;}
|
||||||
|
void SetPos(size_t Pos) {ReadPos=Pos;}
|
||||||
|
void Skip(size_t Size) {ReadPos+=Size;}
|
||||||
|
void Rewind() {SetPos(0);}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
uint64 RawGetV(const byte *Data,uint &ReadPos,uint DataSize,bool &Overflow);
|
||||||
|
|
||||||
|
inline uint RawGet2(const void *Data)
|
||||||
|
{
|
||||||
|
byte *D=(byte *)Data;
|
||||||
|
return D[0]+(D[1]<<8);
|
||||||
|
}
|
||||||
|
|
||||||
|
inline uint RawGet4(const void *Data)
|
||||||
|
{
|
||||||
|
byte *D=(byte *)Data;
|
||||||
|
#if defined(BIG_ENDIAN) || !defined(ALLOW_MISALIGNED) || !defined(PRESENT_INT32)
|
||||||
|
return D[0]+(D[1]<<8)+(D[2]<<16)+(D[3]<<24);
|
||||||
|
#else
|
||||||
|
return GET_UINT32(*(uint32 *)D);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
inline uint64 RawGet8(const void *Data)
|
||||||
|
{
|
||||||
|
byte *D=(byte *)Data;
|
||||||
|
return int32to64(RawGet4(D+4),RawGet4(D));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// We need these "put" functions also in UnRAR code. This is why they are
|
||||||
|
// in rawread.hpp file even though they are "write" functions.
|
||||||
|
inline void RawPut2(uint Field,void *Data)
|
||||||
|
{
|
||||||
|
byte *D=(byte *)Data;
|
||||||
|
D[0]=(byte)(Field);
|
||||||
|
D[1]=(byte)(Field>>8);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
inline void RawPut4(uint Field,void *Data)
|
||||||
|
{
|
||||||
|
byte *D=(byte *)Data;
|
||||||
|
#if defined(BIG_ENDIAN) || !defined(ALLOW_MISALIGNED) || !defined(PRESENT_INT32)
|
||||||
|
D[0]=(byte)(Field);
|
||||||
|
D[1]=(byte)(Field>>8);
|
||||||
|
D[2]=(byte)(Field>>16);
|
||||||
|
D[3]=(byte)(Field>>24);
|
||||||
|
#else
|
||||||
|
*(uint32 *)D=Field;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
inline void RawPut8(uint64 Field,void *Data)
|
||||||
|
{
|
||||||
|
byte *D=(byte *)Data;
|
||||||
|
D[0]=(byte)(Field);
|
||||||
|
D[1]=(byte)(Field>>8);
|
||||||
|
D[2]=(byte)(Field>>16);
|
||||||
|
D[3]=(byte)(Field>>24);
|
||||||
|
D[4]=(byte)(Field>>32);
|
||||||
|
D[5]=(byte)(Field>>40);
|
||||||
|
D[6]=(byte)(Field>>48);
|
||||||
|
D[7]=(byte)(Field>>56);
|
||||||
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -4,12 +4,13 @@
|
||||||
|
|
||||||
1. General
|
1. General
|
||||||
|
|
||||||
This package includes freeware Unrar C++ source and a few makefiles
|
This package includes freeware Unrar C++ source and makefile for
|
||||||
(makefile.bcc, makefile.msc+msc.dep, makefile.unix). Unrar source
|
several Unix compilers.
|
||||||
is subset of RAR and generated from RAR source automatically,
|
|
||||||
|
Unrar source is subset of RAR and generated from RAR source automatically,
|
||||||
by a small program removing blocks like '#ifndef UNRAR ... #endif'.
|
by a small program removing blocks like '#ifndef UNRAR ... #endif'.
|
||||||
Such method is not perfect and you may find some RAR related
|
Such method is not perfect and you may find some RAR related stuff
|
||||||
stuff unnecessary in Unrar, especially in header files.
|
unnecessary in Unrar, especially in header files.
|
||||||
|
|
||||||
If you wish to port Unrar to a new platform, you may need to edit
|
If you wish to port Unrar to a new platform, you may need to edit
|
||||||
'#define LITTLE_ENDIAN' in os.hpp and data type definitions
|
'#define LITTLE_ENDIAN' in os.hpp and data type definitions
|
||||||
|
@ -17,16 +18,10 @@
|
||||||
|
|
||||||
if computer architecture does not allow not aligned data access,
|
if computer architecture does not allow not aligned data access,
|
||||||
you need to undefine ALLOW_NOT_ALIGNED_INT and define
|
you need to undefine ALLOW_NOT_ALIGNED_INT and define
|
||||||
STRICT_ALIGNMENT_REQUIRED in os.h. Note that it will increase memory
|
STRICT_ALIGNMENT_REQUIRED in os.h.
|
||||||
requirements.
|
|
||||||
|
|
||||||
If you use Borland C++ makefile (makefile.bcc), you need to define
|
UnRAR.vcproj and UnRARDll.vcproj are projects for Microsoft Visual C++.
|
||||||
BASEPATHCC environment (or makefile) variable containing
|
UnRARDll.vcproj lets to build unrar.dll library.
|
||||||
the path to Borland C++ installation.
|
|
||||||
|
|
||||||
Makefile.unix contains numerous compiler option sets.
|
|
||||||
GCC Linux is selected by default. If you need to compile Unrar
|
|
||||||
for other platforms, uncomment corresponding lines.
|
|
||||||
|
|
||||||
|
|
||||||
2. Unrar binaries
|
2. Unrar binaries
|
||||||
|
@ -38,16 +33,8 @@
|
||||||
|
|
||||||
3. Acknowledgements
|
3. Acknowledgements
|
||||||
|
|
||||||
This source includes parts of code written by the following authors:
|
This source includes parts of code written by other authors.
|
||||||
|
Please see acknow.txt file for details.
|
||||||
Dmitry Shkarin PPMII v.H text compression
|
|
||||||
Dmitry Subbotin Carryless rangecoder
|
|
||||||
Szymon Stefanek AES encryption
|
|
||||||
Brian Gladman AES encryption
|
|
||||||
Steve Reid SHA-1 hash function
|
|
||||||
Marcus Herbert makefile.unix file
|
|
||||||
Tomasz Klim fixes for libunrar.so
|
|
||||||
Robert Riebisch makefile.dj and patches for DJGPP
|
|
||||||
|
|
||||||
|
|
||||||
4. Legal stuff
|
4. Legal stuff
|
||||||
|
|
|
@ -0,0 +1,18 @@
|
||||||
|
#include "rar.hpp"
|
||||||
|
|
||||||
|
// When we call memset in end of function to clean local variables
|
||||||
|
// for security reason, compiler optimizer can remove such call.
|
||||||
|
// So we use our own function for this purpose.
|
||||||
|
void cleandata(void *data,size_t size)
|
||||||
|
{
|
||||||
|
#if defined(_WIN_ALL) && defined(_MSC_VER)
|
||||||
|
SecureZeroMemory(data,size);
|
||||||
|
#else
|
||||||
|
// 'volatile' is required. Otherwise optimizers can remove this function
|
||||||
|
// if cleaning local variables, which are not used after that.
|
||||||
|
volatile byte *d = (volatile byte *)data;
|
||||||
|
for (size_t i=0;i<size;i++)
|
||||||
|
d[i]=0;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,419 @@
|
||||||
|
#include "rar.hpp"
|
||||||
|
|
||||||
|
#include <ctype.h>
|
||||||
|
|
||||||
|
const char *NullToEmpty(const char *Str)
|
||||||
|
{
|
||||||
|
return Str==NULL ? "":Str;
|
||||||
|
}
|
||||||
|
|
||||||
|
static const wchar Empty[] = {0};
|
||||||
|
|
||||||
|
const wchar *NullToEmpty(const wchar *Str)
|
||||||
|
{
|
||||||
|
return Str==NULL ? Empty:Str;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void IntToExt(const char *Src,char *Dest,size_t DestSize)
|
||||||
|
{
|
||||||
|
#ifdef _WIN_ALL
|
||||||
|
OemToCharBuffA(Src,Dest,(DWORD)DestSize);
|
||||||
|
Dest[DestSize-1]=0;
|
||||||
|
#elif defined(_ANDROID)
|
||||||
|
wchar DestW[NM];
|
||||||
|
UnkToWide(Src,DestW,ASIZE(DestW));
|
||||||
|
WideToChar(DestW,Dest,DestSize);
|
||||||
|
#else
|
||||||
|
if (Dest!=Src)
|
||||||
|
strncpyz(Dest,Src,DestSize);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int stricomp(const char *s1,const char *s2)
|
||||||
|
{
|
||||||
|
#ifdef _WIN_ALL
|
||||||
|
return CompareStringA(LOCALE_USER_DEFAULT,NORM_IGNORECASE|SORT_STRINGSORT,s1,-1,s2,-1)-2;
|
||||||
|
#else
|
||||||
|
while (toupper(*s1)==toupper(*s2))
|
||||||
|
{
|
||||||
|
if (*s1==0)
|
||||||
|
return 0;
|
||||||
|
s1++;
|
||||||
|
s2++;
|
||||||
|
}
|
||||||
|
return s1 < s2 ? -1 : 1;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int strnicomp(const char *s1,const char *s2,size_t n)
|
||||||
|
{
|
||||||
|
#ifdef _WIN_ALL
|
||||||
|
// If we specify 'n' exceeding the actual string length, CompareString goes
|
||||||
|
// beyond the trailing zero and compares garbage. So we need to limit 'n'
|
||||||
|
// to real string length.
|
||||||
|
// It is important to use strnlen (or memchr(...,0)) instead of strlen,
|
||||||
|
// because data can be not zero terminated.
|
||||||
|
size_t l1=Min(strnlen(s1,n),n);
|
||||||
|
size_t l2=Min(strnlen(s2,n),n);
|
||||||
|
return CompareStringA(LOCALE_USER_DEFAULT,NORM_IGNORECASE|SORT_STRINGSORT,s1,(int)l1,s2,(int)l2)-2;
|
||||||
|
#else
|
||||||
|
if (n==0)
|
||||||
|
return 0;
|
||||||
|
while (toupper(*s1)==toupper(*s2))
|
||||||
|
{
|
||||||
|
if (*s1==0 || --n==0)
|
||||||
|
return 0;
|
||||||
|
s1++;
|
||||||
|
s2++;
|
||||||
|
}
|
||||||
|
return s1 < s2 ? -1 : 1;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
wchar* RemoveEOL(wchar *Str)
|
||||||
|
{
|
||||||
|
for (int I=(int)my_wcslen(Str)-1;I>=0 && (Str[I]=='\r' || Str[I]=='\n' || Str[I]==' ' || Str[I]=='\t');I--)
|
||||||
|
Str[I]=0;
|
||||||
|
return Str;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
wchar* RemoveLF(wchar *Str)
|
||||||
|
{
|
||||||
|
for (int I=(int)my_wcslen(Str)-1;I>=0 && (Str[I]=='\r' || Str[I]=='\n');I--)
|
||||||
|
Str[I]=0;
|
||||||
|
return(Str);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
unsigned char loctolower(unsigned char ch)
|
||||||
|
{
|
||||||
|
#ifdef _WIN_ALL
|
||||||
|
// Convert to LPARAM first to avoid a warning in 64 bit mode.
|
||||||
|
return((int)(LPARAM)CharLowerA((LPSTR)ch));
|
||||||
|
#else
|
||||||
|
return(tolower(ch));
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
unsigned char loctoupper(unsigned char ch)
|
||||||
|
{
|
||||||
|
#ifdef _WIN_ALL
|
||||||
|
// Convert to LPARAM first to avoid a warning in 64 bit mode.
|
||||||
|
return((int)(LPARAM)CharUpperA((LPSTR)ch));
|
||||||
|
#else
|
||||||
|
return(toupper(ch));
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// toupper with English only results if English input is provided.
|
||||||
|
// It avoids Turkish (small i) -> (big I with dot) conversion problem.
|
||||||
|
// We do not define 'ch' as 'int' to avoid necessity to cast all
|
||||||
|
// signed chars passed to this function to unsigned char.
|
||||||
|
unsigned char etoupper(unsigned char ch)
|
||||||
|
{
|
||||||
|
if (ch=='i')
|
||||||
|
return('I');
|
||||||
|
return(toupper(ch));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Unicode version of etoupper.
|
||||||
|
wchar etoupperw(wchar ch)
|
||||||
|
{
|
||||||
|
if (ch=='i')
|
||||||
|
return('I');
|
||||||
|
#if defined(__APPLE__) || defined(_MSC_VER)
|
||||||
|
return(toupper(ch));
|
||||||
|
#else
|
||||||
|
return(toupperw(ch));
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// We do not want to cast every signed char to unsigned when passing to
|
||||||
|
// isdigit, so we implement the replacement. Shall work for Unicode too.
|
||||||
|
// If chars are signed, conversion from char to int could generate negative
|
||||||
|
// values, resulting in undefined behavior in standard isdigit.
|
||||||
|
bool IsDigit(int ch)
|
||||||
|
{
|
||||||
|
return(ch>='0' && ch<='9');
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// We do not want to cast every signed char to unsigned when passing to
|
||||||
|
// isspace, so we implement the replacement. Shall work for Unicode too.
|
||||||
|
// If chars are signed, conversion from char to int could generate negative
|
||||||
|
// values, resulting in undefined behavior in standard isspace.
|
||||||
|
bool IsSpace(int ch)
|
||||||
|
{
|
||||||
|
return(ch==' ' || ch=='\t');
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// We do not want to cast every signed char to unsigned when passing to
|
||||||
|
// isalpha, so we implement the replacement. Shall work for Unicode too.
|
||||||
|
// If chars are signed, conversion from char to int could generate negative
|
||||||
|
// values, resulting in undefined behavior in standard function.
|
||||||
|
bool IsAlpha(int ch)
|
||||||
|
{
|
||||||
|
return((ch>='A' && ch<='Z') || (ch>='a' && ch<='z'));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void BinToHex(const byte *Bin,size_t BinSize,char *HexA,wchar *HexW,size_t HexSize)
|
||||||
|
{
|
||||||
|
uint A=0,W=0; // ASCII and Unicode hex output positions.
|
||||||
|
for (uint I=0;I<BinSize;I++)
|
||||||
|
{
|
||||||
|
uint High=Bin[I] >> 4;
|
||||||
|
uint Low=Bin[I] & 0xf;
|
||||||
|
uint HighHex=High>9 ? 'a'+High-10:'0'+High;
|
||||||
|
uint LowHex=Low>9 ? 'a'+Low-10:'0'+Low;
|
||||||
|
if (HexA!=NULL && A<HexSize-2) // Need space for 2 chars and final zero.
|
||||||
|
{
|
||||||
|
HexA[A++]=(char)HighHex;
|
||||||
|
HexA[A++]=(char)LowHex;
|
||||||
|
}
|
||||||
|
if (HexW!=NULL && W<HexSize-2) // Need space for 2 chars and final zero.
|
||||||
|
{
|
||||||
|
HexW[W++]=HighHex;
|
||||||
|
HexW[W++]=LowHex;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (HexA!=NULL && HexSize>0)
|
||||||
|
HexA[A]=0;
|
||||||
|
if (HexW!=NULL && HexSize>0)
|
||||||
|
HexW[W]=0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef SFX_MODULE
|
||||||
|
uint GetDigits(uint Number)
|
||||||
|
{
|
||||||
|
uint Digits=1;
|
||||||
|
while (Number>=10)
|
||||||
|
{
|
||||||
|
Number/=10;
|
||||||
|
Digits++;
|
||||||
|
}
|
||||||
|
return Digits;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
bool LowAscii(const char *Str)
|
||||||
|
{
|
||||||
|
for (int I=0;Str[I]!=0;I++)
|
||||||
|
if ((byte)Str[I]<32 || (byte)Str[I]>127)
|
||||||
|
return false;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool LowAscii(const wchar *Str)
|
||||||
|
{
|
||||||
|
for (int I=0;Str[I]!=0;I++)
|
||||||
|
{
|
||||||
|
// We convert wchar_t to uint just in case if some compiler
|
||||||
|
// uses signed wchar_t.
|
||||||
|
if ((uint)Str[I]<32 || (uint)Str[I]>127)
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int wcsicompc(const wchar *Str1,const wchar *Str2)
|
||||||
|
{
|
||||||
|
#if defined(_UNIX) || defined(_MSC_VER)
|
||||||
|
return my_wcscmp(Str1,Str2);
|
||||||
|
#else
|
||||||
|
return wcsicomp(Str1,Str2);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// safe strncpy: copies maxlen-1 max and always returns zero terminated dest
|
||||||
|
char* strncpyz(char *dest, const char *src, size_t maxlen)
|
||||||
|
{
|
||||||
|
if (maxlen>0)
|
||||||
|
{
|
||||||
|
#if _MSC_VER >= 1300
|
||||||
|
strcpy_s(dest,maxlen-1,src);
|
||||||
|
#else
|
||||||
|
strncpy(dest,src,maxlen-1);
|
||||||
|
#endif
|
||||||
|
dest[maxlen-1]=0;
|
||||||
|
}
|
||||||
|
return dest;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Safe wcsncpy: copies maxlen-1 max and always returns zero terminated dest.
|
||||||
|
wchar* wcsncpyz(wchar *dest, const wchar *src, size_t maxlen)
|
||||||
|
{
|
||||||
|
if (maxlen>0)
|
||||||
|
{
|
||||||
|
my_wcsncpy(dest,src,maxlen-1);
|
||||||
|
dest[maxlen-1]=0;
|
||||||
|
}
|
||||||
|
return dest;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Safe strncat: resulting dest length cannot exceed maxlen and dest
|
||||||
|
// is always zero terminated. Note that 'maxlen' parameter defines the entire
|
||||||
|
// dest buffer size and is not compatible with standard strncat.
|
||||||
|
char* strncatz(char* dest, const char* src, size_t maxlen)
|
||||||
|
{
|
||||||
|
size_t Length = strlen(dest);
|
||||||
|
if (Length + 1 < maxlen)
|
||||||
|
#if _MSC_VER >= 1300
|
||||||
|
strcat_s(dest, maxlen - Length - 1, src);
|
||||||
|
#else
|
||||||
|
strncat(dest, src, maxlen - Length - 1);
|
||||||
|
#endif
|
||||||
|
return dest;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Safe wcsncat: resulting dest length cannot exceed maxlen and dest
|
||||||
|
// is always zero terminated. Note that 'maxlen' parameter defines the entire
|
||||||
|
// dest buffer size and is not compatible with standard wcsncat.
|
||||||
|
wchar* wcsncatz(wchar* dest, const wchar* src, size_t maxlen)
|
||||||
|
{
|
||||||
|
size_t Length = my_wcslen(dest);
|
||||||
|
if (Length + 1 < maxlen)
|
||||||
|
my_wcsncat(dest, src, maxlen - Length - 1);
|
||||||
|
return dest;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void itoa(int64 n,char *Str)
|
||||||
|
{
|
||||||
|
char NumStr[50];
|
||||||
|
size_t Pos=0;
|
||||||
|
|
||||||
|
do
|
||||||
|
{
|
||||||
|
NumStr[Pos++]=char(n%10)+'0';
|
||||||
|
n=n/10;
|
||||||
|
} while (n!=0);
|
||||||
|
|
||||||
|
for (size_t I=0;I<Pos;I++)
|
||||||
|
Str[I]=NumStr[Pos-I-1];
|
||||||
|
Str[Pos]=0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void itoa(int64 n,wchar *Str)
|
||||||
|
{
|
||||||
|
wchar NumStr[50];
|
||||||
|
size_t Pos=0;
|
||||||
|
|
||||||
|
do
|
||||||
|
{
|
||||||
|
NumStr[Pos++]=wchar(n%10)+'0';
|
||||||
|
n=n/10;
|
||||||
|
} while (n!=0);
|
||||||
|
|
||||||
|
for (size_t I=0;I<Pos;I++)
|
||||||
|
Str[I]=NumStr[Pos-I-1];
|
||||||
|
Str[Pos]=0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const wchar* GetWide(const char *Src)
|
||||||
|
{
|
||||||
|
const size_t MaxLength=NM;
|
||||||
|
static wchar StrTable[4][MaxLength];
|
||||||
|
static uint StrNum=0;
|
||||||
|
if (++StrNum >= ASIZE(StrTable))
|
||||||
|
StrNum=0;
|
||||||
|
wchar *Str=StrTable[StrNum];
|
||||||
|
CharToWide(Src,Str,MaxLength);
|
||||||
|
Str[MaxLength-1]=0;
|
||||||
|
return Str;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Parse string containing parameters separated with spaces.
|
||||||
|
// Support quote marks. Param can be NULL to return the pointer to next
|
||||||
|
// parameter, which can be used to estimate the buffer size for Param.
|
||||||
|
const wchar* GetCmdParam(const wchar *CmdLine,wchar *Param,size_t MaxSize)
|
||||||
|
{
|
||||||
|
while (IsSpace(*CmdLine))
|
||||||
|
CmdLine++;
|
||||||
|
if (*CmdLine==0)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
size_t ParamSize=0;
|
||||||
|
bool Quote=false;
|
||||||
|
while (*CmdLine!=0 && (Quote || !IsSpace(*CmdLine)))
|
||||||
|
{
|
||||||
|
if (*CmdLine=='\"')
|
||||||
|
{
|
||||||
|
if (CmdLine[1]=='\"')
|
||||||
|
{
|
||||||
|
// Insert the quote character instead of two adjoining quote characters.
|
||||||
|
if (Param!=NULL && ParamSize<MaxSize-1)
|
||||||
|
Param[ParamSize++]='\"';
|
||||||
|
CmdLine++;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
Quote=!Quote;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
if (Param!=NULL && ParamSize<MaxSize-1)
|
||||||
|
Param[ParamSize++]=*CmdLine;
|
||||||
|
CmdLine++;
|
||||||
|
}
|
||||||
|
if (Param!=NULL)
|
||||||
|
Param[ParamSize]=0;
|
||||||
|
return CmdLine;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef SILENT
|
||||||
|
// For compatibility with existing translations we use %s to print Unicode
|
||||||
|
// strings in format strings and convert them to %ls here. %s could work
|
||||||
|
// without such conversion in Windows, but not in Unix wprintf.
|
||||||
|
void PrintfPrepareFmt(const wchar *Org,wchar *Cvt,size_t MaxSize)
|
||||||
|
{
|
||||||
|
uint Src=0,Dest=0;
|
||||||
|
while (Org[Src]!=0 && Dest<MaxSize-1)
|
||||||
|
{
|
||||||
|
if (Org[Src]=='%' && (Src==0 || Org[Src-1]!='%'))
|
||||||
|
{
|
||||||
|
uint SPos=Src+1;
|
||||||
|
// Skipping a possible width specifier like %-50s.
|
||||||
|
while (IsDigit(Org[SPos]) || Org[SPos]=='-')
|
||||||
|
SPos++;
|
||||||
|
if (Org[SPos]=='s' && Dest<MaxSize-(SPos-Src+1))
|
||||||
|
{
|
||||||
|
while (Src<SPos)
|
||||||
|
Cvt[Dest++]=Org[Src++];
|
||||||
|
Cvt[Dest++]='l';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#ifdef _WIN_ALL
|
||||||
|
// Convert \n to \r\n in Windows. Important when writing to log,
|
||||||
|
// so other tools like Notebook can view resulting log properly.
|
||||||
|
if (Org[Src]=='\n' && (Src==0 || Org[Src-1]!='\r'))
|
||||||
|
Cvt[Dest++]='\r';
|
||||||
|
#endif
|
||||||
|
|
||||||
|
Cvt[Dest++]=Org[Src++];
|
||||||
|
}
|
||||||
|
Cvt[Dest]=0;
|
||||||
|
}
|
||||||
|
#endif
|
|
@ -0,0 +1,45 @@
|
||||||
|
#ifndef _RAR_STRFN_
|
||||||
|
#define _RAR_STRFN_
|
||||||
|
|
||||||
|
const char* NullToEmpty(const char *Str);
|
||||||
|
const wchar* NullToEmpty(const wchar *Str);
|
||||||
|
void IntToExt(const char *Src,char *Dest,size_t DestSize);
|
||||||
|
int stricomp(const char *s1,const char *s2);
|
||||||
|
int strnicomp(const char *s1,const char *s2,size_t n);
|
||||||
|
wchar* RemoveEOL(wchar *Str);
|
||||||
|
wchar* RemoveLF(wchar *Str);
|
||||||
|
unsigned char loctolower(unsigned char ch);
|
||||||
|
unsigned char loctoupper(unsigned char ch);
|
||||||
|
|
||||||
|
char* strncpyz(char *dest, const char *src, size_t maxlen);
|
||||||
|
wchar* wcsncpyz(wchar *dest, const wchar *src, size_t maxlen);
|
||||||
|
char* strncatz(char* dest, const char* src, size_t maxlen);
|
||||||
|
wchar* wcsncatz(wchar* dest, const wchar* src, size_t maxlen);
|
||||||
|
|
||||||
|
unsigned char etoupper(unsigned char ch);
|
||||||
|
wchar etoupperw(wchar ch);
|
||||||
|
|
||||||
|
bool IsDigit(int ch);
|
||||||
|
bool IsSpace(int ch);
|
||||||
|
bool IsAlpha(int ch);
|
||||||
|
|
||||||
|
void BinToHex(const byte *Bin,size_t BinSize,char *Hex,wchar *HexW,size_t HexSize);
|
||||||
|
|
||||||
|
#ifndef SFX_MODULE
|
||||||
|
uint GetDigits(uint Number);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
bool LowAscii(const char *Str);
|
||||||
|
bool LowAscii(const wchar *Str);
|
||||||
|
|
||||||
|
int wcsicompc(const wchar *Str1,const wchar *Str2);
|
||||||
|
|
||||||
|
void itoa(int64 n,char *Str);
|
||||||
|
void itoa(int64 n,wchar *Str);
|
||||||
|
const wchar* GetWide(const char *Src);
|
||||||
|
const wchar* GetCmdParam(const wchar *CmdLine,wchar *Param,size_t MaxSize);
|
||||||
|
#ifndef SILENT
|
||||||
|
void PrintfPrepareFmt(const wchar *Org,wchar *Cvt,size_t MaxSize);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif
|
|
@ -7,6 +7,9 @@
|
||||||
|
|
||||||
// #included by unpack.cpp
|
// #included by unpack.cpp
|
||||||
#ifdef RAR_COMMON_HPP
|
#ifdef RAR_COMMON_HPP
|
||||||
|
static const uint UNIT_SIZE=Max(sizeof(RARPPM_CONTEXT),sizeof(RARPPM_MEM_BLK));
|
||||||
|
static const uint FIXED_UNIT_SIZE=12;
|
||||||
|
|
||||||
SubAllocator::SubAllocator()
|
SubAllocator::SubAllocator()
|
||||||
{
|
{
|
||||||
Clean();
|
Clean();
|
||||||
|
@ -41,12 +44,12 @@ inline uint SubAllocator::U2B(int NU)
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
calculate RAR_MEM_BLK + Items address. Real RAR_MEM_BLK size must be
|
calculate RARPPM_MEM_BLK + Items address. Real RARPPM_MEM_BLK size must be
|
||||||
equal to UNIT_SIZE, so we cannot just add Items to RAR_MEM_BLK address
|
equal to UNIT_SIZE, so we cannot just add Items to RARPPM_MEM_BLK address
|
||||||
*/
|
*/
|
||||||
inline RAR_MEM_BLK* SubAllocator::MBPtr(RAR_MEM_BLK *BasePtr,int Items)
|
inline RARPPM_MEM_BLK* SubAllocator::MBPtr(RARPPM_MEM_BLK *BasePtr,int Items)
|
||||||
{
|
{
|
||||||
return((RAR_MEM_BLK*)( ((byte *)(BasePtr))+U2B(Items) ));
|
return((RARPPM_MEM_BLK*)( ((byte *)(BasePtr))+U2B(Items) ));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -102,9 +105,9 @@ void SubAllocator::InitSubAllocator()
|
||||||
int i, k;
|
int i, k;
|
||||||
memset(FreeList,0,sizeof(FreeList));
|
memset(FreeList,0,sizeof(FreeList));
|
||||||
pText=HeapStart;
|
pText=HeapStart;
|
||||||
uint Size2=FIXED_UNIT_SIZE*(SubAllocatorSize/8/FIXED_UNIT_SIZE*7);
|
uint Size2=(uint)(FIXED_UNIT_SIZE*(SubAllocatorSize/8/FIXED_UNIT_SIZE*7));
|
||||||
uint RealSize2=Size2/FIXED_UNIT_SIZE*UNIT_SIZE;
|
uint RealSize2=Size2/FIXED_UNIT_SIZE*UNIT_SIZE;
|
||||||
uint Size1=SubAllocatorSize-Size2;
|
uint Size1=(uint)(SubAllocatorSize-Size2);
|
||||||
uint RealSize1=Size1/FIXED_UNIT_SIZE*UNIT_SIZE+Size1%FIXED_UNIT_SIZE;
|
uint RealSize1=Size1/FIXED_UNIT_SIZE*UNIT_SIZE+Size1%FIXED_UNIT_SIZE;
|
||||||
#ifdef STRICT_ALIGNMENT_REQUIRED
|
#ifdef STRICT_ALIGNMENT_REQUIRED
|
||||||
if (Size1%FIXED_UNIT_SIZE!=0)
|
if (Size1%FIXED_UNIT_SIZE!=0)
|
||||||
|
@ -132,14 +135,14 @@ void SubAllocator::InitSubAllocator()
|
||||||
|
|
||||||
inline void SubAllocator::GlueFreeBlocks()
|
inline void SubAllocator::GlueFreeBlocks()
|
||||||
{
|
{
|
||||||
RAR_MEM_BLK s0, * p, * p1;
|
RARPPM_MEM_BLK s0, * p, * p1;
|
||||||
int i, k, sz;
|
int i, k, sz;
|
||||||
if (LoUnit != HiUnit)
|
if (LoUnit != HiUnit)
|
||||||
*LoUnit=0;
|
*LoUnit=0;
|
||||||
for (i=0, s0.next=s0.prev=&s0;i < N_INDEXES;i++)
|
for (i=0, s0.next=s0.prev=&s0;i < N_INDEXES;i++)
|
||||||
while ( FreeList[i].next )
|
while ( FreeList[i].next )
|
||||||
{
|
{
|
||||||
p=(RAR_MEM_BLK*)RemoveNode(i);
|
p=(RARPPM_MEM_BLK*)RemoveNode(i);
|
||||||
p->insertAt(&s0);
|
p->insertAt(&s0);
|
||||||
p->Stamp=0xFFFF;
|
p->Stamp=0xFFFF;
|
||||||
p->NU=Indx2Units[i];
|
p->NU=Indx2Units[i];
|
||||||
|
|
|
@ -10,21 +10,21 @@
|
||||||
const int N1=4, N2=4, N3=4, N4=(128+3-1*N1-2*N2-3*N3)/4;
|
const int N1=4, N2=4, N3=4, N4=(128+3-1*N1-2*N2-3*N3)/4;
|
||||||
const int N_INDEXES=N1+N2+N3+N4;
|
const int N_INDEXES=N1+N2+N3+N4;
|
||||||
|
|
||||||
#if defined(__GNUC__) && !defined(STRICT_ALIGNMENT_REQUIRED)
|
#if defined(__GNUC__) && defined(ALLOW_MISALIGNED)
|
||||||
#define _PACK_ATTR __attribute__ ((packed))
|
#define RARPPM_PACK_ATTR __attribute__ ((packed))
|
||||||
#else
|
#else
|
||||||
#define _PACK_ATTR
|
#define RARPPM_PACK_ATTR
|
||||||
#endif /* defined(__GNUC__) */
|
#endif /* defined(__GNUC__) */
|
||||||
|
|
||||||
#ifndef STRICT_ALIGNMENT_REQUIRED
|
#ifdef ALLOW_MISALIGNED
|
||||||
#pragma pack(1)
|
#pragma pack(1)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
struct RAR_MEM_BLK
|
struct RARPPM_MEM_BLK
|
||||||
{
|
{
|
||||||
ushort Stamp, NU;
|
ushort Stamp, NU;
|
||||||
RAR_MEM_BLK* next, * prev;
|
RARPPM_MEM_BLK* next, * prev;
|
||||||
void insertAt(RAR_MEM_BLK* p)
|
void insertAt(RARPPM_MEM_BLK* p)
|
||||||
{
|
{
|
||||||
next=(prev=p)->next;
|
next=(prev=p)->next;
|
||||||
p->next=next->prev=this;
|
p->next=next->prev=this;
|
||||||
|
@ -34,9 +34,9 @@ struct RAR_MEM_BLK
|
||||||
prev->next=next;
|
prev->next=next;
|
||||||
next->prev=prev;
|
next->prev=prev;
|
||||||
}
|
}
|
||||||
} _PACK_ATTR;
|
} RARPPM_PACK_ATTR;
|
||||||
|
|
||||||
#ifndef STRICT_ALIGNMENT_REQUIRED
|
#ifndef ALLOW_MISALIGNED
|
||||||
#ifdef _AIX
|
#ifdef _AIX
|
||||||
#pragma pack(pop)
|
#pragma pack(pop)
|
||||||
#else
|
#else
|
||||||
|
@ -60,7 +60,7 @@ class SubAllocator
|
||||||
uint GetUsedMemory();
|
uint GetUsedMemory();
|
||||||
inline void GlueFreeBlocks();
|
inline void GlueFreeBlocks();
|
||||||
void* AllocUnitsRare(int indx);
|
void* AllocUnitsRare(int indx);
|
||||||
inline RAR_MEM_BLK* MBPtr(RAR_MEM_BLK *BasePtr,int Items);
|
inline RARPPM_MEM_BLK* MBPtr(RARPPM_MEM_BLK *BasePtr,int Items);
|
||||||
|
|
||||||
long SubAllocatorSize;
|
long SubAllocatorSize;
|
||||||
byte Indx2Units[N_INDEXES], Units2Indx[128], GlueCount;
|
byte Indx2Units[N_INDEXES], Units2Indx[128], GlueCount;
|
||||||
|
|
|
@ -0,0 +1,257 @@
|
||||||
|
#include "rar.hpp"
|
||||||
|
|
||||||
|
#ifdef _WIN_ALL
|
||||||
|
#include <Windows.h>
|
||||||
|
RarTime& RarTime::operator =(FILETIME &ft)
|
||||||
|
{
|
||||||
|
_ULARGE_INTEGER ul = {ft.dwLowDateTime, ft.dwHighDateTime};
|
||||||
|
itime=ul.QuadPart;
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void RarTime::GetWin32(FILETIME *ft)
|
||||||
|
{
|
||||||
|
_ULARGE_INTEGER ul;
|
||||||
|
ul.QuadPart=itime;
|
||||||
|
ft->dwLowDateTime=ul.LowPart;
|
||||||
|
ft->dwHighDateTime=ul.HighPart;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
RarTime& RarTime::operator =(time_t ut)
|
||||||
|
{
|
||||||
|
uint64 ushift=int32to64(0x19DB1DE,0xD53E8000); // 116444736000000000.
|
||||||
|
itime=uint64(ut)*10000000+ushift;
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
time_t RarTime::GetUnix()
|
||||||
|
{
|
||||||
|
uint64 ushift=int32to64(0x19DB1DE,0xD53E8000); // 116444736000000000.
|
||||||
|
time_t ut=(itime-ushift)/10000000;
|
||||||
|
return ut;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void RarTime::GetLocal(RarLocalTime *lt)
|
||||||
|
{
|
||||||
|
#ifdef _WIN_ALL
|
||||||
|
FILETIME ft;
|
||||||
|
GetWin32(&ft);
|
||||||
|
FILETIME lft;
|
||||||
|
|
||||||
|
// SystemTimeToTzSpecificLocalTime based code produces 1 hour error on XP.
|
||||||
|
FileTimeToLocalFileTime(&ft,&lft);
|
||||||
|
|
||||||
|
SYSTEMTIME st;
|
||||||
|
FileTimeToSystemTime(&lft,&st);
|
||||||
|
lt->Year=st.wYear;
|
||||||
|
lt->Month=st.wMonth;
|
||||||
|
lt->Day=st.wDay;
|
||||||
|
lt->Hour=st.wHour;
|
||||||
|
lt->Minute=st.wMinute;
|
||||||
|
lt->Second=st.wSecond;
|
||||||
|
lt->wDay=st.wDayOfWeek;
|
||||||
|
lt->yDay=lt->Day-1;
|
||||||
|
|
||||||
|
static int mdays[12]={31,28,31,30,31,30,31,31,30,31,30,31};
|
||||||
|
for (uint I=1;I<lt->Month && I<=ASIZE(mdays);I++)
|
||||||
|
lt->yDay+=mdays[I-1];
|
||||||
|
|
||||||
|
if (lt->Month>2 && IsLeapYear(lt->Year))
|
||||||
|
lt->yDay++;
|
||||||
|
|
||||||
|
st.wMilliseconds=0;
|
||||||
|
FILETIME zft;
|
||||||
|
SystemTimeToFileTime(&st,&zft);
|
||||||
|
|
||||||
|
// Calculate the time reminder, which is the part of time smaller
|
||||||
|
// than 1 second, represented in 100-nanosecond intervals.
|
||||||
|
lt->Reminder=int32to64(lft.dwHighDateTime,lft.dwLowDateTime)-
|
||||||
|
int32to64(zft.dwHighDateTime,zft.dwLowDateTime);
|
||||||
|
#else
|
||||||
|
time_t ut=GetUnix();
|
||||||
|
struct tm *t;
|
||||||
|
t=localtime(&ut);
|
||||||
|
|
||||||
|
lt->Year=t->tm_year+1900;
|
||||||
|
lt->Month=t->tm_mon+1;
|
||||||
|
lt->Day=t->tm_mday;
|
||||||
|
lt->Hour=t->tm_hour;
|
||||||
|
lt->Minute=t->tm_min;
|
||||||
|
lt->Second=t->tm_sec;
|
||||||
|
lt->Reminder=itime % 10000000;
|
||||||
|
lt->wDay=t->tm_wday;
|
||||||
|
lt->yDay=t->tm_yday;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void RarTime::SetLocal(RarLocalTime *lt)
|
||||||
|
{
|
||||||
|
#ifdef _WIN_ALL
|
||||||
|
SYSTEMTIME st;
|
||||||
|
st.wYear=lt->Year;
|
||||||
|
st.wMonth=lt->Month;
|
||||||
|
st.wDay=lt->Day;
|
||||||
|
st.wHour=lt->Hour;
|
||||||
|
st.wMinute=lt->Minute;
|
||||||
|
st.wSecond=lt->Second;
|
||||||
|
st.wMilliseconds=0;
|
||||||
|
FILETIME lft;
|
||||||
|
if (SystemTimeToFileTime(&st,&lft))
|
||||||
|
{
|
||||||
|
lft.dwLowDateTime+=lt->Reminder;
|
||||||
|
if (lft.dwLowDateTime<lt->Reminder)
|
||||||
|
lft.dwHighDateTime++;
|
||||||
|
|
||||||
|
FILETIME ft;
|
||||||
|
|
||||||
|
// TzSpecificLocalTimeToSystemTime based code produces 1 hour error on XP.
|
||||||
|
LocalFileTimeToFileTime(&lft,&ft);
|
||||||
|
|
||||||
|
*this=ft;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
Reset();
|
||||||
|
#else
|
||||||
|
struct tm t;
|
||||||
|
|
||||||
|
t.tm_sec=lt->Second;
|
||||||
|
t.tm_min=lt->Minute;
|
||||||
|
t.tm_hour=lt->Hour;
|
||||||
|
t.tm_mday=lt->Day;
|
||||||
|
t.tm_mon=lt->Month-1;
|
||||||
|
t.tm_year=lt->Year-1900;
|
||||||
|
t.tm_isdst=-1;
|
||||||
|
*this=mktime(&t);
|
||||||
|
itime+=lt->Reminder;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Return the stored time as 64-bit number of 100-nanosecond intervals since
|
||||||
|
// 01.01.1601. Actually we do not care since which date this time starts from
|
||||||
|
// as long as this date is the same for GetRaw and SetRaw. We use the value
|
||||||
|
// returned by GetRaw() for time comparisons, for relative operations
|
||||||
|
// like SetRaw(GetRaw()-C) and for compact time storage when necessary.
|
||||||
|
uint64 RarTime::GetRaw()
|
||||||
|
{
|
||||||
|
return itime;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void RarTime::SetRaw(uint64 RawTime)
|
||||||
|
{
|
||||||
|
itime=RawTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
uint RarTime::GetDos()
|
||||||
|
{
|
||||||
|
RarLocalTime lt;
|
||||||
|
GetLocal(<);
|
||||||
|
uint DosTime=(lt.Second/2)|(lt.Minute<<5)|(lt.Hour<<11)|
|
||||||
|
(lt.Day<<16)|(lt.Month<<21)|((lt.Year-1980)<<25);
|
||||||
|
return DosTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void RarTime::SetDos(uint DosTime)
|
||||||
|
{
|
||||||
|
RarLocalTime lt;
|
||||||
|
lt.Second=(DosTime & 0x1f)*2;
|
||||||
|
lt.Minute=(DosTime>>5) & 0x3f;
|
||||||
|
lt.Hour=(DosTime>>11) & 0x1f;
|
||||||
|
lt.Day=(DosTime>>16) & 0x1f;
|
||||||
|
lt.Month=(DosTime>>21) & 0x0f;
|
||||||
|
lt.Year=(DosTime>>25)+1980;
|
||||||
|
lt.Reminder=0;
|
||||||
|
SetLocal(<);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef SFX_MODULE
|
||||||
|
void RarTime::SetIsoText(const wchar *TimeText)
|
||||||
|
{
|
||||||
|
int Field[6];
|
||||||
|
memset(Field,0,sizeof(Field));
|
||||||
|
for (uint DigitCount=0;*TimeText!=0;TimeText++)
|
||||||
|
if (IsDigit(*TimeText))
|
||||||
|
{
|
||||||
|
int FieldPos=DigitCount<4 ? 0:(DigitCount-4)/2+1;
|
||||||
|
if (FieldPos<ASIZE(Field))
|
||||||
|
Field[FieldPos]=Field[FieldPos]*10+*TimeText-'0';
|
||||||
|
DigitCount++;
|
||||||
|
}
|
||||||
|
RarLocalTime lt;
|
||||||
|
lt.Second=Field[5];
|
||||||
|
lt.Minute=Field[4];
|
||||||
|
lt.Hour=Field[3];
|
||||||
|
lt.Day=Field[2]==0 ? 1:Field[2];
|
||||||
|
lt.Month=Field[1]==0 ? 1:Field[1];
|
||||||
|
lt.Year=Field[0];
|
||||||
|
lt.Reminder=0;
|
||||||
|
SetLocal(<);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef SFX_MODULE
|
||||||
|
void RarTime::SetAgeText(const wchar *TimeText)
|
||||||
|
{
|
||||||
|
uint Seconds=0,Value=0;
|
||||||
|
for (int I=0;TimeText[I]!=0;I++)
|
||||||
|
{
|
||||||
|
int Ch=TimeText[I];
|
||||||
|
if (IsDigit(Ch))
|
||||||
|
Value=Value*10+Ch-'0';
|
||||||
|
else
|
||||||
|
{
|
||||||
|
switch(etoupper(Ch))
|
||||||
|
{
|
||||||
|
case 'D':
|
||||||
|
Seconds+=Value*24*3600;
|
||||||
|
break;
|
||||||
|
case 'H':
|
||||||
|
Seconds+=Value*3600;
|
||||||
|
break;
|
||||||
|
case 'M':
|
||||||
|
Seconds+=Value*60;
|
||||||
|
break;
|
||||||
|
case 'S':
|
||||||
|
Seconds+=Value;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
Value=0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
SetCurrentTime();
|
||||||
|
SetRaw(itime-uint64(Seconds)*10000000);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
void RarTime::SetCurrentTime()
|
||||||
|
{
|
||||||
|
#ifdef _WIN_ALL
|
||||||
|
FILETIME ft;
|
||||||
|
SYSTEMTIME st;
|
||||||
|
GetSystemTime(&st);
|
||||||
|
SystemTimeToFileTime(&st,&ft);
|
||||||
|
*this=ft;
|
||||||
|
#else
|
||||||
|
time_t st;
|
||||||
|
time(&st);
|
||||||
|
*this=st;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool IsLeapYear(int Year)
|
||||||
|
{
|
||||||
|
return (Year&3)==0 && (Year%100!=0 || Year%400==0);
|
||||||
|
}
|
|
@ -0,0 +1,59 @@
|
||||||
|
#ifndef _RAR_TIMEFN_
|
||||||
|
#define _RAR_TIMEFN_
|
||||||
|
|
||||||
|
#include <time.h>
|
||||||
|
#ifdef _WIN_ALL
|
||||||
|
#include <Windows.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
struct RarLocalTime
|
||||||
|
{
|
||||||
|
uint Year;
|
||||||
|
uint Month;
|
||||||
|
uint Day;
|
||||||
|
uint Hour;
|
||||||
|
uint Minute;
|
||||||
|
uint Second;
|
||||||
|
uint Reminder; // Part of time smaller than 1 second, represented in 100-nanosecond intervals.
|
||||||
|
uint wDay;
|
||||||
|
uint yDay;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
class RarTime
|
||||||
|
{
|
||||||
|
private:
|
||||||
|
// Internal FILETIME like time representation in 100 nanoseconds
|
||||||
|
// since 01.01.1601.
|
||||||
|
uint64 itime;
|
||||||
|
public:
|
||||||
|
RarTime() {Reset();}
|
||||||
|
#ifdef _WIN_ALL
|
||||||
|
RarTime(FILETIME &ft) {*this=ft;}
|
||||||
|
RarTime& operator =(FILETIME &ft);
|
||||||
|
void GetWin32(FILETIME *ft);
|
||||||
|
#endif
|
||||||
|
RarTime(time_t ut) {*this=ut;}
|
||||||
|
RarTime& operator =(time_t ut);
|
||||||
|
time_t GetUnix();
|
||||||
|
bool operator == (RarTime &rt) {return itime==rt.itime;}
|
||||||
|
bool operator < (RarTime &rt) {return itime<rt.itime;}
|
||||||
|
bool operator <= (RarTime &rt) {return itime<rt.itime || itime==rt.itime;}
|
||||||
|
bool operator > (RarTime &rt) {return itime>rt.itime;}
|
||||||
|
bool operator >= (RarTime &rt) {return itime>rt.itime || itime==rt.itime;}
|
||||||
|
void GetLocal(RarLocalTime *lt);
|
||||||
|
void SetLocal(RarLocalTime *lt);
|
||||||
|
uint64 GetRaw();
|
||||||
|
void SetRaw(uint64 RawTime);
|
||||||
|
uint GetDos();
|
||||||
|
void SetDos(uint DosTime);
|
||||||
|
void SetIsoText(const wchar *TimeText);
|
||||||
|
void SetAgeText(const wchar *TimeText);
|
||||||
|
void SetCurrentTime();
|
||||||
|
void Reset() {itime=0;}
|
||||||
|
bool IsSet() {return itime!=0;}
|
||||||
|
};
|
||||||
|
|
||||||
|
bool IsLeapYear(int Year);
|
||||||
|
|
||||||
|
#endif
|
|
@ -2,6 +2,48 @@
|
||||||
|
|
||||||
#include "unicode.hpp"
|
#include "unicode.hpp"
|
||||||
|
|
||||||
|
bool CharToWide(const char *Src,wchar *Dest,int DestSize)
|
||||||
|
{
|
||||||
|
bool RetCode=true;
|
||||||
|
#ifdef _WIN_32
|
||||||
|
if (MultiByteToWideChar(CP_ACP,0,Src,-1,Dest,DestSize,NULL,NULL)==0)
|
||||||
|
RetCode=false;
|
||||||
|
#else
|
||||||
|
#ifdef _APPLE
|
||||||
|
UtfToWide(Src,Dest,DestSize);
|
||||||
|
#else
|
||||||
|
#ifdef MBFUNCTIONS
|
||||||
|
|
||||||
|
size_t ResultingSize=mbstowcs(Dest,Src,DestSize);
|
||||||
|
if (ResultingSize==(size_t)-1)
|
||||||
|
RetCode=false;
|
||||||
|
if (ResultingSize==0 && *Src!=0)
|
||||||
|
RetCode=false;
|
||||||
|
|
||||||
|
if ((!RetCode || *Dest==0 && *Src!=0) && DestSize>NM && strlen(Src)<NM)
|
||||||
|
{
|
||||||
|
/* Workaround for strange Linux Unicode functions bug.
|
||||||
|
Some of wcstombs and mbstowcs implementations in some situations
|
||||||
|
(we are yet to find out what it depends on) can return an empty
|
||||||
|
string and success code if buffer size value is too large.
|
||||||
|
*/
|
||||||
|
return(CharToWide(Src,Dest,NM));
|
||||||
|
}
|
||||||
|
|
||||||
|
#else
|
||||||
|
// TODO: convert to UTF-8? Would need conversion routine. Ugh.
|
||||||
|
for (int I=0;I<DestSize;I++)
|
||||||
|
{
|
||||||
|
Dest[I]=(wchar)Src[I];
|
||||||
|
if (Src[I]==0)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
return(RetCode);
|
||||||
|
}
|
||||||
|
|
||||||
bool WideToChar(const wchar *Src,char *Dest,int DestSize)
|
bool WideToChar(const wchar *Src,char *Dest,int DestSize)
|
||||||
{
|
{
|
||||||
bool RetCode=true;
|
bool RetCode=true;
|
||||||
|
@ -94,6 +136,15 @@ void UtfToWide(const char *Src,wchar *Dest,int DestSize)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
wchar* RawToWide(const byte *Src,wchar *Dest,size_t DestSize)
|
||||||
|
{
|
||||||
|
for (size_t I=0;I<DestSize;I++)
|
||||||
|
if ((Dest[I]=Src[I*2]+(Src[I*2+1]<<8))==0)
|
||||||
|
break;
|
||||||
|
return Dest;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// strfn.cpp
|
// strfn.cpp
|
||||||
void ExtToInt(const char *Src,char *Dest)
|
void ExtToInt(const char *Src,char *Dest)
|
||||||
{
|
{
|
||||||
|
@ -104,3 +155,44 @@ void ExtToInt(const char *Src,char *Dest)
|
||||||
strcpy(Dest,Src);
|
strcpy(Dest,Src);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
size_t my_wcslen(const wchar *a)
|
||||||
|
{
|
||||||
|
size_t I;
|
||||||
|
for (I=0; a[I]; ++I);
|
||||||
|
return I;
|
||||||
|
}
|
||||||
|
|
||||||
|
int my_wcsncmp(const wchar *a, const wchar *b, size_t Max)
|
||||||
|
{
|
||||||
|
for (size_t I=0; I<Max && (a[I] || b[I]); ++I)
|
||||||
|
{
|
||||||
|
if (a[I] != b[I])
|
||||||
|
return a[I] - b[I];
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int my_wcscmp(const wchar *a, const wchar *b)
|
||||||
|
{
|
||||||
|
return my_wcsncmp(a, b, ~0UL);
|
||||||
|
}
|
||||||
|
|
||||||
|
void my_wcsncpy(wchar *Dest, const wchar *Src, size_t DestSize)
|
||||||
|
{
|
||||||
|
size_t I;
|
||||||
|
for (I=0; I<DestSize && Src[I]; ++I)
|
||||||
|
Dest[I] = Src[I];
|
||||||
|
if (I<DestSize)
|
||||||
|
Dest[I] = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void my_wcsncat(wchar *Dest, const wchar *Src, size_t DestSize)
|
||||||
|
{
|
||||||
|
size_t I, J;
|
||||||
|
for (I=0; I<DestSize && Dest[I]; ++I);
|
||||||
|
for (J=0; I<DestSize && Src[J]; ++I, ++J)
|
||||||
|
Dest[I] = Src[J];
|
||||||
|
if (I<DestSize)
|
||||||
|
Dest[I] = 0;
|
||||||
|
}
|
||||||
|
|
|
@ -1,10 +1,18 @@
|
||||||
#ifndef _RAR_UNICODE_
|
#ifndef _RAR_UNICODE_
|
||||||
#define _RAR_UNICODE_
|
#define _RAR_UNICODE_
|
||||||
|
|
||||||
|
bool CharToWide(const char *Src,wchar *Dest,int DestSize);
|
||||||
bool WideToChar(const wchar *Src,char *Dest,int DestSize=0x1000000);
|
bool WideToChar(const wchar *Src,char *Dest,int DestSize=0x1000000);
|
||||||
void UtfToWide(const char *Src,wchar *Dest,int DestSize);
|
void UtfToWide(const char *Src,wchar *Dest,int DestSize);
|
||||||
|
wchar* RawToWide(const byte *Src,wchar *Dest,size_t DestSize);
|
||||||
|
|
||||||
// strfn.cpp
|
// strfn.cpp
|
||||||
void ExtToInt(const char *Src,char *Dest);
|
void ExtToInt(const char *Src,char *Dest);
|
||||||
|
|
||||||
|
size_t my_wcslen(const wchar *a);
|
||||||
|
int my_wcscmp(const wchar *a, const wchar *b);
|
||||||
|
int my_wcsncmp(const wchar *a, const wchar *b, size_t DestSize);
|
||||||
|
void my_wcsncpy(wchar *Dest, const wchar *Src, size_t DestSize);
|
||||||
|
void my_wcsncat(wchar *Dest, const wchar *Src, size_t DestSize);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,58 +1,145 @@
|
||||||
#ifndef _RAR_UNPACK_
|
#ifndef _RAR_UNPACK_
|
||||||
#define _RAR_UNPACK_
|
#define _RAR_UNPACK_
|
||||||
|
|
||||||
enum BLOCK_TYPES {BLOCK_LZ,BLOCK_PPM};
|
// Maximum allowed number of compressed bits processed in quick mode.
|
||||||
|
#define MAX_QUICK_DECODE_BITS 10
|
||||||
|
|
||||||
struct Decode
|
// Maximum number of filters per entire data block.
|
||||||
|
#define MAX_UNPACK_FILTERS 8192
|
||||||
|
|
||||||
|
// Maximum number of filters per entire data block for RAR3 unpack.
|
||||||
|
#define MAX3_FILTERS 1024
|
||||||
|
|
||||||
|
// Write data in 4 MB or smaller blocks.
|
||||||
|
#define UNPACK_MAX_WRITE 0x400000
|
||||||
|
|
||||||
|
// Decode compressed bit fields to alphabet numbers.
|
||||||
|
struct DecodeTable:PackDef
|
||||||
{
|
{
|
||||||
unsigned int MaxNum;
|
// Real size of DecodeNum table.
|
||||||
unsigned int DecodeLen[16];
|
uint MaxNum;
|
||||||
unsigned int DecodePos[16];
|
|
||||||
unsigned int DecodeNum[2];
|
// Left aligned start and upper limit codes defining code space
|
||||||
|
// ranges for bit lengths. DecodeLen[BitLength-1] defines the start of
|
||||||
|
// range for bit length and DecodeLen[BitLength] defines next code
|
||||||
|
// after the end of range or in other words the upper limit code
|
||||||
|
// for specified bit length.
|
||||||
|
uint DecodeLen[16];
|
||||||
|
|
||||||
|
// Every item of this array contains the sum of all preceding items.
|
||||||
|
// So it contains the start position in code list for every bit length.
|
||||||
|
uint DecodePos[16];
|
||||||
|
|
||||||
|
// Number of compressed bits processed in quick mode.
|
||||||
|
// Must not exceed MAX_QUICK_DECODE_BITS.
|
||||||
|
uint QuickBits;
|
||||||
|
|
||||||
|
// Translates compressed bits (up to QuickBits length)
|
||||||
|
// to bit length in quick mode.
|
||||||
|
byte QuickLen[1<<MAX_QUICK_DECODE_BITS];
|
||||||
|
|
||||||
|
// Translates compressed bits (up to QuickBits length)
|
||||||
|
// to position in alphabet in quick mode.
|
||||||
|
// 'ushort' saves some memory and even provides a little speed gain
|
||||||
|
// comparting to 'uint' here.
|
||||||
|
ushort QuickNum[1<<MAX_QUICK_DECODE_BITS];
|
||||||
|
|
||||||
|
// Translate the position in code list to position in alphabet.
|
||||||
|
// We do not allocate it dynamically to avoid performance overhead
|
||||||
|
// introduced by pointer, so we use the largest possible table size
|
||||||
|
// as array dimension. Real size of this array is defined in MaxNum.
|
||||||
|
// We use this array if compressed bit field is too lengthy
|
||||||
|
// for QuickLen based translation.
|
||||||
|
// 'ushort' saves some memory and even provides a little speed gain
|
||||||
|
// comparting to 'uint' here.
|
||||||
|
ushort DecodeNum[LARGEST_TABLE_SIZE];
|
||||||
};
|
};
|
||||||
|
|
||||||
struct LitDecode
|
|
||||||
|
struct UnpackBlockHeader
|
||||||
{
|
{
|
||||||
unsigned int MaxNum;
|
int BlockSize;
|
||||||
unsigned int DecodeLen[16];
|
int BlockBitSize;
|
||||||
unsigned int DecodePos[16];
|
int BlockStart;
|
||||||
unsigned int DecodeNum[NC];
|
int HeaderSize;
|
||||||
|
bool LastBlockInFile;
|
||||||
|
bool TablePresent;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct DistDecode
|
|
||||||
|
struct UnpackBlockTables
|
||||||
{
|
{
|
||||||
unsigned int MaxNum;
|
DecodeTable LD; // Decode literals.
|
||||||
unsigned int DecodeLen[16];
|
DecodeTable DD; // Decode distances.
|
||||||
unsigned int DecodePos[16];
|
DecodeTable LDD; // Decode lower bits of distances.
|
||||||
unsigned int DecodeNum[DC];
|
DecodeTable RD; // Decode repeating distances.
|
||||||
|
DecodeTable BD; // Decode bit lengths in Huffman table.
|
||||||
};
|
};
|
||||||
|
|
||||||
struct LowDistDecode
|
|
||||||
{
|
#ifdef RAR_SMP
|
||||||
unsigned int MaxNum;
|
enum UNP_DEC_TYPE {
|
||||||
unsigned int DecodeLen[16];
|
UNPDT_LITERAL,UNPDT_MATCH,UNPDT_FULLREP,UNPDT_REP,UNPDT_FILTER
|
||||||
unsigned int DecodePos[16];
|
|
||||||
unsigned int DecodeNum[LDC];
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct RepDecode
|
struct UnpackDecodedItem
|
||||||
{
|
{
|
||||||
unsigned int MaxNum;
|
UNP_DEC_TYPE Type;
|
||||||
unsigned int DecodeLen[16];
|
ushort Length;
|
||||||
unsigned int DecodePos[16];
|
union
|
||||||
unsigned int DecodeNum[RC];
|
{
|
||||||
|
uint Distance;
|
||||||
|
byte Literal[4];
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
struct BitDecode
|
|
||||||
|
struct UnpackThreadData
|
||||||
{
|
{
|
||||||
unsigned int MaxNum;
|
Unpack *UnpackPtr;
|
||||||
unsigned int DecodeLen[16];
|
BitInput Inp;
|
||||||
unsigned int DecodePos[16];
|
bool HeaderRead;
|
||||||
unsigned int DecodeNum[BC];
|
UnpackBlockHeader BlockHeader;
|
||||||
|
bool TableRead;
|
||||||
|
UnpackBlockTables BlockTables;
|
||||||
|
int DataSize; // Data left in buffer. Can be less than block size.
|
||||||
|
bool DamagedData;
|
||||||
|
bool LargeBlock;
|
||||||
|
bool NoDataLeft; // 'true' if file is read completely.
|
||||||
|
bool Incomplete; // Not entire block was processed, need to read more data.
|
||||||
|
|
||||||
|
UnpackDecodedItem *Decoded;
|
||||||
|
uint DecodedSize;
|
||||||
|
uint DecodedAllocated;
|
||||||
|
uint ThreadNumber; // For debugging.
|
||||||
|
|
||||||
|
UnpackThreadData()
|
||||||
|
:Inp(false)
|
||||||
|
{
|
||||||
|
Decoded=NULL;
|
||||||
|
}
|
||||||
|
~UnpackThreadData()
|
||||||
|
{
|
||||||
|
if (Decoded!=NULL)
|
||||||
|
free(Decoded);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
struct UnpackFilter
|
struct UnpackFilter
|
||||||
: Rar_Allocator
|
{
|
||||||
|
byte Type;
|
||||||
|
uint BlockStart;
|
||||||
|
uint BlockLength;
|
||||||
|
byte Channels;
|
||||||
|
// uint Width;
|
||||||
|
// byte PosR;
|
||||||
|
bool NextWindow;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
struct UnpackFilter30
|
||||||
{
|
{
|
||||||
unsigned int BlockStart;
|
unsigned int BlockStart;
|
||||||
unsigned int BlockLength;
|
unsigned int BlockLength;
|
||||||
|
@ -64,19 +151,10 @@ struct UnpackFilter
|
||||||
unsigned int ParentFilter;
|
unsigned int ParentFilter;
|
||||||
|
|
||||||
VM_PreparedProgram Prg;
|
VM_PreparedProgram Prg;
|
||||||
UnpackFilter( Rar_Error_Handler* eh ) : Prg( eh ) { }
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/***************************** Unpack v 2.0 *********************************/
|
|
||||||
struct MultDecode
|
|
||||||
{
|
|
||||||
unsigned int MaxNum;
|
|
||||||
unsigned int DecodeLen[16];
|
|
||||||
unsigned int DecodePos[16];
|
|
||||||
unsigned int DecodeNum[MC20];
|
|
||||||
};
|
|
||||||
|
|
||||||
struct AudioVariables
|
struct AudioVariables // For RAR 2.0 archives only.
|
||||||
{
|
{
|
||||||
int K1,K2,K3,K4,K5;
|
int K1,K2,K3,K4,K5;
|
||||||
int D1,D2,D3,D4;
|
int D1,D2,D3,D4;
|
||||||
|
@ -85,90 +163,103 @@ struct AudioVariables
|
||||||
unsigned int ByteCount;
|
unsigned int ByteCount;
|
||||||
int LastChar;
|
int LastChar;
|
||||||
};
|
};
|
||||||
/***************************** Unpack v 2.0 *********************************/
|
|
||||||
|
|
||||||
|
|
||||||
// public so operator new/delete will be accessible, argh
|
// We can use the fragmented dictionary in case heap does not have the single
|
||||||
class Unpack:public BitInput
|
// large enough memory block. It is slower than normal dictionary.
|
||||||
|
class FragmentedWindow
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
friend class Pack;
|
enum {MAX_MEM_BLOCKS=32};
|
||||||
|
|
||||||
void Unpack29(bool Solid);
|
void Reset();
|
||||||
|
byte *Mem[MAX_MEM_BLOCKS];
|
||||||
|
size_t MemSize[MAX_MEM_BLOCKS];
|
||||||
|
public:
|
||||||
|
FragmentedWindow();
|
||||||
|
~FragmentedWindow();
|
||||||
|
void Init(size_t WinSize);
|
||||||
|
byte& operator [](size_t Item);
|
||||||
|
void CopyString(uint Length,uint Distance,size_t &UnpPtr,size_t MaxWinMask);
|
||||||
|
void CopyData(byte *Dest,size_t WinPos,size_t Size);
|
||||||
|
size_t GetBlockSize(size_t StartPos,size_t RequiredSize);
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
class Unpack:PackDef
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
static void init_tables();
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
void Unpack5(bool Solid);
|
||||||
|
void Unpack5MT(bool Solid);
|
||||||
bool UnpReadBuf();
|
bool UnpReadBuf();
|
||||||
void UnpWriteBuf();
|
void UnpWriteBuf();
|
||||||
void ExecuteCode(VM_PreparedProgram *Prg);
|
byte* ApplyFilter(byte *Data,uint DataSize,UnpackFilter *Flt);
|
||||||
void UnpWriteArea(unsigned int StartPtr,unsigned int EndPtr);
|
void UnpWriteArea(size_t StartPtr,size_t EndPtr);
|
||||||
void UnpWriteData(byte *Data,int Size);
|
void UnpWriteData(byte *Data,size_t Size);
|
||||||
bool ReadTables();
|
uint SlotToLength(BitInput &Inp,uint Slot);
|
||||||
void MakeDecodeTables(unsigned char *LenTab,struct Decode *Dec,int Size);
|
bool ReadBlockHeader(BitInput &Inp,UnpackBlockHeader &Header);
|
||||||
int DecodeNumber(struct Decode *Dec);
|
bool ReadTables(BitInput &Inp,UnpackBlockHeader &Header,UnpackBlockTables &Tables);
|
||||||
|
void MakeDecodeTables(byte *LengthTable,DecodeTable *Dec,uint Size);
|
||||||
|
uint DecodeNumber(BitInput &Inp,DecodeTable *Dec);
|
||||||
void CopyString();
|
void CopyString();
|
||||||
inline void InsertOldDist(unsigned int Distance);
|
inline void InsertOldDist(unsigned int Distance);
|
||||||
inline void InsertLastMatch(unsigned int Length,unsigned int Distance);
|
void UnpInitData(bool Solid);
|
||||||
void UnpInitData(int Solid);
|
void CopyString(uint Length,uint Distance);
|
||||||
void CopyString(unsigned int Length,unsigned int Distance);
|
uint ReadFilterData(BitInput &Inp);
|
||||||
bool ReadEndOfBlock();
|
bool ReadFilter(BitInput &Inp,UnpackFilter &Filter);
|
||||||
bool ReadVMCode();
|
bool AddFilter(UnpackFilter &Filter);
|
||||||
bool ReadVMCodePPM();
|
bool AddFilter();
|
||||||
bool AddVMCode(unsigned int FirstByte,byte *Code,int CodeSize);
|
|
||||||
void InitFilters();
|
void InitFilters();
|
||||||
|
|
||||||
ComprDataIO *UnpIO;
|
ComprDataIO *UnpIO;
|
||||||
ModelPPM PPM;
|
BitInput Inp;
|
||||||
int PPMEscChar;
|
|
||||||
|
|
||||||
Array<byte> VMCode; // here to avoid leaks
|
Array<byte> FilterSrcMemory;
|
||||||
BitInput Inp; // here to avoid leaks
|
Array<byte> FilterDstMemory;
|
||||||
|
|
||||||
RarVM VM;
|
// Filters code, one entry per filter.
|
||||||
|
Array<UnpackFilter> Filters;
|
||||||
|
|
||||||
UnpackFilter* LastStackFilter; // avoids leak for stack-based filter
|
uint OldDist[4],OldDistPtr;
|
||||||
|
uint LastLength;
|
||||||
|
|
||||||
/* Filters code, one entry per filter */
|
// LastDist is necessary only for RAR2 and older with circular OldDist
|
||||||
Array<UnpackFilter*> Filters;
|
// array. In RAR3 last distance is always stored in OldDist[0].
|
||||||
|
uint LastDist;
|
||||||
|
|
||||||
/* Filters stack, several entrances of same filter are possible */
|
size_t UnpPtr,WrPtr;
|
||||||
Array<UnpackFilter*> PrgStack;
|
|
||||||
|
|
||||||
/* lengths of preceding blocks, one length per filter. Used to reduce
|
|
||||||
size required to write block length if lengths are repeating */
|
|
||||||
Array<int> OldFilterLengths;
|
|
||||||
|
|
||||||
int LastFilter;
|
|
||||||
|
|
||||||
bool TablesRead;
|
|
||||||
struct LitDecode LD;
|
|
||||||
struct DistDecode DD;
|
|
||||||
struct LowDistDecode LDD;
|
|
||||||
struct RepDecode RD;
|
|
||||||
struct BitDecode BD;
|
|
||||||
|
|
||||||
unsigned int OldDist[4],OldDistPtr;
|
|
||||||
unsigned int LastDist,LastLength;
|
|
||||||
|
|
||||||
unsigned int UnpPtr,WrPtr;
|
|
||||||
|
|
||||||
|
// Top border of read packed data.
|
||||||
int ReadTop;
|
int ReadTop;
|
||||||
|
|
||||||
|
// Border to call UnpReadBuf. We use it instead of (ReadTop-C)
|
||||||
|
// for optimization reasons. Ensures that we have C bytes in buffer
|
||||||
|
// unless we are at the end of file.
|
||||||
int ReadBorder;
|
int ReadBorder;
|
||||||
|
|
||||||
unsigned char UnpOldTable[HUFF_TABLE_SIZE];
|
UnpackBlockHeader BlockHeader;
|
||||||
|
UnpackBlockTables BlockTables;
|
||||||
|
|
||||||
int UnpBlockType;
|
size_t WriteBorder;
|
||||||
|
|
||||||
byte *Window;
|
byte *Window;
|
||||||
bool ExternalWindow;
|
|
||||||
|
FragmentedWindow FragWindow;
|
||||||
|
bool Fragmented;
|
||||||
|
|
||||||
|
|
||||||
Int64 DestUnpSize;
|
int64 DestUnpSize;
|
||||||
|
|
||||||
enum { Suspended = false }; // original source could never set to true
|
bool Suspended;
|
||||||
bool UnpAllBuf;
|
bool UnpAllBuf;
|
||||||
bool UnpSomeRead;
|
bool UnpSomeRead;
|
||||||
Int64 WrittenFileSize;
|
int64 WrittenFileSize;
|
||||||
bool FileExtracted;
|
bool FileExtracted;
|
||||||
|
|
||||||
int PrevLowDist,LowDistRepCount;
|
|
||||||
|
|
||||||
/***************************** Unpack v 1.5 *********************************/
|
/***************************** Unpack v 1.5 *********************************/
|
||||||
void Unpack15(bool Solid);
|
void Unpack15(bool Solid);
|
||||||
|
@ -176,51 +267,102 @@ private:
|
||||||
void LongLZ();
|
void LongLZ();
|
||||||
void HuffDecode();
|
void HuffDecode();
|
||||||
void GetFlagsBuf();
|
void GetFlagsBuf();
|
||||||
void OldUnpInitData(int Solid);
|
void UnpInitData15(int Solid);
|
||||||
void InitHuff();
|
void InitHuff();
|
||||||
void CorrHuff(unsigned int *CharSet,unsigned int *NumToPlace);
|
void CorrHuff(ushort *CharSet,byte *NumToPlace);
|
||||||
void OldCopyString(unsigned int Distance,unsigned int Length);
|
void CopyString15(uint Distance,uint Length);
|
||||||
unsigned int DecodeNum(int Num,unsigned int StartPos,
|
uint DecodeNum(uint Num,uint StartPos,uint *DecTab,uint *PosTab);
|
||||||
const unsigned int *DecTab,const unsigned int *PosTab);
|
|
||||||
void OldUnpWriteBuf();
|
|
||||||
|
|
||||||
unsigned int ChSet[256],ChSetA[256],ChSetB[256],ChSetC[256];
|
ushort ChSet[256],ChSetA[256],ChSetB[256],ChSetC[256];
|
||||||
unsigned int Place[256],PlaceA[256],PlaceB[256],PlaceC[256];
|
byte NToPl[256],NToPlB[256],NToPlC[256];
|
||||||
unsigned int NToPl[256],NToPlB[256],NToPlC[256];
|
uint FlagBuf,AvrPlc,AvrPlcB,AvrLn1,AvrLn2,AvrLn3;
|
||||||
unsigned int FlagBuf,AvrPlc,AvrPlcB,AvrLn1,AvrLn2,AvrLn3;
|
|
||||||
int Buf60,NumHuf,StMode,LCount,FlagsCnt;
|
int Buf60,NumHuf,StMode,LCount,FlagsCnt;
|
||||||
unsigned int Nhfb,Nlzb,MaxDist3;
|
uint Nhfb,Nlzb,MaxDist3;
|
||||||
/***************************** Unpack v 1.5 *********************************/
|
/***************************** Unpack v 1.5 *********************************/
|
||||||
|
|
||||||
/***************************** Unpack v 2.0 *********************************/
|
/***************************** Unpack v 2.0 *********************************/
|
||||||
void Unpack20(bool Solid);
|
void Unpack20(bool Solid);
|
||||||
struct MultDecode MD[4];
|
|
||||||
|
DecodeTable MD[4]; // Decode multimedia data, up to 4 channels.
|
||||||
|
|
||||||
unsigned char UnpOldTable20[MC20*4];
|
unsigned char UnpOldTable20[MC20*4];
|
||||||
int UnpAudioBlock,UnpChannels,UnpCurChannel,UnpChannelDelta;
|
uint UnpAudioBlock,UnpChannels,UnpCurChannel;
|
||||||
void CopyString20(unsigned int Length,unsigned int Distance);
|
int UnpChannelDelta;
|
||||||
|
void CopyString20(uint Length,uint Distance);
|
||||||
bool ReadTables20();
|
bool ReadTables20();
|
||||||
|
void UnpWriteBuf20();
|
||||||
void UnpInitData20(int Solid);
|
void UnpInitData20(int Solid);
|
||||||
void ReadLastTables();
|
void ReadLastTables();
|
||||||
byte DecodeAudio(int Delta);
|
byte DecodeAudio(int Delta);
|
||||||
struct AudioVariables AudV[4];
|
struct AudioVariables AudV[4];
|
||||||
/***************************** Unpack v 2.0 *********************************/
|
/***************************** Unpack v 2.0 *********************************/
|
||||||
|
|
||||||
public:
|
/***************************** Unpack v 3.0 *********************************/
|
||||||
Rar_Error_Handler& ErrHandler;
|
enum BLOCK_TYPES {BLOCK_LZ,BLOCK_PPM};
|
||||||
byte const* window_wrptr() const { return &Window [WrPtr & MAXWINMASK]; }
|
|
||||||
|
|
||||||
static void init_tables();
|
void UnpInitData30(bool Solid);
|
||||||
|
void Unpack29(bool Solid);
|
||||||
|
void InitFilters30();
|
||||||
|
bool ReadEndOfBlock();
|
||||||
|
bool ReadVMCode();
|
||||||
|
bool ReadVMCodePPM();
|
||||||
|
bool AddVMCode(uint FirstByte,byte *Code,int CodeSize);
|
||||||
|
int SafePPMDecodeChar();
|
||||||
|
bool ReadTables30();
|
||||||
|
bool UnpReadBuf30();
|
||||||
|
void UnpWriteBuf30();
|
||||||
|
void ExecuteCode(VM_PreparedProgram *Prg);
|
||||||
|
|
||||||
|
int PrevLowDist,LowDistRepCount;
|
||||||
|
|
||||||
|
ModelPPM PPM;
|
||||||
|
int PPMEscChar;
|
||||||
|
|
||||||
|
byte UnpOldTable[HUFF_TABLE_SIZE30];
|
||||||
|
int UnpBlockType;
|
||||||
|
|
||||||
|
bool TablesRead;
|
||||||
|
|
||||||
|
// Virtual machine to execute filters code.
|
||||||
|
RarVM VM;
|
||||||
|
|
||||||
|
// Buffer to read VM filters code. We moved it here from AddVMCode
|
||||||
|
// function to reduce time spent in BitInput constructor.
|
||||||
|
BitInput VMCodeInp;
|
||||||
|
|
||||||
|
// Filters code, one entry per filter.
|
||||||
|
Array<UnpackFilter30 *> Filters30;
|
||||||
|
|
||||||
|
// Filters stack, several entrances of same filter are possible.
|
||||||
|
Array<UnpackFilter30 *> PrgStack;
|
||||||
|
|
||||||
|
// Lengths of preceding data blocks, one length of one last block
|
||||||
|
// for every filter. Used to reduce the size required to write
|
||||||
|
// the data block length if lengths are repeating.
|
||||||
|
Array<int> OldFilterLengths;
|
||||||
|
|
||||||
|
int LastFilter;
|
||||||
|
/***************************** Unpack v 3.0 *********************************/
|
||||||
|
|
||||||
|
public:
|
||||||
Unpack(ComprDataIO *DataIO);
|
Unpack(ComprDataIO *DataIO);
|
||||||
~Unpack();
|
~Unpack();
|
||||||
void Init(byte *Window=NULL);
|
void Init(size_t WinSize,bool Solid);
|
||||||
void DoUnpack(int Method,bool Solid);
|
void DoUnpack(int Method,bool Solid);
|
||||||
void SetDestSize(Int64 DestSize) {DestUnpSize=DestSize;FileExtracted=false;}
|
bool IsFileExtracted() {return(FileExtracted);}
|
||||||
|
void SetDestSize(int64 DestSize) {DestUnpSize=DestSize;FileExtracted=false;}
|
||||||
|
void SetSuspended(bool Suspended) {Unpack::Suspended=Suspended;}
|
||||||
|
|
||||||
unsigned int GetChar()
|
byte const* window_wrptr() const { return &Window [WrPtr & MaxWinMask]; }
|
||||||
|
|
||||||
|
size_t MaxWinSize;
|
||||||
|
size_t MaxWinMask;
|
||||||
|
|
||||||
|
uint GetChar()
|
||||||
{
|
{
|
||||||
if (InAddr>BitInput::MAX_SIZE-30)
|
if (Inp.InAddr>BitInput::MAX_SIZE-30)
|
||||||
UnpReadBuf();
|
UnpReadBuf();
|
||||||
return(InBuf[InAddr++]);
|
return(Inp.InBuf[Inp.InAddr++]);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -1,66 +1,48 @@
|
||||||
// #included by unpack.cpp
|
|
||||||
#ifdef RAR_COMMON_HPP
|
#ifdef RAR_COMMON_HPP
|
||||||
|
|
||||||
#define STARTL1 2
|
#define STARTL1 2
|
||||||
const
|
|
||||||
static unsigned int DecL1[]={0x8000,0xa000,0xc000,0xd000,0xe000,0xea00,
|
static unsigned int DecL1[]={0x8000,0xa000,0xc000,0xd000,0xe000,0xea00,
|
||||||
0xee00,0xf000,0xf200,0xf200,0xffff};
|
0xee00,0xf000,0xf200,0xf200,0xffff};
|
||||||
const
|
|
||||||
static unsigned int PosL1[]={0,0,0,2,3,5,7,11,16,20,24,32,32};
|
static unsigned int PosL1[]={0,0,0,2,3,5,7,11,16,20,24,32,32};
|
||||||
|
|
||||||
#define STARTL2 3
|
#define STARTL2 3
|
||||||
const
|
|
||||||
static unsigned int DecL2[]={0xa000,0xc000,0xd000,0xe000,0xea00,0xee00,
|
static unsigned int DecL2[]={0xa000,0xc000,0xd000,0xe000,0xea00,0xee00,
|
||||||
0xf000,0xf200,0xf240,0xffff};
|
0xf000,0xf200,0xf240,0xffff};
|
||||||
const
|
|
||||||
static unsigned int PosL2[]={0,0,0,0,5,7,9,13,18,22,26,34,36};
|
static unsigned int PosL2[]={0,0,0,0,5,7,9,13,18,22,26,34,36};
|
||||||
|
|
||||||
#define STARTHF0 4
|
#define STARTHF0 4
|
||||||
const
|
|
||||||
static unsigned int DecHf0[]={0x8000,0xc000,0xe000,0xf200,0xf200,0xf200,
|
static unsigned int DecHf0[]={0x8000,0xc000,0xe000,0xf200,0xf200,0xf200,
|
||||||
0xf200,0xf200,0xffff};
|
0xf200,0xf200,0xffff};
|
||||||
const
|
|
||||||
static unsigned int PosHf0[]={0,0,0,0,0,8,16,24,33,33,33,33,33};
|
static unsigned int PosHf0[]={0,0,0,0,0,8,16,24,33,33,33,33,33};
|
||||||
|
|
||||||
|
|
||||||
#define STARTHF1 5
|
#define STARTHF1 5
|
||||||
const
|
|
||||||
static unsigned int DecHf1[]={0x2000,0xc000,0xe000,0xf000,0xf200,0xf200,
|
static unsigned int DecHf1[]={0x2000,0xc000,0xe000,0xf000,0xf200,0xf200,
|
||||||
0xf7e0,0xffff};
|
0xf7e0,0xffff};
|
||||||
const
|
|
||||||
static unsigned int PosHf1[]={0,0,0,0,0,0,4,44,60,76,80,80,127};
|
static unsigned int PosHf1[]={0,0,0,0,0,0,4,44,60,76,80,80,127};
|
||||||
|
|
||||||
|
|
||||||
#define STARTHF2 5
|
#define STARTHF2 5
|
||||||
const
|
|
||||||
static unsigned int DecHf2[]={0x1000,0x2400,0x8000,0xc000,0xfa00,0xffff,
|
static unsigned int DecHf2[]={0x1000,0x2400,0x8000,0xc000,0xfa00,0xffff,
|
||||||
0xffff,0xffff};
|
0xffff,0xffff};
|
||||||
const
|
|
||||||
static unsigned int PosHf2[]={0,0,0,0,0,0,2,7,53,117,233,0,0};
|
static unsigned int PosHf2[]={0,0,0,0,0,0,2,7,53,117,233,0,0};
|
||||||
|
|
||||||
|
|
||||||
#define STARTHF3 6
|
#define STARTHF3 6
|
||||||
const
|
|
||||||
static unsigned int DecHf3[]={0x800,0x2400,0xee00,0xfe80,0xffff,0xffff,
|
static unsigned int DecHf3[]={0x800,0x2400,0xee00,0xfe80,0xffff,0xffff,
|
||||||
0xffff};
|
0xffff};
|
||||||
const
|
|
||||||
static unsigned int PosHf3[]={0,0,0,0,0,0,0,2,16,218,251,0,0};
|
static unsigned int PosHf3[]={0,0,0,0,0,0,0,2,16,218,251,0,0};
|
||||||
|
|
||||||
|
|
||||||
#define STARTHF4 8
|
#define STARTHF4 8
|
||||||
const
|
|
||||||
static unsigned int DecHf4[]={0xff00,0xffff,0xffff,0xffff,0xffff,0xffff};
|
static unsigned int DecHf4[]={0xff00,0xffff,0xffff,0xffff,0xffff,0xffff};
|
||||||
const
|
|
||||||
static unsigned int PosHf4[]={0,0,0,0,0,0,0,0,0,255,0,0,0};
|
static unsigned int PosHf4[]={0,0,0,0,0,0,0,0,0,255,0,0,0};
|
||||||
|
|
||||||
|
|
||||||
void Unpack::Unpack15(bool Solid)
|
void Unpack::Unpack15(bool Solid)
|
||||||
{
|
|
||||||
if (Suspended)
|
|
||||||
UnpPtr=WrPtr;
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
UnpInitData(Solid);
|
UnpInitData(Solid);
|
||||||
OldUnpInitData(Solid);
|
UnpInitData15(Solid);
|
||||||
UnpReadBuf();
|
UnpReadBuf();
|
||||||
if (!Solid)
|
if (!Solid)
|
||||||
{
|
{
|
||||||
|
@ -70,7 +52,6 @@ void Unpack::Unpack15(bool Solid)
|
||||||
else
|
else
|
||||||
UnpPtr=WrPtr;
|
UnpPtr=WrPtr;
|
||||||
--DestUnpSize;
|
--DestUnpSize;
|
||||||
}
|
|
||||||
if (DestUnpSize>=0)
|
if (DestUnpSize>=0)
|
||||||
{
|
{
|
||||||
GetFlagsBuf();
|
GetFlagsBuf();
|
||||||
|
@ -79,16 +60,12 @@ void Unpack::Unpack15(bool Solid)
|
||||||
|
|
||||||
while (DestUnpSize>=0)
|
while (DestUnpSize>=0)
|
||||||
{
|
{
|
||||||
UnpPtr&=MAXWINMASK;
|
UnpPtr&=MaxWinMask;
|
||||||
|
|
||||||
if (InAddr>ReadTop-30 && !UnpReadBuf())
|
if (Inp.InAddr>ReadTop-30 && !UnpReadBuf())
|
||||||
break;
|
break;
|
||||||
if (((WrPtr-UnpPtr) & MAXWINMASK)<270 && WrPtr!=UnpPtr)
|
if (((WrPtr-UnpPtr) & MaxWinMask)<270 && WrPtr!=UnpPtr)
|
||||||
{
|
UnpWriteBuf20();
|
||||||
OldUnpWriteBuf();
|
|
||||||
if (Suspended)
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (StMode)
|
if (StMode)
|
||||||
{
|
{
|
||||||
HuffDecode();
|
HuffDecode();
|
||||||
|
@ -132,23 +109,7 @@ void Unpack::Unpack15(bool Solid)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
OldUnpWriteBuf();
|
UnpWriteBuf20();
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Unpack::OldUnpWriteBuf()
|
|
||||||
{
|
|
||||||
if (UnpPtr!=WrPtr)
|
|
||||||
UnpSomeRead=true;
|
|
||||||
if (UnpPtr<WrPtr)
|
|
||||||
{
|
|
||||||
UnpIO->UnpWrite(&Window[WrPtr],-WrPtr & MAXWINMASK);
|
|
||||||
UnpIO->UnpWrite(Window,UnpPtr);
|
|
||||||
UnpAllBuf=true;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
UnpIO->UnpWrite(&Window[WrPtr],UnpPtr-WrPtr);
|
|
||||||
WrPtr=UnpPtr;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -157,14 +118,10 @@ void Unpack::OldUnpWriteBuf()
|
||||||
|
|
||||||
void Unpack::ShortLZ()
|
void Unpack::ShortLZ()
|
||||||
{
|
{
|
||||||
const
|
|
||||||
static unsigned int ShortLen1[]={1,3,4,4,5,6,7,8,8,4,4,5,6,6,4,0};
|
static unsigned int ShortLen1[]={1,3,4,4,5,6,7,8,8,4,4,5,6,6,4,0};
|
||||||
const
|
|
||||||
static unsigned int ShortXor1[]={0,0xa0,0xd0,0xe0,0xf0,0xf8,0xfc,0xfe,
|
static unsigned int ShortXor1[]={0,0xa0,0xd0,0xe0,0xf0,0xf8,0xfc,0xfe,
|
||||||
0xff,0xc0,0x80,0x90,0x98,0x9c,0xb0};
|
0xff,0xc0,0x80,0x90,0x98,0x9c,0xb0};
|
||||||
const
|
|
||||||
static unsigned int ShortLen2[]={2,3,3,3,4,4,5,6,6,4,4,5,6,6,4,0};
|
static unsigned int ShortLen2[]={2,3,3,3,4,4,5,6,6,4,4,5,6,6,4,0};
|
||||||
const
|
|
||||||
static unsigned int ShortXor2[]={0,0x40,0x60,0xa0,0xd0,0xe0,0xf0,0xf8,
|
static unsigned int ShortXor2[]={0,0x40,0x60,0xa0,0xd0,0xe0,0xf0,0xf8,
|
||||||
0xfc,0xc0,0x80,0x90,0x98,0x9c,0xb0};
|
0xfc,0xc0,0x80,0x90,0x98,0x9c,0xb0};
|
||||||
|
|
||||||
|
@ -175,13 +132,13 @@ void Unpack::ShortLZ()
|
||||||
int DistancePlace;
|
int DistancePlace;
|
||||||
NumHuf=0;
|
NumHuf=0;
|
||||||
|
|
||||||
unsigned int BitField=fgetbits();
|
unsigned int BitField=Inp.fgetbits();
|
||||||
if (LCount==2)
|
if (LCount==2)
|
||||||
{
|
{
|
||||||
faddbits(1);
|
Inp.faddbits(1);
|
||||||
if (BitField >= 0x8000)
|
if (BitField >= 0x8000)
|
||||||
{
|
{
|
||||||
OldCopyString((unsigned int)LastDist,LastLength);
|
CopyString15((unsigned int)LastDist,LastLength);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
BitField <<= 1;
|
BitField <<= 1;
|
||||||
|
@ -198,14 +155,14 @@ void Unpack::ShortLZ()
|
||||||
for (Length=0;;Length++)
|
for (Length=0;;Length++)
|
||||||
if (((BitField^ShortXor1[Length]) & (~(0xff>>GetShortLen1(Length))))==0)
|
if (((BitField^ShortXor1[Length]) & (~(0xff>>GetShortLen1(Length))))==0)
|
||||||
break;
|
break;
|
||||||
faddbits(GetShortLen1(Length));
|
Inp.faddbits(GetShortLen1(Length));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
for (Length=0;;Length++)
|
for (Length=0;;Length++)
|
||||||
if (((BitField^ShortXor2[Length]) & (~(0xff>>GetShortLen2(Length))))==0)
|
if (((BitField^ShortXor2[Length]) & (~(0xff>>GetShortLen2(Length))))==0)
|
||||||
break;
|
break;
|
||||||
faddbits(GetShortLen2(Length));
|
Inp.faddbits(GetShortLen2(Length));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Length >= 9)
|
if (Length >= 9)
|
||||||
|
@ -213,25 +170,25 @@ void Unpack::ShortLZ()
|
||||||
if (Length == 9)
|
if (Length == 9)
|
||||||
{
|
{
|
||||||
LCount++;
|
LCount++;
|
||||||
OldCopyString((unsigned int)LastDist,LastLength);
|
CopyString15((unsigned int)LastDist,LastLength);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (Length == 14)
|
if (Length == 14)
|
||||||
{
|
{
|
||||||
LCount=0;
|
LCount=0;
|
||||||
Length=DecodeNum(fgetbits(),STARTL2,DecL2,PosL2)+5;
|
Length=DecodeNum(Inp.fgetbits(),STARTL2,DecL2,PosL2)+5;
|
||||||
Distance=(fgetbits()>>1) | 0x8000;
|
Distance=(Inp.fgetbits()>>1) | 0x8000;
|
||||||
faddbits(15);
|
Inp.faddbits(15);
|
||||||
LastLength=Length;
|
LastLength=Length;
|
||||||
LastDist=Distance;
|
LastDist=Distance;
|
||||||
OldCopyString(Distance,Length);
|
CopyString15(Distance,Length);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
LCount=0;
|
LCount=0;
|
||||||
SaveLength=Length;
|
SaveLength=Length;
|
||||||
Distance=OldDist[(OldDistPtr-(Length-9)) & 3];
|
Distance=OldDist[(OldDistPtr-(Length-9)) & 3];
|
||||||
Length=DecodeNum(fgetbits(),STARTL1,DecL1,PosL1)+2;
|
Length=DecodeNum(Inp.fgetbits(),STARTL1,DecL1,PosL1)+2;
|
||||||
if (Length==0x101 && SaveLength==10)
|
if (Length==0x101 && SaveLength==10)
|
||||||
{
|
{
|
||||||
Buf60 ^= 1;
|
Buf60 ^= 1;
|
||||||
|
@ -246,7 +203,7 @@ void Unpack::ShortLZ()
|
||||||
OldDistPtr = OldDistPtr & 3;
|
OldDistPtr = OldDistPtr & 3;
|
||||||
LastLength=Length;
|
LastLength=Length;
|
||||||
LastDist=Distance;
|
LastDist=Distance;
|
||||||
OldCopyString(Distance,Length);
|
CopyString15(Distance,Length);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -254,13 +211,11 @@ void Unpack::ShortLZ()
|
||||||
AvrLn1 += Length;
|
AvrLn1 += Length;
|
||||||
AvrLn1 -= AvrLn1 >> 4;
|
AvrLn1 -= AvrLn1 >> 4;
|
||||||
|
|
||||||
DistancePlace=DecodeNum(fgetbits(),STARTHF2,DecHf2,PosHf2) & 0xff;
|
DistancePlace=DecodeNum(Inp.fgetbits(),STARTHF2,DecHf2,PosHf2) & 0xff;
|
||||||
Distance=ChSetA[DistancePlace];
|
Distance=ChSetA[DistancePlace];
|
||||||
if (--DistancePlace != -1)
|
if (--DistancePlace != -1)
|
||||||
{
|
{
|
||||||
PlaceA[Distance]--;
|
|
||||||
LastDistance=ChSetA[DistancePlace];
|
LastDistance=ChSetA[DistancePlace];
|
||||||
PlaceA[LastDistance]++;
|
|
||||||
ChSetA[DistancePlace+1]=LastDistance;
|
ChSetA[DistancePlace+1]=LastDistance;
|
||||||
ChSetA[DistancePlace]=Distance;
|
ChSetA[DistancePlace]=Distance;
|
||||||
}
|
}
|
||||||
|
@ -269,7 +224,7 @@ void Unpack::ShortLZ()
|
||||||
OldDistPtr = OldDistPtr & 3;
|
OldDistPtr = OldDistPtr & 3;
|
||||||
LastLength=Length;
|
LastLength=Length;
|
||||||
LastDist=Distance;
|
LastDist=Distance;
|
||||||
OldCopyString(Distance,Length);
|
CopyString15(Distance,Length);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -289,7 +244,7 @@ void Unpack::LongLZ()
|
||||||
}
|
}
|
||||||
OldAvr2=AvrLn2;
|
OldAvr2=AvrLn2;
|
||||||
|
|
||||||
unsigned int BitField=fgetbits();
|
unsigned int BitField=Inp.fgetbits();
|
||||||
if (AvrLn2 >= 122)
|
if (AvrLn2 >= 122)
|
||||||
Length=DecodeNum(BitField,STARTL2,DecL2,PosL2);
|
Length=DecodeNum(BitField,STARTL2,DecL2,PosL2);
|
||||||
else
|
else
|
||||||
|
@ -299,19 +254,19 @@ void Unpack::LongLZ()
|
||||||
if (BitField < 0x100)
|
if (BitField < 0x100)
|
||||||
{
|
{
|
||||||
Length=BitField;
|
Length=BitField;
|
||||||
faddbits(16);
|
Inp.faddbits(16);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
for (Length=0;((BitField<<Length)&0x8000)==0;Length++)
|
for (Length=0;((BitField<<Length)&0x8000)==0;Length++)
|
||||||
;
|
;
|
||||||
faddbits(Length+1);
|
Inp.faddbits(Length+1);
|
||||||
}
|
}
|
||||||
|
|
||||||
AvrLn2 += Length;
|
AvrLn2 += Length;
|
||||||
AvrLn2 -= AvrLn2 >> 5;
|
AvrLn2 -= AvrLn2 >> 5;
|
||||||
|
|
||||||
BitField=fgetbits();
|
BitField=Inp.fgetbits();
|
||||||
if (AvrPlcB > 0x28ff)
|
if (AvrPlcB > 0x28ff)
|
||||||
DistancePlace=DecodeNum(BitField,STARTHF2,DecHf2,PosHf2);
|
DistancePlace=DecodeNum(BitField,STARTHF2,DecHf2,PosHf2);
|
||||||
else
|
else
|
||||||
|
@ -335,8 +290,8 @@ void Unpack::LongLZ()
|
||||||
ChSetB[DistancePlace]=ChSetB[NewDistancePlace];
|
ChSetB[DistancePlace]=ChSetB[NewDistancePlace];
|
||||||
ChSetB[NewDistancePlace]=Distance;
|
ChSetB[NewDistancePlace]=Distance;
|
||||||
|
|
||||||
Distance=((Distance & 0xff00) | (fgetbits() >> 8)) >> 1;
|
Distance=((Distance & 0xff00) | (Inp.fgetbits() >> 8)) >> 1;
|
||||||
faddbits(7);
|
Inp.faddbits(7);
|
||||||
|
|
||||||
OldAvr3=AvrLn3;
|
OldAvr3=AvrLn3;
|
||||||
if (Length!=1 && Length!=4)
|
if (Length!=1 && Length!=4)
|
||||||
|
@ -353,7 +308,7 @@ void Unpack::LongLZ()
|
||||||
Length++;
|
Length++;
|
||||||
if (Distance <= 256)
|
if (Distance <= 256)
|
||||||
Length+=8;
|
Length+=8;
|
||||||
if (OldAvr3 > 0xb0 || AvrPlc >= 0x2a00 && OldAvr2 < 0x40)
|
if (OldAvr3 > 0xb0 || (AvrPlc >= 0x2a00 && OldAvr2 < 0x40))
|
||||||
MaxDist3=0x7f00;
|
MaxDist3=0x7f00;
|
||||||
else
|
else
|
||||||
MaxDist3=0x2001;
|
MaxDist3=0x2001;
|
||||||
|
@ -361,7 +316,7 @@ void Unpack::LongLZ()
|
||||||
OldDistPtr = OldDistPtr & 3;
|
OldDistPtr = OldDistPtr & 3;
|
||||||
LastLength=Length;
|
LastLength=Length;
|
||||||
LastDist=Distance;
|
LastDist=Distance;
|
||||||
OldCopyString(Distance,Length);
|
CopyString15(Distance,Length);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -372,7 +327,7 @@ void Unpack::HuffDecode()
|
||||||
unsigned int Distance;
|
unsigned int Distance;
|
||||||
int BytePlace;
|
int BytePlace;
|
||||||
|
|
||||||
unsigned int BitField=fgetbits();
|
unsigned int BitField=Inp.fgetbits();
|
||||||
|
|
||||||
if (AvrPlc > 0x75ff)
|
if (AvrPlc > 0x75ff)
|
||||||
BytePlace=DecodeNum(BitField,STARTHF4,DecHf4,PosHf4);
|
BytePlace=DecodeNum(BitField,STARTHF4,DecHf4,PosHf4);
|
||||||
|
@ -394,8 +349,8 @@ void Unpack::HuffDecode()
|
||||||
BytePlace=0x100;
|
BytePlace=0x100;
|
||||||
if (--BytePlace==-1)
|
if (--BytePlace==-1)
|
||||||
{
|
{
|
||||||
BitField=fgetbits();
|
BitField=Inp.fgetbits();
|
||||||
faddbits(1);
|
Inp.faddbits(1);
|
||||||
if (BitField & 0x8000)
|
if (BitField & 0x8000)
|
||||||
{
|
{
|
||||||
NumHuf=StMode=0;
|
NumHuf=StMode=0;
|
||||||
|
@ -404,11 +359,11 @@ void Unpack::HuffDecode()
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Length = (BitField & 0x4000) ? 4 : 3;
|
Length = (BitField & 0x4000) ? 4 : 3;
|
||||||
faddbits(1);
|
Inp.faddbits(1);
|
||||||
Distance=DecodeNum(fgetbits(),STARTHF2,DecHf2,PosHf2);
|
Distance=DecodeNum(Inp.fgetbits(),STARTHF2,DecHf2,PosHf2);
|
||||||
Distance = (Distance << 5) | (fgetbits() >> 11);
|
Distance = (Distance << 5) | (Inp.fgetbits() >> 11);
|
||||||
faddbits(5);
|
Inp.faddbits(5);
|
||||||
OldCopyString(Distance,Length);
|
CopyString15(Distance,Length);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -446,7 +401,7 @@ void Unpack::HuffDecode()
|
||||||
void Unpack::GetFlagsBuf()
|
void Unpack::GetFlagsBuf()
|
||||||
{
|
{
|
||||||
unsigned int Flags,NewFlagsPlace;
|
unsigned int Flags,NewFlagsPlace;
|
||||||
unsigned int FlagsPlace=DecodeNum(fgetbits(),STARTHF2,DecHf2,PosHf2);
|
unsigned int FlagsPlace=DecodeNum(Inp.fgetbits(),STARTHF2,DecHf2,PosHf2);
|
||||||
|
|
||||||
while (1)
|
while (1)
|
||||||
{
|
{
|
||||||
|
@ -463,7 +418,7 @@ void Unpack::GetFlagsBuf()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Unpack::OldUnpInitData(int Solid)
|
void Unpack::UnpInitData15(int Solid)
|
||||||
{
|
{
|
||||||
if (!Solid)
|
if (!Solid)
|
||||||
{
|
{
|
||||||
|
@ -484,8 +439,6 @@ void Unpack::InitHuff()
|
||||||
{
|
{
|
||||||
for (unsigned int I=0;I<256;I++)
|
for (unsigned int I=0;I<256;I++)
|
||||||
{
|
{
|
||||||
Place[I]=PlaceA[I]=PlaceB[I]=I;
|
|
||||||
PlaceC[I]=(~I+1) & 0xff;
|
|
||||||
ChSet[I]=ChSetB[I]=I<<8;
|
ChSet[I]=ChSetB[I]=I<<8;
|
||||||
ChSetA[I]=I;
|
ChSetA[I]=I;
|
||||||
ChSetC[I]=((~I+1) & 0xff)<<8;
|
ChSetC[I]=((~I+1) & 0xff)<<8;
|
||||||
|
@ -497,7 +450,7 @@ void Unpack::InitHuff()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Unpack::CorrHuff(unsigned int *CharSet,unsigned int *NumToPlace)
|
void Unpack::CorrHuff(ushort *CharSet,byte *NumToPlace)
|
||||||
{
|
{
|
||||||
int I,J;
|
int I,J;
|
||||||
for (I=7;I>=0;I--)
|
for (I=7;I>=0;I--)
|
||||||
|
@ -509,24 +462,24 @@ void Unpack::CorrHuff(unsigned int *CharSet,unsigned int *NumToPlace)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Unpack::OldCopyString(unsigned int Distance,unsigned int Length)
|
void Unpack::CopyString15(uint Distance,uint Length)
|
||||||
{
|
{
|
||||||
DestUnpSize-=Length;
|
DestUnpSize-=Length;
|
||||||
while (Length--)
|
while (Length--)
|
||||||
{
|
{
|
||||||
Window[UnpPtr]=Window[(UnpPtr-Distance) & MAXWINMASK];
|
Window[UnpPtr]=Window[(UnpPtr-Distance) & MaxWinMask];
|
||||||
UnpPtr=(UnpPtr+1) & MAXWINMASK;
|
UnpPtr=(UnpPtr+1) & MaxWinMask;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
unsigned int Unpack::DecodeNum(int Num,unsigned int StartPos,
|
uint Unpack::DecodeNum(uint Num,uint StartPos,uint *DecTab,uint *PosTab)
|
||||||
const unsigned int *DecTab,const unsigned int *PosTab)
|
|
||||||
{
|
{
|
||||||
int I;
|
int I;
|
||||||
for (Num&=0xfff0,I=0;DecTab[I]<=Num;I++)
|
for (Num&=0xfff0,I=0;DecTab[I]<=Num;I++)
|
||||||
StartPos++;
|
StartPos++;
|
||||||
faddbits(StartPos);
|
Inp.faddbits(StartPos);
|
||||||
return(((Num-(I ? DecTab[I-1]:0))>>(16-StartPos))+PosTab[StartPos]);
|
return(((Num-(I ? DecTab[I-1]:0))>>(16-StartPos))+PosTab[StartPos]);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -1,61 +1,21 @@
|
||||||
// #included by unpack.cpp
|
|
||||||
#ifdef RAR_COMMON_HPP
|
#ifdef RAR_COMMON_HPP
|
||||||
#include "rar.hpp"
|
|
||||||
|
|
||||||
// Presumably these optimizations give similar speedup as those for CopyString in unpack.cpp
|
void Unpack::CopyString20(uint Length,uint Distance)
|
||||||
void Unpack::CopyString20(unsigned int Length,unsigned int Distance)
|
|
||||||
{
|
{
|
||||||
LastDist=OldDist[OldDistPtr++ & 3]=Distance;
|
LastDist=OldDist[OldDistPtr++ & 3]=Distance;
|
||||||
LastLength=Length;
|
LastLength=Length;
|
||||||
DestUnpSize-=Length;
|
DestUnpSize-=Length;
|
||||||
|
CopyString(Length,Distance);
|
||||||
unsigned UnpPtr = this->UnpPtr; // cache in register
|
|
||||||
byte* const Window = this->Window; // cache in register
|
|
||||||
|
|
||||||
unsigned int DestPtr=UnpPtr-Distance;
|
|
||||||
if (UnpPtr<MAXWINSIZE-300 && DestPtr<MAXWINSIZE-300)
|
|
||||||
{
|
|
||||||
this->UnpPtr += Length;
|
|
||||||
if ( Distance < Length ) // can't use memcpy when source and dest overlap
|
|
||||||
{
|
|
||||||
Window[UnpPtr++]=Window[DestPtr++];
|
|
||||||
Window[UnpPtr++]=Window[DestPtr++];
|
|
||||||
while (Length>2)
|
|
||||||
{
|
|
||||||
Length--;
|
|
||||||
Window[UnpPtr++]=Window[DestPtr++];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
memcpy( &Window[UnpPtr], &Window[DestPtr], Length );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
while (Length--)
|
|
||||||
{
|
|
||||||
Window[UnpPtr]=Window[DestPtr++ & MAXWINMASK];
|
|
||||||
UnpPtr=(UnpPtr+1) & MAXWINMASK;
|
|
||||||
}
|
|
||||||
this->UnpPtr = UnpPtr;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Unpack::Unpack20(bool Solid)
|
void Unpack::Unpack20(bool Solid)
|
||||||
{
|
{
|
||||||
const
|
|
||||||
static unsigned char LDecode[]={0,1,2,3,4,5,6,7,8,10,12,14,16,20,24,28,32,40,48,56,64,80,96,112,128,160,192,224};
|
static unsigned char LDecode[]={0,1,2,3,4,5,6,7,8,10,12,14,16,20,24,28,32,40,48,56,64,80,96,112,128,160,192,224};
|
||||||
const
|
|
||||||
static unsigned char LBits[]= {0,0,0,0,0,0,0,0,1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5};
|
static unsigned char LBits[]= {0,0,0,0,0,0,0,0,1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5};
|
||||||
const
|
|
||||||
static int DDecode[]={0,1,2,3,4,6,8,12,16,24,32,48,64,96,128,192,256,384,512,768,1024,1536,2048,3072,4096,6144,8192,12288,16384,24576,32768U,49152U,65536,98304,131072,196608,262144,327680,393216,458752,524288,589824,655360,720896,786432,851968,917504,983040};
|
static int DDecode[]={0,1,2,3,4,6,8,12,16,24,32,48,64,96,128,192,256,384,512,768,1024,1536,2048,3072,4096,6144,8192,12288,16384,24576,32768U,49152U,65536,98304,131072,196608,262144,327680,393216,458752,524288,589824,655360,720896,786432,851968,917504,983040};
|
||||||
const
|
|
||||||
static unsigned char DBits[]= {0,0,0,0,1,1,2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16};
|
static unsigned char DBits[]= {0,0,0,0,1,1,2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16};
|
||||||
const
|
|
||||||
static unsigned char SDDecode[]={0,4,8,16,32,64,128,192};
|
static unsigned char SDDecode[]={0,4,8,16,32,64,128,192};
|
||||||
const
|
|
||||||
static unsigned char SDBits[]= {2,2,3, 4, 5, 6, 6, 6};
|
static unsigned char SDBits[]= {2,2,3, 4, 5, 6, 6, 6};
|
||||||
unsigned int Bits;
|
unsigned int Bits;
|
||||||
|
|
||||||
|
@ -72,22 +32,22 @@ void Unpack::Unpack20(bool Solid)
|
||||||
--DestUnpSize;
|
--DestUnpSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
while (is64plus(DestUnpSize))
|
while (DestUnpSize>=0)
|
||||||
{
|
{
|
||||||
UnpPtr&=MAXWINMASK;
|
UnpPtr&=MaxWinMask;
|
||||||
|
|
||||||
if (InAddr>ReadTop-30)
|
if (Inp.InAddr>ReadTop-30)
|
||||||
if (!UnpReadBuf())
|
if (!UnpReadBuf())
|
||||||
break;
|
break;
|
||||||
if (((WrPtr-UnpPtr) & MAXWINMASK)<270 && WrPtr!=UnpPtr)
|
if (((WrPtr-UnpPtr) & MaxWinMask)<270 && WrPtr!=UnpPtr)
|
||||||
{
|
{
|
||||||
OldUnpWriteBuf();
|
UnpWriteBuf20();
|
||||||
if (Suspended)
|
if (Suspended)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (UnpAudioBlock)
|
if (UnpAudioBlock)
|
||||||
{
|
{
|
||||||
int AudioNumber=DecodeNumber((struct Decode *)&MD[UnpCurChannel]);
|
int AudioNumber=DecodeNumber(Inp,&MD[UnpCurChannel]);
|
||||||
|
|
||||||
if (AudioNumber==256)
|
if (AudioNumber==256)
|
||||||
{
|
{
|
||||||
|
@ -102,7 +62,7 @@ void Unpack::Unpack20(bool Solid)
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
int Number=DecodeNumber((struct Decode *)&LD);
|
int Number=DecodeNumber(Inp,&BlockTables.LD);
|
||||||
if (Number<256)
|
if (Number<256)
|
||||||
{
|
{
|
||||||
Window[UnpPtr++]=(byte)Number;
|
Window[UnpPtr++]=(byte)Number;
|
||||||
|
@ -114,16 +74,16 @@ void Unpack::Unpack20(bool Solid)
|
||||||
int Length=LDecode[Number-=270]+3;
|
int Length=LDecode[Number-=270]+3;
|
||||||
if ((Bits=LBits[Number])>0)
|
if ((Bits=LBits[Number])>0)
|
||||||
{
|
{
|
||||||
Length+=getbits()>>(16-Bits);
|
Length+=Inp.getbits()>>(16-Bits);
|
||||||
addbits(Bits);
|
Inp.addbits(Bits);
|
||||||
}
|
}
|
||||||
|
|
||||||
int DistNumber=DecodeNumber((struct Decode *)&DD);
|
int DistNumber=DecodeNumber(Inp,&BlockTables.DD);
|
||||||
unsigned int Distance=DDecode[DistNumber]+1;
|
unsigned int Distance=DDecode[DistNumber]+1;
|
||||||
if ((Bits=DBits[DistNumber])>0)
|
if ((Bits=DBits[DistNumber])>0)
|
||||||
{
|
{
|
||||||
Distance+=getbits()>>(16-Bits);
|
Distance+=Inp.getbits()>>(16-Bits);
|
||||||
addbits(Bits);
|
Inp.addbits(Bits);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Distance>=0x2000)
|
if (Distance>=0x2000)
|
||||||
|
@ -150,12 +110,12 @@ void Unpack::Unpack20(bool Solid)
|
||||||
if (Number<261)
|
if (Number<261)
|
||||||
{
|
{
|
||||||
unsigned int Distance=OldDist[(OldDistPtr-(Number-256)) & 3];
|
unsigned int Distance=OldDist[(OldDistPtr-(Number-256)) & 3];
|
||||||
int LengthNumber=DecodeNumber((struct Decode *)&RD);
|
int LengthNumber=DecodeNumber(Inp,&BlockTables.RD);
|
||||||
int Length=LDecode[LengthNumber]+2;
|
int Length=LDecode[LengthNumber]+2;
|
||||||
if ((Bits=LBits[LengthNumber])>0)
|
if ((Bits=LBits[LengthNumber])>0)
|
||||||
{
|
{
|
||||||
Length+=getbits()>>(16-Bits);
|
Length+=Inp.getbits()>>(16-Bits);
|
||||||
addbits(Bits);
|
Inp.addbits(Bits);
|
||||||
}
|
}
|
||||||
if (Distance>=0x101)
|
if (Distance>=0x101)
|
||||||
{
|
{
|
||||||
|
@ -175,39 +135,55 @@ void Unpack::Unpack20(bool Solid)
|
||||||
unsigned int Distance=SDDecode[Number-=261]+1;
|
unsigned int Distance=SDDecode[Number-=261]+1;
|
||||||
if ((Bits=SDBits[Number])>0)
|
if ((Bits=SDBits[Number])>0)
|
||||||
{
|
{
|
||||||
Distance+=getbits()>>(16-Bits);
|
Distance+=Inp.getbits()>>(16-Bits);
|
||||||
addbits(Bits);
|
Inp.addbits(Bits);
|
||||||
}
|
}
|
||||||
CopyString20(2,Distance);
|
CopyString20(2,Distance);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ReadLastTables();
|
ReadLastTables();
|
||||||
OldUnpWriteBuf();
|
UnpWriteBuf20();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Unpack::UnpWriteBuf20()
|
||||||
|
{
|
||||||
|
if (UnpPtr!=WrPtr)
|
||||||
|
UnpSomeRead=true;
|
||||||
|
if (UnpPtr<WrPtr)
|
||||||
|
{
|
||||||
|
UnpIO->UnpWrite(&Window[WrPtr],-(int)WrPtr & MaxWinMask);
|
||||||
|
UnpIO->UnpWrite(Window,UnpPtr);
|
||||||
|
UnpAllBuf=true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
UnpIO->UnpWrite(&Window[WrPtr],UnpPtr-WrPtr);
|
||||||
|
WrPtr=UnpPtr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool Unpack::ReadTables20()
|
bool Unpack::ReadTables20()
|
||||||
{
|
{
|
||||||
byte BitLength[BC20];
|
byte BitLength[BC20];
|
||||||
unsigned char Table[MC20*4];
|
byte Table[MC20*4];
|
||||||
int TableSize,N,I;
|
int TableSize,N,I;
|
||||||
if (InAddr>ReadTop-25)
|
if (Inp.InAddr>ReadTop-25)
|
||||||
if (!UnpReadBuf())
|
if (!UnpReadBuf())
|
||||||
return(false);
|
return(false);
|
||||||
unsigned int BitField=getbits();
|
uint BitField=Inp.getbits();
|
||||||
UnpAudioBlock=(BitField & 0x8000);
|
UnpAudioBlock=(BitField & 0x8000);
|
||||||
|
|
||||||
if (!(BitField & 0x4000))
|
if (!(BitField & 0x4000))
|
||||||
memset(UnpOldTable20,0,sizeof(UnpOldTable20));
|
memset(UnpOldTable20,0,sizeof(UnpOldTable20));
|
||||||
addbits(2);
|
Inp.addbits(2);
|
||||||
|
|
||||||
if (UnpAudioBlock)
|
if (UnpAudioBlock)
|
||||||
{
|
{
|
||||||
UnpChannels=((BitField>>12) & 3)+1;
|
UnpChannels=((BitField>>12) & 3)+1;
|
||||||
if (UnpCurChannel>=UnpChannels)
|
if (UnpCurChannel>=UnpChannels)
|
||||||
UnpCurChannel=0;
|
UnpCurChannel=0;
|
||||||
addbits(2);
|
Inp.addbits(2);
|
||||||
TableSize=MC20*UnpChannels;
|
TableSize=MC20*UnpChannels;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -215,17 +191,17 @@ bool Unpack::ReadTables20()
|
||||||
|
|
||||||
for (I=0;I<BC20;I++)
|
for (I=0;I<BC20;I++)
|
||||||
{
|
{
|
||||||
BitLength[I]=(byte)(getbits() >> 12);
|
BitLength[I]=(byte)(Inp.getbits() >> 12);
|
||||||
addbits(4);
|
Inp.addbits(4);
|
||||||
}
|
}
|
||||||
MakeDecodeTables(BitLength,(struct Decode *)&BD,BC20);
|
MakeDecodeTables(BitLength,&BlockTables.BD,BC20);
|
||||||
I=0;
|
I=0;
|
||||||
while (I<TableSize)
|
while (I<TableSize)
|
||||||
{
|
{
|
||||||
if (InAddr>ReadTop-5)
|
if (Inp.InAddr>ReadTop-5)
|
||||||
if (!UnpReadBuf())
|
if (!UnpReadBuf())
|
||||||
return(false);
|
return false;
|
||||||
int Number=DecodeNumber((struct Decode *)&BD);
|
int Number=DecodeNumber(Inp,&BlockTables.BD);
|
||||||
if (Number<16)
|
if (Number<16)
|
||||||
{
|
{
|
||||||
Table[I]=(Number+UnpOldTable20[I]) & 0xf;
|
Table[I]=(Number+UnpOldTable20[I]) & 0xf;
|
||||||
|
@ -234,8 +210,9 @@ bool Unpack::ReadTables20()
|
||||||
else
|
else
|
||||||
if (Number==16)
|
if (Number==16)
|
||||||
{
|
{
|
||||||
N=(getbits() >> 14)+3;
|
N=(Inp.getbits() >> 14)+3;
|
||||||
addbits(2);
|
Inp.addbits(2);
|
||||||
|
if (I>0)
|
||||||
while (N-- > 0 && I<TableSize)
|
while (N-- > 0 && I<TableSize)
|
||||||
{
|
{
|
||||||
Table[I]=Table[I-1];
|
Table[I]=Table[I-1];
|
||||||
|
@ -246,28 +223,28 @@ bool Unpack::ReadTables20()
|
||||||
{
|
{
|
||||||
if (Number==17)
|
if (Number==17)
|
||||||
{
|
{
|
||||||
N=(getbits() >> 13)+3;
|
N=(Inp.getbits() >> 13)+3;
|
||||||
addbits(3);
|
Inp.addbits(3);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
N=(getbits() >> 9)+11;
|
N=(Inp.getbits() >> 9)+11;
|
||||||
addbits(7);
|
Inp.addbits(7);
|
||||||
}
|
}
|
||||||
while (N-- > 0 && I<TableSize)
|
while (N-- > 0 && I<TableSize)
|
||||||
Table[I++]=0;
|
Table[I++]=0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (InAddr>ReadTop)
|
if (Inp.InAddr>ReadTop)
|
||||||
return(true);
|
return(true);
|
||||||
if (UnpAudioBlock)
|
if (UnpAudioBlock)
|
||||||
for (I=0;I<UnpChannels;I++)
|
for (I=0;I<UnpChannels;I++)
|
||||||
MakeDecodeTables(&Table[I*MC20],(struct Decode *)&MD[I],MC20);
|
MakeDecodeTables(&Table[I*MC20],&MD[I],MC20);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
MakeDecodeTables(&Table[0],(struct Decode *)&LD,NC20);
|
MakeDecodeTables(&Table[0],&BlockTables.LD,NC20);
|
||||||
MakeDecodeTables(&Table[NC20],(struct Decode *)&DD,DC20);
|
MakeDecodeTables(&Table[NC20],&BlockTables.DD,DC20);
|
||||||
MakeDecodeTables(&Table[NC20+DC20],(struct Decode *)&RD,RC20);
|
MakeDecodeTables(&Table[NC20+DC20],&BlockTables.RD,RC20);
|
||||||
}
|
}
|
||||||
memcpy(UnpOldTable20,Table,sizeof(UnpOldTable20));
|
memcpy(UnpOldTable20,Table,sizeof(UnpOldTable20));
|
||||||
return(true);
|
return(true);
|
||||||
|
@ -276,14 +253,14 @@ bool Unpack::ReadTables20()
|
||||||
|
|
||||||
void Unpack::ReadLastTables()
|
void Unpack::ReadLastTables()
|
||||||
{
|
{
|
||||||
if (ReadTop>=InAddr+5)
|
if (ReadTop>=Inp.InAddr+5)
|
||||||
if (UnpAudioBlock)
|
if (UnpAudioBlock)
|
||||||
{
|
{
|
||||||
if (DecodeNumber((struct Decode *)&MD[UnpCurChannel])==256)
|
if (DecodeNumber(Inp,&MD[UnpCurChannel])==256)
|
||||||
ReadTables20();
|
ReadTables20();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
if (DecodeNumber((struct Decode *)&LD)==269)
|
if (DecodeNumber(Inp,&BlockTables.LD)==269)
|
||||||
ReadTables20();
|
ReadTables20();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -391,4 +368,5 @@ byte Unpack::DecodeAudio(int Delta)
|
||||||
}
|
}
|
||||||
return((byte)Ch);
|
return((byte)Ch);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -0,0 +1,840 @@
|
||||||
|
#ifdef RAR_COMMON_HPP
|
||||||
|
|
||||||
|
// We use it instead of direct PPM.DecodeChar call to be sure that
|
||||||
|
// we reset PPM structures in case of corrupt data. It is important,
|
||||||
|
// because these structures can be invalid after PPM.DecodeChar returned -1.
|
||||||
|
inline int Unpack::SafePPMDecodeChar()
|
||||||
|
{
|
||||||
|
int Ch=PPM.DecodeChar();
|
||||||
|
if (Ch==-1) // Corrupt PPM data found.
|
||||||
|
{
|
||||||
|
PPM.CleanUp(); // Reset possibly corrupt PPM data structures.
|
||||||
|
UnpBlockType=BLOCK_LZ; // Set faster and more fail proof LZ mode.
|
||||||
|
}
|
||||||
|
return(Ch);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Unpack::Unpack29(bool Solid)
|
||||||
|
{
|
||||||
|
static unsigned char LDecode[]={0,1,2,3,4,5,6,7,8,10,12,14,16,20,24,28,32,40,48,56,64,80,96,112,128,160,192,224};
|
||||||
|
static unsigned char LBits[]= {0,0,0,0,0,0,0,0,1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5};
|
||||||
|
static int DDecode[DC];
|
||||||
|
static byte DBits[DC];
|
||||||
|
static int DBitLengthCounts[]= {4,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,14,0,12};
|
||||||
|
static unsigned char SDDecode[]={0,4,8,16,32,64,128,192};
|
||||||
|
static unsigned char SDBits[]= {2,2,3, 4, 5, 6, 6, 6};
|
||||||
|
unsigned int Bits;
|
||||||
|
|
||||||
|
if (DDecode[1]==0)
|
||||||
|
{
|
||||||
|
int Dist=0,BitLength=0,Slot=0;
|
||||||
|
for (int I=0;I<ASIZE(DBitLengthCounts);I++,BitLength++)
|
||||||
|
for (int J=0;J<DBitLengthCounts[I];J++,Slot++,Dist+=(1<<BitLength))
|
||||||
|
{
|
||||||
|
DDecode[Slot]=Dist;
|
||||||
|
DBits[Slot]=BitLength;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
FileExtracted=true;
|
||||||
|
|
||||||
|
if (!Suspended)
|
||||||
|
{
|
||||||
|
UnpInitData(Solid);
|
||||||
|
if (!UnpReadBuf30())
|
||||||
|
return;
|
||||||
|
if ((!Solid || !TablesRead) && !ReadTables30())
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
while (true)
|
||||||
|
{
|
||||||
|
UnpPtr&=MaxWinMask;
|
||||||
|
|
||||||
|
if (Inp.InAddr>ReadBorder)
|
||||||
|
{
|
||||||
|
if (!UnpReadBuf30())
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (((WrPtr-UnpPtr) & MaxWinMask)<260 && WrPtr!=UnpPtr)
|
||||||
|
{
|
||||||
|
UnpWriteBuf30();
|
||||||
|
if (WrittenFileSize>DestUnpSize)
|
||||||
|
return;
|
||||||
|
if (Suspended)
|
||||||
|
{
|
||||||
|
FileExtracted=false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (UnpBlockType==BLOCK_PPM)
|
||||||
|
{
|
||||||
|
// Here speed is critical, so we do not use SafePPMDecodeChar,
|
||||||
|
// because sometimes even the inline function can introduce
|
||||||
|
// some additional penalty.
|
||||||
|
int Ch=PPM.DecodeChar();
|
||||||
|
if (Ch==-1) // Corrupt PPM data found.
|
||||||
|
{
|
||||||
|
PPM.CleanUp(); // Reset possibly corrupt PPM data structures.
|
||||||
|
UnpBlockType=BLOCK_LZ; // Set faster and more fail proof LZ mode.
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (Ch==PPMEscChar)
|
||||||
|
{
|
||||||
|
int NextCh=SafePPMDecodeChar();
|
||||||
|
if (NextCh==0) // End of PPM encoding.
|
||||||
|
{
|
||||||
|
if (!ReadTables30())
|
||||||
|
break;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (NextCh==-1) // Corrupt PPM data found.
|
||||||
|
break;
|
||||||
|
if (NextCh==2) // End of file in PPM mode.
|
||||||
|
break;
|
||||||
|
if (NextCh==3) // Read VM code.
|
||||||
|
{
|
||||||
|
if (!ReadVMCodePPM())
|
||||||
|
break;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (NextCh==4) // LZ inside of PPM.
|
||||||
|
{
|
||||||
|
unsigned int Distance=0,Length;
|
||||||
|
bool Failed=false;
|
||||||
|
for (int I=0;I<4 && !Failed;I++)
|
||||||
|
{
|
||||||
|
int Ch=SafePPMDecodeChar();
|
||||||
|
if (Ch==-1)
|
||||||
|
Failed=true;
|
||||||
|
else
|
||||||
|
if (I==3)
|
||||||
|
Length=(byte)Ch;
|
||||||
|
else
|
||||||
|
Distance=(Distance<<8)+(byte)Ch;
|
||||||
|
}
|
||||||
|
if (Failed)
|
||||||
|
break;
|
||||||
|
|
||||||
|
CopyString(Length+32,Distance+2);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (NextCh==5) // One byte distance match (RLE) inside of PPM.
|
||||||
|
{
|
||||||
|
int Length=SafePPMDecodeChar();
|
||||||
|
if (Length==-1)
|
||||||
|
break;
|
||||||
|
CopyString(Length+4,1);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
// If we are here, NextCh must be 1, what means that current byte
|
||||||
|
// is equal to our 'escape' byte, so we just store it to Window.
|
||||||
|
}
|
||||||
|
Window[UnpPtr++]=Ch;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
int Number=DecodeNumber(Inp,&BlockTables.LD);
|
||||||
|
if (Number<256)
|
||||||
|
{
|
||||||
|
Window[UnpPtr++]=(byte)Number;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (Number>=271)
|
||||||
|
{
|
||||||
|
int Length=LDecode[Number-=271]+3;
|
||||||
|
if ((Bits=LBits[Number])>0)
|
||||||
|
{
|
||||||
|
Length+=Inp.getbits()>>(16-Bits);
|
||||||
|
Inp.addbits(Bits);
|
||||||
|
}
|
||||||
|
|
||||||
|
int DistNumber=DecodeNumber(Inp,&BlockTables.DD);
|
||||||
|
unsigned int Distance=DDecode[DistNumber]+1;
|
||||||
|
if ((Bits=DBits[DistNumber])>0)
|
||||||
|
{
|
||||||
|
if (DistNumber>9)
|
||||||
|
{
|
||||||
|
if (Bits>4)
|
||||||
|
{
|
||||||
|
Distance+=((Inp.getbits()>>(20-Bits))<<4);
|
||||||
|
Inp.addbits(Bits-4);
|
||||||
|
}
|
||||||
|
if (LowDistRepCount>0)
|
||||||
|
{
|
||||||
|
LowDistRepCount--;
|
||||||
|
Distance+=PrevLowDist;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
int LowDist=DecodeNumber(Inp,&BlockTables.LDD);
|
||||||
|
if (LowDist==16)
|
||||||
|
{
|
||||||
|
LowDistRepCount=LOW_DIST_REP_COUNT-1;
|
||||||
|
Distance+=PrevLowDist;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Distance+=LowDist;
|
||||||
|
PrevLowDist=LowDist;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Distance+=Inp.getbits()>>(16-Bits);
|
||||||
|
Inp.addbits(Bits);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Distance>=0x2000)
|
||||||
|
{
|
||||||
|
Length++;
|
||||||
|
if (Distance>=0x40000L)
|
||||||
|
Length++;
|
||||||
|
}
|
||||||
|
|
||||||
|
InsertOldDist(Distance);
|
||||||
|
LastLength=Length;
|
||||||
|
CopyString(Length,Distance);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (Number==256)
|
||||||
|
{
|
||||||
|
if (!ReadEndOfBlock())
|
||||||
|
break;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (Number==257)
|
||||||
|
{
|
||||||
|
if (!ReadVMCode())
|
||||||
|
break;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (Number==258)
|
||||||
|
{
|
||||||
|
if (LastLength!=0)
|
||||||
|
CopyString(LastLength,OldDist[0]);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (Number<263)
|
||||||
|
{
|
||||||
|
int DistNum=Number-259;
|
||||||
|
unsigned int Distance=OldDist[DistNum];
|
||||||
|
for (int I=DistNum;I>0;I--)
|
||||||
|
OldDist[I]=OldDist[I-1];
|
||||||
|
OldDist[0]=Distance;
|
||||||
|
|
||||||
|
int LengthNumber=DecodeNumber(Inp,&BlockTables.RD);
|
||||||
|
int Length=LDecode[LengthNumber]+2;
|
||||||
|
if ((Bits=LBits[LengthNumber])>0)
|
||||||
|
{
|
||||||
|
Length+=Inp.getbits()>>(16-Bits);
|
||||||
|
Inp.addbits(Bits);
|
||||||
|
}
|
||||||
|
LastLength=Length;
|
||||||
|
CopyString(Length,Distance);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (Number<272)
|
||||||
|
{
|
||||||
|
unsigned int Distance=SDDecode[Number-=263]+1;
|
||||||
|
if ((Bits=SDBits[Number])>0)
|
||||||
|
{
|
||||||
|
Distance+=Inp.getbits()>>(16-Bits);
|
||||||
|
Inp.addbits(Bits);
|
||||||
|
}
|
||||||
|
InsertOldDist(Distance);
|
||||||
|
LastLength=2;
|
||||||
|
CopyString(2,Distance);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
UnpWriteBuf30();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Return 'false' to quit unpacking the current file or 'true' to continue.
|
||||||
|
bool Unpack::ReadEndOfBlock()
|
||||||
|
{
|
||||||
|
uint BitField=Inp.getbits();
|
||||||
|
bool NewTable,NewFile=false;
|
||||||
|
|
||||||
|
// "1" - no new file, new table just here.
|
||||||
|
// "00" - new file, no new table.
|
||||||
|
// "01" - new file, new table (in beginning of next file).
|
||||||
|
|
||||||
|
if ((BitField & 0x8000)!=0)
|
||||||
|
{
|
||||||
|
NewTable=true;
|
||||||
|
Inp.addbits(1);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
NewFile=true;
|
||||||
|
NewTable=(BitField & 0x4000)!=0;
|
||||||
|
Inp.addbits(2);
|
||||||
|
}
|
||||||
|
TablesRead=!NewTable;
|
||||||
|
|
||||||
|
// Quit immediately if "new file" flag is set. If "new table" flag
|
||||||
|
// is present, we'll read the table in beginning of next file
|
||||||
|
// based on 'TablesRead' 'false' value.
|
||||||
|
if (NewFile)
|
||||||
|
return false;
|
||||||
|
return ReadTables30(); // Quit only if we failed to read tables.
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool Unpack::ReadVMCode()
|
||||||
|
{
|
||||||
|
// Entire VM code is guaranteed to fully present in block defined
|
||||||
|
// by current Huffman table. Compressor checks that VM code does not cross
|
||||||
|
// Huffman block boundaries.
|
||||||
|
unsigned int FirstByte=Inp.getbits()>>8;
|
||||||
|
Inp.addbits(8);
|
||||||
|
int Length=(FirstByte & 7)+1;
|
||||||
|
if (Length==7)
|
||||||
|
{
|
||||||
|
Length=(Inp.getbits()>>8)+7;
|
||||||
|
Inp.addbits(8);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
if (Length==8)
|
||||||
|
{
|
||||||
|
Length=Inp.getbits();
|
||||||
|
Inp.addbits(16);
|
||||||
|
}
|
||||||
|
Array<byte> VMCode(Length);
|
||||||
|
for (int I=0;I<Length;I++)
|
||||||
|
{
|
||||||
|
// Try to read the new buffer if only one byte is left.
|
||||||
|
// But if we read all bytes except the last, one byte is enough.
|
||||||
|
if (Inp.InAddr>=ReadTop-1 && !UnpReadBuf30() && I<Length-1)
|
||||||
|
return(false);
|
||||||
|
VMCode[I]=Inp.getbits()>>8;
|
||||||
|
Inp.addbits(8);
|
||||||
|
}
|
||||||
|
return(AddVMCode(FirstByte,&VMCode[0],Length));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool Unpack::ReadVMCodePPM()
|
||||||
|
{
|
||||||
|
unsigned int FirstByte=SafePPMDecodeChar();
|
||||||
|
if ((int)FirstByte==-1)
|
||||||
|
return(false);
|
||||||
|
int Length=(FirstByte & 7)+1;
|
||||||
|
if (Length==7)
|
||||||
|
{
|
||||||
|
int B1=SafePPMDecodeChar();
|
||||||
|
if (B1==-1)
|
||||||
|
return(false);
|
||||||
|
Length=B1+7;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
if (Length==8)
|
||||||
|
{
|
||||||
|
int B1=SafePPMDecodeChar();
|
||||||
|
if (B1==-1)
|
||||||
|
return(false);
|
||||||
|
int B2=SafePPMDecodeChar();
|
||||||
|
if (B2==-1)
|
||||||
|
return(false);
|
||||||
|
Length=B1*256+B2;
|
||||||
|
}
|
||||||
|
Array<byte> VMCode(Length);
|
||||||
|
for (int I=0;I<Length;I++)
|
||||||
|
{
|
||||||
|
int Ch=SafePPMDecodeChar();
|
||||||
|
if (Ch==-1)
|
||||||
|
return(false);
|
||||||
|
VMCode[I]=Ch;
|
||||||
|
}
|
||||||
|
return(AddVMCode(FirstByte,&VMCode[0],Length));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool Unpack::AddVMCode(uint FirstByte,byte *Code,int CodeSize)
|
||||||
|
{
|
||||||
|
VMCodeInp.InitBitInput();
|
||||||
|
memcpy(VMCodeInp.InBuf,Code,Min(BitInput::MAX_SIZE,CodeSize));
|
||||||
|
VM.Init();
|
||||||
|
|
||||||
|
uint FiltPos;
|
||||||
|
if (FirstByte & 0x80)
|
||||||
|
{
|
||||||
|
FiltPos=RarVM::ReadData(VMCodeInp);
|
||||||
|
if (FiltPos==0)
|
||||||
|
InitFilters30();
|
||||||
|
else
|
||||||
|
FiltPos--;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
FiltPos=LastFilter; // Use the same filter as last time.
|
||||||
|
|
||||||
|
if (FiltPos>Filters30.Size() || FiltPos>OldFilterLengths.Size())
|
||||||
|
return(false);
|
||||||
|
LastFilter=FiltPos;
|
||||||
|
bool NewFilter=(FiltPos==Filters30.Size());
|
||||||
|
|
||||||
|
UnpackFilter30 *StackFilter=new UnpackFilter30; // New filter for PrgStack.
|
||||||
|
|
||||||
|
UnpackFilter30 *Filter;
|
||||||
|
if (NewFilter) // New filter code, never used before since VM reset.
|
||||||
|
{
|
||||||
|
if (FiltPos>MAX3_FILTERS)
|
||||||
|
{
|
||||||
|
// Too many different filters, corrupt archive.
|
||||||
|
delete StackFilter;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
Filters30.Add(1);
|
||||||
|
Filters30[Filters30.Size()-1]=Filter=new UnpackFilter30;
|
||||||
|
StackFilter->ParentFilter=(uint)(Filters30.Size()-1);
|
||||||
|
|
||||||
|
// Reserve one item, where we store the data block length of our new
|
||||||
|
// filter entry. We'll set it to real block length below, after reading
|
||||||
|
// it. But we need to initialize it now, because when processing corrupt
|
||||||
|
// data, we can access this item even before we set it to real value.
|
||||||
|
OldFilterLengths.Push(0);
|
||||||
|
Filter->ExecCount=0;
|
||||||
|
}
|
||||||
|
else // Filter was used in the past.
|
||||||
|
{
|
||||||
|
Filter=Filters30[FiltPos];
|
||||||
|
StackFilter->ParentFilter=FiltPos;
|
||||||
|
Filter->ExecCount++;
|
||||||
|
}
|
||||||
|
|
||||||
|
int EmptyCount=0;
|
||||||
|
for (uint I=0;I<PrgStack.Size();I++)
|
||||||
|
{
|
||||||
|
PrgStack[I-EmptyCount]=PrgStack[I];
|
||||||
|
if (PrgStack[I]==NULL)
|
||||||
|
EmptyCount++;
|
||||||
|
if (EmptyCount>0)
|
||||||
|
PrgStack[I]=NULL;
|
||||||
|
}
|
||||||
|
if (EmptyCount==0)
|
||||||
|
{
|
||||||
|
PrgStack.Add(1);
|
||||||
|
EmptyCount=1;
|
||||||
|
}
|
||||||
|
int StackPos=(int)(PrgStack.Size()-EmptyCount);
|
||||||
|
PrgStack[StackPos]=StackFilter;
|
||||||
|
StackFilter->ExecCount=Filter->ExecCount;
|
||||||
|
|
||||||
|
uint BlockStart=RarVM::ReadData(VMCodeInp);
|
||||||
|
if (FirstByte & 0x40)
|
||||||
|
BlockStart+=258;
|
||||||
|
StackFilter->BlockStart=(uint)((BlockStart+UnpPtr)&MaxWinMask);
|
||||||
|
if (FirstByte & 0x20)
|
||||||
|
{
|
||||||
|
StackFilter->BlockLength=RarVM::ReadData(VMCodeInp);
|
||||||
|
|
||||||
|
// Store the last data block length for current filter.
|
||||||
|
OldFilterLengths[FiltPos]=StackFilter->BlockLength;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Set the data block size to same value as the previous block size
|
||||||
|
// for same filter. It is possible on corrupt data to access here a new
|
||||||
|
// and not filled yet item of OldFilterLengths array. This is why above
|
||||||
|
// we set new OldFilterLengths items to zero.
|
||||||
|
StackFilter->BlockLength=FiltPos<OldFilterLengths.Size() ? OldFilterLengths[FiltPos]:0;
|
||||||
|
}
|
||||||
|
|
||||||
|
StackFilter->NextWindow=WrPtr!=UnpPtr && ((WrPtr-UnpPtr)&MaxWinMask)<=BlockStart;
|
||||||
|
|
||||||
|
// DebugLog("\nNextWindow: UnpPtr=%08x WrPtr=%08x BlockStart=%08x",UnpPtr,WrPtr,BlockStart);
|
||||||
|
|
||||||
|
memset(StackFilter->Prg.InitR,0,sizeof(StackFilter->Prg.InitR));
|
||||||
|
StackFilter->Prg.InitR[3]=VM_GLOBALMEMADDR;
|
||||||
|
StackFilter->Prg.InitR[4]=StackFilter->BlockLength;
|
||||||
|
StackFilter->Prg.InitR[5]=StackFilter->ExecCount;
|
||||||
|
|
||||||
|
if (FirstByte & 0x10) // set registers to optional parameters if any
|
||||||
|
{
|
||||||
|
unsigned int InitMask=VMCodeInp.fgetbits()>>9;
|
||||||
|
VMCodeInp.faddbits(7);
|
||||||
|
for (int I=0;I<7;I++)
|
||||||
|
if (InitMask & (1<<I))
|
||||||
|
StackFilter->Prg.InitR[I]=RarVM::ReadData(VMCodeInp);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (NewFilter)
|
||||||
|
{
|
||||||
|
uint VMCodeSize=RarVM::ReadData(VMCodeInp);
|
||||||
|
if (VMCodeSize>=0x10000 || VMCodeSize==0)
|
||||||
|
return(false);
|
||||||
|
Array<byte> VMCode(VMCodeSize);
|
||||||
|
for (uint I=0;I<VMCodeSize;I++)
|
||||||
|
{
|
||||||
|
if (VMCodeInp.Overflow(3))
|
||||||
|
return(false);
|
||||||
|
VMCode[I]=VMCodeInp.fgetbits()>>8;
|
||||||
|
VMCodeInp.faddbits(8);
|
||||||
|
}
|
||||||
|
VM.Prepare(&VMCode[0],VMCodeSize,&Filter->Prg);
|
||||||
|
}
|
||||||
|
StackFilter->Prg.AltCmd=&Filter->Prg.Cmd[0];
|
||||||
|
StackFilter->Prg.CmdCount=Filter->Prg.CmdCount;
|
||||||
|
|
||||||
|
size_t StaticDataSize=Filter->Prg.StaticData.Size();
|
||||||
|
if (StaticDataSize>0 && StaticDataSize<VM_GLOBALMEMSIZE)
|
||||||
|
{
|
||||||
|
// read statically defined data contained in DB commands
|
||||||
|
StackFilter->Prg.StaticData.Add(StaticDataSize);
|
||||||
|
memcpy(&StackFilter->Prg.StaticData[0],&Filter->Prg.StaticData[0],StaticDataSize);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (StackFilter->Prg.GlobalData.Size()<VM_FIXEDGLOBALSIZE)
|
||||||
|
{
|
||||||
|
StackFilter->Prg.GlobalData.Reset();
|
||||||
|
StackFilter->Prg.GlobalData.Add(VM_FIXEDGLOBALSIZE);
|
||||||
|
}
|
||||||
|
byte *GlobalData=&StackFilter->Prg.GlobalData[0];
|
||||||
|
for (int I=0;I<7;I++)
|
||||||
|
VM.SetLowEndianValue((uint *)&GlobalData[I*4],StackFilter->Prg.InitR[I]);
|
||||||
|
VM.SetLowEndianValue((uint *)&GlobalData[0x1c],StackFilter->BlockLength);
|
||||||
|
VM.SetLowEndianValue((uint *)&GlobalData[0x20],0);
|
||||||
|
VM.SetLowEndianValue((uint *)&GlobalData[0x2c],StackFilter->ExecCount);
|
||||||
|
memset(&GlobalData[0x30],0,16);
|
||||||
|
|
||||||
|
if (FirstByte & 8) // Put the data block passed as parameter if any.
|
||||||
|
{
|
||||||
|
if (VMCodeInp.Overflow(3))
|
||||||
|
return(false);
|
||||||
|
uint DataSize=RarVM::ReadData(VMCodeInp);
|
||||||
|
if (DataSize>VM_GLOBALMEMSIZE-VM_FIXEDGLOBALSIZE)
|
||||||
|
return(false);
|
||||||
|
size_t CurSize=StackFilter->Prg.GlobalData.Size();
|
||||||
|
if (CurSize<DataSize+VM_FIXEDGLOBALSIZE)
|
||||||
|
StackFilter->Prg.GlobalData.Add(DataSize+VM_FIXEDGLOBALSIZE-CurSize);
|
||||||
|
byte *GlobalData=&StackFilter->Prg.GlobalData[VM_FIXEDGLOBALSIZE];
|
||||||
|
for (uint I=0;I<DataSize;I++)
|
||||||
|
{
|
||||||
|
if (VMCodeInp.Overflow(3))
|
||||||
|
return(false);
|
||||||
|
GlobalData[I]=VMCodeInp.fgetbits()>>8;
|
||||||
|
VMCodeInp.faddbits(8);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool Unpack::UnpReadBuf30()
|
||||||
|
{
|
||||||
|
int DataSize=ReadTop-Inp.InAddr; // Data left to process.
|
||||||
|
if (DataSize<0)
|
||||||
|
return(false);
|
||||||
|
if (Inp.InAddr>BitInput::MAX_SIZE/2)
|
||||||
|
{
|
||||||
|
// If we already processed more than half of buffer, let's move
|
||||||
|
// remaining data into beginning to free more space for new data
|
||||||
|
// and ensure that calling function does not cross the buffer border
|
||||||
|
// even if we did not read anything here. Also it ensures that read size
|
||||||
|
// is not less than CRYPT_BLOCK_SIZE, so we can align it without risk
|
||||||
|
// to make it zero.
|
||||||
|
if (DataSize>0)
|
||||||
|
memmove(Inp.InBuf,Inp.InBuf+Inp.InAddr,DataSize);
|
||||||
|
Inp.InAddr=0;
|
||||||
|
ReadTop=DataSize;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
DataSize=ReadTop;
|
||||||
|
int ReadCode=UnpIO->UnpRead(Inp.InBuf+DataSize,BitInput::MAX_SIZE-DataSize);
|
||||||
|
if (ReadCode>0)
|
||||||
|
ReadTop+=ReadCode;
|
||||||
|
ReadBorder=ReadTop-30;
|
||||||
|
return(ReadCode!=-1);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Unpack::UnpWriteBuf30()
|
||||||
|
{
|
||||||
|
uint WrittenBorder=(uint)WrPtr;
|
||||||
|
uint WriteSize=(uint)((UnpPtr-WrittenBorder)&MaxWinMask);
|
||||||
|
for (size_t I=0;I<PrgStack.Size();I++)
|
||||||
|
{
|
||||||
|
// Here we apply filters to data which we need to write.
|
||||||
|
// We always copy data to virtual machine memory before processing.
|
||||||
|
// We cannot process them just in place in Window buffer, because
|
||||||
|
// these data can be used for future string matches, so we must
|
||||||
|
// preserve them in original form.
|
||||||
|
|
||||||
|
UnpackFilter30 *flt=PrgStack[I];
|
||||||
|
if (flt==NULL)
|
||||||
|
continue;
|
||||||
|
if (flt->NextWindow)
|
||||||
|
{
|
||||||
|
flt->NextWindow=false;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
unsigned int BlockStart=flt->BlockStart;
|
||||||
|
unsigned int BlockLength=flt->BlockLength;
|
||||||
|
if (((BlockStart-WrittenBorder)&MaxWinMask)<WriteSize)
|
||||||
|
{
|
||||||
|
if (WrittenBorder!=BlockStart)
|
||||||
|
{
|
||||||
|
UnpWriteArea(WrittenBorder,BlockStart);
|
||||||
|
WrittenBorder=BlockStart;
|
||||||
|
WriteSize=(uint)((UnpPtr-WrittenBorder)&MaxWinMask);
|
||||||
|
}
|
||||||
|
if (BlockLength<=WriteSize)
|
||||||
|
{
|
||||||
|
uint BlockEnd=(BlockStart+BlockLength)&MaxWinMask;
|
||||||
|
if (BlockStart<BlockEnd || BlockEnd==0)
|
||||||
|
VM.SetMemory(0,Window+BlockStart,BlockLength);
|
||||||
|
else
|
||||||
|
{
|
||||||
|
uint FirstPartLength=uint(MaxWinSize-BlockStart);
|
||||||
|
VM.SetMemory(0,Window+BlockStart,FirstPartLength);
|
||||||
|
VM.SetMemory(FirstPartLength,Window,BlockEnd);
|
||||||
|
}
|
||||||
|
|
||||||
|
VM_PreparedProgram *ParentPrg=&Filters30[flt->ParentFilter]->Prg;
|
||||||
|
VM_PreparedProgram *Prg=&flt->Prg;
|
||||||
|
|
||||||
|
if (ParentPrg->GlobalData.Size()>VM_FIXEDGLOBALSIZE)
|
||||||
|
{
|
||||||
|
// Copy global data from previous script execution if any.
|
||||||
|
Prg->GlobalData.Alloc(ParentPrg->GlobalData.Size());
|
||||||
|
memcpy(&Prg->GlobalData[VM_FIXEDGLOBALSIZE],&ParentPrg->GlobalData[VM_FIXEDGLOBALSIZE],ParentPrg->GlobalData.Size()-VM_FIXEDGLOBALSIZE);
|
||||||
|
}
|
||||||
|
|
||||||
|
ExecuteCode(Prg);
|
||||||
|
|
||||||
|
if (Prg->GlobalData.Size()>VM_FIXEDGLOBALSIZE)
|
||||||
|
{
|
||||||
|
// Save global data for next script execution.
|
||||||
|
if (ParentPrg->GlobalData.Size()<Prg->GlobalData.Size())
|
||||||
|
ParentPrg->GlobalData.Alloc(Prg->GlobalData.Size());
|
||||||
|
memcpy(&ParentPrg->GlobalData[VM_FIXEDGLOBALSIZE],&Prg->GlobalData[VM_FIXEDGLOBALSIZE],Prg->GlobalData.Size()-VM_FIXEDGLOBALSIZE);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
ParentPrg->GlobalData.Reset();
|
||||||
|
|
||||||
|
byte *FilteredData=Prg->FilteredData;
|
||||||
|
unsigned int FilteredDataSize=Prg->FilteredDataSize;
|
||||||
|
|
||||||
|
delete PrgStack[I];
|
||||||
|
PrgStack[I]=NULL;
|
||||||
|
while (I+1<PrgStack.Size())
|
||||||
|
{
|
||||||
|
UnpackFilter30 *NextFilter=PrgStack[I+1];
|
||||||
|
if (NextFilter==NULL || NextFilter->BlockStart!=BlockStart ||
|
||||||
|
NextFilter->BlockLength!=FilteredDataSize || NextFilter->NextWindow)
|
||||||
|
break;
|
||||||
|
|
||||||
|
// Apply several filters to same data block.
|
||||||
|
|
||||||
|
VM.SetMemory(0,FilteredData,FilteredDataSize);
|
||||||
|
|
||||||
|
VM_PreparedProgram *ParentPrg=&Filters30[NextFilter->ParentFilter]->Prg;
|
||||||
|
VM_PreparedProgram *NextPrg=&NextFilter->Prg;
|
||||||
|
|
||||||
|
if (ParentPrg->GlobalData.Size()>VM_FIXEDGLOBALSIZE)
|
||||||
|
{
|
||||||
|
// Copy global data from previous script execution if any.
|
||||||
|
NextPrg->GlobalData.Alloc(ParentPrg->GlobalData.Size());
|
||||||
|
memcpy(&NextPrg->GlobalData[VM_FIXEDGLOBALSIZE],&ParentPrg->GlobalData[VM_FIXEDGLOBALSIZE],ParentPrg->GlobalData.Size()-VM_FIXEDGLOBALSIZE);
|
||||||
|
}
|
||||||
|
|
||||||
|
ExecuteCode(NextPrg);
|
||||||
|
|
||||||
|
if (NextPrg->GlobalData.Size()>VM_FIXEDGLOBALSIZE)
|
||||||
|
{
|
||||||
|
// Save global data for next script execution.
|
||||||
|
if (ParentPrg->GlobalData.Size()<NextPrg->GlobalData.Size())
|
||||||
|
ParentPrg->GlobalData.Alloc(NextPrg->GlobalData.Size());
|
||||||
|
memcpy(&ParentPrg->GlobalData[VM_FIXEDGLOBALSIZE],&NextPrg->GlobalData[VM_FIXEDGLOBALSIZE],NextPrg->GlobalData.Size()-VM_FIXEDGLOBALSIZE);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
ParentPrg->GlobalData.Reset();
|
||||||
|
|
||||||
|
FilteredData=NextPrg->FilteredData;
|
||||||
|
FilteredDataSize=NextPrg->FilteredDataSize;
|
||||||
|
I++;
|
||||||
|
delete PrgStack[I];
|
||||||
|
PrgStack[I]=NULL;
|
||||||
|
}
|
||||||
|
UnpIO->UnpWrite(FilteredData,FilteredDataSize);
|
||||||
|
UnpSomeRead=true;
|
||||||
|
WrittenFileSize+=FilteredDataSize;
|
||||||
|
WrittenBorder=BlockEnd;
|
||||||
|
WriteSize=uint((UnpPtr-WrittenBorder)&MaxWinMask);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Current filter intersects the window write border, so we adjust
|
||||||
|
// the window border to process this filter next time, not now.
|
||||||
|
for (size_t J=I;J<PrgStack.Size();J++)
|
||||||
|
{
|
||||||
|
UnpackFilter30 *flt=PrgStack[J];
|
||||||
|
if (flt!=NULL && flt->NextWindow)
|
||||||
|
flt->NextWindow=false;
|
||||||
|
}
|
||||||
|
WrPtr=WrittenBorder;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
UnpWriteArea(WrittenBorder,UnpPtr);
|
||||||
|
WrPtr=UnpPtr;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Unpack::ExecuteCode(VM_PreparedProgram *Prg)
|
||||||
|
{
|
||||||
|
if (Prg->GlobalData.Size()>0)
|
||||||
|
{
|
||||||
|
Prg->InitR[6]=(uint)WrittenFileSize;
|
||||||
|
VM.SetLowEndianValue((uint *)&Prg->GlobalData[0x24],(uint)WrittenFileSize);
|
||||||
|
VM.SetLowEndianValue((uint *)&Prg->GlobalData[0x28],(uint)(WrittenFileSize>>32));
|
||||||
|
VM.Execute(Prg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool Unpack::ReadTables30()
|
||||||
|
{
|
||||||
|
byte BitLength[BC];
|
||||||
|
byte Table[HUFF_TABLE_SIZE30];
|
||||||
|
if (Inp.InAddr>ReadTop-25)
|
||||||
|
if (!UnpReadBuf30())
|
||||||
|
return(false);
|
||||||
|
Inp.faddbits((8-Inp.InBit)&7);
|
||||||
|
uint BitField=Inp.fgetbits();
|
||||||
|
if (BitField & 0x8000)
|
||||||
|
{
|
||||||
|
UnpBlockType=BLOCK_PPM;
|
||||||
|
return(PPM.DecodeInit(this,PPMEscChar));
|
||||||
|
}
|
||||||
|
UnpBlockType=BLOCK_LZ;
|
||||||
|
|
||||||
|
PrevLowDist=0;
|
||||||
|
LowDistRepCount=0;
|
||||||
|
|
||||||
|
if (!(BitField & 0x4000))
|
||||||
|
memset(UnpOldTable,0,sizeof(UnpOldTable));
|
||||||
|
Inp.faddbits(2);
|
||||||
|
|
||||||
|
for (int I=0;I<BC;I++)
|
||||||
|
{
|
||||||
|
int Length=(byte)(Inp.fgetbits() >> 12);
|
||||||
|
Inp.faddbits(4);
|
||||||
|
if (Length==15)
|
||||||
|
{
|
||||||
|
int ZeroCount=(byte)(Inp.fgetbits() >> 12);
|
||||||
|
Inp.faddbits(4);
|
||||||
|
if (ZeroCount==0)
|
||||||
|
BitLength[I]=15;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ZeroCount+=2;
|
||||||
|
while (ZeroCount-- > 0 && I<ASIZE(BitLength))
|
||||||
|
BitLength[I++]=0;
|
||||||
|
I--;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
BitLength[I]=Length;
|
||||||
|
}
|
||||||
|
MakeDecodeTables(BitLength,&BlockTables.BD,BC30);
|
||||||
|
|
||||||
|
const int TableSize=HUFF_TABLE_SIZE30;
|
||||||
|
for (int I=0;I<TableSize;)
|
||||||
|
{
|
||||||
|
if (Inp.InAddr>ReadTop-5)
|
||||||
|
if (!UnpReadBuf30())
|
||||||
|
return(false);
|
||||||
|
int Number=DecodeNumber(Inp,&BlockTables.BD);
|
||||||
|
if (Number<16)
|
||||||
|
{
|
||||||
|
Table[I]=(Number+UnpOldTable[I]) & 0xf;
|
||||||
|
I++;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
if (Number<18)
|
||||||
|
{
|
||||||
|
int N;
|
||||||
|
if (Number==16)
|
||||||
|
{
|
||||||
|
N=(Inp.fgetbits() >> 13)+3;
|
||||||
|
Inp.faddbits(3);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
N=(Inp.fgetbits() >> 9)+11;
|
||||||
|
Inp.faddbits(7);
|
||||||
|
}
|
||||||
|
if (I>0)
|
||||||
|
while (N-- > 0 && I<TableSize)
|
||||||
|
{
|
||||||
|
Table[I]=Table[I-1];
|
||||||
|
I++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
int N;
|
||||||
|
if (Number==18)
|
||||||
|
{
|
||||||
|
N=(Inp.fgetbits() >> 13)+3;
|
||||||
|
Inp.faddbits(3);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
N=(Inp.fgetbits() >> 9)+11;
|
||||||
|
Inp.faddbits(7);
|
||||||
|
}
|
||||||
|
while (N-- > 0 && I<TableSize)
|
||||||
|
Table[I++]=0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
TablesRead=true;
|
||||||
|
if (Inp.InAddr>ReadTop)
|
||||||
|
return false;
|
||||||
|
MakeDecodeTables(&Table[0],&BlockTables.LD,NC30);
|
||||||
|
MakeDecodeTables(&Table[NC30],&BlockTables.DD,DC30);
|
||||||
|
MakeDecodeTables(&Table[NC30+DC30],&BlockTables.LDD,LDC30);
|
||||||
|
MakeDecodeTables(&Table[NC30+DC30+LDC30],&BlockTables.RD,RC30);
|
||||||
|
memcpy(UnpOldTable,Table,sizeof(UnpOldTable));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Unpack::UnpInitData30(bool Solid)
|
||||||
|
{
|
||||||
|
if (!Solid)
|
||||||
|
{
|
||||||
|
TablesRead=false;
|
||||||
|
memset(UnpOldTable,0,sizeof(UnpOldTable));
|
||||||
|
PPMEscChar=2;
|
||||||
|
UnpBlockType=BLOCK_LZ;
|
||||||
|
|
||||||
|
InitFilters30();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Unpack::InitFilters30()
|
||||||
|
{
|
||||||
|
OldFilterLengths.Reset();
|
||||||
|
LastFilter=0;
|
||||||
|
|
||||||
|
for (size_t I=0;I<Filters30.Size();I++)
|
||||||
|
delete Filters30[I];
|
||||||
|
Filters30.Reset();
|
||||||
|
for (size_t I=0;I<PrgStack.Size();I++)
|
||||||
|
delete PrgStack[I];
|
||||||
|
PrgStack.Reset();
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
|
@ -0,0 +1,652 @@
|
||||||
|
#ifdef RAR_COMMON_HPP
|
||||||
|
|
||||||
|
void Unpack::Unpack5(bool Solid)
|
||||||
|
{
|
||||||
|
FileExtracted=true;
|
||||||
|
|
||||||
|
if (!Suspended)
|
||||||
|
{
|
||||||
|
UnpInitData(Solid);
|
||||||
|
if (!UnpReadBuf())
|
||||||
|
return;
|
||||||
|
if (!ReadBlockHeader(Inp,BlockHeader) || !ReadTables(Inp,BlockHeader,BlockTables))
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
while (true)
|
||||||
|
{
|
||||||
|
UnpPtr&=MaxWinMask;
|
||||||
|
|
||||||
|
if (Inp.InAddr>=ReadBorder)
|
||||||
|
{
|
||||||
|
bool FileDone=false;
|
||||||
|
|
||||||
|
// We use 'while', because for empty block containing only Huffman table,
|
||||||
|
// we'll be on the block border once again just after reading the table.
|
||||||
|
while (Inp.InAddr>BlockHeader.BlockStart+BlockHeader.BlockSize-1 ||
|
||||||
|
Inp.InAddr==BlockHeader.BlockStart+BlockHeader.BlockSize-1 &&
|
||||||
|
Inp.InBit>=BlockHeader.BlockBitSize)
|
||||||
|
{
|
||||||
|
if (BlockHeader.LastBlockInFile)
|
||||||
|
{
|
||||||
|
FileDone=true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (!ReadBlockHeader(Inp,BlockHeader) || !ReadTables(Inp,BlockHeader,BlockTables))
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (FileDone || !UnpReadBuf())
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (((WriteBorder-UnpPtr) & MaxWinMask)<MAX_LZ_MATCH+3 && WriteBorder!=UnpPtr)
|
||||||
|
{
|
||||||
|
UnpWriteBuf();
|
||||||
|
if (WrittenFileSize>DestUnpSize)
|
||||||
|
return;
|
||||||
|
if (Suspended)
|
||||||
|
{
|
||||||
|
FileExtracted=false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
uint MainSlot=DecodeNumber(Inp,&BlockTables.LD);
|
||||||
|
if (MainSlot<256)
|
||||||
|
{
|
||||||
|
if (Fragmented)
|
||||||
|
FragWindow[UnpPtr++]=(byte)MainSlot;
|
||||||
|
else
|
||||||
|
Window[UnpPtr++]=(byte)MainSlot;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (MainSlot>=262)
|
||||||
|
{
|
||||||
|
uint Length=SlotToLength(Inp,MainSlot-262);
|
||||||
|
|
||||||
|
uint DBits,Distance=1,DistSlot=DecodeNumber(Inp,&BlockTables.DD);
|
||||||
|
if (DistSlot<4)
|
||||||
|
{
|
||||||
|
DBits=0;
|
||||||
|
Distance+=DistSlot;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
DBits=DistSlot/2 - 1;
|
||||||
|
Distance+=(2 | (DistSlot & 1)) << DBits;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (DBits>0)
|
||||||
|
{
|
||||||
|
if (DBits>=4)
|
||||||
|
{
|
||||||
|
if (DBits>4)
|
||||||
|
{
|
||||||
|
Distance+=((Inp.getbits32()>>(36-DBits))<<4);
|
||||||
|
Inp.addbits(DBits-4);
|
||||||
|
}
|
||||||
|
uint LowDist=DecodeNumber(Inp,&BlockTables.LDD);
|
||||||
|
Distance+=LowDist;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Distance+=Inp.getbits32()>>(32-DBits);
|
||||||
|
Inp.addbits(DBits);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Distance>0x100)
|
||||||
|
{
|
||||||
|
Length++;
|
||||||
|
if (Distance>0x2000)
|
||||||
|
{
|
||||||
|
Length++;
|
||||||
|
if (Distance>0x40000)
|
||||||
|
Length++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
InsertOldDist(Distance);
|
||||||
|
LastLength=Length;
|
||||||
|
if (Fragmented)
|
||||||
|
FragWindow.CopyString(Length,Distance,UnpPtr,MaxWinMask);
|
||||||
|
else
|
||||||
|
CopyString(Length,Distance);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (MainSlot==256)
|
||||||
|
{
|
||||||
|
UnpackFilter Filter;
|
||||||
|
if (!ReadFilter(Inp,Filter) || !AddFilter(Filter))
|
||||||
|
break;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (MainSlot==257)
|
||||||
|
{
|
||||||
|
if (LastLength!=0)
|
||||||
|
if (Fragmented)
|
||||||
|
FragWindow.CopyString(LastLength,OldDist[0],UnpPtr,MaxWinMask);
|
||||||
|
else
|
||||||
|
CopyString(LastLength,OldDist[0]);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (MainSlot<262)
|
||||||
|
{
|
||||||
|
uint DistNum=MainSlot-258;
|
||||||
|
uint Distance=OldDist[DistNum];
|
||||||
|
for (uint I=DistNum;I>0;I--)
|
||||||
|
OldDist[I]=OldDist[I-1];
|
||||||
|
OldDist[0]=Distance;
|
||||||
|
|
||||||
|
uint LengthSlot=DecodeNumber(Inp,&BlockTables.RD);
|
||||||
|
uint Length=SlotToLength(Inp,LengthSlot);
|
||||||
|
LastLength=Length;
|
||||||
|
if (Fragmented)
|
||||||
|
FragWindow.CopyString(Length,Distance,UnpPtr,MaxWinMask);
|
||||||
|
else
|
||||||
|
CopyString(Length,Distance);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
UnpWriteBuf();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
uint Unpack::ReadFilterData(BitInput &Inp)
|
||||||
|
{
|
||||||
|
uint ByteCount=(Inp.fgetbits()>>14)+1;
|
||||||
|
Inp.addbits(2);
|
||||||
|
|
||||||
|
uint Data=0;
|
||||||
|
for (uint I=0;I<ByteCount;I++)
|
||||||
|
{
|
||||||
|
Data+=(Inp.fgetbits()>>8)<<(I*8);
|
||||||
|
Inp.addbits(8);
|
||||||
|
}
|
||||||
|
return Data;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool Unpack::ReadFilter(BitInput &Inp,UnpackFilter &Filter)
|
||||||
|
{
|
||||||
|
if (!Inp.ExternalBuffer && Inp.InAddr>ReadTop-16)
|
||||||
|
if (!UnpReadBuf())
|
||||||
|
return false;
|
||||||
|
|
||||||
|
Filter.BlockStart=ReadFilterData(Inp);
|
||||||
|
Filter.BlockLength=ReadFilterData(Inp);
|
||||||
|
|
||||||
|
Filter.Type=Inp.fgetbits()>>13;
|
||||||
|
Inp.faddbits(3);
|
||||||
|
|
||||||
|
if (Filter.Type==FILTER_DELTA)
|
||||||
|
{
|
||||||
|
Filter.Channels=(Inp.fgetbits()>>11)+1;
|
||||||
|
Inp.faddbits(5);
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool Unpack::AddFilter(UnpackFilter &Filter)
|
||||||
|
{
|
||||||
|
if (Filters.Size()>=MAX_UNPACK_FILTERS-1)
|
||||||
|
UnpWriteBuf(); // Write data, apply and flush filters.
|
||||||
|
|
||||||
|
// If distance to filter start is that large that due to circular dictionary
|
||||||
|
// mode it points to old not written yet data, then we set 'NextWindow'
|
||||||
|
// flag and process this filter only after processing that older data.
|
||||||
|
Filter.NextWindow=WrPtr!=UnpPtr && ((WrPtr-UnpPtr)&MaxWinMask)<=Filter.BlockStart;
|
||||||
|
|
||||||
|
Filter.BlockStart=uint((Filter.BlockStart+UnpPtr)&MaxWinMask);
|
||||||
|
Filters.Push(Filter);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool Unpack::UnpReadBuf()
|
||||||
|
{
|
||||||
|
int DataSize=ReadTop-Inp.InAddr; // Data left to process.
|
||||||
|
if (DataSize<0)
|
||||||
|
return false;
|
||||||
|
BlockHeader.BlockSize-=Inp.InAddr-BlockHeader.BlockStart;
|
||||||
|
if (Inp.InAddr>BitInput::MAX_SIZE/2)
|
||||||
|
{
|
||||||
|
// If we already processed more than half of buffer, let's move
|
||||||
|
// remaining data into beginning to free more space for new data
|
||||||
|
// and ensure that calling function does not cross the buffer border
|
||||||
|
// even if we did not read anything here. Also it ensures that read size
|
||||||
|
// is not less than CRYPT_BLOCK_SIZE, so we can align it without risk
|
||||||
|
// to make it zero.
|
||||||
|
if (DataSize>0)
|
||||||
|
memmove(Inp.InBuf,Inp.InBuf+Inp.InAddr,DataSize);
|
||||||
|
Inp.InAddr=0;
|
||||||
|
ReadTop=DataSize;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
DataSize=ReadTop;
|
||||||
|
int ReadCode=0;
|
||||||
|
if (BitInput::MAX_SIZE!=DataSize)
|
||||||
|
ReadCode=UnpIO->UnpRead(Inp.InBuf+DataSize,BitInput::MAX_SIZE-DataSize);
|
||||||
|
if (ReadCode>0) // Can be also -1.
|
||||||
|
ReadTop+=ReadCode;
|
||||||
|
ReadBorder=ReadTop-30;
|
||||||
|
BlockHeader.BlockStart=Inp.InAddr;
|
||||||
|
if (BlockHeader.BlockSize!=-1) // '-1' means not defined yet.
|
||||||
|
{
|
||||||
|
// We may need to quit from main extraction loop and read new block header
|
||||||
|
// and trees earlier than data in input buffer ends.
|
||||||
|
ReadBorder=Min(ReadBorder,BlockHeader.BlockStart+BlockHeader.BlockSize-1);
|
||||||
|
}
|
||||||
|
return ReadCode!=-1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Unpack::UnpWriteBuf()
|
||||||
|
{
|
||||||
|
size_t WrittenBorder=WrPtr;
|
||||||
|
size_t FullWriteSize=(UnpPtr-WrittenBorder)&MaxWinMask;
|
||||||
|
size_t WriteSizeLeft=FullWriteSize;
|
||||||
|
bool NotAllFiltersProcessed=false;
|
||||||
|
for (size_t I=0;I<Filters.Size();I++)
|
||||||
|
{
|
||||||
|
// Here we apply filters to data which we need to write.
|
||||||
|
// We always copy data to virtual machine memory before processing.
|
||||||
|
// We cannot process them just in place in Window buffer, because
|
||||||
|
// these data can be used for future string matches, so we must
|
||||||
|
// preserve them in original form.
|
||||||
|
|
||||||
|
UnpackFilter *flt=&Filters[I];
|
||||||
|
if (flt->Type==FILTER_NONE)
|
||||||
|
continue;
|
||||||
|
if (flt->NextWindow)
|
||||||
|
{
|
||||||
|
// Here we skip filters which have block start in current data range
|
||||||
|
// due to address warp around in circular dictionary, but actually
|
||||||
|
// belong to next dictionary block. If such filter start position
|
||||||
|
// is included to current write range, then we reset 'NextWindow' flag.
|
||||||
|
// In fact we can reset it even without such check, because current
|
||||||
|
// implementation seems to guarantee 'NextWindow' flag reset after
|
||||||
|
// buffer writing for all existing filters. But let's keep this check
|
||||||
|
// just in case. Compressor guarantees that distance between
|
||||||
|
// filter block start and filter storing position cannot exceed
|
||||||
|
// the dictionary size. So if we covered the filter block start with
|
||||||
|
// our write here, we can safely assume that filter is applicable
|
||||||
|
// to next block on no further wrap arounds is possible.
|
||||||
|
if (((flt->BlockStart-WrPtr)&MaxWinMask)<=FullWriteSize)
|
||||||
|
flt->NextWindow=false;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
uint BlockStart=flt->BlockStart;
|
||||||
|
uint BlockLength=flt->BlockLength;
|
||||||
|
if (((BlockStart-WrittenBorder)&MaxWinMask)<WriteSizeLeft)
|
||||||
|
{
|
||||||
|
if (WrittenBorder!=BlockStart)
|
||||||
|
{
|
||||||
|
UnpWriteArea(WrittenBorder,BlockStart);
|
||||||
|
WrittenBorder=BlockStart;
|
||||||
|
WriteSizeLeft=(UnpPtr-WrittenBorder)&MaxWinMask;
|
||||||
|
}
|
||||||
|
if (BlockLength<=WriteSizeLeft)
|
||||||
|
{
|
||||||
|
if (BlockLength>0)
|
||||||
|
{
|
||||||
|
uint BlockEnd=(BlockStart+BlockLength)&MaxWinMask;
|
||||||
|
|
||||||
|
FilterSrcMemory.Alloc(BlockLength);
|
||||||
|
byte *Mem=&FilterSrcMemory[0];
|
||||||
|
if (BlockStart<BlockEnd || BlockEnd==0)
|
||||||
|
{
|
||||||
|
if (Fragmented)
|
||||||
|
FragWindow.CopyData(Mem,BlockStart,BlockLength);
|
||||||
|
else
|
||||||
|
memcpy(Mem,Window+BlockStart,BlockLength);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
size_t FirstPartLength=size_t(MaxWinSize-BlockStart);
|
||||||
|
if (Fragmented)
|
||||||
|
{
|
||||||
|
FragWindow.CopyData(Mem,BlockStart,FirstPartLength);
|
||||||
|
FragWindow.CopyData(Mem+FirstPartLength,0,BlockEnd);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
memcpy(Mem,Window+BlockStart,FirstPartLength);
|
||||||
|
memcpy(Mem+FirstPartLength,Window,BlockEnd);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
byte *OutMem=ApplyFilter(Mem,BlockLength,flt);
|
||||||
|
|
||||||
|
Filters[I].Type=FILTER_NONE;
|
||||||
|
|
||||||
|
if (OutMem!=NULL)
|
||||||
|
UnpIO->UnpWrite(OutMem,BlockLength);
|
||||||
|
|
||||||
|
UnpSomeRead=true;
|
||||||
|
WrittenFileSize+=BlockLength;
|
||||||
|
WrittenBorder=BlockEnd;
|
||||||
|
WriteSizeLeft=(UnpPtr-WrittenBorder)&MaxWinMask;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Current filter intersects the window write border, so we adjust
|
||||||
|
// the window border to process this filter next time, not now.
|
||||||
|
WrPtr=WrittenBorder;
|
||||||
|
|
||||||
|
// Since Filter start position can only increase, we quit processing
|
||||||
|
// all following filters for this data block and reset 'NextWindow'
|
||||||
|
// flag for them.
|
||||||
|
for (size_t J=I;J<Filters.Size();J++)
|
||||||
|
{
|
||||||
|
UnpackFilter *flt=&Filters[J];
|
||||||
|
if (flt->Type!=FILTER_NONE)
|
||||||
|
flt->NextWindow=false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Do not write data left after current filter now.
|
||||||
|
NotAllFiltersProcessed=true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Remove processed filters from queue.
|
||||||
|
size_t EmptyCount=0;
|
||||||
|
for (size_t I=0;I<Filters.Size();I++)
|
||||||
|
{
|
||||||
|
if (EmptyCount>0)
|
||||||
|
Filters[I-EmptyCount]=Filters[I];
|
||||||
|
if (Filters[I].Type==FILTER_NONE)
|
||||||
|
EmptyCount++;
|
||||||
|
}
|
||||||
|
if (EmptyCount>0)
|
||||||
|
Filters.Alloc(Filters.Size()-EmptyCount);
|
||||||
|
|
||||||
|
if (!NotAllFiltersProcessed) // Only if all filters are processed.
|
||||||
|
{
|
||||||
|
// Write data left after last filter.
|
||||||
|
UnpWriteArea(WrittenBorder,UnpPtr);
|
||||||
|
WrPtr=UnpPtr;
|
||||||
|
}
|
||||||
|
|
||||||
|
// We prefer to write data in blocks not exceeding UNPACK_MAX_WRITE
|
||||||
|
// instead of potentially huge MaxWinSize blocks.
|
||||||
|
WriteBorder=(UnpPtr+Min(MaxWinSize,UNPACK_MAX_WRITE))&MaxWinMask;
|
||||||
|
|
||||||
|
// Choose the nearest among WriteBorder and WrPtr actual written border.
|
||||||
|
// If border is equal to UnpPtr, it means that we have MaxWinSize data ahead.
|
||||||
|
if (WriteBorder==UnpPtr ||
|
||||||
|
WrPtr!=UnpPtr && ((WrPtr-UnpPtr)&MaxWinMask)<((WriteBorder-UnpPtr)&MaxWinMask))
|
||||||
|
WriteBorder=WrPtr;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
byte* Unpack::ApplyFilter(byte *Data,uint DataSize,UnpackFilter *Flt)
|
||||||
|
{
|
||||||
|
byte *SrcData=Data;
|
||||||
|
switch(Flt->Type)
|
||||||
|
{
|
||||||
|
case FILTER_E8:
|
||||||
|
case FILTER_E8E9:
|
||||||
|
{
|
||||||
|
uint FileOffset=(uint)WrittenFileSize;
|
||||||
|
|
||||||
|
const int FileSize=0x1000000;
|
||||||
|
byte CmpByte2=Flt->Type==FILTER_E8E9 ? 0xe9:0xe8;
|
||||||
|
for (uint CurPos=0;(int)CurPos<(int)DataSize-4;)
|
||||||
|
{
|
||||||
|
byte CurByte=*(Data++);
|
||||||
|
CurPos++;
|
||||||
|
if (CurByte==0xe8 || CurByte==CmpByte2)
|
||||||
|
{
|
||||||
|
uint Offset=(CurPos+FileOffset)%FileSize;
|
||||||
|
uint Addr=RawGet4(Data);
|
||||||
|
|
||||||
|
// We check 0x80000000 bit instead of '< 0' comparison
|
||||||
|
// not assuming int32 presence or uint size and endianness.
|
||||||
|
if ((Addr & 0x80000000)!=0) // Addr<0
|
||||||
|
{
|
||||||
|
if (((Addr+Offset) & 0x80000000)==0) // Addr+Offset>=0
|
||||||
|
RawPut4(Addr+FileSize,Data);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
if (((Addr-FileSize) & 0x80000000)!=0) // Addr<FileSize
|
||||||
|
RawPut4(Addr-Offset,Data);
|
||||||
|
|
||||||
|
Data+=4;
|
||||||
|
CurPos+=4;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return SrcData;
|
||||||
|
case FILTER_ARM:
|
||||||
|
{
|
||||||
|
uint FileOffset=(uint)WrittenFileSize;
|
||||||
|
for (uint CurPos=0;(int)CurPos<(int)DataSize-3;CurPos+=4)
|
||||||
|
{
|
||||||
|
byte *D=Data+CurPos;
|
||||||
|
if (D[3]==0xeb) // BL command with '1110' (Always) condition.
|
||||||
|
{
|
||||||
|
uint Offset=D[0]+uint(D[1])*0x100+uint(D[2])*0x10000;
|
||||||
|
Offset-=(FileOffset+CurPos)/4;
|
||||||
|
D[0]=(byte)Offset;
|
||||||
|
D[1]=(byte)(Offset>>8);
|
||||||
|
D[2]=(byte)(Offset>>16);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return SrcData;
|
||||||
|
case FILTER_DELTA:
|
||||||
|
{
|
||||||
|
uint Channels=Flt->Channels,SrcPos=0;
|
||||||
|
|
||||||
|
FilterDstMemory.Alloc(DataSize);
|
||||||
|
byte *DstData=&FilterDstMemory[0];
|
||||||
|
|
||||||
|
// Bytes from same channels are grouped to continual data blocks,
|
||||||
|
// so we need to place them back to their interleaving positions.
|
||||||
|
for (uint CurChannel=0;CurChannel<Channels;CurChannel++)
|
||||||
|
{
|
||||||
|
byte PrevByte=0;
|
||||||
|
for (uint DestPos=CurChannel;DestPos<DataSize;DestPos+=Channels)
|
||||||
|
DstData[DestPos]=(PrevByte-=Data[SrcPos++]);
|
||||||
|
}
|
||||||
|
return DstData;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Unpack::UnpWriteArea(size_t StartPtr,size_t EndPtr)
|
||||||
|
{
|
||||||
|
if (EndPtr!=StartPtr)
|
||||||
|
UnpSomeRead=true;
|
||||||
|
if (EndPtr<StartPtr)
|
||||||
|
UnpAllBuf=true;
|
||||||
|
|
||||||
|
if (Fragmented)
|
||||||
|
{
|
||||||
|
size_t SizeToWrite=(EndPtr-StartPtr) & MaxWinMask;
|
||||||
|
while (SizeToWrite>0)
|
||||||
|
{
|
||||||
|
size_t BlockSize=FragWindow.GetBlockSize(StartPtr,SizeToWrite);
|
||||||
|
UnpWriteData(&FragWindow[StartPtr],BlockSize);
|
||||||
|
SizeToWrite-=BlockSize;
|
||||||
|
StartPtr=(StartPtr+BlockSize) & MaxWinMask;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
if (EndPtr<StartPtr)
|
||||||
|
{
|
||||||
|
UnpWriteData(Window+StartPtr,MaxWinSize-StartPtr);
|
||||||
|
UnpWriteData(Window,EndPtr);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
UnpWriteData(Window+StartPtr,EndPtr-StartPtr);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Unpack::UnpWriteData(byte *Data,size_t Size)
|
||||||
|
{
|
||||||
|
if (WrittenFileSize>=DestUnpSize)
|
||||||
|
return;
|
||||||
|
size_t WriteSize=Size;
|
||||||
|
int64 LeftToWrite=DestUnpSize-WrittenFileSize;
|
||||||
|
if ((int64)WriteSize>LeftToWrite)
|
||||||
|
WriteSize=(size_t)LeftToWrite;
|
||||||
|
UnpIO->UnpWrite(Data,WriteSize);
|
||||||
|
WrittenFileSize+=Size;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool Unpack::ReadBlockHeader(BitInput &Inp,UnpackBlockHeader &Header)
|
||||||
|
{
|
||||||
|
Header.HeaderSize=0;
|
||||||
|
|
||||||
|
if (!Inp.ExternalBuffer && Inp.InAddr>ReadTop-7)
|
||||||
|
if (!UnpReadBuf())
|
||||||
|
return false;
|
||||||
|
Inp.faddbits((8-Inp.InBit)&7);
|
||||||
|
|
||||||
|
byte BlockFlags=Inp.fgetbits()>>8;
|
||||||
|
Inp.faddbits(8);
|
||||||
|
uint ByteCount=((BlockFlags>>3)&3)+1; // Block size byte count.
|
||||||
|
|
||||||
|
if (ByteCount==4)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
Header.HeaderSize=2+ByteCount;
|
||||||
|
|
||||||
|
Header.BlockBitSize=(BlockFlags&7)+1;
|
||||||
|
|
||||||
|
byte SavedCheckSum=Inp.fgetbits()>>8;
|
||||||
|
Inp.faddbits(8);
|
||||||
|
|
||||||
|
int BlockSize=0;
|
||||||
|
for (uint I=0;I<ByteCount;I++)
|
||||||
|
{
|
||||||
|
BlockSize+=(Inp.fgetbits()>>8)<<(I*8);
|
||||||
|
Inp.addbits(8);
|
||||||
|
}
|
||||||
|
|
||||||
|
Header.BlockSize=BlockSize;
|
||||||
|
byte CheckSum=byte(0x5a^BlockFlags^BlockSize^(BlockSize>>8)^(BlockSize>>16));
|
||||||
|
if (CheckSum!=SavedCheckSum)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
Header.BlockStart=Inp.InAddr;
|
||||||
|
ReadBorder=Min(ReadBorder,Header.BlockStart+Header.BlockSize-1);
|
||||||
|
|
||||||
|
Header.LastBlockInFile=(BlockFlags & 0x40)!=0;
|
||||||
|
Header.TablePresent=(BlockFlags & 0x80)!=0;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool Unpack::ReadTables(BitInput &Inp,UnpackBlockHeader &Header,UnpackBlockTables &Tables)
|
||||||
|
{
|
||||||
|
if (!Header.TablePresent)
|
||||||
|
return true;
|
||||||
|
|
||||||
|
if (!Inp.ExternalBuffer && Inp.InAddr>ReadTop-25)
|
||||||
|
if (!UnpReadBuf())
|
||||||
|
return false;
|
||||||
|
|
||||||
|
byte BitLength[BC];
|
||||||
|
for (int I=0;I<BC;I++)
|
||||||
|
{
|
||||||
|
int Length=(byte)(Inp.fgetbits() >> 12);
|
||||||
|
Inp.faddbits(4);
|
||||||
|
if (Length==15)
|
||||||
|
{
|
||||||
|
int ZeroCount=(byte)(Inp.fgetbits() >> 12);
|
||||||
|
Inp.faddbits(4);
|
||||||
|
if (ZeroCount==0)
|
||||||
|
BitLength[I]=15;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ZeroCount+=2;
|
||||||
|
while (ZeroCount-- > 0 && I<sizeof(BitLength)/sizeof(BitLength[0]))
|
||||||
|
BitLength[I++]=0;
|
||||||
|
I--;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
BitLength[I]=Length;
|
||||||
|
}
|
||||||
|
|
||||||
|
MakeDecodeTables(BitLength,&Tables.BD,BC);
|
||||||
|
|
||||||
|
byte Table[HUFF_TABLE_SIZE];
|
||||||
|
const int TableSize=HUFF_TABLE_SIZE;
|
||||||
|
for (int I=0;I<TableSize;)
|
||||||
|
{
|
||||||
|
if (!Inp.ExternalBuffer && Inp.InAddr>ReadTop-5)
|
||||||
|
if (!UnpReadBuf())
|
||||||
|
return(false);
|
||||||
|
int Number=DecodeNumber(Inp,&Tables.BD);
|
||||||
|
if (Number<16)
|
||||||
|
{
|
||||||
|
Table[I]=Number;
|
||||||
|
I++;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
if (Number<18)
|
||||||
|
{
|
||||||
|
int N;
|
||||||
|
if (Number==16)
|
||||||
|
{
|
||||||
|
N=(Inp.fgetbits() >> 13)+3;
|
||||||
|
Inp.faddbits(3);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
N=(Inp.fgetbits() >> 9)+11;
|
||||||
|
Inp.faddbits(7);
|
||||||
|
}
|
||||||
|
if (I>0)
|
||||||
|
while (N-- > 0 && I<TableSize)
|
||||||
|
{
|
||||||
|
Table[I]=Table[I-1];
|
||||||
|
I++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
int N;
|
||||||
|
if (Number==18)
|
||||||
|
{
|
||||||
|
N=(Inp.fgetbits() >> 13)+3;
|
||||||
|
Inp.faddbits(3);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
N=(Inp.fgetbits() >> 9)+11;
|
||||||
|
Inp.faddbits(7);
|
||||||
|
}
|
||||||
|
while (N-- > 0 && I<TableSize)
|
||||||
|
Table[I++]=0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!Inp.ExternalBuffer && Inp.InAddr>ReadTop)
|
||||||
|
return(false);
|
||||||
|
MakeDecodeTables(&Table[0],&Tables.LD,NC);
|
||||||
|
MakeDecodeTables(&Table[NC],&Tables.DD,DC);
|
||||||
|
MakeDecodeTables(&Table[NC+DC],&Tables.LDD,LDC);
|
||||||
|
MakeDecodeTables(&Table[NC+DC+LDC],&Tables.RD,RC);
|
||||||
|
return(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Unpack::InitFilters()
|
||||||
|
{
|
||||||
|
Filters.Reset();
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
|
@ -0,0 +1,107 @@
|
||||||
|
#ifdef RAR_COMMON_HPP
|
||||||
|
|
||||||
|
FragmentedWindow::FragmentedWindow()
|
||||||
|
{
|
||||||
|
memset(Mem,0,sizeof(Mem));
|
||||||
|
memset(MemSize,0,sizeof(MemSize));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
FragmentedWindow::~FragmentedWindow()
|
||||||
|
{
|
||||||
|
Reset();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void FragmentedWindow::Reset()
|
||||||
|
{
|
||||||
|
for (uint I=0;I<ASIZE(Mem);I++)
|
||||||
|
if (Mem[I]!=NULL)
|
||||||
|
{
|
||||||
|
free(Mem[I]);
|
||||||
|
Mem[I]=NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void FragmentedWindow::Init(size_t WinSize)
|
||||||
|
{
|
||||||
|
Reset();
|
||||||
|
|
||||||
|
uint BlockNum=0;
|
||||||
|
size_t TotalSize=0; // Already allocated.
|
||||||
|
while (TotalSize<WinSize && BlockNum<ASIZE(Mem))
|
||||||
|
{
|
||||||
|
size_t Size=WinSize-TotalSize; // Size needed to allocate.
|
||||||
|
|
||||||
|
// Minimum still acceptable block size. Next allocations cannot be larger
|
||||||
|
// than current, so we do not need blocks if they are smaller than
|
||||||
|
// "size left / attempts left". Also we do not waste time to blocks
|
||||||
|
// smaller than some arbitrary constant.
|
||||||
|
size_t MinSize=Max(Size/(ASIZE(Mem)-BlockNum), 0x400000);
|
||||||
|
|
||||||
|
byte *NewMem=NULL;
|
||||||
|
while (Size>=MinSize)
|
||||||
|
{
|
||||||
|
NewMem=(byte *)malloc(Size);
|
||||||
|
if (NewMem!=NULL)
|
||||||
|
break;
|
||||||
|
Size-=Size/32;
|
||||||
|
}
|
||||||
|
if (NewMem==NULL)
|
||||||
|
throw std::bad_alloc();
|
||||||
|
|
||||||
|
// Clean the window to generate the same output when unpacking corrupt
|
||||||
|
// RAR files, which may access to unused areas of sliding dictionary.
|
||||||
|
memset(NewMem,0,Size);
|
||||||
|
|
||||||
|
Mem[BlockNum]=NewMem;
|
||||||
|
TotalSize+=Size;
|
||||||
|
MemSize[BlockNum]=TotalSize;
|
||||||
|
BlockNum++;
|
||||||
|
}
|
||||||
|
if (TotalSize<WinSize) // Not found enough free blocks.
|
||||||
|
throw std::bad_alloc();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
byte& FragmentedWindow::operator [](size_t Item)
|
||||||
|
{
|
||||||
|
if (Item<MemSize[0])
|
||||||
|
return Mem[0][Item];
|
||||||
|
for (uint I=1;I<ASIZE(MemSize);I++)
|
||||||
|
if (Item<MemSize[I])
|
||||||
|
return Mem[I][Item-MemSize[I-1]];
|
||||||
|
return Mem[0][0]; // Must never happen;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void FragmentedWindow::CopyString(uint Length,uint Distance,size_t &UnpPtr,size_t MaxWinMask)
|
||||||
|
{
|
||||||
|
size_t SrcPtr=UnpPtr-Distance;
|
||||||
|
while (Length-- > 0)
|
||||||
|
{
|
||||||
|
(*this)[UnpPtr]=(*this)[SrcPtr++ & MaxWinMask];
|
||||||
|
// We need to have masked UnpPtr after quit from loop, so it must not
|
||||||
|
// be replaced with '(*this)[UnpPtr++ & MaxWinMask]'
|
||||||
|
UnpPtr=(UnpPtr+1) & MaxWinMask;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void FragmentedWindow::CopyData(byte *Dest,size_t WinPos,size_t Size)
|
||||||
|
{
|
||||||
|
for (size_t I=0;I<Size;I++)
|
||||||
|
Dest[I]=(*this)[WinPos+I];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
size_t FragmentedWindow::GetBlockSize(size_t StartPos,size_t RequiredSize)
|
||||||
|
{
|
||||||
|
for (uint I=0;I<ASIZE(MemSize);I++)
|
||||||
|
if (StartPos<MemSize[I])
|
||||||
|
return Min(MemSize[I]-StartPos,RequiredSize);
|
||||||
|
return 0; // Must never be here.
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
|
@ -0,0 +1,146 @@
|
||||||
|
#ifdef RAR_COMMON_HPP
|
||||||
|
|
||||||
|
inline void Unpack::InsertOldDist(uint Distance)
|
||||||
|
{
|
||||||
|
OldDist[3]=OldDist[2];
|
||||||
|
OldDist[2]=OldDist[1];
|
||||||
|
OldDist[1]=OldDist[0];
|
||||||
|
OldDist[0]=Distance;
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
#define FAST_MEMCPY
|
||||||
|
#endif
|
||||||
|
|
||||||
|
inline void Unpack::CopyString(uint Length,uint Distance)
|
||||||
|
{
|
||||||
|
size_t SrcPtr=UnpPtr-Distance;
|
||||||
|
if (SrcPtr<MaxWinSize-MAX_LZ_MATCH && UnpPtr<MaxWinSize-MAX_LZ_MATCH)
|
||||||
|
{
|
||||||
|
// If we are not close to end of window, we do not need to waste time
|
||||||
|
// to "& MaxWinMask" pointer protection.
|
||||||
|
|
||||||
|
byte *Src=Window+SrcPtr;
|
||||||
|
byte *Dest=Window+UnpPtr;
|
||||||
|
UnpPtr+=Length;
|
||||||
|
|
||||||
|
#ifdef FAST_MEMCPY
|
||||||
|
if (Distance<Length) // Overlapping strings
|
||||||
|
#endif
|
||||||
|
while (Length>=8)
|
||||||
|
{
|
||||||
|
Dest[0]=Src[0];
|
||||||
|
Dest[1]=Src[1];
|
||||||
|
Dest[2]=Src[2];
|
||||||
|
Dest[3]=Src[3];
|
||||||
|
Dest[4]=Src[4];
|
||||||
|
Dest[5]=Src[5];
|
||||||
|
Dest[6]=Src[6];
|
||||||
|
Dest[7]=Src[7];
|
||||||
|
|
||||||
|
Src+=8;
|
||||||
|
Dest+=8;
|
||||||
|
Length-=8;
|
||||||
|
}
|
||||||
|
#ifdef FAST_MEMCPY
|
||||||
|
else
|
||||||
|
while (Length>=8)
|
||||||
|
{
|
||||||
|
// This memcpy expanded inline by MSVC. We could also use uint64
|
||||||
|
// assignment, which seems to provide about the same speed.
|
||||||
|
memcpy(Dest,Src,8);
|
||||||
|
|
||||||
|
Src+=8;
|
||||||
|
Dest+=8;
|
||||||
|
Length-=8;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// Unroll the loop for 0 - 7 bytes left. Note that we use nested "if"s.
|
||||||
|
if (Length>0) { Dest[0]=Src[0];
|
||||||
|
if (Length>1) { Dest[1]=Src[1];
|
||||||
|
if (Length>2) { Dest[2]=Src[2];
|
||||||
|
if (Length>3) { Dest[3]=Src[3];
|
||||||
|
if (Length>4) { Dest[4]=Src[4];
|
||||||
|
if (Length>5) { Dest[5]=Src[5];
|
||||||
|
if (Length>6) { Dest[6]=Src[6]; } } } } } } } // Close all nested "if"s.
|
||||||
|
}
|
||||||
|
else
|
||||||
|
while (Length-- > 0) // Slow copying with all possible precautions.
|
||||||
|
{
|
||||||
|
Window[UnpPtr]=Window[SrcPtr++ & MaxWinMask];
|
||||||
|
// We need to have masked UnpPtr after quit from loop, so it must not
|
||||||
|
// be replaced with 'Window[UnpPtr++ & MaxWinMask]'
|
||||||
|
UnpPtr=(UnpPtr+1) & MaxWinMask;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
inline uint Unpack::DecodeNumber(BitInput &Inp,DecodeTable *Dec)
|
||||||
|
{
|
||||||
|
// Left aligned 15 bit length raw bit field.
|
||||||
|
uint BitField=Inp.getbits() & 0xfffe;
|
||||||
|
|
||||||
|
if (BitField<Dec->DecodeLen[Dec->QuickBits])
|
||||||
|
{
|
||||||
|
uint Code=BitField>>(16-Dec->QuickBits);
|
||||||
|
Inp.addbits(Dec->QuickLen[Code]);
|
||||||
|
return Dec->QuickNum[Code];
|
||||||
|
}
|
||||||
|
|
||||||
|
// Detect the real bit length for current code.
|
||||||
|
uint Bits=15;
|
||||||
|
for (uint I=Dec->QuickBits+1;I<15;I++)
|
||||||
|
if (BitField<Dec->DecodeLen[I])
|
||||||
|
{
|
||||||
|
Bits=I;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
Inp.addbits(Bits);
|
||||||
|
|
||||||
|
// Calculate the distance from the start code for current bit length.
|
||||||
|
uint Dist=BitField-Dec->DecodeLen[Bits-1];
|
||||||
|
|
||||||
|
// Start codes are left aligned, but we need the normal right aligned
|
||||||
|
// number. So we shift the distance to the right.
|
||||||
|
Dist>>=(16-Bits);
|
||||||
|
|
||||||
|
// Now we can calculate the position in the code list. It is the sum
|
||||||
|
// of first position for current bit length and right aligned distance
|
||||||
|
// between our bit field and start code for current bit length.
|
||||||
|
uint Pos=Dec->DecodePos[Bits]+Dist;
|
||||||
|
|
||||||
|
// Out of bounds safety check required for damaged archives.
|
||||||
|
if (Pos>=Dec->MaxNum)
|
||||||
|
Pos=0;
|
||||||
|
|
||||||
|
// Convert the position in the code list to position in alphabet
|
||||||
|
// and return it.
|
||||||
|
return(Dec->DecodeNum[Pos]);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
inline uint Unpack::SlotToLength(BitInput &Inp,uint Slot)
|
||||||
|
{
|
||||||
|
uint LBits,Length=2;
|
||||||
|
if (Slot<8)
|
||||||
|
{
|
||||||
|
LBits=0;
|
||||||
|
Length+=Slot;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
LBits=Slot/4-1;
|
||||||
|
Length+=(4 | (Slot & 3)) << LBits;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (LBits>0)
|
||||||
|
{
|
||||||
|
Length+=Inp.getbits()>>(16-LBits);
|
||||||
|
Inp.addbits(LBits);
|
||||||
|
}
|
||||||
|
return Length;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
|
@ -42,8 +42,7 @@ void Rar_Error_Handler::MemoryError()
|
||||||
|
|
||||||
//// Internal
|
//// Internal
|
||||||
|
|
||||||
unrar_t::unrar_t() :
|
unrar_t::unrar_t()
|
||||||
Buffer( &Arc )
|
|
||||||
{
|
{
|
||||||
Arc.user_read = NULL;
|
Arc.user_read = NULL;
|
||||||
Arc.user_write = NULL;
|
Arc.user_write = NULL;
|
||||||
|
@ -74,8 +73,8 @@ unrar_t::~unrar_t()
|
||||||
static inline bool solid_file( const unrar_t* p )
|
static inline bool solid_file( const unrar_t* p )
|
||||||
{
|
{
|
||||||
return p->Arc.Solid &&
|
return p->Arc.Solid &&
|
||||||
p->Arc.NewLhd.Method != 0x30 &&
|
p->Arc.FileHead.Method != 0 &&
|
||||||
p->Arc.NewLhd.FullPackSize != 0;
|
p->Arc.FileHead.PackSize != 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void update_solid_pos( unrar_t* p )
|
static void update_solid_pos( unrar_t* p )
|
||||||
|
@ -129,8 +128,9 @@ static unrar_err_t next_( unrar_t* p, bool skipping_solid )
|
||||||
|
|
||||||
for (;;)
|
for (;;)
|
||||||
{
|
{
|
||||||
|
size_t ReadSize;
|
||||||
p->Arc.SeekToNext();
|
p->Arc.SeekToNext();
|
||||||
unrar_err_t const err = p->Arc.ReadHeader();
|
unrar_err_t const err = p->Arc.ReadHeader(&ReadSize);
|
||||||
if ( err != unrar_err_arc_eof )
|
if ( err != unrar_err_arc_eof )
|
||||||
RETURN_ERR( err );
|
RETURN_ERR( err );
|
||||||
//else
|
//else
|
||||||
|
@ -138,16 +138,16 @@ static unrar_err_t next_( unrar_t* p, bool skipping_solid )
|
||||||
|
|
||||||
HEADER_TYPE const type = (HEADER_TYPE) p->Arc.GetHeaderType();
|
HEADER_TYPE const type = (HEADER_TYPE) p->Arc.GetHeaderType();
|
||||||
|
|
||||||
if ( err != unrar_ok || type == ENDARC_HEAD )
|
if ( err != unrar_ok || type == HEAD_ENDARC )
|
||||||
{
|
{
|
||||||
p->done = true;
|
p->done = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( type != FILE_HEAD )
|
if ( type != HEAD_FILE )
|
||||||
{
|
{
|
||||||
// Skip non-files
|
// Skip non-files
|
||||||
if ( type != NEWSUB_HEAD && type != PROTECT_HEAD && type != SIGN_HEAD && type != SUB_HEAD )
|
if ( type != HEAD_SERVICE && type != HEAD_CRYPT && type != HEAD_MARK )
|
||||||
debug_printf( "unrar: Skipping unknown block type: %X\n", (unsigned) type );
|
debug_printf( "unrar: Skipping unknown block type: %X\n", (unsigned) type );
|
||||||
|
|
||||||
update_solid_pos( p );
|
update_solid_pos( p );
|
||||||
|
@ -162,7 +162,7 @@ static unrar_err_t next_( unrar_t* p, bool skipping_solid )
|
||||||
{
|
{
|
||||||
// Ignore labels
|
// Ignore labels
|
||||||
}
|
}
|
||||||
else if ( IsLink( p->Arc.NewLhd.FileAttr ) )
|
else if ( IsLink( p->Arc.FileHead.FileAttr ) )
|
||||||
{
|
{
|
||||||
// Ignore links
|
// Ignore links
|
||||||
|
|
||||||
|
@ -175,12 +175,12 @@ static unrar_err_t next_( unrar_t* p, bool skipping_solid )
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
p->info.size = p->Arc.NewLhd.UnpSize;
|
p->info.size = p->Arc.FileHead.UnpSize;
|
||||||
p->info.name = p->Arc.NewLhd.FileName;
|
p->info.name_w = p->Arc.FileHead.FileName;
|
||||||
p->info.name_w = p->Arc.NewLhd.FileNameW;
|
WideToChar(p->info.name_w, p->info.name);
|
||||||
p->info.is_unicode = (p->Arc.NewLhd.Flags & LHD_UNICODE) != 0;
|
p->info.is_unicode = (p->Arc.FileHead.Flags & LHD_UNICODE) != 0;
|
||||||
p->info.dos_date = p->Arc.NewLhd.mtime.time;
|
p->info.dos_date = p->Arc.FileHead.mtime.GetDos();
|
||||||
p->info.crc = p->Arc.NewLhd.FileCRC;
|
p->info.crc = p->Arc.FileHead.FileHash.CRC32;
|
||||||
p->info.is_crc32 = !p->Arc.OldFormat;
|
p->info.is_crc32 = !p->Arc.OldFormat;
|
||||||
|
|
||||||
// Stop for files
|
// Stop for files
|
||||||
|
|
|
@ -7,10 +7,14 @@
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
|
|
||||||
|
#include "../fex/blargg_common.h"
|
||||||
|
|
||||||
#if !defined (UNRAR_NO_LONG_LONG) && defined (LLONG_MAX)
|
#if !defined (UNRAR_NO_LONG_LONG) && defined (LLONG_MAX)
|
||||||
typedef long long unrar_long_long;
|
typedef long long unrar_long_long;
|
||||||
|
typedef unsigned long long unrar_ulong_long;
|
||||||
#else
|
#else
|
||||||
typedef long unrar_long_long;
|
typedef long unrar_long_long;
|
||||||
|
typedef unsigned long unrar_ulong_long;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
@ -89,8 +93,8 @@ unrar_err_t unrar_seek( unrar_t*, unrar_pos_t );
|
||||||
typedef struct unrar_info_t
|
typedef struct unrar_info_t
|
||||||
{
|
{
|
||||||
unrar_pos_t size; /**< Uncompressed size */
|
unrar_pos_t size; /**< Uncompressed size */
|
||||||
const char* name; /**< Name, in Unicode if is_unicode is true */
|
char name[32767]; /**< Name, in Unicode if is_unicode is true */
|
||||||
const wchar_t* name_w; /**< Name in Unicode, "" if unavailable */
|
const blargg_wchar_t* name_w; /**< Name in Unicode, "" if unavailable */
|
||||||
unrar_bool is_unicode; /**< True if name is Unicode (UTF-8) */
|
unrar_bool is_unicode; /**< True if name is Unicode (UTF-8) */
|
||||||
unsigned int dos_date; /**< Date in DOS-style format, 0 if unavailable */
|
unsigned int dos_date; /**< Date in DOS-style format, 0 if unavailable */
|
||||||
unsigned int crc; /**< Checksum; algorithm depends on archive */
|
unsigned int crc; /**< Checksum; algorithm depends on archive */
|
||||||
|
|
|
@ -11,8 +11,8 @@
|
||||||
|
|
||||||
void unrar_init()
|
void unrar_init()
|
||||||
{
|
{
|
||||||
if (CRCTab[1]==0)
|
if (crc_tables[0][1]==0)
|
||||||
InitCRC();
|
InitCRCTables();
|
||||||
|
|
||||||
Unpack::init_tables();
|
Unpack::init_tables();
|
||||||
}
|
}
|
||||||
|
@ -32,7 +32,7 @@ extern "C" {
|
||||||
if ( remain > 0 )
|
if ( remain > 0 )
|
||||||
{
|
{
|
||||||
if ( count > remain )
|
if ( count > remain )
|
||||||
count = remain;
|
count = (int)remain;
|
||||||
|
|
||||||
memcpy( p->out, in, count );
|
memcpy( p->out, in, count );
|
||||||
p->out += count;
|
p->out += count;
|
||||||
|
@ -55,7 +55,7 @@ unrar_err_t unrar_extract( unrar_t* p, void* out, unrar_pos_t size )
|
||||||
inline
|
inline
|
||||||
static bool is_entire_file( const unrar_t* p, const void* in, int count )
|
static bool is_entire_file( const unrar_t* p, const void* in, int count )
|
||||||
{
|
{
|
||||||
return (count == p->Arc.NewLhd.UnpSize && p->Unp && in == p->Unp->window_wrptr());
|
return (count == p->Arc.SubHead.UnpSize && p->Unp && in == p->Unp->window_wrptr());
|
||||||
}
|
}
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
@ -76,7 +76,7 @@ extern "C" {
|
||||||
assert( !p->data_ );
|
assert( !p->data_ );
|
||||||
|
|
||||||
unrar_pos_t size = unrar_info( p )->size;
|
unrar_pos_t size = unrar_info( p )->size;
|
||||||
p->own_data_ = malloc( size ? size : 1 );
|
p->own_data_ = malloc( size ? (size_t)size : 1 );
|
||||||
if ( !p->own_data_ )
|
if ( !p->own_data_ )
|
||||||
return unrar_err_memory;
|
return unrar_err_memory;
|
||||||
|
|
||||||
|
@ -149,10 +149,7 @@ void ComprDataIO::UnpWrite( byte* out, uint count )
|
||||||
if ( write_error == unrar_ok )
|
if ( write_error == unrar_ok )
|
||||||
write_error = user_write( user_write_data, out, count );
|
write_error = user_write( user_write_data, out, count );
|
||||||
|
|
||||||
if ( OldFormat )
|
UnpHash.Update(out,count);
|
||||||
UnpFileCRC = OldCRC( (ushort) UnpFileCRC, out, count );
|
|
||||||
else
|
|
||||||
UnpFileCRC = CRC( UnpFileCRC, out, count );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -162,7 +159,7 @@ int ComprDataIO::UnpRead( byte* out, uint count )
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if ( count > (uint) UnpPackedSize )
|
if ( count > (uint) UnpPackedSize )
|
||||||
count = UnpPackedSize;
|
count = (uint) UnpPackedSize;
|
||||||
|
|
||||||
int result = Read( out, count );
|
int result = Read( out, count );
|
||||||
UnpPackedSize -= result;
|
UnpPackedSize -= result;
|
||||||
|
|
|
@ -10,7 +10,7 @@ extern "C" {
|
||||||
FILE* file = (FILE*) user_data;
|
FILE* file = (FILE*) user_data;
|
||||||
|
|
||||||
// most of the time, seeking won't be necessary
|
// most of the time, seeking won't be necessary
|
||||||
if ( pos != ftell( file ) && fseek( file, pos, SEEK_SET ) != 0 )
|
if ( pos != ftell( file ) && fseek( file, (long)pos, SEEK_SET ) != 0 )
|
||||||
return unrar_err_corrupt;
|
return unrar_err_corrupt;
|
||||||
|
|
||||||
*count = (int) fread( out, 1, *count, file );
|
*count = (int) fread( out, 1, *count, file );
|
||||||
|
@ -31,7 +31,12 @@ unrar_err_t unrar_open( unrar_t** arc_out, const char path [] )
|
||||||
{
|
{
|
||||||
*arc_out = NULL;
|
*arc_out = NULL;
|
||||||
|
|
||||||
|
#if _MSC_VER >= 1300
|
||||||
|
FILE* file = NULL;
|
||||||
|
fopen_s(&file, path, "rb");
|
||||||
|
#else
|
||||||
FILE* file = fopen( path, "rb" );
|
FILE* file = fopen( path, "rb" );
|
||||||
|
#endif
|
||||||
if ( file == NULL )
|
if ( file == NULL )
|
||||||
return unrar_err_open;
|
return unrar_err_open;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue