7zip-native 0.0.0-stage → 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +103 -2
- package/THIRD_PARTY_NOTICES.md +23 -0
- package/bench/args.mts +69 -0
- package/bench/benchmark.mts +102 -0
- package/bench/compare.mts +546 -0
- package/bench/concurrency.mts +196 -0
- package/binding.gyp +51 -0
- package/dist/index.cjs +433 -0
- package/dist/index.d.cts +59 -0
- package/dist/index.d.mts +59 -0
- package/dist/index.d.ts +59 -0
- package/dist/index.mjs +429 -0
- package/docs/architecture.md +112 -0
- package/examples/basic.mts +19 -0
- package/native/addon.cpp +2154 -0
- package/package.json +85 -5
- package/prebuilds/linux-x64/7z.so +0 -0
- package/prebuilds/linux-x64/7zip_native.node +0 -0
- package/vendor/7zip/.gitattributes +2 -0
- package/vendor/7zip/Asm/arm/7zCrcOpt.asm +100 -0
- package/vendor/7zip/Asm/arm64/7zAsm.S +187 -0
- package/vendor/7zip/Asm/arm64/LzmaDecOpt.S +1487 -0
- package/vendor/7zip/Asm/x86/7zAsm.asm +341 -0
- package/vendor/7zip/Asm/x86/7zCrcOpt.asm +258 -0
- package/vendor/7zip/Asm/x86/AesOpt.asm +742 -0
- package/vendor/7zip/Asm/x86/LzFindOpt.asm +540 -0
- package/vendor/7zip/Asm/x86/LzmaDecOpt.asm +1339 -0
- package/vendor/7zip/Asm/x86/Sha1Opt.asm +263 -0
- package/vendor/7zip/Asm/x86/Sha256Opt.asm +275 -0
- package/vendor/7zip/Asm/x86/Sort.asm +860 -0
- package/vendor/7zip/Asm/x86/XzCrc64Opt.asm +523 -0
- package/vendor/7zip/C/7z.h +204 -0
- package/vendor/7zip/C/7zAlloc.c +89 -0
- package/vendor/7zip/C/7zAlloc.h +19 -0
- package/vendor/7zip/C/7zArcIn.c +1701 -0
- package/vendor/7zip/C/7zBuf.c +36 -0
- package/vendor/7zip/C/7zBuf.h +35 -0
- package/vendor/7zip/C/7zBuf2.c +52 -0
- package/vendor/7zip/C/7zCrc.c +420 -0
- package/vendor/7zip/C/7zCrc.h +28 -0
- package/vendor/7zip/C/7zCrcOpt.c +199 -0
- package/vendor/7zip/C/7zDec.c +672 -0
- package/vendor/7zip/C/7zFile.c +443 -0
- package/vendor/7zip/C/7zFile.h +91 -0
- package/vendor/7zip/C/7zStream.c +199 -0
- package/vendor/7zip/C/7zTypes.h +600 -0
- package/vendor/7zip/C/7zVersion.h +27 -0
- package/vendor/7zip/C/7zVersion.rc +55 -0
- package/vendor/7zip/C/7zWindows.h +107 -0
- package/vendor/7zip/C/7zip_gcc_c.mak +366 -0
- package/vendor/7zip/C/Aes.c +429 -0
- package/vendor/7zip/C/Aes.h +60 -0
- package/vendor/7zip/C/AesOpt.c +1002 -0
- package/vendor/7zip/C/Alloc.c +774 -0
- package/vendor/7zip/C/Alloc.h +76 -0
- package/vendor/7zip/C/Asm_c.mak +12 -0
- package/vendor/7zip/C/Bcj2.c +290 -0
- package/vendor/7zip/C/Bcj2.h +332 -0
- package/vendor/7zip/C/Bcj2Enc.c +509 -0
- package/vendor/7zip/C/Blake2.h +105 -0
- package/vendor/7zip/C/Blake2s.c +2672 -0
- package/vendor/7zip/C/Bra.c +709 -0
- package/vendor/7zip/C/Bra.h +105 -0
- package/vendor/7zip/C/Bra86.c +187 -0
- package/vendor/7zip/C/BraIA64.c +14 -0
- package/vendor/7zip/C/BwtSort.c +630 -0
- package/vendor/7zip/C/BwtSort.h +27 -0
- package/vendor/7zip/C/Compiler.h +287 -0
- package/vendor/7zip/C/CpuArch.c +970 -0
- package/vendor/7zip/C/CpuArch.h +719 -0
- package/vendor/7zip/C/Delta.c +169 -0
- package/vendor/7zip/C/Delta.h +19 -0
- package/vendor/7zip/C/DllSecur.c +99 -0
- package/vendor/7zip/C/DllSecur.h +20 -0
- package/vendor/7zip/C/HuffEnc.c +361 -0
- package/vendor/7zip/C/HuffEnc.h +23 -0
- package/vendor/7zip/C/LzFind.c +1746 -0
- package/vendor/7zip/C/LzFind.h +160 -0
- package/vendor/7zip/C/LzFindMt.c +1422 -0
- package/vendor/7zip/C/LzFindMt.h +114 -0
- package/vendor/7zip/C/LzFindOpt.c +578 -0
- package/vendor/7zip/C/LzHash.h +34 -0
- package/vendor/7zip/C/Lzma2Dec.c +493 -0
- package/vendor/7zip/C/Lzma2Dec.h +121 -0
- package/vendor/7zip/C/Lzma2DecMt.c +1095 -0
- package/vendor/7zip/C/Lzma2DecMt.h +81 -0
- package/vendor/7zip/C/Lzma2Enc.c +799 -0
- package/vendor/7zip/C/Lzma2Enc.h +58 -0
- package/vendor/7zip/C/Lzma86.h +111 -0
- package/vendor/7zip/C/Lzma86Dec.c +53 -0
- package/vendor/7zip/C/Lzma86Enc.c +103 -0
- package/vendor/7zip/C/LzmaDec.c +1367 -0
- package/vendor/7zip/C/LzmaDec.h +237 -0
- package/vendor/7zip/C/LzmaEnc.c +3154 -0
- package/vendor/7zip/C/LzmaEnc.h +85 -0
- package/vendor/7zip/C/LzmaLib.c +42 -0
- package/vendor/7zip/C/LzmaLib.h +138 -0
- package/vendor/7zip/C/Md5.c +206 -0
- package/vendor/7zip/C/Md5.h +34 -0
- package/vendor/7zip/C/MtCoder.c +604 -0
- package/vendor/7zip/C/MtCoder.h +144 -0
- package/vendor/7zip/C/MtDec.c +1124 -0
- package/vendor/7zip/C/MtDec.h +202 -0
- package/vendor/7zip/C/Ppmd.h +169 -0
- package/vendor/7zip/C/Ppmd7.c +1131 -0
- package/vendor/7zip/C/Ppmd7.h +181 -0
- package/vendor/7zip/C/Ppmd7Dec.c +312 -0
- package/vendor/7zip/C/Ppmd7Enc.c +340 -0
- package/vendor/7zip/C/Ppmd7aDec.c +295 -0
- package/vendor/7zip/C/Ppmd8.c +1574 -0
- package/vendor/7zip/C/Ppmd8.h +181 -0
- package/vendor/7zip/C/Ppmd8Dec.c +295 -0
- package/vendor/7zip/C/Ppmd8Enc.c +337 -0
- package/vendor/7zip/C/Precomp.h +127 -0
- package/vendor/7zip/C/RotateDefs.h +50 -0
- package/vendor/7zip/C/Sha1.c +441 -0
- package/vendor/7zip/C/Sha1.h +86 -0
- package/vendor/7zip/C/Sha1Opt.c +424 -0
- package/vendor/7zip/C/Sha256.c +492 -0
- package/vendor/7zip/C/Sha256.h +86 -0
- package/vendor/7zip/C/Sha256Opt.c +451 -0
- package/vendor/7zip/C/Sha3.c +359 -0
- package/vendor/7zip/C/Sha3.h +36 -0
- package/vendor/7zip/C/Sha512.c +711 -0
- package/vendor/7zip/C/Sha512.h +86 -0
- package/vendor/7zip/C/Sha512Opt.c +395 -0
- package/vendor/7zip/C/Sort.c +268 -0
- package/vendor/7zip/C/Sort.h +15 -0
- package/vendor/7zip/C/SwapBytes.c +835 -0
- package/vendor/7zip/C/SwapBytes.h +17 -0
- package/vendor/7zip/C/Threads.c +826 -0
- package/vendor/7zip/C/Threads.h +260 -0
- package/vendor/7zip/C/Util/7z/7z.dsp +249 -0
- package/vendor/7zip/C/Util/7z/7z.dsw +29 -0
- package/vendor/7zip/C/Util/7z/7zMain.c +1210 -0
- package/vendor/7zip/C/Util/7z/Precomp.c +4 -0
- package/vendor/7zip/C/Util/7z/Precomp.h +13 -0
- package/vendor/7zip/C/Util/7z/makefile +44 -0
- package/vendor/7zip/C/Util/7z/makefile.gcc +32 -0
- package/vendor/7zip/C/Util/7zipInstall/7zip.ico +0 -0
- package/vendor/7zip/C/Util/7zipInstall/7zipInstall.c +1699 -0
- package/vendor/7zip/C/Util/7zipInstall/7zipInstall.dsp +248 -0
- package/vendor/7zip/C/Util/7zipInstall/7zipInstall.dsw +29 -0
- package/vendor/7zip/C/Util/7zipInstall/7zipInstall.manifest +18 -0
- package/vendor/7zip/C/Util/7zipInstall/Precomp.c +4 -0
- package/vendor/7zip/C/Util/7zipInstall/Precomp.h +13 -0
- package/vendor/7zip/C/Util/7zipInstall/makefile +47 -0
- package/vendor/7zip/C/Util/7zipInstall/resource.h +9 -0
- package/vendor/7zip/C/Util/7zipInstall/resource.rc +48 -0
- package/vendor/7zip/C/Util/7zipUninstall/7zipUninstall.c +1234 -0
- package/vendor/7zip/C/Util/7zipUninstall/7zipUninstall.dsp +132 -0
- package/vendor/7zip/C/Util/7zipUninstall/7zipUninstall.dsw +29 -0
- package/vendor/7zip/C/Util/7zipUninstall/7zipUninstall.ico +0 -0
- package/vendor/7zip/C/Util/7zipUninstall/7zipUninstall.manifest +18 -0
- package/vendor/7zip/C/Util/7zipUninstall/Precomp.c +4 -0
- package/vendor/7zip/C/Util/7zipUninstall/Precomp.h +13 -0
- package/vendor/7zip/C/Util/7zipUninstall/makefile +18 -0
- package/vendor/7zip/C/Util/7zipUninstall/resource.h +9 -0
- package/vendor/7zip/C/Util/7zipUninstall/resource.rc +48 -0
- package/vendor/7zip/C/Util/Lzma/LzmaUtil.c +313 -0
- package/vendor/7zip/C/Util/Lzma/LzmaUtil.dsp +192 -0
- package/vendor/7zip/C/Util/Lzma/LzmaUtil.dsw +29 -0
- package/vendor/7zip/C/Util/Lzma/Precomp.h +13 -0
- package/vendor/7zip/C/Util/Lzma/makefile +30 -0
- package/vendor/7zip/C/Util/Lzma/makefile.gcc +21 -0
- package/vendor/7zip/C/Util/LzmaLib/LzmaLib.def +4 -0
- package/vendor/7zip/C/Util/LzmaLib/LzmaLib.dsp +206 -0
- package/vendor/7zip/C/Util/LzmaLib/LzmaLib.dsw +29 -0
- package/vendor/7zip/C/Util/LzmaLib/LzmaLibExports.c +15 -0
- package/vendor/7zip/C/Util/LzmaLib/Precomp.c +4 -0
- package/vendor/7zip/C/Util/LzmaLib/Precomp.h +13 -0
- package/vendor/7zip/C/Util/LzmaLib/makefile +59 -0
- package/vendor/7zip/C/Util/LzmaLib/resource.rc +3 -0
- package/vendor/7zip/C/Util/SfxSetup/Precomp.c +4 -0
- package/vendor/7zip/C/Util/SfxSetup/Precomp.h +13 -0
- package/vendor/7zip/C/Util/SfxSetup/SfxSetup.c +657 -0
- package/vendor/7zip/C/Util/SfxSetup/SfxSetup.dsp +231 -0
- package/vendor/7zip/C/Util/SfxSetup/SfxSetup.dsw +29 -0
- package/vendor/7zip/C/Util/SfxSetup/makefile +44 -0
- package/vendor/7zip/C/Util/SfxSetup/makefile_con +40 -0
- package/vendor/7zip/C/Util/SfxSetup/resource.rc +5 -0
- package/vendor/7zip/C/Util/SfxSetup/setup.ico +0 -0
- package/vendor/7zip/C/Xxh64.c +389 -0
- package/vendor/7zip/C/Xxh64.h +50 -0
- package/vendor/7zip/C/Xz.c +92 -0
- package/vendor/7zip/C/Xz.h +542 -0
- package/vendor/7zip/C/XzCrc64.c +140 -0
- package/vendor/7zip/C/XzCrc64.h +26 -0
- package/vendor/7zip/C/XzCrc64Opt.c +261 -0
- package/vendor/7zip/C/XzDec.c +2865 -0
- package/vendor/7zip/C/XzEnc.c +1374 -0
- package/vendor/7zip/C/XzEnc.h +62 -0
- package/vendor/7zip/C/XzIn.c +385 -0
- package/vendor/7zip/C/ZstdDec.c +4067 -0
- package/vendor/7zip/C/ZstdDec.h +173 -0
- package/vendor/7zip/C/var_clang.mak +11 -0
- package/vendor/7zip/C/var_clang_arm64.mak +12 -0
- package/vendor/7zip/C/var_clang_x64.mak +11 -0
- package/vendor/7zip/C/var_clang_x86.mak +11 -0
- package/vendor/7zip/C/var_gcc.mak +12 -0
- package/vendor/7zip/C/var_gcc_arm64.mak +12 -0
- package/vendor/7zip/C/var_gcc_x64.mak +10 -0
- package/vendor/7zip/C/var_gcc_x86.mak +10 -0
- package/vendor/7zip/C/var_mac_arm64.mak +13 -0
- package/vendor/7zip/C/var_mac_x64.mak +13 -0
- package/vendor/7zip/C/warn_clang.mak +1 -0
- package/vendor/7zip/C/warn_clang_mac.mak +1 -0
- package/vendor/7zip/C/warn_gcc.mak +51 -0
- package/vendor/7zip/CPP/7zip/7zip.mak +240 -0
- package/vendor/7zip/CPP/7zip/7zip_gcc.mak +1376 -0
- package/vendor/7zip/CPP/7zip/Aes.mak +10 -0
- package/vendor/7zip/CPP/7zip/Archive/7z/7z.dsp +650 -0
- package/vendor/7zip/CPP/7zip/Archive/7z/7z.dsw +29 -0
- package/vendor/7zip/CPP/7zip/Archive/7z/7zCompressionMode.cpp +3 -0
- package/vendor/7zip/CPP/7zip/Archive/7z/7zCompressionMode.h +92 -0
- package/vendor/7zip/CPP/7zip/Archive/7z/7zDecode.cpp +599 -0
- package/vendor/7zip/CPP/7zip/Archive/7z/7zDecode.h +73 -0
- package/vendor/7zip/CPP/7zip/Archive/7z/7zEncode.cpp +702 -0
- package/vendor/7zip/CPP/7zip/Archive/7z/7zEncode.h +95 -0
- package/vendor/7zip/CPP/7zip/Archive/7z/7zExtract.cpp +444 -0
- package/vendor/7zip/CPP/7zip/Archive/7z/7zFolderInStream.cpp +264 -0
- package/vendor/7zip/CPP/7zip/Archive/7z/7zFolderInStream.h +101 -0
- package/vendor/7zip/CPP/7zip/Archive/7z/7zHandler.cpp +800 -0
- package/vendor/7zip/CPP/7zip/Archive/7z/7zHandler.h +178 -0
- package/vendor/7zip/CPP/7zip/Archive/7z/7zHandlerOut.cpp +1162 -0
- package/vendor/7zip/CPP/7zip/Archive/7z/7zHeader.cpp +19 -0
- package/vendor/7zip/CPP/7zip/Archive/7z/7zHeader.h +156 -0
- package/vendor/7zip/CPP/7zip/Archive/7z/7zIn.cpp +1815 -0
- package/vendor/7zip/CPP/7zip/Archive/7z/7zIn.h +454 -0
- package/vendor/7zip/CPP/7zip/Archive/7z/7zItem.h +207 -0
- package/vendor/7zip/CPP/7zip/Archive/7z/7zOut.cpp +1026 -0
- package/vendor/7zip/CPP/7zip/Archive/7z/7zOut.h +346 -0
- package/vendor/7zip/CPP/7zip/Archive/7z/7zProperties.cpp +182 -0
- package/vendor/7zip/CPP/7zip/Archive/7z/7zProperties.h +26 -0
- package/vendor/7zip/CPP/7zip/Archive/7z/7zRegister.cpp +27 -0
- package/vendor/7zip/CPP/7zip/Archive/7z/7zSpecStream.cpp +31 -0
- package/vendor/7zip/CPP/7zip/Archive/7z/7zSpecStream.h +49 -0
- package/vendor/7zip/CPP/7zip/Archive/7z/7zUpdate.cpp +3087 -0
- package/vendor/7zip/CPP/7zip/Archive/7z/7zUpdate.h +167 -0
- package/vendor/7zip/CPP/7zip/Archive/7z/StdAfx.cpp +3 -0
- package/vendor/7zip/CPP/7zip/Archive/7z/StdAfx.h +11 -0
- package/vendor/7zip/CPP/7zip/Archive/7z/makefile +81 -0
- package/vendor/7zip/CPP/7zip/Archive/7z/resource.rc +11 -0
- package/vendor/7zip/CPP/7zip/Archive/ApfsHandler.cpp +4470 -0
- package/vendor/7zip/CPP/7zip/Archive/ApmHandler.cpp +420 -0
- package/vendor/7zip/CPP/7zip/Archive/ArHandler.cpp +844 -0
- package/vendor/7zip/CPP/7zip/Archive/Archive.def +15 -0
- package/vendor/7zip/CPP/7zip/Archive/Archive2.def +22 -0
- package/vendor/7zip/CPP/7zip/Archive/ArchiveExports.cpp +158 -0
- package/vendor/7zip/CPP/7zip/Archive/ArjHandler.cpp +977 -0
- package/vendor/7zip/CPP/7zip/Archive/AvbHandler.cpp +616 -0
- package/vendor/7zip/CPP/7zip/Archive/Base64Handler.cpp +488 -0
- package/vendor/7zip/CPP/7zip/Archive/Bz2Handler.cpp +482 -0
- package/vendor/7zip/CPP/7zip/Archive/Cab/CabBlockInStream.cpp +122 -0
- package/vendor/7zip/CPP/7zip/Archive/Cab/CabBlockInStream.h +28 -0
- package/vendor/7zip/CPP/7zip/Archive/Cab/CabHandler.cpp +1270 -0
- package/vendor/7zip/CPP/7zip/Archive/Cab/CabHandler.h +29 -0
- package/vendor/7zip/CPP/7zip/Archive/Cab/CabHeader.cpp +15 -0
- package/vendor/7zip/CPP/7zip/Archive/Cab/CabHeader.h +41 -0
- package/vendor/7zip/CPP/7zip/Archive/Cab/CabIn.cpp +485 -0
- package/vendor/7zip/CPP/7zip/Archive/Cab/CabIn.h +169 -0
- package/vendor/7zip/CPP/7zip/Archive/Cab/CabItem.h +69 -0
- package/vendor/7zip/CPP/7zip/Archive/Cab/CabRegister.cpp +19 -0
- package/vendor/7zip/CPP/7zip/Archive/Cab/StdAfx.h +11 -0
- package/vendor/7zip/CPP/7zip/Archive/Chm/ChmHandler.cpp +790 -0
- package/vendor/7zip/CPP/7zip/Archive/Chm/ChmHandler.h +27 -0
- package/vendor/7zip/CPP/7zip/Archive/Chm/ChmIn.cpp +1026 -0
- package/vendor/7zip/CPP/7zip/Archive/Chm/ChmIn.h +282 -0
- package/vendor/7zip/CPP/7zip/Archive/Chm/StdAfx.h +11 -0
- package/vendor/7zip/CPP/7zip/Archive/ComHandler.cpp +1449 -0
- package/vendor/7zip/CPP/7zip/Archive/Common/CoderMixer2.cpp +1144 -0
- package/vendor/7zip/CPP/7zip/Archive/Common/CoderMixer2.h +447 -0
- package/vendor/7zip/CPP/7zip/Archive/Common/DummyOutStream.cpp +17 -0
- package/vendor/7zip/CPP/7zip/Archive/Common/DummyOutStream.h +23 -0
- package/vendor/7zip/CPP/7zip/Archive/Common/FindSignature.cpp +90 -0
- package/vendor/7zip/CPP/7zip/Archive/Common/FindSignature.h +12 -0
- package/vendor/7zip/CPP/7zip/Archive/Common/HandlerOut.cpp +315 -0
- package/vendor/7zip/CPP/7zip/Archive/Common/HandlerOut.h +169 -0
- package/vendor/7zip/CPP/7zip/Archive/Common/InStreamWithCRC.cpp +57 -0
- package/vendor/7zip/CPP/7zip/Archive/Common/InStreamWithCRC.h +64 -0
- package/vendor/7zip/CPP/7zip/Archive/Common/ItemNameUtils.cpp +140 -0
- package/vendor/7zip/CPP/7zip/Archive/Common/ItemNameUtils.h +33 -0
- package/vendor/7zip/CPP/7zip/Archive/Common/MultiStream.cpp +193 -0
- package/vendor/7zip/CPP/7zip/Archive/Common/MultiStream.h +86 -0
- package/vendor/7zip/CPP/7zip/Archive/Common/OutStreamWithCRC.cpp +18 -0
- package/vendor/7zip/CPP/7zip/Archive/Common/OutStreamWithCRC.h +35 -0
- package/vendor/7zip/CPP/7zip/Archive/Common/OutStreamWithSha1.cpp +29 -0
- package/vendor/7zip/CPP/7zip/Archive/Common/OutStreamWithSha1.h +61 -0
- package/vendor/7zip/CPP/7zip/Archive/Common/ParseProperties.cpp +3 -0
- package/vendor/7zip/CPP/7zip/Archive/Common/ParseProperties.h +6 -0
- package/vendor/7zip/CPP/7zip/Archive/Common/StdAfx.h +11 -0
- package/vendor/7zip/CPP/7zip/Archive/CpioHandler.cpp +1110 -0
- package/vendor/7zip/CPP/7zip/Archive/CramfsHandler.cpp +784 -0
- package/vendor/7zip/CPP/7zip/Archive/DeflateProps.cpp +3 -0
- package/vendor/7zip/CPP/7zip/Archive/DeflateProps.h +6 -0
- package/vendor/7zip/CPP/7zip/Archive/DllExports.cpp +96 -0
- package/vendor/7zip/CPP/7zip/Archive/DllExports2.cpp +184 -0
- package/vendor/7zip/CPP/7zip/Archive/DmgHandler.cpp +2336 -0
- package/vendor/7zip/CPP/7zip/Archive/ElfHandler.cpp +1284 -0
- package/vendor/7zip/CPP/7zip/Archive/ExtHandler.cpp +2860 -0
- package/vendor/7zip/CPP/7zip/Archive/FatHandler.cpp +1325 -0
- package/vendor/7zip/CPP/7zip/Archive/FlvHandler.cpp +521 -0
- package/vendor/7zip/CPP/7zip/Archive/GptHandler.cpp +473 -0
- package/vendor/7zip/CPP/7zip/Archive/GzHandler.cpp +1200 -0
- package/vendor/7zip/CPP/7zip/Archive/HandlerCont.cpp +320 -0
- package/vendor/7zip/CPP/7zip/Archive/HandlerCont.h +134 -0
- package/vendor/7zip/CPP/7zip/Archive/HfsHandler.cpp +2631 -0
- package/vendor/7zip/CPP/7zip/Archive/HfsHandler.h +87 -0
- package/vendor/7zip/CPP/7zip/Archive/IArchive.h +755 -0
- package/vendor/7zip/CPP/7zip/Archive/Icons/7z.ico +0 -0
- package/vendor/7zip/CPP/7zip/Archive/Icons/apfs.ico +0 -0
- package/vendor/7zip/CPP/7zip/Archive/Icons/arj.ico +0 -0
- package/vendor/7zip/CPP/7zip/Archive/Icons/bz2.ico +0 -0
- package/vendor/7zip/CPP/7zip/Archive/Icons/cab.ico +0 -0
- package/vendor/7zip/CPP/7zip/Archive/Icons/cpio.ico +0 -0
- package/vendor/7zip/CPP/7zip/Archive/Icons/deb.ico +0 -0
- package/vendor/7zip/CPP/7zip/Archive/Icons/dmg.ico +0 -0
- package/vendor/7zip/CPP/7zip/Archive/Icons/fat.ico +0 -0
- package/vendor/7zip/CPP/7zip/Archive/Icons/gz.ico +0 -0
- package/vendor/7zip/CPP/7zip/Archive/Icons/hfs.ico +0 -0
- package/vendor/7zip/CPP/7zip/Archive/Icons/iso.ico +0 -0
- package/vendor/7zip/CPP/7zip/Archive/Icons/lzh.ico +0 -0
- package/vendor/7zip/CPP/7zip/Archive/Icons/lzma.ico +0 -0
- package/vendor/7zip/CPP/7zip/Archive/Icons/ntfs.ico +0 -0
- package/vendor/7zip/CPP/7zip/Archive/Icons/rar.ico +0 -0
- package/vendor/7zip/CPP/7zip/Archive/Icons/rpm.ico +0 -0
- package/vendor/7zip/CPP/7zip/Archive/Icons/split.ico +0 -0
- package/vendor/7zip/CPP/7zip/Archive/Icons/squashfs.ico +0 -0
- package/vendor/7zip/CPP/7zip/Archive/Icons/tar.ico +0 -0
- package/vendor/7zip/CPP/7zip/Archive/Icons/vhd.ico +0 -0
- package/vendor/7zip/CPP/7zip/Archive/Icons/wim.ico +0 -0
- package/vendor/7zip/CPP/7zip/Archive/Icons/xar.ico +0 -0
- package/vendor/7zip/CPP/7zip/Archive/Icons/xz.ico +0 -0
- package/vendor/7zip/CPP/7zip/Archive/Icons/z.ico +0 -0
- package/vendor/7zip/CPP/7zip/Archive/Icons/zip.ico +0 -0
- package/vendor/7zip/CPP/7zip/Archive/Icons/zst.ico +0 -0
- package/vendor/7zip/CPP/7zip/Archive/IhexHandler.cpp +493 -0
- package/vendor/7zip/CPP/7zip/Archive/Iso/IsoHandler.cpp +498 -0
- package/vendor/7zip/CPP/7zip/Archive/Iso/IsoHandler.h +24 -0
- package/vendor/7zip/CPP/7zip/Archive/Iso/IsoHeader.cpp +12 -0
- package/vendor/7zip/CPP/7zip/Archive/Iso/IsoHeader.h +64 -0
- package/vendor/7zip/CPP/7zip/Archive/Iso/IsoIn.cpp +801 -0
- package/vendor/7zip/CPP/7zip/Archive/Iso/IsoIn.h +328 -0
- package/vendor/7zip/CPP/7zip/Archive/Iso/IsoItem.h +316 -0
- package/vendor/7zip/CPP/7zip/Archive/Iso/IsoRegister.cpp +21 -0
- package/vendor/7zip/CPP/7zip/Archive/Iso/StdAfx.h +11 -0
- package/vendor/7zip/CPP/7zip/Archive/LpHandler.cpp +1172 -0
- package/vendor/7zip/CPP/7zip/Archive/LvmHandler.cpp +1108 -0
- package/vendor/7zip/CPP/7zip/Archive/LzhHandler.cpp +719 -0
- package/vendor/7zip/CPP/7zip/Archive/LzmaHandler.cpp +606 -0
- package/vendor/7zip/CPP/7zip/Archive/MachoHandler.cpp +1075 -0
- package/vendor/7zip/CPP/7zip/Archive/MbrHandler.cpp +648 -0
- package/vendor/7zip/CPP/7zip/Archive/MslzHandler.cpp +389 -0
- package/vendor/7zip/CPP/7zip/Archive/MubHandler.cpp +248 -0
- package/vendor/7zip/CPP/7zip/Archive/Nsis/NsisDecode.cpp +295 -0
- package/vendor/7zip/CPP/7zip/Archive/Nsis/NsisDecode.h +97 -0
- package/vendor/7zip/CPP/7zip/Archive/Nsis/NsisHandler.cpp +703 -0
- package/vendor/7zip/CPP/7zip/Archive/Nsis/NsisHandler.h +30 -0
- package/vendor/7zip/CPP/7zip/Archive/Nsis/NsisIn.cpp +6231 -0
- package/vendor/7zip/CPP/7zip/Archive/Nsis/NsisIn.h +462 -0
- package/vendor/7zip/CPP/7zip/Archive/Nsis/NsisRegister.cpp +20 -0
- package/vendor/7zip/CPP/7zip/Archive/Nsis/StdAfx.h +11 -0
- package/vendor/7zip/CPP/7zip/Archive/NtfsHandler.cpp +2944 -0
- package/vendor/7zip/CPP/7zip/Archive/PeHandler.cpp +3427 -0
- package/vendor/7zip/CPP/7zip/Archive/PpmdHandler.cpp +414 -0
- package/vendor/7zip/CPP/7zip/Archive/QcowHandler.cpp +713 -0
- package/vendor/7zip/CPP/7zip/Archive/Rar/Rar5Handler.cpp +3483 -0
- package/vendor/7zip/CPP/7zip/Archive/Rar/Rar5Handler.h +527 -0
- package/vendor/7zip/CPP/7zip/Archive/Rar/RarHandler.cpp +1775 -0
- package/vendor/7zip/CPP/7zip/Archive/Rar/RarHandler.h +115 -0
- package/vendor/7zip/CPP/7zip/Archive/Rar/RarHeader.h +209 -0
- package/vendor/7zip/CPP/7zip/Archive/Rar/RarItem.h +97 -0
- package/vendor/7zip/CPP/7zip/Archive/Rar/RarVol.h +136 -0
- package/vendor/7zip/CPP/7zip/Archive/Rar/StdAfx.cpp +3 -0
- package/vendor/7zip/CPP/7zip/Archive/Rar/StdAfx.h +11 -0
- package/vendor/7zip/CPP/7zip/Archive/RpmHandler.cpp +775 -0
- package/vendor/7zip/CPP/7zip/Archive/SparseHandler.cpp +558 -0
- package/vendor/7zip/CPP/7zip/Archive/SplitHandler.cpp +353 -0
- package/vendor/7zip/CPP/7zip/Archive/SquashfsHandler.cpp +2373 -0
- package/vendor/7zip/CPP/7zip/Archive/StdAfx.h +11 -0
- package/vendor/7zip/CPP/7zip/Archive/SwfHandler.cpp +996 -0
- package/vendor/7zip/CPP/7zip/Archive/Tar/StdAfx.h +11 -0
- package/vendor/7zip/CPP/7zip/Archive/Tar/TarHandler.cpp +1105 -0
- package/vendor/7zip/CPP/7zip/Archive/Tar/TarHandler.h +57 -0
- package/vendor/7zip/CPP/7zip/Archive/Tar/TarHandlerOut.cpp +332 -0
- package/vendor/7zip/CPP/7zip/Archive/Tar/TarHeader.cpp +99 -0
- package/vendor/7zip/CPP/7zip/Archive/Tar/TarHeader.h +90 -0
- package/vendor/7zip/CPP/7zip/Archive/Tar/TarIn.cpp +1151 -0
- package/vendor/7zip/CPP/7zip/Archive/Tar/TarIn.h +151 -0
- package/vendor/7zip/CPP/7zip/Archive/Tar/TarItem.h +365 -0
- package/vendor/7zip/CPP/7zip/Archive/Tar/TarOut.cpp +644 -0
- package/vendor/7zip/CPP/7zip/Archive/Tar/TarOut.h +53 -0
- package/vendor/7zip/CPP/7zip/Archive/Tar/TarRegister.cpp +31 -0
- package/vendor/7zip/CPP/7zip/Archive/Tar/TarUpdate.cpp +563 -0
- package/vendor/7zip/CPP/7zip/Archive/Tar/TarUpdate.h +74 -0
- package/vendor/7zip/CPP/7zip/Archive/Udf/StdAfx.h +11 -0
- package/vendor/7zip/CPP/7zip/Archive/Udf/UdfHandler.cpp +427 -0
- package/vendor/7zip/CPP/7zip/Archive/Udf/UdfHandler.h +32 -0
- package/vendor/7zip/CPP/7zip/Archive/Udf/UdfIn.cpp +1756 -0
- package/vendor/7zip/CPP/7zip/Archive/Udf/UdfIn.h +508 -0
- package/vendor/7zip/CPP/7zip/Archive/UefiHandler.cpp +1884 -0
- package/vendor/7zip/CPP/7zip/Archive/VdiHandler.cpp +433 -0
- package/vendor/7zip/CPP/7zip/Archive/VhdHandler.cpp +1106 -0
- package/vendor/7zip/CPP/7zip/Archive/VhdxHandler.cpp +2085 -0
- package/vendor/7zip/CPP/7zip/Archive/VmdkHandler.cpp +1530 -0
- package/vendor/7zip/CPP/7zip/Archive/Wim/StdAfx.h +11 -0
- package/vendor/7zip/CPP/7zip/Archive/Wim/WimHandler.cpp +1291 -0
- package/vendor/7zip/CPP/7zip/Archive/Wim/WimHandler.h +117 -0
- package/vendor/7zip/CPP/7zip/Archive/Wim/WimHandlerOut.cpp +2008 -0
- package/vendor/7zip/CPP/7zip/Archive/Wim/WimIn.cpp +2104 -0
- package/vendor/7zip/CPP/7zip/Archive/Wim/WimIn.h +719 -0
- package/vendor/7zip/CPP/7zip/Archive/Wim/WimRegister.cpp +29 -0
- package/vendor/7zip/CPP/7zip/Archive/XarHandler.cpp +1316 -0
- package/vendor/7zip/CPP/7zip/Archive/XzHandler.cpp +1452 -0
- package/vendor/7zip/CPP/7zip/Archive/XzHandler.h +11 -0
- package/vendor/7zip/CPP/7zip/Archive/ZHandler.cpp +208 -0
- package/vendor/7zip/CPP/7zip/Archive/Zip/StdAfx.h +11 -0
- package/vendor/7zip/CPP/7zip/Archive/Zip/ZipAddCommon.cpp +484 -0
- package/vendor/7zip/CPP/7zip/Archive/Zip/ZipAddCommon.h +76 -0
- package/vendor/7zip/CPP/7zip/Archive/Zip/ZipCompressionMode.h +62 -0
- package/vendor/7zip/CPP/7zip/Archive/Zip/ZipHandler.cpp +1679 -0
- package/vendor/7zip/CPP/7zip/Archive/Zip/ZipHandler.h +94 -0
- package/vendor/7zip/CPP/7zip/Archive/Zip/ZipHandlerOut.cpp +626 -0
- package/vendor/7zip/CPP/7zip/Archive/Zip/ZipHeader.h +201 -0
- package/vendor/7zip/CPP/7zip/Archive/Zip/ZipIn.cpp +3474 -0
- package/vendor/7zip/CPP/7zip/Archive/Zip/ZipIn.h +456 -0
- package/vendor/7zip/CPP/7zip/Archive/Zip/ZipItem.cpp +464 -0
- package/vendor/7zip/CPP/7zip/Archive/Zip/ZipItem.h +356 -0
- package/vendor/7zip/CPP/7zip/Archive/Zip/ZipOut.cpp +428 -0
- package/vendor/7zip/CPP/7zip/Archive/Zip/ZipOut.h +103 -0
- package/vendor/7zip/CPP/7zip/Archive/Zip/ZipRegister.cpp +38 -0
- package/vendor/7zip/CPP/7zip/Archive/Zip/ZipUpdate.cpp +2165 -0
- package/vendor/7zip/CPP/7zip/Archive/Zip/ZipUpdate.h +107 -0
- package/vendor/7zip/CPP/7zip/Archive/ZstdHandler.cpp +1147 -0
- package/vendor/7zip/CPP/7zip/Archive/makefile +23 -0
- package/vendor/7zip/CPP/7zip/Asm.mak +12 -0
- package/vendor/7zip/CPP/7zip/Bundles/Alone/Alone.dsp +3324 -0
- package/vendor/7zip/CPP/7zip/Bundles/Alone/Alone.dsw +29 -0
- package/vendor/7zip/CPP/7zip/Bundles/Alone/StdAfx.cpp +3 -0
- package/vendor/7zip/CPP/7zip/Bundles/Alone/StdAfx.h +11 -0
- package/vendor/7zip/CPP/7zip/Bundles/Alone/makefile +245 -0
- package/vendor/7zip/CPP/7zip/Bundles/Alone/makefile.gcc +354 -0
- package/vendor/7zip/CPP/7zip/Bundles/Alone/resource.rc +7 -0
- package/vendor/7zip/CPP/7zip/Bundles/Alone2/StdAfx.cpp +3 -0
- package/vendor/7zip/CPP/7zip/Bundles/Alone2/StdAfx.h +11 -0
- package/vendor/7zip/CPP/7zip/Bundles/Alone2/makefile +31 -0
- package/vendor/7zip/CPP/7zip/Bundles/Alone2/makefile.gcc +108 -0
- package/vendor/7zip/CPP/7zip/Bundles/Alone2/resource.rc +7 -0
- package/vendor/7zip/CPP/7zip/Bundles/Alone7z/Alone.dsp +2090 -0
- package/vendor/7zip/CPP/7zip/Bundles/Alone7z/Alone.dsw +29 -0
- package/vendor/7zip/CPP/7zip/Bundles/Alone7z/StdAfx.cpp +3 -0
- package/vendor/7zip/CPP/7zip/Bundles/Alone7z/StdAfx.h +11 -0
- package/vendor/7zip/CPP/7zip/Bundles/Alone7z/makefile +168 -0
- package/vendor/7zip/CPP/7zip/Bundles/Alone7z/makefile.gcc +276 -0
- package/vendor/7zip/CPP/7zip/Bundles/Alone7z/resource.rc +7 -0
- package/vendor/7zip/CPP/7zip/Bundles/Fm/FM.dsp +2275 -0
- package/vendor/7zip/CPP/7zip/Bundles/Fm/FM.dsw +29 -0
- package/vendor/7zip/CPP/7zip/Bundles/Fm/StdAfx.cpp +3 -0
- package/vendor/7zip/CPP/7zip/Bundles/Fm/StdAfx.h +6 -0
- package/vendor/7zip/CPP/7zip/Bundles/Fm/makefile +82 -0
- package/vendor/7zip/CPP/7zip/Bundles/Fm/resource.rc +7 -0
- package/vendor/7zip/CPP/7zip/Bundles/Format7z/StdAfx.cpp +3 -0
- package/vendor/7zip/CPP/7zip/Bundles/Format7z/StdAfx.h +11 -0
- package/vendor/7zip/CPP/7zip/Bundles/Format7z/makefile +148 -0
- package/vendor/7zip/CPP/7zip/Bundles/Format7z/resource.rc +5 -0
- package/vendor/7zip/CPP/7zip/Bundles/Format7zExtract/StdAfx.cpp +3 -0
- package/vendor/7zip/CPP/7zip/Bundles/Format7zExtract/StdAfx.h +11 -0
- package/vendor/7zip/CPP/7zip/Bundles/Format7zExtract/makefile +116 -0
- package/vendor/7zip/CPP/7zip/Bundles/Format7zExtract/resource.rc +5 -0
- package/vendor/7zip/CPP/7zip/Bundles/Format7zExtractR/StdAfx.cpp +3 -0
- package/vendor/7zip/CPP/7zip/Bundles/Format7zExtractR/StdAfx.h +11 -0
- package/vendor/7zip/CPP/7zip/Bundles/Format7zExtractR/makefile +98 -0
- package/vendor/7zip/CPP/7zip/Bundles/Format7zExtractR/resource.rc +5 -0
- package/vendor/7zip/CPP/7zip/Bundles/Format7zF/Arc.mak +310 -0
- package/vendor/7zip/CPP/7zip/Bundles/Format7zF/Arc_gcc.mak +395 -0
- package/vendor/7zip/CPP/7zip/Bundles/Format7zF/Format7z.dsp +3486 -0
- package/vendor/7zip/CPP/7zip/Bundles/Format7zF/Format7z.dsw +29 -0
- package/vendor/7zip/CPP/7zip/Bundles/Format7zF/StdAfx.cpp +3 -0
- package/vendor/7zip/CPP/7zip/Bundles/Format7zF/StdAfx.h +11 -0
- package/vendor/7zip/CPP/7zip/Bundles/Format7zF/makefile +20 -0
- package/vendor/7zip/CPP/7zip/Bundles/Format7zF/makefile.gcc +55 -0
- package/vendor/7zip/CPP/7zip/Bundles/Format7zF/resource.rc +39 -0
- package/vendor/7zip/CPP/7zip/Bundles/Format7zR/StdAfx.cpp +3 -0
- package/vendor/7zip/CPP/7zip/Bundles/Format7zR/StdAfx.h +11 -0
- package/vendor/7zip/CPP/7zip/Bundles/Format7zR/makefile +121 -0
- package/vendor/7zip/CPP/7zip/Bundles/Format7zR/resource.rc +5 -0
- package/vendor/7zip/CPP/7zip/Bundles/LzmaCon/LzmaAlone.cpp +815 -0
- package/vendor/7zip/CPP/7zip/Bundles/LzmaCon/LzmaCon.dsp +540 -0
- package/vendor/7zip/CPP/7zip/Bundles/LzmaCon/LzmaCon.dsw +29 -0
- package/vendor/7zip/CPP/7zip/Bundles/LzmaCon/StdAfx.cpp +3 -0
- package/vendor/7zip/CPP/7zip/Bundles/LzmaCon/StdAfx.h +11 -0
- package/vendor/7zip/CPP/7zip/Bundles/LzmaCon/makefile +68 -0
- package/vendor/7zip/CPP/7zip/Bundles/LzmaCon/makefile.gcc +131 -0
- package/vendor/7zip/CPP/7zip/Bundles/LzmaCon/resource.rc +3 -0
- package/vendor/7zip/CPP/7zip/Bundles/SFXCon/7z.ico +0 -0
- package/vendor/7zip/CPP/7zip/Bundles/SFXCon/SFXCon.dsp +1017 -0
- package/vendor/7zip/CPP/7zip/Bundles/SFXCon/SFXCon.dsw +29 -0
- package/vendor/7zip/CPP/7zip/Bundles/SFXCon/SfxCon.cpp +521 -0
- package/vendor/7zip/CPP/7zip/Bundles/SFXCon/StdAfx.cpp +3 -0
- package/vendor/7zip/CPP/7zip/Bundles/SFXCon/StdAfx.h +11 -0
- package/vendor/7zip/CPP/7zip/Bundles/SFXCon/makefile +137 -0
- package/vendor/7zip/CPP/7zip/Bundles/SFXCon/makefile.gcc +215 -0
- package/vendor/7zip/CPP/7zip/Bundles/SFXCon/resource.rc +9 -0
- package/vendor/7zip/CPP/7zip/Bundles/SFXSetup/ExtractCallbackSfx.cpp +246 -0
- package/vendor/7zip/CPP/7zip/Bundles/SFXSetup/ExtractCallbackSfx.h +83 -0
- package/vendor/7zip/CPP/7zip/Bundles/SFXSetup/ExtractEngine.cpp +135 -0
- package/vendor/7zip/CPP/7zip/Bundles/SFXSetup/ExtractEngine.h +11 -0
- package/vendor/7zip/CPP/7zip/Bundles/SFXSetup/SFXSetup.dsp +872 -0
- package/vendor/7zip/CPP/7zip/Bundles/SFXSetup/SFXSetup.dsw +29 -0
- package/vendor/7zip/CPP/7zip/Bundles/SFXSetup/SfxSetup.cpp +359 -0
- package/vendor/7zip/CPP/7zip/Bundles/SFXSetup/StdAfx.cpp +3 -0
- package/vendor/7zip/CPP/7zip/Bundles/SFXSetup/StdAfx.h +6 -0
- package/vendor/7zip/CPP/7zip/Bundles/SFXSetup/makefile +121 -0
- package/vendor/7zip/CPP/7zip/Bundles/SFXSetup/resource.h +6 -0
- package/vendor/7zip/CPP/7zip/Bundles/SFXSetup/resource.rc +16 -0
- package/vendor/7zip/CPP/7zip/Bundles/SFXSetup/setup.ico +0 -0
- package/vendor/7zip/CPP/7zip/Bundles/SFXWin/7z.ico +0 -0
- package/vendor/7zip/CPP/7zip/Bundles/SFXWin/SFXWin.dsp +1074 -0
- package/vendor/7zip/CPP/7zip/Bundles/SFXWin/SFXWin.dsw +29 -0
- package/vendor/7zip/CPP/7zip/Bundles/SFXWin/SfxWin.cpp +268 -0
- package/vendor/7zip/CPP/7zip/Bundles/SFXWin/StdAfx.cpp +3 -0
- package/vendor/7zip/CPP/7zip/Bundles/SFXWin/StdAfx.h +6 -0
- package/vendor/7zip/CPP/7zip/Bundles/SFXWin/makefile +159 -0
- package/vendor/7zip/CPP/7zip/Bundles/SFXWin/resource.h +1 -0
- package/vendor/7zip/CPP/7zip/Bundles/SFXWin/resource.rc +55 -0
- package/vendor/7zip/CPP/7zip/Bundles/makefile +19 -0
- package/vendor/7zip/CPP/7zip/Common/CWrappers.cpp +358 -0
- package/vendor/7zip/CPP/7zip/Common/CWrappers.h +182 -0
- package/vendor/7zip/CPP/7zip/Common/CreateCoder.cpp +548 -0
- package/vendor/7zip/CPP/7zip/Common/CreateCoder.h +200 -0
- package/vendor/7zip/CPP/7zip/Common/FilePathAutoRename.cpp +46 -0
- package/vendor/7zip/CPP/7zip/Common/FilePathAutoRename.h +10 -0
- package/vendor/7zip/CPP/7zip/Common/FileStreams.cpp +923 -0
- package/vendor/7zip/CPP/7zip/Common/FileStreams.h +205 -0
- package/vendor/7zip/CPP/7zip/Common/FilterCoder.cpp +582 -0
- package/vendor/7zip/CPP/7zip/Common/FilterCoder.h +201 -0
- package/vendor/7zip/CPP/7zip/Common/InBuffer.cpp +182 -0
- package/vendor/7zip/CPP/7zip/Common/InBuffer.h +121 -0
- package/vendor/7zip/CPP/7zip/Common/InOutTempBuffer.cpp +237 -0
- package/vendor/7zip/CPP/7zip/Common/InOutTempBuffer.h +45 -0
- package/vendor/7zip/CPP/7zip/Common/LimitedStreams.cpp +395 -0
- package/vendor/7zip/CPP/7zip/Common/LimitedStreams.h +221 -0
- package/vendor/7zip/CPP/7zip/Common/LockedStream.cpp +3 -0
- package/vendor/7zip/CPP/7zip/Common/LockedStream.h +6 -0
- package/vendor/7zip/CPP/7zip/Common/MemBlocks.cpp +215 -0
- package/vendor/7zip/CPP/7zip/Common/MemBlocks.h +72 -0
- package/vendor/7zip/CPP/7zip/Common/MethodId.cpp +3 -0
- package/vendor/7zip/CPP/7zip/Common/MethodId.h +10 -0
- package/vendor/7zip/CPP/7zip/Common/MethodProps.cpp +765 -0
- package/vendor/7zip/CPP/7zip/Common/MethodProps.h +348 -0
- package/vendor/7zip/CPP/7zip/Common/MultiOutStream.cpp +855 -0
- package/vendor/7zip/CPP/7zip/Common/MultiOutStream.h +160 -0
- package/vendor/7zip/CPP/7zip/Common/OffsetStream.cpp +37 -0
- package/vendor/7zip/CPP/7zip/Common/OffsetStream.h +22 -0
- package/vendor/7zip/CPP/7zip/Common/OutBuffer.cpp +111 -0
- package/vendor/7zip/CPP/7zip/Common/OutBuffer.h +133 -0
- package/vendor/7zip/CPP/7zip/Common/OutMemStream.cpp +158 -0
- package/vendor/7zip/CPP/7zip/Common/OutMemStream.h +104 -0
- package/vendor/7zip/CPP/7zip/Common/ProgressMt.cpp +53 -0
- package/vendor/7zip/CPP/7zip/Common/ProgressMt.h +43 -0
- package/vendor/7zip/CPP/7zip/Common/ProgressUtils.cpp +51 -0
- package/vendor/7zip/CPP/7zip/Common/ProgressUtils.h +33 -0
- package/vendor/7zip/CPP/7zip/Common/PropId.cpp +115 -0
- package/vendor/7zip/CPP/7zip/Common/RegisterArc.h +80 -0
- package/vendor/7zip/CPP/7zip/Common/RegisterCodec.h +106 -0
- package/vendor/7zip/CPP/7zip/Common/StdAfx.h +11 -0
- package/vendor/7zip/CPP/7zip/Common/StreamBinder.cpp +151 -0
- package/vendor/7zip/CPP/7zip/Common/StreamBinder.h +78 -0
- package/vendor/7zip/CPP/7zip/Common/StreamObjects.cpp +290 -0
- package/vendor/7zip/CPP/7zip/Common/StreamObjects.h +146 -0
- package/vendor/7zip/CPP/7zip/Common/StreamUtils.cpp +101 -0
- package/vendor/7zip/CPP/7zip/Common/StreamUtils.h +31 -0
- package/vendor/7zip/CPP/7zip/Common/UniqBlocks.cpp +57 -0
- package/vendor/7zip/CPP/7zip/Common/UniqBlocks.h +41 -0
- package/vendor/7zip/CPP/7zip/Common/VirtThread.cpp +47 -0
- package/vendor/7zip/CPP/7zip/Common/VirtThread.h +24 -0
- package/vendor/7zip/CPP/7zip/Compress/BZip2Const.h +71 -0
- package/vendor/7zip/CPP/7zip/Compress/BZip2Crc.cpp +28 -0
- package/vendor/7zip/CPP/7zip/Compress/BZip2Crc.h +31 -0
- package/vendor/7zip/CPP/7zip/Compress/BZip2Decoder.cpp +1777 -0
- package/vendor/7zip/CPP/7zip/Compress/BZip2Decoder.h +388 -0
- package/vendor/7zip/CPP/7zip/Compress/BZip2Encoder.cpp +1116 -0
- package/vendor/7zip/CPP/7zip/Compress/BZip2Encoder.h +273 -0
- package/vendor/7zip/CPP/7zip/Compress/BZip2Register.cpp +25 -0
- package/vendor/7zip/CPP/7zip/Compress/Bcj2Coder.cpp +867 -0
- package/vendor/7zip/CPP/7zip/Compress/Bcj2Coder.h +127 -0
- package/vendor/7zip/CPP/7zip/Compress/Bcj2Register.cpp +24 -0
- package/vendor/7zip/CPP/7zip/Compress/BcjCoder.cpp +24 -0
- package/vendor/7zip/CPP/7zip/Compress/BcjCoder.h +37 -0
- package/vendor/7zip/CPP/7zip/Compress/BcjRegister.cpp +17 -0
- package/vendor/7zip/CPP/7zip/Compress/BitlDecoder.cpp +32 -0
- package/vendor/7zip/CPP/7zip/Compress/BitlDecoder.h +225 -0
- package/vendor/7zip/CPP/7zip/Compress/BitlEncoder.h +57 -0
- package/vendor/7zip/CPP/7zip/Compress/BitmDecoder.h +106 -0
- package/vendor/7zip/CPP/7zip/Compress/BitmEncoder.h +90 -0
- package/vendor/7zip/CPP/7zip/Compress/BranchMisc.cpp +106 -0
- package/vendor/7zip/CPP/7zip/Compress/BranchMisc.h +59 -0
- package/vendor/7zip/CPP/7zip/Compress/BranchRegister.cpp +58 -0
- package/vendor/7zip/CPP/7zip/Compress/ByteSwap.cpp +91 -0
- package/vendor/7zip/CPP/7zip/Compress/Codec.def +7 -0
- package/vendor/7zip/CPP/7zip/Compress/CodecExports.cpp +378 -0
- package/vendor/7zip/CPP/7zip/Compress/CopyCoder.cpp +153 -0
- package/vendor/7zip/CPP/7zip/Compress/CopyCoder.h +34 -0
- package/vendor/7zip/CPP/7zip/Compress/CopyRegister.cpp +15 -0
- package/vendor/7zip/CPP/7zip/Compress/Deflate64Register.cpp +25 -0
- package/vendor/7zip/CPP/7zip/Compress/DeflateConst.h +131 -0
- package/vendor/7zip/CPP/7zip/Compress/DeflateDecoder.cpp +566 -0
- package/vendor/7zip/CPP/7zip/Compress/DeflateDecoder.h +154 -0
- package/vendor/7zip/CPP/7zip/Compress/DeflateEncoder.cpp +1045 -0
- package/vendor/7zip/CPP/7zip/Compress/DeflateEncoder.h +203 -0
- package/vendor/7zip/CPP/7zip/Compress/DeflateRegister.cpp +25 -0
- package/vendor/7zip/CPP/7zip/Compress/DeltaFilter.cpp +126 -0
- package/vendor/7zip/CPP/7zip/Compress/DllExports2Compress.cpp +38 -0
- package/vendor/7zip/CPP/7zip/Compress/DllExportsCompress.cpp +59 -0
- package/vendor/7zip/CPP/7zip/Compress/HuffmanDecoder.h +528 -0
- package/vendor/7zip/CPP/7zip/Compress/ImplodeDecoder.cpp +250 -0
- package/vendor/7zip/CPP/7zip/Compress/ImplodeDecoder.h +61 -0
- package/vendor/7zip/CPP/7zip/Compress/ImplodeHuffmanDecoder.cpp +3 -0
- package/vendor/7zip/CPP/7zip/Compress/ImplodeHuffmanDecoder.h +6 -0
- package/vendor/7zip/CPP/7zip/Compress/LzOutWindow.cpp +14 -0
- package/vendor/7zip/CPP/7zip/Compress/LzOutWindow.h +102 -0
- package/vendor/7zip/CPP/7zip/Compress/LzfseDecoder.cpp +950 -0
- package/vendor/7zip/CPP/7zip/Compress/LzfseDecoder.h +63 -0
- package/vendor/7zip/CPP/7zip/Compress/LzhDecoder.cpp +220 -0
- package/vendor/7zip/CPP/7zip/Compress/LzhDecoder.h +68 -0
- package/vendor/7zip/CPP/7zip/Compress/Lzma2Decoder.cpp +267 -0
- package/vendor/7zip/CPP/7zip/Compress/Lzma2Decoder.h +87 -0
- package/vendor/7zip/CPP/7zip/Compress/Lzma2Encoder.cpp +134 -0
- package/vendor/7zip/CPP/7zip/Compress/Lzma2Encoder.h +30 -0
- package/vendor/7zip/CPP/7zip/Compress/Lzma2Register.cpp +22 -0
- package/vendor/7zip/CPP/7zip/Compress/LzmaDecoder.cpp +350 -0
- package/vendor/7zip/CPP/7zip/Compress/LzmaDecoder.h +113 -0
- package/vendor/7zip/CPP/7zip/Compress/LzmaEncoder.cpp +374 -0
- package/vendor/7zip/CPP/7zip/Compress/LzmaEncoder.h +45 -0
- package/vendor/7zip/CPP/7zip/Compress/LzmaRegister.cpp +22 -0
- package/vendor/7zip/CPP/7zip/Compress/LzmsDecoder.cpp +619 -0
- package/vendor/7zip/CPP/7zip/Compress/LzmsDecoder.h +209 -0
- package/vendor/7zip/CPP/7zip/Compress/Lzx.h +61 -0
- package/vendor/7zip/CPP/7zip/Compress/LzxDecoder.cpp +1517 -0
- package/vendor/7zip/CPP/7zip/Compress/LzxDecoder.h +106 -0
- package/vendor/7zip/CPP/7zip/Compress/Mtf8.h +225 -0
- package/vendor/7zip/CPP/7zip/Compress/PpmdDecoder.cpp +219 -0
- package/vendor/7zip/CPP/7zip/Compress/PpmdDecoder.h +87 -0
- package/vendor/7zip/CPP/7zip/Compress/PpmdEncoder.cpp +193 -0
- package/vendor/7zip/CPP/7zip/Compress/PpmdEncoder.h +49 -0
- package/vendor/7zip/CPP/7zip/Compress/PpmdRegister.cpp +22 -0
- package/vendor/7zip/CPP/7zip/Compress/PpmdZip.cpp +309 -0
- package/vendor/7zip/CPP/7zip/Compress/PpmdZip.h +78 -0
- package/vendor/7zip/CPP/7zip/Compress/QuantumDecoder.cpp +355 -0
- package/vendor/7zip/CPP/7zip/Compress/QuantumDecoder.h +60 -0
- package/vendor/7zip/CPP/7zip/Compress/Rar1Decoder.cpp +518 -0
- package/vendor/7zip/CPP/7zip/Compress/Rar1Decoder.h +70 -0
- package/vendor/7zip/CPP/7zip/Compress/Rar2Decoder.cpp +472 -0
- package/vendor/7zip/CPP/7zip/Compress/Rar2Decoder.h +111 -0
- package/vendor/7zip/CPP/7zip/Compress/Rar3Decoder.cpp +939 -0
- package/vendor/7zip/CPP/7zip/Compress/Rar3Decoder.h +283 -0
- package/vendor/7zip/CPP/7zip/Compress/Rar3Vm.cpp +1153 -0
- package/vendor/7zip/CPP/7zip/Compress/Rar3Vm.h +195 -0
- package/vendor/7zip/CPP/7zip/Compress/Rar5Decoder.cpp +2060 -0
- package/vendor/7zip/CPP/7zip/Compress/Rar5Decoder.h +132 -0
- package/vendor/7zip/CPP/7zip/Compress/RarCodecsRegister.cpp +33 -0
- package/vendor/7zip/CPP/7zip/Compress/ShrinkDecoder.cpp +290 -0
- package/vendor/7zip/CPP/7zip/Compress/ShrinkDecoder.h +38 -0
- package/vendor/7zip/CPP/7zip/Compress/StdAfx.h +11 -0
- package/vendor/7zip/CPP/7zip/Compress/XpressDecoder.cpp +399 -0
- package/vendor/7zip/CPP/7zip/Compress/XpressDecoder.h +18 -0
- package/vendor/7zip/CPP/7zip/Compress/XzDecoder.cpp +151 -0
- package/vendor/7zip/CPP/7zip/Compress/XzDecoder.h +86 -0
- package/vendor/7zip/CPP/7zip/Compress/XzEncoder.cpp +243 -0
- package/vendor/7zip/CPP/7zip/Compress/XzEncoder.h +35 -0
- package/vendor/7zip/CPP/7zip/Compress/ZDecoder.cpp +392 -0
- package/vendor/7zip/CPP/7zip/Compress/ZDecoder.h +41 -0
- package/vendor/7zip/CPP/7zip/Compress/ZlibDecoder.cpp +136 -0
- package/vendor/7zip/CPP/7zip/Compress/ZlibDecoder.h +78 -0
- package/vendor/7zip/CPP/7zip/Compress/ZlibEncoder.cpp +61 -0
- package/vendor/7zip/CPP/7zip/Compress/ZlibEncoder.h +42 -0
- package/vendor/7zip/CPP/7zip/Compress/ZstdDecoder.cpp +437 -0
- package/vendor/7zip/CPP/7zip/Compress/ZstdDecoder.h +98 -0
- package/vendor/7zip/CPP/7zip/Compress/makefile +7 -0
- package/vendor/7zip/CPP/7zip/Crc.mak +8 -0
- package/vendor/7zip/CPP/7zip/Crc64.mak +8 -0
- package/vendor/7zip/CPP/7zip/Crypto/7zAes.cpp +315 -0
- package/vendor/7zip/CPP/7zip/Crypto/7zAes.h +130 -0
- package/vendor/7zip/CPP/7zip/Crypto/7zAesRegister.cpp +17 -0
- package/vendor/7zip/CPP/7zip/Crypto/Codec.def +4 -0
- package/vendor/7zip/CPP/7zip/Crypto/HmacSha1.cpp +94 -0
- package/vendor/7zip/CPP/7zip/Crypto/HmacSha1.h +31 -0
- package/vendor/7zip/CPP/7zip/Crypto/HmacSha256.cpp +53 -0
- package/vendor/7zip/CPP/7zip/Crypto/HmacSha256.h +27 -0
- package/vendor/7zip/CPP/7zip/Crypto/MyAes.cpp +277 -0
- package/vendor/7zip/CPP/7zip/Crypto/MyAes.h +122 -0
- package/vendor/7zip/CPP/7zip/Crypto/MyAesReg.cpp +29 -0
- package/vendor/7zip/CPP/7zip/Crypto/Pbkdf2HmacSha1.cpp +48 -0
- package/vendor/7zip/CPP/7zip/Crypto/Pbkdf2HmacSha1.h +19 -0
- package/vendor/7zip/CPP/7zip/Crypto/RandGen.cpp +242 -0
- package/vendor/7zip/CPP/7zip/Crypto/RandGen.h +41 -0
- package/vendor/7zip/CPP/7zip/Crypto/Rar20Crypto.cpp +130 -0
- package/vendor/7zip/CPP/7zip/Crypto/Rar20Crypto.h +54 -0
- package/vendor/7zip/CPP/7zip/Crypto/Rar5Aes.cpp +273 -0
- package/vendor/7zip/CPP/7zip/Crypto/Rar5Aes.h +97 -0
- package/vendor/7zip/CPP/7zip/Crypto/RarAes.cpp +202 -0
- package/vendor/7zip/CPP/7zip/Crypto/RarAes.h +54 -0
- package/vendor/7zip/CPP/7zip/Crypto/Sha1Cls.h +37 -0
- package/vendor/7zip/CPP/7zip/Crypto/StdAfx.h +11 -0
- package/vendor/7zip/CPP/7zip/Crypto/WzAes.cpp +231 -0
- package/vendor/7zip/CPP/7zip/Crypto/WzAes.h +161 -0
- package/vendor/7zip/CPP/7zip/Crypto/ZipCrypto.cpp +114 -0
- package/vendor/7zip/CPP/7zip/Crypto/ZipCrypto.h +80 -0
- package/vendor/7zip/CPP/7zip/Crypto/ZipStrong.cpp +265 -0
- package/vendor/7zip/CPP/7zip/Crypto/ZipStrong.h +73 -0
- package/vendor/7zip/CPP/7zip/GuiCommon.rc +119 -0
- package/vendor/7zip/CPP/7zip/Guid.txt +243 -0
- package/vendor/7zip/CPP/7zip/ICoder.h +480 -0
- package/vendor/7zip/CPP/7zip/IDecl.h +76 -0
- package/vendor/7zip/CPP/7zip/IPassword.h +54 -0
- package/vendor/7zip/CPP/7zip/IProgress.h +20 -0
- package/vendor/7zip/CPP/7zip/IStream.h +210 -0
- package/vendor/7zip/CPP/7zip/LzFindOpt.mak +7 -0
- package/vendor/7zip/CPP/7zip/LzmaDec.mak +7 -0
- package/vendor/7zip/CPP/7zip/LzmaDec_gcc.mak +14 -0
- package/vendor/7zip/CPP/7zip/MyVersion.h +2 -0
- package/vendor/7zip/CPP/7zip/MyVersionInfo.rc +2 -0
- package/vendor/7zip/CPP/7zip/PropID.h +178 -0
- package/vendor/7zip/CPP/7zip/Sha1.mak +13 -0
- package/vendor/7zip/CPP/7zip/Sha256.mak +13 -0
- package/vendor/7zip/CPP/7zip/Sort.mak +6 -0
- package/vendor/7zip/CPP/7zip/SubBuild.mak +3 -0
- package/vendor/7zip/CPP/7zip/UI/Agent/Agent.cpp +2003 -0
- package/vendor/7zip/CPP/7zip/UI/Agent/Agent.h +365 -0
- package/vendor/7zip/CPP/7zip/UI/Agent/AgentOut.cpp +776 -0
- package/vendor/7zip/CPP/7zip/UI/Agent/AgentProxy.cpp +1098 -0
- package/vendor/7zip/CPP/7zip/UI/Agent/AgentProxy.h +198 -0
- package/vendor/7zip/CPP/7zip/UI/Agent/ArchiveFolder.cpp +57 -0
- package/vendor/7zip/CPP/7zip/UI/Agent/ArchiveFolderOpen.cpp +243 -0
- package/vendor/7zip/CPP/7zip/UI/Agent/ArchiveFolderOut.cpp +457 -0
- package/vendor/7zip/CPP/7zip/UI/Agent/IFolderArchive.h +123 -0
- package/vendor/7zip/CPP/7zip/UI/Agent/StdAfx.h +11 -0
- package/vendor/7zip/CPP/7zip/UI/Agent/UpdateCallbackAgent.cpp +208 -0
- package/vendor/7zip/CPP/7zip/UI/Agent/UpdateCallbackAgent.h +22 -0
- package/vendor/7zip/CPP/7zip/UI/Client7z/Client7z.cpp +1145 -0
- package/vendor/7zip/CPP/7zip/UI/Client7z/Client7z.dsp +331 -0
- package/vendor/7zip/CPP/7zip/UI/Client7z/Client7z.dsw +29 -0
- package/vendor/7zip/CPP/7zip/UI/Client7z/StdAfx.cpp +3 -0
- package/vendor/7zip/CPP/7zip/UI/Client7z/StdAfx.h +11 -0
- package/vendor/7zip/CPP/7zip/UI/Client7z/makefile +29 -0
- package/vendor/7zip/CPP/7zip/UI/Client7z/makefile.gcc +72 -0
- package/vendor/7zip/CPP/7zip/UI/Client7z/resource.rc +3 -0
- package/vendor/7zip/CPP/7zip/UI/Common/ArchiveCommandLine.cpp +1913 -0
- package/vendor/7zip/CPP/7zip/UI/Common/ArchiveCommandLine.h +170 -0
- package/vendor/7zip/CPP/7zip/UI/Common/ArchiveExtractCallback.cpp +3243 -0
- package/vendor/7zip/CPP/7zip/UI/Common/ArchiveExtractCallback.h +640 -0
- package/vendor/7zip/CPP/7zip/UI/Common/ArchiveName.cpp +176 -0
- package/vendor/7zip/CPP/7zip/UI/Common/ArchiveName.h +16 -0
- package/vendor/7zip/CPP/7zip/UI/Common/ArchiveOpenCallback.cpp +403 -0
- package/vendor/7zip/CPP/7zip/UI/Common/ArchiveOpenCallback.h +182 -0
- package/vendor/7zip/CPP/7zip/UI/Common/Bench.cpp +5036 -0
- package/vendor/7zip/CPP/7zip/UI/Common/Bench.h +121 -0
- package/vendor/7zip/CPP/7zip/UI/Common/CompressCall.cpp +343 -0
- package/vendor/7zip/CPP/7zip/UI/Common/CompressCall.h +28 -0
- package/vendor/7zip/CPP/7zip/UI/Common/CompressCall2.cpp +327 -0
- package/vendor/7zip/CPP/7zip/UI/Common/DefaultName.cpp +37 -0
- package/vendor/7zip/CPP/7zip/UI/Common/DefaultName.h +11 -0
- package/vendor/7zip/CPP/7zip/UI/Common/DirItem.h +407 -0
- package/vendor/7zip/CPP/7zip/UI/Common/EnumDirItems.cpp +1637 -0
- package/vendor/7zip/CPP/7zip/UI/Common/EnumDirItems.h +38 -0
- package/vendor/7zip/CPP/7zip/UI/Common/ExitCode.h +27 -0
- package/vendor/7zip/CPP/7zip/UI/Common/Extract.cpp +593 -0
- package/vendor/7zip/CPP/7zip/UI/Common/Extract.h +118 -0
- package/vendor/7zip/CPP/7zip/UI/Common/ExtractMode.h +44 -0
- package/vendor/7zip/CPP/7zip/UI/Common/ExtractingFilePath.cpp +299 -0
- package/vendor/7zip/CPP/7zip/UI/Common/ExtractingFilePath.h +31 -0
- package/vendor/7zip/CPP/7zip/UI/Common/HashCalc.cpp +2273 -0
- package/vendor/7zip/CPP/7zip/UI/Common/HashCalc.h +322 -0
- package/vendor/7zip/CPP/7zip/UI/Common/IFileExtractCallback.h +112 -0
- package/vendor/7zip/CPP/7zip/UI/Common/LoadCodecs.cpp +1354 -0
- package/vendor/7zip/CPP/7zip/UI/Common/LoadCodecs.h +482 -0
- package/vendor/7zip/CPP/7zip/UI/Common/OpenArchive.cpp +3690 -0
- package/vendor/7zip/CPP/7zip/UI/Common/OpenArchive.h +469 -0
- package/vendor/7zip/CPP/7zip/UI/Common/PropIDUtils.cpp +746 -0
- package/vendor/7zip/CPP/7zip/UI/Common/PropIDUtils.h +18 -0
- package/vendor/7zip/CPP/7zip/UI/Common/Property.h +14 -0
- package/vendor/7zip/CPP/7zip/UI/Common/SetProperties.cpp +88 -0
- package/vendor/7zip/CPP/7zip/UI/Common/SetProperties.h +10 -0
- package/vendor/7zip/CPP/7zip/UI/Common/SortUtils.cpp +25 -0
- package/vendor/7zip/CPP/7zip/UI/Common/SortUtils.h +10 -0
- package/vendor/7zip/CPP/7zip/UI/Common/StdAfx.h +11 -0
- package/vendor/7zip/CPP/7zip/UI/Common/TempFiles.cpp +20 -0
- package/vendor/7zip/CPP/7zip/UI/Common/TempFiles.h +19 -0
- package/vendor/7zip/CPP/7zip/UI/Common/Update.cpp +1931 -0
- package/vendor/7zip/CPP/7zip/UI/Common/Update.h +221 -0
- package/vendor/7zip/CPP/7zip/UI/Common/UpdateAction.cpp +64 -0
- package/vendor/7zip/CPP/7zip/UI/Common/UpdateAction.h +66 -0
- package/vendor/7zip/CPP/7zip/UI/Common/UpdateCallback.cpp +1078 -0
- package/vendor/7zip/CPP/7zip/UI/Common/UpdateCallback.h +197 -0
- package/vendor/7zip/CPP/7zip/UI/Common/UpdatePair.cpp +303 -0
- package/vendor/7zip/CPP/7zip/UI/Common/UpdatePair.h +27 -0
- package/vendor/7zip/CPP/7zip/UI/Common/UpdateProduce.cpp +75 -0
- package/vendor/7zip/CPP/7zip/UI/Common/UpdateProduce.h +60 -0
- package/vendor/7zip/CPP/7zip/UI/Common/WorkDir.cpp +84 -0
- package/vendor/7zip/CPP/7zip/UI/Common/WorkDir.h +30 -0
- package/vendor/7zip/CPP/7zip/UI/Common/ZipRegistry.cpp +599 -0
- package/vendor/7zip/CPP/7zip/UI/Common/ZipRegistry.h +212 -0
- package/vendor/7zip/CPP/7zip/UI/Console/BenchCon.cpp +41 -0
- package/vendor/7zip/CPP/7zip/UI/Console/BenchCon.h +14 -0
- package/vendor/7zip/CPP/7zip/UI/Console/Console.dsp +1052 -0
- package/vendor/7zip/CPP/7zip/UI/Console/Console.dsw +29 -0
- package/vendor/7zip/CPP/7zip/UI/Console/Console.mak +45 -0
- package/vendor/7zip/CPP/7zip/UI/Console/Console.manifest +16 -0
- package/vendor/7zip/CPP/7zip/UI/Console/ConsoleClose.cpp +98 -0
- package/vendor/7zip/CPP/7zip/UI/Console/ConsoleClose.h +39 -0
- package/vendor/7zip/CPP/7zip/UI/Console/ExtractCallbackConsole.cpp +954 -0
- package/vendor/7zip/CPP/7zip/UI/Console/ExtractCallbackConsole.h +211 -0
- package/vendor/7zip/CPP/7zip/UI/Console/HashCon.cpp +426 -0
- package/vendor/7zip/CPP/7zip/UI/Console/HashCon.h +58 -0
- package/vendor/7zip/CPP/7zip/UI/Console/List.cpp +1417 -0
- package/vendor/7zip/CPP/7zip/UI/Console/List.h +42 -0
- package/vendor/7zip/CPP/7zip/UI/Console/Main.cpp +1663 -0
- package/vendor/7zip/CPP/7zip/UI/Console/MainAr.cpp +235 -0
- package/vendor/7zip/CPP/7zip/UI/Console/OpenCallbackConsole.cpp +115 -0
- package/vendor/7zip/CPP/7zip/UI/Console/OpenCallbackConsole.h +73 -0
- package/vendor/7zip/CPP/7zip/UI/Console/PercentPrinter.cpp +186 -0
- package/vendor/7zip/CPP/7zip/UI/Console/PercentPrinter.h +66 -0
- package/vendor/7zip/CPP/7zip/UI/Console/StdAfx.cpp +3 -0
- package/vendor/7zip/CPP/7zip/UI/Console/StdAfx.h +11 -0
- package/vendor/7zip/CPP/7zip/UI/Console/UpdateCallbackConsole.cpp +1012 -0
- package/vendor/7zip/CPP/7zip/UI/Console/UpdateCallbackConsole.h +148 -0
- package/vendor/7zip/CPP/7zip/UI/Console/UserInputUtils.cpp +118 -0
- package/vendor/7zip/CPP/7zip/UI/Console/UserInputUtils.h +27 -0
- package/vendor/7zip/CPP/7zip/UI/Console/makefile +68 -0
- package/vendor/7zip/CPP/7zip/UI/Console/makefile.gcc +184 -0
- package/vendor/7zip/CPP/7zip/UI/Console/resource.rc +7 -0
- package/vendor/7zip/CPP/7zip/UI/Explorer/7-zip.dll.manifest +1 -0
- package/vendor/7zip/CPP/7zip/UI/Explorer/ContextMenu.cpp +1837 -0
- package/vendor/7zip/CPP/7zip/UI/Explorer/ContextMenu.h +173 -0
- package/vendor/7zip/CPP/7zip/UI/Explorer/ContextMenuFlags.h +27 -0
- package/vendor/7zip/CPP/7zip/UI/Explorer/DllExportsExplorer.cpp +268 -0
- package/vendor/7zip/CPP/7zip/UI/Explorer/Explorer.def +9 -0
- package/vendor/7zip/CPP/7zip/UI/Explorer/Explorer.dsp +620 -0
- package/vendor/7zip/CPP/7zip/UI/Explorer/Explorer.dsw +29 -0
- package/vendor/7zip/CPP/7zip/UI/Explorer/MenuLogo.bmp +0 -0
- package/vendor/7zip/CPP/7zip/UI/Explorer/MyExplorerCommand.h +217 -0
- package/vendor/7zip/CPP/7zip/UI/Explorer/MyMessages.cpp +43 -0
- package/vendor/7zip/CPP/7zip/UI/Explorer/MyMessages.h +16 -0
- package/vendor/7zip/CPP/7zip/UI/Explorer/RegistryContextMenu.cpp +225 -0
- package/vendor/7zip/CPP/7zip/UI/Explorer/RegistryContextMenu.h +13 -0
- package/vendor/7zip/CPP/7zip/UI/Explorer/StdAfx.cpp +3 -0
- package/vendor/7zip/CPP/7zip/UI/Explorer/StdAfx.h +6 -0
- package/vendor/7zip/CPP/7zip/UI/Explorer/makefile +76 -0
- package/vendor/7zip/CPP/7zip/UI/Explorer/resource.h +15 -0
- package/vendor/7zip/CPP/7zip/UI/Explorer/resource.rc +10 -0
- package/vendor/7zip/CPP/7zip/UI/Explorer/resource2.rc +19 -0
- package/vendor/7zip/CPP/7zip/UI/Far/ExtractEngine.cpp +274 -0
- package/vendor/7zip/CPP/7zip/UI/Far/ExtractEngine.h +43 -0
- package/vendor/7zip/CPP/7zip/UI/Far/Far.cpp +588 -0
- package/vendor/7zip/CPP/7zip/UI/Far/Far.def +35 -0
- package/vendor/7zip/CPP/7zip/UI/Far/Far.dsp +831 -0
- package/vendor/7zip/CPP/7zip/UI/Far/Far.dsw +29 -0
- package/vendor/7zip/CPP/7zip/UI/Far/FarPlugin.h +560 -0
- package/vendor/7zip/CPP/7zip/UI/Far/FarUtils.cpp +523 -0
- package/vendor/7zip/CPP/7zip/UI/Far/FarUtils.h +203 -0
- package/vendor/7zip/CPP/7zip/UI/Far/Messages.h +136 -0
- package/vendor/7zip/CPP/7zip/UI/Far/OverwriteDialogFar.cpp +145 -0
- package/vendor/7zip/CPP/7zip/UI/Far/OverwriteDialogFar.h +37 -0
- package/vendor/7zip/CPP/7zip/UI/Far/Plugin.cpp +937 -0
- package/vendor/7zip/CPP/7zip/UI/Far/Plugin.h +97 -0
- package/vendor/7zip/CPP/7zip/UI/Far/PluginCommon.cpp +50 -0
- package/vendor/7zip/CPP/7zip/UI/Far/PluginDelete.cpp +144 -0
- package/vendor/7zip/CPP/7zip/UI/Far/PluginRead.cpp +301 -0
- package/vendor/7zip/CPP/7zip/UI/Far/PluginWrite.cpp +840 -0
- package/vendor/7zip/CPP/7zip/UI/Far/ProgressBox.cpp +305 -0
- package/vendor/7zip/CPP/7zip/UI/Far/ProgressBox.h +85 -0
- package/vendor/7zip/CPP/7zip/UI/Far/StdAfx.cpp +3 -0
- package/vendor/7zip/CPP/7zip/UI/Far/StdAfx.h +11 -0
- package/vendor/7zip/CPP/7zip/UI/Far/UpdateCallbackFar.cpp +327 -0
- package/vendor/7zip/CPP/7zip/UI/Far/UpdateCallbackFar.h +58 -0
- package/vendor/7zip/CPP/7zip/UI/Far/makefile +105 -0
- package/vendor/7zip/CPP/7zip/UI/Far/resource.rc +3 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/7zFM.exe.manifest +23 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/7zipLogo.ico +0 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/AboutDialog.cpp +81 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/AboutDialog.h +19 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/AboutDialog.rc +26 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/AboutDialogRes.h +8 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/Add.bmp +0 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/Add2.bmp +0 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/AltStreamsFolder.cpp +865 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/AltStreamsFolder.h +92 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/App.cpp +1004 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/App.h +314 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/AppState.h +95 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/BrowseDialog.cpp +1132 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/BrowseDialog.h +32 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/BrowseDialog.rc +25 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/BrowseDialog2.cpp +1873 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/BrowseDialog2.h +10 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/BrowseDialog2.rc +32 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/BrowseDialog2Res.h +9 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/BrowseDialogRes.h +9 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/ClassDefs.cpp +12 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/ComboDialog.cpp +64 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/ComboDialog.h +28 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/ComboDialog.rc +16 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/ComboDialogRes.h +4 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/Copy.bmp +0 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/Copy2.bmp +0 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/CopyDialog.cpp +103 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/CopyDialog.h +31 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/CopyDialog.rc +20 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/CopyDialogRes.h +8 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/Delete.bmp +0 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/Delete2.bmp +0 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/DialogSize.h +16 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/EditDialog.cpp +57 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/EditDialog.h +25 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/EditDialog.rc +15 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/EditDialogRes.h +2 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/EditPage.cpp +159 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/EditPage.h +30 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/EditPage.rc +19 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/EditPage2.rc +14 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/EditPageRes.h +15 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/EnumFormatEtc.cpp +109 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/EnumFormatEtc.h +10 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/Extract.bmp +0 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/Extract2.bmp +0 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/ExtractCallback.cpp +1284 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/ExtractCallback.h +347 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/FM.cpp +1230 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/FM.dsp +1699 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/FM.dsw +29 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/FM.ico +0 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/FM.mak +102 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/FSDrives.cpp +512 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/FSDrives.h +52 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/FSFolder.cpp +1179 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/FSFolder.h +220 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/FSFolderCopy.cpp +871 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/FileFolderPluginOpen.cpp +394 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/FileFolderPluginOpen.h +27 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/FilePlugins.cpp +78 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/FilePlugins.h +33 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/FoldersPage.cpp +172 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/FoldersPage.h +32 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/FoldersPage.rc +23 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/FoldersPage2.rc +11 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/FoldersPageRes.h +12 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/FormatUtils.cpp +28 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/FormatUtils.h +14 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/HelpUtils.cpp +78 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/HelpUtils.h +10 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/IFolder.h +187 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/Info.bmp +0 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/Info2.bmp +0 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/LangPage.cpp +359 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/LangPage.h +36 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/LangPage.rc +40 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/LangPageRes.h +9 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/LangUtils.cpp +333 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/LangUtils.h +48 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/LinkDialog.cpp +402 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/LinkDialog.h +34 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/LinkDialog.rc +38 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/LinkDialogRes.h +22 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/ListViewDialog.cpp +321 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/ListViewDialog.h +46 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/ListViewDialog.rc +14 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/ListViewDialogRes.h +2 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/MemDialog.cpp +218 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/MemDialog.h +48 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/MemDialog.rc +49 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/MemDialogRes.h +13 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/MenuPage.cpp +439 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/MenuPage.h +57 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/MenuPage.rc +24 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/MenuPage2.rc +28 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/MenuPageRes.h +15 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/MessagesDialog.cpp +76 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/MessagesDialog.h +25 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/MessagesDialog.rc +14 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/MessagesDialogRes.h +3 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/Move.bmp +0 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/Move2.bmp +0 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/MyCom2.h +46 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/MyLoadMenu.cpp +964 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/MyLoadMenu.h +40 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/MyWindowsNew.h +119 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/NetFolder.cpp +276 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/NetFolder.h +36 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/OpenCallback.cpp +86 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/OpenCallback.h +69 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/OptionsDialog.cpp +89 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/OverwriteDialog.cpp +288 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/OverwriteDialog.h +89 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/OverwriteDialog.rc +93 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/OverwriteDialogRes.h +19 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/Panel.cpp +1177 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/Panel.h +1020 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/PanelCopy.cpp +477 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/PanelCrc.cpp +422 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/PanelDrag.cpp +3006 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/PanelFolderChange.cpp +1122 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/PanelItemOpen.cpp +1836 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/PanelItems.cpp +1476 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/PanelKey.cpp +357 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/PanelListNotify.cpp +838 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/PanelMenu.cpp +1160 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/PanelOperations.cpp +533 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/PanelSelect.cpp +317 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/PanelSort.cpp +288 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/PanelSplitFile.cpp +562 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/PasswordDialog.cpp +58 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/PasswordDialog.h +28 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/PasswordDialog.rc +18 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/PasswordDialogRes.h +5 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/PluginInterface.h +32 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/PluginLoader.h +33 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/ProgramLocation.cpp +3 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/ProgramLocation.h +6 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/ProgressDialog.cpp +201 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/ProgressDialog.h +171 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/ProgressDialog.rc +12 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/ProgressDialog2.cpp +1484 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/ProgressDialog2.h +355 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/ProgressDialog2.rc +40 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/ProgressDialog2Res.h +49 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/ProgressDialog2a.rc +85 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/ProgressDialogRes.h +3 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/PropertyName.cpp +23 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/PropertyName.h +10 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/PropertyName.rc +109 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/PropertyNameRes.h +104 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/RegistryAssociations.cpp +167 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/RegistryAssociations.h +31 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/RegistryPlugins.cpp +145 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/RegistryPlugins.h +29 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/RegistryUtils.cpp +194 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/RegistryUtils.h +50 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/RootFolder.cpp +342 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/RootFolder.h +24 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/SettingsPage.cpp +453 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/SettingsPage.h +37 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/SettingsPage.rc +22 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/SettingsPage2.rc +37 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/SettingsPageRes.h +23 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/SplitDialog.cpp +114 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/SplitDialog.h +28 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/SplitDialog.rc +16 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/SplitDialogRes.h +8 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/SplitUtils.cpp +96 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/SplitUtils.h +15 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/StdAfx.cpp +3 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/StdAfx.h +67 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/StringUtils.cpp +39 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/StringUtils.h +11 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/SysIconUtils.cpp +352 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/SysIconUtils.h +65 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/SystemPage.cpp +472 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/SystemPage.h +126 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/SystemPage.rc +43 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/SystemPageRes.h +9 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/Test.bmp +0 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/Test2.bmp +0 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/TextPairs.cpp +193 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/TextPairs.h +32 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/UpdateCallback100.cpp +147 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/UpdateCallback100.h +49 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/VerCtrl.cpp +428 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/ViewSettings.cpp +315 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/ViewSettings.h +115 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/makefile +110 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/resource.h +199 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/resource.rc +296 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/resourceGui.h +25 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/resourceGui.rc +30 -0
- package/vendor/7zip/CPP/7zip/UI/GUI/7zG.exe.manifest +23 -0
- package/vendor/7zip/CPP/7zip/UI/GUI/BenchmarkDialog.cpp +1921 -0
- package/vendor/7zip/CPP/7zip/UI/GUI/BenchmarkDialog.h +15 -0
- package/vendor/7zip/CPP/7zip/UI/GUI/BenchmarkDialog.rc +288 -0
- package/vendor/7zip/CPP/7zip/UI/GUI/BenchmarkDialogRes.h +79 -0
- package/vendor/7zip/CPP/7zip/UI/GUI/CompressDialog.cpp +3821 -0
- package/vendor/7zip/CPP/7zip/UI/GUI/CompressDialog.h +483 -0
- package/vendor/7zip/CPP/7zip/UI/GUI/CompressDialog.rc +233 -0
- package/vendor/7zip/CPP/7zip/UI/GUI/CompressDialogRes.h +125 -0
- package/vendor/7zip/CPP/7zip/UI/GUI/CompressOptionsDialog.rc +79 -0
- package/vendor/7zip/CPP/7zip/UI/GUI/Extract.rc +59 -0
- package/vendor/7zip/CPP/7zip/UI/GUI/ExtractDialog.cpp +420 -0
- package/vendor/7zip/CPP/7zip/UI/GUI/ExtractDialog.h +113 -0
- package/vendor/7zip/CPP/7zip/UI/GUI/ExtractDialog.rc +98 -0
- package/vendor/7zip/CPP/7zip/UI/GUI/ExtractDialogRes.h +24 -0
- package/vendor/7zip/CPP/7zip/UI/GUI/ExtractGUI.cpp +297 -0
- package/vendor/7zip/CPP/7zip/UI/GUI/ExtractGUI.h +39 -0
- package/vendor/7zip/CPP/7zip/UI/GUI/ExtractRes.h +51 -0
- package/vendor/7zip/CPP/7zip/UI/GUI/FM.ico +0 -0
- package/vendor/7zip/CPP/7zip/UI/GUI/GUI.cpp +502 -0
- package/vendor/7zip/CPP/7zip/UI/GUI/GUI.dsp +1275 -0
- package/vendor/7zip/CPP/7zip/UI/GUI/GUI.dsw +29 -0
- package/vendor/7zip/CPP/7zip/UI/GUI/HashGUI.cpp +341 -0
- package/vendor/7zip/CPP/7zip/UI/GUI/HashGUI.h +27 -0
- package/vendor/7zip/CPP/7zip/UI/GUI/StdAfx.cpp +3 -0
- package/vendor/7zip/CPP/7zip/UI/GUI/StdAfx.h +6 -0
- package/vendor/7zip/CPP/7zip/UI/GUI/UpdateCallbackGUI.cpp +295 -0
- package/vendor/7zip/CPP/7zip/UI/GUI/UpdateCallbackGUI.h +31 -0
- package/vendor/7zip/CPP/7zip/UI/GUI/UpdateCallbackGUI2.cpp +130 -0
- package/vendor/7zip/CPP/7zip/UI/GUI/UpdateCallbackGUI2.h +53 -0
- package/vendor/7zip/CPP/7zip/UI/GUI/UpdateGUI.cpp +605 -0
- package/vendor/7zip/CPP/7zip/UI/GUI/UpdateGUI.h +33 -0
- package/vendor/7zip/CPP/7zip/UI/GUI/makefile +148 -0
- package/vendor/7zip/CPP/7zip/UI/GUI/resource.rc +26 -0
- package/vendor/7zip/CPP/7zip/UI/GUI/resource2.h +2 -0
- package/vendor/7zip/CPP/7zip/UI/GUI/resource2.rc +10 -0
- package/vendor/7zip/CPP/7zip/UI/GUI/resource3.h +10 -0
- package/vendor/7zip/CPP/7zip/UI/GUI/resource3.rc +15 -0
- package/vendor/7zip/CPP/7zip/UI/makefile +12 -0
- package/vendor/7zip/CPP/7zip/cmpl_clang.mak +3 -0
- package/vendor/7zip/CPP/7zip/cmpl_clang_arm64.mak +3 -0
- package/vendor/7zip/CPP/7zip/cmpl_clang_x64.mak +3 -0
- package/vendor/7zip/CPP/7zip/cmpl_clang_x86.mak +3 -0
- package/vendor/7zip/CPP/7zip/cmpl_gcc.mak +3 -0
- package/vendor/7zip/CPP/7zip/cmpl_gcc_arm.mak +3 -0
- package/vendor/7zip/CPP/7zip/cmpl_gcc_arm64.mak +3 -0
- package/vendor/7zip/CPP/7zip/cmpl_gcc_x64.mak +3 -0
- package/vendor/7zip/CPP/7zip/cmpl_gcc_x86.mak +3 -0
- package/vendor/7zip/CPP/7zip/cmpl_mac_arm64.mak +3 -0
- package/vendor/7zip/CPP/7zip/cmpl_mac_x64.mak +3 -0
- package/vendor/7zip/CPP/7zip/makefile +10 -0
- package/vendor/7zip/CPP/7zip/var_clang.mak +11 -0
- package/vendor/7zip/CPP/7zip/var_clang_arm64.mak +19 -0
- package/vendor/7zip/CPP/7zip/var_clang_x64.mak +11 -0
- package/vendor/7zip/CPP/7zip/var_clang_x86.mak +11 -0
- package/vendor/7zip/CPP/7zip/var_gcc.mak +12 -0
- package/vendor/7zip/CPP/7zip/var_gcc_arm.mak +34 -0
- package/vendor/7zip/CPP/7zip/var_gcc_arm64.mak +12 -0
- package/vendor/7zip/CPP/7zip/var_gcc_x64.mak +11 -0
- package/vendor/7zip/CPP/7zip/var_gcc_x86.mak +10 -0
- package/vendor/7zip/CPP/7zip/var_mac_arm64.mak +13 -0
- package/vendor/7zip/CPP/7zip/var_mac_x64.mak +13 -0
- package/vendor/7zip/CPP/7zip/warn_clang.mak +3 -0
- package/vendor/7zip/CPP/7zip/warn_clang_mac.mak +9 -0
- package/vendor/7zip/CPP/7zip/warn_gcc.mak +55 -0
- package/vendor/7zip/CPP/Build.mak +259 -0
- package/vendor/7zip/CPP/Common/AutoPtr.h +46 -0
- package/vendor/7zip/CPP/Common/CRC.cpp +7 -0
- package/vendor/7zip/CPP/Common/C_FileIO.cpp +3 -0
- package/vendor/7zip/CPP/Common/C_FileIO.h +6 -0
- package/vendor/7zip/CPP/Common/CksumReg.cpp +55 -0
- package/vendor/7zip/CPP/Common/ComTry.h +21 -0
- package/vendor/7zip/CPP/Common/CommandLineParser.cpp +231 -0
- package/vendor/7zip/CPP/Common/CommandLineParser.h +63 -0
- package/vendor/7zip/CPP/Common/Common.h +28 -0
- package/vendor/7zip/CPP/Common/Common0.h +342 -0
- package/vendor/7zip/CPP/Common/CrcReg.cpp +77 -0
- package/vendor/7zip/CPP/Common/Defs.h +16 -0
- package/vendor/7zip/CPP/Common/DynLimBuf.cpp +93 -0
- package/vendor/7zip/CPP/Common/DynLimBuf.h +41 -0
- package/vendor/7zip/CPP/Common/DynamicBuffer.h +76 -0
- package/vendor/7zip/CPP/Common/IntToString.cpp +215 -0
- package/vendor/7zip/CPP/Common/IntToString.h +54 -0
- package/vendor/7zip/CPP/Common/Lang.cpp +173 -0
- package/vendor/7zip/CPP/Common/Lang.h +30 -0
- package/vendor/7zip/CPP/Common/ListFileUtils.cpp +150 -0
- package/vendor/7zip/CPP/Common/ListFileUtils.h +18 -0
- package/vendor/7zip/CPP/Common/LzFindPrepare.cpp +7 -0
- package/vendor/7zip/CPP/Common/Md5Reg.cpp +44 -0
- package/vendor/7zip/CPP/Common/MyBuffer.h +343 -0
- package/vendor/7zip/CPP/Common/MyBuffer2.h +185 -0
- package/vendor/7zip/CPP/Common/MyCom.h +693 -0
- package/vendor/7zip/CPP/Common/MyException.h +14 -0
- package/vendor/7zip/CPP/Common/MyGuidDef.h +63 -0
- package/vendor/7zip/CPP/Common/MyInitGuid.h +57 -0
- package/vendor/7zip/CPP/Common/MyLinux.h +75 -0
- package/vendor/7zip/CPP/Common/MyMap.cpp +140 -0
- package/vendor/7zip/CPP/Common/MyMap.h +28 -0
- package/vendor/7zip/CPP/Common/MyString.cpp +1842 -0
- package/vendor/7zip/CPP/Common/MyString.h +1079 -0
- package/vendor/7zip/CPP/Common/MyTypes.h +38 -0
- package/vendor/7zip/CPP/Common/MyUnknown.h +8 -0
- package/vendor/7zip/CPP/Common/MyVector.cpp +3 -0
- package/vendor/7zip/CPP/Common/MyVector.h +772 -0
- package/vendor/7zip/CPP/Common/MyWindows.cpp +292 -0
- package/vendor/7zip/CPP/Common/MyWindows.h +325 -0
- package/vendor/7zip/CPP/Common/MyXml.cpp +349 -0
- package/vendor/7zip/CPP/Common/MyXml.h +45 -0
- package/vendor/7zip/CPP/Common/NewHandler.cpp +340 -0
- package/vendor/7zip/CPP/Common/NewHandler.h +121 -0
- package/vendor/7zip/CPP/Common/Random.cpp +28 -0
- package/vendor/7zip/CPP/Common/Random.h +14 -0
- package/vendor/7zip/CPP/Common/Sha1Prepare.cpp +7 -0
- package/vendor/7zip/CPP/Common/Sha1Reg.cpp +67 -0
- package/vendor/7zip/CPP/Common/Sha256Prepare.cpp +7 -0
- package/vendor/7zip/CPP/Common/Sha256Reg.cpp +67 -0
- package/vendor/7zip/CPP/Common/Sha3Reg.cpp +76 -0
- package/vendor/7zip/CPP/Common/Sha512Prepare.cpp +7 -0
- package/vendor/7zip/CPP/Common/Sha512Reg.cpp +83 -0
- package/vendor/7zip/CPP/Common/StdAfx.h +8 -0
- package/vendor/7zip/CPP/Common/StdInStream.cpp +98 -0
- package/vendor/7zip/CPP/Common/StdInStream.h +46 -0
- package/vendor/7zip/CPP/Common/StdOutStream.cpp +271 -0
- package/vendor/7zip/CPP/Common/StdOutStream.h +87 -0
- package/vendor/7zip/CPP/Common/StringConvert.cpp +762 -0
- package/vendor/7zip/CPP/Common/StringConvert.h +110 -0
- package/vendor/7zip/CPP/Common/StringToInt.cpp +154 -0
- package/vendor/7zip/CPP/Common/StringToInt.h +38 -0
- package/vendor/7zip/CPP/Common/TextConfig.cpp +123 -0
- package/vendor/7zip/CPP/Common/TextConfig.h +19 -0
- package/vendor/7zip/CPP/Common/UTFConvert.cpp +863 -0
- package/vendor/7zip/CPP/Common/UTFConvert.h +384 -0
- package/vendor/7zip/CPP/Common/Wildcard.cpp +789 -0
- package/vendor/7zip/CPP/Common/Wildcard.h +231 -0
- package/vendor/7zip/CPP/Common/Xxh64Reg.cpp +97 -0
- package/vendor/7zip/CPP/Common/XzCrc64Init.cpp +7 -0
- package/vendor/7zip/CPP/Common/XzCrc64Reg.cpp +39 -0
- package/vendor/7zip/CPP/Windows/COM.cpp +41 -0
- package/vendor/7zip/CPP/Windows/COM.h +86 -0
- package/vendor/7zip/CPP/Windows/Clipboard.cpp +130 -0
- package/vendor/7zip/CPP/Windows/Clipboard.h +28 -0
- package/vendor/7zip/CPP/Windows/CommonDialog.cpp +269 -0
- package/vendor/7zip/CPP/Windows/CommonDialog.h +43 -0
- package/vendor/7zip/CPP/Windows/Console.cpp +10 -0
- package/vendor/7zip/CPP/Windows/Console.h +52 -0
- package/vendor/7zip/CPP/Windows/Control/ComboBox.cpp +75 -0
- package/vendor/7zip/CPP/Windows/Control/ComboBox.h +79 -0
- package/vendor/7zip/CPP/Windows/Control/CommandBar.h +52 -0
- package/vendor/7zip/CPP/Windows/Control/Dialog.cpp +446 -0
- package/vendor/7zip/CPP/Windows/Control/Dialog.h +213 -0
- package/vendor/7zip/CPP/Windows/Control/Edit.h +19 -0
- package/vendor/7zip/CPP/Windows/Control/ImageList.cpp +10 -0
- package/vendor/7zip/CPP/Windows/Control/ImageList.h +87 -0
- package/vendor/7zip/CPP/Windows/Control/ListView.cpp +162 -0
- package/vendor/7zip/CPP/Windows/Control/ListView.h +156 -0
- package/vendor/7zip/CPP/Windows/Control/ProgressBar.h +35 -0
- package/vendor/7zip/CPP/Windows/Control/PropertyPage.cpp +165 -0
- package/vendor/7zip/CPP/Windows/Control/PropertyPage.h +50 -0
- package/vendor/7zip/CPP/Windows/Control/ReBar.h +34 -0
- package/vendor/7zip/CPP/Windows/Control/Static.h +28 -0
- package/vendor/7zip/CPP/Windows/Control/StatusBar.h +42 -0
- package/vendor/7zip/CPP/Windows/Control/StdAfx.h +11 -0
- package/vendor/7zip/CPP/Windows/Control/ToolBar.h +43 -0
- package/vendor/7zip/CPP/Windows/Control/Trackbar.h +27 -0
- package/vendor/7zip/CPP/Windows/Control/Window2.cpp +202 -0
- package/vendor/7zip/CPP/Windows/Control/Window2.h +53 -0
- package/vendor/7zip/CPP/Windows/DLL.cpp +178 -0
- package/vendor/7zip/CPP/Windows/DLL.h +103 -0
- package/vendor/7zip/CPP/Windows/ErrorMsg.cpp +133 -0
- package/vendor/7zip/CPP/Windows/ErrorMsg.h +16 -0
- package/vendor/7zip/CPP/Windows/FileDir.cpp +1388 -0
- package/vendor/7zip/CPP/Windows/FileDir.h +173 -0
- package/vendor/7zip/CPP/Windows/FileFind.cpp +1458 -0
- package/vendor/7zip/CPP/Windows/FileFind.h +345 -0
- package/vendor/7zip/CPP/Windows/FileIO.cpp +1188 -0
- package/vendor/7zip/CPP/Windows/FileIO.h +508 -0
- package/vendor/7zip/CPP/Windows/FileLink.cpp +697 -0
- package/vendor/7zip/CPP/Windows/FileMapping.cpp +12 -0
- package/vendor/7zip/CPP/Windows/FileMapping.h +66 -0
- package/vendor/7zip/CPP/Windows/FileName.cpp +911 -0
- package/vendor/7zip/CPP/Windows/FileName.h +142 -0
- package/vendor/7zip/CPP/Windows/FileSystem.cpp +187 -0
- package/vendor/7zip/CPP/Windows/FileSystem.h +31 -0
- package/vendor/7zip/CPP/Windows/Handle.h +39 -0
- package/vendor/7zip/CPP/Windows/MemoryGlobal.cpp +36 -0
- package/vendor/7zip/CPP/Windows/MemoryGlobal.h +55 -0
- package/vendor/7zip/CPP/Windows/MemoryLock.cpp +127 -0
- package/vendor/7zip/CPP/Windows/MemoryLock.h +40 -0
- package/vendor/7zip/CPP/Windows/Menu.cpp +265 -0
- package/vendor/7zip/CPP/Windows/Menu.h +170 -0
- package/vendor/7zip/CPP/Windows/NationalTime.cpp +37 -0
- package/vendor/7zip/CPP/Windows/NationalTime.h +20 -0
- package/vendor/7zip/CPP/Windows/Net.cpp +398 -0
- package/vendor/7zip/CPP/Windows/Net.h +87 -0
- package/vendor/7zip/CPP/Windows/NtCheck.h +58 -0
- package/vendor/7zip/CPP/Windows/ProcessMessages.cpp +22 -0
- package/vendor/7zip/CPP/Windows/ProcessMessages.h +12 -0
- package/vendor/7zip/CPP/Windows/ProcessUtils.cpp +102 -0
- package/vendor/7zip/CPP/Windows/ProcessUtils.h +138 -0
- package/vendor/7zip/CPP/Windows/PropVariant.cpp +393 -0
- package/vendor/7zip/CPP/Windows/PropVariant.h +173 -0
- package/vendor/7zip/CPP/Windows/PropVariantConv.cpp +274 -0
- package/vendor/7zip/CPP/Windows/PropVariantConv.h +47 -0
- package/vendor/7zip/CPP/Windows/PropVariantUtils.cpp +161 -0
- package/vendor/7zip/CPP/Windows/PropVariantUtils.h +34 -0
- package/vendor/7zip/CPP/Windows/Registry.cpp +474 -0
- package/vendor/7zip/CPP/Windows/Registry.h +96 -0
- package/vendor/7zip/CPP/Windows/ResourceString.cpp +103 -0
- package/vendor/7zip/CPP/Windows/ResourceString.h +17 -0
- package/vendor/7zip/CPP/Windows/SecurityUtils.cpp +186 -0
- package/vendor/7zip/CPP/Windows/SecurityUtils.h +154 -0
- package/vendor/7zip/CPP/Windows/Shell.cpp +839 -0
- package/vendor/7zip/CPP/Windows/Shell.h +129 -0
- package/vendor/7zip/CPP/Windows/StdAfx.h +11 -0
- package/vendor/7zip/CPP/Windows/Synchronization.cpp +87 -0
- package/vendor/7zip/CPP/Windows/Synchronization.h +386 -0
- package/vendor/7zip/CPP/Windows/System.cpp +423 -0
- package/vendor/7zip/CPP/Windows/System.h +209 -0
- package/vendor/7zip/CPP/Windows/SystemInfo.cpp +1312 -0
- package/vendor/7zip/CPP/Windows/SystemInfo.h +19 -0
- package/vendor/7zip/CPP/Windows/Thread.h +46 -0
- package/vendor/7zip/CPP/Windows/TimeUtils.cpp +467 -0
- package/vendor/7zip/CPP/Windows/TimeUtils.h +154 -0
- package/vendor/7zip/CPP/Windows/WinDefs.h +17 -0
- package/vendor/7zip/CPP/Windows/Window.cpp +179 -0
- package/vendor/7zip/CPP/Windows/Window.h +363 -0
- package/vendor/7zip/DOC/7zC.txt +187 -0
- package/vendor/7zip/DOC/7zFormat.txt +469 -0
- package/vendor/7zip/DOC/7zip.hhp +84 -0
- package/vendor/7zip/DOC/7zip.wxs +403 -0
- package/vendor/7zip/DOC/License.txt +151 -0
- package/vendor/7zip/DOC/Methods.txt +177 -0
- package/vendor/7zip/DOC/copying.txt +502 -0
- package/vendor/7zip/DOC/lzma.txt +345 -0
- package/vendor/7zip/DOC/readme.txt +299 -0
- package/vendor/7zip/DOC/src-history.txt +884 -0
- package/vendor/7zip/DOC/unRarLicense.txt +41 -0
- package/vendor/7zip/README.md +2 -0
|
@@ -0,0 +1,3483 @@
|
|
|
1
|
+
// Rar5Handler.cpp
|
|
2
|
+
|
|
3
|
+
#include "StdAfx.h"
|
|
4
|
+
|
|
5
|
+
#include "../../../../C/7zCrc.h"
|
|
6
|
+
#include "../../../../C/CpuArch.h"
|
|
7
|
+
|
|
8
|
+
#include "../../../Common/ComTry.h"
|
|
9
|
+
#include "../../../Common/IntToString.h"
|
|
10
|
+
#include "../../../Common/MyBuffer2.h"
|
|
11
|
+
#include "../../../Common/MyLinux.h"
|
|
12
|
+
#include "../../../Common/UTFConvert.h"
|
|
13
|
+
|
|
14
|
+
#include "../../../Windows/PropVariantUtils.h"
|
|
15
|
+
#include "../../../Windows/TimeUtils.h"
|
|
16
|
+
|
|
17
|
+
#include "../../IPassword.h"
|
|
18
|
+
|
|
19
|
+
#include "../../Common/FilterCoder.h"
|
|
20
|
+
#include "../../Common/LimitedStreams.h"
|
|
21
|
+
#include "../../Common/MethodProps.h"
|
|
22
|
+
#include "../../Common/ProgressUtils.h"
|
|
23
|
+
#include "../../Common/RegisterArc.h"
|
|
24
|
+
#include "../../Common/StreamObjects.h"
|
|
25
|
+
#include "../../Common/StreamUtils.h"
|
|
26
|
+
|
|
27
|
+
#include "../../Common/RegisterCodec.h"
|
|
28
|
+
|
|
29
|
+
#include "../../Compress/CopyCoder.h"
|
|
30
|
+
|
|
31
|
+
#include "../../Crypto/Rar5Aes.h"
|
|
32
|
+
|
|
33
|
+
#include "../../Archive/Common/FindSignature.h"
|
|
34
|
+
#include "../../Archive/Common/ItemNameUtils.h"
|
|
35
|
+
#include "../../Archive/Common/HandlerOut.h"
|
|
36
|
+
|
|
37
|
+
#include "../../Archive/HandlerCont.h"
|
|
38
|
+
|
|
39
|
+
#include "../../Archive/Rar/RarVol.h"
|
|
40
|
+
#include "Rar5Handler.h"
|
|
41
|
+
|
|
42
|
+
using namespace NWindows;
|
|
43
|
+
|
|
44
|
+
#define Get32(p) GetUi32(p)
|
|
45
|
+
|
|
46
|
+
namespace NArchive {
|
|
47
|
+
namespace NRar5 {
|
|
48
|
+
|
|
49
|
+
static const unsigned kMarkerSize = 8;
|
|
50
|
+
|
|
51
|
+
static const Byte kMarker[kMarkerSize] =
|
|
52
|
+
{ 0x52, 0x61, 0x72, 0x21, 0x1a, 0x07, 0x01, 0 };
|
|
53
|
+
|
|
54
|
+
// Comment length is limited to 256 KB in rar-encoder.
|
|
55
|
+
// So we use same limitation
|
|
56
|
+
static const size_t kCommentSize_Max = (size_t)1 << 18;
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
static const char * const kHostOS[] =
|
|
60
|
+
{
|
|
61
|
+
"Windows"
|
|
62
|
+
, "Unix"
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
static const char * const k_ArcFlags[] =
|
|
67
|
+
{
|
|
68
|
+
"Volume"
|
|
69
|
+
, "VolumeField"
|
|
70
|
+
, "Solid"
|
|
71
|
+
, "Recovery"
|
|
72
|
+
, "Lock" // 4
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
static const char * const k_FileFlags[] =
|
|
77
|
+
{
|
|
78
|
+
"Dir"
|
|
79
|
+
, "UnixTime"
|
|
80
|
+
, "CRC"
|
|
81
|
+
, "UnknownSize"
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
static const char * const g_ExtraTypes[] =
|
|
86
|
+
{
|
|
87
|
+
"0"
|
|
88
|
+
, "Crypto"
|
|
89
|
+
, "Hash"
|
|
90
|
+
, "Time"
|
|
91
|
+
, "Version"
|
|
92
|
+
, "Link"
|
|
93
|
+
, "UnixOwner"
|
|
94
|
+
, "Subdata"
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
static const char * const g_LinkTypes[] =
|
|
99
|
+
{
|
|
100
|
+
"0"
|
|
101
|
+
, "UnixSymLink"
|
|
102
|
+
, "WinSymLink"
|
|
103
|
+
, "WinJunction"
|
|
104
|
+
, "HardLink"
|
|
105
|
+
, "FileCopy"
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
static const char g_ExtraTimeFlags[] = { 'u', 'M', 'C', 'A', 'n' };
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
static
|
|
113
|
+
Z7_NO_INLINE
|
|
114
|
+
unsigned ReadVarInt(const Byte *p, size_t maxSize, UInt64 *val_ptr)
|
|
115
|
+
{
|
|
116
|
+
if (maxSize > 10)
|
|
117
|
+
maxSize = 10;
|
|
118
|
+
UInt64 val = 0;
|
|
119
|
+
unsigned i;
|
|
120
|
+
for (i = 0; i < maxSize;)
|
|
121
|
+
{
|
|
122
|
+
const unsigned b = p[i];
|
|
123
|
+
val |= (UInt64)(b & 0x7F) << (7 * i);
|
|
124
|
+
i++;
|
|
125
|
+
if ((b & 0x80) == 0)
|
|
126
|
+
{
|
|
127
|
+
*val_ptr = val;
|
|
128
|
+
return i;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
*val_ptr = 0;
|
|
132
|
+
#if 1
|
|
133
|
+
return 0; // 7zip-unrar : strict check of error
|
|
134
|
+
#else
|
|
135
|
+
return i; // original-unrar : ignore error
|
|
136
|
+
#endif
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
#define PARSE_VAR_INT(p, size, dest) \
|
|
141
|
+
{ const unsigned num_ = ReadVarInt(p, size, &dest); \
|
|
142
|
+
if (num_ == 0) return false; \
|
|
143
|
+
p += num_; \
|
|
144
|
+
size -= num_; \
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
bool CLinkInfo::Parse(const Byte *p, unsigned size)
|
|
149
|
+
{
|
|
150
|
+
const Byte *pStart = p;
|
|
151
|
+
UInt64 len;
|
|
152
|
+
PARSE_VAR_INT(p, size, Type)
|
|
153
|
+
PARSE_VAR_INT(p, size, Flags)
|
|
154
|
+
PARSE_VAR_INT(p, size, len)
|
|
155
|
+
if (size != len)
|
|
156
|
+
return false;
|
|
157
|
+
NameLen = (unsigned)len;
|
|
158
|
+
NameOffset = (unsigned)(size_t)(p - pStart);
|
|
159
|
+
return true;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
static void AddHex64(AString &s, UInt64 v)
|
|
164
|
+
{
|
|
165
|
+
char sz[32];
|
|
166
|
+
sz[0] = '0';
|
|
167
|
+
sz[1] = 'x';
|
|
168
|
+
ConvertUInt64ToHex(v, sz + 2);
|
|
169
|
+
s += sz;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
static void PrintType(AString &s, const char * const table[], unsigned num, UInt64 val)
|
|
174
|
+
{
|
|
175
|
+
char sz[32];
|
|
176
|
+
const char *p = NULL;
|
|
177
|
+
if (val < num)
|
|
178
|
+
p = table[(unsigned)val];
|
|
179
|
+
if (!p)
|
|
180
|
+
{
|
|
181
|
+
ConvertUInt64ToString(val, sz);
|
|
182
|
+
p = sz;
|
|
183
|
+
}
|
|
184
|
+
s += p;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
int CItem::FindExtra(unsigned extraID, unsigned &recordDataSize) const
|
|
189
|
+
{
|
|
190
|
+
recordDataSize = 0;
|
|
191
|
+
size_t offset = 0;
|
|
192
|
+
|
|
193
|
+
for (;;)
|
|
194
|
+
{
|
|
195
|
+
size_t rem = Extra.Size() - offset;
|
|
196
|
+
if (rem == 0)
|
|
197
|
+
return -1;
|
|
198
|
+
|
|
199
|
+
{
|
|
200
|
+
UInt64 size;
|
|
201
|
+
const unsigned num = ReadVarInt(Extra + offset, rem, &size);
|
|
202
|
+
if (num == 0)
|
|
203
|
+
return -1;
|
|
204
|
+
offset += num;
|
|
205
|
+
rem -= num;
|
|
206
|
+
if (size > rem)
|
|
207
|
+
return -1;
|
|
208
|
+
rem = (size_t)size;
|
|
209
|
+
}
|
|
210
|
+
{
|
|
211
|
+
UInt64 id;
|
|
212
|
+
const unsigned num = ReadVarInt(Extra + offset, rem, &id);
|
|
213
|
+
if (num == 0)
|
|
214
|
+
return -1;
|
|
215
|
+
offset += num;
|
|
216
|
+
rem -= num;
|
|
217
|
+
|
|
218
|
+
// There was BUG in RAR 5.21- : it stored (size-1) instead of (size)
|
|
219
|
+
// for Subdata record in Service header.
|
|
220
|
+
// That record always was last in bad archives, so we can fix that case.
|
|
221
|
+
if (id == NExtraID::kSubdata
|
|
222
|
+
&& RecordType == NHeaderType::kService
|
|
223
|
+
&& rem + 1 == Extra.Size() - offset)
|
|
224
|
+
rem++;
|
|
225
|
+
|
|
226
|
+
if (id == extraID)
|
|
227
|
+
{
|
|
228
|
+
recordDataSize = (unsigned)rem;
|
|
229
|
+
return (int)offset;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
offset += rem;
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
|
|
238
|
+
void CItem::PrintInfo(AString &s) const
|
|
239
|
+
{
|
|
240
|
+
size_t offset = 0;
|
|
241
|
+
|
|
242
|
+
for (;;)
|
|
243
|
+
{
|
|
244
|
+
size_t rem = Extra.Size() - offset;
|
|
245
|
+
if (rem == 0)
|
|
246
|
+
return;
|
|
247
|
+
|
|
248
|
+
{
|
|
249
|
+
UInt64 size;
|
|
250
|
+
unsigned num = ReadVarInt(Extra + offset, rem, &size);
|
|
251
|
+
if (num == 0)
|
|
252
|
+
return;
|
|
253
|
+
offset += num;
|
|
254
|
+
rem -= num;
|
|
255
|
+
if (size > rem)
|
|
256
|
+
break;
|
|
257
|
+
rem = (size_t)size;
|
|
258
|
+
}
|
|
259
|
+
{
|
|
260
|
+
UInt64 id;
|
|
261
|
+
{
|
|
262
|
+
unsigned num = ReadVarInt(Extra + offset, rem, &id);
|
|
263
|
+
if (num == 0)
|
|
264
|
+
break;
|
|
265
|
+
offset += num;
|
|
266
|
+
rem -= num;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
// There was BUG in RAR 5.21- : it stored (size-1) instead of (size)
|
|
270
|
+
// for Subdata record in Service header.
|
|
271
|
+
// That record always was last in bad archives, so we can fix that case.
|
|
272
|
+
if (id == NExtraID::kSubdata
|
|
273
|
+
&& RecordType == NHeaderType::kService
|
|
274
|
+
&& rem + 1 == Extra.Size() - offset)
|
|
275
|
+
rem++;
|
|
276
|
+
|
|
277
|
+
s.Add_Space_if_NotEmpty();
|
|
278
|
+
PrintType(s, g_ExtraTypes, Z7_ARRAY_SIZE(g_ExtraTypes), id);
|
|
279
|
+
|
|
280
|
+
if (id == NExtraID::kTime)
|
|
281
|
+
{
|
|
282
|
+
const Byte *p = Extra + offset;
|
|
283
|
+
UInt64 flags;
|
|
284
|
+
const unsigned num = ReadVarInt(p, rem, &flags);
|
|
285
|
+
if (num != 0)
|
|
286
|
+
{
|
|
287
|
+
s.Add_Colon();
|
|
288
|
+
for (unsigned i = 0; i < Z7_ARRAY_SIZE(g_ExtraTimeFlags); i++)
|
|
289
|
+
if ((flags & ((UInt64)1 << i)) != 0)
|
|
290
|
+
s.Add_Char(g_ExtraTimeFlags[i]);
|
|
291
|
+
flags &= ~(((UInt64)1 << Z7_ARRAY_SIZE(g_ExtraTimeFlags)) - 1);
|
|
292
|
+
if (flags != 0)
|
|
293
|
+
{
|
|
294
|
+
s.Add_Char('_');
|
|
295
|
+
AddHex64(s, flags);
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
else if (id == NExtraID::kLink)
|
|
300
|
+
{
|
|
301
|
+
CLinkInfo linkInfo;
|
|
302
|
+
if (linkInfo.Parse(Extra + offset, (unsigned)rem))
|
|
303
|
+
{
|
|
304
|
+
s.Add_Colon();
|
|
305
|
+
PrintType(s, g_LinkTypes, Z7_ARRAY_SIZE(g_LinkTypes), linkInfo.Type);
|
|
306
|
+
UInt64 flags = linkInfo.Flags;
|
|
307
|
+
if (flags != 0)
|
|
308
|
+
{
|
|
309
|
+
s.Add_Colon();
|
|
310
|
+
if (flags & NLinkFlags::kTargetIsDir)
|
|
311
|
+
{
|
|
312
|
+
s.Add_Char('D');
|
|
313
|
+
flags &= ~((UInt64)NLinkFlags::kTargetIsDir);
|
|
314
|
+
}
|
|
315
|
+
if (flags != 0)
|
|
316
|
+
{
|
|
317
|
+
s.Add_Char('_');
|
|
318
|
+
AddHex64(s, flags);
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
offset += rem;
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
s.Add_OptSpaced("ERROR");
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
|
|
332
|
+
bool CCryptoInfo::Parse(const Byte *p, size_t size)
|
|
333
|
+
{
|
|
334
|
+
Algo = 0;
|
|
335
|
+
Flags = 0;
|
|
336
|
+
Cnt = 0;
|
|
337
|
+
PARSE_VAR_INT(p, size, Algo)
|
|
338
|
+
PARSE_VAR_INT(p, size, Flags)
|
|
339
|
+
if (size > 0)
|
|
340
|
+
Cnt = p[0];
|
|
341
|
+
if (size != 1 + 16 + 16 + (unsigned)(IsThereCheck() ? 12 : 0))
|
|
342
|
+
return false;
|
|
343
|
+
return true;
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
|
|
347
|
+
bool CItem::FindExtra_Version(UInt64 &version) const
|
|
348
|
+
{
|
|
349
|
+
unsigned size;
|
|
350
|
+
const int offset = FindExtra(NExtraID::kVersion, size);
|
|
351
|
+
if (offset < 0)
|
|
352
|
+
return false;
|
|
353
|
+
const Byte *p = Extra + (unsigned)offset;
|
|
354
|
+
|
|
355
|
+
UInt64 flags;
|
|
356
|
+
PARSE_VAR_INT(p, size, flags)
|
|
357
|
+
PARSE_VAR_INT(p, size, version)
|
|
358
|
+
return size == 0;
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
bool CItem::FindExtra_Link(CLinkInfo &link) const
|
|
362
|
+
{
|
|
363
|
+
unsigned size;
|
|
364
|
+
const int offset = FindExtra(NExtraID::kLink, size);
|
|
365
|
+
if (offset < 0)
|
|
366
|
+
return false;
|
|
367
|
+
if (!link.Parse(Extra + (unsigned)offset, size))
|
|
368
|
+
return false;
|
|
369
|
+
link.NameOffset += (unsigned)offset;
|
|
370
|
+
return true;
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
bool CItem::Is_CopyLink() const
|
|
374
|
+
{
|
|
375
|
+
CLinkInfo link;
|
|
376
|
+
return FindExtra_Link(link) && link.Type == NLinkType::kFileCopy;
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
bool CItem::Is_HardLink() const
|
|
380
|
+
{
|
|
381
|
+
CLinkInfo link;
|
|
382
|
+
return FindExtra_Link(link) && link.Type == NLinkType::kHardLink;
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
bool CItem::Is_CopyLink_or_HardLink() const
|
|
386
|
+
{
|
|
387
|
+
CLinkInfo link;
|
|
388
|
+
return FindExtra_Link(link) && (link.Type == NLinkType::kFileCopy || link.Type == NLinkType::kHardLink);
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
void CItem::Link_to_Prop(unsigned linkType, NWindows::NCOM::CPropVariant &prop) const
|
|
392
|
+
{
|
|
393
|
+
CLinkInfo link;
|
|
394
|
+
if (!FindExtra_Link(link))
|
|
395
|
+
return;
|
|
396
|
+
|
|
397
|
+
bool isWindows = (HostOS == kHost_Windows);
|
|
398
|
+
if (link.Type != linkType)
|
|
399
|
+
{
|
|
400
|
+
if (linkType != NLinkType::kUnixSymLink)
|
|
401
|
+
return;
|
|
402
|
+
switch ((unsigned)link.Type)
|
|
403
|
+
{
|
|
404
|
+
case NLinkType::kUnixSymLink:
|
|
405
|
+
isWindows = false;
|
|
406
|
+
break;
|
|
407
|
+
case NLinkType::kWinSymLink:
|
|
408
|
+
case NLinkType::kWinJunction:
|
|
409
|
+
isWindows = true;
|
|
410
|
+
break;
|
|
411
|
+
default: return;
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
AString s;
|
|
416
|
+
s.SetFrom_CalcLen((const char *)(Extra + link.NameOffset), link.NameLen);
|
|
417
|
+
UString unicode;
|
|
418
|
+
ConvertUTF8ToUnicode(s, unicode);
|
|
419
|
+
// rar5.0 used '\\' separator for windows symlinks and \??\ prefix for abs paths.
|
|
420
|
+
// rar5.1+ uses '/' separator for windows symlinks and /??/ prefix for abs paths.
|
|
421
|
+
// v25.00: we convert Windows slashes to Linux slashes:
|
|
422
|
+
if (isWindows)
|
|
423
|
+
unicode.Replace(L'\\', L'/');
|
|
424
|
+
prop = unicode;
|
|
425
|
+
// prop = NItemName::GetOsPath(unicode);
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
bool CItem::GetAltStreamName(AString &name) const
|
|
429
|
+
{
|
|
430
|
+
name.Empty();
|
|
431
|
+
unsigned size;
|
|
432
|
+
const int offset = FindExtra(NExtraID::kSubdata, size);
|
|
433
|
+
if (offset < 0)
|
|
434
|
+
return false;
|
|
435
|
+
name.SetFrom_CalcLen((const char *)(Extra + (unsigned)offset), size);
|
|
436
|
+
return true;
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
|
|
440
|
+
class CHash
|
|
441
|
+
{
|
|
442
|
+
bool _calcCRC;
|
|
443
|
+
UInt32 _crc;
|
|
444
|
+
int _blakeOffset;
|
|
445
|
+
CAlignedBuffer1 _buf;
|
|
446
|
+
// CBlake2sp _blake;
|
|
447
|
+
CBlake2sp *BlakeObj() { return (CBlake2sp *)(void *)(Byte *)_buf; }
|
|
448
|
+
public:
|
|
449
|
+
CHash():
|
|
450
|
+
_buf(sizeof(CBlake2sp))
|
|
451
|
+
{}
|
|
452
|
+
|
|
453
|
+
void Init_NoCalc()
|
|
454
|
+
{
|
|
455
|
+
_calcCRC = false;
|
|
456
|
+
_crc = CRC_INIT_VAL;
|
|
457
|
+
_blakeOffset = -1;
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
void Init(const CItem &item);
|
|
461
|
+
void Update(const void *data, size_t size);
|
|
462
|
+
UInt32 GetCRC() const { return CRC_GET_DIGEST(_crc); }
|
|
463
|
+
|
|
464
|
+
bool Check(const CItem &item, NCrypto::NRar5::CDecoder *cryptoDecoder);
|
|
465
|
+
};
|
|
466
|
+
|
|
467
|
+
void CHash::Init(const CItem &item)
|
|
468
|
+
{
|
|
469
|
+
_crc = CRC_INIT_VAL;
|
|
470
|
+
_calcCRC = item.Has_CRC();
|
|
471
|
+
_blakeOffset = item.FindExtra_Blake();
|
|
472
|
+
if (_blakeOffset >= 0)
|
|
473
|
+
Blake2sp_Init(BlakeObj());
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
void CHash::Update(const void *data, size_t size)
|
|
477
|
+
{
|
|
478
|
+
if (_calcCRC)
|
|
479
|
+
_crc = CrcUpdate(_crc, data, size);
|
|
480
|
+
if (_blakeOffset >= 0)
|
|
481
|
+
Blake2sp_Update(BlakeObj(), (const Byte *)data, size);
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
bool CHash::Check(const CItem &item, NCrypto::NRar5::CDecoder *cryptoDecoder)
|
|
485
|
+
{
|
|
486
|
+
if (_calcCRC)
|
|
487
|
+
{
|
|
488
|
+
UInt32 crc = GetCRC();
|
|
489
|
+
if (cryptoDecoder)
|
|
490
|
+
crc = cryptoDecoder->Hmac_Convert_Crc32(crc);
|
|
491
|
+
if (crc != item.CRC)
|
|
492
|
+
return false;
|
|
493
|
+
}
|
|
494
|
+
if (_blakeOffset >= 0)
|
|
495
|
+
{
|
|
496
|
+
UInt32 digest[Z7_BLAKE2S_DIGEST_SIZE / sizeof(UInt32)];
|
|
497
|
+
Blake2sp_Final(BlakeObj(), (Byte *)(void *)digest);
|
|
498
|
+
if (cryptoDecoder)
|
|
499
|
+
cryptoDecoder->Hmac_Convert_32Bytes((Byte *)(void *)digest);
|
|
500
|
+
if (memcmp(digest, item.Extra + (unsigned)_blakeOffset, Z7_BLAKE2S_DIGEST_SIZE) != 0)
|
|
501
|
+
return false;
|
|
502
|
+
}
|
|
503
|
+
return true;
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
|
|
507
|
+
Z7_CLASS_IMP_NOQIB_1(
|
|
508
|
+
COutStreamWithHash
|
|
509
|
+
, ISequentialOutStream
|
|
510
|
+
)
|
|
511
|
+
bool _size_Defined;
|
|
512
|
+
ISequentialOutStream *_stream;
|
|
513
|
+
UInt64 _pos;
|
|
514
|
+
UInt64 _size;
|
|
515
|
+
Byte *_destBuf;
|
|
516
|
+
public:
|
|
517
|
+
CHash _hash;
|
|
518
|
+
|
|
519
|
+
COutStreamWithHash(): _destBuf(NULL) {}
|
|
520
|
+
|
|
521
|
+
void SetStream(ISequentialOutStream *stream) { _stream = stream; }
|
|
522
|
+
void Init(const CItem &item, Byte *destBuf, bool needChecksumCheck)
|
|
523
|
+
{
|
|
524
|
+
_size_Defined = false;
|
|
525
|
+
_size = 0;
|
|
526
|
+
_destBuf = NULL;
|
|
527
|
+
if (!item.Is_UnknownSize())
|
|
528
|
+
{
|
|
529
|
+
_size_Defined = true;
|
|
530
|
+
_size = item.Size;
|
|
531
|
+
_destBuf = destBuf;
|
|
532
|
+
}
|
|
533
|
+
_pos = 0;
|
|
534
|
+
if (needChecksumCheck)
|
|
535
|
+
_hash.Init(item);
|
|
536
|
+
else
|
|
537
|
+
_hash.Init_NoCalc();
|
|
538
|
+
}
|
|
539
|
+
UInt64 GetPos() const { return _pos; }
|
|
540
|
+
};
|
|
541
|
+
|
|
542
|
+
|
|
543
|
+
Z7_COM7F_IMF(COutStreamWithHash::Write(const void *data, UInt32 size, UInt32 *processedSize))
|
|
544
|
+
{
|
|
545
|
+
HRESULT result = S_OK;
|
|
546
|
+
if (_size_Defined)
|
|
547
|
+
{
|
|
548
|
+
const UInt64 rem = _size - _pos;
|
|
549
|
+
if (size > rem)
|
|
550
|
+
size = (UInt32)rem;
|
|
551
|
+
}
|
|
552
|
+
if (_stream)
|
|
553
|
+
result = _stream->Write(data, size, &size);
|
|
554
|
+
if (_destBuf)
|
|
555
|
+
memcpy(_destBuf + (size_t)_pos, data, size);
|
|
556
|
+
_hash.Update(data, size);
|
|
557
|
+
_pos += size;
|
|
558
|
+
if (processedSize)
|
|
559
|
+
*processedSize = size;
|
|
560
|
+
return result;
|
|
561
|
+
}
|
|
562
|
+
|
|
563
|
+
|
|
564
|
+
|
|
565
|
+
|
|
566
|
+
|
|
567
|
+
class CInArchive
|
|
568
|
+
{
|
|
569
|
+
CAlignedBuffer _buf;
|
|
570
|
+
size_t _bufSize;
|
|
571
|
+
size_t _bufPos;
|
|
572
|
+
ISequentialInStream *_stream;
|
|
573
|
+
|
|
574
|
+
CMyComPtr2<ICompressFilter, NCrypto::NRar5::CDecoder> m_CryptoDecoder;
|
|
575
|
+
|
|
576
|
+
Z7_CLASS_NO_COPY(CInArchive)
|
|
577
|
+
|
|
578
|
+
HRESULT ReadStream_Check(void *data, size_t size);
|
|
579
|
+
|
|
580
|
+
public:
|
|
581
|
+
bool m_CryptoMode;
|
|
582
|
+
|
|
583
|
+
bool WrongPassword;
|
|
584
|
+
bool IsArc;
|
|
585
|
+
bool UnexpectedEnd;
|
|
586
|
+
|
|
587
|
+
UInt64 StreamStartPosition;
|
|
588
|
+
UInt64 Position;
|
|
589
|
+
|
|
590
|
+
size_t Get_Buf_RemainSize() const { return _bufSize - _bufPos; }
|
|
591
|
+
bool Is_Buf_Finished() const { return _bufPos == _bufSize; }
|
|
592
|
+
const Byte *Get_Buf_Data() const { return _buf + _bufPos; }
|
|
593
|
+
void Move_BufPos(size_t num) { _bufPos += num; }
|
|
594
|
+
bool ReadVar(UInt64 &val);
|
|
595
|
+
|
|
596
|
+
struct CHeader
|
|
597
|
+
{
|
|
598
|
+
UInt64 Type;
|
|
599
|
+
UInt64 Flags;
|
|
600
|
+
size_t ExtraSize;
|
|
601
|
+
UInt64 DataSize;
|
|
602
|
+
};
|
|
603
|
+
|
|
604
|
+
CInArchive() {}
|
|
605
|
+
|
|
606
|
+
HRESULT ReadBlockHeader(CHeader &h);
|
|
607
|
+
bool ReadFileHeader(const CHeader &header, CItem &item);
|
|
608
|
+
void AddToSeekValue(UInt64 addValue)
|
|
609
|
+
{
|
|
610
|
+
Position += addValue;
|
|
611
|
+
}
|
|
612
|
+
|
|
613
|
+
HRESULT Open(IInStream *inStream, const UInt64 *searchHeaderSizeLimit, ICryptoGetTextPassword *getTextPassword,
|
|
614
|
+
CInArcInfo &info);
|
|
615
|
+
};
|
|
616
|
+
|
|
617
|
+
|
|
618
|
+
static HRESULT MySetPassword(ICryptoGetTextPassword *getTextPassword, NCrypto::NRar5::CDecoder *cryptoDecoder)
|
|
619
|
+
{
|
|
620
|
+
CMyComBSTR_Wipe password;
|
|
621
|
+
RINOK(getTextPassword->CryptoGetTextPassword(&password))
|
|
622
|
+
AString_Wipe utf8;
|
|
623
|
+
const unsigned kPasswordLen_MAX = 127;
|
|
624
|
+
UString_Wipe unicode;
|
|
625
|
+
unicode.SetFromBstr(password);
|
|
626
|
+
if (unicode.Len() > kPasswordLen_MAX)
|
|
627
|
+
unicode.DeleteFrom(kPasswordLen_MAX);
|
|
628
|
+
ConvertUnicodeToUTF8(unicode, utf8);
|
|
629
|
+
cryptoDecoder->SetPassword((const Byte *)(const char *)utf8, utf8.Len());
|
|
630
|
+
return S_OK;
|
|
631
|
+
}
|
|
632
|
+
|
|
633
|
+
|
|
634
|
+
bool CInArchive::ReadVar(UInt64 &val)
|
|
635
|
+
{
|
|
636
|
+
const unsigned offset = ReadVarInt(Get_Buf_Data(), Get_Buf_RemainSize(), &val);
|
|
637
|
+
Move_BufPos(offset);
|
|
638
|
+
return (offset != 0);
|
|
639
|
+
}
|
|
640
|
+
|
|
641
|
+
|
|
642
|
+
HRESULT CInArchive::ReadStream_Check(void *data, size_t size)
|
|
643
|
+
{
|
|
644
|
+
size_t size2 = size;
|
|
645
|
+
RINOK(ReadStream(_stream, data, &size2))
|
|
646
|
+
if (size2 == size)
|
|
647
|
+
return S_OK;
|
|
648
|
+
UnexpectedEnd = true;
|
|
649
|
+
return S_FALSE;
|
|
650
|
+
}
|
|
651
|
+
|
|
652
|
+
|
|
653
|
+
HRESULT CInArchive::ReadBlockHeader(CHeader &h)
|
|
654
|
+
{
|
|
655
|
+
h.Type = 0;
|
|
656
|
+
h.Flags = 0;
|
|
657
|
+
h.ExtraSize = 0;
|
|
658
|
+
h.DataSize = 0;
|
|
659
|
+
|
|
660
|
+
Byte buf[AES_BLOCK_SIZE];
|
|
661
|
+
unsigned filled;
|
|
662
|
+
|
|
663
|
+
if (m_CryptoMode)
|
|
664
|
+
{
|
|
665
|
+
_buf.AllocAtLeast(1 << 12); // at least (AES_BLOCK_SIZE * 2)
|
|
666
|
+
if (!(Byte *)_buf)
|
|
667
|
+
return E_OUTOFMEMORY;
|
|
668
|
+
RINOK(ReadStream_Check(_buf, AES_BLOCK_SIZE * 2))
|
|
669
|
+
memcpy(m_CryptoDecoder->_iv, _buf, AES_BLOCK_SIZE);
|
|
670
|
+
RINOK(m_CryptoDecoder->Init())
|
|
671
|
+
// we call RAR5_AES_Filter with:
|
|
672
|
+
// data_ptr == aligned_ptr + 16
|
|
673
|
+
// data_size == 16
|
|
674
|
+
if (m_CryptoDecoder->Filter(_buf + AES_BLOCK_SIZE, AES_BLOCK_SIZE) != AES_BLOCK_SIZE)
|
|
675
|
+
return E_FAIL;
|
|
676
|
+
memcpy(buf, _buf + AES_BLOCK_SIZE, AES_BLOCK_SIZE);
|
|
677
|
+
filled = AES_BLOCK_SIZE;
|
|
678
|
+
}
|
|
679
|
+
else
|
|
680
|
+
{
|
|
681
|
+
const unsigned kStartSize = 4 + 3;
|
|
682
|
+
RINOK(ReadStream_Check(buf, kStartSize))
|
|
683
|
+
filled = kStartSize;
|
|
684
|
+
}
|
|
685
|
+
|
|
686
|
+
{
|
|
687
|
+
UInt64 val;
|
|
688
|
+
unsigned offset = ReadVarInt(buf + 4, 3, &val);
|
|
689
|
+
if (offset == 0)
|
|
690
|
+
return S_FALSE;
|
|
691
|
+
size_t size = (size_t)val;
|
|
692
|
+
if (size < 2)
|
|
693
|
+
return S_FALSE;
|
|
694
|
+
offset += 4;
|
|
695
|
+
_bufPos = offset;
|
|
696
|
+
size += offset;
|
|
697
|
+
_bufSize = size;
|
|
698
|
+
if (m_CryptoMode)
|
|
699
|
+
size = (size + AES_BLOCK_SIZE - 1) & ~(size_t)(AES_BLOCK_SIZE - 1);
|
|
700
|
+
_buf.AllocAtLeast(size);
|
|
701
|
+
if (!(Byte *)_buf)
|
|
702
|
+
return E_OUTOFMEMORY;
|
|
703
|
+
memcpy(_buf, buf, filled);
|
|
704
|
+
const size_t rem = size - filled;
|
|
705
|
+
// if (m_CryptoMode), we add AES_BLOCK_SIZE here, because _iv is not included to size.
|
|
706
|
+
AddToSeekValue(size + (m_CryptoMode ? AES_BLOCK_SIZE : 0));
|
|
707
|
+
RINOK(ReadStream_Check(_buf + filled, rem))
|
|
708
|
+
if (m_CryptoMode)
|
|
709
|
+
{
|
|
710
|
+
// we call RAR5_AES_Filter with:
|
|
711
|
+
// data_ptr == aligned_ptr + 16
|
|
712
|
+
// (rem) can be big
|
|
713
|
+
if (m_CryptoDecoder->Filter(_buf + filled, (UInt32)rem) != rem)
|
|
714
|
+
return E_FAIL;
|
|
715
|
+
#if 1
|
|
716
|
+
// optional 7zip-unrar check : remainder must contain zeros.
|
|
717
|
+
const size_t pad = size - _bufSize;
|
|
718
|
+
const Byte *p = _buf + _bufSize;
|
|
719
|
+
for (size_t i = 0; i < pad; i++)
|
|
720
|
+
if (p[i])
|
|
721
|
+
return S_FALSE;
|
|
722
|
+
#endif
|
|
723
|
+
}
|
|
724
|
+
}
|
|
725
|
+
|
|
726
|
+
if (CrcCalc(_buf + 4, _bufSize - 4) != Get32(buf))
|
|
727
|
+
return S_FALSE;
|
|
728
|
+
|
|
729
|
+
if (!ReadVar(h.Type)) return S_FALSE;
|
|
730
|
+
if (!ReadVar(h.Flags)) return S_FALSE;
|
|
731
|
+
|
|
732
|
+
if (h.Flags & NHeaderFlags::kExtra)
|
|
733
|
+
{
|
|
734
|
+
UInt64 extraSize;
|
|
735
|
+
if (!ReadVar(extraSize))
|
|
736
|
+
return S_FALSE;
|
|
737
|
+
if (extraSize >= (1u << 21))
|
|
738
|
+
return S_FALSE;
|
|
739
|
+
h.ExtraSize = (size_t)extraSize;
|
|
740
|
+
}
|
|
741
|
+
|
|
742
|
+
if (h.Flags & NHeaderFlags::kData)
|
|
743
|
+
{
|
|
744
|
+
if (!ReadVar(h.DataSize))
|
|
745
|
+
return S_FALSE;
|
|
746
|
+
}
|
|
747
|
+
|
|
748
|
+
if (h.ExtraSize > Get_Buf_RemainSize())
|
|
749
|
+
return S_FALSE;
|
|
750
|
+
return S_OK;
|
|
751
|
+
}
|
|
752
|
+
|
|
753
|
+
|
|
754
|
+
bool CInArcInfo::CLocator::Parse(const Byte *p, size_t size)
|
|
755
|
+
{
|
|
756
|
+
Flags = 0;
|
|
757
|
+
QuickOpen = 0;
|
|
758
|
+
Recovery = 0;
|
|
759
|
+
|
|
760
|
+
PARSE_VAR_INT(p, size, Flags)
|
|
761
|
+
|
|
762
|
+
if (Is_QuickOpen())
|
|
763
|
+
{
|
|
764
|
+
PARSE_VAR_INT(p, size, QuickOpen)
|
|
765
|
+
}
|
|
766
|
+
if (Is_Recovery())
|
|
767
|
+
{
|
|
768
|
+
PARSE_VAR_INT(p, size, Recovery)
|
|
769
|
+
}
|
|
770
|
+
#if 0
|
|
771
|
+
// another records are possible in future rar formats.
|
|
772
|
+
if (size != 0)
|
|
773
|
+
return false;
|
|
774
|
+
#endif
|
|
775
|
+
return true;
|
|
776
|
+
}
|
|
777
|
+
|
|
778
|
+
|
|
779
|
+
bool CInArcInfo::CMetadata::Parse(const Byte *p, size_t size)
|
|
780
|
+
{
|
|
781
|
+
PARSE_VAR_INT(p, size, Flags)
|
|
782
|
+
if (Flags & NMetadataFlags::kArcName)
|
|
783
|
+
{
|
|
784
|
+
UInt64 nameLen;
|
|
785
|
+
PARSE_VAR_INT(p, size, nameLen)
|
|
786
|
+
if (nameLen > size)
|
|
787
|
+
return false;
|
|
788
|
+
ArcName.SetFrom_CalcLen((const char *)(const void *)p, (unsigned)nameLen);
|
|
789
|
+
p += (size_t)nameLen;
|
|
790
|
+
size -= (size_t)nameLen;
|
|
791
|
+
}
|
|
792
|
+
if (Flags & NMetadataFlags::kCTime)
|
|
793
|
+
{
|
|
794
|
+
if ((Flags & NMetadataFlags::kUnixTime) &&
|
|
795
|
+
(Flags & NMetadataFlags::kNanoSec) == 0)
|
|
796
|
+
{
|
|
797
|
+
if (size < 4)
|
|
798
|
+
return false;
|
|
799
|
+
CTime = GetUi32(p);
|
|
800
|
+
p += 4;
|
|
801
|
+
size -= 4;
|
|
802
|
+
}
|
|
803
|
+
else
|
|
804
|
+
{
|
|
805
|
+
if (size < 8)
|
|
806
|
+
return false;
|
|
807
|
+
CTime = GetUi64(p);
|
|
808
|
+
p += 8;
|
|
809
|
+
size -= 8;
|
|
810
|
+
}
|
|
811
|
+
}
|
|
812
|
+
#if 0
|
|
813
|
+
// another records are possible in future rar formats.
|
|
814
|
+
if (size != 0)
|
|
815
|
+
return false;
|
|
816
|
+
#endif
|
|
817
|
+
return true;
|
|
818
|
+
}
|
|
819
|
+
|
|
820
|
+
|
|
821
|
+
bool CInArcInfo::ParseExtra(const Byte *p, size_t size)
|
|
822
|
+
{
|
|
823
|
+
for (;;)
|
|
824
|
+
{
|
|
825
|
+
if (size == 0)
|
|
826
|
+
return true;
|
|
827
|
+
UInt64 recSize64, id;
|
|
828
|
+
PARSE_VAR_INT(p, size, recSize64)
|
|
829
|
+
if (recSize64 > size)
|
|
830
|
+
return false;
|
|
831
|
+
size_t recSize = (size_t)recSize64;
|
|
832
|
+
size -= recSize;
|
|
833
|
+
// READ_VAR_INT(p, recSize, recSize)
|
|
834
|
+
{
|
|
835
|
+
const unsigned num = ReadVarInt(p, recSize, &id);
|
|
836
|
+
if (num == 0)
|
|
837
|
+
return false;
|
|
838
|
+
p += num;
|
|
839
|
+
recSize -= num;
|
|
840
|
+
}
|
|
841
|
+
if (id == kArcExtraRecordType_Metadata)
|
|
842
|
+
{
|
|
843
|
+
Metadata_Defined = true;
|
|
844
|
+
if (!Metadata.Parse(p, recSize))
|
|
845
|
+
Metadata_Error = true;
|
|
846
|
+
}
|
|
847
|
+
else if (id == kArcExtraRecordType_Locator)
|
|
848
|
+
{
|
|
849
|
+
Locator_Defined = true;
|
|
850
|
+
if (!Locator.Parse(p, recSize))
|
|
851
|
+
Locator_Error = true;
|
|
852
|
+
}
|
|
853
|
+
else
|
|
854
|
+
UnknownExtraRecord = true;
|
|
855
|
+
p += recSize;
|
|
856
|
+
}
|
|
857
|
+
}
|
|
858
|
+
|
|
859
|
+
|
|
860
|
+
|
|
861
|
+
HRESULT CInArchive::Open(IInStream *stream, const UInt64 *searchHeaderSizeLimit, ICryptoGetTextPassword *getTextPassword,
|
|
862
|
+
CInArcInfo &info)
|
|
863
|
+
{
|
|
864
|
+
m_CryptoMode = false;
|
|
865
|
+
|
|
866
|
+
WrongPassword = false;
|
|
867
|
+
IsArc = false;
|
|
868
|
+
UnexpectedEnd = false;
|
|
869
|
+
|
|
870
|
+
Position = StreamStartPosition;
|
|
871
|
+
|
|
872
|
+
UInt64 arcStartPos = StreamStartPosition;
|
|
873
|
+
{
|
|
874
|
+
Byte marker[kMarkerSize];
|
|
875
|
+
RINOK(ReadStream_FALSE(stream, marker, kMarkerSize))
|
|
876
|
+
if (memcmp(marker, kMarker, kMarkerSize) == 0)
|
|
877
|
+
Position += kMarkerSize;
|
|
878
|
+
else
|
|
879
|
+
{
|
|
880
|
+
if (searchHeaderSizeLimit && *searchHeaderSizeLimit == 0)
|
|
881
|
+
return S_FALSE;
|
|
882
|
+
RINOK(InStream_SeekSet(stream, StreamStartPosition))
|
|
883
|
+
RINOK(FindSignatureInStream(stream, kMarker, kMarkerSize,
|
|
884
|
+
searchHeaderSizeLimit, arcStartPos))
|
|
885
|
+
arcStartPos += StreamStartPosition;
|
|
886
|
+
Position = arcStartPos + kMarkerSize;
|
|
887
|
+
RINOK(InStream_SeekSet(stream, Position))
|
|
888
|
+
}
|
|
889
|
+
}
|
|
890
|
+
|
|
891
|
+
info.StartPos = arcStartPos;
|
|
892
|
+
_stream = stream;
|
|
893
|
+
|
|
894
|
+
CHeader h;
|
|
895
|
+
RINOK(ReadBlockHeader(h))
|
|
896
|
+
info.IsEncrypted = false;
|
|
897
|
+
|
|
898
|
+
if (h.Type == NHeaderType::kArcEncrypt)
|
|
899
|
+
{
|
|
900
|
+
info.IsEncrypted = true;
|
|
901
|
+
IsArc = true;
|
|
902
|
+
if (!getTextPassword)
|
|
903
|
+
return E_NOTIMPL;
|
|
904
|
+
m_CryptoMode = true;
|
|
905
|
+
m_CryptoDecoder.Create_if_Empty();
|
|
906
|
+
RINOK(m_CryptoDecoder->SetDecoderProps(
|
|
907
|
+
Get_Buf_Data(), (unsigned)Get_Buf_RemainSize(), false, false))
|
|
908
|
+
RINOK(MySetPassword(getTextPassword, m_CryptoDecoder.ClsPtr()))
|
|
909
|
+
if (!m_CryptoDecoder->CalcKey_and_CheckPassword())
|
|
910
|
+
{
|
|
911
|
+
WrongPassword = True;
|
|
912
|
+
return S_FALSE;
|
|
913
|
+
}
|
|
914
|
+
RINOK(ReadBlockHeader(h))
|
|
915
|
+
}
|
|
916
|
+
|
|
917
|
+
if (h.Type != NHeaderType::kArc)
|
|
918
|
+
return S_FALSE;
|
|
919
|
+
|
|
920
|
+
IsArc = true;
|
|
921
|
+
info.VolNumber = 0;
|
|
922
|
+
|
|
923
|
+
if (!ReadVar(info.Flags))
|
|
924
|
+
return S_FALSE;
|
|
925
|
+
|
|
926
|
+
if (info.Flags & NArcFlags::kVolNumber)
|
|
927
|
+
if (!ReadVar(info.VolNumber))
|
|
928
|
+
return S_FALSE;
|
|
929
|
+
|
|
930
|
+
if (h.ExtraSize != Get_Buf_RemainSize())
|
|
931
|
+
return S_FALSE;
|
|
932
|
+
if (h.ExtraSize)
|
|
933
|
+
{
|
|
934
|
+
if (!info.ParseExtra(Get_Buf_Data(), h.ExtraSize))
|
|
935
|
+
info.Extra_Error = true;
|
|
936
|
+
}
|
|
937
|
+
return S_OK;
|
|
938
|
+
}
|
|
939
|
+
|
|
940
|
+
|
|
941
|
+
bool CInArchive::ReadFileHeader(const CHeader &header, CItem &item)
|
|
942
|
+
{
|
|
943
|
+
item.CommonFlags = (UInt32)header.Flags;
|
|
944
|
+
item.PackSize = header.DataSize;
|
|
945
|
+
item.UnixMTime = 0;
|
|
946
|
+
item.CRC = 0;
|
|
947
|
+
|
|
948
|
+
{
|
|
949
|
+
UInt64 flags64;
|
|
950
|
+
if (!ReadVar(flags64)) return false;
|
|
951
|
+
item.Flags = (UInt32)flags64;
|
|
952
|
+
}
|
|
953
|
+
|
|
954
|
+
if (!ReadVar(item.Size)) return false;
|
|
955
|
+
|
|
956
|
+
{
|
|
957
|
+
UInt64 attrib;
|
|
958
|
+
if (!ReadVar(attrib)) return false;
|
|
959
|
+
item.Attrib = (UInt32)attrib;
|
|
960
|
+
}
|
|
961
|
+
if (item.Has_UnixMTime())
|
|
962
|
+
{
|
|
963
|
+
if (Get_Buf_RemainSize() < 4)
|
|
964
|
+
return false;
|
|
965
|
+
item.UnixMTime = Get32(Get_Buf_Data());
|
|
966
|
+
Move_BufPos(4);
|
|
967
|
+
}
|
|
968
|
+
if (item.Has_CRC())
|
|
969
|
+
{
|
|
970
|
+
if (Get_Buf_RemainSize() < 4)
|
|
971
|
+
return false;
|
|
972
|
+
item.CRC = Get32(Get_Buf_Data());
|
|
973
|
+
Move_BufPos(4);
|
|
974
|
+
}
|
|
975
|
+
{
|
|
976
|
+
UInt64 method;
|
|
977
|
+
if (!ReadVar(method)) return false;
|
|
978
|
+
item.Method = (UInt32)method;
|
|
979
|
+
}
|
|
980
|
+
|
|
981
|
+
if (!ReadVar(item.HostOS)) return false;
|
|
982
|
+
|
|
983
|
+
{
|
|
984
|
+
UInt64 len;
|
|
985
|
+
if (!ReadVar(len)) return false;
|
|
986
|
+
if (len > Get_Buf_RemainSize())
|
|
987
|
+
return false;
|
|
988
|
+
item.Name.SetFrom_CalcLen((const char *)Get_Buf_Data(), (unsigned)len);
|
|
989
|
+
Move_BufPos((size_t)len);
|
|
990
|
+
}
|
|
991
|
+
|
|
992
|
+
item.Extra.Free();
|
|
993
|
+
const size_t extraSize = header.ExtraSize;
|
|
994
|
+
if (extraSize != 0)
|
|
995
|
+
{
|
|
996
|
+
if (Get_Buf_RemainSize() < extraSize)
|
|
997
|
+
return false;
|
|
998
|
+
item.Extra.Alloc(extraSize);
|
|
999
|
+
memcpy(item.Extra, Get_Buf_Data(), extraSize);
|
|
1000
|
+
Move_BufPos(extraSize);
|
|
1001
|
+
}
|
|
1002
|
+
|
|
1003
|
+
return Is_Buf_Finished();
|
|
1004
|
+
}
|
|
1005
|
+
|
|
1006
|
+
|
|
1007
|
+
|
|
1008
|
+
struct CLinkFile
|
|
1009
|
+
{
|
|
1010
|
+
unsigned Index;
|
|
1011
|
+
unsigned NumLinks; // the number of links to Data
|
|
1012
|
+
CByteBuffer Data;
|
|
1013
|
+
HRESULT Res;
|
|
1014
|
+
bool crcOK;
|
|
1015
|
+
|
|
1016
|
+
CLinkFile(): Index(0), NumLinks(0), Res(S_OK), crcOK(true) {}
|
|
1017
|
+
};
|
|
1018
|
+
|
|
1019
|
+
|
|
1020
|
+
struct CUnpacker
|
|
1021
|
+
{
|
|
1022
|
+
CMyComPtr2<ICompressCoder, NCompress::CCopyCoder> copyCoder;
|
|
1023
|
+
CMyComPtr<ICompressCoder> LzCoders[2];
|
|
1024
|
+
bool SolidAllowed;
|
|
1025
|
+
bool NeedCrc;
|
|
1026
|
+
CFilterCoder *filterStreamSpec;
|
|
1027
|
+
CMyComPtr<ISequentialInStream> filterStream;
|
|
1028
|
+
CMyComPtr2<ICompressFilter, NCrypto::NRar5::CDecoder> cryptoDecoder;
|
|
1029
|
+
CMyComPtr<ICryptoGetTextPassword> getTextPassword;
|
|
1030
|
+
CMyComPtr2<ISequentialOutStream, COutStreamWithHash> outStream;
|
|
1031
|
+
|
|
1032
|
+
CByteBuffer _tempBuf;
|
|
1033
|
+
CLinkFile *linkFile;
|
|
1034
|
+
|
|
1035
|
+
CUnpacker(): linkFile(NULL) { SolidAllowed = false; NeedCrc = true; }
|
|
1036
|
+
|
|
1037
|
+
HRESULT Create(DECL_EXTERNAL_CODECS_LOC_VARS
|
|
1038
|
+
const CItem &item, bool isSolid, bool &wrongPassword);
|
|
1039
|
+
|
|
1040
|
+
HRESULT Code(const CItem &item, const CItem &lastItem, UInt64 packSize,
|
|
1041
|
+
ISequentialInStream *inStream, ISequentialOutStream *outStream, ICompressProgressInfo *progress,
|
|
1042
|
+
bool &isCrcOK);
|
|
1043
|
+
|
|
1044
|
+
HRESULT DecodeToBuf(DECL_EXTERNAL_CODECS_LOC_VARS
|
|
1045
|
+
const CItem &item, UInt64 packSize, ISequentialInStream *inStream, CByteBuffer &buffer);
|
|
1046
|
+
};
|
|
1047
|
+
|
|
1048
|
+
|
|
1049
|
+
static const unsigned kLzMethodMax = 5;
|
|
1050
|
+
|
|
1051
|
+
HRESULT CUnpacker::Create(DECL_EXTERNAL_CODECS_LOC_VARS
|
|
1052
|
+
const CItem &item, bool isSolid, bool &wrongPassword)
|
|
1053
|
+
{
|
|
1054
|
+
wrongPassword = false;
|
|
1055
|
+
|
|
1056
|
+
if (item.Get_AlgoVersion_RawBits() > 1)
|
|
1057
|
+
return E_NOTIMPL;
|
|
1058
|
+
|
|
1059
|
+
outStream.Create_if_Empty();
|
|
1060
|
+
|
|
1061
|
+
const unsigned method = item.Get_Method();
|
|
1062
|
+
|
|
1063
|
+
if (method == 0)
|
|
1064
|
+
copyCoder.Create_if_Empty();
|
|
1065
|
+
else
|
|
1066
|
+
{
|
|
1067
|
+
if (method > kLzMethodMax)
|
|
1068
|
+
return E_NOTIMPL;
|
|
1069
|
+
/*
|
|
1070
|
+
if (item.IsSplitBefore())
|
|
1071
|
+
return S_FALSE;
|
|
1072
|
+
*/
|
|
1073
|
+
const unsigned lzIndex = item.IsService() ? 1 : 0;
|
|
1074
|
+
CMyComPtr<ICompressCoder> &lzCoder = LzCoders[lzIndex];
|
|
1075
|
+
if (!lzCoder)
|
|
1076
|
+
{
|
|
1077
|
+
const UInt32 methodID = 0x40305;
|
|
1078
|
+
RINOK(CreateCoder_Id(EXTERNAL_CODECS_LOC_VARS methodID, false, lzCoder))
|
|
1079
|
+
if (!lzCoder)
|
|
1080
|
+
return E_NOTIMPL;
|
|
1081
|
+
}
|
|
1082
|
+
|
|
1083
|
+
CMyComPtr<ICompressSetDecoderProperties2> csdp;
|
|
1084
|
+
RINOK(lzCoder.QueryInterface(IID_ICompressSetDecoderProperties2, &csdp))
|
|
1085
|
+
if (!csdp)
|
|
1086
|
+
return E_NOTIMPL;
|
|
1087
|
+
const unsigned ver = item.Get_AlgoVersion_HuffRev();
|
|
1088
|
+
if (ver > 1)
|
|
1089
|
+
return E_NOTIMPL;
|
|
1090
|
+
const Byte props[2] =
|
|
1091
|
+
{
|
|
1092
|
+
(Byte)item.Get_DictSize_Main(),
|
|
1093
|
+
(Byte)((item.Get_DictSize_Frac() << 3) + (ver << 1) + (isSolid ? 1 : 0))
|
|
1094
|
+
};
|
|
1095
|
+
RINOK(csdp->SetDecoderProperties2(props, 2))
|
|
1096
|
+
}
|
|
1097
|
+
|
|
1098
|
+
unsigned cryptoSize = 0;
|
|
1099
|
+
const int cryptoOffset = item.FindExtra(NExtraID::kCrypto, cryptoSize);
|
|
1100
|
+
|
|
1101
|
+
if (cryptoOffset >= 0)
|
|
1102
|
+
{
|
|
1103
|
+
if (!filterStream)
|
|
1104
|
+
{
|
|
1105
|
+
filterStreamSpec = new CFilterCoder(false);
|
|
1106
|
+
filterStream = filterStreamSpec;
|
|
1107
|
+
}
|
|
1108
|
+
|
|
1109
|
+
cryptoDecoder.Create_if_Empty();
|
|
1110
|
+
|
|
1111
|
+
RINOK(cryptoDecoder->SetDecoderProps(item.Extra + (unsigned)cryptoOffset, cryptoSize, true, item.IsService()))
|
|
1112
|
+
|
|
1113
|
+
if (!getTextPassword)
|
|
1114
|
+
{
|
|
1115
|
+
wrongPassword = True;
|
|
1116
|
+
return E_NOTIMPL;
|
|
1117
|
+
}
|
|
1118
|
+
|
|
1119
|
+
RINOK(MySetPassword(getTextPassword, cryptoDecoder.ClsPtr()))
|
|
1120
|
+
|
|
1121
|
+
if (!cryptoDecoder->CalcKey_and_CheckPassword())
|
|
1122
|
+
wrongPassword = True;
|
|
1123
|
+
}
|
|
1124
|
+
|
|
1125
|
+
return S_OK;
|
|
1126
|
+
}
|
|
1127
|
+
|
|
1128
|
+
|
|
1129
|
+
HRESULT CUnpacker::Code(const CItem &item, const CItem &lastItem, UInt64 packSize,
|
|
1130
|
+
ISequentialInStream *volsInStream, ISequentialOutStream *realOutStream, ICompressProgressInfo *progress,
|
|
1131
|
+
bool &isCrcOK)
|
|
1132
|
+
{
|
|
1133
|
+
isCrcOK = true;
|
|
1134
|
+
|
|
1135
|
+
const unsigned method = item.Get_Method();
|
|
1136
|
+
if (method > kLzMethodMax)
|
|
1137
|
+
return E_NOTIMPL;
|
|
1138
|
+
|
|
1139
|
+
const bool needBuf = (linkFile && linkFile->NumLinks != 0);
|
|
1140
|
+
|
|
1141
|
+
if (needBuf && !lastItem.Is_UnknownSize())
|
|
1142
|
+
{
|
|
1143
|
+
const size_t dataSize = (size_t)lastItem.Size;
|
|
1144
|
+
if (dataSize != lastItem.Size)
|
|
1145
|
+
return E_NOTIMPL;
|
|
1146
|
+
linkFile->Data.Alloc(dataSize);
|
|
1147
|
+
}
|
|
1148
|
+
|
|
1149
|
+
bool isCryptoMode = false;
|
|
1150
|
+
ISequentialInStream *inStream;
|
|
1151
|
+
|
|
1152
|
+
if (item.IsEncrypted())
|
|
1153
|
+
{
|
|
1154
|
+
filterStreamSpec->Filter = cryptoDecoder;
|
|
1155
|
+
filterStreamSpec->SetInStream(volsInStream);
|
|
1156
|
+
filterStreamSpec->SetOutStreamSize(NULL);
|
|
1157
|
+
inStream = filterStream;
|
|
1158
|
+
isCryptoMode = true;
|
|
1159
|
+
}
|
|
1160
|
+
else
|
|
1161
|
+
inStream = volsInStream;
|
|
1162
|
+
|
|
1163
|
+
ICompressCoder *commonCoder = (method == 0) ?
|
|
1164
|
+
copyCoder.Interface() :
|
|
1165
|
+
LzCoders[item.IsService() ? 1 : 0].Interface();
|
|
1166
|
+
|
|
1167
|
+
outStream->SetStream(realOutStream);
|
|
1168
|
+
outStream->Init(lastItem, (needBuf ? (Byte *)linkFile->Data : NULL), NeedCrc);
|
|
1169
|
+
|
|
1170
|
+
HRESULT res = S_OK;
|
|
1171
|
+
if (packSize != 0 || lastItem.Is_UnknownSize() || lastItem.Size != 0)
|
|
1172
|
+
{
|
|
1173
|
+
res = commonCoder->Code(inStream, outStream, &packSize,
|
|
1174
|
+
lastItem.Is_UnknownSize() ? NULL : &lastItem.Size, progress);
|
|
1175
|
+
if (!item.IsService())
|
|
1176
|
+
SolidAllowed = true;
|
|
1177
|
+
}
|
|
1178
|
+
else
|
|
1179
|
+
{
|
|
1180
|
+
// res = res;
|
|
1181
|
+
}
|
|
1182
|
+
|
|
1183
|
+
if (isCryptoMode)
|
|
1184
|
+
filterStreamSpec->ReleaseInStream();
|
|
1185
|
+
|
|
1186
|
+
const UInt64 processedSize = outStream->GetPos();
|
|
1187
|
+
if (res == S_OK && !lastItem.Is_UnknownSize() && processedSize != lastItem.Size)
|
|
1188
|
+
{
|
|
1189
|
+
// rar_v7.13-: linux archive contains symLink with (packSize == 0 && lastItem.Size != 0)
|
|
1190
|
+
// v25.02: we ignore such record in rar headers:
|
|
1191
|
+
if (packSize != 0
|
|
1192
|
+
|| method != 0
|
|
1193
|
+
|| lastItem.HostOS != kHost_Unix
|
|
1194
|
+
|| !MY_LIN_S_ISLNK(lastItem.Attrib))
|
|
1195
|
+
res = S_FALSE;
|
|
1196
|
+
}
|
|
1197
|
+
|
|
1198
|
+
// if (res == S_OK)
|
|
1199
|
+
{
|
|
1200
|
+
unsigned cryptoSize = 0;
|
|
1201
|
+
const int cryptoOffset = lastItem.FindExtra(NExtraID::kCrypto, cryptoSize);
|
|
1202
|
+
NCrypto::NRar5::CDecoder *crypto = NULL;
|
|
1203
|
+
if (cryptoOffset >= 0)
|
|
1204
|
+
{
|
|
1205
|
+
CCryptoInfo cryptoInfo;
|
|
1206
|
+
if (cryptoInfo.Parse(lastItem.Extra + (unsigned)cryptoOffset, cryptoSize))
|
|
1207
|
+
if (cryptoInfo.UseMAC())
|
|
1208
|
+
crypto = cryptoDecoder.ClsPtr();
|
|
1209
|
+
}
|
|
1210
|
+
if (NeedCrc)
|
|
1211
|
+
isCrcOK = outStream->_hash.Check(lastItem, crypto);
|
|
1212
|
+
}
|
|
1213
|
+
|
|
1214
|
+
if (linkFile)
|
|
1215
|
+
{
|
|
1216
|
+
linkFile->Res = res;
|
|
1217
|
+
linkFile->crcOK = isCrcOK;
|
|
1218
|
+
if (needBuf
|
|
1219
|
+
&& !lastItem.Is_UnknownSize()
|
|
1220
|
+
&& processedSize != lastItem.Size)
|
|
1221
|
+
linkFile->Data.ChangeSize_KeepData((size_t)processedSize, (size_t)processedSize);
|
|
1222
|
+
}
|
|
1223
|
+
|
|
1224
|
+
return res;
|
|
1225
|
+
}
|
|
1226
|
+
|
|
1227
|
+
|
|
1228
|
+
HRESULT CUnpacker::DecodeToBuf(DECL_EXTERNAL_CODECS_LOC_VARS
|
|
1229
|
+
const CItem &item, UInt64 packSize,
|
|
1230
|
+
ISequentialInStream *inStream,
|
|
1231
|
+
CByteBuffer &buffer)
|
|
1232
|
+
{
|
|
1233
|
+
CMyComPtr2_Create<ISequentialOutStream, CBufPtrSeqOutStream> out;
|
|
1234
|
+
_tempBuf.AllocAtLeast((size_t)item.Size);
|
|
1235
|
+
out->Init(_tempBuf, (size_t)item.Size);
|
|
1236
|
+
|
|
1237
|
+
bool wrongPassword;
|
|
1238
|
+
|
|
1239
|
+
if (item.IsSolid())
|
|
1240
|
+
return E_NOTIMPL;
|
|
1241
|
+
|
|
1242
|
+
HRESULT res = Create(EXTERNAL_CODECS_LOC_VARS item, item.IsSolid(), wrongPassword);
|
|
1243
|
+
|
|
1244
|
+
if (res == S_OK)
|
|
1245
|
+
{
|
|
1246
|
+
if (wrongPassword)
|
|
1247
|
+
return S_FALSE;
|
|
1248
|
+
|
|
1249
|
+
CMyComPtr2_Create<ISequentialInStream, CLimitedSequentialInStream> limitedStream;
|
|
1250
|
+
limitedStream->SetStream(inStream);
|
|
1251
|
+
limitedStream->Init(packSize);
|
|
1252
|
+
|
|
1253
|
+
bool crcOK = true;
|
|
1254
|
+
res = Code(item, item, packSize, limitedStream, out, NULL, crcOK);
|
|
1255
|
+
if (res == S_OK)
|
|
1256
|
+
{
|
|
1257
|
+
if (!crcOK || out->GetPos() != item.Size)
|
|
1258
|
+
res = S_FALSE;
|
|
1259
|
+
else
|
|
1260
|
+
buffer.CopyFrom(_tempBuf, (size_t)item.Size);
|
|
1261
|
+
}
|
|
1262
|
+
}
|
|
1263
|
+
|
|
1264
|
+
return res;
|
|
1265
|
+
}
|
|
1266
|
+
|
|
1267
|
+
|
|
1268
|
+
struct CTempBuf
|
|
1269
|
+
{
|
|
1270
|
+
CByteBuffer _buf;
|
|
1271
|
+
size_t _offset;
|
|
1272
|
+
bool _isOK;
|
|
1273
|
+
|
|
1274
|
+
void Clear()
|
|
1275
|
+
{
|
|
1276
|
+
_offset = 0;
|
|
1277
|
+
_isOK = true;
|
|
1278
|
+
}
|
|
1279
|
+
|
|
1280
|
+
CTempBuf() { Clear(); }
|
|
1281
|
+
|
|
1282
|
+
HRESULT Decode(DECL_EXTERNAL_CODECS_LOC_VARS
|
|
1283
|
+
const CItem &item,
|
|
1284
|
+
ISequentialInStream *inStream,
|
|
1285
|
+
CUnpacker &unpacker,
|
|
1286
|
+
CByteBuffer &destBuf);
|
|
1287
|
+
};
|
|
1288
|
+
|
|
1289
|
+
|
|
1290
|
+
HRESULT CTempBuf::Decode(DECL_EXTERNAL_CODECS_LOC_VARS
|
|
1291
|
+
const CItem &item,
|
|
1292
|
+
ISequentialInStream *inStream,
|
|
1293
|
+
CUnpacker &unpacker,
|
|
1294
|
+
CByteBuffer &destBuf)
|
|
1295
|
+
{
|
|
1296
|
+
const size_t kPackSize_Max = (1 << 24);
|
|
1297
|
+
if (item.Size > (1 << 24)
|
|
1298
|
+
|| item.Size == 0
|
|
1299
|
+
|| item.PackSize >= kPackSize_Max)
|
|
1300
|
+
{
|
|
1301
|
+
Clear();
|
|
1302
|
+
return S_OK;
|
|
1303
|
+
}
|
|
1304
|
+
|
|
1305
|
+
if (item.IsSplit() /* && _isOK */)
|
|
1306
|
+
{
|
|
1307
|
+
size_t packSize = (size_t)item.PackSize;
|
|
1308
|
+
if (packSize > kPackSize_Max - _offset)
|
|
1309
|
+
return S_OK;
|
|
1310
|
+
size_t newSize = _offset + packSize;
|
|
1311
|
+
if (newSize > _buf.Size())
|
|
1312
|
+
_buf.ChangeSize_KeepData(newSize, _offset);
|
|
1313
|
+
|
|
1314
|
+
Byte *data = (Byte *)_buf + _offset;
|
|
1315
|
+
RINOK(ReadStream_FALSE(inStream, data, packSize))
|
|
1316
|
+
|
|
1317
|
+
_offset += packSize;
|
|
1318
|
+
|
|
1319
|
+
if (item.IsSplitAfter())
|
|
1320
|
+
{
|
|
1321
|
+
CHash hash;
|
|
1322
|
+
hash.Init(item);
|
|
1323
|
+
hash.Update(data, packSize);
|
|
1324
|
+
_isOK = hash.Check(item, NULL); // RAR5 doesn't use HMAC for packed part
|
|
1325
|
+
}
|
|
1326
|
+
}
|
|
1327
|
+
|
|
1328
|
+
if (_isOK)
|
|
1329
|
+
{
|
|
1330
|
+
if (!item.IsSplitAfter())
|
|
1331
|
+
{
|
|
1332
|
+
if (_offset == 0)
|
|
1333
|
+
{
|
|
1334
|
+
RINOK(unpacker.DecodeToBuf(EXTERNAL_CODECS_LOC_VARS
|
|
1335
|
+
item, item.PackSize, inStream, destBuf))
|
|
1336
|
+
}
|
|
1337
|
+
else
|
|
1338
|
+
{
|
|
1339
|
+
CMyComPtr2_Create<ISequentialInStream, CBufInStream> bufInStream;
|
|
1340
|
+
bufInStream->Init(_buf, _offset);
|
|
1341
|
+
RINOK(unpacker.DecodeToBuf(EXTERNAL_CODECS_LOC_VARS
|
|
1342
|
+
item, _offset, bufInStream, destBuf))
|
|
1343
|
+
}
|
|
1344
|
+
}
|
|
1345
|
+
}
|
|
1346
|
+
|
|
1347
|
+
return S_OK;
|
|
1348
|
+
}
|
|
1349
|
+
|
|
1350
|
+
|
|
1351
|
+
|
|
1352
|
+
static const Byte kProps[] =
|
|
1353
|
+
{
|
|
1354
|
+
kpidPath,
|
|
1355
|
+
kpidIsDir,
|
|
1356
|
+
kpidSize,
|
|
1357
|
+
kpidPackSize,
|
|
1358
|
+
kpidMTime,
|
|
1359
|
+
kpidCTime,
|
|
1360
|
+
kpidATime,
|
|
1361
|
+
kpidAttrib,
|
|
1362
|
+
// kpidPosixAttrib, // for debug
|
|
1363
|
+
|
|
1364
|
+
kpidIsAltStream,
|
|
1365
|
+
kpidEncrypted,
|
|
1366
|
+
kpidSolid,
|
|
1367
|
+
kpidSplitBefore,
|
|
1368
|
+
kpidSplitAfter,
|
|
1369
|
+
kpidCRC,
|
|
1370
|
+
kpidHostOS,
|
|
1371
|
+
kpidMethod,
|
|
1372
|
+
kpidCharacts,
|
|
1373
|
+
kpidSymLink,
|
|
1374
|
+
kpidHardLink,
|
|
1375
|
+
kpidCopyLink,
|
|
1376
|
+
|
|
1377
|
+
kpidVolumeIndex
|
|
1378
|
+
};
|
|
1379
|
+
|
|
1380
|
+
|
|
1381
|
+
static const Byte kArcProps[] =
|
|
1382
|
+
{
|
|
1383
|
+
kpidTotalPhySize,
|
|
1384
|
+
kpidCharacts,
|
|
1385
|
+
kpidEncrypted,
|
|
1386
|
+
kpidSolid,
|
|
1387
|
+
kpidNumBlocks,
|
|
1388
|
+
kpidMethod,
|
|
1389
|
+
kpidIsVolume,
|
|
1390
|
+
kpidVolumeIndex,
|
|
1391
|
+
kpidNumVolumes,
|
|
1392
|
+
kpidName,
|
|
1393
|
+
kpidCTime,
|
|
1394
|
+
kpidComment
|
|
1395
|
+
};
|
|
1396
|
+
|
|
1397
|
+
|
|
1398
|
+
IMP_IInArchive_Props
|
|
1399
|
+
IMP_IInArchive_ArcProps
|
|
1400
|
+
|
|
1401
|
+
|
|
1402
|
+
UInt64 CHandler::GetPackSize(unsigned refIndex) const
|
|
1403
|
+
{
|
|
1404
|
+
UInt64 size = 0;
|
|
1405
|
+
unsigned index = _refs[refIndex].Item;
|
|
1406
|
+
for (;;)
|
|
1407
|
+
{
|
|
1408
|
+
const CItem &item = _items[index];
|
|
1409
|
+
size += item.PackSize;
|
|
1410
|
+
if (item.NextItem < 0)
|
|
1411
|
+
return size;
|
|
1412
|
+
index = (unsigned)item.NextItem;
|
|
1413
|
+
}
|
|
1414
|
+
}
|
|
1415
|
+
|
|
1416
|
+
static char *PrintDictSize(char *s Z7_lifetimebound, UInt64 w)
|
|
1417
|
+
{
|
|
1418
|
+
char c = 'K'; w >>= 10;
|
|
1419
|
+
if ((w & ((1 << 10) - 1)) == 0) { c = 'M'; w >>= 10;
|
|
1420
|
+
if ((w & ((1 << 10) - 1)) == 0) { c = 'G'; w >>= 10; }}
|
|
1421
|
+
s = ConvertUInt64ToString(w, s);
|
|
1422
|
+
*s++ = c;
|
|
1423
|
+
*s = 0;
|
|
1424
|
+
return s;
|
|
1425
|
+
}
|
|
1426
|
+
|
|
1427
|
+
|
|
1428
|
+
Z7_COM7F_IMF(CHandler::GetArchiveProperty(PROPID propID, PROPVARIANT *value))
|
|
1429
|
+
{
|
|
1430
|
+
COM_TRY_BEGIN
|
|
1431
|
+
|
|
1432
|
+
NCOM::CPropVariant prop;
|
|
1433
|
+
|
|
1434
|
+
const CInArcInfo *arcInfo = NULL;
|
|
1435
|
+
if (!_arcs.IsEmpty())
|
|
1436
|
+
arcInfo = &_arcs[0].Info;
|
|
1437
|
+
|
|
1438
|
+
switch (propID)
|
|
1439
|
+
{
|
|
1440
|
+
case kpidVolumeIndex: if (arcInfo && arcInfo->IsVolume()) prop = arcInfo->GetVolIndex(); break;
|
|
1441
|
+
case kpidSolid: if (arcInfo) prop = arcInfo->IsSolid(); break;
|
|
1442
|
+
case kpidCharacts:
|
|
1443
|
+
{
|
|
1444
|
+
AString s;
|
|
1445
|
+
if (arcInfo)
|
|
1446
|
+
{
|
|
1447
|
+
s = FlagsToString(k_ArcFlags, Z7_ARRAY_SIZE(k_ArcFlags), (UInt32)arcInfo->Flags);
|
|
1448
|
+
if (arcInfo->Extra_Error)
|
|
1449
|
+
s.Add_OptSpaced("Extra-ERROR");
|
|
1450
|
+
if (arcInfo->UnsupportedFeature)
|
|
1451
|
+
s.Add_OptSpaced("unsupported-feature");
|
|
1452
|
+
if (arcInfo->Metadata_Defined)
|
|
1453
|
+
{
|
|
1454
|
+
s.Add_OptSpaced("Metadata");
|
|
1455
|
+
if (arcInfo->Metadata_Error)
|
|
1456
|
+
s += "-ERROR";
|
|
1457
|
+
else
|
|
1458
|
+
{
|
|
1459
|
+
if (arcInfo->Metadata.Flags & NMetadataFlags::kArcName)
|
|
1460
|
+
s.Add_OptSpaced("arc-name");
|
|
1461
|
+
if (arcInfo->Metadata.Flags & NMetadataFlags::kCTime)
|
|
1462
|
+
{
|
|
1463
|
+
s.Add_OptSpaced("ctime-");
|
|
1464
|
+
s +=
|
|
1465
|
+
(arcInfo->Metadata.Flags & NMetadataFlags::kUnixTime) ?
|
|
1466
|
+
(arcInfo->Metadata.Flags & NMetadataFlags::kNanoSec) ?
|
|
1467
|
+
"1ns" : "1s" : "win";
|
|
1468
|
+
}
|
|
1469
|
+
}
|
|
1470
|
+
}
|
|
1471
|
+
if (arcInfo->Locator_Defined)
|
|
1472
|
+
{
|
|
1473
|
+
s.Add_OptSpaced("Locator");
|
|
1474
|
+
if (arcInfo->Locator_Error)
|
|
1475
|
+
s += "-ERROR";
|
|
1476
|
+
else
|
|
1477
|
+
{
|
|
1478
|
+
if (arcInfo->Locator.Is_QuickOpen())
|
|
1479
|
+
{
|
|
1480
|
+
s.Add_OptSpaced("QuickOpen:");
|
|
1481
|
+
s.Add_UInt64(arcInfo->Locator.QuickOpen);
|
|
1482
|
+
}
|
|
1483
|
+
if (arcInfo->Locator.Is_Recovery())
|
|
1484
|
+
{
|
|
1485
|
+
s.Add_OptSpaced("Recovery:");
|
|
1486
|
+
s.Add_UInt64(arcInfo->Locator.Recovery);
|
|
1487
|
+
}
|
|
1488
|
+
}
|
|
1489
|
+
}
|
|
1490
|
+
if (arcInfo->UnknownExtraRecord)
|
|
1491
|
+
s.Add_OptSpaced("Unknown-Extra-Record");
|
|
1492
|
+
|
|
1493
|
+
}
|
|
1494
|
+
if (_comment_WasUsedInArc)
|
|
1495
|
+
{
|
|
1496
|
+
s.Add_OptSpaced("Comment");
|
|
1497
|
+
// s.Add_UInt32((UInt32)_comment.Size());
|
|
1498
|
+
}
|
|
1499
|
+
//
|
|
1500
|
+
if (_acls.Size() != 0)
|
|
1501
|
+
{
|
|
1502
|
+
s.Add_OptSpaced("ACL");
|
|
1503
|
+
// s.Add_UInt32(_acls.Size());
|
|
1504
|
+
}
|
|
1505
|
+
if (!s.IsEmpty())
|
|
1506
|
+
prop = s;
|
|
1507
|
+
break;
|
|
1508
|
+
}
|
|
1509
|
+
case kpidEncrypted: if (arcInfo) prop = arcInfo->IsEncrypted; break; // it's for encrypted names.
|
|
1510
|
+
case kpidIsVolume: if (arcInfo) prop = arcInfo->IsVolume(); break;
|
|
1511
|
+
case kpidNumVolumes: prop = (UInt32)_arcs.Size(); break;
|
|
1512
|
+
case kpidOffset: if (arcInfo && arcInfo->StartPos != 0) prop = arcInfo->StartPos; break;
|
|
1513
|
+
|
|
1514
|
+
case kpidTotalPhySize:
|
|
1515
|
+
{
|
|
1516
|
+
if (_arcs.Size() > 1)
|
|
1517
|
+
{
|
|
1518
|
+
UInt64 sum = 0;
|
|
1519
|
+
FOR_VECTOR (v, _arcs)
|
|
1520
|
+
sum += _arcs[v].Info.GetPhySize();
|
|
1521
|
+
prop = sum;
|
|
1522
|
+
}
|
|
1523
|
+
break;
|
|
1524
|
+
}
|
|
1525
|
+
|
|
1526
|
+
case kpidPhySize:
|
|
1527
|
+
{
|
|
1528
|
+
if (arcInfo)
|
|
1529
|
+
prop = arcInfo->GetPhySize();
|
|
1530
|
+
break;
|
|
1531
|
+
}
|
|
1532
|
+
|
|
1533
|
+
case kpidName:
|
|
1534
|
+
if (arcInfo)
|
|
1535
|
+
if (!arcInfo->Metadata_Error
|
|
1536
|
+
&& !arcInfo->Metadata.ArcName.IsEmpty())
|
|
1537
|
+
{
|
|
1538
|
+
UString s;
|
|
1539
|
+
if (ConvertUTF8ToUnicode(arcInfo->Metadata.ArcName, s))
|
|
1540
|
+
prop = s;
|
|
1541
|
+
}
|
|
1542
|
+
break;
|
|
1543
|
+
|
|
1544
|
+
case kpidCTime:
|
|
1545
|
+
if (arcInfo)
|
|
1546
|
+
if (!arcInfo->Metadata_Error
|
|
1547
|
+
&& (arcInfo->Metadata.Flags & NMetadataFlags::kCTime))
|
|
1548
|
+
{
|
|
1549
|
+
const UInt64 ct = arcInfo->Metadata.CTime;
|
|
1550
|
+
if (arcInfo->Metadata.Flags & NMetadataFlags::kUnixTime)
|
|
1551
|
+
{
|
|
1552
|
+
if (arcInfo->Metadata.Flags & NMetadataFlags::kNanoSec)
|
|
1553
|
+
{
|
|
1554
|
+
const UInt64 sec = ct / 1000000000;
|
|
1555
|
+
const UInt64 ns = ct % 1000000000;
|
|
1556
|
+
UInt64 wt = NTime::UnixTime64_To_FileTime64((Int64)sec);
|
|
1557
|
+
wt += ns / 100;
|
|
1558
|
+
const unsigned ns100 = (unsigned)(ns % 100);
|
|
1559
|
+
FILETIME ft;
|
|
1560
|
+
ft.dwLowDateTime = (DWORD)(UInt32)wt;
|
|
1561
|
+
ft.dwHighDateTime = (DWORD)(UInt32)(wt >> 32);
|
|
1562
|
+
prop.SetAsTimeFrom_FT_Prec_Ns100(ft, k_PropVar_TimePrec_1ns, ns100);
|
|
1563
|
+
}
|
|
1564
|
+
else
|
|
1565
|
+
{
|
|
1566
|
+
const UInt64 wt = NTime::UnixTime64_To_FileTime64((Int64)ct);
|
|
1567
|
+
prop.SetAsTimeFrom_Ft64_Prec(wt, k_PropVar_TimePrec_Unix);
|
|
1568
|
+
}
|
|
1569
|
+
}
|
|
1570
|
+
else
|
|
1571
|
+
prop.SetAsTimeFrom_Ft64_Prec(ct, k_PropVar_TimePrec_100ns);
|
|
1572
|
+
}
|
|
1573
|
+
break;
|
|
1574
|
+
|
|
1575
|
+
case kpidComment:
|
|
1576
|
+
{
|
|
1577
|
+
// if (!_arcs.IsEmpty())
|
|
1578
|
+
{
|
|
1579
|
+
// const CArc &arc = _arcs[0];
|
|
1580
|
+
const CByteBuffer &cmt = _comment;
|
|
1581
|
+
if (cmt.Size() != 0 /* && cmt.Size() < (1 << 16) */)
|
|
1582
|
+
{
|
|
1583
|
+
AString s;
|
|
1584
|
+
s.SetFrom_CalcLen((const char *)(const Byte *)cmt, (unsigned)cmt.Size());
|
|
1585
|
+
UString unicode;
|
|
1586
|
+
ConvertUTF8ToUnicode(s, unicode);
|
|
1587
|
+
prop = unicode;
|
|
1588
|
+
}
|
|
1589
|
+
}
|
|
1590
|
+
break;
|
|
1591
|
+
}
|
|
1592
|
+
|
|
1593
|
+
case kpidNumBlocks:
|
|
1594
|
+
{
|
|
1595
|
+
prop = (UInt32)_numBlocks;
|
|
1596
|
+
break;
|
|
1597
|
+
}
|
|
1598
|
+
|
|
1599
|
+
case kpidMethod:
|
|
1600
|
+
{
|
|
1601
|
+
AString s;
|
|
1602
|
+
|
|
1603
|
+
UInt64 algo = _algo_Mask;
|
|
1604
|
+
for (unsigned v = 0; algo != 0; v++, algo >>= 1)
|
|
1605
|
+
{
|
|
1606
|
+
if ((algo & 1) == 0)
|
|
1607
|
+
continue;
|
|
1608
|
+
s.Add_OptSpaced("v");
|
|
1609
|
+
s.Add_UInt32(v + 6);
|
|
1610
|
+
if (v < Z7_ARRAY_SIZE(_methodMasks))
|
|
1611
|
+
{
|
|
1612
|
+
const UInt64 dict = _dictMaxSizes[v];
|
|
1613
|
+
if (dict)
|
|
1614
|
+
{
|
|
1615
|
+
char temp[24];
|
|
1616
|
+
temp[0] = ':';
|
|
1617
|
+
PrintDictSize(temp + 1, dict);
|
|
1618
|
+
s += temp;
|
|
1619
|
+
}
|
|
1620
|
+
unsigned method = _methodMasks[v];
|
|
1621
|
+
for (unsigned m = 0; method; m++, method >>= 1)
|
|
1622
|
+
{
|
|
1623
|
+
if ((method & 1) == 0)
|
|
1624
|
+
continue;
|
|
1625
|
+
s += ":m";
|
|
1626
|
+
s.Add_UInt32(m);
|
|
1627
|
+
}
|
|
1628
|
+
}
|
|
1629
|
+
}
|
|
1630
|
+
if (_rar5comapt_mask & 2)
|
|
1631
|
+
{
|
|
1632
|
+
s += ":c";
|
|
1633
|
+
if (_rar5comapt_mask & 1)
|
|
1634
|
+
s.Add_Char('n');
|
|
1635
|
+
}
|
|
1636
|
+
prop = s;
|
|
1637
|
+
break;
|
|
1638
|
+
}
|
|
1639
|
+
|
|
1640
|
+
case kpidError:
|
|
1641
|
+
{
|
|
1642
|
+
if (/* &_missingVol || */ !_missingVolName.IsEmpty())
|
|
1643
|
+
{
|
|
1644
|
+
UString s ("Missing volume : ");
|
|
1645
|
+
s += _missingVolName;
|
|
1646
|
+
prop = s;
|
|
1647
|
+
}
|
|
1648
|
+
break;
|
|
1649
|
+
}
|
|
1650
|
+
|
|
1651
|
+
case kpidErrorFlags:
|
|
1652
|
+
{
|
|
1653
|
+
UInt32 v = _errorFlags;
|
|
1654
|
+
if (!_isArc)
|
|
1655
|
+
v |= kpv_ErrorFlags_IsNotArc;
|
|
1656
|
+
if (_error_in_ACL)
|
|
1657
|
+
v |= kpv_ErrorFlags_HeadersError;
|
|
1658
|
+
if (_split_Error)
|
|
1659
|
+
v |= kpv_ErrorFlags_HeadersError;
|
|
1660
|
+
prop = v;
|
|
1661
|
+
break;
|
|
1662
|
+
}
|
|
1663
|
+
|
|
1664
|
+
/*
|
|
1665
|
+
case kpidWarningFlags:
|
|
1666
|
+
{
|
|
1667
|
+
if (_warningFlags != 0)
|
|
1668
|
+
prop = _warningFlags;
|
|
1669
|
+
break;
|
|
1670
|
+
}
|
|
1671
|
+
*/
|
|
1672
|
+
|
|
1673
|
+
case kpidExtension:
|
|
1674
|
+
if (_arcs.Size() == 1)
|
|
1675
|
+
{
|
|
1676
|
+
if (arcInfo && arcInfo->IsVolume())
|
|
1677
|
+
{
|
|
1678
|
+
AString s ("part");
|
|
1679
|
+
UInt32 v = (UInt32)arcInfo->GetVolIndex() + 1;
|
|
1680
|
+
if (v < 10)
|
|
1681
|
+
s.Add_Char('0');
|
|
1682
|
+
s.Add_UInt32(v);
|
|
1683
|
+
s += ".rar";
|
|
1684
|
+
prop = s;
|
|
1685
|
+
}
|
|
1686
|
+
}
|
|
1687
|
+
break;
|
|
1688
|
+
|
|
1689
|
+
case kpidIsAltStream: prop = true; break;
|
|
1690
|
+
}
|
|
1691
|
+
|
|
1692
|
+
prop.Detach(value);
|
|
1693
|
+
return S_OK;
|
|
1694
|
+
|
|
1695
|
+
COM_TRY_END
|
|
1696
|
+
}
|
|
1697
|
+
|
|
1698
|
+
|
|
1699
|
+
Z7_COM7F_IMF(CHandler::GetNumberOfItems(UInt32 *numItems))
|
|
1700
|
+
{
|
|
1701
|
+
*numItems = (UInt32)_refs.Size();
|
|
1702
|
+
return S_OK;
|
|
1703
|
+
}
|
|
1704
|
+
|
|
1705
|
+
|
|
1706
|
+
static const Byte kRawProps[] =
|
|
1707
|
+
{
|
|
1708
|
+
kpidChecksum,
|
|
1709
|
+
kpidNtSecure
|
|
1710
|
+
};
|
|
1711
|
+
|
|
1712
|
+
|
|
1713
|
+
Z7_COM7F_IMF(CHandler::GetNumRawProps(UInt32 *numProps))
|
|
1714
|
+
{
|
|
1715
|
+
*numProps = Z7_ARRAY_SIZE(kRawProps);
|
|
1716
|
+
return S_OK;
|
|
1717
|
+
}
|
|
1718
|
+
|
|
1719
|
+
Z7_COM7F_IMF(CHandler::GetRawPropInfo(UInt32 index, BSTR *name, PROPID *propID))
|
|
1720
|
+
{
|
|
1721
|
+
*propID = kRawProps[index];
|
|
1722
|
+
*name = NULL;
|
|
1723
|
+
return S_OK;
|
|
1724
|
+
}
|
|
1725
|
+
|
|
1726
|
+
Z7_COM7F_IMF(CHandler::GetParent(UInt32 index, UInt32 *parent, UInt32 *parentType))
|
|
1727
|
+
{
|
|
1728
|
+
*parentType = NParentType::kDir;
|
|
1729
|
+
*parent = (UInt32)(Int32)-1;
|
|
1730
|
+
|
|
1731
|
+
if (index >= _refs.Size())
|
|
1732
|
+
return S_OK;
|
|
1733
|
+
|
|
1734
|
+
const CRefItem &ref = _refs[index];
|
|
1735
|
+
const CItem &item = _items[ref.Item];
|
|
1736
|
+
|
|
1737
|
+
if (item.Is_STM() && ref.Parent >= 0)
|
|
1738
|
+
{
|
|
1739
|
+
*parent = (UInt32)ref.Parent;
|
|
1740
|
+
*parentType = NParentType::kAltStream;
|
|
1741
|
+
}
|
|
1742
|
+
|
|
1743
|
+
return S_OK;
|
|
1744
|
+
}
|
|
1745
|
+
|
|
1746
|
+
|
|
1747
|
+
Z7_COM7F_IMF(CHandler::GetRawProp(UInt32 index, PROPID propID, const void **data, UInt32 *dataSize, UInt32 *propType))
|
|
1748
|
+
{
|
|
1749
|
+
*data = NULL;
|
|
1750
|
+
*dataSize = 0;
|
|
1751
|
+
*propType = 0;
|
|
1752
|
+
|
|
1753
|
+
if (index >= _refs.Size())
|
|
1754
|
+
return E_INVALIDARG;
|
|
1755
|
+
|
|
1756
|
+
const CItem &item = _items[_refs[index].Item];
|
|
1757
|
+
|
|
1758
|
+
if (propID == kpidNtSecure)
|
|
1759
|
+
{
|
|
1760
|
+
if (item.ACL >= 0)
|
|
1761
|
+
{
|
|
1762
|
+
const CByteBuffer &buf = _acls[item.ACL];
|
|
1763
|
+
*dataSize = (UInt32)buf.Size();
|
|
1764
|
+
*propType = NPropDataType::kRaw;
|
|
1765
|
+
*data = (const Byte *)buf;
|
|
1766
|
+
}
|
|
1767
|
+
return S_OK;
|
|
1768
|
+
}
|
|
1769
|
+
|
|
1770
|
+
if (propID == kpidChecksum)
|
|
1771
|
+
{
|
|
1772
|
+
const int hashRecOffset = item.FindExtra_Blake();
|
|
1773
|
+
if (hashRecOffset >= 0)
|
|
1774
|
+
{
|
|
1775
|
+
*dataSize = Z7_BLAKE2S_DIGEST_SIZE;
|
|
1776
|
+
*propType = NPropDataType::kRaw;
|
|
1777
|
+
*data = item.Extra + (unsigned)hashRecOffset;
|
|
1778
|
+
}
|
|
1779
|
+
/*
|
|
1780
|
+
else if (item.Has_CRC() && item.IsEncrypted())
|
|
1781
|
+
{
|
|
1782
|
+
*dataSize = 4;
|
|
1783
|
+
*propType = NPropDataType::kRaw;
|
|
1784
|
+
*data = &item->CRC; // we must show same value for big/little endian here
|
|
1785
|
+
}
|
|
1786
|
+
*/
|
|
1787
|
+
return S_OK;
|
|
1788
|
+
}
|
|
1789
|
+
|
|
1790
|
+
return S_OK;
|
|
1791
|
+
}
|
|
1792
|
+
|
|
1793
|
+
|
|
1794
|
+
static void TimeRecordToProp(const CItem &item, unsigned stampIndex, NCOM::CPropVariant &prop)
|
|
1795
|
+
{
|
|
1796
|
+
unsigned size;
|
|
1797
|
+
const int offset = item.FindExtra(NExtraID::kTime, size);
|
|
1798
|
+
if (offset < 0)
|
|
1799
|
+
return;
|
|
1800
|
+
|
|
1801
|
+
const Byte *p = item.Extra + (unsigned)offset;
|
|
1802
|
+
UInt64 flags;
|
|
1803
|
+
// PARSE_VAR_INT(p, size, flags)
|
|
1804
|
+
{
|
|
1805
|
+
const unsigned num = ReadVarInt(p, size, &flags);
|
|
1806
|
+
if (num == 0)
|
|
1807
|
+
return;
|
|
1808
|
+
p += num;
|
|
1809
|
+
size -= num;
|
|
1810
|
+
}
|
|
1811
|
+
|
|
1812
|
+
if (((UInt32)flags & (NTimeRecord::NFlags::kMTime << stampIndex)) == 0)
|
|
1813
|
+
return;
|
|
1814
|
+
|
|
1815
|
+
unsigned numStamps = 0;
|
|
1816
|
+
unsigned curStamp = 0;
|
|
1817
|
+
|
|
1818
|
+
for (unsigned i = 0; i < 3; i++)
|
|
1819
|
+
if (((UInt32)flags & (NTimeRecord::NFlags::kMTime << i)) != 0)
|
|
1820
|
+
{
|
|
1821
|
+
if (i == stampIndex)
|
|
1822
|
+
curStamp = numStamps;
|
|
1823
|
+
numStamps++;
|
|
1824
|
+
}
|
|
1825
|
+
|
|
1826
|
+
FILETIME ft;
|
|
1827
|
+
|
|
1828
|
+
unsigned timePrec = 0;
|
|
1829
|
+
unsigned ns100 = 0;
|
|
1830
|
+
|
|
1831
|
+
if ((flags & NTimeRecord::NFlags::kUnixTime) != 0)
|
|
1832
|
+
{
|
|
1833
|
+
curStamp *= 4;
|
|
1834
|
+
if (curStamp + 4 > size)
|
|
1835
|
+
return;
|
|
1836
|
+
p += curStamp;
|
|
1837
|
+
UInt64 val = NTime::UnixTime_To_FileTime64(Get32(p));
|
|
1838
|
+
numStamps *= 4;
|
|
1839
|
+
timePrec = k_PropVar_TimePrec_Unix;
|
|
1840
|
+
if ((flags & NTimeRecord::NFlags::kUnixNs) != 0 && numStamps * 2 <= size)
|
|
1841
|
+
{
|
|
1842
|
+
const UInt32 ns = Get32(p + numStamps) & 0x3FFFFFFF;
|
|
1843
|
+
if (ns < 1000000000)
|
|
1844
|
+
{
|
|
1845
|
+
val += ns / 100;
|
|
1846
|
+
ns100 = (unsigned)(ns % 100);
|
|
1847
|
+
timePrec = k_PropVar_TimePrec_1ns;
|
|
1848
|
+
}
|
|
1849
|
+
}
|
|
1850
|
+
ft.dwLowDateTime = (DWORD)val;
|
|
1851
|
+
ft.dwHighDateTime = (DWORD)(val >> 32);
|
|
1852
|
+
}
|
|
1853
|
+
else
|
|
1854
|
+
{
|
|
1855
|
+
curStamp *= 8;
|
|
1856
|
+
if (curStamp + 8 > size)
|
|
1857
|
+
return;
|
|
1858
|
+
p += curStamp;
|
|
1859
|
+
ft.dwLowDateTime = Get32(p);
|
|
1860
|
+
ft.dwHighDateTime = Get32(p + 4);
|
|
1861
|
+
}
|
|
1862
|
+
|
|
1863
|
+
prop.SetAsTimeFrom_FT_Prec_Ns100(ft, timePrec, ns100);
|
|
1864
|
+
}
|
|
1865
|
+
|
|
1866
|
+
|
|
1867
|
+
Z7_COM7F_IMF(CHandler::GetProperty(UInt32 index, PROPID propID, PROPVARIANT *value))
|
|
1868
|
+
{
|
|
1869
|
+
COM_TRY_BEGIN
|
|
1870
|
+
|
|
1871
|
+
NCOM::CPropVariant prop;
|
|
1872
|
+
const CRefItem &ref = _refs[index];
|
|
1873
|
+
const CItem &item = _items[ref.Item];
|
|
1874
|
+
const CItem &lastItem = _items[ref.Last];
|
|
1875
|
+
|
|
1876
|
+
switch (propID)
|
|
1877
|
+
{
|
|
1878
|
+
case kpidPath:
|
|
1879
|
+
{
|
|
1880
|
+
UString unicodeName;
|
|
1881
|
+
|
|
1882
|
+
if (item.Is_STM())
|
|
1883
|
+
{
|
|
1884
|
+
AString s;
|
|
1885
|
+
if (ref.Parent >= 0)
|
|
1886
|
+
{
|
|
1887
|
+
const CItem &mainItem = _items[_refs[ref.Parent].Item];
|
|
1888
|
+
s = mainItem.Name;
|
|
1889
|
+
}
|
|
1890
|
+
|
|
1891
|
+
AString name;
|
|
1892
|
+
item.GetAltStreamName(name);
|
|
1893
|
+
if (name[0] != ':')
|
|
1894
|
+
s.Add_Colon();
|
|
1895
|
+
s += name;
|
|
1896
|
+
ConvertUTF8ToUnicode(s, unicodeName);
|
|
1897
|
+
}
|
|
1898
|
+
else
|
|
1899
|
+
{
|
|
1900
|
+
ConvertUTF8ToUnicode(item.Name, unicodeName);
|
|
1901
|
+
|
|
1902
|
+
if (item.Version_Defined)
|
|
1903
|
+
{
|
|
1904
|
+
char temp[32];
|
|
1905
|
+
// temp[0] = ';';
|
|
1906
|
+
// ConvertUInt64ToString(item.Version, temp + 1);
|
|
1907
|
+
// unicodeName += temp;
|
|
1908
|
+
ConvertUInt64ToString(item.Version, temp);
|
|
1909
|
+
UString s2 ("[VER]" STRING_PATH_SEPARATOR);
|
|
1910
|
+
s2 += temp;
|
|
1911
|
+
s2.Add_PathSepar();
|
|
1912
|
+
unicodeName.Insert(0, s2);
|
|
1913
|
+
}
|
|
1914
|
+
}
|
|
1915
|
+
|
|
1916
|
+
NItemName::ReplaceToOsSlashes_Remove_TailSlash(unicodeName);
|
|
1917
|
+
prop = unicodeName;
|
|
1918
|
+
|
|
1919
|
+
break;
|
|
1920
|
+
}
|
|
1921
|
+
|
|
1922
|
+
case kpidIsDir: prop = item.IsDir(); break;
|
|
1923
|
+
case kpidSize: if (!lastItem.Is_UnknownSize()) prop = lastItem.Size; break;
|
|
1924
|
+
case kpidPackSize: prop = GetPackSize((unsigned)index); break;
|
|
1925
|
+
|
|
1926
|
+
case kpidMTime:
|
|
1927
|
+
{
|
|
1928
|
+
TimeRecordToProp(item, NTimeRecord::k_Index_MTime, prop);
|
|
1929
|
+
if (prop.vt == VT_EMPTY && item.Has_UnixMTime())
|
|
1930
|
+
PropVariant_SetFrom_UnixTime(prop, item.UnixMTime);
|
|
1931
|
+
if (prop.vt == VT_EMPTY && ref.Parent >= 0)
|
|
1932
|
+
{
|
|
1933
|
+
const CItem &baseItem = _items[_refs[ref.Parent].Item];
|
|
1934
|
+
TimeRecordToProp(baseItem, NTimeRecord::k_Index_MTime, prop);
|
|
1935
|
+
if (prop.vt == VT_EMPTY && baseItem.Has_UnixMTime())
|
|
1936
|
+
PropVariant_SetFrom_UnixTime(prop, baseItem.UnixMTime);
|
|
1937
|
+
}
|
|
1938
|
+
break;
|
|
1939
|
+
}
|
|
1940
|
+
case kpidCTime: TimeRecordToProp(item, NTimeRecord::k_Index_CTime, prop); break;
|
|
1941
|
+
case kpidATime: TimeRecordToProp(item, NTimeRecord::k_Index_ATime, prop); break;
|
|
1942
|
+
|
|
1943
|
+
case kpidName:
|
|
1944
|
+
{
|
|
1945
|
+
if (item.Is_STM())
|
|
1946
|
+
{
|
|
1947
|
+
AString name;
|
|
1948
|
+
item.GetAltStreamName(name);
|
|
1949
|
+
if (name[0] == ':')
|
|
1950
|
+
{
|
|
1951
|
+
name.DeleteFrontal(1);
|
|
1952
|
+
UString unicodeName;
|
|
1953
|
+
ConvertUTF8ToUnicode(name, unicodeName);
|
|
1954
|
+
prop = unicodeName;
|
|
1955
|
+
}
|
|
1956
|
+
}
|
|
1957
|
+
break;
|
|
1958
|
+
}
|
|
1959
|
+
|
|
1960
|
+
case kpidIsAltStream: prop = item.Is_STM(); break;
|
|
1961
|
+
|
|
1962
|
+
case kpidSymLink: item.Link_to_Prop(NLinkType::kUnixSymLink, prop); break;
|
|
1963
|
+
case kpidHardLink: item.Link_to_Prop(NLinkType::kHardLink, prop); break;
|
|
1964
|
+
case kpidCopyLink: item.Link_to_Prop(NLinkType::kFileCopy, prop); break;
|
|
1965
|
+
|
|
1966
|
+
case kpidAttrib: prop = item.GetWinAttrib(); break;
|
|
1967
|
+
case kpidPosixAttrib:
|
|
1968
|
+
if (item.HostOS == kHost_Unix)
|
|
1969
|
+
prop = (UInt32)item.Attrib;
|
|
1970
|
+
break;
|
|
1971
|
+
|
|
1972
|
+
case kpidEncrypted: prop = item.IsEncrypted(); break;
|
|
1973
|
+
case kpidSolid: prop = item.IsSolid(); break;
|
|
1974
|
+
|
|
1975
|
+
case kpidSplitBefore: prop = item.IsSplitBefore(); break;
|
|
1976
|
+
case kpidSplitAfter: prop = lastItem.IsSplitAfter(); break;
|
|
1977
|
+
|
|
1978
|
+
case kpidVolumeIndex:
|
|
1979
|
+
{
|
|
1980
|
+
if (item.VolIndex < _arcs.Size())
|
|
1981
|
+
{
|
|
1982
|
+
const CInArcInfo &arcInfo = _arcs[item.VolIndex].Info;
|
|
1983
|
+
if (arcInfo.IsVolume())
|
|
1984
|
+
prop = (UInt64)arcInfo.GetVolIndex();
|
|
1985
|
+
}
|
|
1986
|
+
break;
|
|
1987
|
+
}
|
|
1988
|
+
|
|
1989
|
+
case kpidCRC:
|
|
1990
|
+
{
|
|
1991
|
+
const CItem *item2 = (lastItem.IsSplitAfter() ? &item : &lastItem);
|
|
1992
|
+
// we don't want to show crc for encrypted file here,
|
|
1993
|
+
// because crc is also encrrypted.
|
|
1994
|
+
if (item2->Has_CRC() && !item2->IsEncrypted())
|
|
1995
|
+
prop = item2->CRC;
|
|
1996
|
+
break;
|
|
1997
|
+
}
|
|
1998
|
+
|
|
1999
|
+
case kpidMethod:
|
|
2000
|
+
{
|
|
2001
|
+
char temp[128];
|
|
2002
|
+
const unsigned algo = item.Get_AlgoVersion_RawBits();
|
|
2003
|
+
char *s = temp;
|
|
2004
|
+
// if (algo != 0)
|
|
2005
|
+
{
|
|
2006
|
+
*s++ = 'v';
|
|
2007
|
+
s = ConvertUInt32ToString((UInt32)algo + 6, s);
|
|
2008
|
+
if (item.Is_Rar5_Compat())
|
|
2009
|
+
*s++ = 'c';
|
|
2010
|
+
*s++ = ':';
|
|
2011
|
+
}
|
|
2012
|
+
{
|
|
2013
|
+
const unsigned m = item.Get_Method();
|
|
2014
|
+
*s++ = 'm';
|
|
2015
|
+
*s++ = (char)(m + '0');
|
|
2016
|
+
if (!item.IsDir())
|
|
2017
|
+
{
|
|
2018
|
+
*s++ = ':';
|
|
2019
|
+
const unsigned dictMain = item.Get_DictSize_Main();
|
|
2020
|
+
const unsigned frac = item.Get_DictSize_Frac();
|
|
2021
|
+
/*
|
|
2022
|
+
if (frac == 0 && algo == 0)
|
|
2023
|
+
s = ConvertUInt32ToString(dictMain + 17, s);
|
|
2024
|
+
else
|
|
2025
|
+
*/
|
|
2026
|
+
s = PrintDictSize(s, (UInt64)(32 + frac) << (12 + dictMain));
|
|
2027
|
+
if (item.Is_Rar5_Compat())
|
|
2028
|
+
{
|
|
2029
|
+
*s++ = ':';
|
|
2030
|
+
*s++ = 'c';
|
|
2031
|
+
}
|
|
2032
|
+
}
|
|
2033
|
+
}
|
|
2034
|
+
unsigned cryptoSize = 0;
|
|
2035
|
+
const int cryptoOffset = item.FindExtra(NExtraID::kCrypto, cryptoSize);
|
|
2036
|
+
if (cryptoOffset >= 0)
|
|
2037
|
+
{
|
|
2038
|
+
*s++ = ' ';
|
|
2039
|
+
CCryptoInfo cryptoInfo;
|
|
2040
|
+
const bool isOK = cryptoInfo.Parse(item.Extra + (unsigned)cryptoOffset, cryptoSize);
|
|
2041
|
+
if (cryptoInfo.Algo == 0)
|
|
2042
|
+
s = MyStpCpy(s, "AES");
|
|
2043
|
+
else
|
|
2044
|
+
{
|
|
2045
|
+
s = MyStpCpy(s, "Crypto_");
|
|
2046
|
+
s = ConvertUInt64ToString(cryptoInfo.Algo, s);
|
|
2047
|
+
}
|
|
2048
|
+
if (isOK)
|
|
2049
|
+
{
|
|
2050
|
+
*s++ = ':';
|
|
2051
|
+
s = ConvertUInt32ToString(cryptoInfo.Cnt, s);
|
|
2052
|
+
*s++ = ':';
|
|
2053
|
+
s = ConvertUInt64ToString(cryptoInfo.Flags, s);
|
|
2054
|
+
}
|
|
2055
|
+
}
|
|
2056
|
+
*s = 0;
|
|
2057
|
+
prop = temp;
|
|
2058
|
+
break;
|
|
2059
|
+
}
|
|
2060
|
+
|
|
2061
|
+
case kpidCharacts:
|
|
2062
|
+
{
|
|
2063
|
+
AString s;
|
|
2064
|
+
|
|
2065
|
+
if (item.ACL >= 0)
|
|
2066
|
+
s.Add_OptSpaced("ACL");
|
|
2067
|
+
|
|
2068
|
+
const UInt32 flags = item.Flags;
|
|
2069
|
+
if (flags != 0)
|
|
2070
|
+
{
|
|
2071
|
+
const AString s2 = FlagsToString(k_FileFlags, Z7_ARRAY_SIZE(k_FileFlags), flags);
|
|
2072
|
+
if (!s2.IsEmpty())
|
|
2073
|
+
s.Add_OptSpaced(s2);
|
|
2074
|
+
}
|
|
2075
|
+
|
|
2076
|
+
item.PrintInfo(s);
|
|
2077
|
+
|
|
2078
|
+
if (!s.IsEmpty())
|
|
2079
|
+
prop = s;
|
|
2080
|
+
break;
|
|
2081
|
+
}
|
|
2082
|
+
|
|
2083
|
+
|
|
2084
|
+
case kpidHostOS:
|
|
2085
|
+
if (item.HostOS < Z7_ARRAY_SIZE(kHostOS))
|
|
2086
|
+
prop = kHostOS[(size_t)item.HostOS];
|
|
2087
|
+
else
|
|
2088
|
+
prop = (UInt64)item.HostOS;
|
|
2089
|
+
break;
|
|
2090
|
+
}
|
|
2091
|
+
|
|
2092
|
+
prop.Detach(value);
|
|
2093
|
+
return S_OK;
|
|
2094
|
+
|
|
2095
|
+
COM_TRY_END
|
|
2096
|
+
}
|
|
2097
|
+
|
|
2098
|
+
|
|
2099
|
+
|
|
2100
|
+
// ---------- Copy Links ----------
|
|
2101
|
+
|
|
2102
|
+
static int CompareItemsPaths(const CHandler &handler, unsigned p1, unsigned p2, const AString *name1)
|
|
2103
|
+
{
|
|
2104
|
+
const CItem &item1 = handler._items[handler._refs[p1].Item];
|
|
2105
|
+
const CItem &item2 = handler._items[handler._refs[p2].Item];
|
|
2106
|
+
|
|
2107
|
+
if (item1.Version_Defined)
|
|
2108
|
+
{
|
|
2109
|
+
if (!item2.Version_Defined)
|
|
2110
|
+
return -1;
|
|
2111
|
+
const int res = MyCompare(item1.Version, item2.Version);
|
|
2112
|
+
if (res != 0)
|
|
2113
|
+
return res;
|
|
2114
|
+
}
|
|
2115
|
+
else if (item2.Version_Defined)
|
|
2116
|
+
return 1;
|
|
2117
|
+
|
|
2118
|
+
if (!name1)
|
|
2119
|
+
name1 = &item1.Name;
|
|
2120
|
+
return strcmp(*name1, item2.Name);
|
|
2121
|
+
}
|
|
2122
|
+
|
|
2123
|
+
static int CompareItemsPaths2(const CHandler &handler, unsigned p1, unsigned p2, const AString *name1)
|
|
2124
|
+
{
|
|
2125
|
+
const int res = CompareItemsPaths(handler, p1, p2, name1);
|
|
2126
|
+
if (res != 0)
|
|
2127
|
+
return res;
|
|
2128
|
+
return MyCompare(p1, p2);
|
|
2129
|
+
}
|
|
2130
|
+
|
|
2131
|
+
static int CompareItemsPaths_Sort(const unsigned *p1, const unsigned *p2, void *param)
|
|
2132
|
+
{
|
|
2133
|
+
return CompareItemsPaths2(*(const CHandler *)param, *p1, *p2, NULL);
|
|
2134
|
+
}
|
|
2135
|
+
|
|
2136
|
+
static int FindLink(const CHandler &handler, const CUIntVector &sorted,
|
|
2137
|
+
const AString &s, unsigned index)
|
|
2138
|
+
{
|
|
2139
|
+
unsigned left = 0, right = sorted.Size();
|
|
2140
|
+
for (;;)
|
|
2141
|
+
{
|
|
2142
|
+
if (left == right)
|
|
2143
|
+
{
|
|
2144
|
+
if (left > 0)
|
|
2145
|
+
{
|
|
2146
|
+
const unsigned refIndex = sorted[left - 1];
|
|
2147
|
+
if (CompareItemsPaths(handler, index, refIndex, &s) == 0)
|
|
2148
|
+
return (int)refIndex;
|
|
2149
|
+
}
|
|
2150
|
+
if (right < sorted.Size())
|
|
2151
|
+
{
|
|
2152
|
+
const unsigned refIndex = sorted[right];
|
|
2153
|
+
if (CompareItemsPaths(handler, index, refIndex, &s) == 0)
|
|
2154
|
+
return (int)refIndex;
|
|
2155
|
+
}
|
|
2156
|
+
return -1;
|
|
2157
|
+
}
|
|
2158
|
+
|
|
2159
|
+
const unsigned mid = (left + right) / 2;
|
|
2160
|
+
const unsigned refIndex = sorted[mid];
|
|
2161
|
+
const int compare = CompareItemsPaths2(handler, index, refIndex, &s);
|
|
2162
|
+
if (compare == 0)
|
|
2163
|
+
return (int)refIndex;
|
|
2164
|
+
if (compare < 0)
|
|
2165
|
+
right = mid;
|
|
2166
|
+
else
|
|
2167
|
+
left = mid + 1;
|
|
2168
|
+
}
|
|
2169
|
+
}
|
|
2170
|
+
|
|
2171
|
+
void CHandler::FillLinks()
|
|
2172
|
+
{
|
|
2173
|
+
unsigned i;
|
|
2174
|
+
|
|
2175
|
+
bool need_FillLinks = false;
|
|
2176
|
+
|
|
2177
|
+
for (i = 0; i < _refs.Size(); i++)
|
|
2178
|
+
{
|
|
2179
|
+
const CItem &item = _items[_refs[i].Item];
|
|
2180
|
+
if (!item.IsDir()
|
|
2181
|
+
&& !item.IsService()
|
|
2182
|
+
&& item.NeedUse_as_CopyLink())
|
|
2183
|
+
need_FillLinks = true;
|
|
2184
|
+
|
|
2185
|
+
if (!item.IsSolid())
|
|
2186
|
+
_numBlocks++;
|
|
2187
|
+
|
|
2188
|
+
const unsigned algo = item.Get_AlgoVersion_RawBits();
|
|
2189
|
+
_algo_Mask |= (UInt64)1 << algo;
|
|
2190
|
+
_rar5comapt_mask |= 1u << item.Get_Rar5_CompatBit();
|
|
2191
|
+
if (!item.IsDir() && algo < Z7_ARRAY_SIZE(_methodMasks))
|
|
2192
|
+
{
|
|
2193
|
+
_methodMasks[algo] |= 1u << (item.Get_Method());
|
|
2194
|
+
UInt64 d = 32 + item.Get_DictSize_Frac();
|
|
2195
|
+
d <<= (12 + item.Get_DictSize_Main());
|
|
2196
|
+
if (_dictMaxSizes[algo] < d)
|
|
2197
|
+
_dictMaxSizes[algo] = d;
|
|
2198
|
+
}
|
|
2199
|
+
}
|
|
2200
|
+
|
|
2201
|
+
if (!need_FillLinks)
|
|
2202
|
+
return;
|
|
2203
|
+
|
|
2204
|
+
CUIntVector sorted;
|
|
2205
|
+
for (i = 0; i < _refs.Size(); i++)
|
|
2206
|
+
{
|
|
2207
|
+
const CItem &item = _items[_refs[i].Item];
|
|
2208
|
+
if (!item.IsDir() && !item.IsService())
|
|
2209
|
+
sorted.Add(i);
|
|
2210
|
+
}
|
|
2211
|
+
|
|
2212
|
+
if (sorted.IsEmpty())
|
|
2213
|
+
return;
|
|
2214
|
+
|
|
2215
|
+
sorted.Sort(CompareItemsPaths_Sort, (void *)this);
|
|
2216
|
+
|
|
2217
|
+
AString link;
|
|
2218
|
+
|
|
2219
|
+
for (i = 0; i < _refs.Size(); i++)
|
|
2220
|
+
{
|
|
2221
|
+
CRefItem &ref = _refs[i];
|
|
2222
|
+
const CItem &item = _items[ref.Item];
|
|
2223
|
+
if (item.IsDir() || item.IsService() || item.PackSize != 0)
|
|
2224
|
+
continue;
|
|
2225
|
+
CLinkInfo linkInfo;
|
|
2226
|
+
if (!item.FindExtra_Link(linkInfo) || linkInfo.Type != NLinkType::kFileCopy)
|
|
2227
|
+
continue;
|
|
2228
|
+
link.SetFrom_CalcLen((const char *)(item.Extra + linkInfo.NameOffset), linkInfo.NameLen);
|
|
2229
|
+
const int linkIndex = FindLink(*this, sorted, link, i);
|
|
2230
|
+
if (linkIndex < 0)
|
|
2231
|
+
continue;
|
|
2232
|
+
if ((unsigned)linkIndex >= i)
|
|
2233
|
+
continue; // we don't support forward links that can lead to loops
|
|
2234
|
+
const CRefItem &linkRef = _refs[linkIndex];
|
|
2235
|
+
const CItem &linkItem = _items[linkRef.Item];
|
|
2236
|
+
if (linkItem.Size == item.Size)
|
|
2237
|
+
{
|
|
2238
|
+
if (linkRef.Link >= 0)
|
|
2239
|
+
ref.Link = linkRef.Link;
|
|
2240
|
+
else if (!linkItem.NeedUse_as_CopyLink())
|
|
2241
|
+
ref.Link = linkIndex;
|
|
2242
|
+
}
|
|
2243
|
+
}
|
|
2244
|
+
}
|
|
2245
|
+
|
|
2246
|
+
|
|
2247
|
+
|
|
2248
|
+
HRESULT CHandler::Open2(IInStream *stream,
|
|
2249
|
+
const UInt64 *maxCheckStartPosition,
|
|
2250
|
+
IArchiveOpenCallback *openCallback)
|
|
2251
|
+
{
|
|
2252
|
+
CMyComPtr<IArchiveOpenVolumeCallback> openVolumeCallback;
|
|
2253
|
+
// CMyComPtr<ICryptoGetTextPassword> getTextPassword;
|
|
2254
|
+
NRar::CVolumeName seqName;
|
|
2255
|
+
CTempBuf tempBuf;
|
|
2256
|
+
CUnpacker unpacker;
|
|
2257
|
+
|
|
2258
|
+
if (openCallback)
|
|
2259
|
+
{
|
|
2260
|
+
openCallback->QueryInterface(IID_IArchiveOpenVolumeCallback, (void **)&openVolumeCallback);
|
|
2261
|
+
openCallback->QueryInterface(IID_ICryptoGetTextPassword, (void **)&unpacker.getTextPassword);
|
|
2262
|
+
}
|
|
2263
|
+
// unpacker.getTextPassword = getTextPassword;
|
|
2264
|
+
|
|
2265
|
+
CInArchive arch;
|
|
2266
|
+
int prevSplitFile = -1;
|
|
2267
|
+
int prevMainFile = -1;
|
|
2268
|
+
UInt64 totalBytes = 0;
|
|
2269
|
+
UInt64 curBytes = 0;
|
|
2270
|
+
bool nextVol_is_Required = false;
|
|
2271
|
+
|
|
2272
|
+
for (;;)
|
|
2273
|
+
{
|
|
2274
|
+
CMyComPtr<IInStream> inStream;
|
|
2275
|
+
|
|
2276
|
+
if (_arcs.IsEmpty())
|
|
2277
|
+
inStream = stream;
|
|
2278
|
+
else
|
|
2279
|
+
{
|
|
2280
|
+
if (!openVolumeCallback)
|
|
2281
|
+
break;
|
|
2282
|
+
if (_arcs.Size() == 1)
|
|
2283
|
+
{
|
|
2284
|
+
UString baseName;
|
|
2285
|
+
{
|
|
2286
|
+
NCOM::CPropVariant prop;
|
|
2287
|
+
RINOK(openVolumeCallback->GetProperty(kpidName, &prop))
|
|
2288
|
+
if (prop.vt != VT_BSTR)
|
|
2289
|
+
break;
|
|
2290
|
+
baseName = prop.bstrVal;
|
|
2291
|
+
}
|
|
2292
|
+
if (!seqName.InitName(baseName))
|
|
2293
|
+
break;
|
|
2294
|
+
}
|
|
2295
|
+
const UString volName = seqName.GetNextName();
|
|
2296
|
+
const HRESULT result = openVolumeCallback->GetStream(volName, &inStream);
|
|
2297
|
+
if (result != S_OK && result != S_FALSE)
|
|
2298
|
+
return result;
|
|
2299
|
+
if (!inStream || result != S_OK)
|
|
2300
|
+
{
|
|
2301
|
+
if (nextVol_is_Required)
|
|
2302
|
+
_missingVolName = volName;
|
|
2303
|
+
break;
|
|
2304
|
+
}
|
|
2305
|
+
}
|
|
2306
|
+
|
|
2307
|
+
UInt64 endPos = 0;
|
|
2308
|
+
RINOK(InStream_GetPos_GetSize(inStream, arch.StreamStartPosition, endPos))
|
|
2309
|
+
|
|
2310
|
+
if (openCallback)
|
|
2311
|
+
{
|
|
2312
|
+
totalBytes += endPos;
|
|
2313
|
+
RINOK(openCallback->SetTotal(NULL, &totalBytes))
|
|
2314
|
+
}
|
|
2315
|
+
|
|
2316
|
+
CInArcInfo arcInfo_Open;
|
|
2317
|
+
{
|
|
2318
|
+
const HRESULT res = arch.Open(inStream, maxCheckStartPosition, unpacker.getTextPassword, arcInfo_Open);
|
|
2319
|
+
if (arch.IsArc && arch.UnexpectedEnd)
|
|
2320
|
+
_errorFlags |= kpv_ErrorFlags_UnexpectedEnd;
|
|
2321
|
+
if (_arcs.IsEmpty())
|
|
2322
|
+
_isArc = arch.IsArc;
|
|
2323
|
+
if (res != S_OK)
|
|
2324
|
+
{
|
|
2325
|
+
if (res != S_FALSE)
|
|
2326
|
+
return res;
|
|
2327
|
+
if (_arcs.IsEmpty())
|
|
2328
|
+
return res;
|
|
2329
|
+
break;
|
|
2330
|
+
}
|
|
2331
|
+
}
|
|
2332
|
+
|
|
2333
|
+
CArc &arc = _arcs.AddNew();
|
|
2334
|
+
CInArcInfo &arcInfo = arc.Info;
|
|
2335
|
+
arcInfo = arcInfo_Open;
|
|
2336
|
+
arc.Stream = inStream;
|
|
2337
|
+
|
|
2338
|
+
CItem item;
|
|
2339
|
+
|
|
2340
|
+
for (;;)
|
|
2341
|
+
{
|
|
2342
|
+
item.Clear();
|
|
2343
|
+
|
|
2344
|
+
arcInfo.EndPos = arch.Position;
|
|
2345
|
+
if (arch.Position > endPos)
|
|
2346
|
+
{
|
|
2347
|
+
_errorFlags |= kpv_ErrorFlags_UnexpectedEnd;
|
|
2348
|
+
break;
|
|
2349
|
+
}
|
|
2350
|
+
RINOK(InStream_SeekSet(inStream, arch.Position))
|
|
2351
|
+
|
|
2352
|
+
{
|
|
2353
|
+
CInArchive::CHeader h;
|
|
2354
|
+
const HRESULT res = arch.ReadBlockHeader(h);
|
|
2355
|
+
if (res != S_OK)
|
|
2356
|
+
{
|
|
2357
|
+
if (res != S_FALSE)
|
|
2358
|
+
return res;
|
|
2359
|
+
if (arch.UnexpectedEnd)
|
|
2360
|
+
{
|
|
2361
|
+
_errorFlags |= kpv_ErrorFlags_UnexpectedEnd;
|
|
2362
|
+
if (arcInfo.EndPos < arch.Position)
|
|
2363
|
+
arcInfo.EndPos = arch.Position;
|
|
2364
|
+
if (arcInfo.EndPos < endPos)
|
|
2365
|
+
arcInfo.EndPos = endPos;
|
|
2366
|
+
}
|
|
2367
|
+
else
|
|
2368
|
+
_errorFlags |= kpv_ErrorFlags_HeadersError;
|
|
2369
|
+
break;
|
|
2370
|
+
}
|
|
2371
|
+
|
|
2372
|
+
if (h.Type == NHeaderType::kEndOfArc)
|
|
2373
|
+
{
|
|
2374
|
+
arcInfo.EndPos = arch.Position;
|
|
2375
|
+
arcInfo.EndOfArchive_was_Read = true;
|
|
2376
|
+
if (!arch.ReadVar(arcInfo.EndFlags))
|
|
2377
|
+
_errorFlags |= kpv_ErrorFlags_HeadersError;
|
|
2378
|
+
if (!arch.Is_Buf_Finished() || h.ExtraSize || h.DataSize)
|
|
2379
|
+
arcInfo.UnsupportedFeature = true;
|
|
2380
|
+
if (arcInfo.IsVolume())
|
|
2381
|
+
{
|
|
2382
|
+
// for multivolume archives RAR can add ZERO bytes at the end for alignment.
|
|
2383
|
+
// We must skip these bytes to prevent phySize warning.
|
|
2384
|
+
RINOK(InStream_SeekSet(inStream, arcInfo.EndPos))
|
|
2385
|
+
bool areThereNonZeros;
|
|
2386
|
+
UInt64 numZeros;
|
|
2387
|
+
const UInt64 maxSize = 1 << 12;
|
|
2388
|
+
RINOK(ReadZeroTail(inStream, areThereNonZeros, numZeros, maxSize))
|
|
2389
|
+
if (!areThereNonZeros && numZeros != 0 && numZeros <= maxSize)
|
|
2390
|
+
arcInfo.EndPos += numZeros;
|
|
2391
|
+
}
|
|
2392
|
+
break;
|
|
2393
|
+
}
|
|
2394
|
+
|
|
2395
|
+
if (h.Type != NHeaderType::kFile &&
|
|
2396
|
+
h.Type != NHeaderType::kService)
|
|
2397
|
+
{
|
|
2398
|
+
_errorFlags |= kpv_ErrorFlags_UnsupportedFeature;
|
|
2399
|
+
break;
|
|
2400
|
+
}
|
|
2401
|
+
|
|
2402
|
+
item.RecordType = (Byte)h.Type;
|
|
2403
|
+
if (!arch.ReadFileHeader(h, item))
|
|
2404
|
+
{
|
|
2405
|
+
_errorFlags |= kpv_ErrorFlags_HeadersError;
|
|
2406
|
+
break;
|
|
2407
|
+
}
|
|
2408
|
+
item.DataPos = arch.Position;
|
|
2409
|
+
}
|
|
2410
|
+
|
|
2411
|
+
bool isOk_packSize = true;
|
|
2412
|
+
{
|
|
2413
|
+
arcInfo.EndPos = arch.Position;
|
|
2414
|
+
if (arch.Position + item.PackSize < arch.Position)
|
|
2415
|
+
{
|
|
2416
|
+
isOk_packSize = false;
|
|
2417
|
+
_errorFlags |= kpv_ErrorFlags_HeadersError;
|
|
2418
|
+
if (arcInfo.EndPos < endPos)
|
|
2419
|
+
arcInfo.EndPos = endPos;
|
|
2420
|
+
}
|
|
2421
|
+
else
|
|
2422
|
+
{
|
|
2423
|
+
arch.AddToSeekValue(item.PackSize); // Position points to next header;
|
|
2424
|
+
arcInfo.EndPos = arch.Position;
|
|
2425
|
+
}
|
|
2426
|
+
}
|
|
2427
|
+
|
|
2428
|
+
bool needAdd = true;
|
|
2429
|
+
|
|
2430
|
+
if (!_comment_WasUsedInArc
|
|
2431
|
+
&& _comment.Size() == 0
|
|
2432
|
+
&& item.Is_CMT())
|
|
2433
|
+
{
|
|
2434
|
+
_comment_WasUsedInArc = true;
|
|
2435
|
+
if ( item.PackSize <= kCommentSize_Max
|
|
2436
|
+
&& item.PackSize == item.Size
|
|
2437
|
+
&& item.PackSize != 0
|
|
2438
|
+
&& item.Get_Method() == 0
|
|
2439
|
+
&& !item.IsSplit())
|
|
2440
|
+
{
|
|
2441
|
+
RINOK(unpacker.DecodeToBuf(EXTERNAL_CODECS_VARS item, item.PackSize, inStream, _comment))
|
|
2442
|
+
needAdd = false;
|
|
2443
|
+
// item.RecordType = (Byte)NHeaderType::kFile; // for debug
|
|
2444
|
+
}
|
|
2445
|
+
}
|
|
2446
|
+
|
|
2447
|
+
CRefItem ref;
|
|
2448
|
+
ref.Item = _items.Size();
|
|
2449
|
+
ref.Last = ref.Item;
|
|
2450
|
+
ref.Parent = -1;
|
|
2451
|
+
ref.Link = -1;
|
|
2452
|
+
|
|
2453
|
+
if (needAdd)
|
|
2454
|
+
{
|
|
2455
|
+
if (item.IsService())
|
|
2456
|
+
{
|
|
2457
|
+
if (item.Is_STM())
|
|
2458
|
+
{
|
|
2459
|
+
if (prevMainFile >= 0)
|
|
2460
|
+
ref.Parent = prevMainFile;
|
|
2461
|
+
}
|
|
2462
|
+
else
|
|
2463
|
+
{
|
|
2464
|
+
needAdd = false;
|
|
2465
|
+
if (item.Is_ACL())
|
|
2466
|
+
{
|
|
2467
|
+
_acl_Used = true;
|
|
2468
|
+
if (item.IsEncrypted() && !arch.m_CryptoMode)
|
|
2469
|
+
_error_in_ACL = true;
|
|
2470
|
+
else if (item.IsSolid()
|
|
2471
|
+
|| prevMainFile < 0
|
|
2472
|
+
|| item.Size >= (1 << 24)
|
|
2473
|
+
|| item.Size == 0)
|
|
2474
|
+
_error_in_ACL = true;
|
|
2475
|
+
if (prevMainFile >= 0 && item.Size < (1 << 24) && item.Size != 0)
|
|
2476
|
+
{
|
|
2477
|
+
CItem &mainItem = _items[_refs[prevMainFile].Item];
|
|
2478
|
+
|
|
2479
|
+
if (mainItem.ACL < 0)
|
|
2480
|
+
{
|
|
2481
|
+
CByteBuffer acl;
|
|
2482
|
+
const HRESULT res = tempBuf.Decode(EXTERNAL_CODECS_VARS item, inStream, unpacker, acl);
|
|
2483
|
+
if (!item.IsSplitAfter())
|
|
2484
|
+
tempBuf.Clear();
|
|
2485
|
+
if (res != S_OK)
|
|
2486
|
+
{
|
|
2487
|
+
tempBuf.Clear();
|
|
2488
|
+
if (res != S_FALSE && res != E_NOTIMPL)
|
|
2489
|
+
return res;
|
|
2490
|
+
_error_in_ACL = true;
|
|
2491
|
+
}
|
|
2492
|
+
else if (acl.Size() != 0)
|
|
2493
|
+
{
|
|
2494
|
+
if (_acls.IsEmpty() || acl != _acls.Back())
|
|
2495
|
+
_acls.Add(acl);
|
|
2496
|
+
mainItem.ACL = (int)_acls.Size() - 1;
|
|
2497
|
+
}
|
|
2498
|
+
}
|
|
2499
|
+
}
|
|
2500
|
+
}
|
|
2501
|
+
}
|
|
2502
|
+
} // item.IsService()
|
|
2503
|
+
|
|
2504
|
+
if (needAdd)
|
|
2505
|
+
{
|
|
2506
|
+
if (item.IsSplitBefore())
|
|
2507
|
+
{
|
|
2508
|
+
if (prevSplitFile >= 0)
|
|
2509
|
+
{
|
|
2510
|
+
CRefItem &ref2 = _refs[prevSplitFile];
|
|
2511
|
+
CItem &prevItem = _items[ref2.Last];
|
|
2512
|
+
if (item.IsNextForItem(prevItem))
|
|
2513
|
+
{
|
|
2514
|
+
ref2.Last = _items.Size();
|
|
2515
|
+
prevItem.NextItem = (int)ref2.Last;
|
|
2516
|
+
needAdd = false;
|
|
2517
|
+
}
|
|
2518
|
+
}
|
|
2519
|
+
else
|
|
2520
|
+
_split_Error = true;
|
|
2521
|
+
}
|
|
2522
|
+
}
|
|
2523
|
+
|
|
2524
|
+
if (needAdd)
|
|
2525
|
+
{
|
|
2526
|
+
if (item.IsSplitAfter())
|
|
2527
|
+
prevSplitFile = (int)_refs.Size();
|
|
2528
|
+
if (!item.IsService())
|
|
2529
|
+
prevMainFile = (int)_refs.Size();
|
|
2530
|
+
}
|
|
2531
|
+
}
|
|
2532
|
+
|
|
2533
|
+
{
|
|
2534
|
+
UInt64 version;
|
|
2535
|
+
if (item.FindExtra_Version(version))
|
|
2536
|
+
{
|
|
2537
|
+
item.Version_Defined = true;
|
|
2538
|
+
item.Version = version;
|
|
2539
|
+
}
|
|
2540
|
+
}
|
|
2541
|
+
|
|
2542
|
+
item.VolIndex = _arcs.Size() - 1;
|
|
2543
|
+
_items.Add(item);
|
|
2544
|
+
if (needAdd)
|
|
2545
|
+
_refs.Add(ref);
|
|
2546
|
+
|
|
2547
|
+
if (openCallback && (_items.Size() & 0xFF) == 0)
|
|
2548
|
+
{
|
|
2549
|
+
const UInt64 numFiles = _refs.Size(); // _items.Size()
|
|
2550
|
+
const UInt64 numBytes = curBytes + item.DataPos;
|
|
2551
|
+
RINOK(openCallback->SetCompleted(&numFiles, &numBytes))
|
|
2552
|
+
}
|
|
2553
|
+
|
|
2554
|
+
if (!isOk_packSize)
|
|
2555
|
+
break;
|
|
2556
|
+
}
|
|
2557
|
+
|
|
2558
|
+
curBytes += endPos;
|
|
2559
|
+
|
|
2560
|
+
nextVol_is_Required = false;
|
|
2561
|
+
|
|
2562
|
+
if (!arcInfo.IsVolume())
|
|
2563
|
+
break;
|
|
2564
|
+
|
|
2565
|
+
if (arcInfo.EndOfArchive_was_Read)
|
|
2566
|
+
{
|
|
2567
|
+
if (!arcInfo.AreMoreVolumes())
|
|
2568
|
+
break;
|
|
2569
|
+
nextVol_is_Required = true;
|
|
2570
|
+
}
|
|
2571
|
+
}
|
|
2572
|
+
|
|
2573
|
+
FillLinks();
|
|
2574
|
+
return S_OK;
|
|
2575
|
+
}
|
|
2576
|
+
|
|
2577
|
+
|
|
2578
|
+
|
|
2579
|
+
Z7_COM7F_IMF(CHandler::Open(IInStream *stream,
|
|
2580
|
+
const UInt64 *maxCheckStartPosition,
|
|
2581
|
+
IArchiveOpenCallback *openCallback))
|
|
2582
|
+
{
|
|
2583
|
+
COM_TRY_BEGIN
|
|
2584
|
+
Close();
|
|
2585
|
+
return Open2(stream, maxCheckStartPosition, openCallback);
|
|
2586
|
+
COM_TRY_END
|
|
2587
|
+
}
|
|
2588
|
+
|
|
2589
|
+
Z7_COM7F_IMF(CHandler::Close())
|
|
2590
|
+
{
|
|
2591
|
+
COM_TRY_BEGIN
|
|
2592
|
+
_missingVolName.Empty();
|
|
2593
|
+
_errorFlags = 0;
|
|
2594
|
+
// _warningFlags = 0;
|
|
2595
|
+
_isArc = false;
|
|
2596
|
+
_comment_WasUsedInArc = false;
|
|
2597
|
+
_acl_Used = false;
|
|
2598
|
+
_error_in_ACL = false;
|
|
2599
|
+
_split_Error = false;
|
|
2600
|
+
_numBlocks = 0;
|
|
2601
|
+
_rar5comapt_mask = 0;
|
|
2602
|
+
_algo_Mask = 0; // (UInt64)0u - 1;
|
|
2603
|
+
for (unsigned i = 0; i < Z7_ARRAY_SIZE(_methodMasks); i++)
|
|
2604
|
+
{
|
|
2605
|
+
_methodMasks[i] = 0;
|
|
2606
|
+
_dictMaxSizes[i] = 0;
|
|
2607
|
+
}
|
|
2608
|
+
|
|
2609
|
+
_refs.Clear();
|
|
2610
|
+
_items.Clear();
|
|
2611
|
+
_arcs.Clear();
|
|
2612
|
+
_acls.Clear();
|
|
2613
|
+
_comment.Free();
|
|
2614
|
+
return S_OK;
|
|
2615
|
+
COM_TRY_END
|
|
2616
|
+
}
|
|
2617
|
+
|
|
2618
|
+
|
|
2619
|
+
Z7_CLASS_IMP_NOQIB_1(
|
|
2620
|
+
CVolsInStream
|
|
2621
|
+
, ISequentialInStream
|
|
2622
|
+
)
|
|
2623
|
+
UInt64 _rem;
|
|
2624
|
+
ISequentialInStream *_stream;
|
|
2625
|
+
const CObjectVector<CArc> *_arcs;
|
|
2626
|
+
const CObjectVector<CItem> *_items;
|
|
2627
|
+
int _itemIndex;
|
|
2628
|
+
public:
|
|
2629
|
+
bool CrcIsOK;
|
|
2630
|
+
private:
|
|
2631
|
+
CHash _hash;
|
|
2632
|
+
public:
|
|
2633
|
+
void Init(const CObjectVector<CArc> *arcs,
|
|
2634
|
+
const CObjectVector<CItem> *items,
|
|
2635
|
+
unsigned itemIndex)
|
|
2636
|
+
{
|
|
2637
|
+
_arcs = arcs;
|
|
2638
|
+
_items = items;
|
|
2639
|
+
_itemIndex = (int)itemIndex;
|
|
2640
|
+
_stream = NULL;
|
|
2641
|
+
CrcIsOK = true;
|
|
2642
|
+
}
|
|
2643
|
+
};
|
|
2644
|
+
|
|
2645
|
+
Z7_COM7F_IMF(CVolsInStream::Read(void *data, UInt32 size, UInt32 *processedSize))
|
|
2646
|
+
{
|
|
2647
|
+
if (processedSize)
|
|
2648
|
+
*processedSize = 0;
|
|
2649
|
+
UInt32 realProcessedSize = 0;
|
|
2650
|
+
|
|
2651
|
+
while (size != 0)
|
|
2652
|
+
{
|
|
2653
|
+
if (!_stream)
|
|
2654
|
+
{
|
|
2655
|
+
if (_itemIndex < 0)
|
|
2656
|
+
break;
|
|
2657
|
+
const CItem &item = (*_items)[_itemIndex];
|
|
2658
|
+
IInStream *s = (*_arcs)[item.VolIndex].Stream;
|
|
2659
|
+
RINOK(InStream_SeekSet(s, item.GetDataPosition()))
|
|
2660
|
+
_stream = s;
|
|
2661
|
+
if (CrcIsOK && item.IsSplitAfter())
|
|
2662
|
+
_hash.Init(item);
|
|
2663
|
+
else
|
|
2664
|
+
_hash.Init_NoCalc();
|
|
2665
|
+
_rem = item.PackSize;
|
|
2666
|
+
}
|
|
2667
|
+
{
|
|
2668
|
+
UInt32 cur = size;
|
|
2669
|
+
if (cur > _rem)
|
|
2670
|
+
cur = (UInt32)_rem;
|
|
2671
|
+
const UInt32 num = cur;
|
|
2672
|
+
HRESULT res = _stream->Read(data, cur, &cur);
|
|
2673
|
+
_hash.Update(data, cur);
|
|
2674
|
+
realProcessedSize += cur;
|
|
2675
|
+
if (processedSize)
|
|
2676
|
+
*processedSize = realProcessedSize;
|
|
2677
|
+
data = (Byte *)data + cur;
|
|
2678
|
+
size -= cur;
|
|
2679
|
+
_rem -= cur;
|
|
2680
|
+
if (_rem == 0)
|
|
2681
|
+
{
|
|
2682
|
+
const CItem &item = (*_items)[_itemIndex];
|
|
2683
|
+
_itemIndex = item.NextItem;
|
|
2684
|
+
if (!_hash.Check(item, NULL)) // RAR doesn't use MAC here
|
|
2685
|
+
CrcIsOK = false;
|
|
2686
|
+
_stream = NULL;
|
|
2687
|
+
}
|
|
2688
|
+
if (res != S_OK)
|
|
2689
|
+
return res;
|
|
2690
|
+
if (realProcessedSize != 0)
|
|
2691
|
+
return S_OK;
|
|
2692
|
+
if (cur == 0 && num != 0)
|
|
2693
|
+
return S_OK;
|
|
2694
|
+
}
|
|
2695
|
+
}
|
|
2696
|
+
|
|
2697
|
+
return S_OK;
|
|
2698
|
+
}
|
|
2699
|
+
|
|
2700
|
+
|
|
2701
|
+
static int FindLinkBuf(CObjectVector<CLinkFile> &linkFiles, unsigned index)
|
|
2702
|
+
{
|
|
2703
|
+
unsigned left = 0, right = linkFiles.Size();
|
|
2704
|
+
for (;;)
|
|
2705
|
+
{
|
|
2706
|
+
if (left == right)
|
|
2707
|
+
return -1;
|
|
2708
|
+
const unsigned mid = (left + right) / 2;
|
|
2709
|
+
const unsigned linkIndex = linkFiles[mid].Index;
|
|
2710
|
+
if (index == linkIndex)
|
|
2711
|
+
return (int)mid;
|
|
2712
|
+
if (index < linkIndex)
|
|
2713
|
+
right = mid;
|
|
2714
|
+
else
|
|
2715
|
+
left = mid + 1;
|
|
2716
|
+
}
|
|
2717
|
+
}
|
|
2718
|
+
|
|
2719
|
+
|
|
2720
|
+
static inline int DecoderRes_to_OpRes(HRESULT res, bool crcOK)
|
|
2721
|
+
{
|
|
2722
|
+
if (res == E_NOTIMPL)
|
|
2723
|
+
return NExtract::NOperationResult::kUnsupportedMethod;
|
|
2724
|
+
// if (res == S_FALSE)
|
|
2725
|
+
if (res != S_OK)
|
|
2726
|
+
return NExtract::NOperationResult::kDataError;
|
|
2727
|
+
return crcOK ?
|
|
2728
|
+
NExtract::NOperationResult::kOK :
|
|
2729
|
+
NExtract::NOperationResult::kCRCError;
|
|
2730
|
+
}
|
|
2731
|
+
|
|
2732
|
+
|
|
2733
|
+
static HRESULT CopyData_with_Progress(const Byte *data, size_t size,
|
|
2734
|
+
ISequentialOutStream *outStream, ICompressProgressInfo *progress)
|
|
2735
|
+
{
|
|
2736
|
+
UInt64 pos64 = 0;
|
|
2737
|
+
while (size)
|
|
2738
|
+
{
|
|
2739
|
+
const UInt32 kStepSize = (UInt32)1 << 24;
|
|
2740
|
+
UInt32 cur = kStepSize;
|
|
2741
|
+
if (cur > size)
|
|
2742
|
+
cur = (UInt32)size;
|
|
2743
|
+
RINOK(outStream->Write(data, cur, &cur))
|
|
2744
|
+
if (cur == 0)
|
|
2745
|
+
return E_FAIL;
|
|
2746
|
+
size -= cur;
|
|
2747
|
+
data += cur;
|
|
2748
|
+
pos64 += cur;
|
|
2749
|
+
if (progress)
|
|
2750
|
+
{
|
|
2751
|
+
RINOK(progress->SetRatioInfo(&pos64, &pos64))
|
|
2752
|
+
}
|
|
2753
|
+
}
|
|
2754
|
+
return S_OK;
|
|
2755
|
+
}
|
|
2756
|
+
|
|
2757
|
+
|
|
2758
|
+
Z7_COM7F_IMF(CHandler::Extract(const UInt32 *indices, UInt32 numItems,
|
|
2759
|
+
Int32 testMode, IArchiveExtractCallback *extractCallback))
|
|
2760
|
+
{
|
|
2761
|
+
COM_TRY_BEGIN
|
|
2762
|
+
const bool allFilesMode = (numItems == (UInt32)(Int32)-1);
|
|
2763
|
+
if (allFilesMode)
|
|
2764
|
+
numItems = (UInt32)_refs.Size();
|
|
2765
|
+
if (numItems == 0)
|
|
2766
|
+
return S_OK;
|
|
2767
|
+
|
|
2768
|
+
CByteArr extractStatuses(_refs.Size());
|
|
2769
|
+
memset(extractStatuses, 0, _refs.Size());
|
|
2770
|
+
|
|
2771
|
+
// we don't want to use temp buffer for big link files.
|
|
2772
|
+
const size_t k_CopyLinkFile_MaxSize = (size_t)1 << (28 + sizeof(size_t) / 2);
|
|
2773
|
+
|
|
2774
|
+
const Byte kStatus_Extract = 1 << 0;
|
|
2775
|
+
const Byte kStatus_Skip = 1 << 1;
|
|
2776
|
+
const Byte kStatus_Link = 1 << 2;
|
|
2777
|
+
|
|
2778
|
+
/*
|
|
2779
|
+
In original RAR:
|
|
2780
|
+
1) service streams are not allowed to be solid,
|
|
2781
|
+
and solid flag must be ignored for service streams.
|
|
2782
|
+
2) If RAR creates new solid block and first file in solid block is Link file,
|
|
2783
|
+
then it can clear solid flag for Link file and
|
|
2784
|
+
clear solid flag for first non-Link file after Link file.
|
|
2785
|
+
*/
|
|
2786
|
+
|
|
2787
|
+
CObjectVector<CLinkFile> linkFiles;
|
|
2788
|
+
|
|
2789
|
+
{
|
|
2790
|
+
UInt64 total = 0;
|
|
2791
|
+
bool isThereUndefinedSize = false;
|
|
2792
|
+
bool thereAreLinks = false;
|
|
2793
|
+
{
|
|
2794
|
+
unsigned solidLimit = 0;
|
|
2795
|
+
for (UInt32 t = 0; t < numItems; t++)
|
|
2796
|
+
{
|
|
2797
|
+
const unsigned index = (unsigned)(allFilesMode ? t : indices[t]);
|
|
2798
|
+
const CRefItem &ref = _refs[index];
|
|
2799
|
+
const CItem &item = _items[ref.Item];
|
|
2800
|
+
const CItem &lastItem = _items[ref.Last];
|
|
2801
|
+
|
|
2802
|
+
extractStatuses[index] |= kStatus_Extract;
|
|
2803
|
+
|
|
2804
|
+
if (!lastItem.Is_UnknownSize())
|
|
2805
|
+
total += lastItem.Size;
|
|
2806
|
+
else
|
|
2807
|
+
isThereUndefinedSize = true;
|
|
2808
|
+
|
|
2809
|
+
if (ref.Link >= 0)
|
|
2810
|
+
{
|
|
2811
|
+
// 18.06 fixed: we use links for Test mode too
|
|
2812
|
+
// if (!testMode)
|
|
2813
|
+
{
|
|
2814
|
+
if ((unsigned)ref.Link < index)
|
|
2815
|
+
{
|
|
2816
|
+
const CRefItem &linkRef = _refs[(unsigned)ref.Link];
|
|
2817
|
+
const CItem &linkItem = _items[linkRef.Item];
|
|
2818
|
+
if (linkItem.IsSolid())
|
|
2819
|
+
if (testMode || linkItem.Size <= k_CopyLinkFile_MaxSize)
|
|
2820
|
+
{
|
|
2821
|
+
if (extractStatuses[(unsigned)ref.Link] == 0)
|
|
2822
|
+
{
|
|
2823
|
+
const CItem &lastLinkItem = _items[linkRef.Last];
|
|
2824
|
+
if (!lastLinkItem.Is_UnknownSize())
|
|
2825
|
+
total += lastLinkItem.Size;
|
|
2826
|
+
else
|
|
2827
|
+
isThereUndefinedSize = true;
|
|
2828
|
+
}
|
|
2829
|
+
extractStatuses[(unsigned)ref.Link] |= kStatus_Link;
|
|
2830
|
+
thereAreLinks = true;
|
|
2831
|
+
}
|
|
2832
|
+
}
|
|
2833
|
+
}
|
|
2834
|
+
continue;
|
|
2835
|
+
}
|
|
2836
|
+
|
|
2837
|
+
if (item.IsService())
|
|
2838
|
+
continue;
|
|
2839
|
+
|
|
2840
|
+
if (item.IsSolid())
|
|
2841
|
+
{
|
|
2842
|
+
unsigned j = index;
|
|
2843
|
+
|
|
2844
|
+
while (j > solidLimit)
|
|
2845
|
+
{
|
|
2846
|
+
j--;
|
|
2847
|
+
const CRefItem &ref2 = _refs[j];
|
|
2848
|
+
const CItem &item2 = _items[ref2.Item];
|
|
2849
|
+
if (!item2.IsService())
|
|
2850
|
+
{
|
|
2851
|
+
if (extractStatuses[j] == 0)
|
|
2852
|
+
{
|
|
2853
|
+
const CItem &lastItem2 = _items[ref2.Last];
|
|
2854
|
+
if (!lastItem2.Is_UnknownSize())
|
|
2855
|
+
total += lastItem2.Size;
|
|
2856
|
+
else
|
|
2857
|
+
isThereUndefinedSize = true;
|
|
2858
|
+
}
|
|
2859
|
+
extractStatuses[j] |= kStatus_Skip;
|
|
2860
|
+
if (!item2.IsSolid())
|
|
2861
|
+
break;
|
|
2862
|
+
}
|
|
2863
|
+
}
|
|
2864
|
+
}
|
|
2865
|
+
|
|
2866
|
+
solidLimit = index + 1;
|
|
2867
|
+
}
|
|
2868
|
+
}
|
|
2869
|
+
|
|
2870
|
+
if (thereAreLinks)
|
|
2871
|
+
{
|
|
2872
|
+
unsigned solidLimit = 0;
|
|
2873
|
+
|
|
2874
|
+
FOR_VECTOR (i, _refs)
|
|
2875
|
+
{
|
|
2876
|
+
if ((extractStatuses[i] & kStatus_Link) == 0)
|
|
2877
|
+
continue;
|
|
2878
|
+
|
|
2879
|
+
// We use CLinkFile for testMode too.
|
|
2880
|
+
// So we can show errors for copy files.
|
|
2881
|
+
// if (!testMode)
|
|
2882
|
+
{
|
|
2883
|
+
CLinkFile &linkFile = linkFiles.AddNew();
|
|
2884
|
+
linkFile.Index = i;
|
|
2885
|
+
}
|
|
2886
|
+
|
|
2887
|
+
const CItem &item = _items[_refs[i].Item];
|
|
2888
|
+
/*
|
|
2889
|
+
if (item.IsService())
|
|
2890
|
+
continue;
|
|
2891
|
+
*/
|
|
2892
|
+
|
|
2893
|
+
if (item.IsSolid())
|
|
2894
|
+
{
|
|
2895
|
+
unsigned j = i;
|
|
2896
|
+
|
|
2897
|
+
while (j > solidLimit)
|
|
2898
|
+
{
|
|
2899
|
+
j--;
|
|
2900
|
+
const CRefItem &ref2 = _refs[j];
|
|
2901
|
+
const CItem &item2 = _items[ref2.Item];
|
|
2902
|
+
if (!item2.IsService())
|
|
2903
|
+
{
|
|
2904
|
+
if (extractStatuses[j] != 0)
|
|
2905
|
+
break;
|
|
2906
|
+
extractStatuses[j] = kStatus_Skip;
|
|
2907
|
+
{
|
|
2908
|
+
const CItem &lastItem2 = _items[ref2.Last];
|
|
2909
|
+
if (!lastItem2.Is_UnknownSize())
|
|
2910
|
+
total += lastItem2.Size;
|
|
2911
|
+
else
|
|
2912
|
+
isThereUndefinedSize = true;
|
|
2913
|
+
}
|
|
2914
|
+
if (!item2.IsSolid())
|
|
2915
|
+
break;
|
|
2916
|
+
}
|
|
2917
|
+
}
|
|
2918
|
+
}
|
|
2919
|
+
|
|
2920
|
+
solidLimit = i + 1;
|
|
2921
|
+
}
|
|
2922
|
+
|
|
2923
|
+
if (!testMode)
|
|
2924
|
+
for (UInt32 t = 0; t < numItems; t++)
|
|
2925
|
+
{
|
|
2926
|
+
const unsigned index = (unsigned)(allFilesMode ? t : indices[t]);
|
|
2927
|
+
const CRefItem &ref = _refs[index];
|
|
2928
|
+
|
|
2929
|
+
const int linkIndex = ref.Link;
|
|
2930
|
+
if (linkIndex < 0 || (unsigned)linkIndex >= index)
|
|
2931
|
+
continue;
|
|
2932
|
+
const CItem &linkItem = _items[_refs[(unsigned)linkIndex].Item];
|
|
2933
|
+
if (!linkItem.IsSolid() || linkItem.Size > k_CopyLinkFile_MaxSize)
|
|
2934
|
+
continue;
|
|
2935
|
+
const int bufIndex = FindLinkBuf(linkFiles, (unsigned)linkIndex);
|
|
2936
|
+
if (bufIndex < 0)
|
|
2937
|
+
return E_FAIL;
|
|
2938
|
+
linkFiles[bufIndex].NumLinks++;
|
|
2939
|
+
}
|
|
2940
|
+
}
|
|
2941
|
+
|
|
2942
|
+
if (total != 0 || !isThereUndefinedSize)
|
|
2943
|
+
{
|
|
2944
|
+
RINOK(extractCallback->SetTotal(total))
|
|
2945
|
+
}
|
|
2946
|
+
}
|
|
2947
|
+
|
|
2948
|
+
|
|
2949
|
+
|
|
2950
|
+
// ---------- MEMORY REQUEST ----------
|
|
2951
|
+
{
|
|
2952
|
+
UInt64 dictMaxSize = 0;
|
|
2953
|
+
for (UInt32 i = 0; i < _refs.Size(); i++)
|
|
2954
|
+
{
|
|
2955
|
+
if (extractStatuses[i] == 0)
|
|
2956
|
+
continue;
|
|
2957
|
+
const CRefItem &ref = _refs[i];
|
|
2958
|
+
const CItem &item = _items[ref.Item];
|
|
2959
|
+
/*
|
|
2960
|
+
if (!item.IsDir() && !item.IsService() && item.NeedUse_as_CopyLink())
|
|
2961
|
+
{
|
|
2962
|
+
}
|
|
2963
|
+
*/
|
|
2964
|
+
const unsigned algo = item.Get_AlgoVersion_RawBits();
|
|
2965
|
+
if (!item.IsDir() && algo < Z7_ARRAY_SIZE(_methodMasks))
|
|
2966
|
+
{
|
|
2967
|
+
const UInt64 d = item.Get_DictSize64();
|
|
2968
|
+
if (dictMaxSize < d)
|
|
2969
|
+
dictMaxSize = d;
|
|
2970
|
+
}
|
|
2971
|
+
}
|
|
2972
|
+
// we use callback, if dict exceeds (1 GB), because
|
|
2973
|
+
// client code can set low limit (1 GB) for allowed memory usage.
|
|
2974
|
+
const UInt64 k_MemLimit_for_Callback = (UInt64)1 << 30;
|
|
2975
|
+
if (dictMaxSize > (_memUsage_WasSet ?
|
|
2976
|
+
_memUsage_Decompress : k_MemLimit_for_Callback))
|
|
2977
|
+
{
|
|
2978
|
+
{
|
|
2979
|
+
CMyComPtr<IArchiveRequestMemoryUseCallback> requestMem;
|
|
2980
|
+
extractCallback->QueryInterface(IID_IArchiveRequestMemoryUseCallback, (void **)&requestMem);
|
|
2981
|
+
if (!requestMem)
|
|
2982
|
+
{
|
|
2983
|
+
if (_memUsage_WasSet)
|
|
2984
|
+
return E_OUTOFMEMORY;
|
|
2985
|
+
}
|
|
2986
|
+
else
|
|
2987
|
+
{
|
|
2988
|
+
UInt64 allowedSize = _memUsage_WasSet ?
|
|
2989
|
+
_memUsage_Decompress :
|
|
2990
|
+
(UInt64)1 << 32; // 4 GB is default allowed limit for RAR7
|
|
2991
|
+
|
|
2992
|
+
const UInt32 flags = (_memUsage_WasSet ?
|
|
2993
|
+
NRequestMemoryUseFlags::k_AllowedSize_WasForced |
|
|
2994
|
+
NRequestMemoryUseFlags::k_MLimit_Exceeded :
|
|
2995
|
+
(dictMaxSize > allowedSize) ?
|
|
2996
|
+
NRequestMemoryUseFlags::k_DefaultLimit_Exceeded:
|
|
2997
|
+
0)
|
|
2998
|
+
| NRequestMemoryUseFlags::k_SkipArc_IsExpected
|
|
2999
|
+
// | NRequestMemoryUseFlags::k_NoErrorMessage // for debug
|
|
3000
|
+
;
|
|
3001
|
+
|
|
3002
|
+
// we set "Allow" for default case, if requestMem doesn't process anything.
|
|
3003
|
+
UInt32 answerFlags =
|
|
3004
|
+
(_memUsage_WasSet && dictMaxSize > allowedSize) ?
|
|
3005
|
+
NRequestMemoryAnswerFlags::k_Limit_Exceeded
|
|
3006
|
+
| NRequestMemoryAnswerFlags::k_SkipArc
|
|
3007
|
+
: NRequestMemoryAnswerFlags::k_Allow;
|
|
3008
|
+
|
|
3009
|
+
RINOK(requestMem->RequestMemoryUse(
|
|
3010
|
+
flags,
|
|
3011
|
+
NEventIndexType::kNoIndex,
|
|
3012
|
+
// NEventIndexType::kInArcIndex, // for debug
|
|
3013
|
+
0, // index
|
|
3014
|
+
NULL, // path
|
|
3015
|
+
dictMaxSize, &allowedSize, &answerFlags))
|
|
3016
|
+
if ( (answerFlags & NRequestMemoryAnswerFlags::k_Allow) == 0
|
|
3017
|
+
|| (answerFlags & NRequestMemoryAnswerFlags::k_Stop)
|
|
3018
|
+
|| (answerFlags & NRequestMemoryAnswerFlags::k_SkipArc)
|
|
3019
|
+
)
|
|
3020
|
+
{
|
|
3021
|
+
return E_OUTOFMEMORY;
|
|
3022
|
+
}
|
|
3023
|
+
/*
|
|
3024
|
+
if ((answerFlags & NRequestMemoryAnswerFlags::k_AskForBigFile) == 0 &&
|
|
3025
|
+
(answerFlags & NRequestMemoryAnswerFlags::k_ReportForBigFile) == 0)
|
|
3026
|
+
{
|
|
3027
|
+
// requestMem.Release();
|
|
3028
|
+
}
|
|
3029
|
+
*/
|
|
3030
|
+
}
|
|
3031
|
+
}
|
|
3032
|
+
}
|
|
3033
|
+
}
|
|
3034
|
+
|
|
3035
|
+
|
|
3036
|
+
|
|
3037
|
+
// ---------- UNPACK ----------
|
|
3038
|
+
|
|
3039
|
+
UInt64 totalUnpacked = 0;
|
|
3040
|
+
UInt64 totalPacked = 0;
|
|
3041
|
+
UInt64 curUnpackSize;
|
|
3042
|
+
UInt64 curPackSize;
|
|
3043
|
+
|
|
3044
|
+
CUnpacker unpacker;
|
|
3045
|
+
unpacker.NeedCrc = _needChecksumCheck;
|
|
3046
|
+
CMyComPtr2_Create<ISequentialInStream, CVolsInStream> volsInStream;
|
|
3047
|
+
CMyComPtr2_Create<ICompressProgressInfo, CLocalProgress> lps;
|
|
3048
|
+
lps->Init(extractCallback, false);
|
|
3049
|
+
|
|
3050
|
+
/*
|
|
3051
|
+
bool prevSolidWasSkipped = false;
|
|
3052
|
+
UInt64 solidDictSize_Skip = 0;
|
|
3053
|
+
*/
|
|
3054
|
+
|
|
3055
|
+
for (unsigned i = 0;; i++,
|
|
3056
|
+
totalUnpacked += curUnpackSize,
|
|
3057
|
+
totalPacked += curPackSize)
|
|
3058
|
+
{
|
|
3059
|
+
lps->InSize = totalPacked;
|
|
3060
|
+
lps->OutSize = totalUnpacked;
|
|
3061
|
+
RINOK(lps->SetCur())
|
|
3062
|
+
{
|
|
3063
|
+
const unsigned num = _refs.Size();
|
|
3064
|
+
if (i >= num)
|
|
3065
|
+
break;
|
|
3066
|
+
for (;;)
|
|
3067
|
+
{
|
|
3068
|
+
if (extractStatuses[i] != 0)
|
|
3069
|
+
break;
|
|
3070
|
+
i++;
|
|
3071
|
+
if (i >= num)
|
|
3072
|
+
break;
|
|
3073
|
+
}
|
|
3074
|
+
if (i >= num)
|
|
3075
|
+
break;
|
|
3076
|
+
}
|
|
3077
|
+
curUnpackSize = 0;
|
|
3078
|
+
curPackSize = 0;
|
|
3079
|
+
|
|
3080
|
+
// isExtract means that we don't skip that item. So we need read data.
|
|
3081
|
+
const bool isExtract = ((extractStatuses[i] & kStatus_Extract) != 0);
|
|
3082
|
+
Int32 askMode =
|
|
3083
|
+
isExtract ? (testMode ?
|
|
3084
|
+
NExtract::NAskMode::kTest :
|
|
3085
|
+
NExtract::NAskMode::kExtract) :
|
|
3086
|
+
NExtract::NAskMode::kSkip;
|
|
3087
|
+
|
|
3088
|
+
unpacker.linkFile = NULL;
|
|
3089
|
+
|
|
3090
|
+
// if (!testMode)
|
|
3091
|
+
if ((extractStatuses[i] & kStatus_Link) != 0)
|
|
3092
|
+
{
|
|
3093
|
+
const int bufIndex = FindLinkBuf(linkFiles, i);
|
|
3094
|
+
if (bufIndex < 0)
|
|
3095
|
+
return E_FAIL;
|
|
3096
|
+
unpacker.linkFile = &linkFiles[bufIndex];
|
|
3097
|
+
}
|
|
3098
|
+
|
|
3099
|
+
const unsigned index = i;
|
|
3100
|
+
const CRefItem *ref = &_refs[index];
|
|
3101
|
+
const CItem *item = &_items[ref->Item];
|
|
3102
|
+
const CItem &lastItem = _items[ref->Last];
|
|
3103
|
+
|
|
3104
|
+
curUnpackSize = 0;
|
|
3105
|
+
if (!lastItem.Is_UnknownSize())
|
|
3106
|
+
curUnpackSize = lastItem.Size;
|
|
3107
|
+
|
|
3108
|
+
curPackSize = GetPackSize(index);
|
|
3109
|
+
|
|
3110
|
+
bool isSolid = false;
|
|
3111
|
+
if (!item->IsService())
|
|
3112
|
+
{
|
|
3113
|
+
if (item->IsSolid())
|
|
3114
|
+
isSolid = unpacker.SolidAllowed;
|
|
3115
|
+
unpacker.SolidAllowed = isSolid;
|
|
3116
|
+
}
|
|
3117
|
+
|
|
3118
|
+
|
|
3119
|
+
// ----- request mem -----
|
|
3120
|
+
/*
|
|
3121
|
+
// link files are complicated cases. (ref->Link >= 0)
|
|
3122
|
+
// link file can refer to non-solid file that can have big dictionary
|
|
3123
|
+
// link file can refer to solid files that requres buffer
|
|
3124
|
+
if (!item->IsDir() && requestMem && ref->Link < 0)
|
|
3125
|
+
{
|
|
3126
|
+
bool needSkip = false;
|
|
3127
|
+
if (isSolid)
|
|
3128
|
+
needSkip = prevSolidWasSkipped;
|
|
3129
|
+
else
|
|
3130
|
+
{
|
|
3131
|
+
// isSolid == false
|
|
3132
|
+
const unsigned algo = item->Get_AlgoVersion_RawBits();
|
|
3133
|
+
// const unsigned m = item.Get_Method();
|
|
3134
|
+
if (algo < Z7_ARRAY_SIZE(_methodMasks))
|
|
3135
|
+
{
|
|
3136
|
+
solidDictSize_Skip = item->Get_DictSize64();
|
|
3137
|
+
if (solidDictSize_Skip > allowedSize)
|
|
3138
|
+
needSkip = true;
|
|
3139
|
+
}
|
|
3140
|
+
}
|
|
3141
|
+
if (needSkip)
|
|
3142
|
+
{
|
|
3143
|
+
UInt32 answerFlags = 0;
|
|
3144
|
+
UInt64 allowedSize_File = allowedSize;
|
|
3145
|
+
RINOK(requestMem->RequestMemoryUse(
|
|
3146
|
+
NRequestMemoryUseFlags::k_Limit_Exceeded |
|
|
3147
|
+
NRequestMemoryUseFlags::k_IsReport,
|
|
3148
|
+
NEventIndexType::kInArcIndex,
|
|
3149
|
+
index,
|
|
3150
|
+
NULL, // path
|
|
3151
|
+
solidDictSize_Skip, &allowedSize_File, &answerFlags))
|
|
3152
|
+
if (!item->IsService())
|
|
3153
|
+
prevSolidWasSkipped = true;
|
|
3154
|
+
continue;
|
|
3155
|
+
}
|
|
3156
|
+
}
|
|
3157
|
+
if (!item->IsService() && item->IsDir())
|
|
3158
|
+
prevSolidWasSkipped = false;
|
|
3159
|
+
*/
|
|
3160
|
+
|
|
3161
|
+
CMyComPtr<ISequentialOutStream> realOutStream;
|
|
3162
|
+
RINOK(extractCallback->GetStream((UInt32)index, &realOutStream, askMode))
|
|
3163
|
+
|
|
3164
|
+
if (item->IsDir())
|
|
3165
|
+
{
|
|
3166
|
+
RINOK(extractCallback->PrepareOperation(askMode))
|
|
3167
|
+
RINOK(extractCallback->SetOperationResult(NExtract::NOperationResult::kOK))
|
|
3168
|
+
continue;
|
|
3169
|
+
}
|
|
3170
|
+
|
|
3171
|
+
const int index2 = ref->Link;
|
|
3172
|
+
|
|
3173
|
+
int bufIndex = -1;
|
|
3174
|
+
|
|
3175
|
+
if (index2 >= 0)
|
|
3176
|
+
{
|
|
3177
|
+
const CRefItem &ref2 = _refs[index2];
|
|
3178
|
+
const CItem &item2 = _items[ref2.Item];
|
|
3179
|
+
const CItem &lastItem2 = _items[ref2.Last];
|
|
3180
|
+
if (!item2.IsSolid())
|
|
3181
|
+
{
|
|
3182
|
+
item = &item2;
|
|
3183
|
+
ref = &ref2;
|
|
3184
|
+
if (!lastItem2.Is_UnknownSize())
|
|
3185
|
+
curUnpackSize = lastItem2.Size;
|
|
3186
|
+
else
|
|
3187
|
+
curUnpackSize = 0;
|
|
3188
|
+
curPackSize = GetPackSize((unsigned)index2);
|
|
3189
|
+
}
|
|
3190
|
+
else
|
|
3191
|
+
{
|
|
3192
|
+
if ((unsigned)index2 < index)
|
|
3193
|
+
bufIndex = FindLinkBuf(linkFiles, (unsigned)index2);
|
|
3194
|
+
}
|
|
3195
|
+
}
|
|
3196
|
+
|
|
3197
|
+
bool needCallback = true;
|
|
3198
|
+
|
|
3199
|
+
if (!realOutStream)
|
|
3200
|
+
{
|
|
3201
|
+
if (testMode)
|
|
3202
|
+
{
|
|
3203
|
+
if (item->NeedUse_as_CopyLink_or_HardLink())
|
|
3204
|
+
{
|
|
3205
|
+
Int32 opRes = NExtract::NOperationResult::kOK;
|
|
3206
|
+
if (bufIndex >= 0)
|
|
3207
|
+
{
|
|
3208
|
+
const CLinkFile &linkFile = linkFiles[bufIndex];
|
|
3209
|
+
opRes = DecoderRes_to_OpRes(linkFile.Res, linkFile.crcOK);
|
|
3210
|
+
}
|
|
3211
|
+
|
|
3212
|
+
RINOK(extractCallback->PrepareOperation(askMode))
|
|
3213
|
+
RINOK(extractCallback->SetOperationResult(opRes))
|
|
3214
|
+
continue;
|
|
3215
|
+
}
|
|
3216
|
+
}
|
|
3217
|
+
else
|
|
3218
|
+
{
|
|
3219
|
+
if (item->IsService())
|
|
3220
|
+
continue;
|
|
3221
|
+
|
|
3222
|
+
needCallback = false;
|
|
3223
|
+
|
|
3224
|
+
if (!item->NeedUse_as_HardLink())
|
|
3225
|
+
if (index2 < 0)
|
|
3226
|
+
|
|
3227
|
+
for (unsigned n = i + 1; n < _refs.Size(); n++)
|
|
3228
|
+
{
|
|
3229
|
+
const CItem &nextItem = _items[_refs[n].Item];
|
|
3230
|
+
if (nextItem.IsService())
|
|
3231
|
+
continue;
|
|
3232
|
+
if (!nextItem.IsSolid())
|
|
3233
|
+
break;
|
|
3234
|
+
if (extractStatuses[i] != 0)
|
|
3235
|
+
{
|
|
3236
|
+
needCallback = true;
|
|
3237
|
+
break;
|
|
3238
|
+
}
|
|
3239
|
+
}
|
|
3240
|
+
|
|
3241
|
+
askMode = NExtract::NAskMode::kSkip;
|
|
3242
|
+
}
|
|
3243
|
+
}
|
|
3244
|
+
|
|
3245
|
+
if (needCallback)
|
|
3246
|
+
{
|
|
3247
|
+
RINOK(extractCallback->PrepareOperation(askMode))
|
|
3248
|
+
}
|
|
3249
|
+
|
|
3250
|
+
if (bufIndex >= 0)
|
|
3251
|
+
{
|
|
3252
|
+
CLinkFile &linkFile = linkFiles[bufIndex];
|
|
3253
|
+
|
|
3254
|
+
if (isExtract)
|
|
3255
|
+
{
|
|
3256
|
+
if (linkFile.NumLinks == 0)
|
|
3257
|
+
return E_FAIL;
|
|
3258
|
+
|
|
3259
|
+
if (needCallback)
|
|
3260
|
+
if (realOutStream)
|
|
3261
|
+
{
|
|
3262
|
+
RINOK(CopyData_with_Progress(linkFile.Data, linkFile.Data.Size(), realOutStream, lps))
|
|
3263
|
+
}
|
|
3264
|
+
|
|
3265
|
+
if (--linkFile.NumLinks == 0)
|
|
3266
|
+
linkFile.Data.Free();
|
|
3267
|
+
}
|
|
3268
|
+
|
|
3269
|
+
if (needCallback)
|
|
3270
|
+
{
|
|
3271
|
+
RINOK(extractCallback->SetOperationResult(DecoderRes_to_OpRes(linkFile.Res, linkFile.crcOK)))
|
|
3272
|
+
}
|
|
3273
|
+
continue;
|
|
3274
|
+
}
|
|
3275
|
+
|
|
3276
|
+
if (!needCallback)
|
|
3277
|
+
continue;
|
|
3278
|
+
|
|
3279
|
+
if (item->NeedUse_as_CopyLink())
|
|
3280
|
+
{
|
|
3281
|
+
const int opRes = realOutStream ?
|
|
3282
|
+
NExtract::NOperationResult::kUnsupportedMethod:
|
|
3283
|
+
NExtract::NOperationResult::kOK;
|
|
3284
|
+
realOutStream.Release();
|
|
3285
|
+
RINOK(extractCallback->SetOperationResult(opRes))
|
|
3286
|
+
continue;
|
|
3287
|
+
}
|
|
3288
|
+
|
|
3289
|
+
volsInStream->Init(&_arcs, &_items, ref->Item);
|
|
3290
|
+
|
|
3291
|
+
const UInt64 packSize = curPackSize;
|
|
3292
|
+
|
|
3293
|
+
if (item->IsEncrypted())
|
|
3294
|
+
if (!unpacker.getTextPassword)
|
|
3295
|
+
extractCallback->QueryInterface(IID_ICryptoGetTextPassword, (void **)&unpacker.getTextPassword);
|
|
3296
|
+
|
|
3297
|
+
bool wrongPassword;
|
|
3298
|
+
HRESULT result = unpacker.Create(EXTERNAL_CODECS_VARS *item, isSolid, wrongPassword);
|
|
3299
|
+
|
|
3300
|
+
if (wrongPassword)
|
|
3301
|
+
{
|
|
3302
|
+
realOutStream.Release();
|
|
3303
|
+
RINOK(extractCallback->SetOperationResult(NExtract::NOperationResult::kWrongPassword))
|
|
3304
|
+
continue;
|
|
3305
|
+
}
|
|
3306
|
+
|
|
3307
|
+
bool crcOK = true;
|
|
3308
|
+
if (result == S_OK)
|
|
3309
|
+
result = unpacker.Code(*item, _items[ref->Last], packSize, volsInStream, realOutStream, lps, crcOK);
|
|
3310
|
+
realOutStream.Release();
|
|
3311
|
+
if (!volsInStream->CrcIsOK)
|
|
3312
|
+
crcOK = false;
|
|
3313
|
+
|
|
3314
|
+
int opRes = crcOK ?
|
|
3315
|
+
NExtract::NOperationResult::kOK:
|
|
3316
|
+
NExtract::NOperationResult::kCRCError;
|
|
3317
|
+
|
|
3318
|
+
if (result != S_OK)
|
|
3319
|
+
{
|
|
3320
|
+
if (result == S_FALSE)
|
|
3321
|
+
opRes = NExtract::NOperationResult::kDataError;
|
|
3322
|
+
else if (result == E_NOTIMPL)
|
|
3323
|
+
opRes = NExtract::NOperationResult::kUnsupportedMethod;
|
|
3324
|
+
else
|
|
3325
|
+
return result;
|
|
3326
|
+
}
|
|
3327
|
+
|
|
3328
|
+
RINOK(extractCallback->SetOperationResult(opRes))
|
|
3329
|
+
}
|
|
3330
|
+
|
|
3331
|
+
{
|
|
3332
|
+
FOR_VECTOR (k, linkFiles)
|
|
3333
|
+
if (linkFiles[k].NumLinks != 0)
|
|
3334
|
+
return E_FAIL;
|
|
3335
|
+
}
|
|
3336
|
+
|
|
3337
|
+
return S_OK;
|
|
3338
|
+
COM_TRY_END
|
|
3339
|
+
}
|
|
3340
|
+
|
|
3341
|
+
|
|
3342
|
+
CHandler::CHandler()
|
|
3343
|
+
{
|
|
3344
|
+
InitDefaults();
|
|
3345
|
+
}
|
|
3346
|
+
|
|
3347
|
+
void CHandler::InitDefaults()
|
|
3348
|
+
{
|
|
3349
|
+
_needChecksumCheck = true;
|
|
3350
|
+
_memUsage_WasSet = false;
|
|
3351
|
+
_memUsage_Decompress = (UInt64)1 << 32;
|
|
3352
|
+
}
|
|
3353
|
+
|
|
3354
|
+
Z7_COM7F_IMF(CHandler::SetProperties(const wchar_t * const *names, const PROPVARIANT *values, UInt32 numProps))
|
|
3355
|
+
{
|
|
3356
|
+
InitDefaults();
|
|
3357
|
+
|
|
3358
|
+
for (UInt32 i = 0; i < numProps; i++)
|
|
3359
|
+
{
|
|
3360
|
+
UString name = names[i];
|
|
3361
|
+
name.MakeLower_Ascii();
|
|
3362
|
+
if (name.IsEmpty())
|
|
3363
|
+
return E_INVALIDARG;
|
|
3364
|
+
|
|
3365
|
+
const PROPVARIANT &prop = values[i];
|
|
3366
|
+
|
|
3367
|
+
if (name.IsPrefixedBy_Ascii_NoCase("mt"))
|
|
3368
|
+
{
|
|
3369
|
+
}
|
|
3370
|
+
else if (name.IsPrefixedBy_Ascii_NoCase("memx"))
|
|
3371
|
+
{
|
|
3372
|
+
size_t memAvail;
|
|
3373
|
+
if (!NWindows::NSystem::GetRamSize(memAvail))
|
|
3374
|
+
memAvail = (size_t)sizeof(size_t) << 28;
|
|
3375
|
+
UInt64 v;
|
|
3376
|
+
if (!ParseSizeString(name.Ptr(4), prop, memAvail, v))
|
|
3377
|
+
return E_INVALIDARG;
|
|
3378
|
+
_memUsage_Decompress = v;
|
|
3379
|
+
_memUsage_WasSet = true;
|
|
3380
|
+
}
|
|
3381
|
+
else if (name.IsPrefixedBy_Ascii_NoCase("crc"))
|
|
3382
|
+
{
|
|
3383
|
+
name.Delete(0, 3);
|
|
3384
|
+
UInt32 crcSize = 1;
|
|
3385
|
+
RINOK(ParsePropToUInt32(name, prop, crcSize))
|
|
3386
|
+
_needChecksumCheck = (crcSize != 0);
|
|
3387
|
+
}
|
|
3388
|
+
else
|
|
3389
|
+
{
|
|
3390
|
+
return E_INVALIDARG;
|
|
3391
|
+
}
|
|
3392
|
+
}
|
|
3393
|
+
return S_OK;
|
|
3394
|
+
}
|
|
3395
|
+
|
|
3396
|
+
|
|
3397
|
+
IMPL_ISetCompressCodecsInfo
|
|
3398
|
+
|
|
3399
|
+
REGISTER_ARC_I(
|
|
3400
|
+
"Rar5", "rar r00", NULL, 0xCC,
|
|
3401
|
+
kMarker,
|
|
3402
|
+
0,
|
|
3403
|
+
NArcInfoFlags::kFindSignature,
|
|
3404
|
+
NULL)
|
|
3405
|
+
|
|
3406
|
+
}}
|
|
3407
|
+
|
|
3408
|
+
|
|
3409
|
+
Z7_CLASS_IMP_COM_2(
|
|
3410
|
+
CBlake2spHasher
|
|
3411
|
+
, IHasher
|
|
3412
|
+
, ICompressSetCoderProperties
|
|
3413
|
+
)
|
|
3414
|
+
CAlignedBuffer1 _buf;
|
|
3415
|
+
// CBlake2sp _blake;
|
|
3416
|
+
#define Z7_BLACK2S_ALIGN_OBJECT_OFFSET 0
|
|
3417
|
+
CBlake2sp *Obj() { return (CBlake2sp *)(void *)((Byte *)_buf + Z7_BLACK2S_ALIGN_OBJECT_OFFSET); }
|
|
3418
|
+
public:
|
|
3419
|
+
Byte _mtDummy[1 << 7]; // it's public to eliminate clang warning: unused private field
|
|
3420
|
+
CBlake2spHasher():
|
|
3421
|
+
_buf(sizeof(CBlake2sp) + Z7_BLACK2S_ALIGN_OBJECT_OFFSET)
|
|
3422
|
+
{
|
|
3423
|
+
Blake2sp_SetFunction(Obj(), 0);
|
|
3424
|
+
Blake2sp_InitState(Obj());
|
|
3425
|
+
}
|
|
3426
|
+
};
|
|
3427
|
+
|
|
3428
|
+
Z7_COM7F_IMF2(void, CBlake2spHasher::Init())
|
|
3429
|
+
{
|
|
3430
|
+
Blake2sp_InitState(Obj());
|
|
3431
|
+
}
|
|
3432
|
+
|
|
3433
|
+
Z7_COM7F_IMF2(void, CBlake2spHasher::Update(const void *data, UInt32 size))
|
|
3434
|
+
{
|
|
3435
|
+
#if 1
|
|
3436
|
+
Blake2sp_Update(Obj(), (const Byte *)data, (size_t)size);
|
|
3437
|
+
#else
|
|
3438
|
+
// for debug:
|
|
3439
|
+
for (;;)
|
|
3440
|
+
{
|
|
3441
|
+
if (size == 0)
|
|
3442
|
+
return;
|
|
3443
|
+
UInt32 size2 = (size * 0x85EBCA87) % size / 800;
|
|
3444
|
+
// UInt32 size2 = size / 2;
|
|
3445
|
+
if (size2 == 0)
|
|
3446
|
+
size2 = 1;
|
|
3447
|
+
Blake2sp_Update(Obj(), (const Byte *)data, size2);
|
|
3448
|
+
data = (const void *)((const Byte *)data + size2);
|
|
3449
|
+
size -= size2;
|
|
3450
|
+
}
|
|
3451
|
+
#endif
|
|
3452
|
+
}
|
|
3453
|
+
|
|
3454
|
+
Z7_COM7F_IMF2(void, CBlake2spHasher::Final(Byte *digest))
|
|
3455
|
+
{
|
|
3456
|
+
Blake2sp_Final(Obj(), digest);
|
|
3457
|
+
}
|
|
3458
|
+
|
|
3459
|
+
Z7_COM7F_IMF(CBlake2spHasher::SetCoderProperties(const PROPID *propIDs, const PROPVARIANT *coderProps, UInt32 numProps))
|
|
3460
|
+
{
|
|
3461
|
+
unsigned algo = 0;
|
|
3462
|
+
for (UInt32 i = 0; i < numProps; i++)
|
|
3463
|
+
{
|
|
3464
|
+
if (propIDs[i] == NCoderPropID::kDefaultProp)
|
|
3465
|
+
{
|
|
3466
|
+
const PROPVARIANT &prop = coderProps[i];
|
|
3467
|
+
if (prop.vt != VT_UI4)
|
|
3468
|
+
return E_INVALIDARG;
|
|
3469
|
+
/*
|
|
3470
|
+
if (prop.ulVal > Z7_BLAKE2S_ALGO_MAX)
|
|
3471
|
+
return E_NOTIMPL;
|
|
3472
|
+
*/
|
|
3473
|
+
algo = (unsigned)prop.ulVal;
|
|
3474
|
+
}
|
|
3475
|
+
}
|
|
3476
|
+
if (!Blake2sp_SetFunction(Obj(), algo))
|
|
3477
|
+
return E_NOTIMPL;
|
|
3478
|
+
return S_OK;
|
|
3479
|
+
}
|
|
3480
|
+
|
|
3481
|
+
REGISTER_HASHER(CBlake2spHasher, 0x202, "BLAKE2sp", Z7_BLAKE2S_DIGEST_SIZE)
|
|
3482
|
+
|
|
3483
|
+
static struct CBlake2sp_Prepare { CBlake2sp_Prepare() { z7_Black2sp_Prepare(); } } g_Blake2sp_Prepare;
|