7zip-native 0.0.0-stage → 0.0.5
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 +293 -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 +528 -0
- package/dist/index.d.cts +63 -0
- package/dist/index.d.mts +63 -0
- package/dist/index.d.ts +63 -0
- package/dist/index.mjs +524 -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/darwin-arm64/7zip_native.node +0 -0
- package/prebuilds/darwin-arm64/lib7z.dylib +0 -0
- package/prebuilds/darwin-x64/7zip_native.node +0 -0
- package/prebuilds/darwin-x64/lib7z.dylib +0 -0
- package/prebuilds/linux-arm/7z.so +0 -0
- package/prebuilds/linux-arm/7zip_native.node +0 -0
- package/prebuilds/linux-arm64/7z.so +0 -0
- package/prebuilds/linux-arm64/7zip_native.node +0 -0
- package/prebuilds/linux-ia32/7z.so +0 -0
- package/prebuilds/linux-ia32/7zip_native.node +0 -0
- package/prebuilds/linux-x64/7z.so +0 -0
- package/prebuilds/linux-x64/7zip_native.node +0 -0
- package/prebuilds/win32-arm64/7z.dll +0 -0
- package/prebuilds/win32-arm64/7zip_native.node +0 -0
- package/prebuilds/win32-x64/7z.dll +0 -0
- package/prebuilds/win32-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,2008 @@
|
|
|
1
|
+
// WimHandlerOut.cpp
|
|
2
|
+
|
|
3
|
+
#include "StdAfx.h"
|
|
4
|
+
|
|
5
|
+
#include "../../../Common/ComTry.h"
|
|
6
|
+
#include "../../../Common/IntToString.h"
|
|
7
|
+
#include "../../../Common/MyBuffer2.h"
|
|
8
|
+
#include "../../../Common/StringToInt.h"
|
|
9
|
+
#include "../../../Common/UTFConvert.h"
|
|
10
|
+
#include "../../../Common/Wildcard.h"
|
|
11
|
+
|
|
12
|
+
#include "../../../Windows/PropVariant.h"
|
|
13
|
+
#include "../../../Windows/TimeUtils.h"
|
|
14
|
+
|
|
15
|
+
#include "../../Common/LimitedStreams.h"
|
|
16
|
+
#include "../../Common/ProgressUtils.h"
|
|
17
|
+
#include "../../Common/StreamUtils.h"
|
|
18
|
+
#include "../../Common/UniqBlocks.h"
|
|
19
|
+
|
|
20
|
+
#include "../../Crypto/RandGen.h"
|
|
21
|
+
#include "../../Crypto/Sha1Cls.h"
|
|
22
|
+
|
|
23
|
+
#include "../Common/OutStreamWithSha1.h"
|
|
24
|
+
|
|
25
|
+
#include "WimHandler.h"
|
|
26
|
+
|
|
27
|
+
using namespace NWindows;
|
|
28
|
+
|
|
29
|
+
namespace NArchive {
|
|
30
|
+
namespace NWim {
|
|
31
|
+
|
|
32
|
+
static const unsigned k_NumSubVectors = 1 << 12; // must be power of 2
|
|
33
|
+
|
|
34
|
+
struct CSortedIndex
|
|
35
|
+
{
|
|
36
|
+
CObjectVector<CUIntVector> Vectors;
|
|
37
|
+
|
|
38
|
+
CSortedIndex()
|
|
39
|
+
{
|
|
40
|
+
Vectors.ClearAndReserve(k_NumSubVectors);
|
|
41
|
+
for (unsigned i = 0; i < k_NumSubVectors; i++)
|
|
42
|
+
Vectors.AddNew();
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
static int AddUniqHash(const CStreamInfo *streams, CSortedIndex &sorted2,
|
|
47
|
+
const UInt32 * const h, const int streamIndexForInsert)
|
|
48
|
+
{
|
|
49
|
+
CUIntVector &sorted = sorted2.Vectors[GetUi32a(h) & (k_NumSubVectors - 1)];
|
|
50
|
+
unsigned left = 0, right = sorted.Size();
|
|
51
|
+
while (left != right)
|
|
52
|
+
{
|
|
53
|
+
const unsigned mid = (unsigned)(((size_t)left + (size_t)right) / 2);
|
|
54
|
+
const unsigned index = sorted[mid];
|
|
55
|
+
Z7_WIM_SHA1_UI32_COMPARE_LESS_EQUAL_GREATER(h, streams[index].Hash,
|
|
56
|
+
right = mid; ,
|
|
57
|
+
return (int)index; ,
|
|
58
|
+
left = mid + 1; )
|
|
59
|
+
}
|
|
60
|
+
if (streamIndexForInsert != -1)
|
|
61
|
+
sorted.Insert(left, (unsigned)streamIndexForInsert);
|
|
62
|
+
return -1;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
struct CAltStream
|
|
67
|
+
{
|
|
68
|
+
int UpdateIndex;
|
|
69
|
+
int HashIndex;
|
|
70
|
+
UInt64 Size;
|
|
71
|
+
UString Name;
|
|
72
|
+
bool Skip;
|
|
73
|
+
|
|
74
|
+
CAltStream(): UpdateIndex(-1), HashIndex(-1), Skip(false) {}
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
struct CMetaItem
|
|
79
|
+
{
|
|
80
|
+
int UpdateIndex;
|
|
81
|
+
int HashIndex;
|
|
82
|
+
|
|
83
|
+
UInt64 Size;
|
|
84
|
+
FILETIME CTime;
|
|
85
|
+
FILETIME ATime;
|
|
86
|
+
FILETIME MTime;
|
|
87
|
+
UInt64 FileID;
|
|
88
|
+
UInt64 VolID;
|
|
89
|
+
|
|
90
|
+
UString Name;
|
|
91
|
+
UString ShortName;
|
|
92
|
+
|
|
93
|
+
UInt32 Attrib;
|
|
94
|
+
int SecurityId; // -1: means no secutity ID
|
|
95
|
+
bool IsDir;
|
|
96
|
+
bool Skip;
|
|
97
|
+
unsigned NumSkipAltStreams;
|
|
98
|
+
CObjectVector<CAltStream> AltStreams;
|
|
99
|
+
|
|
100
|
+
CByteBuffer Reparse;
|
|
101
|
+
|
|
102
|
+
unsigned GetNumAltStreams() const { return AltStreams.Size() - NumSkipAltStreams; }
|
|
103
|
+
CMetaItem():
|
|
104
|
+
UpdateIndex(-1)
|
|
105
|
+
, HashIndex(-1)
|
|
106
|
+
, Size(0)
|
|
107
|
+
, FileID(0)
|
|
108
|
+
, VolID(0)
|
|
109
|
+
, Attrib(0)
|
|
110
|
+
, SecurityId(-1)
|
|
111
|
+
, IsDir(false)
|
|
112
|
+
, Skip(false)
|
|
113
|
+
, NumSkipAltStreams(0)
|
|
114
|
+
{
|
|
115
|
+
FILETIME_Clear(CTime);
|
|
116
|
+
FILETIME_Clear(ATime);
|
|
117
|
+
FILETIME_Clear(MTime);
|
|
118
|
+
}
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
static int Compare_HardLink_MetaItems(const CMetaItem &a1, const CMetaItem &a2)
|
|
123
|
+
{
|
|
124
|
+
if (a1.VolID < a2.VolID) return -1;
|
|
125
|
+
if (a1.VolID > a2.VolID) return 1;
|
|
126
|
+
if (a1.FileID < a2.FileID) return -1;
|
|
127
|
+
if (a1.FileID > a2.FileID) return 1;
|
|
128
|
+
if (a1.Size < a2.Size) return -1;
|
|
129
|
+
if (a1.Size > a2.Size) return 1;
|
|
130
|
+
return ::CompareFileTime(&a1.MTime, &a2.MTime);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
static int AddToHardLinkList(const CObjectVector<CMetaItem> &metaItems, unsigned indexOfItem, CUIntVector &indexes)
|
|
135
|
+
{
|
|
136
|
+
const CMetaItem &mi = metaItems[indexOfItem];
|
|
137
|
+
unsigned left = 0, right = indexes.Size();
|
|
138
|
+
while (left != right)
|
|
139
|
+
{
|
|
140
|
+
const unsigned mid = (unsigned)(((size_t)left + (size_t)right) / 2);
|
|
141
|
+
const unsigned index = indexes[mid];
|
|
142
|
+
const int comp = Compare_HardLink_MetaItems(mi, metaItems[index]);
|
|
143
|
+
if (comp == 0)
|
|
144
|
+
return (int)index;
|
|
145
|
+
if (comp < 0)
|
|
146
|
+
right = mid;
|
|
147
|
+
else
|
|
148
|
+
left = mid + 1;
|
|
149
|
+
}
|
|
150
|
+
indexes.Insert(left, indexOfItem);
|
|
151
|
+
return -1;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
struct CUpdateItem
|
|
156
|
+
{
|
|
157
|
+
unsigned CallbackIndex; // index in callback
|
|
158
|
+
|
|
159
|
+
int MetaIndex; // index in in MetaItems[]
|
|
160
|
+
|
|
161
|
+
int AltStreamIndex; // index in CMetaItem::AltStreams vector
|
|
162
|
+
// -1: if not alt stream?
|
|
163
|
+
|
|
164
|
+
int InArcIndex; // >= 0, if we use OLD Data
|
|
165
|
+
// -1, if we use NEW Data
|
|
166
|
+
|
|
167
|
+
void Construct()
|
|
168
|
+
{
|
|
169
|
+
MetaIndex = -1;
|
|
170
|
+
AltStreamIndex = -1;
|
|
171
|
+
InArcIndex = -1;
|
|
172
|
+
}
|
|
173
|
+
};
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
struct CDir
|
|
177
|
+
{
|
|
178
|
+
int MetaIndex;
|
|
179
|
+
CObjectVector<CDir> Dirs;
|
|
180
|
+
CUIntVector Files; // indexes in MetaItems[]
|
|
181
|
+
|
|
182
|
+
CDir(): MetaIndex(-1) {}
|
|
183
|
+
unsigned GetNumDirs() const;
|
|
184
|
+
unsigned GetNumFiles() const;
|
|
185
|
+
UInt64 GetTotalSize(const CObjectVector<CMetaItem> &metaItems) const;
|
|
186
|
+
bool FindDir(const CObjectVector<CMetaItem> &items, const UString &name, unsigned &index);
|
|
187
|
+
};
|
|
188
|
+
|
|
189
|
+
/* imagex counts Junctions as files (not as dirs).
|
|
190
|
+
We suppose that it's not correct */
|
|
191
|
+
|
|
192
|
+
unsigned CDir::GetNumDirs() const
|
|
193
|
+
{
|
|
194
|
+
unsigned num = Dirs.Size();
|
|
195
|
+
FOR_VECTOR (i, Dirs)
|
|
196
|
+
num += Dirs[i].GetNumDirs();
|
|
197
|
+
return num;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
unsigned CDir::GetNumFiles() const
|
|
201
|
+
{
|
|
202
|
+
unsigned num = Files.Size();
|
|
203
|
+
FOR_VECTOR (i, Dirs)
|
|
204
|
+
num += Dirs[i].GetNumFiles();
|
|
205
|
+
return num;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
UInt64 CDir::GetTotalSize(const CObjectVector<CMetaItem> &metaItems) const
|
|
209
|
+
{
|
|
210
|
+
UInt64 sum = 0;
|
|
211
|
+
unsigned i;
|
|
212
|
+
for (i = 0; i < Files.Size(); i++)
|
|
213
|
+
sum += metaItems[Files[i]].Size;
|
|
214
|
+
for (i = 0; i < Dirs.Size(); i++)
|
|
215
|
+
sum += Dirs[i].GetTotalSize(metaItems);
|
|
216
|
+
return sum;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
bool CDir::FindDir(const CObjectVector<CMetaItem> &items, const UString &name, unsigned &index)
|
|
220
|
+
{
|
|
221
|
+
unsigned left = 0, right = Dirs.Size();
|
|
222
|
+
while (left != right)
|
|
223
|
+
{
|
|
224
|
+
const unsigned mid = (unsigned)(((size_t)left + (size_t)right) / 2);
|
|
225
|
+
const int comp = CompareFileNames(name, items[Dirs[mid].MetaIndex].Name);
|
|
226
|
+
if (comp == 0)
|
|
227
|
+
{
|
|
228
|
+
index = mid;
|
|
229
|
+
return true;
|
|
230
|
+
}
|
|
231
|
+
if (comp < 0)
|
|
232
|
+
right = mid;
|
|
233
|
+
else
|
|
234
|
+
left = mid + 1;
|
|
235
|
+
}
|
|
236
|
+
index = left;
|
|
237
|
+
return false;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
|
|
241
|
+
Z7_COM7F_IMF(CHandler::GetFileTimeType(UInt32 *type))
|
|
242
|
+
{
|
|
243
|
+
*type = NFileTimeType::kWindows;
|
|
244
|
+
return S_OK;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
|
|
248
|
+
HRESULT CHandler::GetOutProperty(IArchiveUpdateCallback *callback, UInt32 callbackIndex, Int32 arcIndex, PROPID propID, PROPVARIANT *value)
|
|
249
|
+
{
|
|
250
|
+
if (arcIndex != -1)
|
|
251
|
+
return GetProperty((UInt32)arcIndex, propID, value);
|
|
252
|
+
return callback->GetProperty(callbackIndex, propID, value);
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
|
|
256
|
+
HRESULT CHandler::GetTime(IArchiveUpdateCallback *callback, UInt32 callbackIndex, Int32 arcIndex, PROPID propID, FILETIME &ft)
|
|
257
|
+
{
|
|
258
|
+
ft.dwLowDateTime = ft.dwHighDateTime = 0;
|
|
259
|
+
NCOM::CPropVariant prop;
|
|
260
|
+
RINOK(GetOutProperty(callback, callbackIndex, arcIndex, propID, &prop))
|
|
261
|
+
if (prop.vt == VT_FILETIME)
|
|
262
|
+
ft = prop.filetime;
|
|
263
|
+
else if (prop.vt != VT_EMPTY)
|
|
264
|
+
return E_INVALIDARG;
|
|
265
|
+
return S_OK;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
|
|
269
|
+
static HRESULT GetRootTime(
|
|
270
|
+
IArchiveGetRootProps *callback,
|
|
271
|
+
IArchiveGetRootProps *arcRoot,
|
|
272
|
+
PROPID propID, FILETIME &ft)
|
|
273
|
+
{
|
|
274
|
+
NCOM::CPropVariant prop;
|
|
275
|
+
if (callback)
|
|
276
|
+
{
|
|
277
|
+
RINOK(callback->GetRootProp(propID, &prop))
|
|
278
|
+
if (prop.vt == VT_FILETIME)
|
|
279
|
+
{
|
|
280
|
+
ft = prop.filetime;
|
|
281
|
+
return S_OK;
|
|
282
|
+
}
|
|
283
|
+
if (prop.vt != VT_EMPTY)
|
|
284
|
+
return E_INVALIDARG;
|
|
285
|
+
}
|
|
286
|
+
if (arcRoot)
|
|
287
|
+
{
|
|
288
|
+
RINOK(arcRoot->GetRootProp(propID, &prop))
|
|
289
|
+
if (prop.vt == VT_FILETIME)
|
|
290
|
+
{
|
|
291
|
+
ft = prop.filetime;
|
|
292
|
+
return S_OK;
|
|
293
|
+
}
|
|
294
|
+
if (prop.vt != VT_EMPTY)
|
|
295
|
+
return E_INVALIDARG;
|
|
296
|
+
}
|
|
297
|
+
return S_OK;
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
#define Set16(p, d) SetUi16a(p, d) // all calls are aligned
|
|
301
|
+
#define Set32(p, d) SetUi32(p, d)
|
|
302
|
+
#define Set64(p, d) SetUi64(p, d)
|
|
303
|
+
|
|
304
|
+
void CResource::WriteTo(Byte *p) const
|
|
305
|
+
{
|
|
306
|
+
Set64(p, PackSize)
|
|
307
|
+
p[7] = Flags;
|
|
308
|
+
Set64(p + 8, Offset)
|
|
309
|
+
Set64(p + 16, UnpackSize)
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
HRESULT CHeader::WriteToStream(IOutStream *stream) const
|
|
313
|
+
{
|
|
314
|
+
UInt64 buf[(kHeaderSizeMax + 7) / 8];
|
|
315
|
+
Byte *p = (Byte *)(void *)buf;
|
|
316
|
+
memcpy(p, kSignature, kSignatureSize);
|
|
317
|
+
Set32(p + 8, kHeaderSizeMax)
|
|
318
|
+
Set32(p + 0xC, Version)
|
|
319
|
+
Set32(p + 0x10, Flags)
|
|
320
|
+
Set32(p + 0x14, ChunkSize)
|
|
321
|
+
memcpy(p + 0x18, Guid, 16);
|
|
322
|
+
Set16(p + 0x28, PartNumber)
|
|
323
|
+
Set16(p + 0x2A, NumParts)
|
|
324
|
+
Set32(p + 0x2C, NumImages)
|
|
325
|
+
OffsetResource.WriteTo(p + 0x30);
|
|
326
|
+
XmlResource.WriteTo(p + 0x48);
|
|
327
|
+
MetadataResource.WriteTo(p + 0x60);
|
|
328
|
+
IntegrityResource.WriteTo(p + 0x7C);
|
|
329
|
+
Set32(p + 0x78, BootIndex)
|
|
330
|
+
memset(p + 0x94, 0, 60);
|
|
331
|
+
return WriteStream(stream, buf, kHeaderSizeMax);
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
|
|
335
|
+
// (p) is aligned for 2-bytes
|
|
336
|
+
void CStreamInfo::WriteTo(Byte *p) const
|
|
337
|
+
{
|
|
338
|
+
Resource.WriteTo(p);
|
|
339
|
+
Set16(p + 0x18, PartNumber)
|
|
340
|
+
Set32(p + 0x1A, RefCount)
|
|
341
|
+
memcpy(p + 0x1E, Hash, kHashSize);
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
|
|
345
|
+
static void SetFileTimeToMem(Byte *p, const FILETIME &ft)
|
|
346
|
+
{
|
|
347
|
+
Set32(p, ft.dwLowDateTime)
|
|
348
|
+
Set32(p + 4, ft.dwHighDateTime)
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
#if 0 // 1 to use old_7zip scheme
|
|
352
|
+
// imagex and old 7-zip : write additional 2 bytes of padding
|
|
353
|
+
#define GET_SHORT_NAME_BUF_SIZE(len) ((len) == 0 ? 2 : (len) + 4)
|
|
354
|
+
#define GET_ALT_NAME_BUF_SIZE(len) ((len) == 0 ? 0 : (len) + 4)
|
|
355
|
+
#else
|
|
356
|
+
// dism : no additional 2 bytes padding and zero tail
|
|
357
|
+
#define GET_SHORT_NAME_BUF_SIZE(len) ((len) == 0 ? 0 : (len) + 2)
|
|
358
|
+
#define GET_ALT_NAME_BUF_SIZE(len) ((len) + 2)
|
|
359
|
+
#endif
|
|
360
|
+
|
|
361
|
+
#define GET_ALIGNED_SIZE_uint(origSize) (((origSize) + 7) & ~7u)
|
|
362
|
+
#define GET_ALT_STREAM_RECORD_SIZE(nameLen) GET_ALIGNED_SIZE_uint(0x26 + (nameLen))
|
|
363
|
+
|
|
364
|
+
static size_t WriteItem_Dummy(const CMetaItem &item)
|
|
365
|
+
{
|
|
366
|
+
if (item.Skip)
|
|
367
|
+
return 0;
|
|
368
|
+
size_t totalLen;
|
|
369
|
+
{
|
|
370
|
+
const unsigned fileNameLen = item.Name.Len() * 2;
|
|
371
|
+
const unsigned fileNameLen2 = (fileNameLen == 0 ? 0 : fileNameLen + 2);
|
|
372
|
+
const unsigned shortNameLen = item.ShortName.Len() * 2;
|
|
373
|
+
const unsigned shortNameLen2 = GET_SHORT_NAME_BUF_SIZE(shortNameLen);
|
|
374
|
+
totalLen = GET_ALIGNED_SIZE_uint(fileNameLen2 + shortNameLen2 + kDirRecordSize);
|
|
375
|
+
}
|
|
376
|
+
if (item.GetNumAltStreams() != 0)
|
|
377
|
+
{
|
|
378
|
+
if (!item.IsDir)
|
|
379
|
+
{
|
|
380
|
+
const unsigned curLen = GET_ALT_STREAM_RECORD_SIZE(0);
|
|
381
|
+
totalLen += curLen;
|
|
382
|
+
}
|
|
383
|
+
FOR_VECTOR (i, item.AltStreams)
|
|
384
|
+
{
|
|
385
|
+
const CAltStream &ss = item.AltStreams[i];
|
|
386
|
+
if (ss.Skip)
|
|
387
|
+
continue;
|
|
388
|
+
const unsigned fileNameLen = ss.Name.Len() * 2;
|
|
389
|
+
const unsigned fileNameLen2 = GET_ALT_NAME_BUF_SIZE(fileNameLen);
|
|
390
|
+
const unsigned curLen = GET_ALT_STREAM_RECORD_SIZE(fileNameLen2);
|
|
391
|
+
totalLen += curLen;
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
return totalLen;
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
// (p) is aligned for 8-bytes
|
|
398
|
+
static size_t WriteItem(const CStreamInfo *streams, const CMetaItem &item, Byte *p)
|
|
399
|
+
{
|
|
400
|
+
if (item.Skip)
|
|
401
|
+
return 0;
|
|
402
|
+
size_t totalLen;
|
|
403
|
+
{
|
|
404
|
+
unsigned fileNameLen = item.Name.Len() * 2;
|
|
405
|
+
unsigned fileNameLen2 = (fileNameLen == 0 ? 0 : fileNameLen + 2);
|
|
406
|
+
unsigned shortNameLen = item.ShortName.Len() * 2;
|
|
407
|
+
const unsigned shortNameLen2 = GET_SHORT_NAME_BUF_SIZE(shortNameLen);
|
|
408
|
+
totalLen = GET_ALIGNED_SIZE_uint(fileNameLen2 + shortNameLen2 + kDirRecordSize);
|
|
409
|
+
|
|
410
|
+
memset(p, 0, totalLen);
|
|
411
|
+
Set64(p, totalLen)
|
|
412
|
+
Set16(p + 0x62, (UInt16)shortNameLen)
|
|
413
|
+
Set16(p + 0x64, (UInt16)fileNameLen)
|
|
414
|
+
{
|
|
415
|
+
const Byte *dest = p + kDirRecordSize;
|
|
416
|
+
unsigned i;
|
|
417
|
+
const wchar_t *src = item.Name;
|
|
418
|
+
fileNameLen2 /= 2;
|
|
419
|
+
for (i = 0; i < fileNameLen2; src++, dest += 2, i++)
|
|
420
|
+
Set16(dest, (UInt16)*src)
|
|
421
|
+
src = item.ShortName;
|
|
422
|
+
shortNameLen /= 2;
|
|
423
|
+
for (i = 0; i < shortNameLen; src++, dest += 2, i++)
|
|
424
|
+
Set16(dest, (UInt16)*src)
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
Set64(p + 8, item.Attrib)
|
|
428
|
+
Set32(p + 0xC, (UInt32)(Int32)item.SecurityId)
|
|
429
|
+
SetFileTimeToMem(p + 0x28, item.CTime);
|
|
430
|
+
SetFileTimeToMem(p + 0x30, item.ATime);
|
|
431
|
+
SetFileTimeToMem(p + 0x38, item.MTime);
|
|
432
|
+
|
|
433
|
+
/* WIM format probably doesn't support hard links to symbolic links.
|
|
434
|
+
In these cases it just stores symbolic links (REPARSE TAGS).
|
|
435
|
+
Check it in new versions of WIM software form MS !!!
|
|
436
|
+
We also follow that scheme */
|
|
437
|
+
|
|
438
|
+
if (item.Reparse.Size() != 0)
|
|
439
|
+
{
|
|
440
|
+
UInt32 tag = GetUi32(item.Reparse);
|
|
441
|
+
Set32(p + 0x58, tag)
|
|
442
|
+
// Set32(p + 0x5C, 0); // probably it's always ZERO
|
|
443
|
+
}
|
|
444
|
+
else if (item.FileID != 0)
|
|
445
|
+
{
|
|
446
|
+
Set64(p + 0x58, item.FileID)
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
if (item.GetNumAltStreams() == 0)
|
|
450
|
+
{
|
|
451
|
+
if (item.HashIndex >= 0)
|
|
452
|
+
memcpy(p + 0x40, streams[item.HashIndex].Hash, kHashSize);
|
|
453
|
+
}
|
|
454
|
+
else
|
|
455
|
+
{
|
|
456
|
+
Set16(p + 0x60, (UInt16)(item.GetNumAltStreams() + (item.IsDir ? 0 : 1)))
|
|
457
|
+
p += totalLen;
|
|
458
|
+
|
|
459
|
+
if (!item.IsDir)
|
|
460
|
+
{
|
|
461
|
+
const unsigned curLen = GET_ALT_STREAM_RECORD_SIZE(0);
|
|
462
|
+
memset(p, 0, curLen);
|
|
463
|
+
Set64(p, curLen)
|
|
464
|
+
if (item.HashIndex >= 0)
|
|
465
|
+
memcpy(p + 0x10, streams[item.HashIndex].Hash, kHashSize);
|
|
466
|
+
totalLen += curLen;
|
|
467
|
+
p += curLen;
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
FOR_VECTOR (si, item.AltStreams)
|
|
471
|
+
{
|
|
472
|
+
const CAltStream &ss = item.AltStreams[si];
|
|
473
|
+
if (ss.Skip)
|
|
474
|
+
continue;
|
|
475
|
+
|
|
476
|
+
unsigned fileNameLen = ss.Name.Len() * 2;
|
|
477
|
+
const unsigned fileNameLen2 = GET_ALT_NAME_BUF_SIZE(fileNameLen);
|
|
478
|
+
const unsigned curLen = GET_ALT_STREAM_RECORD_SIZE(fileNameLen2);
|
|
479
|
+
memset(p, 0, curLen);
|
|
480
|
+
Set64(p, curLen)
|
|
481
|
+
if (ss.HashIndex >= 0)
|
|
482
|
+
memcpy(p + 0x10, streams[ss.HashIndex].Hash, kHashSize);
|
|
483
|
+
Set16(p + 0x24, (UInt16)fileNameLen)
|
|
484
|
+
const Byte *dest = p + 0x26;
|
|
485
|
+
const wchar_t *src = ss.Name;
|
|
486
|
+
fileNameLen /= 2;
|
|
487
|
+
for (unsigned i = 0; i < fileNameLen; src++, dest += 2, i++)
|
|
488
|
+
Set16(dest, (UInt16)*src)
|
|
489
|
+
totalLen += curLen;
|
|
490
|
+
p += curLen;
|
|
491
|
+
}
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
return totalLen;
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
|
|
498
|
+
struct CDb
|
|
499
|
+
{
|
|
500
|
+
CMetaItem DefaultDirItem;
|
|
501
|
+
const CStreamInfo *Hashes;
|
|
502
|
+
CObjectVector<CMetaItem> MetaItems;
|
|
503
|
+
CRecordVector<CUpdateItem> UpdateItems;
|
|
504
|
+
CUIntVector UpdateIndexes; /* indexes in UpdateItems in order of writing data streams
|
|
505
|
+
to disk (the order of tree items). */
|
|
506
|
+
|
|
507
|
+
size_t WriteTree_Dummy(const CDir &tree) const;
|
|
508
|
+
size_t WriteTree(const CDir &tree, Byte *dest, size_t pos) const;
|
|
509
|
+
void WriteOrderList(const CDir &tree);
|
|
510
|
+
};
|
|
511
|
+
|
|
512
|
+
/*
|
|
513
|
+
imagex, dism and 7zip do same actions for any empty directory:
|
|
514
|
+
if empty directory has no reparse point:
|
|
515
|
+
it creates new empty list : just 8 zero bytes (list terminator).
|
|
516
|
+
if empty directory has reparse point, it doesn't create empty list.
|
|
517
|
+
if there are no user items in image, image still contains 2 directory lists:
|
|
518
|
+
list_0: root_list with single item: root_item (with empty name)
|
|
519
|
+
list_1: empty_list_1 (just 8 zero bytes)
|
|
520
|
+
and there is difference in different programs: for subdirOffset value in root_item in root_list :
|
|
521
|
+
imagex and dism : root_item.subdirOffset == 0
|
|
522
|
+
7zip : root_item.subdirOffset == offset_of_empty_list_1
|
|
523
|
+
*/
|
|
524
|
+
size_t CDb::WriteTree_Dummy(const CDir &tree) const
|
|
525
|
+
{
|
|
526
|
+
unsigned i;
|
|
527
|
+
size_t pos = 0;
|
|
528
|
+
for (i = 0; i < tree.Files.Size(); i++)
|
|
529
|
+
pos += WriteItem_Dummy(MetaItems[tree.Files[i]]);
|
|
530
|
+
for (i = 0; i < tree.Dirs.Size(); i++)
|
|
531
|
+
{
|
|
532
|
+
const CDir &subDir = tree.Dirs[i];
|
|
533
|
+
const CMetaItem &metaItem = MetaItems[subDir.MetaIndex];
|
|
534
|
+
pos += WriteItem_Dummy(MetaItems[subDir.MetaIndex]);
|
|
535
|
+
if ((metaItem.Reparse.Size() == 0)
|
|
536
|
+
|| !subDir.Files.IsEmpty()
|
|
537
|
+
|| !subDir.Dirs.IsEmpty())
|
|
538
|
+
pos += WriteTree_Dummy(subDir);
|
|
539
|
+
}
|
|
540
|
+
return pos + 8;
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
|
|
544
|
+
size_t CDb::WriteTree(const CDir &tree, Byte *dest, size_t pos) const
|
|
545
|
+
{
|
|
546
|
+
unsigned i;
|
|
547
|
+
for (i = 0; i < tree.Files.Size(); i++)
|
|
548
|
+
pos += WriteItem(Hashes, MetaItems[tree.Files[i]], dest + pos);
|
|
549
|
+
|
|
550
|
+
size_t posStart = pos;
|
|
551
|
+
for (i = 0; i < tree.Dirs.Size(); i++)
|
|
552
|
+
pos += WriteItem_Dummy(MetaItems[tree.Dirs[i].MetaIndex]);
|
|
553
|
+
|
|
554
|
+
Set64(dest + pos, 0)
|
|
555
|
+
pos += 8;
|
|
556
|
+
|
|
557
|
+
for (i = 0; i < tree.Dirs.Size(); i++)
|
|
558
|
+
{
|
|
559
|
+
const CDir &subDir = tree.Dirs[i];
|
|
560
|
+
const CMetaItem &metaItem = MetaItems[subDir.MetaIndex];
|
|
561
|
+
const size_t len = WriteItem(Hashes, metaItem, dest + posStart);
|
|
562
|
+
if ((metaItem.Reparse.Size() == 0)
|
|
563
|
+
|| !subDir.Files.IsEmpty()
|
|
564
|
+
|| !subDir.Dirs.IsEmpty())
|
|
565
|
+
{
|
|
566
|
+
Set64(dest + posStart + 0x10, pos) // subdirOffset
|
|
567
|
+
pos = WriteTree(subDir, dest, pos);
|
|
568
|
+
}
|
|
569
|
+
posStart += len;
|
|
570
|
+
}
|
|
571
|
+
return pos;
|
|
572
|
+
}
|
|
573
|
+
|
|
574
|
+
|
|
575
|
+
void CDb::WriteOrderList(const CDir &tree)
|
|
576
|
+
{
|
|
577
|
+
if (tree.MetaIndex >= 0)
|
|
578
|
+
{
|
|
579
|
+
const CMetaItem &mi = MetaItems[tree.MetaIndex];
|
|
580
|
+
if (mi.UpdateIndex >= 0)
|
|
581
|
+
UpdateIndexes.Add((unsigned)mi.UpdateIndex);
|
|
582
|
+
FOR_VECTOR (si, mi.AltStreams)
|
|
583
|
+
UpdateIndexes.Add((unsigned)mi.AltStreams[si].UpdateIndex);
|
|
584
|
+
}
|
|
585
|
+
|
|
586
|
+
unsigned i;
|
|
587
|
+
for (i = 0; i < tree.Files.Size(); i++)
|
|
588
|
+
{
|
|
589
|
+
const CMetaItem &mi = MetaItems[tree.Files[i]];
|
|
590
|
+
UpdateIndexes.Add((unsigned)mi.UpdateIndex);
|
|
591
|
+
FOR_VECTOR (si, mi.AltStreams)
|
|
592
|
+
UpdateIndexes.Add((unsigned)mi.AltStreams[si].UpdateIndex);
|
|
593
|
+
}
|
|
594
|
+
|
|
595
|
+
for (i = 0; i < tree.Dirs.Size(); i++)
|
|
596
|
+
WriteOrderList(tree.Dirs[i]);
|
|
597
|
+
}
|
|
598
|
+
|
|
599
|
+
|
|
600
|
+
static void AddTag_ToString(AString &s, const char *name, const char *value)
|
|
601
|
+
{
|
|
602
|
+
s.Add_Char('<');
|
|
603
|
+
s += name;
|
|
604
|
+
s.Add_Char('>');
|
|
605
|
+
s += value;
|
|
606
|
+
s.Add_Char('<');
|
|
607
|
+
s.Add_Slash();
|
|
608
|
+
s += name;
|
|
609
|
+
s.Add_Char('>');
|
|
610
|
+
}
|
|
611
|
+
|
|
612
|
+
|
|
613
|
+
static void AddTagUInt64_ToString(AString &s, const char *name, UInt64 value)
|
|
614
|
+
{
|
|
615
|
+
char temp[32];
|
|
616
|
+
ConvertUInt64ToString(value, temp);
|
|
617
|
+
AddTag_ToString(s, name, temp);
|
|
618
|
+
}
|
|
619
|
+
|
|
620
|
+
|
|
621
|
+
static CXmlItem &AddUniqueTag(CXmlItem &parentItem, const char *name)
|
|
622
|
+
{
|
|
623
|
+
const int index = parentItem.FindSubTag(name);
|
|
624
|
+
if (index < 0)
|
|
625
|
+
{
|
|
626
|
+
CXmlItem &subItem = parentItem.SubItems.AddNew();
|
|
627
|
+
subItem.IsTag = true;
|
|
628
|
+
subItem.Name = name;
|
|
629
|
+
return subItem;
|
|
630
|
+
}
|
|
631
|
+
CXmlItem &subItem = parentItem.SubItems[index];
|
|
632
|
+
subItem.SubItems.Clear();
|
|
633
|
+
return subItem;
|
|
634
|
+
}
|
|
635
|
+
|
|
636
|
+
|
|
637
|
+
static void AddTag_UInt64_2(CXmlItem &item, UInt64 value)
|
|
638
|
+
{
|
|
639
|
+
CXmlItem &subItem = item.SubItems.AddNew();
|
|
640
|
+
subItem.IsTag = false;
|
|
641
|
+
char temp[32];
|
|
642
|
+
ConvertUInt64ToString(value, temp);
|
|
643
|
+
subItem.Name = temp;
|
|
644
|
+
}
|
|
645
|
+
|
|
646
|
+
|
|
647
|
+
static void AddTag_UInt64(CXmlItem &parentItem, const char *name, UInt64 value)
|
|
648
|
+
{
|
|
649
|
+
AddTag_UInt64_2(AddUniqueTag(parentItem, name), value);
|
|
650
|
+
}
|
|
651
|
+
|
|
652
|
+
|
|
653
|
+
static void AddTag_Hex(CXmlItem &item, const char *name, UInt32 value)
|
|
654
|
+
{
|
|
655
|
+
item.IsTag = true;
|
|
656
|
+
item.Name = name;
|
|
657
|
+
char temp[16];
|
|
658
|
+
temp[0] = '0';
|
|
659
|
+
temp[1] = 'x';
|
|
660
|
+
ConvertUInt32ToHex8Digits(value, temp + 2);
|
|
661
|
+
CXmlItem &subItem = item.SubItems.AddNew();
|
|
662
|
+
subItem.IsTag = false;
|
|
663
|
+
subItem.Name = temp;
|
|
664
|
+
}
|
|
665
|
+
|
|
666
|
+
|
|
667
|
+
static void AddTag_Time_2(CXmlItem &item, const FILETIME &ft)
|
|
668
|
+
{
|
|
669
|
+
AddTag_Hex(item.SubItems.AddNew(), "HIGHPART", ft.dwHighDateTime);
|
|
670
|
+
AddTag_Hex(item.SubItems.AddNew(), "LOWPART", ft.dwLowDateTime);
|
|
671
|
+
}
|
|
672
|
+
|
|
673
|
+
|
|
674
|
+
static void AddTag_Time(CXmlItem &parentItem, const char *name, const FILETIME &ft)
|
|
675
|
+
{
|
|
676
|
+
AddTag_Time_2(AddUniqueTag(parentItem, name), ft);
|
|
677
|
+
}
|
|
678
|
+
|
|
679
|
+
|
|
680
|
+
static void AddTag_String_IfEmpty(CXmlItem &parentItem, const char *name, const char *value)
|
|
681
|
+
{
|
|
682
|
+
if (parentItem.FindSubTag(name) >= 0)
|
|
683
|
+
return;
|
|
684
|
+
CXmlItem &tag = parentItem.SubItems.AddNew();
|
|
685
|
+
tag.IsTag = true;
|
|
686
|
+
tag.Name = name;
|
|
687
|
+
CXmlItem &subItem = tag.SubItems.AddNew();
|
|
688
|
+
subItem.IsTag = false;
|
|
689
|
+
subItem.Name = value;
|
|
690
|
+
}
|
|
691
|
+
|
|
692
|
+
|
|
693
|
+
void CHeader::SetDefaultFields(bool useLZX)
|
|
694
|
+
{
|
|
695
|
+
Version = k_Version_NonSolid;
|
|
696
|
+
Flags = NHeaderFlags::kReparsePointFixup;
|
|
697
|
+
ChunkSize = 0;
|
|
698
|
+
if (useLZX)
|
|
699
|
+
{
|
|
700
|
+
Flags |= NHeaderFlags::kCompression | NHeaderFlags::kLZX;
|
|
701
|
+
ChunkSize = kChunkSize;
|
|
702
|
+
ChunkSizeBits = kChunkSizeBits;
|
|
703
|
+
}
|
|
704
|
+
MY_RAND_GEN(Guid, 16);
|
|
705
|
+
PartNumber = 1;
|
|
706
|
+
NumParts = 1;
|
|
707
|
+
NumImages = 1;
|
|
708
|
+
BootIndex = 0;
|
|
709
|
+
OffsetResource.Clear();
|
|
710
|
+
XmlResource.Clear();
|
|
711
|
+
MetadataResource.Clear();
|
|
712
|
+
IntegrityResource.Clear();
|
|
713
|
+
}
|
|
714
|
+
|
|
715
|
+
|
|
716
|
+
static void AddTrees(CObjectVector<CDir> &trees, CObjectVector<CMetaItem> &metaItems, const CMetaItem &ri, int curTreeIndex)
|
|
717
|
+
{
|
|
718
|
+
while (curTreeIndex >= (int)trees.Size())
|
|
719
|
+
trees.AddNew().Dirs.AddNew().MetaIndex = (int)metaItems.Add(ri);
|
|
720
|
+
}
|
|
721
|
+
|
|
722
|
+
|
|
723
|
+
#define IS_LETTER_CHAR(c) (((c) >= 'a' && (c) <= 'z') || ((c) >= 'A' && (c) <= 'Z'))
|
|
724
|
+
|
|
725
|
+
|
|
726
|
+
|
|
727
|
+
Z7_COM7F_IMF(CHandler::UpdateItems(ISequentialOutStream *outSeqStream, UInt32 numItems, IArchiveUpdateCallback *callback))
|
|
728
|
+
{
|
|
729
|
+
COM_TRY_BEGIN
|
|
730
|
+
|
|
731
|
+
if (!IsUpdateSupported())
|
|
732
|
+
return E_NOTIMPL;
|
|
733
|
+
|
|
734
|
+
const bool isUpdate = (_volumes.Size() != 0);
|
|
735
|
+
int defaultImageIndex = _defaultImageNumber - 1;
|
|
736
|
+
bool showImageNumber;
|
|
737
|
+
|
|
738
|
+
if (isUpdate)
|
|
739
|
+
{
|
|
740
|
+
showImageNumber = _showImageNumber;
|
|
741
|
+
if (!showImageNumber)
|
|
742
|
+
defaultImageIndex = _db.IndexOfUserImage;
|
|
743
|
+
}
|
|
744
|
+
else
|
|
745
|
+
{
|
|
746
|
+
showImageNumber = (_set_use_ShowImageNumber && _set_showImageNumber);
|
|
747
|
+
if (!showImageNumber)
|
|
748
|
+
defaultImageIndex = 0;
|
|
749
|
+
}
|
|
750
|
+
|
|
751
|
+
if (defaultImageIndex >= kNumImagesMaxUpdate)
|
|
752
|
+
return E_NOTIMPL;
|
|
753
|
+
|
|
754
|
+
CMyComPtr<IOutStream> outStream;
|
|
755
|
+
RINOK(outSeqStream->QueryInterface(IID_IOutStream, (void **)&outStream))
|
|
756
|
+
if (!outStream)
|
|
757
|
+
return E_NOTIMPL;
|
|
758
|
+
if (!callback)
|
|
759
|
+
return E_FAIL;
|
|
760
|
+
|
|
761
|
+
CDb db;
|
|
762
|
+
CObjectVector<CDir> trees;
|
|
763
|
+
|
|
764
|
+
CMetaItem ri; // default DIR item
|
|
765
|
+
FILETIME ftCur;
|
|
766
|
+
NTime::GetCurUtcFileTime(ftCur);
|
|
767
|
+
// ri.MTime = ri.ATime = ri.CTime = ftCur;
|
|
768
|
+
ri.Attrib = FILE_ATTRIBUTE_DIRECTORY;
|
|
769
|
+
ri.IsDir = true;
|
|
770
|
+
|
|
771
|
+
|
|
772
|
+
// ---------- Detect changed images ----------
|
|
773
|
+
|
|
774
|
+
unsigned i;
|
|
775
|
+
CBoolVector isChangedImage;
|
|
776
|
+
{
|
|
777
|
+
CUIntVector numUnchangedItemsInImage;
|
|
778
|
+
for (i = 0; i < _db.Images.Size(); i++)
|
|
779
|
+
{
|
|
780
|
+
numUnchangedItemsInImage.Add(0);
|
|
781
|
+
isChangedImage.Add(false);
|
|
782
|
+
}
|
|
783
|
+
|
|
784
|
+
for (i = 0; i < numItems; i++)
|
|
785
|
+
{
|
|
786
|
+
UInt32 indexInArchive;
|
|
787
|
+
Int32 newData, newProps;
|
|
788
|
+
RINOK(callback->GetUpdateItemInfo(i, &newData, &newProps, &indexInArchive))
|
|
789
|
+
if (newProps == 0)
|
|
790
|
+
{
|
|
791
|
+
if (indexInArchive >= _db.SortedItems.Size())
|
|
792
|
+
continue;
|
|
793
|
+
const CItem &item = _db.Items[_db.SortedItems[indexInArchive]];
|
|
794
|
+
if (newData == 0)
|
|
795
|
+
{
|
|
796
|
+
if (item.ImageIndex >= 0)
|
|
797
|
+
numUnchangedItemsInImage[item.ImageIndex]++;
|
|
798
|
+
}
|
|
799
|
+
else
|
|
800
|
+
{
|
|
801
|
+
// oldProps & newData. Current version of 7-Zip doesn't use it
|
|
802
|
+
if (item.ImageIndex >= 0)
|
|
803
|
+
isChangedImage[item.ImageIndex] = true;
|
|
804
|
+
}
|
|
805
|
+
}
|
|
806
|
+
else if (!showImageNumber)
|
|
807
|
+
{
|
|
808
|
+
if (defaultImageIndex >= 0 && defaultImageIndex < (int)isChangedImage.Size())
|
|
809
|
+
isChangedImage[defaultImageIndex] = true;
|
|
810
|
+
}
|
|
811
|
+
else
|
|
812
|
+
{
|
|
813
|
+
NCOM::CPropVariant prop;
|
|
814
|
+
RINOK(callback->GetProperty(i, kpidPath, &prop))
|
|
815
|
+
|
|
816
|
+
if (prop.vt != VT_BSTR)
|
|
817
|
+
return E_INVALIDARG;
|
|
818
|
+
const wchar_t *path = prop.bstrVal;
|
|
819
|
+
if (!path)
|
|
820
|
+
return E_INVALIDARG;
|
|
821
|
+
|
|
822
|
+
const wchar_t *end;
|
|
823
|
+
UInt64 val = ConvertStringToUInt64(path, &end);
|
|
824
|
+
if (end == path)
|
|
825
|
+
return E_INVALIDARG;
|
|
826
|
+
if (val == 0 || val > kNumImagesMaxUpdate)
|
|
827
|
+
return E_INVALIDARG;
|
|
828
|
+
wchar_t c = *end;
|
|
829
|
+
if (c != 0 && c != ':' && c != L'/' && c != WCHAR_PATH_SEPARATOR)
|
|
830
|
+
return E_INVALIDARG;
|
|
831
|
+
unsigned imageIndex = (unsigned)val - 1;
|
|
832
|
+
if (imageIndex < _db.Images.Size())
|
|
833
|
+
isChangedImage[imageIndex] = true;
|
|
834
|
+
if (_defaultImageNumber > 0 && val != (unsigned)_defaultImageNumber)
|
|
835
|
+
return E_INVALIDARG;
|
|
836
|
+
}
|
|
837
|
+
}
|
|
838
|
+
|
|
839
|
+
for (i = 0; i < _db.Images.Size(); i++)
|
|
840
|
+
if (!isChangedImage[i])
|
|
841
|
+
isChangedImage[i] = _db.GetNumUserItemsInImage(i) != numUnchangedItemsInImage[i];
|
|
842
|
+
}
|
|
843
|
+
|
|
844
|
+
if (defaultImageIndex >= 0)
|
|
845
|
+
{
|
|
846
|
+
for (i = 0; i < _db.Images.Size(); i++)
|
|
847
|
+
if ((int)i != defaultImageIndex)
|
|
848
|
+
isChangedImage[i] = false;
|
|
849
|
+
}
|
|
850
|
+
|
|
851
|
+
CMyComPtr<IArchiveGetRawProps> getRawProps;
|
|
852
|
+
callback->QueryInterface(IID_IArchiveGetRawProps, (void **)&getRawProps);
|
|
853
|
+
|
|
854
|
+
CMyComPtr<IArchiveGetRootProps> getRootProps;
|
|
855
|
+
callback->QueryInterface(IID_IArchiveGetRootProps, (void **)&getRootProps);
|
|
856
|
+
|
|
857
|
+
CObjectVector<CUniqBlocks> secureBlocks;
|
|
858
|
+
|
|
859
|
+
if (!showImageNumber && (getRootProps || isUpdate) &&
|
|
860
|
+
(
|
|
861
|
+
defaultImageIndex >= (int)isChangedImage.Size()
|
|
862
|
+
|| defaultImageIndex < 0 // test it
|
|
863
|
+
|| isChangedImage[defaultImageIndex]
|
|
864
|
+
))
|
|
865
|
+
{
|
|
866
|
+
// Fill Root Item: Metadata and security
|
|
867
|
+
CMetaItem rootItem = ri;
|
|
868
|
+
{
|
|
869
|
+
const void *data = NULL;
|
|
870
|
+
UInt32 dataSize = 0;
|
|
871
|
+
UInt32 propType = 0;
|
|
872
|
+
if (getRootProps)
|
|
873
|
+
{
|
|
874
|
+
RINOK(getRootProps->GetRootRawProp(kpidNtSecure, &data, &dataSize, &propType))
|
|
875
|
+
}
|
|
876
|
+
if (dataSize == 0 && isUpdate)
|
|
877
|
+
{
|
|
878
|
+
RINOK(GetRootRawProp(kpidNtSecure, &data, &dataSize, &propType))
|
|
879
|
+
}
|
|
880
|
+
if (dataSize != 0)
|
|
881
|
+
{
|
|
882
|
+
if (propType != NPropDataType::kRaw)
|
|
883
|
+
return E_FAIL;
|
|
884
|
+
while (defaultImageIndex >= (int)secureBlocks.Size())
|
|
885
|
+
secureBlocks.AddNew();
|
|
886
|
+
CUniqBlocks &secUniqBlocks = secureBlocks[defaultImageIndex];
|
|
887
|
+
rootItem.SecurityId = (int)secUniqBlocks.AddUniq((const Byte *)data, dataSize);
|
|
888
|
+
}
|
|
889
|
+
}
|
|
890
|
+
|
|
891
|
+
IArchiveGetRootProps *thisGetRoot = isUpdate ? this : NULL;
|
|
892
|
+
|
|
893
|
+
if (_timeOptions.Write_CTime.Val) RINOK(GetRootTime(getRootProps, thisGetRoot, kpidCTime, rootItem.CTime))
|
|
894
|
+
if (_timeOptions.Write_ATime.Val) RINOK(GetRootTime(getRootProps, thisGetRoot, kpidATime, rootItem.ATime))
|
|
895
|
+
if (_timeOptions.Write_MTime.Val) RINOK(GetRootTime(getRootProps, thisGetRoot, kpidMTime, rootItem.MTime))
|
|
896
|
+
|
|
897
|
+
{
|
|
898
|
+
NCOM::CPropVariant prop;
|
|
899
|
+
if (getRootProps)
|
|
900
|
+
{
|
|
901
|
+
RINOK(getRootProps->GetRootProp(kpidAttrib, &prop))
|
|
902
|
+
if (prop.vt == VT_UI4)
|
|
903
|
+
rootItem.Attrib = prop.ulVal;
|
|
904
|
+
else if (prop.vt != VT_EMPTY)
|
|
905
|
+
return E_INVALIDARG;
|
|
906
|
+
}
|
|
907
|
+
if (prop.vt == VT_EMPTY && thisGetRoot)
|
|
908
|
+
{
|
|
909
|
+
RINOK(GetRootProp(kpidAttrib, &prop))
|
|
910
|
+
if (prop.vt == VT_UI4)
|
|
911
|
+
rootItem.Attrib = prop.ulVal;
|
|
912
|
+
else if (prop.vt != VT_EMPTY)
|
|
913
|
+
return E_INVALIDARG;
|
|
914
|
+
}
|
|
915
|
+
rootItem.Attrib |= FILE_ATTRIBUTE_DIRECTORY;
|
|
916
|
+
}
|
|
917
|
+
// rootItem.Name = "ROOT_ITEM"; // for debug
|
|
918
|
+
// rootItem.ShortName = "SHORT_ROOT_ITEM"; // for debug
|
|
919
|
+
AddTrees(trees, db.MetaItems, ri, defaultImageIndex); // for debug
|
|
920
|
+
db.MetaItems[trees[defaultImageIndex].Dirs[0].MetaIndex] = rootItem;
|
|
921
|
+
}
|
|
922
|
+
|
|
923
|
+
// ---------- Request Metadata for changed items ----------
|
|
924
|
+
|
|
925
|
+
UString fileName;
|
|
926
|
+
|
|
927
|
+
for (i = 0; i < numItems; i++)
|
|
928
|
+
{
|
|
929
|
+
CUpdateItem ui;
|
|
930
|
+
ui.Construct();
|
|
931
|
+
UInt32 indexInArchive;
|
|
932
|
+
Int32 newData, newProps;
|
|
933
|
+
RINOK(callback->GetUpdateItemInfo(i, &newData, &newProps, &indexInArchive))
|
|
934
|
+
|
|
935
|
+
if (newData == 0 || newProps == 0)
|
|
936
|
+
{
|
|
937
|
+
if (indexInArchive >= _db.SortedItems.Size())
|
|
938
|
+
continue;
|
|
939
|
+
|
|
940
|
+
const CItem &item = _db.Items[_db.SortedItems[indexInArchive]];
|
|
941
|
+
|
|
942
|
+
if (item.ImageIndex >= 0)
|
|
943
|
+
{
|
|
944
|
+
if (!isChangedImage[item.ImageIndex])
|
|
945
|
+
{
|
|
946
|
+
if (newData == 0 && newProps == 0)
|
|
947
|
+
continue;
|
|
948
|
+
return E_FAIL;
|
|
949
|
+
}
|
|
950
|
+
}
|
|
951
|
+
else
|
|
952
|
+
{
|
|
953
|
+
// if deleted item was not renamed, we just skip it
|
|
954
|
+
if (newProps == 0)
|
|
955
|
+
continue;
|
|
956
|
+
if (item.StreamIndex >= 0)
|
|
957
|
+
{
|
|
958
|
+
// we don't support property change for SolidBig streams
|
|
959
|
+
if (_db.DataStreams[item.StreamIndex].Resource.IsSolidBig())
|
|
960
|
+
return E_NOTIMPL;
|
|
961
|
+
}
|
|
962
|
+
}
|
|
963
|
+
|
|
964
|
+
if (newData == 0)
|
|
965
|
+
ui.InArcIndex = (Int32)indexInArchive;
|
|
966
|
+
}
|
|
967
|
+
|
|
968
|
+
// we set arcIndex only if we must use old props
|
|
969
|
+
const Int32 arcIndex = (newProps ? -1 : (Int32)indexInArchive);
|
|
970
|
+
|
|
971
|
+
bool isDir = false;
|
|
972
|
+
{
|
|
973
|
+
NCOM::CPropVariant prop;
|
|
974
|
+
RINOK(GetOutProperty(callback, i, arcIndex, kpidIsDir, &prop))
|
|
975
|
+
if (prop.vt == VT_BOOL)
|
|
976
|
+
isDir = (prop.boolVal != VARIANT_FALSE);
|
|
977
|
+
else if (prop.vt != VT_EMPTY)
|
|
978
|
+
return E_INVALIDARG;
|
|
979
|
+
}
|
|
980
|
+
|
|
981
|
+
bool isAltStream = false;
|
|
982
|
+
{
|
|
983
|
+
NCOM::CPropVariant prop;
|
|
984
|
+
RINOK(GetOutProperty(callback, i, arcIndex, kpidIsAltStream, &prop))
|
|
985
|
+
if (prop.vt == VT_BOOL)
|
|
986
|
+
isAltStream = (prop.boolVal != VARIANT_FALSE);
|
|
987
|
+
else if (prop.vt != VT_EMPTY)
|
|
988
|
+
return E_INVALIDARG;
|
|
989
|
+
}
|
|
990
|
+
|
|
991
|
+
if (isDir && isAltStream)
|
|
992
|
+
return E_INVALIDARG;
|
|
993
|
+
|
|
994
|
+
UInt64 size = 0;
|
|
995
|
+
UInt64 iNode = 0;
|
|
996
|
+
|
|
997
|
+
if (!isDir)
|
|
998
|
+
{
|
|
999
|
+
if (!newData)
|
|
1000
|
+
{
|
|
1001
|
+
NCOM::CPropVariant prop;
|
|
1002
|
+
GetProperty(indexInArchive, kpidINode, &prop);
|
|
1003
|
+
if (prop.vt == VT_UI8)
|
|
1004
|
+
iNode = prop.uhVal.QuadPart;
|
|
1005
|
+
}
|
|
1006
|
+
|
|
1007
|
+
NCOM::CPropVariant prop;
|
|
1008
|
+
|
|
1009
|
+
if (newData)
|
|
1010
|
+
{
|
|
1011
|
+
RINOK(callback->GetProperty(i, kpidSize, &prop))
|
|
1012
|
+
}
|
|
1013
|
+
else
|
|
1014
|
+
{
|
|
1015
|
+
RINOK(GetProperty(indexInArchive, kpidSize, &prop))
|
|
1016
|
+
}
|
|
1017
|
+
|
|
1018
|
+
if (prop.vt == VT_UI8)
|
|
1019
|
+
size = prop.uhVal.QuadPart;
|
|
1020
|
+
else if (prop.vt != VT_EMPTY)
|
|
1021
|
+
return E_INVALIDARG;
|
|
1022
|
+
}
|
|
1023
|
+
|
|
1024
|
+
{
|
|
1025
|
+
NCOM::CPropVariant propPath;
|
|
1026
|
+
const wchar_t *path = NULL;
|
|
1027
|
+
RINOK(GetOutProperty(callback, i, arcIndex, kpidPath, &propPath))
|
|
1028
|
+
if (propPath.vt == VT_BSTR)
|
|
1029
|
+
path = propPath.bstrVal;
|
|
1030
|
+
else if (propPath.vt != VT_EMPTY)
|
|
1031
|
+
return E_INVALIDARG;
|
|
1032
|
+
// path = L""; // for debug only
|
|
1033
|
+
|
|
1034
|
+
if (!path)
|
|
1035
|
+
return E_INVALIDARG;
|
|
1036
|
+
|
|
1037
|
+
CDir *curItem = NULL;
|
|
1038
|
+
bool isRootImageDir = false;
|
|
1039
|
+
fileName.Empty();
|
|
1040
|
+
|
|
1041
|
+
int imageIndex;
|
|
1042
|
+
|
|
1043
|
+
if (!showImageNumber)
|
|
1044
|
+
{
|
|
1045
|
+
imageIndex = defaultImageIndex;
|
|
1046
|
+
AddTrees(trees, db.MetaItems, ri, imageIndex);
|
|
1047
|
+
curItem = &trees[imageIndex].Dirs[0];
|
|
1048
|
+
}
|
|
1049
|
+
else
|
|
1050
|
+
{
|
|
1051
|
+
const wchar_t *end;
|
|
1052
|
+
UInt64 val = ConvertStringToUInt64(path, &end);
|
|
1053
|
+
if (end == path)
|
|
1054
|
+
return E_INVALIDARG;
|
|
1055
|
+
if (val == 0 || val > kNumImagesMaxUpdate)
|
|
1056
|
+
return E_INVALIDARG;
|
|
1057
|
+
|
|
1058
|
+
imageIndex = (int)val - 1;
|
|
1059
|
+
if (imageIndex < (int)isChangedImage.Size())
|
|
1060
|
+
if (!isChangedImage[imageIndex])
|
|
1061
|
+
return E_FAIL;
|
|
1062
|
+
|
|
1063
|
+
AddTrees(trees, db.MetaItems, ri, imageIndex);
|
|
1064
|
+
curItem = &trees[imageIndex].Dirs[0];
|
|
1065
|
+
wchar_t c = *end;
|
|
1066
|
+
|
|
1067
|
+
if (c == 0)
|
|
1068
|
+
{
|
|
1069
|
+
if (!isDir || isAltStream)
|
|
1070
|
+
return E_INVALIDARG;
|
|
1071
|
+
ui.MetaIndex = curItem->MetaIndex;
|
|
1072
|
+
isRootImageDir = true;
|
|
1073
|
+
}
|
|
1074
|
+
else if (c == ':')
|
|
1075
|
+
{
|
|
1076
|
+
if (isDir || !isAltStream)
|
|
1077
|
+
return E_INVALIDARG;
|
|
1078
|
+
ui.MetaIndex = curItem->MetaIndex;
|
|
1079
|
+
CAltStream ss;
|
|
1080
|
+
ss.Size = size;
|
|
1081
|
+
ss.Name = end + 1;
|
|
1082
|
+
ss.UpdateIndex = (int)db.UpdateItems.Size();
|
|
1083
|
+
ui.AltStreamIndex = (int)db.MetaItems[ui.MetaIndex].AltStreams.Add(ss);
|
|
1084
|
+
}
|
|
1085
|
+
else if (c == WCHAR_PATH_SEPARATOR || c == L'/')
|
|
1086
|
+
{
|
|
1087
|
+
path = end + 1;
|
|
1088
|
+
if (*path == 0)
|
|
1089
|
+
return E_INVALIDARG;
|
|
1090
|
+
}
|
|
1091
|
+
else
|
|
1092
|
+
return E_INVALIDARG;
|
|
1093
|
+
}
|
|
1094
|
+
|
|
1095
|
+
if (ui.MetaIndex < 0)
|
|
1096
|
+
{
|
|
1097
|
+
for (;;)
|
|
1098
|
+
{
|
|
1099
|
+
const wchar_t c = *path++;
|
|
1100
|
+
if (c == 0)
|
|
1101
|
+
break;
|
|
1102
|
+
if (c == WCHAR_PATH_SEPARATOR || c == L'/')
|
|
1103
|
+
{
|
|
1104
|
+
unsigned indexOfDir;
|
|
1105
|
+
if (!curItem->FindDir(db.MetaItems, fileName, indexOfDir))
|
|
1106
|
+
{
|
|
1107
|
+
CDir &dir = curItem->Dirs.InsertNew(indexOfDir);
|
|
1108
|
+
dir.MetaIndex = (int)db.MetaItems.Add(ri);
|
|
1109
|
+
db.MetaItems.Back().Name = fileName;
|
|
1110
|
+
}
|
|
1111
|
+
curItem = &curItem->Dirs[indexOfDir];
|
|
1112
|
+
fileName.Empty();
|
|
1113
|
+
}
|
|
1114
|
+
else
|
|
1115
|
+
{
|
|
1116
|
+
/*
|
|
1117
|
+
#if WCHAR_MAX > 0xffff
|
|
1118
|
+
if (c >= 0x10000)
|
|
1119
|
+
{
|
|
1120
|
+
c -= 0x10000;
|
|
1121
|
+
|
|
1122
|
+
if (c < (1 << 20))
|
|
1123
|
+
{
|
|
1124
|
+
wchar_t c0 = 0xd800 + ((c >> 10) & 0x3FF);
|
|
1125
|
+
fileName += c0;
|
|
1126
|
+
c = 0xdc00 + (c & 0x3FF);
|
|
1127
|
+
}
|
|
1128
|
+
else
|
|
1129
|
+
c = '_'; // we change character unsupported by UTF16
|
|
1130
|
+
}
|
|
1131
|
+
#endif
|
|
1132
|
+
*/
|
|
1133
|
+
|
|
1134
|
+
fileName += c;
|
|
1135
|
+
}
|
|
1136
|
+
}
|
|
1137
|
+
|
|
1138
|
+
if (isAltStream)
|
|
1139
|
+
{
|
|
1140
|
+
int colonPos = fileName.Find(L':');
|
|
1141
|
+
if (colonPos < 0)
|
|
1142
|
+
return E_INVALIDARG;
|
|
1143
|
+
|
|
1144
|
+
// we want to support cases of c::substream, where c: is drive name
|
|
1145
|
+
if (colonPos == 1 && fileName[2] == L':' && IS_LETTER_CHAR(fileName[0]))
|
|
1146
|
+
colonPos = 2;
|
|
1147
|
+
const UString mainName = fileName.Left((unsigned)colonPos);
|
|
1148
|
+
unsigned indexOfDir;
|
|
1149
|
+
|
|
1150
|
+
if (mainName.IsEmpty())
|
|
1151
|
+
ui.MetaIndex = curItem->MetaIndex;
|
|
1152
|
+
else if (curItem->FindDir(db.MetaItems, mainName, indexOfDir))
|
|
1153
|
+
ui.MetaIndex = curItem->Dirs[indexOfDir].MetaIndex;
|
|
1154
|
+
else
|
|
1155
|
+
{
|
|
1156
|
+
for (int j = (int)curItem->Files.Size() - 1; j >= 0; j--)
|
|
1157
|
+
{
|
|
1158
|
+
const unsigned metaIndex = curItem->Files[j];
|
|
1159
|
+
const CMetaItem &mi = db.MetaItems[metaIndex];
|
|
1160
|
+
if (CompareFileNames(mainName, mi.Name) == 0)
|
|
1161
|
+
{
|
|
1162
|
+
ui.MetaIndex = (int)metaIndex;
|
|
1163
|
+
break;
|
|
1164
|
+
}
|
|
1165
|
+
}
|
|
1166
|
+
}
|
|
1167
|
+
|
|
1168
|
+
if (ui.MetaIndex >= 0)
|
|
1169
|
+
{
|
|
1170
|
+
CAltStream ss;
|
|
1171
|
+
ss.Size = size;
|
|
1172
|
+
ss.Name = fileName.Ptr(colonPos + 1);
|
|
1173
|
+
ss.UpdateIndex = (int)db.UpdateItems.Size();
|
|
1174
|
+
ui.AltStreamIndex = (int)db.MetaItems[ui.MetaIndex].AltStreams.Add(ss);
|
|
1175
|
+
}
|
|
1176
|
+
}
|
|
1177
|
+
}
|
|
1178
|
+
|
|
1179
|
+
|
|
1180
|
+
if (ui.MetaIndex < 0 || isRootImageDir)
|
|
1181
|
+
{
|
|
1182
|
+
if (!isRootImageDir)
|
|
1183
|
+
{
|
|
1184
|
+
ui.MetaIndex = (int)db.MetaItems.Size();
|
|
1185
|
+
db.MetaItems.AddNew();
|
|
1186
|
+
}
|
|
1187
|
+
|
|
1188
|
+
CMetaItem &mi = db.MetaItems[ui.MetaIndex];
|
|
1189
|
+
mi.Size = size;
|
|
1190
|
+
mi.IsDir = isDir;
|
|
1191
|
+
mi.Name = fileName;
|
|
1192
|
+
mi.UpdateIndex = (int)db.UpdateItems.Size();
|
|
1193
|
+
{
|
|
1194
|
+
NCOM::CPropVariant prop;
|
|
1195
|
+
RINOK(GetOutProperty(callback, i, arcIndex, kpidAttrib, &prop))
|
|
1196
|
+
if (prop.vt == VT_EMPTY)
|
|
1197
|
+
mi.Attrib = 0;
|
|
1198
|
+
else if (prop.vt == VT_UI4)
|
|
1199
|
+
mi.Attrib = prop.ulVal;
|
|
1200
|
+
else
|
|
1201
|
+
return E_INVALIDARG;
|
|
1202
|
+
if (isDir)
|
|
1203
|
+
mi.Attrib |= FILE_ATTRIBUTE_DIRECTORY;
|
|
1204
|
+
}
|
|
1205
|
+
|
|
1206
|
+
if (arcIndex != -1 || _timeOptions.Write_CTime.Val)
|
|
1207
|
+
RINOK(GetTime(callback, i, arcIndex, kpidCTime, mi.CTime))
|
|
1208
|
+
if (arcIndex != -1 || _timeOptions.Write_ATime.Val)
|
|
1209
|
+
RINOK(GetTime(callback, i, arcIndex, kpidATime, mi.ATime))
|
|
1210
|
+
if (arcIndex != -1 || _timeOptions.Write_MTime.Val)
|
|
1211
|
+
RINOK(GetTime(callback, i, arcIndex, kpidMTime, mi.MTime))
|
|
1212
|
+
|
|
1213
|
+
{
|
|
1214
|
+
NCOM::CPropVariant prop;
|
|
1215
|
+
RINOK(GetOutProperty(callback, i, arcIndex, kpidShortName, &prop))
|
|
1216
|
+
if (prop.vt == VT_BSTR)
|
|
1217
|
+
mi.ShortName.SetFromBstr(prop.bstrVal);
|
|
1218
|
+
else if (prop.vt != VT_EMPTY)
|
|
1219
|
+
return E_INVALIDARG;
|
|
1220
|
+
// mi.ShortName = "SHORT_NAME"; // for debug
|
|
1221
|
+
}
|
|
1222
|
+
|
|
1223
|
+
while (imageIndex >= (int)secureBlocks.Size())
|
|
1224
|
+
secureBlocks.AddNew();
|
|
1225
|
+
|
|
1226
|
+
if (!isAltStream && (getRawProps || arcIndex >= 0))
|
|
1227
|
+
{
|
|
1228
|
+
CUniqBlocks &secUniqBlocks = secureBlocks[imageIndex];
|
|
1229
|
+
const void *data;
|
|
1230
|
+
UInt32 dataSize;
|
|
1231
|
+
UInt32 propType;
|
|
1232
|
+
|
|
1233
|
+
data = NULL;
|
|
1234
|
+
dataSize = 0;
|
|
1235
|
+
propType = 0;
|
|
1236
|
+
|
|
1237
|
+
if (arcIndex >= 0)
|
|
1238
|
+
{
|
|
1239
|
+
GetRawProp((UInt32)arcIndex, kpidNtSecure, &data, &dataSize, &propType);
|
|
1240
|
+
}
|
|
1241
|
+
else
|
|
1242
|
+
{
|
|
1243
|
+
getRawProps->GetRawProp(i, kpidNtSecure, &data, &dataSize, &propType);
|
|
1244
|
+
}
|
|
1245
|
+
|
|
1246
|
+
if (dataSize != 0)
|
|
1247
|
+
{
|
|
1248
|
+
if (propType != NPropDataType::kRaw)
|
|
1249
|
+
return E_FAIL;
|
|
1250
|
+
mi.SecurityId = (int)secUniqBlocks.AddUniq((const Byte *)data, dataSize);
|
|
1251
|
+
}
|
|
1252
|
+
|
|
1253
|
+
data = NULL;
|
|
1254
|
+
dataSize = 0;
|
|
1255
|
+
propType = 0;
|
|
1256
|
+
|
|
1257
|
+
if (arcIndex >= 0)
|
|
1258
|
+
{
|
|
1259
|
+
GetRawProp((UInt32)arcIndex, kpidNtReparse, &data, &dataSize, &propType);
|
|
1260
|
+
}
|
|
1261
|
+
else
|
|
1262
|
+
{
|
|
1263
|
+
getRawProps->GetRawProp(i, kpidNtReparse, &data, &dataSize, &propType);
|
|
1264
|
+
}
|
|
1265
|
+
|
|
1266
|
+
if (dataSize != 0)
|
|
1267
|
+
{
|
|
1268
|
+
if (propType != NPropDataType::kRaw)
|
|
1269
|
+
return E_FAIL;
|
|
1270
|
+
mi.Reparse.CopyFrom((const Byte *)data, dataSize);
|
|
1271
|
+
}
|
|
1272
|
+
}
|
|
1273
|
+
|
|
1274
|
+
if (!isRootImageDir)
|
|
1275
|
+
{
|
|
1276
|
+
if (isDir)
|
|
1277
|
+
{
|
|
1278
|
+
unsigned indexOfDir;
|
|
1279
|
+
if (curItem->FindDir(db.MetaItems, fileName, indexOfDir))
|
|
1280
|
+
curItem->Dirs[indexOfDir].MetaIndex = ui.MetaIndex;
|
|
1281
|
+
else
|
|
1282
|
+
curItem->Dirs.InsertNew(indexOfDir).MetaIndex = ui.MetaIndex;
|
|
1283
|
+
}
|
|
1284
|
+
else
|
|
1285
|
+
curItem->Files.Add((unsigned)ui.MetaIndex);
|
|
1286
|
+
}
|
|
1287
|
+
}
|
|
1288
|
+
|
|
1289
|
+
}
|
|
1290
|
+
|
|
1291
|
+
if (iNode != 0 && ui.MetaIndex >= 0 && ui.AltStreamIndex < 0)
|
|
1292
|
+
db.MetaItems[ui.MetaIndex].FileID = iNode;
|
|
1293
|
+
|
|
1294
|
+
ui.CallbackIndex = i;
|
|
1295
|
+
db.UpdateItems.Add(ui);
|
|
1296
|
+
}
|
|
1297
|
+
|
|
1298
|
+
unsigned numNewImages = trees.Size();
|
|
1299
|
+
for (i = numNewImages; i < isChangedImage.Size(); i++)
|
|
1300
|
+
if (!isChangedImage[i])
|
|
1301
|
+
numNewImages = i + 1;
|
|
1302
|
+
|
|
1303
|
+
AddTrees(trees, db.MetaItems, ri, (int)numNewImages - 1);
|
|
1304
|
+
|
|
1305
|
+
for (i = 0; i < trees.Size(); i++)
|
|
1306
|
+
if (i >= isChangedImage.Size() || isChangedImage[i])
|
|
1307
|
+
db.WriteOrderList(trees[i]);
|
|
1308
|
+
|
|
1309
|
+
|
|
1310
|
+
UInt64 complexity = 0;
|
|
1311
|
+
|
|
1312
|
+
unsigned numDataStreams = _db.DataStreams.Size();
|
|
1313
|
+
CUIntArr streamsRefs(numDataStreams);
|
|
1314
|
+
for (i = 0; i < numDataStreams; i++)
|
|
1315
|
+
streamsRefs[i] = 0;
|
|
1316
|
+
|
|
1317
|
+
// ---------- Calculate Streams Refs Counts in unchanged images
|
|
1318
|
+
|
|
1319
|
+
for (i = 0; i < _db.Images.Size(); i++)
|
|
1320
|
+
{
|
|
1321
|
+
if (isChangedImage[i])
|
|
1322
|
+
continue;
|
|
1323
|
+
complexity += _db.MetaStreams[i].Resource.PackSize;
|
|
1324
|
+
const CImage &image = _db.Images[i];
|
|
1325
|
+
unsigned endItem = image.StartItem + image.NumItems;
|
|
1326
|
+
for (unsigned k = image.StartItem; k < endItem; k++)
|
|
1327
|
+
{
|
|
1328
|
+
const CItem &item = _db.Items[k];
|
|
1329
|
+
if (item.StreamIndex >= 0)
|
|
1330
|
+
streamsRefs[(unsigned)item.StreamIndex]++;
|
|
1331
|
+
}
|
|
1332
|
+
}
|
|
1333
|
+
|
|
1334
|
+
|
|
1335
|
+
// ---------- Update Streams Refs Counts in changed images
|
|
1336
|
+
|
|
1337
|
+
for (i = 0; i < db.UpdateIndexes.Size(); i++)
|
|
1338
|
+
{
|
|
1339
|
+
const CUpdateItem &ui = db.UpdateItems[db.UpdateIndexes[i]];
|
|
1340
|
+
|
|
1341
|
+
if (ui.InArcIndex >= 0)
|
|
1342
|
+
{
|
|
1343
|
+
if ((unsigned)ui.InArcIndex >= _db.SortedItems.Size())
|
|
1344
|
+
continue;
|
|
1345
|
+
const CItem &item = _db.Items[_db.SortedItems[ui.InArcIndex]];
|
|
1346
|
+
if (item.StreamIndex >= 0)
|
|
1347
|
+
streamsRefs[(unsigned)item.StreamIndex]++;
|
|
1348
|
+
}
|
|
1349
|
+
else
|
|
1350
|
+
{
|
|
1351
|
+
const CMetaItem &mi = db.MetaItems[ui.MetaIndex];
|
|
1352
|
+
UInt64 size;
|
|
1353
|
+
if (ui.AltStreamIndex < 0)
|
|
1354
|
+
size = mi.Size;
|
|
1355
|
+
else
|
|
1356
|
+
size = mi.AltStreams[ui.AltStreamIndex].Size;
|
|
1357
|
+
complexity += size;
|
|
1358
|
+
}
|
|
1359
|
+
}
|
|
1360
|
+
|
|
1361
|
+
// Clear ref counts for SolidBig streams
|
|
1362
|
+
|
|
1363
|
+
for (i = 0; i < _db.DataStreams.Size(); i++)
|
|
1364
|
+
if (_db.DataStreams[i].Resource.IsSolidBig())
|
|
1365
|
+
streamsRefs[i] = 0;
|
|
1366
|
+
|
|
1367
|
+
// Set ref counts for SolidBig streams
|
|
1368
|
+
|
|
1369
|
+
for (i = 0; i < _db.DataStreams.Size(); i++)
|
|
1370
|
+
if (streamsRefs[i] != 0)
|
|
1371
|
+
{
|
|
1372
|
+
const CResource &rs = _db.DataStreams[i].Resource;
|
|
1373
|
+
if (rs.IsSolidSmall())
|
|
1374
|
+
streamsRefs[_db.Solids[rs.SolidIndex].StreamIndex] = 1;
|
|
1375
|
+
}
|
|
1376
|
+
|
|
1377
|
+
for (i = 0; i < _db.DataStreams.Size(); i++)
|
|
1378
|
+
if (streamsRefs[i] != 0)
|
|
1379
|
+
{
|
|
1380
|
+
const CResource &rs = _db.DataStreams[i].Resource;
|
|
1381
|
+
if (!rs.IsSolidSmall())
|
|
1382
|
+
complexity += rs.PackSize;
|
|
1383
|
+
}
|
|
1384
|
+
|
|
1385
|
+
RINOK(callback->SetTotal(complexity))
|
|
1386
|
+
UInt64 totalComplexity = complexity;
|
|
1387
|
+
|
|
1388
|
+
CMyComPtr2_Create<ICompressProgressInfo, CLocalProgress> lps;
|
|
1389
|
+
lps->Init(callback, true);
|
|
1390
|
+
CMyComPtr2_Create<ICompressCoder, NCompress::CCopyCoder> copyCoder;
|
|
1391
|
+
|
|
1392
|
+
complexity = 0;
|
|
1393
|
+
|
|
1394
|
+
// bool useResourceCompression = false;
|
|
1395
|
+
// use useResourceCompression only if CHeader::Flags compression is also set
|
|
1396
|
+
|
|
1397
|
+
CHeader header;
|
|
1398
|
+
header.SetDefaultFields(false);
|
|
1399
|
+
|
|
1400
|
+
if (isUpdate)
|
|
1401
|
+
{
|
|
1402
|
+
const CHeader &srcHeader = _volumes[1].Header;
|
|
1403
|
+
header.Flags = srcHeader.Flags;
|
|
1404
|
+
header.Version = srcHeader.Version;
|
|
1405
|
+
header.ChunkSize = srcHeader.ChunkSize;
|
|
1406
|
+
header.ChunkSizeBits = srcHeader.ChunkSizeBits;
|
|
1407
|
+
}
|
|
1408
|
+
|
|
1409
|
+
CMyComPtr<IStreamSetRestriction> setRestriction;
|
|
1410
|
+
outSeqStream->QueryInterface(IID_IStreamSetRestriction, (void **)&setRestriction);
|
|
1411
|
+
if (setRestriction)
|
|
1412
|
+
RINOK(setRestriction->SetRestriction(0, kHeaderSizeMax))
|
|
1413
|
+
|
|
1414
|
+
RINOK(header.WriteToStream(outStream))
|
|
1415
|
+
|
|
1416
|
+
UInt64 curPos = kHeaderSizeMax;
|
|
1417
|
+
|
|
1418
|
+
CMyComPtr2_Create<ISequentialInStream, CInStreamWithSha1> inShaStream;
|
|
1419
|
+
|
|
1420
|
+
CLimitedSequentialInStream *inStreamLimitedSpec = NULL;
|
|
1421
|
+
CMyComPtr<ISequentialInStream> inStreamLimited;
|
|
1422
|
+
if (_volumes.Size() == 2)
|
|
1423
|
+
{
|
|
1424
|
+
inStreamLimitedSpec = new CLimitedSequentialInStream;
|
|
1425
|
+
inStreamLimited = inStreamLimitedSpec;
|
|
1426
|
+
inStreamLimitedSpec->SetStream(_volumes[1].Stream);
|
|
1427
|
+
}
|
|
1428
|
+
|
|
1429
|
+
|
|
1430
|
+
CRecordVector<CStreamInfo> streams;
|
|
1431
|
+
CSortedIndex sortedHashes; // indexes to streams, sorted by SHA1
|
|
1432
|
+
|
|
1433
|
+
// ---------- Copy unchanged data streams ----------
|
|
1434
|
+
|
|
1435
|
+
UInt64 solidRunOffset = 0;
|
|
1436
|
+
UInt64 curSolidSize = 0;
|
|
1437
|
+
|
|
1438
|
+
for (i = 0; i < _db.DataStreams.Size(); i++)
|
|
1439
|
+
{
|
|
1440
|
+
const CStreamInfo &siOld = _db.DataStreams[i];
|
|
1441
|
+
const CResource &rs = siOld.Resource;
|
|
1442
|
+
|
|
1443
|
+
const unsigned numRefs = streamsRefs[i];
|
|
1444
|
+
|
|
1445
|
+
if (numRefs == 0)
|
|
1446
|
+
{
|
|
1447
|
+
if (!rs.IsSolidSmall())
|
|
1448
|
+
continue;
|
|
1449
|
+
if (streamsRefs[_db.Solids[rs.SolidIndex].StreamIndex] == 0)
|
|
1450
|
+
continue;
|
|
1451
|
+
}
|
|
1452
|
+
|
|
1453
|
+
lps->InSize = lps->OutSize = complexity;
|
|
1454
|
+
RINOK(lps->SetCur())
|
|
1455
|
+
|
|
1456
|
+
const unsigned streamIndex = streams.Size();
|
|
1457
|
+
CStreamInfo s;
|
|
1458
|
+
s.Resource = rs;
|
|
1459
|
+
s.PartNumber = 1;
|
|
1460
|
+
s.RefCount = numRefs;
|
|
1461
|
+
|
|
1462
|
+
memcpy(s.Hash, siOld.Hash, kHashSize);
|
|
1463
|
+
|
|
1464
|
+
if (rs.IsSolid())
|
|
1465
|
+
{
|
|
1466
|
+
CSolid &ss = _db.Solids[rs.SolidIndex];
|
|
1467
|
+
if (rs.IsSolidSmall())
|
|
1468
|
+
{
|
|
1469
|
+
UInt64 oldOffset = ss.SolidOffset;
|
|
1470
|
+
if (rs.Offset < oldOffset)
|
|
1471
|
+
return E_FAIL;
|
|
1472
|
+
UInt64 relatOffset = rs.Offset - oldOffset;
|
|
1473
|
+
s.Resource.Offset = solidRunOffset + relatOffset;
|
|
1474
|
+
}
|
|
1475
|
+
else
|
|
1476
|
+
{
|
|
1477
|
+
// IsSolidBig
|
|
1478
|
+
solidRunOffset += curSolidSize;
|
|
1479
|
+
curSolidSize = ss.UnpackSize;
|
|
1480
|
+
}
|
|
1481
|
+
}
|
|
1482
|
+
else
|
|
1483
|
+
{
|
|
1484
|
+
solidRunOffset = 0;
|
|
1485
|
+
curSolidSize = 0;
|
|
1486
|
+
}
|
|
1487
|
+
|
|
1488
|
+
if (!rs.IsSolid() || rs.IsSolidSmall())
|
|
1489
|
+
{
|
|
1490
|
+
const int find = AddUniqHash(streams.ConstData(), sortedHashes, siOld.Hash, (int)streamIndex);
|
|
1491
|
+
if (find != -1)
|
|
1492
|
+
return E_FAIL; // two streams with same SHA-1
|
|
1493
|
+
}
|
|
1494
|
+
|
|
1495
|
+
if (!rs.IsSolid() || rs.IsSolidBig())
|
|
1496
|
+
{
|
|
1497
|
+
RINOK(InStream_SeekSet(_volumes[siOld.PartNumber].Stream, rs.Offset))
|
|
1498
|
+
inStreamLimitedSpec->Init(rs.PackSize);
|
|
1499
|
+
RINOK(copyCoder.Interface()->Code(inStreamLimited, outStream, NULL, NULL, lps))
|
|
1500
|
+
if (copyCoder->TotalSize != rs.PackSize)
|
|
1501
|
+
return E_FAIL;
|
|
1502
|
+
s.Resource.Offset = curPos;
|
|
1503
|
+
curPos += rs.PackSize;
|
|
1504
|
+
lps->ProgressOffset += rs.PackSize;
|
|
1505
|
+
}
|
|
1506
|
+
|
|
1507
|
+
streams.Add(s);
|
|
1508
|
+
}
|
|
1509
|
+
|
|
1510
|
+
|
|
1511
|
+
// ---------- Write new items ----------
|
|
1512
|
+
|
|
1513
|
+
CUIntVector hlIndexes; // sorted indexes for hard link items
|
|
1514
|
+
|
|
1515
|
+
for (i = 0; i < db.UpdateIndexes.Size(); i++)
|
|
1516
|
+
{
|
|
1517
|
+
lps->InSize = lps->OutSize = complexity;
|
|
1518
|
+
RINOK(lps->SetCur())
|
|
1519
|
+
const CUpdateItem &ui = db.UpdateItems[db.UpdateIndexes[i]];
|
|
1520
|
+
CMetaItem &mi = db.MetaItems[ui.MetaIndex];
|
|
1521
|
+
UInt64 size = 0;
|
|
1522
|
+
|
|
1523
|
+
if (ui.AltStreamIndex >= 0)
|
|
1524
|
+
{
|
|
1525
|
+
if (mi.Skip)
|
|
1526
|
+
continue;
|
|
1527
|
+
size = mi.AltStreams[ui.AltStreamIndex].Size;
|
|
1528
|
+
}
|
|
1529
|
+
else
|
|
1530
|
+
{
|
|
1531
|
+
size = mi.Size;
|
|
1532
|
+
if (mi.IsDir)
|
|
1533
|
+
{
|
|
1534
|
+
// we support LINK files here
|
|
1535
|
+
if (mi.Reparse.Size() == 0)
|
|
1536
|
+
continue;
|
|
1537
|
+
}
|
|
1538
|
+
}
|
|
1539
|
+
|
|
1540
|
+
if (ui.InArcIndex >= 0)
|
|
1541
|
+
{
|
|
1542
|
+
// data streams with OLD Data were written already
|
|
1543
|
+
// we just need to find HashIndex in hashes.
|
|
1544
|
+
|
|
1545
|
+
if ((unsigned)ui.InArcIndex >= _db.SortedItems.Size())
|
|
1546
|
+
return E_FAIL;
|
|
1547
|
+
|
|
1548
|
+
const CItem &item = _db.Items[_db.SortedItems[ui.InArcIndex]];
|
|
1549
|
+
|
|
1550
|
+
if (item.StreamIndex < 0)
|
|
1551
|
+
{
|
|
1552
|
+
if (size == 0)
|
|
1553
|
+
continue;
|
|
1554
|
+
// if (_db.ItemHasStream(item))
|
|
1555
|
+
return E_FAIL;
|
|
1556
|
+
}
|
|
1557
|
+
|
|
1558
|
+
// We support empty file (size = 0, but with stream and SHA-1) from old archive
|
|
1559
|
+
|
|
1560
|
+
const CStreamInfo &siOld = _db.DataStreams[item.StreamIndex];
|
|
1561
|
+
|
|
1562
|
+
const int index = AddUniqHash(streams.ConstData(), sortedHashes, siOld.Hash, -1);
|
|
1563
|
+
// we must have written that stream already
|
|
1564
|
+
if (index == -1)
|
|
1565
|
+
return E_FAIL;
|
|
1566
|
+
|
|
1567
|
+
if (ui.AltStreamIndex < 0)
|
|
1568
|
+
mi.HashIndex = index;
|
|
1569
|
+
else
|
|
1570
|
+
mi.AltStreams[ui.AltStreamIndex].HashIndex = index;
|
|
1571
|
+
|
|
1572
|
+
continue;
|
|
1573
|
+
}
|
|
1574
|
+
|
|
1575
|
+
CMyComPtr<ISequentialInStream> fileInStream;
|
|
1576
|
+
HRESULT res = callback->GetStream(ui.CallbackIndex, &fileInStream);
|
|
1577
|
+
|
|
1578
|
+
if (res == S_FALSE)
|
|
1579
|
+
{
|
|
1580
|
+
if (ui.AltStreamIndex >= 0)
|
|
1581
|
+
{
|
|
1582
|
+
mi.NumSkipAltStreams++;
|
|
1583
|
+
mi.AltStreams[ui.AltStreamIndex].Skip = true;
|
|
1584
|
+
}
|
|
1585
|
+
else
|
|
1586
|
+
mi.Skip = true;
|
|
1587
|
+
}
|
|
1588
|
+
else
|
|
1589
|
+
{
|
|
1590
|
+
RINOK(res)
|
|
1591
|
+
|
|
1592
|
+
int miIndex = -1;
|
|
1593
|
+
|
|
1594
|
+
if (!fileInStream)
|
|
1595
|
+
{
|
|
1596
|
+
if (!mi.IsDir)
|
|
1597
|
+
return E_INVALIDARG;
|
|
1598
|
+
}
|
|
1599
|
+
else if (ui.AltStreamIndex < 0)
|
|
1600
|
+
{
|
|
1601
|
+
CMyComPtr<IStreamGetProps2> getProps2;
|
|
1602
|
+
fileInStream->QueryInterface(IID_IStreamGetProps2, (void **)&getProps2);
|
|
1603
|
+
if (getProps2)
|
|
1604
|
+
{
|
|
1605
|
+
CStreamFileProps props;
|
|
1606
|
+
if (getProps2->GetProps2(&props) == S_OK)
|
|
1607
|
+
{
|
|
1608
|
+
mi.Attrib = props.Attrib;
|
|
1609
|
+
if (_timeOptions.Write_CTime.Val) mi.CTime = props.CTime;
|
|
1610
|
+
if (_timeOptions.Write_ATime.Val) mi.ATime = props.ATime;
|
|
1611
|
+
if (_timeOptions.Write_MTime.Val) mi.MTime = props.MTime;
|
|
1612
|
+
mi.FileID = props.FileID_Low;
|
|
1613
|
+
if (props.NumLinks <= 1)
|
|
1614
|
+
mi.FileID = 0;
|
|
1615
|
+
mi.VolID = props.VolID;
|
|
1616
|
+
if (mi.FileID != 0)
|
|
1617
|
+
miIndex = AddToHardLinkList(db.MetaItems, (unsigned)ui.MetaIndex, hlIndexes);
|
|
1618
|
+
|
|
1619
|
+
if (props.Size != size && props.Size != (UInt64)(Int64)-1)
|
|
1620
|
+
{
|
|
1621
|
+
const Int64 delta = (Int64)props.Size - (Int64)size;
|
|
1622
|
+
const Int64 newComplexity = (Int64)totalComplexity + delta;
|
|
1623
|
+
if (newComplexity > 0)
|
|
1624
|
+
{
|
|
1625
|
+
totalComplexity = (UInt64)newComplexity;
|
|
1626
|
+
callback->SetTotal(totalComplexity);
|
|
1627
|
+
}
|
|
1628
|
+
mi.Size = props.Size;
|
|
1629
|
+
size = props.Size;
|
|
1630
|
+
}
|
|
1631
|
+
}
|
|
1632
|
+
}
|
|
1633
|
+
}
|
|
1634
|
+
|
|
1635
|
+
if (miIndex >= 0)
|
|
1636
|
+
{
|
|
1637
|
+
mi.HashIndex = db.MetaItems[miIndex].HashIndex;
|
|
1638
|
+
if (mi.HashIndex >= 0)
|
|
1639
|
+
streams[mi.HashIndex].RefCount++;
|
|
1640
|
+
// fix for future: maybe we need to check also that real size is equal to size from IStreamGetProps2
|
|
1641
|
+
}
|
|
1642
|
+
else if (ui.AltStreamIndex < 0 && mi.Reparse.Size() != 0)
|
|
1643
|
+
{
|
|
1644
|
+
if (mi.Reparse.Size() < 8)
|
|
1645
|
+
return E_FAIL;
|
|
1646
|
+
NCrypto::NSha1::CContext sha1;
|
|
1647
|
+
sha1.Init();
|
|
1648
|
+
const size_t packSize = mi.Reparse.Size() - 8;
|
|
1649
|
+
sha1.Update((const Byte *)mi.Reparse + 8, packSize);
|
|
1650
|
+
UInt32 hash[kHashSize / 4];
|
|
1651
|
+
sha1.Final((Byte *)(void *)hash);
|
|
1652
|
+
|
|
1653
|
+
int index = AddUniqHash(streams.ConstData(), sortedHashes, hash, (int)streams.Size());
|
|
1654
|
+
|
|
1655
|
+
if (index != -1)
|
|
1656
|
+
streams[index].RefCount++;
|
|
1657
|
+
else
|
|
1658
|
+
{
|
|
1659
|
+
index = (int)streams.Size();
|
|
1660
|
+
RINOK(WriteStream(outStream, (const Byte *)mi.Reparse + 8, packSize))
|
|
1661
|
+
CStreamInfo s;
|
|
1662
|
+
s.Resource.PackSize = packSize;
|
|
1663
|
+
s.Resource.Offset = curPos;
|
|
1664
|
+
s.Resource.UnpackSize = packSize;
|
|
1665
|
+
s.Resource.Flags = 0; // check it
|
|
1666
|
+
/*
|
|
1667
|
+
if (useResourceCompression)
|
|
1668
|
+
s.Resource.Flags = NResourceFlags::Compressed;
|
|
1669
|
+
*/
|
|
1670
|
+
s.PartNumber = 1;
|
|
1671
|
+
s.RefCount = 1;
|
|
1672
|
+
memcpy(s.Hash, hash, kHashSize);
|
|
1673
|
+
curPos += packSize;
|
|
1674
|
+
|
|
1675
|
+
streams.Add(s);
|
|
1676
|
+
}
|
|
1677
|
+
|
|
1678
|
+
mi.HashIndex = index;
|
|
1679
|
+
}
|
|
1680
|
+
else
|
|
1681
|
+
{
|
|
1682
|
+
inShaStream->SetStream(fileInStream);
|
|
1683
|
+
|
|
1684
|
+
CMyComPtr<IInStream> inSeekStream;
|
|
1685
|
+
fileInStream.QueryInterface(IID_IInStream, (void **)&inSeekStream);
|
|
1686
|
+
|
|
1687
|
+
fileInStream.Release();
|
|
1688
|
+
inShaStream->Init();
|
|
1689
|
+
UInt64 offsetBlockSize = 0;
|
|
1690
|
+
/*
|
|
1691
|
+
if (useResourceCompression)
|
|
1692
|
+
{
|
|
1693
|
+
for (UInt64 t = kChunkSize; t < size; t += kChunkSize)
|
|
1694
|
+
{
|
|
1695
|
+
Byte buf[8];
|
|
1696
|
+
SetUi32(buf, (UInt32)t);
|
|
1697
|
+
RINOK(WriteStream(outStream, buf, 4));
|
|
1698
|
+
offsetBlockSize += 4;
|
|
1699
|
+
}
|
|
1700
|
+
}
|
|
1701
|
+
*/
|
|
1702
|
+
|
|
1703
|
+
// 22.02: we use additional read-only pass to calculate SHA-1
|
|
1704
|
+
bool needWritePass = true;
|
|
1705
|
+
int index = -1;
|
|
1706
|
+
|
|
1707
|
+
if (inSeekStream /* && !sortedHashes.IsEmpty() */)
|
|
1708
|
+
{
|
|
1709
|
+
RINOK(copyCoder.Interface()->Code(inShaStream, NULL, NULL, NULL, lps))
|
|
1710
|
+
size = copyCoder->TotalSize;
|
|
1711
|
+
if (size == 0)
|
|
1712
|
+
needWritePass = false;
|
|
1713
|
+
else
|
|
1714
|
+
{
|
|
1715
|
+
UInt32 hash[kHashSize / 4];
|
|
1716
|
+
inShaStream->Final((Byte *)(void *)hash);
|
|
1717
|
+
|
|
1718
|
+
index = AddUniqHash(streams.ConstData(), sortedHashes, hash, -1);
|
|
1719
|
+
if (index != -1)
|
|
1720
|
+
{
|
|
1721
|
+
streams[index].RefCount++;
|
|
1722
|
+
needWritePass = false;
|
|
1723
|
+
}
|
|
1724
|
+
else
|
|
1725
|
+
{
|
|
1726
|
+
RINOK(InStream_SeekToBegin(inSeekStream))
|
|
1727
|
+
inShaStream->Init();
|
|
1728
|
+
}
|
|
1729
|
+
}
|
|
1730
|
+
}
|
|
1731
|
+
|
|
1732
|
+
if (needWritePass)
|
|
1733
|
+
{
|
|
1734
|
+
RINOK(copyCoder.Interface()->Code(inShaStream, outStream, NULL, NULL, lps))
|
|
1735
|
+
size = copyCoder->TotalSize;
|
|
1736
|
+
}
|
|
1737
|
+
|
|
1738
|
+
if (size != 0)
|
|
1739
|
+
{
|
|
1740
|
+
if (needWritePass)
|
|
1741
|
+
{
|
|
1742
|
+
UInt32 hash[kHashSize / 4];
|
|
1743
|
+
const UInt64 packSize = offsetBlockSize + size;
|
|
1744
|
+
inShaStream->Final((Byte *)(void *)hash);
|
|
1745
|
+
|
|
1746
|
+
index = AddUniqHash(streams.ConstData(), sortedHashes, hash, (int)streams.Size());
|
|
1747
|
+
|
|
1748
|
+
if (index != -1)
|
|
1749
|
+
{
|
|
1750
|
+
streams[index].RefCount++;
|
|
1751
|
+
outStream->Seek(-(Int64)packSize, STREAM_SEEK_CUR, &curPos);
|
|
1752
|
+
outStream->SetSize(curPos);
|
|
1753
|
+
}
|
|
1754
|
+
else
|
|
1755
|
+
{
|
|
1756
|
+
index = (int)streams.Size();
|
|
1757
|
+
CStreamInfo s;
|
|
1758
|
+
s.Resource.PackSize = packSize;
|
|
1759
|
+
s.Resource.Offset = curPos;
|
|
1760
|
+
s.Resource.UnpackSize = size;
|
|
1761
|
+
s.Resource.Flags = 0;
|
|
1762
|
+
/*
|
|
1763
|
+
if (useResourceCompression)
|
|
1764
|
+
s.Resource.Flags = NResourceFlags::Compressed;
|
|
1765
|
+
*/
|
|
1766
|
+
s.PartNumber = 1;
|
|
1767
|
+
s.RefCount = 1;
|
|
1768
|
+
memcpy(s.Hash, hash, kHashSize);
|
|
1769
|
+
curPos += packSize;
|
|
1770
|
+
|
|
1771
|
+
streams.Add(s);
|
|
1772
|
+
}
|
|
1773
|
+
} // needWritePass
|
|
1774
|
+
if (ui.AltStreamIndex < 0)
|
|
1775
|
+
mi.HashIndex = index;
|
|
1776
|
+
else
|
|
1777
|
+
mi.AltStreams[ui.AltStreamIndex].HashIndex = index;
|
|
1778
|
+
} // (size != 0)
|
|
1779
|
+
}
|
|
1780
|
+
}
|
|
1781
|
+
fileInStream.Release();
|
|
1782
|
+
complexity += size;
|
|
1783
|
+
RINOK(callback->SetOperationResult(NArchive::NUpdate::NOperationResult::kOK))
|
|
1784
|
+
}
|
|
1785
|
+
|
|
1786
|
+
while (secureBlocks.Size() < numNewImages)
|
|
1787
|
+
secureBlocks.AddNew();
|
|
1788
|
+
|
|
1789
|
+
|
|
1790
|
+
|
|
1791
|
+
// ---------- Write Images ----------
|
|
1792
|
+
|
|
1793
|
+
for (i = 0;; i++)
|
|
1794
|
+
{
|
|
1795
|
+
lps->InSize = lps->OutSize = complexity;
|
|
1796
|
+
RINOK(lps->SetCur())
|
|
1797
|
+
if (i >= numNewImages)
|
|
1798
|
+
break;
|
|
1799
|
+
|
|
1800
|
+
if (i < isChangedImage.Size() && !isChangedImage[i])
|
|
1801
|
+
{
|
|
1802
|
+
CStreamInfo s = _db.MetaStreams[i];
|
|
1803
|
+
|
|
1804
|
+
RINOK(InStream_SeekSet(_volumes[1].Stream, s.Resource.Offset))
|
|
1805
|
+
inStreamLimitedSpec->Init(s.Resource.PackSize);
|
|
1806
|
+
RINOK(copyCoder.Interface()->Code(inStreamLimited, outStream, NULL, NULL, lps))
|
|
1807
|
+
if (copyCoder->TotalSize != s.Resource.PackSize)
|
|
1808
|
+
return E_FAIL;
|
|
1809
|
+
|
|
1810
|
+
s.Resource.Offset = curPos;
|
|
1811
|
+
s.PartNumber = 1;
|
|
1812
|
+
s.RefCount = 1;
|
|
1813
|
+
streams.Add(s);
|
|
1814
|
+
|
|
1815
|
+
if (_bootIndex != 0 && _bootIndex == (UInt32)i + 1)
|
|
1816
|
+
{
|
|
1817
|
+
header.MetadataResource = s.Resource;
|
|
1818
|
+
header.BootIndex = _bootIndex;
|
|
1819
|
+
}
|
|
1820
|
+
|
|
1821
|
+
lps->ProgressOffset += s.Resource.PackSize;
|
|
1822
|
+
curPos += s.Resource.PackSize;
|
|
1823
|
+
// printf("\nWrite old image %x\n", i + 1);
|
|
1824
|
+
continue;
|
|
1825
|
+
}
|
|
1826
|
+
|
|
1827
|
+
const CDir &tree = trees[i];
|
|
1828
|
+
const CUniqBlocks &secUniqBlocks = secureBlocks[i];
|
|
1829
|
+
const CObjectVector<CByteBuffer> &secBufs = secUniqBlocks.Bufs;
|
|
1830
|
+
|
|
1831
|
+
const unsigned kSecuritySize = 8;
|
|
1832
|
+
size_t pos = kSecuritySize +
|
|
1833
|
+
(size_t)secUniqBlocks.GetTotalSizeInBytes() +
|
|
1834
|
+
(size_t)secBufs.Size() * 8;
|
|
1835
|
+
pos = (pos + 7) & ~(size_t)7;
|
|
1836
|
+
if ((UInt32)pos != pos) // size of security data will be stored as 32-bit to header
|
|
1837
|
+
return E_INVALIDARG;
|
|
1838
|
+
|
|
1839
|
+
db.DefaultDirItem = ri;
|
|
1840
|
+
pos += db.WriteTree_Dummy(tree);
|
|
1841
|
+
|
|
1842
|
+
const size_t meta_size = pos;
|
|
1843
|
+
CByteArr meta(pos);
|
|
1844
|
+
|
|
1845
|
+
Set32((Byte *)meta + 4, secBufs.Size()) // num security entries
|
|
1846
|
+
pos = kSecuritySize;
|
|
1847
|
+
/*
|
|
1848
|
+
if (secBufs.Size() == 0)
|
|
1849
|
+
{
|
|
1850
|
+
// we can write 0 here only if there is no security data, imageX does it,
|
|
1851
|
+
// but some programs expect size = 8
|
|
1852
|
+
Set32((Byte *)meta, 8) // size of security data
|
|
1853
|
+
// Set32((Byte *)meta, 0);
|
|
1854
|
+
}
|
|
1855
|
+
else
|
|
1856
|
+
*/
|
|
1857
|
+
{
|
|
1858
|
+
unsigned k;
|
|
1859
|
+
for (k = 0; k < secBufs.Size(); k++, pos += 8)
|
|
1860
|
+
{
|
|
1861
|
+
Set64(meta + pos, secBufs[k].Size())
|
|
1862
|
+
}
|
|
1863
|
+
for (k = 0; k < secBufs.Size(); k++)
|
|
1864
|
+
{
|
|
1865
|
+
const CByteBuffer &buf = secBufs[k];
|
|
1866
|
+
size_t size = buf.Size();
|
|
1867
|
+
if (size != 0)
|
|
1868
|
+
{
|
|
1869
|
+
memcpy(meta + pos, buf, size);
|
|
1870
|
+
pos += size;
|
|
1871
|
+
}
|
|
1872
|
+
}
|
|
1873
|
+
while ((pos & 7) != 0)
|
|
1874
|
+
meta[pos++] = 0;
|
|
1875
|
+
Set32((Byte *)meta, (UInt32)pos) // size of security data
|
|
1876
|
+
}
|
|
1877
|
+
|
|
1878
|
+
db.Hashes = streams.ConstData();
|
|
1879
|
+
pos = db.WriteTree(tree, (Byte *)meta, pos);
|
|
1880
|
+
if (pos != meta_size)
|
|
1881
|
+
return E_FAIL;
|
|
1882
|
+
{
|
|
1883
|
+
CStreamInfo s;
|
|
1884
|
+
s.Resource.PackSize = pos;
|
|
1885
|
+
s.Resource.Offset = curPos;
|
|
1886
|
+
s.Resource.UnpackSize = pos;
|
|
1887
|
+
s.Resource.Flags = NResourceFlags::kMetadata;
|
|
1888
|
+
s.PartNumber = 1;
|
|
1889
|
+
s.RefCount = 1;
|
|
1890
|
+
NCrypto::NSha1::CContext sha;
|
|
1891
|
+
sha.Init();
|
|
1892
|
+
sha.Update((const Byte *)meta, pos);
|
|
1893
|
+
sha.Final((Byte *)(void *)s.Hash);
|
|
1894
|
+
streams.Add(s);
|
|
1895
|
+
|
|
1896
|
+
if (_bootIndex != 0 && _bootIndex == (UInt32)i + 1)
|
|
1897
|
+
{
|
|
1898
|
+
header.MetadataResource = s.Resource;
|
|
1899
|
+
header.BootIndex = _bootIndex;
|
|
1900
|
+
}
|
|
1901
|
+
}
|
|
1902
|
+
RINOK(WriteStream(outStream, (const Byte *)meta, pos))
|
|
1903
|
+
curPos += pos;
|
|
1904
|
+
}
|
|
1905
|
+
// lps->InSize = lps->OutSize = complexity;
|
|
1906
|
+
// RINOK(lps->SetCur())
|
|
1907
|
+
|
|
1908
|
+
header.OffsetResource.UnpackSize = header.OffsetResource.PackSize = (UInt64)streams.Size() * kStreamInfoSize;
|
|
1909
|
+
header.OffsetResource.Offset = curPos;
|
|
1910
|
+
header.OffsetResource.Flags = NResourceFlags::kMetadata;
|
|
1911
|
+
|
|
1912
|
+
|
|
1913
|
+
|
|
1914
|
+
// ---------- Write Streams Info Tables ----------
|
|
1915
|
+
|
|
1916
|
+
for (i = 0; i < streams.Size(); i++)
|
|
1917
|
+
{
|
|
1918
|
+
UInt64 buf[(kStreamInfoSize + 7) / 8];
|
|
1919
|
+
streams[i].WriteTo((Byte *)(void *)buf);
|
|
1920
|
+
RINOK(WriteStream(outStream, buf, kStreamInfoSize))
|
|
1921
|
+
curPos += kStreamInfoSize;
|
|
1922
|
+
}
|
|
1923
|
+
|
|
1924
|
+
AString xml ("<WIM>");
|
|
1925
|
+
AddTagUInt64_ToString(xml, "TOTALBYTES", curPos);
|
|
1926
|
+
for (i = 0; i < trees.Size(); i++)
|
|
1927
|
+
{
|
|
1928
|
+
const CDir &tree = trees[i];
|
|
1929
|
+
|
|
1930
|
+
CXmlItem item;
|
|
1931
|
+
if (_xmls.Size() == 1)
|
|
1932
|
+
{
|
|
1933
|
+
const CWimXml &_oldXml = _xmls[0];
|
|
1934
|
+
if (i < _oldXml.Images.Size())
|
|
1935
|
+
{
|
|
1936
|
+
// int ttt = _oldXml.Images[i].ItemIndexInXml;
|
|
1937
|
+
item = _oldXml.Xml.Root.SubItems[_oldXml.Images[i].ItemIndexInXml];
|
|
1938
|
+
}
|
|
1939
|
+
}
|
|
1940
|
+
if (i >= isChangedImage.Size() || isChangedImage[i])
|
|
1941
|
+
{
|
|
1942
|
+
char temp[16];
|
|
1943
|
+
if (item.Name.IsEmpty())
|
|
1944
|
+
{
|
|
1945
|
+
ConvertUInt32ToString(i + 1, temp);
|
|
1946
|
+
item.Name = "IMAGE";
|
|
1947
|
+
item.IsTag = true;
|
|
1948
|
+
CXmlProp &prop = item.Props.AddNew();
|
|
1949
|
+
prop.Name = "INDEX";
|
|
1950
|
+
prop.Value = temp;
|
|
1951
|
+
}
|
|
1952
|
+
|
|
1953
|
+
AddTag_String_IfEmpty(item, "NAME", temp);
|
|
1954
|
+
AddTag_UInt64(item, "DIRCOUNT", tree.GetNumDirs() - 1);
|
|
1955
|
+
AddTag_UInt64(item, "FILECOUNT", tree.GetNumFiles());
|
|
1956
|
+
AddTag_UInt64(item, "TOTALBYTES", tree.GetTotalSize(db.MetaItems));
|
|
1957
|
+
|
|
1958
|
+
AddTag_Time(item, "CREATIONTIME", ftCur);
|
|
1959
|
+
AddTag_Time(item, "LASTMODIFICATIONTIME", ftCur);
|
|
1960
|
+
}
|
|
1961
|
+
|
|
1962
|
+
item.AppendTo(xml);
|
|
1963
|
+
}
|
|
1964
|
+
xml += "</WIM>";
|
|
1965
|
+
|
|
1966
|
+
size_t xmlSize;
|
|
1967
|
+
{
|
|
1968
|
+
UString utf16;
|
|
1969
|
+
if (!ConvertUTF8ToUnicode(xml, utf16))
|
|
1970
|
+
return S_FALSE;
|
|
1971
|
+
size_t numChars = utf16.Len();
|
|
1972
|
+
xmlSize = ((size_t)numChars + 1) * 2;
|
|
1973
|
+
CByteArr xmlBuf(xmlSize);
|
|
1974
|
+
Byte *dest = xmlBuf;
|
|
1975
|
+
Set16(dest, 0xFEFF)
|
|
1976
|
+
dest += 2;
|
|
1977
|
+
if (numChars)
|
|
1978
|
+
{
|
|
1979
|
+
const wchar_t *src = utf16;
|
|
1980
|
+
do
|
|
1981
|
+
{
|
|
1982
|
+
Set16(dest, (UInt16)*src)
|
|
1983
|
+
src++;
|
|
1984
|
+
dest += 2;
|
|
1985
|
+
}
|
|
1986
|
+
while (--numChars);
|
|
1987
|
+
}
|
|
1988
|
+
RINOK(WriteStream(outStream, (const Byte *)xmlBuf, xmlSize))
|
|
1989
|
+
}
|
|
1990
|
+
|
|
1991
|
+
header.XmlResource.UnpackSize =
|
|
1992
|
+
header.XmlResource.PackSize = xmlSize;
|
|
1993
|
+
header.XmlResource.Offset = curPos;
|
|
1994
|
+
header.XmlResource.Flags = NResourceFlags::kMetadata;
|
|
1995
|
+
|
|
1996
|
+
header.NumImages = trees.Size();
|
|
1997
|
+
RINOK(outStream->Seek(0, STREAM_SEEK_SET, NULL))
|
|
1998
|
+
RINOK(header.WriteToStream(outStream))
|
|
1999
|
+
|
|
2000
|
+
if (setRestriction)
|
|
2001
|
+
RINOK(setRestriction->SetRestriction(0, 0))
|
|
2002
|
+
|
|
2003
|
+
return S_OK;
|
|
2004
|
+
|
|
2005
|
+
COM_TRY_END
|
|
2006
|
+
}
|
|
2007
|
+
|
|
2008
|
+
}}
|