7zip-native 0.0.0-stage → 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +103 -2
- package/THIRD_PARTY_NOTICES.md +23 -0
- package/bench/args.mts +69 -0
- package/bench/benchmark.mts +102 -0
- package/bench/compare.mts +546 -0
- package/bench/concurrency.mts +196 -0
- package/binding.gyp +51 -0
- package/dist/index.cjs +433 -0
- package/dist/index.d.cts +59 -0
- package/dist/index.d.mts +59 -0
- package/dist/index.d.ts +59 -0
- package/dist/index.mjs +429 -0
- package/docs/architecture.md +112 -0
- package/examples/basic.mts +19 -0
- package/native/addon.cpp +2154 -0
- package/package.json +85 -5
- package/prebuilds/linux-x64/7z.so +0 -0
- package/prebuilds/linux-x64/7zip_native.node +0 -0
- package/vendor/7zip/.gitattributes +2 -0
- package/vendor/7zip/Asm/arm/7zCrcOpt.asm +100 -0
- package/vendor/7zip/Asm/arm64/7zAsm.S +187 -0
- package/vendor/7zip/Asm/arm64/LzmaDecOpt.S +1487 -0
- package/vendor/7zip/Asm/x86/7zAsm.asm +341 -0
- package/vendor/7zip/Asm/x86/7zCrcOpt.asm +258 -0
- package/vendor/7zip/Asm/x86/AesOpt.asm +742 -0
- package/vendor/7zip/Asm/x86/LzFindOpt.asm +540 -0
- package/vendor/7zip/Asm/x86/LzmaDecOpt.asm +1339 -0
- package/vendor/7zip/Asm/x86/Sha1Opt.asm +263 -0
- package/vendor/7zip/Asm/x86/Sha256Opt.asm +275 -0
- package/vendor/7zip/Asm/x86/Sort.asm +860 -0
- package/vendor/7zip/Asm/x86/XzCrc64Opt.asm +523 -0
- package/vendor/7zip/C/7z.h +204 -0
- package/vendor/7zip/C/7zAlloc.c +89 -0
- package/vendor/7zip/C/7zAlloc.h +19 -0
- package/vendor/7zip/C/7zArcIn.c +1701 -0
- package/vendor/7zip/C/7zBuf.c +36 -0
- package/vendor/7zip/C/7zBuf.h +35 -0
- package/vendor/7zip/C/7zBuf2.c +52 -0
- package/vendor/7zip/C/7zCrc.c +420 -0
- package/vendor/7zip/C/7zCrc.h +28 -0
- package/vendor/7zip/C/7zCrcOpt.c +199 -0
- package/vendor/7zip/C/7zDec.c +672 -0
- package/vendor/7zip/C/7zFile.c +443 -0
- package/vendor/7zip/C/7zFile.h +91 -0
- package/vendor/7zip/C/7zStream.c +199 -0
- package/vendor/7zip/C/7zTypes.h +600 -0
- package/vendor/7zip/C/7zVersion.h +27 -0
- package/vendor/7zip/C/7zVersion.rc +55 -0
- package/vendor/7zip/C/7zWindows.h +107 -0
- package/vendor/7zip/C/7zip_gcc_c.mak +366 -0
- package/vendor/7zip/C/Aes.c +429 -0
- package/vendor/7zip/C/Aes.h +60 -0
- package/vendor/7zip/C/AesOpt.c +1002 -0
- package/vendor/7zip/C/Alloc.c +774 -0
- package/vendor/7zip/C/Alloc.h +76 -0
- package/vendor/7zip/C/Asm_c.mak +12 -0
- package/vendor/7zip/C/Bcj2.c +290 -0
- package/vendor/7zip/C/Bcj2.h +332 -0
- package/vendor/7zip/C/Bcj2Enc.c +509 -0
- package/vendor/7zip/C/Blake2.h +105 -0
- package/vendor/7zip/C/Blake2s.c +2672 -0
- package/vendor/7zip/C/Bra.c +709 -0
- package/vendor/7zip/C/Bra.h +105 -0
- package/vendor/7zip/C/Bra86.c +187 -0
- package/vendor/7zip/C/BraIA64.c +14 -0
- package/vendor/7zip/C/BwtSort.c +630 -0
- package/vendor/7zip/C/BwtSort.h +27 -0
- package/vendor/7zip/C/Compiler.h +287 -0
- package/vendor/7zip/C/CpuArch.c +970 -0
- package/vendor/7zip/C/CpuArch.h +719 -0
- package/vendor/7zip/C/Delta.c +169 -0
- package/vendor/7zip/C/Delta.h +19 -0
- package/vendor/7zip/C/DllSecur.c +99 -0
- package/vendor/7zip/C/DllSecur.h +20 -0
- package/vendor/7zip/C/HuffEnc.c +361 -0
- package/vendor/7zip/C/HuffEnc.h +23 -0
- package/vendor/7zip/C/LzFind.c +1746 -0
- package/vendor/7zip/C/LzFind.h +160 -0
- package/vendor/7zip/C/LzFindMt.c +1422 -0
- package/vendor/7zip/C/LzFindMt.h +114 -0
- package/vendor/7zip/C/LzFindOpt.c +578 -0
- package/vendor/7zip/C/LzHash.h +34 -0
- package/vendor/7zip/C/Lzma2Dec.c +493 -0
- package/vendor/7zip/C/Lzma2Dec.h +121 -0
- package/vendor/7zip/C/Lzma2DecMt.c +1095 -0
- package/vendor/7zip/C/Lzma2DecMt.h +81 -0
- package/vendor/7zip/C/Lzma2Enc.c +799 -0
- package/vendor/7zip/C/Lzma2Enc.h +58 -0
- package/vendor/7zip/C/Lzma86.h +111 -0
- package/vendor/7zip/C/Lzma86Dec.c +53 -0
- package/vendor/7zip/C/Lzma86Enc.c +103 -0
- package/vendor/7zip/C/LzmaDec.c +1367 -0
- package/vendor/7zip/C/LzmaDec.h +237 -0
- package/vendor/7zip/C/LzmaEnc.c +3154 -0
- package/vendor/7zip/C/LzmaEnc.h +85 -0
- package/vendor/7zip/C/LzmaLib.c +42 -0
- package/vendor/7zip/C/LzmaLib.h +138 -0
- package/vendor/7zip/C/Md5.c +206 -0
- package/vendor/7zip/C/Md5.h +34 -0
- package/vendor/7zip/C/MtCoder.c +604 -0
- package/vendor/7zip/C/MtCoder.h +144 -0
- package/vendor/7zip/C/MtDec.c +1124 -0
- package/vendor/7zip/C/MtDec.h +202 -0
- package/vendor/7zip/C/Ppmd.h +169 -0
- package/vendor/7zip/C/Ppmd7.c +1131 -0
- package/vendor/7zip/C/Ppmd7.h +181 -0
- package/vendor/7zip/C/Ppmd7Dec.c +312 -0
- package/vendor/7zip/C/Ppmd7Enc.c +340 -0
- package/vendor/7zip/C/Ppmd7aDec.c +295 -0
- package/vendor/7zip/C/Ppmd8.c +1574 -0
- package/vendor/7zip/C/Ppmd8.h +181 -0
- package/vendor/7zip/C/Ppmd8Dec.c +295 -0
- package/vendor/7zip/C/Ppmd8Enc.c +337 -0
- package/vendor/7zip/C/Precomp.h +127 -0
- package/vendor/7zip/C/RotateDefs.h +50 -0
- package/vendor/7zip/C/Sha1.c +441 -0
- package/vendor/7zip/C/Sha1.h +86 -0
- package/vendor/7zip/C/Sha1Opt.c +424 -0
- package/vendor/7zip/C/Sha256.c +492 -0
- package/vendor/7zip/C/Sha256.h +86 -0
- package/vendor/7zip/C/Sha256Opt.c +451 -0
- package/vendor/7zip/C/Sha3.c +359 -0
- package/vendor/7zip/C/Sha3.h +36 -0
- package/vendor/7zip/C/Sha512.c +711 -0
- package/vendor/7zip/C/Sha512.h +86 -0
- package/vendor/7zip/C/Sha512Opt.c +395 -0
- package/vendor/7zip/C/Sort.c +268 -0
- package/vendor/7zip/C/Sort.h +15 -0
- package/vendor/7zip/C/SwapBytes.c +835 -0
- package/vendor/7zip/C/SwapBytes.h +17 -0
- package/vendor/7zip/C/Threads.c +826 -0
- package/vendor/7zip/C/Threads.h +260 -0
- package/vendor/7zip/C/Util/7z/7z.dsp +249 -0
- package/vendor/7zip/C/Util/7z/7z.dsw +29 -0
- package/vendor/7zip/C/Util/7z/7zMain.c +1210 -0
- package/vendor/7zip/C/Util/7z/Precomp.c +4 -0
- package/vendor/7zip/C/Util/7z/Precomp.h +13 -0
- package/vendor/7zip/C/Util/7z/makefile +44 -0
- package/vendor/7zip/C/Util/7z/makefile.gcc +32 -0
- package/vendor/7zip/C/Util/7zipInstall/7zip.ico +0 -0
- package/vendor/7zip/C/Util/7zipInstall/7zipInstall.c +1699 -0
- package/vendor/7zip/C/Util/7zipInstall/7zipInstall.dsp +248 -0
- package/vendor/7zip/C/Util/7zipInstall/7zipInstall.dsw +29 -0
- package/vendor/7zip/C/Util/7zipInstall/7zipInstall.manifest +18 -0
- package/vendor/7zip/C/Util/7zipInstall/Precomp.c +4 -0
- package/vendor/7zip/C/Util/7zipInstall/Precomp.h +13 -0
- package/vendor/7zip/C/Util/7zipInstall/makefile +47 -0
- package/vendor/7zip/C/Util/7zipInstall/resource.h +9 -0
- package/vendor/7zip/C/Util/7zipInstall/resource.rc +48 -0
- package/vendor/7zip/C/Util/7zipUninstall/7zipUninstall.c +1234 -0
- package/vendor/7zip/C/Util/7zipUninstall/7zipUninstall.dsp +132 -0
- package/vendor/7zip/C/Util/7zipUninstall/7zipUninstall.dsw +29 -0
- package/vendor/7zip/C/Util/7zipUninstall/7zipUninstall.ico +0 -0
- package/vendor/7zip/C/Util/7zipUninstall/7zipUninstall.manifest +18 -0
- package/vendor/7zip/C/Util/7zipUninstall/Precomp.c +4 -0
- package/vendor/7zip/C/Util/7zipUninstall/Precomp.h +13 -0
- package/vendor/7zip/C/Util/7zipUninstall/makefile +18 -0
- package/vendor/7zip/C/Util/7zipUninstall/resource.h +9 -0
- package/vendor/7zip/C/Util/7zipUninstall/resource.rc +48 -0
- package/vendor/7zip/C/Util/Lzma/LzmaUtil.c +313 -0
- package/vendor/7zip/C/Util/Lzma/LzmaUtil.dsp +192 -0
- package/vendor/7zip/C/Util/Lzma/LzmaUtil.dsw +29 -0
- package/vendor/7zip/C/Util/Lzma/Precomp.h +13 -0
- package/vendor/7zip/C/Util/Lzma/makefile +30 -0
- package/vendor/7zip/C/Util/Lzma/makefile.gcc +21 -0
- package/vendor/7zip/C/Util/LzmaLib/LzmaLib.def +4 -0
- package/vendor/7zip/C/Util/LzmaLib/LzmaLib.dsp +206 -0
- package/vendor/7zip/C/Util/LzmaLib/LzmaLib.dsw +29 -0
- package/vendor/7zip/C/Util/LzmaLib/LzmaLibExports.c +15 -0
- package/vendor/7zip/C/Util/LzmaLib/Precomp.c +4 -0
- package/vendor/7zip/C/Util/LzmaLib/Precomp.h +13 -0
- package/vendor/7zip/C/Util/LzmaLib/makefile +59 -0
- package/vendor/7zip/C/Util/LzmaLib/resource.rc +3 -0
- package/vendor/7zip/C/Util/SfxSetup/Precomp.c +4 -0
- package/vendor/7zip/C/Util/SfxSetup/Precomp.h +13 -0
- package/vendor/7zip/C/Util/SfxSetup/SfxSetup.c +657 -0
- package/vendor/7zip/C/Util/SfxSetup/SfxSetup.dsp +231 -0
- package/vendor/7zip/C/Util/SfxSetup/SfxSetup.dsw +29 -0
- package/vendor/7zip/C/Util/SfxSetup/makefile +44 -0
- package/vendor/7zip/C/Util/SfxSetup/makefile_con +40 -0
- package/vendor/7zip/C/Util/SfxSetup/resource.rc +5 -0
- package/vendor/7zip/C/Util/SfxSetup/setup.ico +0 -0
- package/vendor/7zip/C/Xxh64.c +389 -0
- package/vendor/7zip/C/Xxh64.h +50 -0
- package/vendor/7zip/C/Xz.c +92 -0
- package/vendor/7zip/C/Xz.h +542 -0
- package/vendor/7zip/C/XzCrc64.c +140 -0
- package/vendor/7zip/C/XzCrc64.h +26 -0
- package/vendor/7zip/C/XzCrc64Opt.c +261 -0
- package/vendor/7zip/C/XzDec.c +2865 -0
- package/vendor/7zip/C/XzEnc.c +1374 -0
- package/vendor/7zip/C/XzEnc.h +62 -0
- package/vendor/7zip/C/XzIn.c +385 -0
- package/vendor/7zip/C/ZstdDec.c +4067 -0
- package/vendor/7zip/C/ZstdDec.h +173 -0
- package/vendor/7zip/C/var_clang.mak +11 -0
- package/vendor/7zip/C/var_clang_arm64.mak +12 -0
- package/vendor/7zip/C/var_clang_x64.mak +11 -0
- package/vendor/7zip/C/var_clang_x86.mak +11 -0
- package/vendor/7zip/C/var_gcc.mak +12 -0
- package/vendor/7zip/C/var_gcc_arm64.mak +12 -0
- package/vendor/7zip/C/var_gcc_x64.mak +10 -0
- package/vendor/7zip/C/var_gcc_x86.mak +10 -0
- package/vendor/7zip/C/var_mac_arm64.mak +13 -0
- package/vendor/7zip/C/var_mac_x64.mak +13 -0
- package/vendor/7zip/C/warn_clang.mak +1 -0
- package/vendor/7zip/C/warn_clang_mac.mak +1 -0
- package/vendor/7zip/C/warn_gcc.mak +51 -0
- package/vendor/7zip/CPP/7zip/7zip.mak +240 -0
- package/vendor/7zip/CPP/7zip/7zip_gcc.mak +1376 -0
- package/vendor/7zip/CPP/7zip/Aes.mak +10 -0
- package/vendor/7zip/CPP/7zip/Archive/7z/7z.dsp +650 -0
- package/vendor/7zip/CPP/7zip/Archive/7z/7z.dsw +29 -0
- package/vendor/7zip/CPP/7zip/Archive/7z/7zCompressionMode.cpp +3 -0
- package/vendor/7zip/CPP/7zip/Archive/7z/7zCompressionMode.h +92 -0
- package/vendor/7zip/CPP/7zip/Archive/7z/7zDecode.cpp +599 -0
- package/vendor/7zip/CPP/7zip/Archive/7z/7zDecode.h +73 -0
- package/vendor/7zip/CPP/7zip/Archive/7z/7zEncode.cpp +702 -0
- package/vendor/7zip/CPP/7zip/Archive/7z/7zEncode.h +95 -0
- package/vendor/7zip/CPP/7zip/Archive/7z/7zExtract.cpp +444 -0
- package/vendor/7zip/CPP/7zip/Archive/7z/7zFolderInStream.cpp +264 -0
- package/vendor/7zip/CPP/7zip/Archive/7z/7zFolderInStream.h +101 -0
- package/vendor/7zip/CPP/7zip/Archive/7z/7zHandler.cpp +800 -0
- package/vendor/7zip/CPP/7zip/Archive/7z/7zHandler.h +178 -0
- package/vendor/7zip/CPP/7zip/Archive/7z/7zHandlerOut.cpp +1162 -0
- package/vendor/7zip/CPP/7zip/Archive/7z/7zHeader.cpp +19 -0
- package/vendor/7zip/CPP/7zip/Archive/7z/7zHeader.h +156 -0
- package/vendor/7zip/CPP/7zip/Archive/7z/7zIn.cpp +1815 -0
- package/vendor/7zip/CPP/7zip/Archive/7z/7zIn.h +454 -0
- package/vendor/7zip/CPP/7zip/Archive/7z/7zItem.h +207 -0
- package/vendor/7zip/CPP/7zip/Archive/7z/7zOut.cpp +1026 -0
- package/vendor/7zip/CPP/7zip/Archive/7z/7zOut.h +346 -0
- package/vendor/7zip/CPP/7zip/Archive/7z/7zProperties.cpp +182 -0
- package/vendor/7zip/CPP/7zip/Archive/7z/7zProperties.h +26 -0
- package/vendor/7zip/CPP/7zip/Archive/7z/7zRegister.cpp +27 -0
- package/vendor/7zip/CPP/7zip/Archive/7z/7zSpecStream.cpp +31 -0
- package/vendor/7zip/CPP/7zip/Archive/7z/7zSpecStream.h +49 -0
- package/vendor/7zip/CPP/7zip/Archive/7z/7zUpdate.cpp +3087 -0
- package/vendor/7zip/CPP/7zip/Archive/7z/7zUpdate.h +167 -0
- package/vendor/7zip/CPP/7zip/Archive/7z/StdAfx.cpp +3 -0
- package/vendor/7zip/CPP/7zip/Archive/7z/StdAfx.h +11 -0
- package/vendor/7zip/CPP/7zip/Archive/7z/makefile +81 -0
- package/vendor/7zip/CPP/7zip/Archive/7z/resource.rc +11 -0
- package/vendor/7zip/CPP/7zip/Archive/ApfsHandler.cpp +4470 -0
- package/vendor/7zip/CPP/7zip/Archive/ApmHandler.cpp +420 -0
- package/vendor/7zip/CPP/7zip/Archive/ArHandler.cpp +844 -0
- package/vendor/7zip/CPP/7zip/Archive/Archive.def +15 -0
- package/vendor/7zip/CPP/7zip/Archive/Archive2.def +22 -0
- package/vendor/7zip/CPP/7zip/Archive/ArchiveExports.cpp +158 -0
- package/vendor/7zip/CPP/7zip/Archive/ArjHandler.cpp +977 -0
- package/vendor/7zip/CPP/7zip/Archive/AvbHandler.cpp +616 -0
- package/vendor/7zip/CPP/7zip/Archive/Base64Handler.cpp +488 -0
- package/vendor/7zip/CPP/7zip/Archive/Bz2Handler.cpp +482 -0
- package/vendor/7zip/CPP/7zip/Archive/Cab/CabBlockInStream.cpp +122 -0
- package/vendor/7zip/CPP/7zip/Archive/Cab/CabBlockInStream.h +28 -0
- package/vendor/7zip/CPP/7zip/Archive/Cab/CabHandler.cpp +1270 -0
- package/vendor/7zip/CPP/7zip/Archive/Cab/CabHandler.h +29 -0
- package/vendor/7zip/CPP/7zip/Archive/Cab/CabHeader.cpp +15 -0
- package/vendor/7zip/CPP/7zip/Archive/Cab/CabHeader.h +41 -0
- package/vendor/7zip/CPP/7zip/Archive/Cab/CabIn.cpp +485 -0
- package/vendor/7zip/CPP/7zip/Archive/Cab/CabIn.h +169 -0
- package/vendor/7zip/CPP/7zip/Archive/Cab/CabItem.h +69 -0
- package/vendor/7zip/CPP/7zip/Archive/Cab/CabRegister.cpp +19 -0
- package/vendor/7zip/CPP/7zip/Archive/Cab/StdAfx.h +11 -0
- package/vendor/7zip/CPP/7zip/Archive/Chm/ChmHandler.cpp +790 -0
- package/vendor/7zip/CPP/7zip/Archive/Chm/ChmHandler.h +27 -0
- package/vendor/7zip/CPP/7zip/Archive/Chm/ChmIn.cpp +1026 -0
- package/vendor/7zip/CPP/7zip/Archive/Chm/ChmIn.h +282 -0
- package/vendor/7zip/CPP/7zip/Archive/Chm/StdAfx.h +11 -0
- package/vendor/7zip/CPP/7zip/Archive/ComHandler.cpp +1449 -0
- package/vendor/7zip/CPP/7zip/Archive/Common/CoderMixer2.cpp +1144 -0
- package/vendor/7zip/CPP/7zip/Archive/Common/CoderMixer2.h +447 -0
- package/vendor/7zip/CPP/7zip/Archive/Common/DummyOutStream.cpp +17 -0
- package/vendor/7zip/CPP/7zip/Archive/Common/DummyOutStream.h +23 -0
- package/vendor/7zip/CPP/7zip/Archive/Common/FindSignature.cpp +90 -0
- package/vendor/7zip/CPP/7zip/Archive/Common/FindSignature.h +12 -0
- package/vendor/7zip/CPP/7zip/Archive/Common/HandlerOut.cpp +315 -0
- package/vendor/7zip/CPP/7zip/Archive/Common/HandlerOut.h +169 -0
- package/vendor/7zip/CPP/7zip/Archive/Common/InStreamWithCRC.cpp +57 -0
- package/vendor/7zip/CPP/7zip/Archive/Common/InStreamWithCRC.h +64 -0
- package/vendor/7zip/CPP/7zip/Archive/Common/ItemNameUtils.cpp +140 -0
- package/vendor/7zip/CPP/7zip/Archive/Common/ItemNameUtils.h +33 -0
- package/vendor/7zip/CPP/7zip/Archive/Common/MultiStream.cpp +193 -0
- package/vendor/7zip/CPP/7zip/Archive/Common/MultiStream.h +86 -0
- package/vendor/7zip/CPP/7zip/Archive/Common/OutStreamWithCRC.cpp +18 -0
- package/vendor/7zip/CPP/7zip/Archive/Common/OutStreamWithCRC.h +35 -0
- package/vendor/7zip/CPP/7zip/Archive/Common/OutStreamWithSha1.cpp +29 -0
- package/vendor/7zip/CPP/7zip/Archive/Common/OutStreamWithSha1.h +61 -0
- package/vendor/7zip/CPP/7zip/Archive/Common/ParseProperties.cpp +3 -0
- package/vendor/7zip/CPP/7zip/Archive/Common/ParseProperties.h +6 -0
- package/vendor/7zip/CPP/7zip/Archive/Common/StdAfx.h +11 -0
- package/vendor/7zip/CPP/7zip/Archive/CpioHandler.cpp +1110 -0
- package/vendor/7zip/CPP/7zip/Archive/CramfsHandler.cpp +784 -0
- package/vendor/7zip/CPP/7zip/Archive/DeflateProps.cpp +3 -0
- package/vendor/7zip/CPP/7zip/Archive/DeflateProps.h +6 -0
- package/vendor/7zip/CPP/7zip/Archive/DllExports.cpp +96 -0
- package/vendor/7zip/CPP/7zip/Archive/DllExports2.cpp +184 -0
- package/vendor/7zip/CPP/7zip/Archive/DmgHandler.cpp +2336 -0
- package/vendor/7zip/CPP/7zip/Archive/ElfHandler.cpp +1284 -0
- package/vendor/7zip/CPP/7zip/Archive/ExtHandler.cpp +2860 -0
- package/vendor/7zip/CPP/7zip/Archive/FatHandler.cpp +1325 -0
- package/vendor/7zip/CPP/7zip/Archive/FlvHandler.cpp +521 -0
- package/vendor/7zip/CPP/7zip/Archive/GptHandler.cpp +473 -0
- package/vendor/7zip/CPP/7zip/Archive/GzHandler.cpp +1200 -0
- package/vendor/7zip/CPP/7zip/Archive/HandlerCont.cpp +320 -0
- package/vendor/7zip/CPP/7zip/Archive/HandlerCont.h +134 -0
- package/vendor/7zip/CPP/7zip/Archive/HfsHandler.cpp +2631 -0
- package/vendor/7zip/CPP/7zip/Archive/HfsHandler.h +87 -0
- package/vendor/7zip/CPP/7zip/Archive/IArchive.h +755 -0
- package/vendor/7zip/CPP/7zip/Archive/Icons/7z.ico +0 -0
- package/vendor/7zip/CPP/7zip/Archive/Icons/apfs.ico +0 -0
- package/vendor/7zip/CPP/7zip/Archive/Icons/arj.ico +0 -0
- package/vendor/7zip/CPP/7zip/Archive/Icons/bz2.ico +0 -0
- package/vendor/7zip/CPP/7zip/Archive/Icons/cab.ico +0 -0
- package/vendor/7zip/CPP/7zip/Archive/Icons/cpio.ico +0 -0
- package/vendor/7zip/CPP/7zip/Archive/Icons/deb.ico +0 -0
- package/vendor/7zip/CPP/7zip/Archive/Icons/dmg.ico +0 -0
- package/vendor/7zip/CPP/7zip/Archive/Icons/fat.ico +0 -0
- package/vendor/7zip/CPP/7zip/Archive/Icons/gz.ico +0 -0
- package/vendor/7zip/CPP/7zip/Archive/Icons/hfs.ico +0 -0
- package/vendor/7zip/CPP/7zip/Archive/Icons/iso.ico +0 -0
- package/vendor/7zip/CPP/7zip/Archive/Icons/lzh.ico +0 -0
- package/vendor/7zip/CPP/7zip/Archive/Icons/lzma.ico +0 -0
- package/vendor/7zip/CPP/7zip/Archive/Icons/ntfs.ico +0 -0
- package/vendor/7zip/CPP/7zip/Archive/Icons/rar.ico +0 -0
- package/vendor/7zip/CPP/7zip/Archive/Icons/rpm.ico +0 -0
- package/vendor/7zip/CPP/7zip/Archive/Icons/split.ico +0 -0
- package/vendor/7zip/CPP/7zip/Archive/Icons/squashfs.ico +0 -0
- package/vendor/7zip/CPP/7zip/Archive/Icons/tar.ico +0 -0
- package/vendor/7zip/CPP/7zip/Archive/Icons/vhd.ico +0 -0
- package/vendor/7zip/CPP/7zip/Archive/Icons/wim.ico +0 -0
- package/vendor/7zip/CPP/7zip/Archive/Icons/xar.ico +0 -0
- package/vendor/7zip/CPP/7zip/Archive/Icons/xz.ico +0 -0
- package/vendor/7zip/CPP/7zip/Archive/Icons/z.ico +0 -0
- package/vendor/7zip/CPP/7zip/Archive/Icons/zip.ico +0 -0
- package/vendor/7zip/CPP/7zip/Archive/Icons/zst.ico +0 -0
- package/vendor/7zip/CPP/7zip/Archive/IhexHandler.cpp +493 -0
- package/vendor/7zip/CPP/7zip/Archive/Iso/IsoHandler.cpp +498 -0
- package/vendor/7zip/CPP/7zip/Archive/Iso/IsoHandler.h +24 -0
- package/vendor/7zip/CPP/7zip/Archive/Iso/IsoHeader.cpp +12 -0
- package/vendor/7zip/CPP/7zip/Archive/Iso/IsoHeader.h +64 -0
- package/vendor/7zip/CPP/7zip/Archive/Iso/IsoIn.cpp +801 -0
- package/vendor/7zip/CPP/7zip/Archive/Iso/IsoIn.h +328 -0
- package/vendor/7zip/CPP/7zip/Archive/Iso/IsoItem.h +316 -0
- package/vendor/7zip/CPP/7zip/Archive/Iso/IsoRegister.cpp +21 -0
- package/vendor/7zip/CPP/7zip/Archive/Iso/StdAfx.h +11 -0
- package/vendor/7zip/CPP/7zip/Archive/LpHandler.cpp +1172 -0
- package/vendor/7zip/CPP/7zip/Archive/LvmHandler.cpp +1108 -0
- package/vendor/7zip/CPP/7zip/Archive/LzhHandler.cpp +719 -0
- package/vendor/7zip/CPP/7zip/Archive/LzmaHandler.cpp +606 -0
- package/vendor/7zip/CPP/7zip/Archive/MachoHandler.cpp +1075 -0
- package/vendor/7zip/CPP/7zip/Archive/MbrHandler.cpp +648 -0
- package/vendor/7zip/CPP/7zip/Archive/MslzHandler.cpp +389 -0
- package/vendor/7zip/CPP/7zip/Archive/MubHandler.cpp +248 -0
- package/vendor/7zip/CPP/7zip/Archive/Nsis/NsisDecode.cpp +295 -0
- package/vendor/7zip/CPP/7zip/Archive/Nsis/NsisDecode.h +97 -0
- package/vendor/7zip/CPP/7zip/Archive/Nsis/NsisHandler.cpp +703 -0
- package/vendor/7zip/CPP/7zip/Archive/Nsis/NsisHandler.h +30 -0
- package/vendor/7zip/CPP/7zip/Archive/Nsis/NsisIn.cpp +6231 -0
- package/vendor/7zip/CPP/7zip/Archive/Nsis/NsisIn.h +462 -0
- package/vendor/7zip/CPP/7zip/Archive/Nsis/NsisRegister.cpp +20 -0
- package/vendor/7zip/CPP/7zip/Archive/Nsis/StdAfx.h +11 -0
- package/vendor/7zip/CPP/7zip/Archive/NtfsHandler.cpp +2944 -0
- package/vendor/7zip/CPP/7zip/Archive/PeHandler.cpp +3427 -0
- package/vendor/7zip/CPP/7zip/Archive/PpmdHandler.cpp +414 -0
- package/vendor/7zip/CPP/7zip/Archive/QcowHandler.cpp +713 -0
- package/vendor/7zip/CPP/7zip/Archive/Rar/Rar5Handler.cpp +3483 -0
- package/vendor/7zip/CPP/7zip/Archive/Rar/Rar5Handler.h +527 -0
- package/vendor/7zip/CPP/7zip/Archive/Rar/RarHandler.cpp +1775 -0
- package/vendor/7zip/CPP/7zip/Archive/Rar/RarHandler.h +115 -0
- package/vendor/7zip/CPP/7zip/Archive/Rar/RarHeader.h +209 -0
- package/vendor/7zip/CPP/7zip/Archive/Rar/RarItem.h +97 -0
- package/vendor/7zip/CPP/7zip/Archive/Rar/RarVol.h +136 -0
- package/vendor/7zip/CPP/7zip/Archive/Rar/StdAfx.cpp +3 -0
- package/vendor/7zip/CPP/7zip/Archive/Rar/StdAfx.h +11 -0
- package/vendor/7zip/CPP/7zip/Archive/RpmHandler.cpp +775 -0
- package/vendor/7zip/CPP/7zip/Archive/SparseHandler.cpp +558 -0
- package/vendor/7zip/CPP/7zip/Archive/SplitHandler.cpp +353 -0
- package/vendor/7zip/CPP/7zip/Archive/SquashfsHandler.cpp +2373 -0
- package/vendor/7zip/CPP/7zip/Archive/StdAfx.h +11 -0
- package/vendor/7zip/CPP/7zip/Archive/SwfHandler.cpp +996 -0
- package/vendor/7zip/CPP/7zip/Archive/Tar/StdAfx.h +11 -0
- package/vendor/7zip/CPP/7zip/Archive/Tar/TarHandler.cpp +1105 -0
- package/vendor/7zip/CPP/7zip/Archive/Tar/TarHandler.h +57 -0
- package/vendor/7zip/CPP/7zip/Archive/Tar/TarHandlerOut.cpp +332 -0
- package/vendor/7zip/CPP/7zip/Archive/Tar/TarHeader.cpp +99 -0
- package/vendor/7zip/CPP/7zip/Archive/Tar/TarHeader.h +90 -0
- package/vendor/7zip/CPP/7zip/Archive/Tar/TarIn.cpp +1151 -0
- package/vendor/7zip/CPP/7zip/Archive/Tar/TarIn.h +151 -0
- package/vendor/7zip/CPP/7zip/Archive/Tar/TarItem.h +365 -0
- package/vendor/7zip/CPP/7zip/Archive/Tar/TarOut.cpp +644 -0
- package/vendor/7zip/CPP/7zip/Archive/Tar/TarOut.h +53 -0
- package/vendor/7zip/CPP/7zip/Archive/Tar/TarRegister.cpp +31 -0
- package/vendor/7zip/CPP/7zip/Archive/Tar/TarUpdate.cpp +563 -0
- package/vendor/7zip/CPP/7zip/Archive/Tar/TarUpdate.h +74 -0
- package/vendor/7zip/CPP/7zip/Archive/Udf/StdAfx.h +11 -0
- package/vendor/7zip/CPP/7zip/Archive/Udf/UdfHandler.cpp +427 -0
- package/vendor/7zip/CPP/7zip/Archive/Udf/UdfHandler.h +32 -0
- package/vendor/7zip/CPP/7zip/Archive/Udf/UdfIn.cpp +1756 -0
- package/vendor/7zip/CPP/7zip/Archive/Udf/UdfIn.h +508 -0
- package/vendor/7zip/CPP/7zip/Archive/UefiHandler.cpp +1884 -0
- package/vendor/7zip/CPP/7zip/Archive/VdiHandler.cpp +433 -0
- package/vendor/7zip/CPP/7zip/Archive/VhdHandler.cpp +1106 -0
- package/vendor/7zip/CPP/7zip/Archive/VhdxHandler.cpp +2085 -0
- package/vendor/7zip/CPP/7zip/Archive/VmdkHandler.cpp +1530 -0
- package/vendor/7zip/CPP/7zip/Archive/Wim/StdAfx.h +11 -0
- package/vendor/7zip/CPP/7zip/Archive/Wim/WimHandler.cpp +1291 -0
- package/vendor/7zip/CPP/7zip/Archive/Wim/WimHandler.h +117 -0
- package/vendor/7zip/CPP/7zip/Archive/Wim/WimHandlerOut.cpp +2008 -0
- package/vendor/7zip/CPP/7zip/Archive/Wim/WimIn.cpp +2104 -0
- package/vendor/7zip/CPP/7zip/Archive/Wim/WimIn.h +719 -0
- package/vendor/7zip/CPP/7zip/Archive/Wim/WimRegister.cpp +29 -0
- package/vendor/7zip/CPP/7zip/Archive/XarHandler.cpp +1316 -0
- package/vendor/7zip/CPP/7zip/Archive/XzHandler.cpp +1452 -0
- package/vendor/7zip/CPP/7zip/Archive/XzHandler.h +11 -0
- package/vendor/7zip/CPP/7zip/Archive/ZHandler.cpp +208 -0
- package/vendor/7zip/CPP/7zip/Archive/Zip/StdAfx.h +11 -0
- package/vendor/7zip/CPP/7zip/Archive/Zip/ZipAddCommon.cpp +484 -0
- package/vendor/7zip/CPP/7zip/Archive/Zip/ZipAddCommon.h +76 -0
- package/vendor/7zip/CPP/7zip/Archive/Zip/ZipCompressionMode.h +62 -0
- package/vendor/7zip/CPP/7zip/Archive/Zip/ZipHandler.cpp +1679 -0
- package/vendor/7zip/CPP/7zip/Archive/Zip/ZipHandler.h +94 -0
- package/vendor/7zip/CPP/7zip/Archive/Zip/ZipHandlerOut.cpp +626 -0
- package/vendor/7zip/CPP/7zip/Archive/Zip/ZipHeader.h +201 -0
- package/vendor/7zip/CPP/7zip/Archive/Zip/ZipIn.cpp +3474 -0
- package/vendor/7zip/CPP/7zip/Archive/Zip/ZipIn.h +456 -0
- package/vendor/7zip/CPP/7zip/Archive/Zip/ZipItem.cpp +464 -0
- package/vendor/7zip/CPP/7zip/Archive/Zip/ZipItem.h +356 -0
- package/vendor/7zip/CPP/7zip/Archive/Zip/ZipOut.cpp +428 -0
- package/vendor/7zip/CPP/7zip/Archive/Zip/ZipOut.h +103 -0
- package/vendor/7zip/CPP/7zip/Archive/Zip/ZipRegister.cpp +38 -0
- package/vendor/7zip/CPP/7zip/Archive/Zip/ZipUpdate.cpp +2165 -0
- package/vendor/7zip/CPP/7zip/Archive/Zip/ZipUpdate.h +107 -0
- package/vendor/7zip/CPP/7zip/Archive/ZstdHandler.cpp +1147 -0
- package/vendor/7zip/CPP/7zip/Archive/makefile +23 -0
- package/vendor/7zip/CPP/7zip/Asm.mak +12 -0
- package/vendor/7zip/CPP/7zip/Bundles/Alone/Alone.dsp +3324 -0
- package/vendor/7zip/CPP/7zip/Bundles/Alone/Alone.dsw +29 -0
- package/vendor/7zip/CPP/7zip/Bundles/Alone/StdAfx.cpp +3 -0
- package/vendor/7zip/CPP/7zip/Bundles/Alone/StdAfx.h +11 -0
- package/vendor/7zip/CPP/7zip/Bundles/Alone/makefile +245 -0
- package/vendor/7zip/CPP/7zip/Bundles/Alone/makefile.gcc +354 -0
- package/vendor/7zip/CPP/7zip/Bundles/Alone/resource.rc +7 -0
- package/vendor/7zip/CPP/7zip/Bundles/Alone2/StdAfx.cpp +3 -0
- package/vendor/7zip/CPP/7zip/Bundles/Alone2/StdAfx.h +11 -0
- package/vendor/7zip/CPP/7zip/Bundles/Alone2/makefile +31 -0
- package/vendor/7zip/CPP/7zip/Bundles/Alone2/makefile.gcc +108 -0
- package/vendor/7zip/CPP/7zip/Bundles/Alone2/resource.rc +7 -0
- package/vendor/7zip/CPP/7zip/Bundles/Alone7z/Alone.dsp +2090 -0
- package/vendor/7zip/CPP/7zip/Bundles/Alone7z/Alone.dsw +29 -0
- package/vendor/7zip/CPP/7zip/Bundles/Alone7z/StdAfx.cpp +3 -0
- package/vendor/7zip/CPP/7zip/Bundles/Alone7z/StdAfx.h +11 -0
- package/vendor/7zip/CPP/7zip/Bundles/Alone7z/makefile +168 -0
- package/vendor/7zip/CPP/7zip/Bundles/Alone7z/makefile.gcc +276 -0
- package/vendor/7zip/CPP/7zip/Bundles/Alone7z/resource.rc +7 -0
- package/vendor/7zip/CPP/7zip/Bundles/Fm/FM.dsp +2275 -0
- package/vendor/7zip/CPP/7zip/Bundles/Fm/FM.dsw +29 -0
- package/vendor/7zip/CPP/7zip/Bundles/Fm/StdAfx.cpp +3 -0
- package/vendor/7zip/CPP/7zip/Bundles/Fm/StdAfx.h +6 -0
- package/vendor/7zip/CPP/7zip/Bundles/Fm/makefile +82 -0
- package/vendor/7zip/CPP/7zip/Bundles/Fm/resource.rc +7 -0
- package/vendor/7zip/CPP/7zip/Bundles/Format7z/StdAfx.cpp +3 -0
- package/vendor/7zip/CPP/7zip/Bundles/Format7z/StdAfx.h +11 -0
- package/vendor/7zip/CPP/7zip/Bundles/Format7z/makefile +148 -0
- package/vendor/7zip/CPP/7zip/Bundles/Format7z/resource.rc +5 -0
- package/vendor/7zip/CPP/7zip/Bundles/Format7zExtract/StdAfx.cpp +3 -0
- package/vendor/7zip/CPP/7zip/Bundles/Format7zExtract/StdAfx.h +11 -0
- package/vendor/7zip/CPP/7zip/Bundles/Format7zExtract/makefile +116 -0
- package/vendor/7zip/CPP/7zip/Bundles/Format7zExtract/resource.rc +5 -0
- package/vendor/7zip/CPP/7zip/Bundles/Format7zExtractR/StdAfx.cpp +3 -0
- package/vendor/7zip/CPP/7zip/Bundles/Format7zExtractR/StdAfx.h +11 -0
- package/vendor/7zip/CPP/7zip/Bundles/Format7zExtractR/makefile +98 -0
- package/vendor/7zip/CPP/7zip/Bundles/Format7zExtractR/resource.rc +5 -0
- package/vendor/7zip/CPP/7zip/Bundles/Format7zF/Arc.mak +310 -0
- package/vendor/7zip/CPP/7zip/Bundles/Format7zF/Arc_gcc.mak +395 -0
- package/vendor/7zip/CPP/7zip/Bundles/Format7zF/Format7z.dsp +3486 -0
- package/vendor/7zip/CPP/7zip/Bundles/Format7zF/Format7z.dsw +29 -0
- package/vendor/7zip/CPP/7zip/Bundles/Format7zF/StdAfx.cpp +3 -0
- package/vendor/7zip/CPP/7zip/Bundles/Format7zF/StdAfx.h +11 -0
- package/vendor/7zip/CPP/7zip/Bundles/Format7zF/makefile +20 -0
- package/vendor/7zip/CPP/7zip/Bundles/Format7zF/makefile.gcc +55 -0
- package/vendor/7zip/CPP/7zip/Bundles/Format7zF/resource.rc +39 -0
- package/vendor/7zip/CPP/7zip/Bundles/Format7zR/StdAfx.cpp +3 -0
- package/vendor/7zip/CPP/7zip/Bundles/Format7zR/StdAfx.h +11 -0
- package/vendor/7zip/CPP/7zip/Bundles/Format7zR/makefile +121 -0
- package/vendor/7zip/CPP/7zip/Bundles/Format7zR/resource.rc +5 -0
- package/vendor/7zip/CPP/7zip/Bundles/LzmaCon/LzmaAlone.cpp +815 -0
- package/vendor/7zip/CPP/7zip/Bundles/LzmaCon/LzmaCon.dsp +540 -0
- package/vendor/7zip/CPP/7zip/Bundles/LzmaCon/LzmaCon.dsw +29 -0
- package/vendor/7zip/CPP/7zip/Bundles/LzmaCon/StdAfx.cpp +3 -0
- package/vendor/7zip/CPP/7zip/Bundles/LzmaCon/StdAfx.h +11 -0
- package/vendor/7zip/CPP/7zip/Bundles/LzmaCon/makefile +68 -0
- package/vendor/7zip/CPP/7zip/Bundles/LzmaCon/makefile.gcc +131 -0
- package/vendor/7zip/CPP/7zip/Bundles/LzmaCon/resource.rc +3 -0
- package/vendor/7zip/CPP/7zip/Bundles/SFXCon/7z.ico +0 -0
- package/vendor/7zip/CPP/7zip/Bundles/SFXCon/SFXCon.dsp +1017 -0
- package/vendor/7zip/CPP/7zip/Bundles/SFXCon/SFXCon.dsw +29 -0
- package/vendor/7zip/CPP/7zip/Bundles/SFXCon/SfxCon.cpp +521 -0
- package/vendor/7zip/CPP/7zip/Bundles/SFXCon/StdAfx.cpp +3 -0
- package/vendor/7zip/CPP/7zip/Bundles/SFXCon/StdAfx.h +11 -0
- package/vendor/7zip/CPP/7zip/Bundles/SFXCon/makefile +137 -0
- package/vendor/7zip/CPP/7zip/Bundles/SFXCon/makefile.gcc +215 -0
- package/vendor/7zip/CPP/7zip/Bundles/SFXCon/resource.rc +9 -0
- package/vendor/7zip/CPP/7zip/Bundles/SFXSetup/ExtractCallbackSfx.cpp +246 -0
- package/vendor/7zip/CPP/7zip/Bundles/SFXSetup/ExtractCallbackSfx.h +83 -0
- package/vendor/7zip/CPP/7zip/Bundles/SFXSetup/ExtractEngine.cpp +135 -0
- package/vendor/7zip/CPP/7zip/Bundles/SFXSetup/ExtractEngine.h +11 -0
- package/vendor/7zip/CPP/7zip/Bundles/SFXSetup/SFXSetup.dsp +872 -0
- package/vendor/7zip/CPP/7zip/Bundles/SFXSetup/SFXSetup.dsw +29 -0
- package/vendor/7zip/CPP/7zip/Bundles/SFXSetup/SfxSetup.cpp +359 -0
- package/vendor/7zip/CPP/7zip/Bundles/SFXSetup/StdAfx.cpp +3 -0
- package/vendor/7zip/CPP/7zip/Bundles/SFXSetup/StdAfx.h +6 -0
- package/vendor/7zip/CPP/7zip/Bundles/SFXSetup/makefile +121 -0
- package/vendor/7zip/CPP/7zip/Bundles/SFXSetup/resource.h +6 -0
- package/vendor/7zip/CPP/7zip/Bundles/SFXSetup/resource.rc +16 -0
- package/vendor/7zip/CPP/7zip/Bundles/SFXSetup/setup.ico +0 -0
- package/vendor/7zip/CPP/7zip/Bundles/SFXWin/7z.ico +0 -0
- package/vendor/7zip/CPP/7zip/Bundles/SFXWin/SFXWin.dsp +1074 -0
- package/vendor/7zip/CPP/7zip/Bundles/SFXWin/SFXWin.dsw +29 -0
- package/vendor/7zip/CPP/7zip/Bundles/SFXWin/SfxWin.cpp +268 -0
- package/vendor/7zip/CPP/7zip/Bundles/SFXWin/StdAfx.cpp +3 -0
- package/vendor/7zip/CPP/7zip/Bundles/SFXWin/StdAfx.h +6 -0
- package/vendor/7zip/CPP/7zip/Bundles/SFXWin/makefile +159 -0
- package/vendor/7zip/CPP/7zip/Bundles/SFXWin/resource.h +1 -0
- package/vendor/7zip/CPP/7zip/Bundles/SFXWin/resource.rc +55 -0
- package/vendor/7zip/CPP/7zip/Bundles/makefile +19 -0
- package/vendor/7zip/CPP/7zip/Common/CWrappers.cpp +358 -0
- package/vendor/7zip/CPP/7zip/Common/CWrappers.h +182 -0
- package/vendor/7zip/CPP/7zip/Common/CreateCoder.cpp +548 -0
- package/vendor/7zip/CPP/7zip/Common/CreateCoder.h +200 -0
- package/vendor/7zip/CPP/7zip/Common/FilePathAutoRename.cpp +46 -0
- package/vendor/7zip/CPP/7zip/Common/FilePathAutoRename.h +10 -0
- package/vendor/7zip/CPP/7zip/Common/FileStreams.cpp +923 -0
- package/vendor/7zip/CPP/7zip/Common/FileStreams.h +205 -0
- package/vendor/7zip/CPP/7zip/Common/FilterCoder.cpp +582 -0
- package/vendor/7zip/CPP/7zip/Common/FilterCoder.h +201 -0
- package/vendor/7zip/CPP/7zip/Common/InBuffer.cpp +182 -0
- package/vendor/7zip/CPP/7zip/Common/InBuffer.h +121 -0
- package/vendor/7zip/CPP/7zip/Common/InOutTempBuffer.cpp +237 -0
- package/vendor/7zip/CPP/7zip/Common/InOutTempBuffer.h +45 -0
- package/vendor/7zip/CPP/7zip/Common/LimitedStreams.cpp +395 -0
- package/vendor/7zip/CPP/7zip/Common/LimitedStreams.h +221 -0
- package/vendor/7zip/CPP/7zip/Common/LockedStream.cpp +3 -0
- package/vendor/7zip/CPP/7zip/Common/LockedStream.h +6 -0
- package/vendor/7zip/CPP/7zip/Common/MemBlocks.cpp +215 -0
- package/vendor/7zip/CPP/7zip/Common/MemBlocks.h +72 -0
- package/vendor/7zip/CPP/7zip/Common/MethodId.cpp +3 -0
- package/vendor/7zip/CPP/7zip/Common/MethodId.h +10 -0
- package/vendor/7zip/CPP/7zip/Common/MethodProps.cpp +765 -0
- package/vendor/7zip/CPP/7zip/Common/MethodProps.h +348 -0
- package/vendor/7zip/CPP/7zip/Common/MultiOutStream.cpp +855 -0
- package/vendor/7zip/CPP/7zip/Common/MultiOutStream.h +160 -0
- package/vendor/7zip/CPP/7zip/Common/OffsetStream.cpp +37 -0
- package/vendor/7zip/CPP/7zip/Common/OffsetStream.h +22 -0
- package/vendor/7zip/CPP/7zip/Common/OutBuffer.cpp +111 -0
- package/vendor/7zip/CPP/7zip/Common/OutBuffer.h +133 -0
- package/vendor/7zip/CPP/7zip/Common/OutMemStream.cpp +158 -0
- package/vendor/7zip/CPP/7zip/Common/OutMemStream.h +104 -0
- package/vendor/7zip/CPP/7zip/Common/ProgressMt.cpp +53 -0
- package/vendor/7zip/CPP/7zip/Common/ProgressMt.h +43 -0
- package/vendor/7zip/CPP/7zip/Common/ProgressUtils.cpp +51 -0
- package/vendor/7zip/CPP/7zip/Common/ProgressUtils.h +33 -0
- package/vendor/7zip/CPP/7zip/Common/PropId.cpp +115 -0
- package/vendor/7zip/CPP/7zip/Common/RegisterArc.h +80 -0
- package/vendor/7zip/CPP/7zip/Common/RegisterCodec.h +106 -0
- package/vendor/7zip/CPP/7zip/Common/StdAfx.h +11 -0
- package/vendor/7zip/CPP/7zip/Common/StreamBinder.cpp +151 -0
- package/vendor/7zip/CPP/7zip/Common/StreamBinder.h +78 -0
- package/vendor/7zip/CPP/7zip/Common/StreamObjects.cpp +290 -0
- package/vendor/7zip/CPP/7zip/Common/StreamObjects.h +146 -0
- package/vendor/7zip/CPP/7zip/Common/StreamUtils.cpp +101 -0
- package/vendor/7zip/CPP/7zip/Common/StreamUtils.h +31 -0
- package/vendor/7zip/CPP/7zip/Common/UniqBlocks.cpp +57 -0
- package/vendor/7zip/CPP/7zip/Common/UniqBlocks.h +41 -0
- package/vendor/7zip/CPP/7zip/Common/VirtThread.cpp +47 -0
- package/vendor/7zip/CPP/7zip/Common/VirtThread.h +24 -0
- package/vendor/7zip/CPP/7zip/Compress/BZip2Const.h +71 -0
- package/vendor/7zip/CPP/7zip/Compress/BZip2Crc.cpp +28 -0
- package/vendor/7zip/CPP/7zip/Compress/BZip2Crc.h +31 -0
- package/vendor/7zip/CPP/7zip/Compress/BZip2Decoder.cpp +1777 -0
- package/vendor/7zip/CPP/7zip/Compress/BZip2Decoder.h +388 -0
- package/vendor/7zip/CPP/7zip/Compress/BZip2Encoder.cpp +1116 -0
- package/vendor/7zip/CPP/7zip/Compress/BZip2Encoder.h +273 -0
- package/vendor/7zip/CPP/7zip/Compress/BZip2Register.cpp +25 -0
- package/vendor/7zip/CPP/7zip/Compress/Bcj2Coder.cpp +867 -0
- package/vendor/7zip/CPP/7zip/Compress/Bcj2Coder.h +127 -0
- package/vendor/7zip/CPP/7zip/Compress/Bcj2Register.cpp +24 -0
- package/vendor/7zip/CPP/7zip/Compress/BcjCoder.cpp +24 -0
- package/vendor/7zip/CPP/7zip/Compress/BcjCoder.h +37 -0
- package/vendor/7zip/CPP/7zip/Compress/BcjRegister.cpp +17 -0
- package/vendor/7zip/CPP/7zip/Compress/BitlDecoder.cpp +32 -0
- package/vendor/7zip/CPP/7zip/Compress/BitlDecoder.h +225 -0
- package/vendor/7zip/CPP/7zip/Compress/BitlEncoder.h +57 -0
- package/vendor/7zip/CPP/7zip/Compress/BitmDecoder.h +106 -0
- package/vendor/7zip/CPP/7zip/Compress/BitmEncoder.h +90 -0
- package/vendor/7zip/CPP/7zip/Compress/BranchMisc.cpp +106 -0
- package/vendor/7zip/CPP/7zip/Compress/BranchMisc.h +59 -0
- package/vendor/7zip/CPP/7zip/Compress/BranchRegister.cpp +58 -0
- package/vendor/7zip/CPP/7zip/Compress/ByteSwap.cpp +91 -0
- package/vendor/7zip/CPP/7zip/Compress/Codec.def +7 -0
- package/vendor/7zip/CPP/7zip/Compress/CodecExports.cpp +378 -0
- package/vendor/7zip/CPP/7zip/Compress/CopyCoder.cpp +153 -0
- package/vendor/7zip/CPP/7zip/Compress/CopyCoder.h +34 -0
- package/vendor/7zip/CPP/7zip/Compress/CopyRegister.cpp +15 -0
- package/vendor/7zip/CPP/7zip/Compress/Deflate64Register.cpp +25 -0
- package/vendor/7zip/CPP/7zip/Compress/DeflateConst.h +131 -0
- package/vendor/7zip/CPP/7zip/Compress/DeflateDecoder.cpp +566 -0
- package/vendor/7zip/CPP/7zip/Compress/DeflateDecoder.h +154 -0
- package/vendor/7zip/CPP/7zip/Compress/DeflateEncoder.cpp +1045 -0
- package/vendor/7zip/CPP/7zip/Compress/DeflateEncoder.h +203 -0
- package/vendor/7zip/CPP/7zip/Compress/DeflateRegister.cpp +25 -0
- package/vendor/7zip/CPP/7zip/Compress/DeltaFilter.cpp +126 -0
- package/vendor/7zip/CPP/7zip/Compress/DllExports2Compress.cpp +38 -0
- package/vendor/7zip/CPP/7zip/Compress/DllExportsCompress.cpp +59 -0
- package/vendor/7zip/CPP/7zip/Compress/HuffmanDecoder.h +528 -0
- package/vendor/7zip/CPP/7zip/Compress/ImplodeDecoder.cpp +250 -0
- package/vendor/7zip/CPP/7zip/Compress/ImplodeDecoder.h +61 -0
- package/vendor/7zip/CPP/7zip/Compress/ImplodeHuffmanDecoder.cpp +3 -0
- package/vendor/7zip/CPP/7zip/Compress/ImplodeHuffmanDecoder.h +6 -0
- package/vendor/7zip/CPP/7zip/Compress/LzOutWindow.cpp +14 -0
- package/vendor/7zip/CPP/7zip/Compress/LzOutWindow.h +102 -0
- package/vendor/7zip/CPP/7zip/Compress/LzfseDecoder.cpp +950 -0
- package/vendor/7zip/CPP/7zip/Compress/LzfseDecoder.h +63 -0
- package/vendor/7zip/CPP/7zip/Compress/LzhDecoder.cpp +220 -0
- package/vendor/7zip/CPP/7zip/Compress/LzhDecoder.h +68 -0
- package/vendor/7zip/CPP/7zip/Compress/Lzma2Decoder.cpp +267 -0
- package/vendor/7zip/CPP/7zip/Compress/Lzma2Decoder.h +87 -0
- package/vendor/7zip/CPP/7zip/Compress/Lzma2Encoder.cpp +134 -0
- package/vendor/7zip/CPP/7zip/Compress/Lzma2Encoder.h +30 -0
- package/vendor/7zip/CPP/7zip/Compress/Lzma2Register.cpp +22 -0
- package/vendor/7zip/CPP/7zip/Compress/LzmaDecoder.cpp +350 -0
- package/vendor/7zip/CPP/7zip/Compress/LzmaDecoder.h +113 -0
- package/vendor/7zip/CPP/7zip/Compress/LzmaEncoder.cpp +374 -0
- package/vendor/7zip/CPP/7zip/Compress/LzmaEncoder.h +45 -0
- package/vendor/7zip/CPP/7zip/Compress/LzmaRegister.cpp +22 -0
- package/vendor/7zip/CPP/7zip/Compress/LzmsDecoder.cpp +619 -0
- package/vendor/7zip/CPP/7zip/Compress/LzmsDecoder.h +209 -0
- package/vendor/7zip/CPP/7zip/Compress/Lzx.h +61 -0
- package/vendor/7zip/CPP/7zip/Compress/LzxDecoder.cpp +1517 -0
- package/vendor/7zip/CPP/7zip/Compress/LzxDecoder.h +106 -0
- package/vendor/7zip/CPP/7zip/Compress/Mtf8.h +225 -0
- package/vendor/7zip/CPP/7zip/Compress/PpmdDecoder.cpp +219 -0
- package/vendor/7zip/CPP/7zip/Compress/PpmdDecoder.h +87 -0
- package/vendor/7zip/CPP/7zip/Compress/PpmdEncoder.cpp +193 -0
- package/vendor/7zip/CPP/7zip/Compress/PpmdEncoder.h +49 -0
- package/vendor/7zip/CPP/7zip/Compress/PpmdRegister.cpp +22 -0
- package/vendor/7zip/CPP/7zip/Compress/PpmdZip.cpp +309 -0
- package/vendor/7zip/CPP/7zip/Compress/PpmdZip.h +78 -0
- package/vendor/7zip/CPP/7zip/Compress/QuantumDecoder.cpp +355 -0
- package/vendor/7zip/CPP/7zip/Compress/QuantumDecoder.h +60 -0
- package/vendor/7zip/CPP/7zip/Compress/Rar1Decoder.cpp +518 -0
- package/vendor/7zip/CPP/7zip/Compress/Rar1Decoder.h +70 -0
- package/vendor/7zip/CPP/7zip/Compress/Rar2Decoder.cpp +472 -0
- package/vendor/7zip/CPP/7zip/Compress/Rar2Decoder.h +111 -0
- package/vendor/7zip/CPP/7zip/Compress/Rar3Decoder.cpp +939 -0
- package/vendor/7zip/CPP/7zip/Compress/Rar3Decoder.h +283 -0
- package/vendor/7zip/CPP/7zip/Compress/Rar3Vm.cpp +1153 -0
- package/vendor/7zip/CPP/7zip/Compress/Rar3Vm.h +195 -0
- package/vendor/7zip/CPP/7zip/Compress/Rar5Decoder.cpp +2060 -0
- package/vendor/7zip/CPP/7zip/Compress/Rar5Decoder.h +132 -0
- package/vendor/7zip/CPP/7zip/Compress/RarCodecsRegister.cpp +33 -0
- package/vendor/7zip/CPP/7zip/Compress/ShrinkDecoder.cpp +290 -0
- package/vendor/7zip/CPP/7zip/Compress/ShrinkDecoder.h +38 -0
- package/vendor/7zip/CPP/7zip/Compress/StdAfx.h +11 -0
- package/vendor/7zip/CPP/7zip/Compress/XpressDecoder.cpp +399 -0
- package/vendor/7zip/CPP/7zip/Compress/XpressDecoder.h +18 -0
- package/vendor/7zip/CPP/7zip/Compress/XzDecoder.cpp +151 -0
- package/vendor/7zip/CPP/7zip/Compress/XzDecoder.h +86 -0
- package/vendor/7zip/CPP/7zip/Compress/XzEncoder.cpp +243 -0
- package/vendor/7zip/CPP/7zip/Compress/XzEncoder.h +35 -0
- package/vendor/7zip/CPP/7zip/Compress/ZDecoder.cpp +392 -0
- package/vendor/7zip/CPP/7zip/Compress/ZDecoder.h +41 -0
- package/vendor/7zip/CPP/7zip/Compress/ZlibDecoder.cpp +136 -0
- package/vendor/7zip/CPP/7zip/Compress/ZlibDecoder.h +78 -0
- package/vendor/7zip/CPP/7zip/Compress/ZlibEncoder.cpp +61 -0
- package/vendor/7zip/CPP/7zip/Compress/ZlibEncoder.h +42 -0
- package/vendor/7zip/CPP/7zip/Compress/ZstdDecoder.cpp +437 -0
- package/vendor/7zip/CPP/7zip/Compress/ZstdDecoder.h +98 -0
- package/vendor/7zip/CPP/7zip/Compress/makefile +7 -0
- package/vendor/7zip/CPP/7zip/Crc.mak +8 -0
- package/vendor/7zip/CPP/7zip/Crc64.mak +8 -0
- package/vendor/7zip/CPP/7zip/Crypto/7zAes.cpp +315 -0
- package/vendor/7zip/CPP/7zip/Crypto/7zAes.h +130 -0
- package/vendor/7zip/CPP/7zip/Crypto/7zAesRegister.cpp +17 -0
- package/vendor/7zip/CPP/7zip/Crypto/Codec.def +4 -0
- package/vendor/7zip/CPP/7zip/Crypto/HmacSha1.cpp +94 -0
- package/vendor/7zip/CPP/7zip/Crypto/HmacSha1.h +31 -0
- package/vendor/7zip/CPP/7zip/Crypto/HmacSha256.cpp +53 -0
- package/vendor/7zip/CPP/7zip/Crypto/HmacSha256.h +27 -0
- package/vendor/7zip/CPP/7zip/Crypto/MyAes.cpp +277 -0
- package/vendor/7zip/CPP/7zip/Crypto/MyAes.h +122 -0
- package/vendor/7zip/CPP/7zip/Crypto/MyAesReg.cpp +29 -0
- package/vendor/7zip/CPP/7zip/Crypto/Pbkdf2HmacSha1.cpp +48 -0
- package/vendor/7zip/CPP/7zip/Crypto/Pbkdf2HmacSha1.h +19 -0
- package/vendor/7zip/CPP/7zip/Crypto/RandGen.cpp +242 -0
- package/vendor/7zip/CPP/7zip/Crypto/RandGen.h +41 -0
- package/vendor/7zip/CPP/7zip/Crypto/Rar20Crypto.cpp +130 -0
- package/vendor/7zip/CPP/7zip/Crypto/Rar20Crypto.h +54 -0
- package/vendor/7zip/CPP/7zip/Crypto/Rar5Aes.cpp +273 -0
- package/vendor/7zip/CPP/7zip/Crypto/Rar5Aes.h +97 -0
- package/vendor/7zip/CPP/7zip/Crypto/RarAes.cpp +202 -0
- package/vendor/7zip/CPP/7zip/Crypto/RarAes.h +54 -0
- package/vendor/7zip/CPP/7zip/Crypto/Sha1Cls.h +37 -0
- package/vendor/7zip/CPP/7zip/Crypto/StdAfx.h +11 -0
- package/vendor/7zip/CPP/7zip/Crypto/WzAes.cpp +231 -0
- package/vendor/7zip/CPP/7zip/Crypto/WzAes.h +161 -0
- package/vendor/7zip/CPP/7zip/Crypto/ZipCrypto.cpp +114 -0
- package/vendor/7zip/CPP/7zip/Crypto/ZipCrypto.h +80 -0
- package/vendor/7zip/CPP/7zip/Crypto/ZipStrong.cpp +265 -0
- package/vendor/7zip/CPP/7zip/Crypto/ZipStrong.h +73 -0
- package/vendor/7zip/CPP/7zip/GuiCommon.rc +119 -0
- package/vendor/7zip/CPP/7zip/Guid.txt +243 -0
- package/vendor/7zip/CPP/7zip/ICoder.h +480 -0
- package/vendor/7zip/CPP/7zip/IDecl.h +76 -0
- package/vendor/7zip/CPP/7zip/IPassword.h +54 -0
- package/vendor/7zip/CPP/7zip/IProgress.h +20 -0
- package/vendor/7zip/CPP/7zip/IStream.h +210 -0
- package/vendor/7zip/CPP/7zip/LzFindOpt.mak +7 -0
- package/vendor/7zip/CPP/7zip/LzmaDec.mak +7 -0
- package/vendor/7zip/CPP/7zip/LzmaDec_gcc.mak +14 -0
- package/vendor/7zip/CPP/7zip/MyVersion.h +2 -0
- package/vendor/7zip/CPP/7zip/MyVersionInfo.rc +2 -0
- package/vendor/7zip/CPP/7zip/PropID.h +178 -0
- package/vendor/7zip/CPP/7zip/Sha1.mak +13 -0
- package/vendor/7zip/CPP/7zip/Sha256.mak +13 -0
- package/vendor/7zip/CPP/7zip/Sort.mak +6 -0
- package/vendor/7zip/CPP/7zip/SubBuild.mak +3 -0
- package/vendor/7zip/CPP/7zip/UI/Agent/Agent.cpp +2003 -0
- package/vendor/7zip/CPP/7zip/UI/Agent/Agent.h +365 -0
- package/vendor/7zip/CPP/7zip/UI/Agent/AgentOut.cpp +776 -0
- package/vendor/7zip/CPP/7zip/UI/Agent/AgentProxy.cpp +1098 -0
- package/vendor/7zip/CPP/7zip/UI/Agent/AgentProxy.h +198 -0
- package/vendor/7zip/CPP/7zip/UI/Agent/ArchiveFolder.cpp +57 -0
- package/vendor/7zip/CPP/7zip/UI/Agent/ArchiveFolderOpen.cpp +243 -0
- package/vendor/7zip/CPP/7zip/UI/Agent/ArchiveFolderOut.cpp +457 -0
- package/vendor/7zip/CPP/7zip/UI/Agent/IFolderArchive.h +123 -0
- package/vendor/7zip/CPP/7zip/UI/Agent/StdAfx.h +11 -0
- package/vendor/7zip/CPP/7zip/UI/Agent/UpdateCallbackAgent.cpp +208 -0
- package/vendor/7zip/CPP/7zip/UI/Agent/UpdateCallbackAgent.h +22 -0
- package/vendor/7zip/CPP/7zip/UI/Client7z/Client7z.cpp +1145 -0
- package/vendor/7zip/CPP/7zip/UI/Client7z/Client7z.dsp +331 -0
- package/vendor/7zip/CPP/7zip/UI/Client7z/Client7z.dsw +29 -0
- package/vendor/7zip/CPP/7zip/UI/Client7z/StdAfx.cpp +3 -0
- package/vendor/7zip/CPP/7zip/UI/Client7z/StdAfx.h +11 -0
- package/vendor/7zip/CPP/7zip/UI/Client7z/makefile +29 -0
- package/vendor/7zip/CPP/7zip/UI/Client7z/makefile.gcc +72 -0
- package/vendor/7zip/CPP/7zip/UI/Client7z/resource.rc +3 -0
- package/vendor/7zip/CPP/7zip/UI/Common/ArchiveCommandLine.cpp +1913 -0
- package/vendor/7zip/CPP/7zip/UI/Common/ArchiveCommandLine.h +170 -0
- package/vendor/7zip/CPP/7zip/UI/Common/ArchiveExtractCallback.cpp +3243 -0
- package/vendor/7zip/CPP/7zip/UI/Common/ArchiveExtractCallback.h +640 -0
- package/vendor/7zip/CPP/7zip/UI/Common/ArchiveName.cpp +176 -0
- package/vendor/7zip/CPP/7zip/UI/Common/ArchiveName.h +16 -0
- package/vendor/7zip/CPP/7zip/UI/Common/ArchiveOpenCallback.cpp +403 -0
- package/vendor/7zip/CPP/7zip/UI/Common/ArchiveOpenCallback.h +182 -0
- package/vendor/7zip/CPP/7zip/UI/Common/Bench.cpp +5036 -0
- package/vendor/7zip/CPP/7zip/UI/Common/Bench.h +121 -0
- package/vendor/7zip/CPP/7zip/UI/Common/CompressCall.cpp +343 -0
- package/vendor/7zip/CPP/7zip/UI/Common/CompressCall.h +28 -0
- package/vendor/7zip/CPP/7zip/UI/Common/CompressCall2.cpp +327 -0
- package/vendor/7zip/CPP/7zip/UI/Common/DefaultName.cpp +37 -0
- package/vendor/7zip/CPP/7zip/UI/Common/DefaultName.h +11 -0
- package/vendor/7zip/CPP/7zip/UI/Common/DirItem.h +407 -0
- package/vendor/7zip/CPP/7zip/UI/Common/EnumDirItems.cpp +1637 -0
- package/vendor/7zip/CPP/7zip/UI/Common/EnumDirItems.h +38 -0
- package/vendor/7zip/CPP/7zip/UI/Common/ExitCode.h +27 -0
- package/vendor/7zip/CPP/7zip/UI/Common/Extract.cpp +593 -0
- package/vendor/7zip/CPP/7zip/UI/Common/Extract.h +118 -0
- package/vendor/7zip/CPP/7zip/UI/Common/ExtractMode.h +44 -0
- package/vendor/7zip/CPP/7zip/UI/Common/ExtractingFilePath.cpp +299 -0
- package/vendor/7zip/CPP/7zip/UI/Common/ExtractingFilePath.h +31 -0
- package/vendor/7zip/CPP/7zip/UI/Common/HashCalc.cpp +2273 -0
- package/vendor/7zip/CPP/7zip/UI/Common/HashCalc.h +322 -0
- package/vendor/7zip/CPP/7zip/UI/Common/IFileExtractCallback.h +112 -0
- package/vendor/7zip/CPP/7zip/UI/Common/LoadCodecs.cpp +1354 -0
- package/vendor/7zip/CPP/7zip/UI/Common/LoadCodecs.h +482 -0
- package/vendor/7zip/CPP/7zip/UI/Common/OpenArchive.cpp +3690 -0
- package/vendor/7zip/CPP/7zip/UI/Common/OpenArchive.h +469 -0
- package/vendor/7zip/CPP/7zip/UI/Common/PropIDUtils.cpp +746 -0
- package/vendor/7zip/CPP/7zip/UI/Common/PropIDUtils.h +18 -0
- package/vendor/7zip/CPP/7zip/UI/Common/Property.h +14 -0
- package/vendor/7zip/CPP/7zip/UI/Common/SetProperties.cpp +88 -0
- package/vendor/7zip/CPP/7zip/UI/Common/SetProperties.h +10 -0
- package/vendor/7zip/CPP/7zip/UI/Common/SortUtils.cpp +25 -0
- package/vendor/7zip/CPP/7zip/UI/Common/SortUtils.h +10 -0
- package/vendor/7zip/CPP/7zip/UI/Common/StdAfx.h +11 -0
- package/vendor/7zip/CPP/7zip/UI/Common/TempFiles.cpp +20 -0
- package/vendor/7zip/CPP/7zip/UI/Common/TempFiles.h +19 -0
- package/vendor/7zip/CPP/7zip/UI/Common/Update.cpp +1931 -0
- package/vendor/7zip/CPP/7zip/UI/Common/Update.h +221 -0
- package/vendor/7zip/CPP/7zip/UI/Common/UpdateAction.cpp +64 -0
- package/vendor/7zip/CPP/7zip/UI/Common/UpdateAction.h +66 -0
- package/vendor/7zip/CPP/7zip/UI/Common/UpdateCallback.cpp +1078 -0
- package/vendor/7zip/CPP/7zip/UI/Common/UpdateCallback.h +197 -0
- package/vendor/7zip/CPP/7zip/UI/Common/UpdatePair.cpp +303 -0
- package/vendor/7zip/CPP/7zip/UI/Common/UpdatePair.h +27 -0
- package/vendor/7zip/CPP/7zip/UI/Common/UpdateProduce.cpp +75 -0
- package/vendor/7zip/CPP/7zip/UI/Common/UpdateProduce.h +60 -0
- package/vendor/7zip/CPP/7zip/UI/Common/WorkDir.cpp +84 -0
- package/vendor/7zip/CPP/7zip/UI/Common/WorkDir.h +30 -0
- package/vendor/7zip/CPP/7zip/UI/Common/ZipRegistry.cpp +599 -0
- package/vendor/7zip/CPP/7zip/UI/Common/ZipRegistry.h +212 -0
- package/vendor/7zip/CPP/7zip/UI/Console/BenchCon.cpp +41 -0
- package/vendor/7zip/CPP/7zip/UI/Console/BenchCon.h +14 -0
- package/vendor/7zip/CPP/7zip/UI/Console/Console.dsp +1052 -0
- package/vendor/7zip/CPP/7zip/UI/Console/Console.dsw +29 -0
- package/vendor/7zip/CPP/7zip/UI/Console/Console.mak +45 -0
- package/vendor/7zip/CPP/7zip/UI/Console/Console.manifest +16 -0
- package/vendor/7zip/CPP/7zip/UI/Console/ConsoleClose.cpp +98 -0
- package/vendor/7zip/CPP/7zip/UI/Console/ConsoleClose.h +39 -0
- package/vendor/7zip/CPP/7zip/UI/Console/ExtractCallbackConsole.cpp +954 -0
- package/vendor/7zip/CPP/7zip/UI/Console/ExtractCallbackConsole.h +211 -0
- package/vendor/7zip/CPP/7zip/UI/Console/HashCon.cpp +426 -0
- package/vendor/7zip/CPP/7zip/UI/Console/HashCon.h +58 -0
- package/vendor/7zip/CPP/7zip/UI/Console/List.cpp +1417 -0
- package/vendor/7zip/CPP/7zip/UI/Console/List.h +42 -0
- package/vendor/7zip/CPP/7zip/UI/Console/Main.cpp +1663 -0
- package/vendor/7zip/CPP/7zip/UI/Console/MainAr.cpp +235 -0
- package/vendor/7zip/CPP/7zip/UI/Console/OpenCallbackConsole.cpp +115 -0
- package/vendor/7zip/CPP/7zip/UI/Console/OpenCallbackConsole.h +73 -0
- package/vendor/7zip/CPP/7zip/UI/Console/PercentPrinter.cpp +186 -0
- package/vendor/7zip/CPP/7zip/UI/Console/PercentPrinter.h +66 -0
- package/vendor/7zip/CPP/7zip/UI/Console/StdAfx.cpp +3 -0
- package/vendor/7zip/CPP/7zip/UI/Console/StdAfx.h +11 -0
- package/vendor/7zip/CPP/7zip/UI/Console/UpdateCallbackConsole.cpp +1012 -0
- package/vendor/7zip/CPP/7zip/UI/Console/UpdateCallbackConsole.h +148 -0
- package/vendor/7zip/CPP/7zip/UI/Console/UserInputUtils.cpp +118 -0
- package/vendor/7zip/CPP/7zip/UI/Console/UserInputUtils.h +27 -0
- package/vendor/7zip/CPP/7zip/UI/Console/makefile +68 -0
- package/vendor/7zip/CPP/7zip/UI/Console/makefile.gcc +184 -0
- package/vendor/7zip/CPP/7zip/UI/Console/resource.rc +7 -0
- package/vendor/7zip/CPP/7zip/UI/Explorer/7-zip.dll.manifest +1 -0
- package/vendor/7zip/CPP/7zip/UI/Explorer/ContextMenu.cpp +1837 -0
- package/vendor/7zip/CPP/7zip/UI/Explorer/ContextMenu.h +173 -0
- package/vendor/7zip/CPP/7zip/UI/Explorer/ContextMenuFlags.h +27 -0
- package/vendor/7zip/CPP/7zip/UI/Explorer/DllExportsExplorer.cpp +268 -0
- package/vendor/7zip/CPP/7zip/UI/Explorer/Explorer.def +9 -0
- package/vendor/7zip/CPP/7zip/UI/Explorer/Explorer.dsp +620 -0
- package/vendor/7zip/CPP/7zip/UI/Explorer/Explorer.dsw +29 -0
- package/vendor/7zip/CPP/7zip/UI/Explorer/MenuLogo.bmp +0 -0
- package/vendor/7zip/CPP/7zip/UI/Explorer/MyExplorerCommand.h +217 -0
- package/vendor/7zip/CPP/7zip/UI/Explorer/MyMessages.cpp +43 -0
- package/vendor/7zip/CPP/7zip/UI/Explorer/MyMessages.h +16 -0
- package/vendor/7zip/CPP/7zip/UI/Explorer/RegistryContextMenu.cpp +225 -0
- package/vendor/7zip/CPP/7zip/UI/Explorer/RegistryContextMenu.h +13 -0
- package/vendor/7zip/CPP/7zip/UI/Explorer/StdAfx.cpp +3 -0
- package/vendor/7zip/CPP/7zip/UI/Explorer/StdAfx.h +6 -0
- package/vendor/7zip/CPP/7zip/UI/Explorer/makefile +76 -0
- package/vendor/7zip/CPP/7zip/UI/Explorer/resource.h +15 -0
- package/vendor/7zip/CPP/7zip/UI/Explorer/resource.rc +10 -0
- package/vendor/7zip/CPP/7zip/UI/Explorer/resource2.rc +19 -0
- package/vendor/7zip/CPP/7zip/UI/Far/ExtractEngine.cpp +274 -0
- package/vendor/7zip/CPP/7zip/UI/Far/ExtractEngine.h +43 -0
- package/vendor/7zip/CPP/7zip/UI/Far/Far.cpp +588 -0
- package/vendor/7zip/CPP/7zip/UI/Far/Far.def +35 -0
- package/vendor/7zip/CPP/7zip/UI/Far/Far.dsp +831 -0
- package/vendor/7zip/CPP/7zip/UI/Far/Far.dsw +29 -0
- package/vendor/7zip/CPP/7zip/UI/Far/FarPlugin.h +560 -0
- package/vendor/7zip/CPP/7zip/UI/Far/FarUtils.cpp +523 -0
- package/vendor/7zip/CPP/7zip/UI/Far/FarUtils.h +203 -0
- package/vendor/7zip/CPP/7zip/UI/Far/Messages.h +136 -0
- package/vendor/7zip/CPP/7zip/UI/Far/OverwriteDialogFar.cpp +145 -0
- package/vendor/7zip/CPP/7zip/UI/Far/OverwriteDialogFar.h +37 -0
- package/vendor/7zip/CPP/7zip/UI/Far/Plugin.cpp +937 -0
- package/vendor/7zip/CPP/7zip/UI/Far/Plugin.h +97 -0
- package/vendor/7zip/CPP/7zip/UI/Far/PluginCommon.cpp +50 -0
- package/vendor/7zip/CPP/7zip/UI/Far/PluginDelete.cpp +144 -0
- package/vendor/7zip/CPP/7zip/UI/Far/PluginRead.cpp +301 -0
- package/vendor/7zip/CPP/7zip/UI/Far/PluginWrite.cpp +840 -0
- package/vendor/7zip/CPP/7zip/UI/Far/ProgressBox.cpp +305 -0
- package/vendor/7zip/CPP/7zip/UI/Far/ProgressBox.h +85 -0
- package/vendor/7zip/CPP/7zip/UI/Far/StdAfx.cpp +3 -0
- package/vendor/7zip/CPP/7zip/UI/Far/StdAfx.h +11 -0
- package/vendor/7zip/CPP/7zip/UI/Far/UpdateCallbackFar.cpp +327 -0
- package/vendor/7zip/CPP/7zip/UI/Far/UpdateCallbackFar.h +58 -0
- package/vendor/7zip/CPP/7zip/UI/Far/makefile +105 -0
- package/vendor/7zip/CPP/7zip/UI/Far/resource.rc +3 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/7zFM.exe.manifest +23 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/7zipLogo.ico +0 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/AboutDialog.cpp +81 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/AboutDialog.h +19 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/AboutDialog.rc +26 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/AboutDialogRes.h +8 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/Add.bmp +0 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/Add2.bmp +0 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/AltStreamsFolder.cpp +865 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/AltStreamsFolder.h +92 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/App.cpp +1004 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/App.h +314 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/AppState.h +95 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/BrowseDialog.cpp +1132 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/BrowseDialog.h +32 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/BrowseDialog.rc +25 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/BrowseDialog2.cpp +1873 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/BrowseDialog2.h +10 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/BrowseDialog2.rc +32 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/BrowseDialog2Res.h +9 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/BrowseDialogRes.h +9 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/ClassDefs.cpp +12 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/ComboDialog.cpp +64 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/ComboDialog.h +28 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/ComboDialog.rc +16 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/ComboDialogRes.h +4 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/Copy.bmp +0 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/Copy2.bmp +0 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/CopyDialog.cpp +103 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/CopyDialog.h +31 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/CopyDialog.rc +20 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/CopyDialogRes.h +8 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/Delete.bmp +0 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/Delete2.bmp +0 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/DialogSize.h +16 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/EditDialog.cpp +57 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/EditDialog.h +25 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/EditDialog.rc +15 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/EditDialogRes.h +2 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/EditPage.cpp +159 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/EditPage.h +30 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/EditPage.rc +19 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/EditPage2.rc +14 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/EditPageRes.h +15 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/EnumFormatEtc.cpp +109 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/EnumFormatEtc.h +10 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/Extract.bmp +0 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/Extract2.bmp +0 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/ExtractCallback.cpp +1284 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/ExtractCallback.h +347 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/FM.cpp +1230 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/FM.dsp +1699 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/FM.dsw +29 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/FM.ico +0 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/FM.mak +102 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/FSDrives.cpp +512 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/FSDrives.h +52 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/FSFolder.cpp +1179 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/FSFolder.h +220 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/FSFolderCopy.cpp +871 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/FileFolderPluginOpen.cpp +394 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/FileFolderPluginOpen.h +27 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/FilePlugins.cpp +78 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/FilePlugins.h +33 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/FoldersPage.cpp +172 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/FoldersPage.h +32 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/FoldersPage.rc +23 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/FoldersPage2.rc +11 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/FoldersPageRes.h +12 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/FormatUtils.cpp +28 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/FormatUtils.h +14 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/HelpUtils.cpp +78 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/HelpUtils.h +10 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/IFolder.h +187 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/Info.bmp +0 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/Info2.bmp +0 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/LangPage.cpp +359 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/LangPage.h +36 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/LangPage.rc +40 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/LangPageRes.h +9 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/LangUtils.cpp +333 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/LangUtils.h +48 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/LinkDialog.cpp +402 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/LinkDialog.h +34 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/LinkDialog.rc +38 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/LinkDialogRes.h +22 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/ListViewDialog.cpp +321 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/ListViewDialog.h +46 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/ListViewDialog.rc +14 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/ListViewDialogRes.h +2 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/MemDialog.cpp +218 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/MemDialog.h +48 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/MemDialog.rc +49 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/MemDialogRes.h +13 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/MenuPage.cpp +439 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/MenuPage.h +57 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/MenuPage.rc +24 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/MenuPage2.rc +28 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/MenuPageRes.h +15 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/MessagesDialog.cpp +76 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/MessagesDialog.h +25 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/MessagesDialog.rc +14 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/MessagesDialogRes.h +3 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/Move.bmp +0 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/Move2.bmp +0 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/MyCom2.h +46 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/MyLoadMenu.cpp +964 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/MyLoadMenu.h +40 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/MyWindowsNew.h +119 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/NetFolder.cpp +276 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/NetFolder.h +36 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/OpenCallback.cpp +86 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/OpenCallback.h +69 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/OptionsDialog.cpp +89 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/OverwriteDialog.cpp +288 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/OverwriteDialog.h +89 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/OverwriteDialog.rc +93 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/OverwriteDialogRes.h +19 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/Panel.cpp +1177 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/Panel.h +1020 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/PanelCopy.cpp +477 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/PanelCrc.cpp +422 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/PanelDrag.cpp +3006 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/PanelFolderChange.cpp +1122 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/PanelItemOpen.cpp +1836 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/PanelItems.cpp +1476 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/PanelKey.cpp +357 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/PanelListNotify.cpp +838 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/PanelMenu.cpp +1160 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/PanelOperations.cpp +533 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/PanelSelect.cpp +317 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/PanelSort.cpp +288 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/PanelSplitFile.cpp +562 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/PasswordDialog.cpp +58 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/PasswordDialog.h +28 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/PasswordDialog.rc +18 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/PasswordDialogRes.h +5 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/PluginInterface.h +32 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/PluginLoader.h +33 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/ProgramLocation.cpp +3 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/ProgramLocation.h +6 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/ProgressDialog.cpp +201 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/ProgressDialog.h +171 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/ProgressDialog.rc +12 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/ProgressDialog2.cpp +1484 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/ProgressDialog2.h +355 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/ProgressDialog2.rc +40 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/ProgressDialog2Res.h +49 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/ProgressDialog2a.rc +85 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/ProgressDialogRes.h +3 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/PropertyName.cpp +23 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/PropertyName.h +10 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/PropertyName.rc +109 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/PropertyNameRes.h +104 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/RegistryAssociations.cpp +167 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/RegistryAssociations.h +31 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/RegistryPlugins.cpp +145 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/RegistryPlugins.h +29 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/RegistryUtils.cpp +194 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/RegistryUtils.h +50 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/RootFolder.cpp +342 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/RootFolder.h +24 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/SettingsPage.cpp +453 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/SettingsPage.h +37 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/SettingsPage.rc +22 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/SettingsPage2.rc +37 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/SettingsPageRes.h +23 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/SplitDialog.cpp +114 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/SplitDialog.h +28 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/SplitDialog.rc +16 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/SplitDialogRes.h +8 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/SplitUtils.cpp +96 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/SplitUtils.h +15 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/StdAfx.cpp +3 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/StdAfx.h +67 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/StringUtils.cpp +39 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/StringUtils.h +11 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/SysIconUtils.cpp +352 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/SysIconUtils.h +65 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/SystemPage.cpp +472 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/SystemPage.h +126 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/SystemPage.rc +43 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/SystemPageRes.h +9 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/Test.bmp +0 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/Test2.bmp +0 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/TextPairs.cpp +193 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/TextPairs.h +32 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/UpdateCallback100.cpp +147 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/UpdateCallback100.h +49 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/VerCtrl.cpp +428 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/ViewSettings.cpp +315 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/ViewSettings.h +115 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/makefile +110 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/resource.h +199 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/resource.rc +296 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/resourceGui.h +25 -0
- package/vendor/7zip/CPP/7zip/UI/FileManager/resourceGui.rc +30 -0
- package/vendor/7zip/CPP/7zip/UI/GUI/7zG.exe.manifest +23 -0
- package/vendor/7zip/CPP/7zip/UI/GUI/BenchmarkDialog.cpp +1921 -0
- package/vendor/7zip/CPP/7zip/UI/GUI/BenchmarkDialog.h +15 -0
- package/vendor/7zip/CPP/7zip/UI/GUI/BenchmarkDialog.rc +288 -0
- package/vendor/7zip/CPP/7zip/UI/GUI/BenchmarkDialogRes.h +79 -0
- package/vendor/7zip/CPP/7zip/UI/GUI/CompressDialog.cpp +3821 -0
- package/vendor/7zip/CPP/7zip/UI/GUI/CompressDialog.h +483 -0
- package/vendor/7zip/CPP/7zip/UI/GUI/CompressDialog.rc +233 -0
- package/vendor/7zip/CPP/7zip/UI/GUI/CompressDialogRes.h +125 -0
- package/vendor/7zip/CPP/7zip/UI/GUI/CompressOptionsDialog.rc +79 -0
- package/vendor/7zip/CPP/7zip/UI/GUI/Extract.rc +59 -0
- package/vendor/7zip/CPP/7zip/UI/GUI/ExtractDialog.cpp +420 -0
- package/vendor/7zip/CPP/7zip/UI/GUI/ExtractDialog.h +113 -0
- package/vendor/7zip/CPP/7zip/UI/GUI/ExtractDialog.rc +98 -0
- package/vendor/7zip/CPP/7zip/UI/GUI/ExtractDialogRes.h +24 -0
- package/vendor/7zip/CPP/7zip/UI/GUI/ExtractGUI.cpp +297 -0
- package/vendor/7zip/CPP/7zip/UI/GUI/ExtractGUI.h +39 -0
- package/vendor/7zip/CPP/7zip/UI/GUI/ExtractRes.h +51 -0
- package/vendor/7zip/CPP/7zip/UI/GUI/FM.ico +0 -0
- package/vendor/7zip/CPP/7zip/UI/GUI/GUI.cpp +502 -0
- package/vendor/7zip/CPP/7zip/UI/GUI/GUI.dsp +1275 -0
- package/vendor/7zip/CPP/7zip/UI/GUI/GUI.dsw +29 -0
- package/vendor/7zip/CPP/7zip/UI/GUI/HashGUI.cpp +341 -0
- package/vendor/7zip/CPP/7zip/UI/GUI/HashGUI.h +27 -0
- package/vendor/7zip/CPP/7zip/UI/GUI/StdAfx.cpp +3 -0
- package/vendor/7zip/CPP/7zip/UI/GUI/StdAfx.h +6 -0
- package/vendor/7zip/CPP/7zip/UI/GUI/UpdateCallbackGUI.cpp +295 -0
- package/vendor/7zip/CPP/7zip/UI/GUI/UpdateCallbackGUI.h +31 -0
- package/vendor/7zip/CPP/7zip/UI/GUI/UpdateCallbackGUI2.cpp +130 -0
- package/vendor/7zip/CPP/7zip/UI/GUI/UpdateCallbackGUI2.h +53 -0
- package/vendor/7zip/CPP/7zip/UI/GUI/UpdateGUI.cpp +605 -0
- package/vendor/7zip/CPP/7zip/UI/GUI/UpdateGUI.h +33 -0
- package/vendor/7zip/CPP/7zip/UI/GUI/makefile +148 -0
- package/vendor/7zip/CPP/7zip/UI/GUI/resource.rc +26 -0
- package/vendor/7zip/CPP/7zip/UI/GUI/resource2.h +2 -0
- package/vendor/7zip/CPP/7zip/UI/GUI/resource2.rc +10 -0
- package/vendor/7zip/CPP/7zip/UI/GUI/resource3.h +10 -0
- package/vendor/7zip/CPP/7zip/UI/GUI/resource3.rc +15 -0
- package/vendor/7zip/CPP/7zip/UI/makefile +12 -0
- package/vendor/7zip/CPP/7zip/cmpl_clang.mak +3 -0
- package/vendor/7zip/CPP/7zip/cmpl_clang_arm64.mak +3 -0
- package/vendor/7zip/CPP/7zip/cmpl_clang_x64.mak +3 -0
- package/vendor/7zip/CPP/7zip/cmpl_clang_x86.mak +3 -0
- package/vendor/7zip/CPP/7zip/cmpl_gcc.mak +3 -0
- package/vendor/7zip/CPP/7zip/cmpl_gcc_arm.mak +3 -0
- package/vendor/7zip/CPP/7zip/cmpl_gcc_arm64.mak +3 -0
- package/vendor/7zip/CPP/7zip/cmpl_gcc_x64.mak +3 -0
- package/vendor/7zip/CPP/7zip/cmpl_gcc_x86.mak +3 -0
- package/vendor/7zip/CPP/7zip/cmpl_mac_arm64.mak +3 -0
- package/vendor/7zip/CPP/7zip/cmpl_mac_x64.mak +3 -0
- package/vendor/7zip/CPP/7zip/makefile +10 -0
- package/vendor/7zip/CPP/7zip/var_clang.mak +11 -0
- package/vendor/7zip/CPP/7zip/var_clang_arm64.mak +19 -0
- package/vendor/7zip/CPP/7zip/var_clang_x64.mak +11 -0
- package/vendor/7zip/CPP/7zip/var_clang_x86.mak +11 -0
- package/vendor/7zip/CPP/7zip/var_gcc.mak +12 -0
- package/vendor/7zip/CPP/7zip/var_gcc_arm.mak +34 -0
- package/vendor/7zip/CPP/7zip/var_gcc_arm64.mak +12 -0
- package/vendor/7zip/CPP/7zip/var_gcc_x64.mak +11 -0
- package/vendor/7zip/CPP/7zip/var_gcc_x86.mak +10 -0
- package/vendor/7zip/CPP/7zip/var_mac_arm64.mak +13 -0
- package/vendor/7zip/CPP/7zip/var_mac_x64.mak +13 -0
- package/vendor/7zip/CPP/7zip/warn_clang.mak +3 -0
- package/vendor/7zip/CPP/7zip/warn_clang_mac.mak +9 -0
- package/vendor/7zip/CPP/7zip/warn_gcc.mak +55 -0
- package/vendor/7zip/CPP/Build.mak +259 -0
- package/vendor/7zip/CPP/Common/AutoPtr.h +46 -0
- package/vendor/7zip/CPP/Common/CRC.cpp +7 -0
- package/vendor/7zip/CPP/Common/C_FileIO.cpp +3 -0
- package/vendor/7zip/CPP/Common/C_FileIO.h +6 -0
- package/vendor/7zip/CPP/Common/CksumReg.cpp +55 -0
- package/vendor/7zip/CPP/Common/ComTry.h +21 -0
- package/vendor/7zip/CPP/Common/CommandLineParser.cpp +231 -0
- package/vendor/7zip/CPP/Common/CommandLineParser.h +63 -0
- package/vendor/7zip/CPP/Common/Common.h +28 -0
- package/vendor/7zip/CPP/Common/Common0.h +342 -0
- package/vendor/7zip/CPP/Common/CrcReg.cpp +77 -0
- package/vendor/7zip/CPP/Common/Defs.h +16 -0
- package/vendor/7zip/CPP/Common/DynLimBuf.cpp +93 -0
- package/vendor/7zip/CPP/Common/DynLimBuf.h +41 -0
- package/vendor/7zip/CPP/Common/DynamicBuffer.h +76 -0
- package/vendor/7zip/CPP/Common/IntToString.cpp +215 -0
- package/vendor/7zip/CPP/Common/IntToString.h +54 -0
- package/vendor/7zip/CPP/Common/Lang.cpp +173 -0
- package/vendor/7zip/CPP/Common/Lang.h +30 -0
- package/vendor/7zip/CPP/Common/ListFileUtils.cpp +150 -0
- package/vendor/7zip/CPP/Common/ListFileUtils.h +18 -0
- package/vendor/7zip/CPP/Common/LzFindPrepare.cpp +7 -0
- package/vendor/7zip/CPP/Common/Md5Reg.cpp +44 -0
- package/vendor/7zip/CPP/Common/MyBuffer.h +343 -0
- package/vendor/7zip/CPP/Common/MyBuffer2.h +185 -0
- package/vendor/7zip/CPP/Common/MyCom.h +693 -0
- package/vendor/7zip/CPP/Common/MyException.h +14 -0
- package/vendor/7zip/CPP/Common/MyGuidDef.h +63 -0
- package/vendor/7zip/CPP/Common/MyInitGuid.h +57 -0
- package/vendor/7zip/CPP/Common/MyLinux.h +75 -0
- package/vendor/7zip/CPP/Common/MyMap.cpp +140 -0
- package/vendor/7zip/CPP/Common/MyMap.h +28 -0
- package/vendor/7zip/CPP/Common/MyString.cpp +1842 -0
- package/vendor/7zip/CPP/Common/MyString.h +1079 -0
- package/vendor/7zip/CPP/Common/MyTypes.h +38 -0
- package/vendor/7zip/CPP/Common/MyUnknown.h +8 -0
- package/vendor/7zip/CPP/Common/MyVector.cpp +3 -0
- package/vendor/7zip/CPP/Common/MyVector.h +772 -0
- package/vendor/7zip/CPP/Common/MyWindows.cpp +292 -0
- package/vendor/7zip/CPP/Common/MyWindows.h +325 -0
- package/vendor/7zip/CPP/Common/MyXml.cpp +349 -0
- package/vendor/7zip/CPP/Common/MyXml.h +45 -0
- package/vendor/7zip/CPP/Common/NewHandler.cpp +340 -0
- package/vendor/7zip/CPP/Common/NewHandler.h +121 -0
- package/vendor/7zip/CPP/Common/Random.cpp +28 -0
- package/vendor/7zip/CPP/Common/Random.h +14 -0
- package/vendor/7zip/CPP/Common/Sha1Prepare.cpp +7 -0
- package/vendor/7zip/CPP/Common/Sha1Reg.cpp +67 -0
- package/vendor/7zip/CPP/Common/Sha256Prepare.cpp +7 -0
- package/vendor/7zip/CPP/Common/Sha256Reg.cpp +67 -0
- package/vendor/7zip/CPP/Common/Sha3Reg.cpp +76 -0
- package/vendor/7zip/CPP/Common/Sha512Prepare.cpp +7 -0
- package/vendor/7zip/CPP/Common/Sha512Reg.cpp +83 -0
- package/vendor/7zip/CPP/Common/StdAfx.h +8 -0
- package/vendor/7zip/CPP/Common/StdInStream.cpp +98 -0
- package/vendor/7zip/CPP/Common/StdInStream.h +46 -0
- package/vendor/7zip/CPP/Common/StdOutStream.cpp +271 -0
- package/vendor/7zip/CPP/Common/StdOutStream.h +87 -0
- package/vendor/7zip/CPP/Common/StringConvert.cpp +762 -0
- package/vendor/7zip/CPP/Common/StringConvert.h +110 -0
- package/vendor/7zip/CPP/Common/StringToInt.cpp +154 -0
- package/vendor/7zip/CPP/Common/StringToInt.h +38 -0
- package/vendor/7zip/CPP/Common/TextConfig.cpp +123 -0
- package/vendor/7zip/CPP/Common/TextConfig.h +19 -0
- package/vendor/7zip/CPP/Common/UTFConvert.cpp +863 -0
- package/vendor/7zip/CPP/Common/UTFConvert.h +384 -0
- package/vendor/7zip/CPP/Common/Wildcard.cpp +789 -0
- package/vendor/7zip/CPP/Common/Wildcard.h +231 -0
- package/vendor/7zip/CPP/Common/Xxh64Reg.cpp +97 -0
- package/vendor/7zip/CPP/Common/XzCrc64Init.cpp +7 -0
- package/vendor/7zip/CPP/Common/XzCrc64Reg.cpp +39 -0
- package/vendor/7zip/CPP/Windows/COM.cpp +41 -0
- package/vendor/7zip/CPP/Windows/COM.h +86 -0
- package/vendor/7zip/CPP/Windows/Clipboard.cpp +130 -0
- package/vendor/7zip/CPP/Windows/Clipboard.h +28 -0
- package/vendor/7zip/CPP/Windows/CommonDialog.cpp +269 -0
- package/vendor/7zip/CPP/Windows/CommonDialog.h +43 -0
- package/vendor/7zip/CPP/Windows/Console.cpp +10 -0
- package/vendor/7zip/CPP/Windows/Console.h +52 -0
- package/vendor/7zip/CPP/Windows/Control/ComboBox.cpp +75 -0
- package/vendor/7zip/CPP/Windows/Control/ComboBox.h +79 -0
- package/vendor/7zip/CPP/Windows/Control/CommandBar.h +52 -0
- package/vendor/7zip/CPP/Windows/Control/Dialog.cpp +446 -0
- package/vendor/7zip/CPP/Windows/Control/Dialog.h +213 -0
- package/vendor/7zip/CPP/Windows/Control/Edit.h +19 -0
- package/vendor/7zip/CPP/Windows/Control/ImageList.cpp +10 -0
- package/vendor/7zip/CPP/Windows/Control/ImageList.h +87 -0
- package/vendor/7zip/CPP/Windows/Control/ListView.cpp +162 -0
- package/vendor/7zip/CPP/Windows/Control/ListView.h +156 -0
- package/vendor/7zip/CPP/Windows/Control/ProgressBar.h +35 -0
- package/vendor/7zip/CPP/Windows/Control/PropertyPage.cpp +165 -0
- package/vendor/7zip/CPP/Windows/Control/PropertyPage.h +50 -0
- package/vendor/7zip/CPP/Windows/Control/ReBar.h +34 -0
- package/vendor/7zip/CPP/Windows/Control/Static.h +28 -0
- package/vendor/7zip/CPP/Windows/Control/StatusBar.h +42 -0
- package/vendor/7zip/CPP/Windows/Control/StdAfx.h +11 -0
- package/vendor/7zip/CPP/Windows/Control/ToolBar.h +43 -0
- package/vendor/7zip/CPP/Windows/Control/Trackbar.h +27 -0
- package/vendor/7zip/CPP/Windows/Control/Window2.cpp +202 -0
- package/vendor/7zip/CPP/Windows/Control/Window2.h +53 -0
- package/vendor/7zip/CPP/Windows/DLL.cpp +178 -0
- package/vendor/7zip/CPP/Windows/DLL.h +103 -0
- package/vendor/7zip/CPP/Windows/ErrorMsg.cpp +133 -0
- package/vendor/7zip/CPP/Windows/ErrorMsg.h +16 -0
- package/vendor/7zip/CPP/Windows/FileDir.cpp +1388 -0
- package/vendor/7zip/CPP/Windows/FileDir.h +173 -0
- package/vendor/7zip/CPP/Windows/FileFind.cpp +1458 -0
- package/vendor/7zip/CPP/Windows/FileFind.h +345 -0
- package/vendor/7zip/CPP/Windows/FileIO.cpp +1188 -0
- package/vendor/7zip/CPP/Windows/FileIO.h +508 -0
- package/vendor/7zip/CPP/Windows/FileLink.cpp +697 -0
- package/vendor/7zip/CPP/Windows/FileMapping.cpp +12 -0
- package/vendor/7zip/CPP/Windows/FileMapping.h +66 -0
- package/vendor/7zip/CPP/Windows/FileName.cpp +911 -0
- package/vendor/7zip/CPP/Windows/FileName.h +142 -0
- package/vendor/7zip/CPP/Windows/FileSystem.cpp +187 -0
- package/vendor/7zip/CPP/Windows/FileSystem.h +31 -0
- package/vendor/7zip/CPP/Windows/Handle.h +39 -0
- package/vendor/7zip/CPP/Windows/MemoryGlobal.cpp +36 -0
- package/vendor/7zip/CPP/Windows/MemoryGlobal.h +55 -0
- package/vendor/7zip/CPP/Windows/MemoryLock.cpp +127 -0
- package/vendor/7zip/CPP/Windows/MemoryLock.h +40 -0
- package/vendor/7zip/CPP/Windows/Menu.cpp +265 -0
- package/vendor/7zip/CPP/Windows/Menu.h +170 -0
- package/vendor/7zip/CPP/Windows/NationalTime.cpp +37 -0
- package/vendor/7zip/CPP/Windows/NationalTime.h +20 -0
- package/vendor/7zip/CPP/Windows/Net.cpp +398 -0
- package/vendor/7zip/CPP/Windows/Net.h +87 -0
- package/vendor/7zip/CPP/Windows/NtCheck.h +58 -0
- package/vendor/7zip/CPP/Windows/ProcessMessages.cpp +22 -0
- package/vendor/7zip/CPP/Windows/ProcessMessages.h +12 -0
- package/vendor/7zip/CPP/Windows/ProcessUtils.cpp +102 -0
- package/vendor/7zip/CPP/Windows/ProcessUtils.h +138 -0
- package/vendor/7zip/CPP/Windows/PropVariant.cpp +393 -0
- package/vendor/7zip/CPP/Windows/PropVariant.h +173 -0
- package/vendor/7zip/CPP/Windows/PropVariantConv.cpp +274 -0
- package/vendor/7zip/CPP/Windows/PropVariantConv.h +47 -0
- package/vendor/7zip/CPP/Windows/PropVariantUtils.cpp +161 -0
- package/vendor/7zip/CPP/Windows/PropVariantUtils.h +34 -0
- package/vendor/7zip/CPP/Windows/Registry.cpp +474 -0
- package/vendor/7zip/CPP/Windows/Registry.h +96 -0
- package/vendor/7zip/CPP/Windows/ResourceString.cpp +103 -0
- package/vendor/7zip/CPP/Windows/ResourceString.h +17 -0
- package/vendor/7zip/CPP/Windows/SecurityUtils.cpp +186 -0
- package/vendor/7zip/CPP/Windows/SecurityUtils.h +154 -0
- package/vendor/7zip/CPP/Windows/Shell.cpp +839 -0
- package/vendor/7zip/CPP/Windows/Shell.h +129 -0
- package/vendor/7zip/CPP/Windows/StdAfx.h +11 -0
- package/vendor/7zip/CPP/Windows/Synchronization.cpp +87 -0
- package/vendor/7zip/CPP/Windows/Synchronization.h +386 -0
- package/vendor/7zip/CPP/Windows/System.cpp +423 -0
- package/vendor/7zip/CPP/Windows/System.h +209 -0
- package/vendor/7zip/CPP/Windows/SystemInfo.cpp +1312 -0
- package/vendor/7zip/CPP/Windows/SystemInfo.h +19 -0
- package/vendor/7zip/CPP/Windows/Thread.h +46 -0
- package/vendor/7zip/CPP/Windows/TimeUtils.cpp +467 -0
- package/vendor/7zip/CPP/Windows/TimeUtils.h +154 -0
- package/vendor/7zip/CPP/Windows/WinDefs.h +17 -0
- package/vendor/7zip/CPP/Windows/Window.cpp +179 -0
- package/vendor/7zip/CPP/Windows/Window.h +363 -0
- package/vendor/7zip/DOC/7zC.txt +187 -0
- package/vendor/7zip/DOC/7zFormat.txt +469 -0
- package/vendor/7zip/DOC/7zip.hhp +84 -0
- package/vendor/7zip/DOC/7zip.wxs +403 -0
- package/vendor/7zip/DOC/License.txt +151 -0
- package/vendor/7zip/DOC/Methods.txt +177 -0
- package/vendor/7zip/DOC/copying.txt +502 -0
- package/vendor/7zip/DOC/lzma.txt +345 -0
- package/vendor/7zip/DOC/readme.txt +299 -0
- package/vendor/7zip/DOC/src-history.txt +884 -0
- package/vendor/7zip/DOC/unRarLicense.txt +41 -0
- package/vendor/7zip/README.md +2 -0
|
@@ -0,0 +1,2944 @@
|
|
|
1
|
+
// NtfsHandler.cpp
|
|
2
|
+
|
|
3
|
+
#include "StdAfx.h"
|
|
4
|
+
|
|
5
|
+
// #define SHOW_DEBUG_INFO
|
|
6
|
+
// #define SHOW_DEBUG_INFO2
|
|
7
|
+
|
|
8
|
+
#if defined(SHOW_DEBUG_INFO) || defined(SHOW_DEBUG_INFO2)
|
|
9
|
+
#include <stdio.h>
|
|
10
|
+
#endif
|
|
11
|
+
|
|
12
|
+
#include "../../../C/CpuArch.h"
|
|
13
|
+
#include "../../../C/RotateDefs.h"
|
|
14
|
+
|
|
15
|
+
#include "../../Common/ComTry.h"
|
|
16
|
+
#include "../../Common/IntToString.h"
|
|
17
|
+
#include "../../Common/MyBuffer2.h"
|
|
18
|
+
#include "../../Common/MyCom.h"
|
|
19
|
+
|
|
20
|
+
#include "../../Windows/PropVariant.h"
|
|
21
|
+
#include "../../Windows/TimeUtils.h"
|
|
22
|
+
|
|
23
|
+
#include "../Common/MethodProps.h"
|
|
24
|
+
#include "../Common/ProgressUtils.h"
|
|
25
|
+
#include "../Common/RegisterArc.h"
|
|
26
|
+
#include "../Common/StreamObjects.h"
|
|
27
|
+
#include "../Common/StreamUtils.h"
|
|
28
|
+
|
|
29
|
+
#include "../Compress/CopyCoder.h"
|
|
30
|
+
|
|
31
|
+
#include "Common/DummyOutStream.h"
|
|
32
|
+
|
|
33
|
+
#ifdef SHOW_DEBUG_INFO
|
|
34
|
+
#define PRF(x) x
|
|
35
|
+
#else
|
|
36
|
+
#define PRF(x)
|
|
37
|
+
#endif
|
|
38
|
+
|
|
39
|
+
#ifdef SHOW_DEBUG_INFO2
|
|
40
|
+
#define PRF2(x) x
|
|
41
|
+
#else
|
|
42
|
+
#define PRF2(x)
|
|
43
|
+
#endif
|
|
44
|
+
|
|
45
|
+
#define PRF_UTF16(x) PRF(printf("%ls", x.GetRawPtr());)
|
|
46
|
+
#if defined(Z7_MSC_VER_ORIGINAL)
|
|
47
|
+
#define PRINT_UI64(s, val) PRF( printf(s " = %9I64x", (UInt64)(val));)
|
|
48
|
+
#define PRINT_UI64_2(s, val) PRF2(printf(s " = %9I64x", (UInt64)(val));)
|
|
49
|
+
#else
|
|
50
|
+
#define PRINT_UI64(s, val) PRF( printf(s " = %9llx", (unsigned long long)(val));)
|
|
51
|
+
#define PRINT_UI64_2(s, val) PRF2(printf(s " = %9llx", (unsigned long long)(val));)
|
|
52
|
+
#endif
|
|
53
|
+
|
|
54
|
+
// data pointers in all Parse() functions are aligned for 8-bytes (UInt64) accesses.
|
|
55
|
+
#if 1 // 0 for debug
|
|
56
|
+
#define Get16(p) GetUi16a(p)
|
|
57
|
+
#define Get32(p) GetUi32a(p)
|
|
58
|
+
#define Get64(p) GetUi64a(p)
|
|
59
|
+
#else
|
|
60
|
+
static UInt16 Get16(const void *p) { if ((ptrdiff_t)p & 1) throw 1; return GetUi16a(p); }
|
|
61
|
+
static UInt32 Get32(const void *p) { if ((ptrdiff_t)p & 3) throw 1; return GetUi32a(p); }
|
|
62
|
+
static UInt64 Get64(const void *p) { if ((ptrdiff_t)p & 7) throw 1; return GetUi64a(p); }
|
|
63
|
+
#endif
|
|
64
|
+
#define G16(p, dest) dest = Get16(p)
|
|
65
|
+
#define G32(p, dest) dest = Get32(p)
|
|
66
|
+
#define G64(p, dest) dest = Get64(p)
|
|
67
|
+
|
|
68
|
+
using namespace NWindows;
|
|
69
|
+
|
|
70
|
+
namespace NArchive {
|
|
71
|
+
namespace Ntfs {
|
|
72
|
+
|
|
73
|
+
static const wchar_t * const kVirtualFolder_System = L"[SYSTEM]";
|
|
74
|
+
static const wchar_t * const kVirtualFolder_Lost_Normal = L"[LOST]";
|
|
75
|
+
static const wchar_t * const kVirtualFolder_Lost_Deleted = L"[UNKNOWN]";
|
|
76
|
+
static const unsigned kNumSysRecs = 16;
|
|
77
|
+
|
|
78
|
+
static const unsigned kRecIndex_Volume = 3;
|
|
79
|
+
static const unsigned kRecIndex_RootDir = 5;
|
|
80
|
+
static const unsigned kRecIndex_BadClus = 8;
|
|
81
|
+
static const unsigned kRecIndex_Security = 9;
|
|
82
|
+
|
|
83
|
+
static const Byte k_Signature[] = { 'N', 'T', 'F', 'S', ' ', ' ', ' ', ' ', 0 };
|
|
84
|
+
|
|
85
|
+
struct CHeader
|
|
86
|
+
{
|
|
87
|
+
unsigned SectorSizeLog;
|
|
88
|
+
unsigned ClusterSizeLog;
|
|
89
|
+
unsigned MftRecordSizeLog;
|
|
90
|
+
// Byte MediaType;
|
|
91
|
+
// UInt32 NumHiddenSectors;
|
|
92
|
+
UInt64 NumSectors;
|
|
93
|
+
UInt64 NumClusters;
|
|
94
|
+
UInt64 MftCluster;
|
|
95
|
+
UInt64 SerialNumber;
|
|
96
|
+
// UInt16 SectorsPerTrack;
|
|
97
|
+
// UInt16 NumHeads;
|
|
98
|
+
|
|
99
|
+
UInt64 GetPhySize_Clusters() const { return NumClusters << ClusterSizeLog; }
|
|
100
|
+
UInt64 GetPhySize_Max() const { return (NumSectors + 1) << SectorSizeLog; }
|
|
101
|
+
UInt32 ClusterSize() const { return (UInt32)1 << ClusterSizeLog; }
|
|
102
|
+
bool Parse(const Byte *p);
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
static unsigned GetLog(const UInt32 num)
|
|
106
|
+
{
|
|
107
|
+
unsigned i;
|
|
108
|
+
for (i = 0; i < 31; i++)
|
|
109
|
+
if ((UInt32)1 << i == num)
|
|
110
|
+
break;
|
|
111
|
+
return i;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
// (p) is aligned for 8-bytes (UInt64) accesses
|
|
115
|
+
bool CHeader::Parse(const Byte * const p)
|
|
116
|
+
{
|
|
117
|
+
if (Get16(p + 0x1FE) != 0xAA55)
|
|
118
|
+
return false;
|
|
119
|
+
if (p[0] != 0xE9 && (p[0] != 0xEB || p[2] != 0x90))
|
|
120
|
+
return false;
|
|
121
|
+
if (memcmp(p + 3, k_Signature, sizeof(k_Signature)))
|
|
122
|
+
return false;
|
|
123
|
+
{
|
|
124
|
+
for (size_t i = 14; i < 21; i++)
|
|
125
|
+
if (p[i])
|
|
126
|
+
return false;
|
|
127
|
+
}
|
|
128
|
+
{
|
|
129
|
+
const unsigned t = GetLog(GetUi16(p + 11)); // unaligned
|
|
130
|
+
if (t < 9 || t > 12)
|
|
131
|
+
return false;
|
|
132
|
+
SectorSizeLog = (unsigned)t;
|
|
133
|
+
}
|
|
134
|
+
unsigned sectorsPerClusterLog;
|
|
135
|
+
{
|
|
136
|
+
const unsigned v = p[13];
|
|
137
|
+
if (v <= 0x80)
|
|
138
|
+
sectorsPerClusterLog = GetLog(v);
|
|
139
|
+
else
|
|
140
|
+
sectorsPerClusterLog = 0x100 - v;
|
|
141
|
+
ClusterSizeLog = SectorSizeLog + sectorsPerClusterLog;
|
|
142
|
+
if (ClusterSizeLog > 21)
|
|
143
|
+
return false;
|
|
144
|
+
}
|
|
145
|
+
if (p[21] != 0xF8) // MediaType == 0xF8 : a hard disk (Fixed_Disk), 0xF0 : high-density 3.5-inch floppy disk
|
|
146
|
+
return false;
|
|
147
|
+
if (*(const UInt16 *)(const void *)(p + 22)) // NumFatSectors : Get16()
|
|
148
|
+
return false;
|
|
149
|
+
// G16(p + 24, SectorsPerTrack); // 63 usually
|
|
150
|
+
// G16(p + 26, NumHeads); // 255
|
|
151
|
+
// G32(p + 28, NumHiddenSectors); // 63 (XP) / 2048 (Vista and win7) / (0 on media that are not partitioned ?)
|
|
152
|
+
if (*(const UInt32 *)(const void *)(p + 32)) // NumSectors32 : Get32()
|
|
153
|
+
return false;
|
|
154
|
+
// DriveNumber = p[0x24];
|
|
155
|
+
if (p[0x25]) // CurrentHead
|
|
156
|
+
return false;
|
|
157
|
+
/*
|
|
158
|
+
NTFS-HDD: p[0x26] = 0x80
|
|
159
|
+
NTFS-FLASH: p[0x26] = 0
|
|
160
|
+
*/
|
|
161
|
+
if (p[0x26] != 0x80 && p[0x26] != 0) // ExtendedBootSig
|
|
162
|
+
return false;
|
|
163
|
+
if (p[0x27]) // reserved
|
|
164
|
+
return false;
|
|
165
|
+
|
|
166
|
+
G64(p + 0x28, NumSectors);
|
|
167
|
+
if (NumSectors >= ((UInt64)1 << (62 - SectorSizeLog)))
|
|
168
|
+
return false;
|
|
169
|
+
NumClusters = NumSectors >> sectorsPerClusterLog;
|
|
170
|
+
G64(p + 0x30, MftCluster); // $MFT
|
|
171
|
+
if (MftCluster > NumClusters)
|
|
172
|
+
return false;
|
|
173
|
+
// G64(p + 0x38, Mft2Cluster);
|
|
174
|
+
G64(p + 0x48, SerialNumber); // $MFTMirr
|
|
175
|
+
/*
|
|
176
|
+
numClusters_per_MftRecord:
|
|
177
|
+
numClusters_per_IndexBlock:
|
|
178
|
+
only low byte from 4 bytes is used. Another 3 high bytes are zeros.
|
|
179
|
+
If the number is positive (number < 0x80),
|
|
180
|
+
then it represents the number of clusters.
|
|
181
|
+
If the number is negative (number >= 0x80),
|
|
182
|
+
then the size of the file record is 2 raised to the absolute value of this number.
|
|
183
|
+
example: (0xF6 == -10) means 2^10 = 1024 bytes.
|
|
184
|
+
*/
|
|
185
|
+
{
|
|
186
|
+
UInt32 numClusters_per_MftRecord;
|
|
187
|
+
G32(p + 0x40, numClusters_per_MftRecord);
|
|
188
|
+
if (numClusters_per_MftRecord <= 0x7f)
|
|
189
|
+
MftRecordSizeLog = GetLog(numClusters_per_MftRecord) + ClusterSizeLog;
|
|
190
|
+
else
|
|
191
|
+
MftRecordSizeLog = 0x100 - numClusters_per_MftRecord;
|
|
192
|
+
#define k_MftRecordSizeLog_MAX 12
|
|
193
|
+
if (MftRecordSizeLog < SectorSizeLog || MftRecordSizeLog > k_MftRecordSizeLog_MAX)
|
|
194
|
+
return false;
|
|
195
|
+
}
|
|
196
|
+
{
|
|
197
|
+
UInt32 numClusters_per_IndexBlock;
|
|
198
|
+
G32(p + 0x44, numClusters_per_IndexBlock);
|
|
199
|
+
return numClusters_per_IndexBlock < 0x100;
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
|
|
204
|
+
struct CMftRef
|
|
205
|
+
{
|
|
206
|
+
UInt64 Val;
|
|
207
|
+
|
|
208
|
+
UInt64 GetIndex() const { return Val & (((UInt64)1 << 48) - 1); }
|
|
209
|
+
UInt16 GetNumber() const { return (UInt16)(Val >> 48); }
|
|
210
|
+
bool IsBaseItself() const { return Val == 0; }
|
|
211
|
+
|
|
212
|
+
CMftRef(): Val(0) {}
|
|
213
|
+
};
|
|
214
|
+
|
|
215
|
+
#define ATNAME(n) ATTR_TYPE_ ## n
|
|
216
|
+
#define DEF_ATTR_TYPE(v, n) ATNAME(n) = v
|
|
217
|
+
|
|
218
|
+
enum
|
|
219
|
+
{
|
|
220
|
+
DEF_ATTR_TYPE(0x00, UNUSED),
|
|
221
|
+
DEF_ATTR_TYPE(0x10, STANDARD_INFO),
|
|
222
|
+
DEF_ATTR_TYPE(0x20, ATTRIBUTE_LIST),
|
|
223
|
+
DEF_ATTR_TYPE(0x30, FILE_NAME),
|
|
224
|
+
DEF_ATTR_TYPE(0x40, OBJECT_ID),
|
|
225
|
+
DEF_ATTR_TYPE(0x50, SECURITY_DESCRIPTOR),
|
|
226
|
+
DEF_ATTR_TYPE(0x60, VOLUME_NAME),
|
|
227
|
+
DEF_ATTR_TYPE(0x70, VOLUME_INFO),
|
|
228
|
+
DEF_ATTR_TYPE(0x80, DATA),
|
|
229
|
+
DEF_ATTR_TYPE(0x90, INDEX_ROOT),
|
|
230
|
+
DEF_ATTR_TYPE(0xA0, INDEX_ALLOCATION),
|
|
231
|
+
DEF_ATTR_TYPE(0xB0, BITMAP),
|
|
232
|
+
DEF_ATTR_TYPE(0xC0, REPARSE_POINT),
|
|
233
|
+
DEF_ATTR_TYPE(0xD0, EA_INFO),
|
|
234
|
+
DEF_ATTR_TYPE(0xE0, EA),
|
|
235
|
+
DEF_ATTR_TYPE(0xF0, PROPERTY_SET),
|
|
236
|
+
DEF_ATTR_TYPE(0x100, LOGGED_UTILITY_STREAM),
|
|
237
|
+
DEF_ATTR_TYPE(0x1000, FIRST_USER_DEFINED_ATTRIBUTE)
|
|
238
|
+
};
|
|
239
|
+
|
|
240
|
+
|
|
241
|
+
/* WinXP-64:
|
|
242
|
+
Probably only one short name (dos name) per record is allowed.
|
|
243
|
+
There are no short names for hard links.
|
|
244
|
+
The pair (Win32,Dos) can be in any order.
|
|
245
|
+
Posix name can be after or before Win32 name
|
|
246
|
+
*/
|
|
247
|
+
// static const Byte kFileNameType_Posix = 0; // for hard links, also used for usual files by Windows.
|
|
248
|
+
static const Byte kFileNameType_Win32 = 1; // after Dos name
|
|
249
|
+
static const Byte kFileNameType_Dos = 2; // short name
|
|
250
|
+
static const Byte kFileNameType_Win32Dos = 3; // short and full name are same
|
|
251
|
+
|
|
252
|
+
struct CFileNameAttr
|
|
253
|
+
{
|
|
254
|
+
CMftRef ParentDirRef;
|
|
255
|
+
UString2 Name;
|
|
256
|
+
Byte NameType;
|
|
257
|
+
// These values may be outdated, as they are not updated instantly by system.
|
|
258
|
+
// Probably these timestamps are not too useful.
|
|
259
|
+
// UInt64 CTime;
|
|
260
|
+
// UInt64 MTime;
|
|
261
|
+
// UInt64 ThisRecMTime; // xp-64: the time of previous name change (not last name change. why?)
|
|
262
|
+
// UInt64 ATime;
|
|
263
|
+
// UInt64 AllocatedSize;
|
|
264
|
+
// UInt64 DataSize;
|
|
265
|
+
// UInt16 PackedEaSize;
|
|
266
|
+
// UInt32 ReparseTag;
|
|
267
|
+
// UInt32 NameAttrib;
|
|
268
|
+
|
|
269
|
+
bool IsDos() const { return NameType == kFileNameType_Dos; }
|
|
270
|
+
bool IsWin32() const { return (NameType == kFileNameType_Win32); }
|
|
271
|
+
|
|
272
|
+
bool ParseFileNameAttr(const Byte *p, unsigned size);
|
|
273
|
+
|
|
274
|
+
CFileNameAttr():
|
|
275
|
+
// NameAttrib(0),
|
|
276
|
+
NameType(0)
|
|
277
|
+
{}
|
|
278
|
+
};
|
|
279
|
+
|
|
280
|
+
// (p) is aligned for 2-bytes
|
|
281
|
+
static void GetString(const Byte * const p, const size_t len, UString2 &res)
|
|
282
|
+
{
|
|
283
|
+
if (len == 0 && res.IsEmpty())
|
|
284
|
+
return;
|
|
285
|
+
wchar_t *s = res.GetBuf((unsigned)len);
|
|
286
|
+
size_t i;
|
|
287
|
+
for (i = 0; i < len; i++)
|
|
288
|
+
{
|
|
289
|
+
const wchar_t c = Get16(p + i * 2);
|
|
290
|
+
if (c == 0)
|
|
291
|
+
break; // we ignore this error
|
|
292
|
+
s[i] = c;
|
|
293
|
+
}
|
|
294
|
+
s[i] = 0;
|
|
295
|
+
res.ReleaseBuf_SetLen((unsigned)i);
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
// Name is empty
|
|
299
|
+
bool CFileNameAttr::ParseFileNameAttr(const Byte * const p, const unsigned size)
|
|
300
|
+
{
|
|
301
|
+
if (size < 0x42)
|
|
302
|
+
return false;
|
|
303
|
+
G64(p + 0x00, ParentDirRef.Val);
|
|
304
|
+
// G64(p + 0x08, CTime);
|
|
305
|
+
// G64(p + 0x10, MTime);
|
|
306
|
+
// G64(p + 0x18, ThisRecMTime);
|
|
307
|
+
// G64(p + 0x20, ATime);
|
|
308
|
+
// G64(p + 0x28, AllocatedSize);
|
|
309
|
+
// G64(p + 0x30, DataSize);
|
|
310
|
+
// G32(p + 0x38, NameAttrib); // similar to file attributes, but flag for directory is (1 << 28)
|
|
311
|
+
// G16(p + 0x3C, PackedEaSize);
|
|
312
|
+
// G32(p + 0x3C, ReparseTag);
|
|
313
|
+
NameType = p[0x41];
|
|
314
|
+
const unsigned len = p[0x40];
|
|
315
|
+
if (0x42 + len * 2 > size)
|
|
316
|
+
return false;
|
|
317
|
+
if (len != 0)
|
|
318
|
+
GetString(p + 0x42, len, Name);
|
|
319
|
+
return true;
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
|
|
323
|
+
struct CSiAttr
|
|
324
|
+
{
|
|
325
|
+
UInt64 CTime;
|
|
326
|
+
UInt64 MTime;
|
|
327
|
+
UInt64 ThisRecMTime;
|
|
328
|
+
UInt64 ATime;
|
|
329
|
+
UInt32 Attrib;
|
|
330
|
+
/*
|
|
331
|
+
UInt32 MaxVersions;
|
|
332
|
+
UInt32 Version;
|
|
333
|
+
UInt32 ClassId;
|
|
334
|
+
UInt32 OwnerId;
|
|
335
|
+
*/
|
|
336
|
+
UInt32 SecurityId; // SecurityId == 0 in kRecIndex_RootDir MFT record
|
|
337
|
+
// UInt64 QuotaCharged;
|
|
338
|
+
|
|
339
|
+
bool Parse(const Byte *p, unsigned size);
|
|
340
|
+
|
|
341
|
+
CSiAttr():
|
|
342
|
+
CTime(0),
|
|
343
|
+
MTime(0),
|
|
344
|
+
ThisRecMTime(0),
|
|
345
|
+
ATime(0),
|
|
346
|
+
Attrib(0),
|
|
347
|
+
SecurityId(0)
|
|
348
|
+
{}
|
|
349
|
+
};
|
|
350
|
+
|
|
351
|
+
bool CSiAttr::Parse(const Byte * const p, unsigned size)
|
|
352
|
+
{
|
|
353
|
+
if (size < 0x24)
|
|
354
|
+
return false;
|
|
355
|
+
G64(p + 0x00, CTime);
|
|
356
|
+
G64(p + 0x08, MTime);
|
|
357
|
+
G64(p + 0x10, ThisRecMTime);
|
|
358
|
+
G64(p + 0x18, ATime);
|
|
359
|
+
G32(p + 0x20, Attrib);
|
|
360
|
+
SecurityId = 0;
|
|
361
|
+
if (size >= 0x38)
|
|
362
|
+
G32(p + 0x34, SecurityId);
|
|
363
|
+
return true;
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
|
|
367
|
+
static const UInt64 kEmptyExtent = (UInt64)0-1;
|
|
368
|
+
|
|
369
|
+
struct CExtent
|
|
370
|
+
{
|
|
371
|
+
UInt64 Virt;
|
|
372
|
+
UInt64 Phy;
|
|
373
|
+
|
|
374
|
+
bool IsEmpty() const { return Phy == kEmptyExtent; }
|
|
375
|
+
};
|
|
376
|
+
|
|
377
|
+
struct CAttr
|
|
378
|
+
{
|
|
379
|
+
unsigned NextAttrIndex; /* DataAttrs[NextAttrIndex] is nearest
|
|
380
|
+
item with a different name, skipping items with identical names. */
|
|
381
|
+
Byte NonResident;
|
|
382
|
+
|
|
383
|
+
// Non-Resident
|
|
384
|
+
Byte CompressionUnit;
|
|
385
|
+
|
|
386
|
+
// UInt32 Len;
|
|
387
|
+
UString2 Name;
|
|
388
|
+
// UInt16 Flags;
|
|
389
|
+
// UInt16 Instance;
|
|
390
|
+
CByteBuffer Data;
|
|
391
|
+
|
|
392
|
+
// Non-Resident
|
|
393
|
+
UInt64 LowVcn;
|
|
394
|
+
UInt64 HighVcn;
|
|
395
|
+
UInt64 AllocatedSize;
|
|
396
|
+
UInt64 Size;
|
|
397
|
+
UInt64 PackSize;
|
|
398
|
+
UInt64 InitializedSize;
|
|
399
|
+
|
|
400
|
+
// Resident
|
|
401
|
+
// UInt16 ResidentFlags;
|
|
402
|
+
|
|
403
|
+
// We support only 2 values for CompressionUnit: 0 (no compression) and 4, which means 16 clusters.
|
|
404
|
+
#define COMPRESSION_UNIT_VAL_4 4
|
|
405
|
+
bool IsCompressionUnitSupported() const { return CompressionUnit == 0 || CompressionUnit == COMPRESSION_UNIT_VAL_4; }
|
|
406
|
+
|
|
407
|
+
UInt32 ParseAttr(const Byte *p, unsigned size, UInt32 &type);
|
|
408
|
+
bool ParseFileName(CFileNameAttr &a) const { return a.ParseFileNameAttr(Data, (unsigned)Data.Size()); }
|
|
409
|
+
bool ParseSi(CSiAttr &a) const { return a.Parse(Data, (unsigned)Data.Size()); }
|
|
410
|
+
bool ParseExtents(CRecordVector<CExtent> &extents, UInt64 numClustersMax, unsigned compressionUnit) const;
|
|
411
|
+
UInt64 GetSize() const { return NonResident ? Size : Data.Size(); }
|
|
412
|
+
UInt64 GetPackSize() const
|
|
413
|
+
{
|
|
414
|
+
if (!NonResident)
|
|
415
|
+
return Data.Size();
|
|
416
|
+
if (CompressionUnit != 0)
|
|
417
|
+
return PackSize;
|
|
418
|
+
return AllocatedSize;
|
|
419
|
+
}
|
|
420
|
+
CAttr():
|
|
421
|
+
// NextAttrIndex(0), // optional
|
|
422
|
+
LowVcn((UInt64)0-1) // used by CompareAttr()
|
|
423
|
+
{}
|
|
424
|
+
};
|
|
425
|
+
|
|
426
|
+
#define RINOZ(x) { int _tt_ = (x); if (_tt_ != 0) return _tt_; }
|
|
427
|
+
|
|
428
|
+
static int CompareAttr(void *const *elem1, void *const *elem2, void *)
|
|
429
|
+
{
|
|
430
|
+
const CAttr &a1 = *(*((const CAttr *const *)elem1));
|
|
431
|
+
const CAttr &a2 = *(*((const CAttr *const *)elem2));
|
|
432
|
+
if (a1.Name.IsEmpty())
|
|
433
|
+
{
|
|
434
|
+
if (!a2.Name.IsEmpty())
|
|
435
|
+
return -1;
|
|
436
|
+
}
|
|
437
|
+
else if (a2.Name.IsEmpty())
|
|
438
|
+
return 1;
|
|
439
|
+
else
|
|
440
|
+
{
|
|
441
|
+
RINOZ(a1.Name.Compare(a2.Name.GetRawPtr()))
|
|
442
|
+
}
|
|
443
|
+
return MyCompare(a1.LowVcn, a2.LowVcn);
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
|
|
447
|
+
/*
|
|
448
|
+
in: CAttr is empty after constructor
|
|
449
|
+
return: len_of_attr : len_of_attr % 8 == 0
|
|
450
|
+
*/
|
|
451
|
+
unsigned CAttr::ParseAttr(const Byte * const p, const unsigned size, UInt32 &type)
|
|
452
|
+
{
|
|
453
|
+
if (size < 4)
|
|
454
|
+
return 0;
|
|
455
|
+
G32(p, type);
|
|
456
|
+
if (type == 0xFFFFFFFF)
|
|
457
|
+
return 8; // required size is 4, but attributes are 8 bytes aligned. So we return 8
|
|
458
|
+
if (size < 0x18)
|
|
459
|
+
return 0;
|
|
460
|
+
PRF(printf(" T=%2X", type));
|
|
461
|
+
|
|
462
|
+
const UInt32 len = Get32(p + 4);
|
|
463
|
+
PRF(printf(" L=%3u", len));
|
|
464
|
+
if (len > size || (len & 7))
|
|
465
|
+
return 0;
|
|
466
|
+
NonResident = p[8];
|
|
467
|
+
{
|
|
468
|
+
const unsigned nameLen = p[9];
|
|
469
|
+
const UInt32 nameOffset = Get16(p + 0x0A);
|
|
470
|
+
if (nameOffset & 1) // v26.04
|
|
471
|
+
return 0;
|
|
472
|
+
if (nameLen != 0)
|
|
473
|
+
{
|
|
474
|
+
if (nameOffset + nameLen * 2 > len)
|
|
475
|
+
return 0;
|
|
476
|
+
GetString(p + nameOffset, nameLen, Name);
|
|
477
|
+
PRF(printf(" N="));
|
|
478
|
+
PRF_UTF16(Name)
|
|
479
|
+
}
|
|
480
|
+
}
|
|
481
|
+
// G16(p + 0x0C, Flags);
|
|
482
|
+
// G16(p + 0x0E, Instance);
|
|
483
|
+
// PRF(printf(" F=%4X", Flags));
|
|
484
|
+
// PRF(printf(" Inst=%d", Instance));
|
|
485
|
+
|
|
486
|
+
UInt32 dataSize, offs;
|
|
487
|
+
if (NonResident)
|
|
488
|
+
{
|
|
489
|
+
if (len < 0x40)
|
|
490
|
+
return 0;
|
|
491
|
+
PRF(printf(" NR"));
|
|
492
|
+
G64(p + 0x10, LowVcn);
|
|
493
|
+
G64(p + 0x18, HighVcn);
|
|
494
|
+
G64(p + 0x28, AllocatedSize);
|
|
495
|
+
G64(p + 0x30, Size);
|
|
496
|
+
PackSize = Size;
|
|
497
|
+
G64(p + 0x38, InitializedSize);
|
|
498
|
+
G16(p + 0x20, offs);
|
|
499
|
+
CompressionUnit = p[0x22];
|
|
500
|
+
if (CompressionUnit != 0)
|
|
501
|
+
{
|
|
502
|
+
if (len < 0x48)
|
|
503
|
+
return 0;
|
|
504
|
+
G64(p + 0x40, PackSize);
|
|
505
|
+
PRINT_UI64(" PS", PackSize)
|
|
506
|
+
}
|
|
507
|
+
// PRF(printf("\n"));
|
|
508
|
+
PRINT_UI64(" ASize", AllocatedSize)
|
|
509
|
+
PRINT_UI64(" Size", Size)
|
|
510
|
+
PRINT_UI64(" IS", InitializedSize)
|
|
511
|
+
PRINT_UI64(" Low", LowVcn)
|
|
512
|
+
PRINT_UI64(" High", HighVcn)
|
|
513
|
+
PRF(printf(" CU=%u", (unsigned)CompressionUnit);)
|
|
514
|
+
dataSize = len - offs;
|
|
515
|
+
}
|
|
516
|
+
else
|
|
517
|
+
{
|
|
518
|
+
if (len < 0x18)
|
|
519
|
+
return 0;
|
|
520
|
+
G32(p + 0x10, dataSize);
|
|
521
|
+
G16(p + 0x14, offs);
|
|
522
|
+
// G16(p + 0x16, ResidentFlags);
|
|
523
|
+
PRF(printf(" RES"));
|
|
524
|
+
PRF(printf(" dataSize=%3u", dataSize));
|
|
525
|
+
// PRF(printf(" ResFlags=%4X", ResidentFlags));
|
|
526
|
+
}
|
|
527
|
+
|
|
528
|
+
if (len < offs || len - offs < dataSize)
|
|
529
|
+
return 0;
|
|
530
|
+
/* we don't check alignment for (offs),
|
|
531
|
+
because we copy the data to aligned (Data) buffer.
|
|
532
|
+
So we will access the data of attribute via aligned (Data) */
|
|
533
|
+
Data.CopyFrom(p + offs, dataSize);
|
|
534
|
+
|
|
535
|
+
#ifdef SHOW_DEBUG_INFO
|
|
536
|
+
PRF(printf(" : "));
|
|
537
|
+
for (unsigned i = 0; i < Data.Size(); i++)
|
|
538
|
+
{
|
|
539
|
+
PRF(printf(" %02X", (unsigned)Data[i]));
|
|
540
|
+
}
|
|
541
|
+
#endif
|
|
542
|
+
|
|
543
|
+
return len;
|
|
544
|
+
}
|
|
545
|
+
|
|
546
|
+
|
|
547
|
+
/*
|
|
548
|
+
in : (Extents.Back().IsEmpty() == true)
|
|
549
|
+
out : (Extents.Back().IsEmpty() == true), if function returns true.
|
|
550
|
+
if function returns false, then there is error and Extents[] are not valid.
|
|
551
|
+
*/
|
|
552
|
+
bool CAttr::ParseExtents(CRecordVector<CExtent> &extents,
|
|
553
|
+
const UInt64 numClustersMax, const unsigned compressionUnit) const
|
|
554
|
+
{
|
|
555
|
+
PRINT_UI64_2("\n# ParseExtents LowVcn", LowVcn)
|
|
556
|
+
PRINT_UI64_2(" HighVcn", HighVcn)
|
|
557
|
+
UInt64 vcn = LowVcn;
|
|
558
|
+
const UInt64 highVcn1 = HighVcn + 1;
|
|
559
|
+
if (vcn >= highVcn1)
|
|
560
|
+
{
|
|
561
|
+
if (vcn)
|
|
562
|
+
return false;
|
|
563
|
+
// (vcn == 0 && highVcn1 == 0)
|
|
564
|
+
/* it's allowed empty Non-Resident file:
|
|
565
|
+
"[SYSTEM]\$Extend\$RmMetadata\$Repair" and other */
|
|
566
|
+
}
|
|
567
|
+
if (highVcn1 >= ((UInt64)1 << 63) || vcn != extents.Back().Virt)
|
|
568
|
+
return false;
|
|
569
|
+
|
|
570
|
+
extents.DeleteBack();
|
|
571
|
+
const Byte *p = Data;
|
|
572
|
+
unsigned size = (unsigned)Data.Size();
|
|
573
|
+
UInt64 lcn = 0;
|
|
574
|
+
for (;;)
|
|
575
|
+
{
|
|
576
|
+
if (size == 0)
|
|
577
|
+
{
|
|
578
|
+
// return false; // no end marker. Do we need to exit with error?
|
|
579
|
+
break;
|
|
580
|
+
}
|
|
581
|
+
size--;
|
|
582
|
+
const unsigned b = *p++;
|
|
583
|
+
if (b == 0)
|
|
584
|
+
break;
|
|
585
|
+
unsigned num = b & 0xF;
|
|
586
|
+
if (num == 0 || num > 8 || num > size)
|
|
587
|
+
return false;
|
|
588
|
+
CExtent e;
|
|
589
|
+
{
|
|
590
|
+
UInt64 v = 0;
|
|
591
|
+
{
|
|
592
|
+
size_t i = num;
|
|
593
|
+
do v = (v << 8) | p[--i]; while (i);
|
|
594
|
+
}
|
|
595
|
+
if (v == 0)
|
|
596
|
+
return false;
|
|
597
|
+
p += num;
|
|
598
|
+
size -= num;
|
|
599
|
+
if (highVcn1 - vcn < v)
|
|
600
|
+
return false;
|
|
601
|
+
e.Virt = vcn;
|
|
602
|
+
vcn += v;
|
|
603
|
+
}
|
|
604
|
+
|
|
605
|
+
num = b >> 4;
|
|
606
|
+
if (num == 0)
|
|
607
|
+
{
|
|
608
|
+
// no LCN : sparse or compressed.
|
|
609
|
+
/* if Unit is compressed, it can have many Elements for each compressed Unit:
|
|
610
|
+
and last Element for unit MUST be without LCN.
|
|
611
|
+
Element 0: numCompressedClusters2, LCN_0
|
|
612
|
+
Element 1: numCompressedClusters2, LCN_1
|
|
613
|
+
...
|
|
614
|
+
Last Element : (16 - total_clusters_in_previous_elements), no LCN
|
|
615
|
+
*/
|
|
616
|
+
if (compressionUnit == 0)
|
|
617
|
+
return false; // we need test examples to test case of Sparse with (compressionUnit == 0).
|
|
618
|
+
e.Phy = kEmptyExtent;
|
|
619
|
+
}
|
|
620
|
+
else
|
|
621
|
+
{
|
|
622
|
+
// num != 0
|
|
623
|
+
if (num > 8 || num > size)
|
|
624
|
+
return false;
|
|
625
|
+
size_t i = num - 1;
|
|
626
|
+
UInt64 v = (UInt64)(Int64)(signed char)p[i];
|
|
627
|
+
while (i)
|
|
628
|
+
v = (v << 8) | p[--i];
|
|
629
|
+
p += num;
|
|
630
|
+
size -= num;
|
|
631
|
+
lcn += v;
|
|
632
|
+
if (lcn > numClustersMax)
|
|
633
|
+
return false;
|
|
634
|
+
e.Phy = lcn;
|
|
635
|
+
}
|
|
636
|
+
extents.Add(e);
|
|
637
|
+
}
|
|
638
|
+
|
|
639
|
+
CExtent e;
|
|
640
|
+
e.Phy = kEmptyExtent;
|
|
641
|
+
e.Virt = vcn;
|
|
642
|
+
extents.Add(e);
|
|
643
|
+
return highVcn1 == vcn;
|
|
644
|
+
}
|
|
645
|
+
|
|
646
|
+
|
|
647
|
+
static const UInt64 kEmptyTag = (UInt64)0-1;
|
|
648
|
+
/* Big cache can be faster for non-sequential access to same chunks.
|
|
649
|
+
We use small cache that is better for sequential access: */
|
|
650
|
+
static const unsigned kNumCacheChunksLog = 1; // [0,4]
|
|
651
|
+
static const size_t kNumCacheChunks = (size_t)1 << kNumCacheChunksLog;
|
|
652
|
+
|
|
653
|
+
Z7_CLASS_IMP_IInStream(
|
|
654
|
+
CInStream
|
|
655
|
+
)
|
|
656
|
+
UInt64 _virtPos;
|
|
657
|
+
UInt64 _physPos;
|
|
658
|
+
UInt64 _curRem;
|
|
659
|
+
bool _sparseMode;
|
|
660
|
+
public:
|
|
661
|
+
bool InUse;
|
|
662
|
+
private:
|
|
663
|
+
unsigned _chunkSizeLog;
|
|
664
|
+
CAlignedBuffer _inBuf;
|
|
665
|
+
CAlignedBuffer _outBuf;
|
|
666
|
+
public:
|
|
667
|
+
UInt64 Size;
|
|
668
|
+
UInt64 InitializedSize;
|
|
669
|
+
unsigned BlockSizeLog;
|
|
670
|
+
unsigned CompressionUnit; // 0 or 4
|
|
671
|
+
CRecordVector<CExtent> Extents;
|
|
672
|
+
CMyComPtr<IInStream> Stream;
|
|
673
|
+
private:
|
|
674
|
+
UInt64 _tags[kNumCacheChunks];
|
|
675
|
+
|
|
676
|
+
HRESULT SeekToPhys() { return InStream_SeekSet(Stream, _physPos); }
|
|
677
|
+
size_t GetCuSize() const { return (size_t)1 << (BlockSizeLog + CompressionUnit); }
|
|
678
|
+
public:
|
|
679
|
+
|
|
680
|
+
void Clear()
|
|
681
|
+
{
|
|
682
|
+
Extents.Clear();
|
|
683
|
+
Stream.Release();
|
|
684
|
+
}
|
|
685
|
+
|
|
686
|
+
HRESULT InitAndSeek(const unsigned compressionUnit)
|
|
687
|
+
{
|
|
688
|
+
CompressionUnit = compressionUnit;
|
|
689
|
+
_chunkSizeLog = BlockSizeLog + CompressionUnit;
|
|
690
|
+
if (compressionUnit != 0)
|
|
691
|
+
{
|
|
692
|
+
const size_t cuSize = GetCuSize();
|
|
693
|
+
_inBuf.Alloc(cuSize);
|
|
694
|
+
if (!_inBuf.IsAllocated())
|
|
695
|
+
return E_OUTOFMEMORY;
|
|
696
|
+
const size_t cacheSize = kNumCacheChunks << _chunkSizeLog;
|
|
697
|
+
// if ((cacheSize >> _chunkSizeLog) != kNumCacheChunks) return E_OUTOFMEMORY;
|
|
698
|
+
_outBuf.Alloc(cacheSize);
|
|
699
|
+
if (!_outBuf.IsAllocated())
|
|
700
|
+
return E_OUTOFMEMORY;
|
|
701
|
+
}
|
|
702
|
+
for (size_t i = 0; i < kNumCacheChunks; i++)
|
|
703
|
+
_tags[i] = kEmptyTag;
|
|
704
|
+
_sparseMode = false;
|
|
705
|
+
_curRem = 0;
|
|
706
|
+
_virtPos = 0;
|
|
707
|
+
_physPos = 0;
|
|
708
|
+
const CExtent &e = Extents[0];
|
|
709
|
+
if (!e.IsEmpty())
|
|
710
|
+
_physPos = e.Phy << BlockSizeLog;
|
|
711
|
+
return SeekToPhys();
|
|
712
|
+
}
|
|
713
|
+
};
|
|
714
|
+
|
|
715
|
+
|
|
716
|
+
#define LZNT_CHUNK_SIZE (1 << 12)
|
|
717
|
+
#if LZNT_CHUNK_SIZE > (512 << COMPRESSION_UNIT_VAL_4)
|
|
718
|
+
#error Stop_Compiling_Bad_COMPRESSION_UNIT
|
|
719
|
+
#endif
|
|
720
|
+
/*
|
|
721
|
+
in:
|
|
722
|
+
dest[] must have space for (dest_up_size) bytes:
|
|
723
|
+
dest_up_size = (destLen) rounded up to the nearest multiple of LZNT_CHUNK_SIZE.
|
|
724
|
+
dest_up_size = (destLen + LZNT_CHUNK_SIZE - 1) & ~(LZNT_CHUNK_SIZE - 1)
|
|
725
|
+
return:
|
|
726
|
+
destSize == 0 : no data was decoded, or there is some error in compressed stream.
|
|
727
|
+
destSize < destLen : some chunks were decoded, but there is error in last chunk or unavailable input data.
|
|
728
|
+
destSize == destLen : end of output stream (destLen) was reached after chunk decoding.
|
|
729
|
+
destSize > destLen && destSize <= dest_up_size : is also normal case.
|
|
730
|
+
*/
|
|
731
|
+
static size_t Lznt1Dec(Byte * const dest, const size_t destLen,
|
|
732
|
+
const Byte *src, size_t srcLen)
|
|
733
|
+
{
|
|
734
|
+
size_t destSize = 0;
|
|
735
|
+
while (destSize < destLen)
|
|
736
|
+
{
|
|
737
|
+
// we check that last decoded chunk contained (LZNT_CHUNK_SIZE) bytes:
|
|
738
|
+
if (srcLen < 2 || (destSize & (LZNT_CHUNK_SIZE - 1)))
|
|
739
|
+
break;
|
|
740
|
+
unsigned comprSize;
|
|
741
|
+
{
|
|
742
|
+
const unsigned v = GetUi16(src);
|
|
743
|
+
if (v == 0) // end_of_stream marker
|
|
744
|
+
break;
|
|
745
|
+
// bits [12:14] : chunk_size_order : (chunk_size = 512 << chunk_size_order)
|
|
746
|
+
// we support only (chunk_size_order == 3) and (chunk_size = 4096)
|
|
747
|
+
if ((v & 0x7000) != 0x3000) // v26.04 check: (chunk_size_order == 3)
|
|
748
|
+
return 0; // break;
|
|
749
|
+
src += 2;
|
|
750
|
+
srcLen -= 2;
|
|
751
|
+
comprSize = (v & 0xFFF) + 1;
|
|
752
|
+
if (srcLen < comprSize)
|
|
753
|
+
break; // unavailable data
|
|
754
|
+
srcLen -= comprSize;
|
|
755
|
+
if ((v & 0x8000) == 0)
|
|
756
|
+
{
|
|
757
|
+
/* win10 probably produces full (LZNT_CHUNK_SIZE) chunk even for last final partial chunk.
|
|
758
|
+
so we use it to check for errors: */
|
|
759
|
+
if (comprSize != LZNT_CHUNK_SIZE)
|
|
760
|
+
break;
|
|
761
|
+
memcpy(dest + destSize, src, comprSize);
|
|
762
|
+
src += comprSize;
|
|
763
|
+
destSize += comprSize;
|
|
764
|
+
continue;
|
|
765
|
+
}
|
|
766
|
+
}
|
|
767
|
+
{
|
|
768
|
+
if (comprSize > 1 && (src[0] & 1)) // we check that first LZ-symbol is LITERAL
|
|
769
|
+
return 0;
|
|
770
|
+
unsigned numDistBits = 4;
|
|
771
|
+
unsigned sbOffset = 0;
|
|
772
|
+
do
|
|
773
|
+
{
|
|
774
|
+
unsigned mask = *src++ | 0x100;
|
|
775
|
+
if (--comprSize == 0)
|
|
776
|
+
{
|
|
777
|
+
// is it error case or normal case?
|
|
778
|
+
// that case can allow some padding data in compressed stream.
|
|
779
|
+
break; // by LZNT specification : it's allowed case
|
|
780
|
+
// return 0; // more stict check
|
|
781
|
+
}
|
|
782
|
+
do
|
|
783
|
+
{
|
|
784
|
+
if ((mask & 1) == 0)
|
|
785
|
+
{
|
|
786
|
+
if (sbOffset >= LZNT_CHUNK_SIZE)
|
|
787
|
+
return 0;
|
|
788
|
+
sbOffset++;
|
|
789
|
+
dest[destSize++] = *src++;
|
|
790
|
+
comprSize--;
|
|
791
|
+
}
|
|
792
|
+
else
|
|
793
|
+
{
|
|
794
|
+
if (comprSize < 2)
|
|
795
|
+
return 0;
|
|
796
|
+
comprSize -= 2;
|
|
797
|
+
const unsigned v = GetUi16(src);
|
|
798
|
+
src += 2;
|
|
799
|
+
|
|
800
|
+
while (((sbOffset - 1) >> numDistBits) != 0)
|
|
801
|
+
numDistBits++;
|
|
802
|
+
|
|
803
|
+
const unsigned len = (v & (0xFFFF >> numDistBits)) + 3;
|
|
804
|
+
if (sbOffset + len > LZNT_CHUNK_SIZE)
|
|
805
|
+
return 0;
|
|
806
|
+
const unsigned dist = v >> (16 - numDistBits);
|
|
807
|
+
if (dist >= sbOffset)
|
|
808
|
+
return 0;
|
|
809
|
+
const size_t offs = 1 + dist;
|
|
810
|
+
Byte *p = dest + destSize - offs;
|
|
811
|
+
destSize += len;
|
|
812
|
+
sbOffset += len;
|
|
813
|
+
const Byte *lim = p + len;
|
|
814
|
+
p[offs] = *p; ++p;
|
|
815
|
+
p[offs] = *p; ++p;
|
|
816
|
+
do
|
|
817
|
+
p[offs] = *p;
|
|
818
|
+
while (++p != lim);
|
|
819
|
+
}
|
|
820
|
+
}
|
|
821
|
+
while ((mask >>= 1) > 1 && comprSize);
|
|
822
|
+
}
|
|
823
|
+
while (comprSize);
|
|
824
|
+
#if 0 // 1 for debug
|
|
825
|
+
/* win10 probably produces full (LZNT_CHUNK_SIZE) chunk even for last final partial chunk.
|
|
826
|
+
But we are not sure that all LZNT1 encoders do it.
|
|
827
|
+
So we don't use the following check: */
|
|
828
|
+
if (sbOffset != LZNT_CHUNK_SIZE)
|
|
829
|
+
break;
|
|
830
|
+
#endif
|
|
831
|
+
}
|
|
832
|
+
}
|
|
833
|
+
return destSize;
|
|
834
|
+
}
|
|
835
|
+
|
|
836
|
+
|
|
837
|
+
Z7_COM7F_IMF(CInStream::Read(void * const data, UInt32 size, UInt32 * const processedSize))
|
|
838
|
+
{
|
|
839
|
+
if (processedSize)
|
|
840
|
+
*processedSize = 0;
|
|
841
|
+
if (size == 0)
|
|
842
|
+
return S_OK;
|
|
843
|
+
if (_virtPos >= Size)
|
|
844
|
+
return S_OK; // return (Size == _virtPos) ? S_OK: E_FAIL;
|
|
845
|
+
{
|
|
846
|
+
const UInt64 rem = Size - _virtPos;
|
|
847
|
+
if (size > rem)
|
|
848
|
+
size = (UInt32)rem;
|
|
849
|
+
}
|
|
850
|
+
if (_virtPos >= InitializedSize)
|
|
851
|
+
{
|
|
852
|
+
memset(data, 0, size);
|
|
853
|
+
_virtPos += size;
|
|
854
|
+
if (processedSize)
|
|
855
|
+
*processedSize = size;
|
|
856
|
+
return S_OK;
|
|
857
|
+
}
|
|
858
|
+
{
|
|
859
|
+
const UInt64 rem = InitializedSize - _virtPos;
|
|
860
|
+
if (size > rem)
|
|
861
|
+
size = (UInt32)rem;
|
|
862
|
+
}
|
|
863
|
+
|
|
864
|
+
while (_curRem == 0)
|
|
865
|
+
{
|
|
866
|
+
const UInt64 cacheTag = _virtPos >> _chunkSizeLog;
|
|
867
|
+
const size_t cacheIndex = (size_t)cacheTag & (kNumCacheChunks - 1);
|
|
868
|
+
|
|
869
|
+
if (_tags[cacheIndex] == cacheTag)
|
|
870
|
+
{
|
|
871
|
+
const size_t chunkSize = (size_t)1 << _chunkSizeLog;
|
|
872
|
+
const size_t offset = (size_t)_virtPos & (chunkSize - 1);
|
|
873
|
+
size_t cur = chunkSize - offset;
|
|
874
|
+
if (cur > size)
|
|
875
|
+
cur = size;
|
|
876
|
+
memcpy(data, _outBuf + (cacheIndex << _chunkSizeLog) + offset, cur);
|
|
877
|
+
if (processedSize)
|
|
878
|
+
*processedSize = (UInt32)cur;
|
|
879
|
+
_virtPos += cur;
|
|
880
|
+
return S_OK;
|
|
881
|
+
}
|
|
882
|
+
|
|
883
|
+
PRINT_UI64_2("\nVirtPos", _virtPos)
|
|
884
|
+
|
|
885
|
+
const UInt32 comprUnitSize = (UInt32)1 << CompressionUnit;
|
|
886
|
+
const UInt64 virtBlock = _virtPos >> BlockSizeLog;
|
|
887
|
+
const UInt64 virtBlock2 = virtBlock & ~((UInt64)comprUnitSize - 1);
|
|
888
|
+
|
|
889
|
+
unsigned left = 0, right = Extents.Size();
|
|
890
|
+
for (;;)
|
|
891
|
+
{
|
|
892
|
+
const unsigned mid = (left + right) / 2;
|
|
893
|
+
if (mid == left)
|
|
894
|
+
break;
|
|
895
|
+
if (virtBlock2 < Extents[mid].Virt)
|
|
896
|
+
right = mid;
|
|
897
|
+
else
|
|
898
|
+
left = mid;
|
|
899
|
+
}
|
|
900
|
+
|
|
901
|
+
bool isCompressed = false;
|
|
902
|
+
const UInt64 virtBlock2End = virtBlock2 + comprUnitSize;
|
|
903
|
+
if (CompressionUnit != 0)
|
|
904
|
+
for (unsigned i = left; i < Extents.Size(); i++)
|
|
905
|
+
{
|
|
906
|
+
const CExtent &e = Extents[i];
|
|
907
|
+
if (e.Virt >= virtBlock2End)
|
|
908
|
+
break;
|
|
909
|
+
if (e.IsEmpty())
|
|
910
|
+
{
|
|
911
|
+
isCompressed = true;
|
|
912
|
+
break;
|
|
913
|
+
}
|
|
914
|
+
}
|
|
915
|
+
|
|
916
|
+
unsigned i;
|
|
917
|
+
for (i = left; Extents[i + 1].Virt <= virtBlock; i++);
|
|
918
|
+
|
|
919
|
+
_sparseMode = false;
|
|
920
|
+
if (!isCompressed)
|
|
921
|
+
{
|
|
922
|
+
const CExtent &e = Extents[i];
|
|
923
|
+
const UInt64 newPos = (e.Phy << BlockSizeLog) + _virtPos - (e.Virt << BlockSizeLog);
|
|
924
|
+
if (newPos != _physPos)
|
|
925
|
+
{
|
|
926
|
+
_physPos = newPos;
|
|
927
|
+
RINOK(SeekToPhys())
|
|
928
|
+
}
|
|
929
|
+
UInt64 next = Extents[i + 1].Virt;
|
|
930
|
+
if (next > virtBlock2End)
|
|
931
|
+
next &= ~((UInt64)comprUnitSize - 1);
|
|
932
|
+
next <<= BlockSizeLog;
|
|
933
|
+
if (next > Size)
|
|
934
|
+
next = Size;
|
|
935
|
+
_curRem = next - _virtPos;
|
|
936
|
+
break;
|
|
937
|
+
}
|
|
938
|
+
|
|
939
|
+
bool thereArePhy = false;
|
|
940
|
+
|
|
941
|
+
for (unsigned i2 = left; i2 < Extents.Size(); i2++)
|
|
942
|
+
{
|
|
943
|
+
const CExtent &e = Extents[i2];
|
|
944
|
+
if (e.Virt >= virtBlock2End)
|
|
945
|
+
break;
|
|
946
|
+
if (!e.IsEmpty())
|
|
947
|
+
{
|
|
948
|
+
thereArePhy = true;
|
|
949
|
+
break;
|
|
950
|
+
}
|
|
951
|
+
}
|
|
952
|
+
|
|
953
|
+
if (!thereArePhy)
|
|
954
|
+
{
|
|
955
|
+
_curRem = (Extents[i + 1].Virt << BlockSizeLog) - _virtPos;
|
|
956
|
+
_sparseMode = true;
|
|
957
|
+
break;
|
|
958
|
+
}
|
|
959
|
+
|
|
960
|
+
size_t offs = 0;
|
|
961
|
+
UInt64 curVirt = virtBlock2;
|
|
962
|
+
|
|
963
|
+
for (i = left; i < Extents.Size(); i++)
|
|
964
|
+
{
|
|
965
|
+
const CExtent &e = Extents[i];
|
|
966
|
+
if (e.IsEmpty())
|
|
967
|
+
break;
|
|
968
|
+
if (e.Virt >= virtBlock2End)
|
|
969
|
+
return S_FALSE;
|
|
970
|
+
const UInt64 newPos = (e.Phy + (curVirt - e.Virt)) << BlockSizeLog;
|
|
971
|
+
if (newPos != _physPos)
|
|
972
|
+
{
|
|
973
|
+
_physPos = newPos;
|
|
974
|
+
RINOK(SeekToPhys())
|
|
975
|
+
}
|
|
976
|
+
UInt64 numChunks = Extents[i + 1].Virt - curVirt;
|
|
977
|
+
if (curVirt + numChunks > virtBlock2End)
|
|
978
|
+
numChunks = virtBlock2End - curVirt;
|
|
979
|
+
const size_t compressed = (size_t)numChunks << BlockSizeLog;
|
|
980
|
+
RINOK(ReadStream_FALSE(Stream, _inBuf + offs, compressed))
|
|
981
|
+
curVirt += numChunks;
|
|
982
|
+
_physPos += compressed;
|
|
983
|
+
offs += compressed;
|
|
984
|
+
}
|
|
985
|
+
|
|
986
|
+
const size_t destLenMax = GetCuSize(); // [8,16,32,64] KB
|
|
987
|
+
// destLenMax >= LZNT_CHUNK_SIZE
|
|
988
|
+
size_t destLen = destLenMax;
|
|
989
|
+
const UInt64 rem = Size - (virtBlock2 << BlockSizeLog);
|
|
990
|
+
if (destLen > rem)
|
|
991
|
+
destLen = (size_t)rem;
|
|
992
|
+
|
|
993
|
+
Byte * const dest = _outBuf + (cacheIndex << _chunkSizeLog);
|
|
994
|
+
_tags[cacheIndex] = cacheTag;
|
|
995
|
+
const size_t destSizeRes = Lznt1Dec(dest, destLen, _inBuf, offs);
|
|
996
|
+
// (destSizeRes > destLen) is normal case for win10 ntfs
|
|
997
|
+
if (destSizeRes < destLen)
|
|
998
|
+
{
|
|
999
|
+
// destSizeRes = 0; // to discard partial data.
|
|
1000
|
+
memset(dest + destSizeRes, 0, destLenMax - destSizeRes);
|
|
1001
|
+
#if 1 // 0 for debug : 0 to ignore any errors in compressed data
|
|
1002
|
+
if (InUse)
|
|
1003
|
+
{
|
|
1004
|
+
// we don't want to return any partial decoded data
|
|
1005
|
+
_tags[cacheIndex] = kEmptyTag;
|
|
1006
|
+
return S_FALSE;
|
|
1007
|
+
}
|
|
1008
|
+
#endif
|
|
1009
|
+
}
|
|
1010
|
+
}
|
|
1011
|
+
|
|
1012
|
+
if (size > _curRem)
|
|
1013
|
+
size = (UInt32)_curRem;
|
|
1014
|
+
HRESULT res = S_OK;
|
|
1015
|
+
if (_sparseMode)
|
|
1016
|
+
memset(data, 0, size);
|
|
1017
|
+
else
|
|
1018
|
+
{
|
|
1019
|
+
res = Stream->Read(data, size, &size);
|
|
1020
|
+
_physPos += size;
|
|
1021
|
+
}
|
|
1022
|
+
if (processedSize)
|
|
1023
|
+
*processedSize = size;
|
|
1024
|
+
_virtPos += size;
|
|
1025
|
+
_curRem -= size;
|
|
1026
|
+
return res;
|
|
1027
|
+
}
|
|
1028
|
+
|
|
1029
|
+
|
|
1030
|
+
Z7_COM7F_IMF(CInStream::Seek(Int64 offset, UInt32 seekOrigin, UInt64 *newPosition))
|
|
1031
|
+
{
|
|
1032
|
+
switch (seekOrigin)
|
|
1033
|
+
{
|
|
1034
|
+
case STREAM_SEEK_SET: break;
|
|
1035
|
+
case STREAM_SEEK_CUR: offset += _virtPos; break;
|
|
1036
|
+
case STREAM_SEEK_END: offset += Size; break;
|
|
1037
|
+
default: return STG_E_INVALIDFUNCTION;
|
|
1038
|
+
}
|
|
1039
|
+
if (offset < 0)
|
|
1040
|
+
return HRESULT_WIN32_ERROR_NEGATIVE_SEEK;
|
|
1041
|
+
if (_virtPos != (UInt64)offset)
|
|
1042
|
+
{
|
|
1043
|
+
_curRem = 0;
|
|
1044
|
+
_virtPos = (UInt64)offset;
|
|
1045
|
+
}
|
|
1046
|
+
if (newPosition)
|
|
1047
|
+
*newPosition = (UInt64)offset;
|
|
1048
|
+
return S_OK;
|
|
1049
|
+
}
|
|
1050
|
+
|
|
1051
|
+
|
|
1052
|
+
static HRESULT DataParseExtents(const unsigned clusterSizeLog,
|
|
1053
|
+
const CObjectVector<CAttr> &attrs, const unsigned attrIndex,
|
|
1054
|
+
const UInt64 numPhysClusters, CRecordVector<CExtent> &Extents)
|
|
1055
|
+
{
|
|
1056
|
+
Extents.Clear();
|
|
1057
|
+
{
|
|
1058
|
+
CExtent e;
|
|
1059
|
+
e.Virt = 0;
|
|
1060
|
+
e.Phy = kEmptyExtent;
|
|
1061
|
+
Extents.Add(e);
|
|
1062
|
+
}
|
|
1063
|
+
const CAttr &attr0 = attrs[attrIndex];
|
|
1064
|
+
const unsigned attrIndexLim = attr0.NextAttrIndex;
|
|
1065
|
+
if (attr0.AllocatedSize < attr0.Size
|
|
1066
|
+
|| attrs[attrIndexLim - 1].HighVcn + 1 != (attr0.AllocatedSize >> clusterSizeLog)
|
|
1067
|
+
|| (attr0.AllocatedSize & ((1u << clusterSizeLog) - 1)))
|
|
1068
|
+
return S_FALSE;
|
|
1069
|
+
|
|
1070
|
+
for (unsigned i = attrIndex; i < attrIndexLim; i++)
|
|
1071
|
+
if (!attrs[i].ParseExtents(Extents, numPhysClusters, attr0.CompressionUnit))
|
|
1072
|
+
return S_FALSE;
|
|
1073
|
+
|
|
1074
|
+
// (Extents.Back().IsEmpty() == true)
|
|
1075
|
+
UInt64 numClusters = 0;
|
|
1076
|
+
for (unsigned k = 1; k < Extents.Size(); k++)
|
|
1077
|
+
{
|
|
1078
|
+
const CExtent &e = Extents[k - 1];
|
|
1079
|
+
const UInt64 next = Extents[k].Virt;
|
|
1080
|
+
if (next <= e.Virt)
|
|
1081
|
+
return E_FAIL;
|
|
1082
|
+
if (!e.IsEmpty())
|
|
1083
|
+
numClusters += next - e.Virt;
|
|
1084
|
+
PRINT_UI64_2("\nVCN", e.Virt)
|
|
1085
|
+
PRINT_UI64_2(" Size", next - e.Virt)
|
|
1086
|
+
PRINT_UI64_2(" Pos", e.Phy)
|
|
1087
|
+
}
|
|
1088
|
+
const UInt64 packSizeCalc = numClusters << clusterSizeLog;
|
|
1089
|
+
if ((packSizeCalc >> clusterSizeLog) != numClusters) // optional
|
|
1090
|
+
return S_FALSE;
|
|
1091
|
+
if (attr0.CompressionUnit != 0)
|
|
1092
|
+
{
|
|
1093
|
+
if (packSizeCalc != attr0.PackSize)
|
|
1094
|
+
return S_FALSE;
|
|
1095
|
+
}
|
|
1096
|
+
else
|
|
1097
|
+
{
|
|
1098
|
+
if (packSizeCalc != attr0.AllocatedSize)
|
|
1099
|
+
return S_FALSE;
|
|
1100
|
+
}
|
|
1101
|
+
return S_OK;
|
|
1102
|
+
}
|
|
1103
|
+
|
|
1104
|
+
|
|
1105
|
+
struct CVolumeInfo
|
|
1106
|
+
{
|
|
1107
|
+
UString2 VolName;
|
|
1108
|
+
int FsVerMajor; // -1 if not defined
|
|
1109
|
+
Byte FsVerMinor;
|
|
1110
|
+
CVolumeInfo(): FsVerMajor(-1) /* , Minor(-1) */ {}
|
|
1111
|
+
void Clear()
|
|
1112
|
+
{
|
|
1113
|
+
FsVerMajor = -1;
|
|
1114
|
+
if (!VolName.IsEmpty())
|
|
1115
|
+
VolName.SetFromAscii("");
|
|
1116
|
+
}
|
|
1117
|
+
};
|
|
1118
|
+
|
|
1119
|
+
|
|
1120
|
+
static const UInt32 kMagic_FILE = 0x454C4946;
|
|
1121
|
+
static const UInt32 kMagic_BAAD = 0x44414142;
|
|
1122
|
+
// 22.02: we support some rare case magic values:
|
|
1123
|
+
static const UInt32 kMagic_INDX = 0x58444e49;
|
|
1124
|
+
static const UInt32 kMagic_HOLE = 0x454c4f48;
|
|
1125
|
+
static const UInt32 kMagic_RSTR = 0x52545352;
|
|
1126
|
+
static const UInt32 kMagic_RCRD = 0x44524352;
|
|
1127
|
+
static const UInt32 kMagic_CHKD = 0x444b4843;
|
|
1128
|
+
static const UInt32 kMagic_FFFFFFFF = 0xFFFFFFFF;
|
|
1129
|
+
|
|
1130
|
+
|
|
1131
|
+
struct CMftRec
|
|
1132
|
+
{
|
|
1133
|
+
UInt32 Magic;
|
|
1134
|
+
// UInt64 Lsn;
|
|
1135
|
+
UInt16 SeqNumber; // Number of times this MFT record has been reused
|
|
1136
|
+
UInt16 Flags;
|
|
1137
|
+
// UInt16 LinkCount;
|
|
1138
|
+
// UInt16 NextAttrInstance;
|
|
1139
|
+
CMftRef BaseMftRef;
|
|
1140
|
+
|
|
1141
|
+
unsigned MyNumNameLinks;
|
|
1142
|
+
int MyItemIndex; // index in Items[] of main item for that record, or -1 if there is no item for that record
|
|
1143
|
+
int ReparseDataIndex;
|
|
1144
|
+
|
|
1145
|
+
CObjectVector<CAttr> DataAttrs; // will be sorted by CAttr::Name and CAttr::LowVcn
|
|
1146
|
+
CObjectVector<CFileNameAttr> FileNames;
|
|
1147
|
+
/* usually there is one FileName per CMftRec record,
|
|
1148
|
+
but there are additional names for Hard links or for DosName. */
|
|
1149
|
+
// CAttr SecurityAttr;
|
|
1150
|
+
CSiAttr SiAttr;
|
|
1151
|
+
|
|
1152
|
+
int FindWin32Name_for_DosName(unsigned dosNameIndex) const
|
|
1153
|
+
{
|
|
1154
|
+
const CFileNameAttr &cur = FileNames[dosNameIndex];
|
|
1155
|
+
if (cur.IsDos())
|
|
1156
|
+
FOR_VECTOR (i, FileNames)
|
|
1157
|
+
{
|
|
1158
|
+
const CFileNameAttr &next = FileNames[i];
|
|
1159
|
+
if (next.IsWin32() && cur.ParentDirRef.Val == next.ParentDirRef.Val)
|
|
1160
|
+
return (int)i;
|
|
1161
|
+
}
|
|
1162
|
+
return -1;
|
|
1163
|
+
}
|
|
1164
|
+
|
|
1165
|
+
int FindDosName(unsigned nameIndex) const
|
|
1166
|
+
{
|
|
1167
|
+
const CFileNameAttr &cur = FileNames[nameIndex];
|
|
1168
|
+
if (cur.IsWin32())
|
|
1169
|
+
FOR_VECTOR (i, FileNames)
|
|
1170
|
+
{
|
|
1171
|
+
const CFileNameAttr &next = FileNames[i];
|
|
1172
|
+
if (next.IsDos() && cur.ParentDirRef.Val == next.ParentDirRef.Val)
|
|
1173
|
+
return (int)i;
|
|
1174
|
+
}
|
|
1175
|
+
return -1;
|
|
1176
|
+
}
|
|
1177
|
+
|
|
1178
|
+
/*
|
|
1179
|
+
bool IsAltStream(int dataIndex) const
|
|
1180
|
+
{
|
|
1181
|
+
return dataIndex >= 0 && (
|
|
1182
|
+
(IsDir() ||
|
|
1183
|
+
!DataAttrs[dataIndex].Name.IsEmpty()));
|
|
1184
|
+
}
|
|
1185
|
+
*/
|
|
1186
|
+
void MoveAttrsFrom(CMftRec &src)
|
|
1187
|
+
{
|
|
1188
|
+
DataAttrs += src.DataAttrs;
|
|
1189
|
+
FileNames += src.FileNames;
|
|
1190
|
+
src.DataAttrs.ClearAndFree();
|
|
1191
|
+
src.FileNames.ClearAndFree();
|
|
1192
|
+
}
|
|
1193
|
+
|
|
1194
|
+
UInt64 GetPackSize() const
|
|
1195
|
+
{
|
|
1196
|
+
UInt64 res = 0;
|
|
1197
|
+
for (unsigned i = 0; i < DataAttrs.Size();)
|
|
1198
|
+
{
|
|
1199
|
+
const CAttr &attr = DataAttrs[i];
|
|
1200
|
+
res += attr.GetPackSize();
|
|
1201
|
+
i = attr.NextAttrIndex;
|
|
1202
|
+
}
|
|
1203
|
+
return res;
|
|
1204
|
+
}
|
|
1205
|
+
|
|
1206
|
+
bool ParseRec(Byte *p, unsigned sectorSizeLog, unsigned numSectors, unsigned recNumber,
|
|
1207
|
+
CObjectVector<CByteBuffer> &reparseDataVector, CVolumeInfo *volInfo);
|
|
1208
|
+
|
|
1209
|
+
bool Is_Magic_Empty() const
|
|
1210
|
+
{
|
|
1211
|
+
// what exact Magic values are possible for empty and unused records?
|
|
1212
|
+
const UInt32 k_Magic_Unused_MAX = 5; // 22.02
|
|
1213
|
+
return (Magic <= k_Magic_Unused_MAX);
|
|
1214
|
+
}
|
|
1215
|
+
bool Is_Magic_FILE() const { return (Magic == kMagic_FILE); }
|
|
1216
|
+
// bool Is_Magic_BAAD() const { return (Magic == kMagic_BAAD); }
|
|
1217
|
+
bool Is_Magic_CanIgnore() const
|
|
1218
|
+
{
|
|
1219
|
+
return Is_Magic_Empty()
|
|
1220
|
+
|| Magic == kMagic_BAAD
|
|
1221
|
+
|| Magic == kMagic_INDX
|
|
1222
|
+
|| Magic == kMagic_HOLE
|
|
1223
|
+
|| Magic == kMagic_RSTR
|
|
1224
|
+
|| Magic == kMagic_RCRD
|
|
1225
|
+
|| Magic == kMagic_CHKD
|
|
1226
|
+
|| Magic == kMagic_FFFFFFFF;
|
|
1227
|
+
}
|
|
1228
|
+
|
|
1229
|
+
bool InUse() const { return (Flags & 1) != 0; }
|
|
1230
|
+
bool IsDir() const { return (Flags & 2) != 0; }
|
|
1231
|
+
|
|
1232
|
+
void ParseDataNames();
|
|
1233
|
+
HRESULT GetStream(IInStream *mainStream, int dataIndex,
|
|
1234
|
+
unsigned clusterSizeLog, UInt64 numPhysClusters, IInStream **stream,
|
|
1235
|
+
CMyComPtr2<IInStream, CInStream> *inStream_Object = NULL) const;
|
|
1236
|
+
unsigned GetNumExtents(int dataIndex, unsigned clusterSizeLog, UInt64 numPhysClusters) const;
|
|
1237
|
+
|
|
1238
|
+
UInt64 GetSize(unsigned dataIndex) const { return DataAttrs[dataIndex].GetSize(); }
|
|
1239
|
+
|
|
1240
|
+
CMftRec():
|
|
1241
|
+
SeqNumber(0),
|
|
1242
|
+
Flags(0),
|
|
1243
|
+
MyNumNameLinks(0),
|
|
1244
|
+
MyItemIndex(-1),
|
|
1245
|
+
ReparseDataIndex(-1) {}
|
|
1246
|
+
};
|
|
1247
|
+
|
|
1248
|
+
|
|
1249
|
+
void CMftRec::ParseDataNames()
|
|
1250
|
+
{
|
|
1251
|
+
DataAttrs.Sort(CompareAttr, NULL);
|
|
1252
|
+
for (unsigned i = 0; i < DataAttrs.Size();)
|
|
1253
|
+
{
|
|
1254
|
+
CAttr &attr = DataAttrs[i];
|
|
1255
|
+
for (i++; i < DataAttrs.Size(); i++)
|
|
1256
|
+
if (attr.Name != DataAttrs[i].Name)
|
|
1257
|
+
break;
|
|
1258
|
+
attr.NextAttrIndex = i;
|
|
1259
|
+
}
|
|
1260
|
+
}
|
|
1261
|
+
|
|
1262
|
+
HRESULT CMftRec::GetStream(IInStream *mainStream, const int dataIndex,
|
|
1263
|
+
const unsigned clusterSizeLog, const UInt64 numPhysClusters,
|
|
1264
|
+
IInStream **destStream,
|
|
1265
|
+
CMyComPtr2<IInStream, CInStream> *inStream_Object) const
|
|
1266
|
+
{
|
|
1267
|
+
*destStream = NULL;
|
|
1268
|
+
CBufferInStream *streamSpec = new CBufferInStream;
|
|
1269
|
+
CMyComPtr<IInStream> streamTemp = streamSpec;
|
|
1270
|
+
|
|
1271
|
+
if (dataIndex >= 0 /* (unsigned)dataIndex < GetNumDataRefs() */)
|
|
1272
|
+
{
|
|
1273
|
+
const CAttr &attr0 = DataAttrs[dataIndex];
|
|
1274
|
+
unsigned numNonResident = 0;
|
|
1275
|
+
for (unsigned i = (unsigned)dataIndex; i < attr0.NextAttrIndex; i++)
|
|
1276
|
+
if (DataAttrs[i].NonResident)
|
|
1277
|
+
numNonResident++;
|
|
1278
|
+
const unsigned refNum = attr0.NextAttrIndex - (unsigned)dataIndex;
|
|
1279
|
+
if (numNonResident != 0 || refNum != 1)
|
|
1280
|
+
{
|
|
1281
|
+
if (numNonResident != refNum || !attr0.IsCompressionUnitSupported())
|
|
1282
|
+
return S_FALSE;
|
|
1283
|
+
if (clusterSizeLog > 12 && attr0.CompressionUnit)
|
|
1284
|
+
return S_FALSE; // NOT SUPPORTED
|
|
1285
|
+
CInStream *ss;
|
|
1286
|
+
if (inStream_Object)
|
|
1287
|
+
{
|
|
1288
|
+
inStream_Object->Create_if_Empty();
|
|
1289
|
+
ss = inStream_Object->ClsPtr();
|
|
1290
|
+
ss->Clear(); // we clear Extents[] filled for previous file.
|
|
1291
|
+
}
|
|
1292
|
+
else
|
|
1293
|
+
ss = new CInStream;
|
|
1294
|
+
CMyComPtr<IInStream> streamTemp2 = ss;
|
|
1295
|
+
RINOK(DataParseExtents(clusterSizeLog, DataAttrs,
|
|
1296
|
+
(unsigned)dataIndex, numPhysClusters, ss->Extents))
|
|
1297
|
+
ss->Size = attr0.Size;
|
|
1298
|
+
ss->InitializedSize = attr0.InitializedSize;
|
|
1299
|
+
ss->Stream = mainStream;
|
|
1300
|
+
ss->BlockSizeLog = clusterSizeLog;
|
|
1301
|
+
ss->InUse = InUse();
|
|
1302
|
+
RINOK(ss->InitAndSeek(attr0.CompressionUnit))
|
|
1303
|
+
*destStream = streamTemp2.Detach();
|
|
1304
|
+
return S_OK;
|
|
1305
|
+
}
|
|
1306
|
+
|
|
1307
|
+
streamSpec->Buf = attr0.Data;
|
|
1308
|
+
}
|
|
1309
|
+
|
|
1310
|
+
streamSpec->Init();
|
|
1311
|
+
*destStream = streamTemp.Detach();
|
|
1312
|
+
return S_OK;
|
|
1313
|
+
}
|
|
1314
|
+
|
|
1315
|
+
unsigned CMftRec::GetNumExtents(const int dataIndex,
|
|
1316
|
+
const unsigned clusterSizeLog, const UInt64 numPhysClusters) const
|
|
1317
|
+
{
|
|
1318
|
+
if (dataIndex < 0)
|
|
1319
|
+
return 0;
|
|
1320
|
+
{
|
|
1321
|
+
const CAttr &attr0 = DataAttrs[dataIndex];
|
|
1322
|
+
unsigned numNonResident = 0;
|
|
1323
|
+
for (unsigned i = (unsigned)dataIndex; i < attr0.NextAttrIndex; i++)
|
|
1324
|
+
if (DataAttrs[i].NonResident)
|
|
1325
|
+
numNonResident++;
|
|
1326
|
+
const unsigned refNum = attr0.NextAttrIndex - (unsigned)dataIndex;
|
|
1327
|
+
if (numNonResident != 0 || refNum != 1)
|
|
1328
|
+
{
|
|
1329
|
+
if (numNonResident != refNum || !attr0.IsCompressionUnitSupported())
|
|
1330
|
+
return 0; // error;
|
|
1331
|
+
if (clusterSizeLog > 12 && attr0.CompressionUnit)
|
|
1332
|
+
return 0; // error;
|
|
1333
|
+
CRecordVector<CExtent> extents;
|
|
1334
|
+
if (DataParseExtents(clusterSizeLog, DataAttrs, (unsigned)dataIndex,
|
|
1335
|
+
numPhysClusters, extents) != S_OK)
|
|
1336
|
+
return 0; // error;
|
|
1337
|
+
return extents.Size() - 1;
|
|
1338
|
+
}
|
|
1339
|
+
// if (attr0.Data.Size() != 0) return 1;
|
|
1340
|
+
return 0;
|
|
1341
|
+
}
|
|
1342
|
+
}
|
|
1343
|
+
|
|
1344
|
+
|
|
1345
|
+
bool CMftRec::ParseRec(Byte * const p, const unsigned sectorSizeLog,
|
|
1346
|
+
const unsigned numSectors, const unsigned recNumber,
|
|
1347
|
+
CObjectVector<CByteBuffer> &reparseDataVector, CVolumeInfo *volInfo)
|
|
1348
|
+
{
|
|
1349
|
+
G32(p, Magic);
|
|
1350
|
+
if (!Is_Magic_FILE())
|
|
1351
|
+
return Is_Magic_CanIgnore();
|
|
1352
|
+
{
|
|
1353
|
+
UInt32 usaOffset, numUsaItems;
|
|
1354
|
+
G16(p + 0x04, usaOffset);
|
|
1355
|
+
G16(p + 0x06, numUsaItems);
|
|
1356
|
+
/* NTFS stores (usn) to 2 last bytes in each sector (before writing record to disk).
|
|
1357
|
+
Original values of these two bytes are stored in table.
|
|
1358
|
+
So we restore original data from table */
|
|
1359
|
+
if ((usaOffset & 1)
|
|
1360
|
+
|| usaOffset + numUsaItems * 2 > (1u << sectorSizeLog) - 2
|
|
1361
|
+
|| numUsaItems - 1 != numSectors)
|
|
1362
|
+
return false;
|
|
1363
|
+
if (usaOffset >= 0x30) // NTFS 3.1+
|
|
1364
|
+
{
|
|
1365
|
+
const UInt32 iii = Get32(p + 0x2C);
|
|
1366
|
+
if (iii != recNumber)
|
|
1367
|
+
{
|
|
1368
|
+
// ntfs-3g probably writes 0 (that probably is incorrect value) to this field for unused records.
|
|
1369
|
+
// so we support that "bad" case.
|
|
1370
|
+
if (iii != 0)
|
|
1371
|
+
return false;
|
|
1372
|
+
}
|
|
1373
|
+
}
|
|
1374
|
+
const UInt16 usn = Get16(p + usaOffset);
|
|
1375
|
+
// PRF(printf("\nusn = %d", usn));
|
|
1376
|
+
for (UInt32 i = 1; i < numUsaItems; i++)
|
|
1377
|
+
{
|
|
1378
|
+
void *pp = p + ((size_t)i << sectorSizeLog) - 2;
|
|
1379
|
+
if (Get16(pp) != usn)
|
|
1380
|
+
return false;
|
|
1381
|
+
SetUi16a(pp, Get16(p + usaOffset + i * 2))
|
|
1382
|
+
}
|
|
1383
|
+
}
|
|
1384
|
+
|
|
1385
|
+
// G64(p + 0x08, Lsn);
|
|
1386
|
+
G16(p + 0x10, SeqNumber);
|
|
1387
|
+
// G16(p + 0x12, LinkCount);
|
|
1388
|
+
// PRF(printf(" L=%d", LinkCount));
|
|
1389
|
+
const unsigned attrOffs = Get16(p + 0x14);
|
|
1390
|
+
G16(p + 0x16, Flags);
|
|
1391
|
+
PRF(printf(" F=%4X", Flags));
|
|
1392
|
+
const UInt32 bytesInUse = Get32(p + 0x18);
|
|
1393
|
+
const UInt32 bytesAlloc = Get32(p + 0x1C);
|
|
1394
|
+
G64(p + 0x20, BaseMftRef.Val);
|
|
1395
|
+
if (BaseMftRef.Val != 0)
|
|
1396
|
+
{
|
|
1397
|
+
PRINT_UI64(" BaseRef", BaseMftRef.Val)
|
|
1398
|
+
}
|
|
1399
|
+
// G16(p + 0x28, NextAttrInstance);
|
|
1400
|
+
unsigned limit = numSectors << sectorSizeLog;
|
|
1401
|
+
if (attrOffs >= limit
|
|
1402
|
+
|| (attrOffs & 7)
|
|
1403
|
+
|| (bytesInUse & 7)
|
|
1404
|
+
|| bytesInUse > limit
|
|
1405
|
+
|| bytesAlloc != limit)
|
|
1406
|
+
return false;
|
|
1407
|
+
limit = bytesInUse;
|
|
1408
|
+
|
|
1409
|
+
for (unsigned t = attrOffs;;)
|
|
1410
|
+
{
|
|
1411
|
+
if (t >= limit)
|
|
1412
|
+
return false;
|
|
1413
|
+
// PRF(printf("\n %2d:", Attrs.Size()));
|
|
1414
|
+
PRF(printf("\n"));
|
|
1415
|
+
CAttr attr;
|
|
1416
|
+
UInt32 type;
|
|
1417
|
+
const UInt32 len = attr.ParseAttr(p + t, limit - t, type);
|
|
1418
|
+
if (len == 0 || limit - t < len)
|
|
1419
|
+
return false;
|
|
1420
|
+
t += len;
|
|
1421
|
+
if (type == 0xFFFFFFFF)
|
|
1422
|
+
{
|
|
1423
|
+
if (t != limit)
|
|
1424
|
+
return false;
|
|
1425
|
+
break;
|
|
1426
|
+
}
|
|
1427
|
+
switch (type)
|
|
1428
|
+
{
|
|
1429
|
+
case ATTR_TYPE_FILE_NAME:
|
|
1430
|
+
{
|
|
1431
|
+
CFileNameAttr fna;
|
|
1432
|
+
if (attr.NonResident != 0 || !attr.ParseFileName(fna))
|
|
1433
|
+
return false;
|
|
1434
|
+
FileNames.Add(fna);
|
|
1435
|
+
PRF(printf(" \n NameType = %1u: ", (unsigned)fna.NameType));
|
|
1436
|
+
PRF_UTF16(fna.Name)
|
|
1437
|
+
break;
|
|
1438
|
+
}
|
|
1439
|
+
case ATTR_TYPE_STANDARD_INFO:
|
|
1440
|
+
if (attr.NonResident != 0 || !attr.ParseSi(SiAttr))
|
|
1441
|
+
return false;
|
|
1442
|
+
break;
|
|
1443
|
+
case ATTR_TYPE_DATA:
|
|
1444
|
+
DataAttrs.Add(attr);
|
|
1445
|
+
break;
|
|
1446
|
+
case ATTR_TYPE_REPARSE_POINT:
|
|
1447
|
+
// if (attr.NonResident != 0) we must read NonResident data from disk
|
|
1448
|
+
if (attr.NonResident == 0)
|
|
1449
|
+
if (ReparseDataIndex < 0)
|
|
1450
|
+
ReparseDataIndex = (int)reparseDataVector.Add(attr.Data);
|
|
1451
|
+
break;
|
|
1452
|
+
/*
|
|
1453
|
+
case ATTR_TYPE_SECURITY_DESCRIPTOR:
|
|
1454
|
+
SecurityAttr = attr;
|
|
1455
|
+
break;
|
|
1456
|
+
*/
|
|
1457
|
+
default:
|
|
1458
|
+
// if (attrs) attrs->Add(attr);
|
|
1459
|
+
if (volInfo && attr.NonResident == 0)
|
|
1460
|
+
{
|
|
1461
|
+
if (type == ATTR_TYPE_VOLUME_NAME && volInfo->VolName.IsEmpty())
|
|
1462
|
+
GetString(attr.Data, (unsigned)attr.Data.Size() / 2, volInfo->VolName);
|
|
1463
|
+
else if (type == ATTR_TYPE_VOLUME_INFO && attr.Data.Size() >= 12 /* && volInfo->FsVerMajor < 0 */)
|
|
1464
|
+
{
|
|
1465
|
+
volInfo->FsVerMajor = attr.Data[8];
|
|
1466
|
+
volInfo->FsVerMinor = attr.Data[9];
|
|
1467
|
+
// volInfo->Flags = Get16(attr.Data + 10);
|
|
1468
|
+
}
|
|
1469
|
+
}
|
|
1470
|
+
break;
|
|
1471
|
+
}
|
|
1472
|
+
}
|
|
1473
|
+
|
|
1474
|
+
return true;
|
|
1475
|
+
}
|
|
1476
|
+
|
|
1477
|
+
/*
|
|
1478
|
+
NTFS probably creates empty DATA_ATTRIBUTE for empty file,
|
|
1479
|
+
But it doesn't do it for
|
|
1480
|
+
$Secure (:$SDS),
|
|
1481
|
+
$Extend\$Quota
|
|
1482
|
+
$Extend\$ObjId
|
|
1483
|
+
$Extend\$Reparse
|
|
1484
|
+
*/
|
|
1485
|
+
|
|
1486
|
+
static const int k_Item_DataIndex_IsEmptyFile = -1; // file without unnamed data stream
|
|
1487
|
+
static const int k_Item_DataIndex_IsDir = -2;
|
|
1488
|
+
|
|
1489
|
+
// static const int k_ParentFolderIndex_Root = -1;
|
|
1490
|
+
static const int k_ParentFolderIndex_Lost = -2;
|
|
1491
|
+
static const int k_ParentFolderIndex_Deleted = -3;
|
|
1492
|
+
|
|
1493
|
+
struct CItem
|
|
1494
|
+
{
|
|
1495
|
+
unsigned RecIndex; // index in Recs[]
|
|
1496
|
+
unsigned NameIndex; // index in CMftRec::FileNames[] : name of file (is not name of alt stream)
|
|
1497
|
+
|
|
1498
|
+
int DataIndex; /* index in CMftRec::Attrs[] for main files and alt streams.
|
|
1499
|
+
-1: file without unnamed data stream
|
|
1500
|
+
-2: for directories */
|
|
1501
|
+
|
|
1502
|
+
int ParentFolder; /* index in Items[]
|
|
1503
|
+
-1: for root items
|
|
1504
|
+
-2: [LOST] folder
|
|
1505
|
+
-3: [UNKNOWN] folder (deleted lost) */
|
|
1506
|
+
int ParentHost; /* index in Items[] array of item that main file for alt stream, if it's AltStream
|
|
1507
|
+
-1: if it's not AltStream */
|
|
1508
|
+
|
|
1509
|
+
/* RecIndex, NameIndex, ParentFolder : are identical for main file and alt substreams of that main files
|
|
1510
|
+
DataIndex, ParentHost : are different for main file and alt substreams of that main files. */
|
|
1511
|
+
|
|
1512
|
+
void Construct()
|
|
1513
|
+
{
|
|
1514
|
+
DataIndex = k_Item_DataIndex_IsDir;
|
|
1515
|
+
ParentFolder = -1;
|
|
1516
|
+
ParentHost = -1;
|
|
1517
|
+
}
|
|
1518
|
+
|
|
1519
|
+
bool IsAltStream() const { return ParentHost != -1; }
|
|
1520
|
+
bool IsDir() const { return DataIndex == k_Item_DataIndex_IsDir; }
|
|
1521
|
+
// check it !!!
|
|
1522
|
+
// probably NTFS for empty file still creates empty DATA_ATTRIBUTE
|
|
1523
|
+
// But it doesn't do it for $Secure:$SDS
|
|
1524
|
+
};
|
|
1525
|
+
|
|
1526
|
+
|
|
1527
|
+
struct CDatabase
|
|
1528
|
+
{
|
|
1529
|
+
CRecordVector<CItem> Items;
|
|
1530
|
+
CObjectVector<CMftRec> Recs;
|
|
1531
|
+
CHeader Header;
|
|
1532
|
+
UInt64 PhySize;
|
|
1533
|
+
|
|
1534
|
+
// bool _headerWarning;
|
|
1535
|
+
bool ThereAreAltStreams;
|
|
1536
|
+
bool _showSystemFiles;
|
|
1537
|
+
bool _showDeletedFiles;
|
|
1538
|
+
|
|
1539
|
+
int _systemFolderIndex;
|
|
1540
|
+
int _lostFolderIndex_Normal;
|
|
1541
|
+
int _lostFolderIndex_Deleted;
|
|
1542
|
+
|
|
1543
|
+
CMyComPtr<IInStream> InStream;
|
|
1544
|
+
IArchiveOpenCallback *OpenCallback;
|
|
1545
|
+
CAlignedBuffer ByteBuf;
|
|
1546
|
+
|
|
1547
|
+
CObjectVector<CByteBuffer> ReparseDataVector;
|
|
1548
|
+
|
|
1549
|
+
CByteBuffer SecurData;
|
|
1550
|
+
CRecordVector<UInt32> SecurOffsets;
|
|
1551
|
+
CRecordVector<UInt32> SecurIds; // sorted
|
|
1552
|
+
|
|
1553
|
+
CVolumeInfo VolumeInfo;
|
|
1554
|
+
CObjectVector<UString2> VirtFolderNames;
|
|
1555
|
+
UString2 EmptyString;
|
|
1556
|
+
|
|
1557
|
+
void InitProps()
|
|
1558
|
+
{
|
|
1559
|
+
_showSystemFiles = true;
|
|
1560
|
+
// we show SystemFiles by default since it's difficult to track $Extend\* system files
|
|
1561
|
+
// it must be fixed later
|
|
1562
|
+
_showDeletedFiles = false;
|
|
1563
|
+
}
|
|
1564
|
+
|
|
1565
|
+
CDatabase(): EmptyString(L"") { InitProps(); }
|
|
1566
|
+
// ~CDatabase() { ClearAndClose(); }
|
|
1567
|
+
|
|
1568
|
+
void ClearSecurInfo()
|
|
1569
|
+
{
|
|
1570
|
+
SecurIds.Clear();
|
|
1571
|
+
SecurOffsets.Clear();
|
|
1572
|
+
SecurData.Free();
|
|
1573
|
+
}
|
|
1574
|
+
void Clear();
|
|
1575
|
+
void ClearAndClose();
|
|
1576
|
+
|
|
1577
|
+
void GetItemPath(unsigned index, NCOM::CPropVariant &path) const;
|
|
1578
|
+
HRESULT Open();
|
|
1579
|
+
|
|
1580
|
+
HRESULT SeekToCluster(UInt64 cluster);
|
|
1581
|
+
|
|
1582
|
+
int Find_DirItem_For_MftRec(UInt64 recIndex) const
|
|
1583
|
+
{
|
|
1584
|
+
if (recIndex >= Recs.Size())
|
|
1585
|
+
return -1;
|
|
1586
|
+
const CMftRec &rec = Recs[(unsigned)recIndex];
|
|
1587
|
+
if (!rec.IsDir())
|
|
1588
|
+
return -1;
|
|
1589
|
+
return rec.MyItemIndex;
|
|
1590
|
+
/*
|
|
1591
|
+
unsigned left = 0, right = Items.Size();
|
|
1592
|
+
while (left != right)
|
|
1593
|
+
{
|
|
1594
|
+
unsigned mid = (left + right) / 2;
|
|
1595
|
+
const CItem &item = Items[mid];
|
|
1596
|
+
UInt64 midValue = item.RecIndex;
|
|
1597
|
+
if (recIndex == midValue)
|
|
1598
|
+
{
|
|
1599
|
+
// if item is not dir (file or alt stream we don't return it)
|
|
1600
|
+
// if (item.DataIndex < 0)
|
|
1601
|
+
if (item.IsDir())
|
|
1602
|
+
return mid;
|
|
1603
|
+
right = mid;
|
|
1604
|
+
}
|
|
1605
|
+
else if (recIndex < midValue)
|
|
1606
|
+
right = mid;
|
|
1607
|
+
else
|
|
1608
|
+
left = mid + 1;
|
|
1609
|
+
}
|
|
1610
|
+
return -1;
|
|
1611
|
+
*/
|
|
1612
|
+
}
|
|
1613
|
+
|
|
1614
|
+
bool ParseSecuritySDS(ISequentialInStream *stream, const size_t size);
|
|
1615
|
+
};
|
|
1616
|
+
|
|
1617
|
+
HRESULT CDatabase::SeekToCluster(UInt64 cluster)
|
|
1618
|
+
{
|
|
1619
|
+
return InStream_SeekSet(InStream, cluster << Header.ClusterSizeLog);
|
|
1620
|
+
}
|
|
1621
|
+
|
|
1622
|
+
void CDatabase::Clear()
|
|
1623
|
+
{
|
|
1624
|
+
Items.Clear();
|
|
1625
|
+
Recs.Clear();
|
|
1626
|
+
ClearSecurInfo();
|
|
1627
|
+
VirtFolderNames.Clear();
|
|
1628
|
+
_systemFolderIndex = -1;
|
|
1629
|
+
_lostFolderIndex_Normal = -1;
|
|
1630
|
+
_lostFolderIndex_Deleted = -1;
|
|
1631
|
+
ThereAreAltStreams = false;
|
|
1632
|
+
// _headerWarning = false;
|
|
1633
|
+
VolumeInfo.Clear();
|
|
1634
|
+
ReparseDataVector.Clear();
|
|
1635
|
+
PhySize = 0;
|
|
1636
|
+
}
|
|
1637
|
+
|
|
1638
|
+
void CDatabase::ClearAndClose()
|
|
1639
|
+
{
|
|
1640
|
+
Clear();
|
|
1641
|
+
InStream.Release();
|
|
1642
|
+
}
|
|
1643
|
+
|
|
1644
|
+
|
|
1645
|
+
// src[0 ... num-1] != 0
|
|
1646
|
+
// it doesn't write NUL to dest[num]
|
|
1647
|
+
static void CopyName(wchar_t *dest, const wchar_t *src, unsigned num)
|
|
1648
|
+
{
|
|
1649
|
+
if (num) do
|
|
1650
|
+
{
|
|
1651
|
+
wchar_t c = *src++;
|
|
1652
|
+
// 18.06
|
|
1653
|
+
if (c == '\\' || c == '/')
|
|
1654
|
+
c = '_';
|
|
1655
|
+
*dest++ = c;
|
|
1656
|
+
}
|
|
1657
|
+
while (--num);
|
|
1658
|
+
}
|
|
1659
|
+
|
|
1660
|
+
#define kLongPath "[LONG_PATH]" STRING_PATH_SEPARATOR "[LONG_PATH_ITEM]"
|
|
1661
|
+
|
|
1662
|
+
void CDatabase::GetItemPath(const unsigned index, NCOM::CPropVariant &path) const
|
|
1663
|
+
{
|
|
1664
|
+
const CItem *item = &Items[index];
|
|
1665
|
+
const UString2 *altName = NULL;
|
|
1666
|
+
unsigned size = 0;
|
|
1667
|
+
if (item->IsAltStream())
|
|
1668
|
+
{
|
|
1669
|
+
const CMftRec &rec = Recs[item->RecIndex];
|
|
1670
|
+
altName = &rec.DataAttrs[item->DataIndex].Name;
|
|
1671
|
+
size = altName->Len() + 1;
|
|
1672
|
+
if (item->RecIndex == kRecIndex_RootDir)
|
|
1673
|
+
{
|
|
1674
|
+
// we don't show main name from kRecIndex_RootDir record for root alt streams:
|
|
1675
|
+
wchar_t *s = path.AllocBstr(size);
|
|
1676
|
+
s[0] = L':';
|
|
1677
|
+
CopyName(s + 1, altName->GetRawPtr(), altName->Len());
|
|
1678
|
+
return;
|
|
1679
|
+
}
|
|
1680
|
+
}
|
|
1681
|
+
|
|
1682
|
+
for (unsigned i = 0;; i++)
|
|
1683
|
+
{
|
|
1684
|
+
size += Recs[item->RecIndex].FileNames[item->NameIndex].Name.Len();
|
|
1685
|
+
if (i > 256 || size >= 1u << 15)
|
|
1686
|
+
{
|
|
1687
|
+
path = kLongPath;
|
|
1688
|
+
return;
|
|
1689
|
+
}
|
|
1690
|
+
if (item->RecIndex == kRecIndex_RootDir)
|
|
1691
|
+
break;
|
|
1692
|
+
const wchar_t *serv;
|
|
1693
|
+
if (item->RecIndex < kNumSysRecs)
|
|
1694
|
+
serv = kVirtualFolder_System;
|
|
1695
|
+
else
|
|
1696
|
+
{
|
|
1697
|
+
const int index2 = item->ParentFolder;
|
|
1698
|
+
if (index2 >= 0)
|
|
1699
|
+
{
|
|
1700
|
+
item = &Items[index2];
|
|
1701
|
+
size++;
|
|
1702
|
+
continue;
|
|
1703
|
+
}
|
|
1704
|
+
if (index2 == -1)
|
|
1705
|
+
break;
|
|
1706
|
+
serv = (index2 == k_ParentFolderIndex_Lost) ?
|
|
1707
|
+
kVirtualFolder_Lost_Normal :
|
|
1708
|
+
kVirtualFolder_Lost_Deleted;
|
|
1709
|
+
}
|
|
1710
|
+
size += MyStringLen(serv) + 1;
|
|
1711
|
+
break;
|
|
1712
|
+
}
|
|
1713
|
+
|
|
1714
|
+
wchar_t *s = path.AllocBstr(size);
|
|
1715
|
+
|
|
1716
|
+
if (altName)
|
|
1717
|
+
{
|
|
1718
|
+
const unsigned len = altName->Len();
|
|
1719
|
+
size -= len;
|
|
1720
|
+
CopyName(s + size, altName->GetRawPtr(), len);
|
|
1721
|
+
s[--size] = ':';
|
|
1722
|
+
}
|
|
1723
|
+
|
|
1724
|
+
item = &Items[index];
|
|
1725
|
+
for (;;)
|
|
1726
|
+
{
|
|
1727
|
+
{
|
|
1728
|
+
const UString2 &name = Recs[item->RecIndex].FileNames[item->NameIndex].Name;
|
|
1729
|
+
const unsigned len = name.Len();
|
|
1730
|
+
size -= len;
|
|
1731
|
+
CopyName(s + size, name.GetRawPtr(), len);
|
|
1732
|
+
}
|
|
1733
|
+
if (item->RecIndex == kRecIndex_RootDir)
|
|
1734
|
+
break;
|
|
1735
|
+
const wchar_t *serv;
|
|
1736
|
+
if (item->RecIndex < kNumSysRecs)
|
|
1737
|
+
serv = kVirtualFolder_System;
|
|
1738
|
+
else
|
|
1739
|
+
{
|
|
1740
|
+
const int index2 = item->ParentFolder;
|
|
1741
|
+
if (index2 >= 0)
|
|
1742
|
+
{
|
|
1743
|
+
s[--size] = WCHAR_PATH_SEPARATOR;
|
|
1744
|
+
item = &Items[index2];
|
|
1745
|
+
continue;
|
|
1746
|
+
}
|
|
1747
|
+
if (index2 == -1)
|
|
1748
|
+
break;
|
|
1749
|
+
serv = (index2 == k_ParentFolderIndex_Lost) ?
|
|
1750
|
+
kVirtualFolder_Lost_Normal :
|
|
1751
|
+
kVirtualFolder_Lost_Deleted;
|
|
1752
|
+
}
|
|
1753
|
+
s[--size] = WCHAR_PATH_SEPARATOR;
|
|
1754
|
+
// if (size != MyStringLen(serv)) throw 1;
|
|
1755
|
+
CopyName(s, serv, size);
|
|
1756
|
+
break;
|
|
1757
|
+
}
|
|
1758
|
+
}
|
|
1759
|
+
|
|
1760
|
+
|
|
1761
|
+
bool CDatabase::ParseSecuritySDS(ISequentialInStream *stream, const size_t size)
|
|
1762
|
+
{
|
|
1763
|
+
/* In most cases, identifiers (IDs) are listed sequentially with a step of 1, starting from 0x100.
|
|
1764
|
+
However, gaps in the IDs numbering are possible. So we use SecurIds[] array.
|
|
1765
|
+
The security data contains a duplicate copy every 256 KB. */
|
|
1766
|
+
const size_t kDupStep = (size_t)1 << 18; // 256 KB
|
|
1767
|
+
if (size == 0 || (size & 3))
|
|
1768
|
+
return false;
|
|
1769
|
+
if (((size - 1) & kDupStep) == 0) // we check that there is duplicate block
|
|
1770
|
+
return false;
|
|
1771
|
+
const size_t skipDupSize = ((size - 1) & ~(kDupStep * 2 - 1)) / 2;
|
|
1772
|
+
const size_t allocSize = size - skipDupSize;
|
|
1773
|
+
SecurData.Alloc(allocSize);
|
|
1774
|
+
size_t posInFile = 0;
|
|
1775
|
+
size_t destPos = 0;
|
|
1776
|
+
UInt32 idPrev = 0;
|
|
1777
|
+
SecurOffsets.Add(0);
|
|
1778
|
+
for (;;)
|
|
1779
|
+
{
|
|
1780
|
+
size_t rem = size - posInFile;
|
|
1781
|
+
if (rem == 0)
|
|
1782
|
+
break;
|
|
1783
|
+
rem = MyMin(rem, kDupStep * 2);
|
|
1784
|
+
if (destPos + rem > allocSize)
|
|
1785
|
+
return false; // internal code failure
|
|
1786
|
+
Byte * const p = SecurData + destPos;
|
|
1787
|
+
if (ReadStream_FALSE(stream, p, rem) != S_OK)
|
|
1788
|
+
return false;
|
|
1789
|
+
const size_t readSize = rem;
|
|
1790
|
+
if (rem < kDupStep)
|
|
1791
|
+
return false;
|
|
1792
|
+
rem -= kDupStep;
|
|
1793
|
+
if (memcmp(p, p + kDupStep, rem))
|
|
1794
|
+
return false;
|
|
1795
|
+
/* Garbage (non-zero) data is possible after the last entry
|
|
1796
|
+
in the main block but before the last block of duplicates.
|
|
1797
|
+
So we don't check zeros padding in last block.
|
|
1798
|
+
*/
|
|
1799
|
+
for (size_t pos = 0;;)
|
|
1800
|
+
{
|
|
1801
|
+
const unsigned kEntrySize = 20;
|
|
1802
|
+
UInt32 id;
|
|
1803
|
+
if ((pos & 0xF)
|
|
1804
|
+
|| rem < kEntrySize
|
|
1805
|
+
|| (id = Get32(p + pos + 4)) == 0)
|
|
1806
|
+
{
|
|
1807
|
+
if (rem < 4)
|
|
1808
|
+
break;
|
|
1809
|
+
// we skip zeros of padding or hole in data:
|
|
1810
|
+
if (*(const UInt32 *)(const void *)(p + pos))
|
|
1811
|
+
return false;
|
|
1812
|
+
pos += 4;
|
|
1813
|
+
rem -= 4;
|
|
1814
|
+
continue;
|
|
1815
|
+
}
|
|
1816
|
+
if (id <= idPrev)
|
|
1817
|
+
return false;
|
|
1818
|
+
idPrev = id;
|
|
1819
|
+
if (Get64(p + pos + 8) != posInFile + pos) // entry offset
|
|
1820
|
+
return false;
|
|
1821
|
+
const UInt32 entrySize = Get32(p + pos + 16);
|
|
1822
|
+
if (entrySize < kEntrySize
|
|
1823
|
+
|| (entrySize & 3)
|
|
1824
|
+
|| rem < entrySize)
|
|
1825
|
+
return false;
|
|
1826
|
+
rem -= entrySize;
|
|
1827
|
+
{
|
|
1828
|
+
const Byte *p2 = p + pos + kEntrySize;
|
|
1829
|
+
UInt32 hash = 0;
|
|
1830
|
+
unsigned num = entrySize - kEntrySize;
|
|
1831
|
+
if (num) do
|
|
1832
|
+
{
|
|
1833
|
+
hash = rotlFixed(hash, 3) + Get32(p2);
|
|
1834
|
+
p2 += 4;
|
|
1835
|
+
}
|
|
1836
|
+
while (num -= 4);
|
|
1837
|
+
if (hash != Get32(p + pos))
|
|
1838
|
+
return false;
|
|
1839
|
+
}
|
|
1840
|
+
memmove(SecurData + destPos, p + pos + kEntrySize, entrySize - kEntrySize);
|
|
1841
|
+
pos += entrySize;
|
|
1842
|
+
destPos += entrySize - kEntrySize;
|
|
1843
|
+
SecurOffsets.Add((UInt32)destPos);
|
|
1844
|
+
SecurIds.Add(id);
|
|
1845
|
+
}
|
|
1846
|
+
posInFile += readSize;
|
|
1847
|
+
}
|
|
1848
|
+
SecurData.ChangeSize_KeepData(destPos, destPos);
|
|
1849
|
+
return true;
|
|
1850
|
+
}
|
|
1851
|
+
|
|
1852
|
+
|
|
1853
|
+
HRESULT CDatabase::Open()
|
|
1854
|
+
{
|
|
1855
|
+
Clear();
|
|
1856
|
+
/* NTFS layout:
|
|
1857
|
+
1) main part (as specified by NumClusters). Only that part is available, if we open "\\.\c:"
|
|
1858
|
+
2) additional empty sectors (as specified by NumSectors)
|
|
1859
|
+
3) the copy of first sector (boot sector)
|
|
1860
|
+
We support both cases:
|
|
1861
|
+
- the file with only main part
|
|
1862
|
+
- full file (as raw data on partition), including the copy
|
|
1863
|
+
of first sector (boot sector) at the end of data
|
|
1864
|
+
We don't support the case, when only the copy of boot sector
|
|
1865
|
+
at the end was detected as NTFS signature.
|
|
1866
|
+
*/
|
|
1867
|
+
const size_t kBufSize = (size_t)1 << MyMax(15, k_MftRecordSizeLog_MAX);
|
|
1868
|
+
ByteBuf.Alloc(kBufSize);
|
|
1869
|
+
if (!ByteBuf.IsAllocated())
|
|
1870
|
+
return E_OUTOFMEMORY;
|
|
1871
|
+
{
|
|
1872
|
+
const unsigned kHeaderSize = 512;
|
|
1873
|
+
RINOK(ReadStream_FALSE(InStream, ByteBuf, kHeaderSize))
|
|
1874
|
+
if (!Header.Parse(ByteBuf))
|
|
1875
|
+
return S_FALSE;
|
|
1876
|
+
|
|
1877
|
+
UInt64 fileSize;
|
|
1878
|
+
RINOK(InStream_GetSize_SeekToEnd(InStream, fileSize))
|
|
1879
|
+
PhySize = Header.GetPhySize_Clusters();
|
|
1880
|
+
if (fileSize < PhySize)
|
|
1881
|
+
return S_FALSE;
|
|
1882
|
+
|
|
1883
|
+
const UInt64 phySizeMax = Header.GetPhySize_Max();
|
|
1884
|
+
if (fileSize >= phySizeMax)
|
|
1885
|
+
{
|
|
1886
|
+
RINOK(InStream_SeekSet(InStream, Header.NumSectors << Header.SectorSizeLog))
|
|
1887
|
+
if (ReadStream_FALSE(InStream, ByteBuf + kHeaderSize, kHeaderSize) == S_OK)
|
|
1888
|
+
{
|
|
1889
|
+
if (memcmp(ByteBuf, ByteBuf + kHeaderSize, kHeaderSize) == 0)
|
|
1890
|
+
PhySize = phySizeMax;
|
|
1891
|
+
// else _headerWarning = true;
|
|
1892
|
+
}
|
|
1893
|
+
}
|
|
1894
|
+
}
|
|
1895
|
+
|
|
1896
|
+
SeekToCluster(Header.MftCluster);
|
|
1897
|
+
const size_t recSize = (size_t)1 << Header.MftRecordSizeLog;
|
|
1898
|
+
// ByteBuf.Size() >= recSize
|
|
1899
|
+
RINOK(ReadStream_FALSE(InStream, ByteBuf, recSize))
|
|
1900
|
+
// if (Get32(ByteBuf + 0x1C) != recSize) return S_FALSE; // NTFRec::bytesAlloc
|
|
1901
|
+
|
|
1902
|
+
{
|
|
1903
|
+
CMyComPtr<IInStream> mftStream;
|
|
1904
|
+
CMftRec mftRec;
|
|
1905
|
+
// MftRecordSizeLog >= SectorSizeLog
|
|
1906
|
+
const unsigned numSectorsInRec = 1u << (Header.MftRecordSizeLog - Header.SectorSizeLog);
|
|
1907
|
+
{
|
|
1908
|
+
if (!mftRec.ParseRec(ByteBuf, Header.SectorSizeLog, numSectorsInRec, 0, ReparseDataVector, NULL))
|
|
1909
|
+
return S_FALSE;
|
|
1910
|
+
if (!mftRec.Is_Magic_FILE())
|
|
1911
|
+
return S_FALSE;
|
|
1912
|
+
mftRec.ParseDataNames(); // it sorts DataAttrs[] by Name and fills DataAttrs[].NextAttrIndex values.
|
|
1913
|
+
if (mftRec.DataAttrs.Size() == 0)
|
|
1914
|
+
return S_FALSE;
|
|
1915
|
+
if (mftRec.DataAttrs[0].NonResident == 0)
|
|
1916
|
+
return S_FALSE;
|
|
1917
|
+
const int dataIndex = 0; // first stream in DataAttrs[]
|
|
1918
|
+
RINOK(mftRec.GetStream(InStream, dataIndex,
|
|
1919
|
+
Header.ClusterSizeLog, Header.NumClusters, &mftStream))
|
|
1920
|
+
if (!mftStream)
|
|
1921
|
+
return S_FALSE;
|
|
1922
|
+
}
|
|
1923
|
+
const UInt64 mftSize = mftRec.DataAttrs[0].Size; // NonResident Size
|
|
1924
|
+
if ((mftSize >> 4) > Header.GetPhySize_Clusters())
|
|
1925
|
+
return S_FALSE;
|
|
1926
|
+
{
|
|
1927
|
+
const UInt64 numFiles = mftSize >> Header.MftRecordSizeLog;
|
|
1928
|
+
if (numFiles > 1u << 30)
|
|
1929
|
+
return S_FALSE;
|
|
1930
|
+
if (OpenCallback)
|
|
1931
|
+
RINOK(OpenCallback->SetTotal(&numFiles, &mftSize))
|
|
1932
|
+
Recs.ClearAndReserve((unsigned)numFiles);
|
|
1933
|
+
}
|
|
1934
|
+
// ReparseDataVector.Clear(); // optional
|
|
1935
|
+
|
|
1936
|
+
for (UInt64 pos64 = 0;;)
|
|
1937
|
+
{
|
|
1938
|
+
if (OpenCallback)
|
|
1939
|
+
{
|
|
1940
|
+
const UInt64 numFiles = Recs.Size();
|
|
1941
|
+
if ((numFiles & 0x3FFF) == 0)
|
|
1942
|
+
RINOK(OpenCallback->SetCompleted(&numFiles, &pos64))
|
|
1943
|
+
}
|
|
1944
|
+
size_t readSize = kBufSize;
|
|
1945
|
+
{
|
|
1946
|
+
const UInt64 rem = mftSize - pos64;
|
|
1947
|
+
if (readSize > rem)
|
|
1948
|
+
readSize = (size_t)rem;
|
|
1949
|
+
}
|
|
1950
|
+
if (readSize < recSize)
|
|
1951
|
+
break;
|
|
1952
|
+
pos64 += readSize;
|
|
1953
|
+
RINOK(ReadStream_FALSE(mftStream, ByteBuf, readSize))
|
|
1954
|
+
|
|
1955
|
+
for (Byte *p = ByteBuf; readSize >= recSize; p += recSize, readSize -= recSize)
|
|
1956
|
+
{
|
|
1957
|
+
PRF(printf("\n---------------------\n%5u:", Recs.Size()));
|
|
1958
|
+
CMftRec rec;
|
|
1959
|
+
CVolumeInfo *volInfo = NULL;
|
|
1960
|
+
const unsigned recIndex = Recs.Size();
|
|
1961
|
+
switch (recIndex)
|
|
1962
|
+
{
|
|
1963
|
+
case kRecIndex_Volume: volInfo = &VolumeInfo; break;
|
|
1964
|
+
// case kRecIndex_Security: attrs = &SecurityAttrs; break;
|
|
1965
|
+
}
|
|
1966
|
+
if (!rec.ParseRec(p, Header.SectorSizeLog, numSectorsInRec,
|
|
1967
|
+
recIndex, ReparseDataVector, volInfo))
|
|
1968
|
+
return S_FALSE;
|
|
1969
|
+
Recs.Add(rec);
|
|
1970
|
+
}
|
|
1971
|
+
}
|
|
1972
|
+
}
|
|
1973
|
+
|
|
1974
|
+
/*
|
|
1975
|
+
// that code looks too complex. And we can get security info without index parsing
|
|
1976
|
+
for (i = 0; i < SecurityAttrs.Size(); i++)
|
|
1977
|
+
{
|
|
1978
|
+
const CAttr &attr = SecurityAttrs[i];
|
|
1979
|
+
if (attr.Name.IsEqualTo("$SII"))
|
|
1980
|
+
{
|
|
1981
|
+
if (attr.Type == ATTR_TYPE_INDEX_ROOT)
|
|
1982
|
+
{
|
|
1983
|
+
const Byte *data = attr.Data;
|
|
1984
|
+
size_t size = attr.Data.Size();
|
|
1985
|
+
// Index Root
|
|
1986
|
+
UInt32 attrType = Get32(data);
|
|
1987
|
+
UInt32 collationRule = Get32(data + 4);
|
|
1988
|
+
UInt32 indexAllocationEtrySizeSize = Get32(data + 8);
|
|
1989
|
+
UInt32 clustersPerIndexRecord = Get32(data + 0xC);
|
|
1990
|
+
data += 0x10;
|
|
1991
|
+
// Index Header
|
|
1992
|
+
UInt32 firstEntryOffset = Get32(data);
|
|
1993
|
+
UInt32 totalSize = Get32(data + 4);
|
|
1994
|
+
UInt32 allocSize = Get32(data + 8);
|
|
1995
|
+
UInt32 flags = Get32(data + 0xC);
|
|
1996
|
+
int num = 0;
|
|
1997
|
+
for (int j = 0 ; j < num; j++)
|
|
1998
|
+
{
|
|
1999
|
+
if (Get32(data) != 0x1414 || // offset and size
|
|
2000
|
+
Get32(data + 4) != 0 ||
|
|
2001
|
+
Get32(data + 8) != 0x428) // KeySize / EntrySize
|
|
2002
|
+
break;
|
|
2003
|
+
UInt32 flags = Get32(data + 12);
|
|
2004
|
+
UInt32 id = Get32(data + 0x10);
|
|
2005
|
+
if (id = Get32(data + 0x18))
|
|
2006
|
+
break;
|
|
2007
|
+
UInt32 descriptorOffset = Get64(data + 0x1C);
|
|
2008
|
+
UInt32 descriptorSize = Get64(data + 0x24);
|
|
2009
|
+
data += 0x28;
|
|
2010
|
+
}
|
|
2011
|
+
// break;
|
|
2012
|
+
}
|
|
2013
|
+
}
|
|
2014
|
+
}
|
|
2015
|
+
*/
|
|
2016
|
+
|
|
2017
|
+
unsigned i;
|
|
2018
|
+
for (i = 0; i < Recs.Size(); i++)
|
|
2019
|
+
{
|
|
2020
|
+
CMftRec &rec = Recs[i];
|
|
2021
|
+
if (!rec.Is_Magic_FILE())
|
|
2022
|
+
continue;
|
|
2023
|
+
if (rec.BaseMftRef.IsBaseItself())
|
|
2024
|
+
continue;
|
|
2025
|
+
|
|
2026
|
+
const UInt64 refIndex = rec.BaseMftRef.GetIndex();
|
|
2027
|
+
if (refIndex >= Recs.Size())
|
|
2028
|
+
return S_FALSE;
|
|
2029
|
+
CMftRec &refRec = Recs[(unsigned)refIndex];
|
|
2030
|
+
if (!refRec.Is_Magic_FILE())
|
|
2031
|
+
continue;
|
|
2032
|
+
|
|
2033
|
+
bool moveAttrs = (refRec.SeqNumber == rec.BaseMftRef.GetNumber()
|
|
2034
|
+
&& refRec.BaseMftRef.IsBaseItself());
|
|
2035
|
+
if (rec.InUse() && refRec.InUse())
|
|
2036
|
+
{
|
|
2037
|
+
if (!moveAttrs)
|
|
2038
|
+
return S_FALSE;
|
|
2039
|
+
}
|
|
2040
|
+
else if (rec.InUse() || refRec.InUse())
|
|
2041
|
+
moveAttrs = false;
|
|
2042
|
+
if (moveAttrs)
|
|
2043
|
+
refRec.MoveAttrsFrom(rec);
|
|
2044
|
+
}
|
|
2045
|
+
|
|
2046
|
+
for (i = 0; i < Recs.Size(); i++)
|
|
2047
|
+
{
|
|
2048
|
+
CMftRec &rec = Recs[i];
|
|
2049
|
+
if (!rec.Is_Magic_FILE())
|
|
2050
|
+
continue;
|
|
2051
|
+
rec.ParseDataNames();
|
|
2052
|
+
}
|
|
2053
|
+
|
|
2054
|
+
for (i = 0; i < Recs.Size(); i++)
|
|
2055
|
+
{
|
|
2056
|
+
CMftRec &rec = Recs[i];
|
|
2057
|
+
if (!rec.Is_Magic_FILE() || !rec.BaseMftRef.IsBaseItself())
|
|
2058
|
+
continue;
|
|
2059
|
+
if (i < kNumSysRecs && !_showSystemFiles)
|
|
2060
|
+
continue;
|
|
2061
|
+
if (!rec.InUse() && !_showDeletedFiles)
|
|
2062
|
+
continue;
|
|
2063
|
+
|
|
2064
|
+
// rec.FileNames.Clear(); // for debug
|
|
2065
|
+
rec.MyNumNameLinks = rec.FileNames.Size();
|
|
2066
|
+
PRF(printf("\n%4u: ", i);)
|
|
2067
|
+
/* DataAttrs[] are sorted already by CAttr::Name.
|
|
2068
|
+
There cannot be more than one unnamed stream in DataAttrs[].NextAttrIndex list
|
|
2069
|
+
*/
|
|
2070
|
+
int indexOfUnnamedStream = -1;
|
|
2071
|
+
if (!rec.IsDir())
|
|
2072
|
+
{
|
|
2073
|
+
for (unsigned di = 0; di < rec.DataAttrs.Size();)
|
|
2074
|
+
{
|
|
2075
|
+
const CAttr &attr = rec.DataAttrs[di];
|
|
2076
|
+
if (attr.Name.IsEmpty())
|
|
2077
|
+
{
|
|
2078
|
+
indexOfUnnamedStream = (int)di;
|
|
2079
|
+
break;
|
|
2080
|
+
}
|
|
2081
|
+
// break; // optional : we need to check only rec.DataAttrs[0] for unnamed attribute.
|
|
2082
|
+
di = attr.NextAttrIndex;
|
|
2083
|
+
}
|
|
2084
|
+
}
|
|
2085
|
+
|
|
2086
|
+
if (rec.FileNames.IsEmpty())
|
|
2087
|
+
{
|
|
2088
|
+
bool needShow = true;
|
|
2089
|
+
if (i < kNumSysRecs)
|
|
2090
|
+
{
|
|
2091
|
+
needShow = false;
|
|
2092
|
+
for (unsigned di = 0; di < rec.DataAttrs.Size();)
|
|
2093
|
+
{
|
|
2094
|
+
const CAttr &attr = rec.DataAttrs[di];
|
|
2095
|
+
if (rec.GetSize(di) != 0)
|
|
2096
|
+
{
|
|
2097
|
+
needShow = true;
|
|
2098
|
+
break;
|
|
2099
|
+
}
|
|
2100
|
+
di = attr.NextAttrIndex;
|
|
2101
|
+
}
|
|
2102
|
+
}
|
|
2103
|
+
if (needShow)
|
|
2104
|
+
{
|
|
2105
|
+
CFileNameAttr &fna = rec.FileNames.AddNew();
|
|
2106
|
+
fna.NameType = kFileNameType_Win32Dos;
|
|
2107
|
+
// we set incorrect ParentDirRef, that will place item to [LOST] folder
|
|
2108
|
+
fna.ParentDirRef.Val = (UInt64)0-1;
|
|
2109
|
+
char s[16 + 16];
|
|
2110
|
+
ConvertUInt32ToString(i, MyStpCpy(s, "[NONAME]-"));
|
|
2111
|
+
fna.Name.SetFromAscii(s);
|
|
2112
|
+
}
|
|
2113
|
+
}
|
|
2114
|
+
|
|
2115
|
+
// bool isMainName = true;
|
|
2116
|
+
|
|
2117
|
+
FOR_VECTOR (t, rec.FileNames)
|
|
2118
|
+
{
|
|
2119
|
+
PRF(printf("\n %1u : ", (unsigned)rec.FileNames[t].NameType));
|
|
2120
|
+
PRF_UTF16(rec.FileNames[t].Name)
|
|
2121
|
+
// PRF(printf(" | "));
|
|
2122
|
+
if (rec.FindWin32Name_for_DosName(t) >= 0)
|
|
2123
|
+
{
|
|
2124
|
+
rec.MyNumNameLinks--;
|
|
2125
|
+
continue;
|
|
2126
|
+
}
|
|
2127
|
+
|
|
2128
|
+
CItem item;
|
|
2129
|
+
item.Construct();
|
|
2130
|
+
item.RecIndex = i;
|
|
2131
|
+
item.NameIndex = t;
|
|
2132
|
+
item.DataIndex = rec.IsDir() ? k_Item_DataIndex_IsDir :
|
|
2133
|
+
indexOfUnnamedStream < 0 ? k_Item_DataIndex_IsEmptyFile :
|
|
2134
|
+
indexOfUnnamedStream;
|
|
2135
|
+
if (rec.MyItemIndex < 0)
|
|
2136
|
+
rec.MyItemIndex = (int)Items.Size();
|
|
2137
|
+
item.ParentHost = (int)Items.Add(item);
|
|
2138
|
+
if (OpenCallback) // if (Items.Size() > Recs.Size())
|
|
2139
|
+
{
|
|
2140
|
+
const UInt64 numFiles = Items.Size();
|
|
2141
|
+
if ((numFiles & 0xFFFFF) == 0)
|
|
2142
|
+
RINOK(OpenCallback->SetCompleted(&numFiles, NULL))
|
|
2143
|
+
}
|
|
2144
|
+
|
|
2145
|
+
/* we can use that code to reduce the number of alt streams:
|
|
2146
|
+
it will not show alt streams for hard links. */
|
|
2147
|
+
// if (!isMainName) continue; isMainName = false;
|
|
2148
|
+
|
|
2149
|
+
// unsigned numAltStreams = 0;
|
|
2150
|
+
for (unsigned di = 0; di < rec.DataAttrs.Size();)
|
|
2151
|
+
{
|
|
2152
|
+
const CAttr &attr = rec.DataAttrs[di];
|
|
2153
|
+
if (rec.IsDir() || (int)di != indexOfUnnamedStream)
|
|
2154
|
+
{
|
|
2155
|
+
const UString2 &subName = attr.Name;
|
|
2156
|
+
PRF(printf("\n alt stream: "));
|
|
2157
|
+
PRF_UTF16(subName)
|
|
2158
|
+
// $BadClus:$Bad is sparse file for all clusters. So we skip it.
|
|
2159
|
+
if (i != kRecIndex_BadClus || subName != L"$Bad")
|
|
2160
|
+
{
|
|
2161
|
+
// numAltStreams++;
|
|
2162
|
+
ThereAreAltStreams = true;
|
|
2163
|
+
item.DataIndex = (int)di;
|
|
2164
|
+
Items.Add(item);
|
|
2165
|
+
if (OpenCallback)
|
|
2166
|
+
{
|
|
2167
|
+
const UInt64 numFiles = Items.Size();
|
|
2168
|
+
if ((numFiles & 0xFFFFF) == 0)
|
|
2169
|
+
RINOK(OpenCallback->SetCompleted(&numFiles, NULL))
|
|
2170
|
+
}
|
|
2171
|
+
}
|
|
2172
|
+
}
|
|
2173
|
+
di = attr.NextAttrIndex;
|
|
2174
|
+
}
|
|
2175
|
+
}
|
|
2176
|
+
}
|
|
2177
|
+
|
|
2178
|
+
if (Recs.Size() > kRecIndex_Security)
|
|
2179
|
+
{
|
|
2180
|
+
const CMftRec &rec = Recs[kRecIndex_Security];
|
|
2181
|
+
for (unsigned di = 0; di < rec.DataAttrs.Size();)
|
|
2182
|
+
{
|
|
2183
|
+
const CAttr &attr = rec.DataAttrs[di];
|
|
2184
|
+
if (attr.Name == L"$SDS")
|
|
2185
|
+
{
|
|
2186
|
+
CMyComPtr<IInStream> sdsStream;
|
|
2187
|
+
RINOK(rec.GetStream(InStream, (int)di,
|
|
2188
|
+
Header.ClusterSizeLog, Header.NumClusters, &sdsStream))
|
|
2189
|
+
if (sdsStream)
|
|
2190
|
+
{
|
|
2191
|
+
const UInt64 size64 = attr.GetSize();
|
|
2192
|
+
if (size64 <= (UInt32)1 << 29)
|
|
2193
|
+
if (!ParseSecuritySDS(sdsStream, (size_t)size64))
|
|
2194
|
+
ClearSecurInfo();
|
|
2195
|
+
}
|
|
2196
|
+
break;
|
|
2197
|
+
}
|
|
2198
|
+
di = attr.NextAttrIndex;
|
|
2199
|
+
}
|
|
2200
|
+
}
|
|
2201
|
+
|
|
2202
|
+
bool thereAreUnknownFolders_Normal = false;
|
|
2203
|
+
bool thereAreUnknownFolders_Deleted = false;
|
|
2204
|
+
|
|
2205
|
+
for (i = 0; i < Items.Size(); i++)
|
|
2206
|
+
{
|
|
2207
|
+
CItem &item = Items[i];
|
|
2208
|
+
const CMftRec &rec = Recs[item.RecIndex];
|
|
2209
|
+
const CFileNameAttr &fn = rec.FileNames[item.NameIndex];
|
|
2210
|
+
const CMftRef &parentDirRef = fn.ParentDirRef;
|
|
2211
|
+
const UInt64 refIndex = parentDirRef.GetIndex();
|
|
2212
|
+
#if 1 // 0 for debug
|
|
2213
|
+
// we don't set ParentFolder link to (RootDir) item:
|
|
2214
|
+
if (refIndex == kRecIndex_RootDir)
|
|
2215
|
+
continue;
|
|
2216
|
+
#endif
|
|
2217
|
+
{
|
|
2218
|
+
int index = Find_DirItem_For_MftRec(refIndex);
|
|
2219
|
+
if (index < 0 ||
|
|
2220
|
+
Recs[(unsigned)refIndex].SeqNumber != parentDirRef.GetNumber())
|
|
2221
|
+
// Recs[Items[index].RecIndex].SeqNumber != parentDirRef.GetNumber())
|
|
2222
|
+
{
|
|
2223
|
+
if (rec.InUse())
|
|
2224
|
+
{
|
|
2225
|
+
thereAreUnknownFolders_Normal = true;
|
|
2226
|
+
index = k_ParentFolderIndex_Lost;
|
|
2227
|
+
}
|
|
2228
|
+
else
|
|
2229
|
+
{
|
|
2230
|
+
thereAreUnknownFolders_Deleted = true;
|
|
2231
|
+
index = k_ParentFolderIndex_Deleted;
|
|
2232
|
+
}
|
|
2233
|
+
}
|
|
2234
|
+
item.ParentFolder = index;
|
|
2235
|
+
}
|
|
2236
|
+
}
|
|
2237
|
+
|
|
2238
|
+
if (kRecIndex_RootDir < Recs.Size())
|
|
2239
|
+
{
|
|
2240
|
+
CMftRec &rec = Recs[kRecIndex_RootDir];
|
|
2241
|
+
if (rec.MyItemIndex >= 0)
|
|
2242
|
+
{
|
|
2243
|
+
// v26.04 : we replace Name of RootDir: from "." to "[SYSTEM]".
|
|
2244
|
+
_systemFolderIndex = rec.MyItemIndex;
|
|
2245
|
+
rec.FileNames[Items[rec.MyItemIndex].NameIndex].Name = kVirtualFolder_System;
|
|
2246
|
+
}
|
|
2247
|
+
}
|
|
2248
|
+
|
|
2249
|
+
unsigned virtIndex = Items.Size();
|
|
2250
|
+
if (_showSystemFiles && _systemFolderIndex < 0)
|
|
2251
|
+
{
|
|
2252
|
+
_systemFolderIndex = (int)(virtIndex++);
|
|
2253
|
+
VirtFolderNames.Add(kVirtualFolder_System);
|
|
2254
|
+
}
|
|
2255
|
+
if (thereAreUnknownFolders_Normal)
|
|
2256
|
+
{
|
|
2257
|
+
_lostFolderIndex_Normal = (int)(virtIndex++);
|
|
2258
|
+
VirtFolderNames.Add(kVirtualFolder_Lost_Normal);
|
|
2259
|
+
}
|
|
2260
|
+
if (thereAreUnknownFolders_Deleted)
|
|
2261
|
+
{
|
|
2262
|
+
_lostFolderIndex_Deleted = (int)(virtIndex++);
|
|
2263
|
+
VirtFolderNames.Add(kVirtualFolder_Lost_Deleted);
|
|
2264
|
+
}
|
|
2265
|
+
|
|
2266
|
+
return S_OK;
|
|
2267
|
+
}
|
|
2268
|
+
|
|
2269
|
+
|
|
2270
|
+
Z7_class_CHandler_final:
|
|
2271
|
+
public IInArchive,
|
|
2272
|
+
public IArchiveGetRawProps,
|
|
2273
|
+
public IInArchiveGetStream,
|
|
2274
|
+
public ISetProperties,
|
|
2275
|
+
public CMyUnknownImp,
|
|
2276
|
+
public CDatabase
|
|
2277
|
+
{
|
|
2278
|
+
Z7_IFACES_IMP_UNK_4(
|
|
2279
|
+
IInArchive,
|
|
2280
|
+
IArchiveGetRawProps,
|
|
2281
|
+
IInArchiveGetStream,
|
|
2282
|
+
ISetProperties)
|
|
2283
|
+
};
|
|
2284
|
+
|
|
2285
|
+
Z7_COM7F_IMF(CHandler::GetNumRawProps(UInt32 *numProps))
|
|
2286
|
+
{
|
|
2287
|
+
*numProps = 2;
|
|
2288
|
+
return S_OK;
|
|
2289
|
+
}
|
|
2290
|
+
|
|
2291
|
+
Z7_COM7F_IMF(CHandler::GetRawPropInfo(const UInt32 index, BSTR * const name, PROPID * const propID))
|
|
2292
|
+
{
|
|
2293
|
+
*name = NULL;
|
|
2294
|
+
*propID = index == 0 ? kpidNtReparse : kpidNtSecure;
|
|
2295
|
+
return S_OK;
|
|
2296
|
+
}
|
|
2297
|
+
|
|
2298
|
+
Z7_COM7F_IMF(CHandler::GetParent(const UInt32 index, UInt32 * const parent, UInt32 * const parentType))
|
|
2299
|
+
{
|
|
2300
|
+
*parentType = NParentType::kDir;
|
|
2301
|
+
int par = -1;
|
|
2302
|
+
|
|
2303
|
+
if (index < Items.Size())
|
|
2304
|
+
{
|
|
2305
|
+
const CItem &item = Items[index];
|
|
2306
|
+
|
|
2307
|
+
if (item.ParentHost >= 0)
|
|
2308
|
+
{
|
|
2309
|
+
*parentType = NParentType::kAltStream;
|
|
2310
|
+
par = (item.RecIndex == kRecIndex_RootDir ? -1 : item.ParentHost);
|
|
2311
|
+
}
|
|
2312
|
+
else if (item.RecIndex < kNumSysRecs)
|
|
2313
|
+
{
|
|
2314
|
+
if (_showSystemFiles && item.RecIndex != kRecIndex_RootDir)
|
|
2315
|
+
par = _systemFolderIndex;
|
|
2316
|
+
}
|
|
2317
|
+
else if (item.ParentFolder >= 0)
|
|
2318
|
+
par = item.ParentFolder;
|
|
2319
|
+
else if (item.ParentFolder == k_ParentFolderIndex_Lost)
|
|
2320
|
+
par = _lostFolderIndex_Normal;
|
|
2321
|
+
else if (item.ParentFolder == k_ParentFolderIndex_Deleted)
|
|
2322
|
+
par = _lostFolderIndex_Deleted;
|
|
2323
|
+
}
|
|
2324
|
+
*parent = (UInt32)(Int32)par;
|
|
2325
|
+
return S_OK;
|
|
2326
|
+
}
|
|
2327
|
+
|
|
2328
|
+
Z7_COM7F_IMF(CHandler::GetRawProp(const UInt32 index, const PROPID propID,
|
|
2329
|
+
const void ** const data, UInt32 * const dataSize, UInt32 * const propType))
|
|
2330
|
+
{
|
|
2331
|
+
*data = NULL;
|
|
2332
|
+
*dataSize = 0;
|
|
2333
|
+
*propType = 0;
|
|
2334
|
+
|
|
2335
|
+
if (propID == kpidName)
|
|
2336
|
+
{
|
|
2337
|
+
#ifdef MY_CPU_LE
|
|
2338
|
+
const UString2 *s;
|
|
2339
|
+
if (index >= Items.Size())
|
|
2340
|
+
s = &VirtFolderNames[index - Items.Size()];
|
|
2341
|
+
else
|
|
2342
|
+
{
|
|
2343
|
+
const CItem &item = Items[index];
|
|
2344
|
+
const CMftRec &rec = Recs[item.RecIndex];
|
|
2345
|
+
s = item.IsAltStream() ?
|
|
2346
|
+
&rec.DataAttrs[item.DataIndex].Name :
|
|
2347
|
+
&rec.FileNames[item.NameIndex].Name;
|
|
2348
|
+
}
|
|
2349
|
+
if (s->IsEmpty())
|
|
2350
|
+
s = &EmptyString;
|
|
2351
|
+
*data = s->GetRawPtr();
|
|
2352
|
+
*dataSize = (s->Len() + 1) * (UInt32)sizeof(wchar_t);
|
|
2353
|
+
*propType = PROP_DATA_TYPE_wchar_t_PTR_Z_LE;
|
|
2354
|
+
#endif
|
|
2355
|
+
return S_OK;
|
|
2356
|
+
}
|
|
2357
|
+
|
|
2358
|
+
if (propID == kpidNtReparse)
|
|
2359
|
+
{
|
|
2360
|
+
if (index >= Items.Size())
|
|
2361
|
+
return S_OK;
|
|
2362
|
+
const CItem &item = Items[index];
|
|
2363
|
+
const CMftRec &rec = Recs[item.RecIndex];
|
|
2364
|
+
if (rec.ReparseDataIndex >= 0)
|
|
2365
|
+
{
|
|
2366
|
+
const CByteBuffer &reparse = ReparseDataVector[rec.ReparseDataIndex];
|
|
2367
|
+
if (reparse.Size() != 0)
|
|
2368
|
+
{
|
|
2369
|
+
*dataSize = (UInt32)reparse.Size();
|
|
2370
|
+
*propType = NPropDataType::kRaw;
|
|
2371
|
+
*data = (const Byte *)reparse;
|
|
2372
|
+
}
|
|
2373
|
+
}
|
|
2374
|
+
}
|
|
2375
|
+
|
|
2376
|
+
if (propID == kpidNtSecure)
|
|
2377
|
+
{
|
|
2378
|
+
if (index >= Items.Size())
|
|
2379
|
+
return S_OK;
|
|
2380
|
+
const CItem &item = Items[index];
|
|
2381
|
+
const CMftRec &rec = Recs[item.RecIndex];
|
|
2382
|
+
const UInt32 securId = rec.SiAttr.SecurityId;
|
|
2383
|
+
if (securId)
|
|
2384
|
+
{
|
|
2385
|
+
const int idIndex = SecurIds.FindInSorted(securId);
|
|
2386
|
+
if (idIndex >= 0)
|
|
2387
|
+
{
|
|
2388
|
+
const UInt32 offset = SecurOffsets[idIndex];
|
|
2389
|
+
const UInt32 size = SecurOffsets[(unsigned)idIndex + 1] - offset;
|
|
2390
|
+
if (SecurData.Size() >= offset
|
|
2391
|
+
&& SecurData.Size() - (size_t)offset >= size)
|
|
2392
|
+
{
|
|
2393
|
+
*dataSize = size;
|
|
2394
|
+
*propType = NPropDataType::kRaw;
|
|
2395
|
+
*data = (const Byte *)SecurData + offset;
|
|
2396
|
+
}
|
|
2397
|
+
}
|
|
2398
|
+
}
|
|
2399
|
+
}
|
|
2400
|
+
|
|
2401
|
+
return S_OK;
|
|
2402
|
+
}
|
|
2403
|
+
|
|
2404
|
+
Z7_COM7F_IMF(CHandler::GetStream(const UInt32 index, ISequentialInStream ** const stream))
|
|
2405
|
+
{
|
|
2406
|
+
COM_TRY_BEGIN
|
|
2407
|
+
*stream = NULL;
|
|
2408
|
+
if (index >= Items.Size())
|
|
2409
|
+
return S_OK;
|
|
2410
|
+
IInStream *stream2;
|
|
2411
|
+
const CItem &item = Items[index];
|
|
2412
|
+
const CMftRec &rec = Recs[item.RecIndex];
|
|
2413
|
+
HRESULT res = rec.GetStream(InStream, item.DataIndex, Header.ClusterSizeLog, Header.NumClusters, &stream2);
|
|
2414
|
+
*stream = (ISequentialInStream *)stream2;
|
|
2415
|
+
return res;
|
|
2416
|
+
COM_TRY_END
|
|
2417
|
+
}
|
|
2418
|
+
|
|
2419
|
+
/*
|
|
2420
|
+
enum
|
|
2421
|
+
{
|
|
2422
|
+
kpidLink2 = kpidUserDefined,
|
|
2423
|
+
kpidLinkType,
|
|
2424
|
+
kpidRecMTime,
|
|
2425
|
+
kpidRecMTime2,
|
|
2426
|
+
kpidMTime2,
|
|
2427
|
+
kpidCTime2,
|
|
2428
|
+
kpidATime2
|
|
2429
|
+
};
|
|
2430
|
+
|
|
2431
|
+
static const CStatProp kProps[] =
|
|
2432
|
+
{
|
|
2433
|
+
{ NULL, kpidPath, VT_BSTR},
|
|
2434
|
+
{ NULL, kpidSize, VT_UI8},
|
|
2435
|
+
{ NULL, kpidPackSize, VT_UI8},
|
|
2436
|
+
|
|
2437
|
+
// { NULL, kpidLink, VT_BSTR},
|
|
2438
|
+
|
|
2439
|
+
// { "Link 2", kpidLink2, VT_BSTR},
|
|
2440
|
+
// { "Link Type", kpidLinkType, VT_UI2},
|
|
2441
|
+
{ NULL, kpidINode, VT_UI8},
|
|
2442
|
+
|
|
2443
|
+
{ NULL, kpidMTime, VT_FILETIME},
|
|
2444
|
+
{ NULL, kpidCTime, VT_FILETIME},
|
|
2445
|
+
{ NULL, kpidATime, VT_FILETIME},
|
|
2446
|
+
|
|
2447
|
+
// { "Record Modified", kpidRecMTime, VT_FILETIME},
|
|
2448
|
+
|
|
2449
|
+
// { "Modified 2", kpidMTime2, VT_FILETIME},
|
|
2450
|
+
// { "Created 2", kpidCTime2, VT_FILETIME},
|
|
2451
|
+
// { "Accessed 2", kpidATime2, VT_FILETIME},
|
|
2452
|
+
// { "Record Modified 2", kpidRecMTime2, VT_FILETIME},
|
|
2453
|
+
|
|
2454
|
+
{ NULL, kpidAttrib, VT_UI4},
|
|
2455
|
+
{ NULL, kpidNumBlocks, VT_UI4},
|
|
2456
|
+
{ NULL, kpidIsDeleted, VT_BOOL},
|
|
2457
|
+
};
|
|
2458
|
+
*/
|
|
2459
|
+
|
|
2460
|
+
static const Byte kProps[] =
|
|
2461
|
+
{
|
|
2462
|
+
kpidPath,
|
|
2463
|
+
kpidIsDir,
|
|
2464
|
+
kpidSize,
|
|
2465
|
+
kpidPackSize,
|
|
2466
|
+
kpidMTime,
|
|
2467
|
+
kpidCTime,
|
|
2468
|
+
kpidATime,
|
|
2469
|
+
kpidChangeTime,
|
|
2470
|
+
kpidAttrib,
|
|
2471
|
+
kpidLinks,
|
|
2472
|
+
kpidINode,
|
|
2473
|
+
kpidNumBlocks,
|
|
2474
|
+
kpidNumAltStreams,
|
|
2475
|
+
kpidIsAltStream,
|
|
2476
|
+
kpidShortName,
|
|
2477
|
+
kpidIsDeleted
|
|
2478
|
+
};
|
|
2479
|
+
|
|
2480
|
+
enum
|
|
2481
|
+
{
|
|
2482
|
+
kpidRecordSize = kpidUserDefined
|
|
2483
|
+
};
|
|
2484
|
+
|
|
2485
|
+
static const CStatProp kArcProps[] =
|
|
2486
|
+
{
|
|
2487
|
+
{ NULL, kpidVolumeName, VT_BSTR},
|
|
2488
|
+
{ NULL, kpidFileSystem, VT_BSTR},
|
|
2489
|
+
{ NULL, kpidClusterSize, VT_UI4},
|
|
2490
|
+
{ NULL, kpidSectorSize, VT_UI4},
|
|
2491
|
+
{ "MFT Record Size", kpidRecordSize, VT_UI4},
|
|
2492
|
+
{ NULL, kpidHeadersSize, VT_UI8},
|
|
2493
|
+
{ NULL, kpidCTime, VT_FILETIME},
|
|
2494
|
+
{ NULL, kpidId, VT_UI8}
|
|
2495
|
+
};
|
|
2496
|
+
|
|
2497
|
+
/*
|
|
2498
|
+
static const Byte kArcProps[] =
|
|
2499
|
+
{
|
|
2500
|
+
kpidVolumeName,
|
|
2501
|
+
kpidFileSystem,
|
|
2502
|
+
kpidClusterSize,
|
|
2503
|
+
kpidHeadersSize,
|
|
2504
|
+
kpidCTime,
|
|
2505
|
+
kpidSectorSize,
|
|
2506
|
+
kpidId
|
|
2507
|
+
// kpidSectorsPerTrack,
|
|
2508
|
+
// kpidNumHeads,
|
|
2509
|
+
// kpidHiddenSectors
|
|
2510
|
+
};
|
|
2511
|
+
*/
|
|
2512
|
+
|
|
2513
|
+
IMP_IInArchive_Props
|
|
2514
|
+
IMP_IInArchive_ArcProps_WITH_NAME
|
|
2515
|
+
|
|
2516
|
+
static void NtfsTimeToProp(UInt64 t, NCOM::CPropVariant &prop)
|
|
2517
|
+
{
|
|
2518
|
+
FILETIME ft;
|
|
2519
|
+
ft.dwLowDateTime = (DWORD)t;
|
|
2520
|
+
ft.dwHighDateTime = (DWORD)(t >> 32);
|
|
2521
|
+
prop = ft;
|
|
2522
|
+
}
|
|
2523
|
+
|
|
2524
|
+
Z7_COM7F_IMF(CHandler::GetArchiveProperty(const PROPID propID, PROPVARIANT * const value))
|
|
2525
|
+
{
|
|
2526
|
+
COM_TRY_BEGIN
|
|
2527
|
+
NCOM::CPropVariant prop;
|
|
2528
|
+
|
|
2529
|
+
const CMftRec *volRec = (Recs.Size() > kRecIndex_Volume ? &Recs[kRecIndex_Volume] : NULL);
|
|
2530
|
+
|
|
2531
|
+
switch (propID)
|
|
2532
|
+
{
|
|
2533
|
+
case kpidClusterSize: prop = Header.ClusterSize(); break;
|
|
2534
|
+
case kpidPhySize: prop = PhySize; break;
|
|
2535
|
+
/*
|
|
2536
|
+
case kpidHeadersSize:
|
|
2537
|
+
{
|
|
2538
|
+
UInt64 val = 0;
|
|
2539
|
+
for (unsigned i = 0; i < kNumSysRecs; i++)
|
|
2540
|
+
{
|
|
2541
|
+
printf("\n%2d: %8I64d ", i, Recs[i].GetPackSize());
|
|
2542
|
+
if (i == 8)
|
|
2543
|
+
i = i
|
|
2544
|
+
val += Recs[i].GetPackSize();
|
|
2545
|
+
}
|
|
2546
|
+
prop = val;
|
|
2547
|
+
break;
|
|
2548
|
+
}
|
|
2549
|
+
*/
|
|
2550
|
+
case kpidCTime: if (volRec) NtfsTimeToProp(volRec->SiAttr.CTime, prop); break;
|
|
2551
|
+
case kpidMTime: if (volRec) NtfsTimeToProp(volRec->SiAttr.MTime, prop); break;
|
|
2552
|
+
case kpidShortComment:
|
|
2553
|
+
case kpidVolumeName:
|
|
2554
|
+
if (!VolumeInfo.VolName.IsEmpty())
|
|
2555
|
+
prop = VolumeInfo.VolName.GetRawPtr();
|
|
2556
|
+
break;
|
|
2557
|
+
case kpidFileSystem:
|
|
2558
|
+
{
|
|
2559
|
+
char buf[32];
|
|
2560
|
+
char *s = MyStpCpy(buf, "NTFS");
|
|
2561
|
+
if (VolumeInfo.FsVerMajor >= 0)
|
|
2562
|
+
{
|
|
2563
|
+
*s++ = ' '; s = ConvertUInt32ToString((UInt32)(unsigned)VolumeInfo.FsVerMajor, s);
|
|
2564
|
+
*s++ = '.'; ConvertUInt32ToString(VolumeInfo.FsVerMinor, s);
|
|
2565
|
+
}
|
|
2566
|
+
prop = buf;
|
|
2567
|
+
break;
|
|
2568
|
+
}
|
|
2569
|
+
case kpidSectorSize: prop = (UInt32)1 << Header.SectorSizeLog; break;
|
|
2570
|
+
case kpidRecordSize: prop = (UInt32)1 << Header.MftRecordSizeLog; break;
|
|
2571
|
+
case kpidId: prop = Header.SerialNumber; break;
|
|
2572
|
+
|
|
2573
|
+
case kpidIsTree: prop = true; break;
|
|
2574
|
+
case kpidIsDeleted: prop = _showDeletedFiles; break;
|
|
2575
|
+
case kpidIsAltStream: prop = ThereAreAltStreams; break;
|
|
2576
|
+
// case kpidIsAux: prop = true; break;
|
|
2577
|
+
case kpidINode: prop = true; break;
|
|
2578
|
+
|
|
2579
|
+
case kpidWarning:
|
|
2580
|
+
if (_lostFolderIndex_Normal >= 0)
|
|
2581
|
+
prop = "There are lost files";
|
|
2582
|
+
break;
|
|
2583
|
+
|
|
2584
|
+
/*
|
|
2585
|
+
case kpidWarningFlags:
|
|
2586
|
+
{
|
|
2587
|
+
UInt32 flags = 0;
|
|
2588
|
+
if (_headerWarning)
|
|
2589
|
+
flags |= k_ErrorFlags_HeadersError;
|
|
2590
|
+
if (flags != 0)
|
|
2591
|
+
prop = flags;
|
|
2592
|
+
break;
|
|
2593
|
+
}
|
|
2594
|
+
*/
|
|
2595
|
+
// case kpidMediaType: prop = Header.MediaType; break;
|
|
2596
|
+
// case kpidSectorsPerTrack: prop = Header.SectorsPerTrack; break;
|
|
2597
|
+
// case kpidNumHeads: prop = Header.NumHeads; break;
|
|
2598
|
+
// case kpidHiddenSectors: prop = Header.NumHiddenSectors; break;
|
|
2599
|
+
}
|
|
2600
|
+
prop.Detach(value);
|
|
2601
|
+
return S_OK;
|
|
2602
|
+
COM_TRY_END
|
|
2603
|
+
}
|
|
2604
|
+
|
|
2605
|
+
Z7_COM7F_IMF(CHandler::GetProperty(const UInt32 index, const PROPID propID, PROPVARIANT * const value))
|
|
2606
|
+
{
|
|
2607
|
+
COM_TRY_BEGIN
|
|
2608
|
+
NCOM::CPropVariant prop;
|
|
2609
|
+
if (index >= Items.Size())
|
|
2610
|
+
{
|
|
2611
|
+
switch (propID)
|
|
2612
|
+
{
|
|
2613
|
+
case kpidName:
|
|
2614
|
+
case kpidPath:
|
|
2615
|
+
prop = VirtFolderNames[index - Items.Size()].GetRawPtr();
|
|
2616
|
+
break;
|
|
2617
|
+
case kpidIsDir: prop = true; break;
|
|
2618
|
+
// case kpidIsAux: prop = true; break;
|
|
2619
|
+
case kpidIsDeleted:
|
|
2620
|
+
if ((int)index == _lostFolderIndex_Deleted)
|
|
2621
|
+
prop = true;
|
|
2622
|
+
break;
|
|
2623
|
+
}
|
|
2624
|
+
}
|
|
2625
|
+
else
|
|
2626
|
+
{
|
|
2627
|
+
|
|
2628
|
+
const CItem &item = Items[index];
|
|
2629
|
+
const CMftRec &rec = Recs[item.RecIndex];
|
|
2630
|
+
const CAttr *data = NULL;
|
|
2631
|
+
if (item.DataIndex >= 0)
|
|
2632
|
+
data = &rec.DataAttrs[item.DataIndex];
|
|
2633
|
+
// const CFileNameAttr *fn = &rec.FileNames[item.NameIndex];
|
|
2634
|
+
/*
|
|
2635
|
+
if (rec.FileNames.Size())
|
|
2636
|
+
fn = &rec.FileNames[0];
|
|
2637
|
+
*/
|
|
2638
|
+
|
|
2639
|
+
switch (propID)
|
|
2640
|
+
{
|
|
2641
|
+
case kpidPath:
|
|
2642
|
+
GetItemPath(index, prop);
|
|
2643
|
+
break;
|
|
2644
|
+
/*
|
|
2645
|
+
case kpidLink: if (!rec.ReparseAttr.SubsName.IsEmpty())
|
|
2646
|
+
{ prop = rec.ReparseAttr.SubsName; }
|
|
2647
|
+
break;
|
|
2648
|
+
case kpidLink2: if (!rec.ReparseAttr.PrintName.IsEmpty())
|
|
2649
|
+
{ prop = rec.ReparseAttr.PrintName; }
|
|
2650
|
+
break;
|
|
2651
|
+
case kpidLinkType: if (rec.ReparseAttr.Tag != 0)
|
|
2652
|
+
{ prop = (rec.ReparseAttr.Tag & 0xFFFF); }
|
|
2653
|
+
break;
|
|
2654
|
+
*/
|
|
2655
|
+
case kpidINode:
|
|
2656
|
+
{
|
|
2657
|
+
// prop = ((UInt64)rec.SeqNumber << 48) | item.RecIndex;
|
|
2658
|
+
prop = (UInt32)item.RecIndex;
|
|
2659
|
+
break;
|
|
2660
|
+
}
|
|
2661
|
+
case kpidStreamId:
|
|
2662
|
+
{
|
|
2663
|
+
if (item.DataIndex >= 0)
|
|
2664
|
+
prop = ((UInt64)item.RecIndex << 32) | (unsigned)item.DataIndex;
|
|
2665
|
+
break;
|
|
2666
|
+
}
|
|
2667
|
+
|
|
2668
|
+
case kpidName:
|
|
2669
|
+
{
|
|
2670
|
+
const UString2 *s = item.IsAltStream() ?
|
|
2671
|
+
&data->Name :
|
|
2672
|
+
&rec.FileNames[item.NameIndex].Name;
|
|
2673
|
+
if (s->IsEmpty())
|
|
2674
|
+
s = &EmptyString;
|
|
2675
|
+
prop = s->GetRawPtr();
|
|
2676
|
+
break;
|
|
2677
|
+
}
|
|
2678
|
+
|
|
2679
|
+
case kpidShortName:
|
|
2680
|
+
{
|
|
2681
|
+
if (!item.IsAltStream())
|
|
2682
|
+
{
|
|
2683
|
+
const int dosNameIndex = rec.FindDosName(item.NameIndex);
|
|
2684
|
+
if (dosNameIndex >= 0)
|
|
2685
|
+
{
|
|
2686
|
+
const UString2 *s = &rec.FileNames[dosNameIndex].Name;
|
|
2687
|
+
if (s->IsEmpty())
|
|
2688
|
+
s = &EmptyString;
|
|
2689
|
+
prop = s->GetRawPtr();
|
|
2690
|
+
}
|
|
2691
|
+
}
|
|
2692
|
+
break;
|
|
2693
|
+
}
|
|
2694
|
+
|
|
2695
|
+
case kpidIsDir: prop = item.IsDir(); break;
|
|
2696
|
+
case kpidIsAltStream: prop = item.IsAltStream(); break;
|
|
2697
|
+
case kpidIsDeleted: prop = !rec.InUse(); break;
|
|
2698
|
+
// case kpidIsAux: prop = false; break;
|
|
2699
|
+
|
|
2700
|
+
case kpidMTime: NtfsTimeToProp(rec.SiAttr.MTime, prop); break;
|
|
2701
|
+
case kpidCTime: NtfsTimeToProp(rec.SiAttr.CTime, prop); break;
|
|
2702
|
+
case kpidATime: NtfsTimeToProp(rec.SiAttr.ATime, prop); break;
|
|
2703
|
+
case kpidChangeTime: NtfsTimeToProp(rec.SiAttr.ThisRecMTime, prop); break;
|
|
2704
|
+
/*
|
|
2705
|
+
case kpidMTime2: if (fn) NtfsTimeToProp(fn->MTime, prop); break;
|
|
2706
|
+
case kpidCTime2: if (fn) NtfsTimeToProp(fn->CTime, prop); break;
|
|
2707
|
+
case kpidATime2: if (fn) NtfsTimeToProp(fn->ATime, prop); break;
|
|
2708
|
+
case kpidRecMTime2: if (fn) NtfsTimeToProp(fn->ThisRecMTime, prop); break;
|
|
2709
|
+
*/
|
|
2710
|
+
case kpidAttrib:
|
|
2711
|
+
{
|
|
2712
|
+
UInt32 attrib = 0;
|
|
2713
|
+
if (item.IsAltStream() && item.RecIndex == kRecIndex_RootDir)
|
|
2714
|
+
{
|
|
2715
|
+
break;
|
|
2716
|
+
}
|
|
2717
|
+
else
|
|
2718
|
+
{
|
|
2719
|
+
/* WinXP-64: The CFileNameAttr::Attrib is not updated after some changes. Why?
|
|
2720
|
+
CSiAttr:attrib is updated better. So we use CSiAttr:Sttrib */
|
|
2721
|
+
/*
|
|
2722
|
+
if (fn)
|
|
2723
|
+
attrib = fn->Attrib;
|
|
2724
|
+
else
|
|
2725
|
+
*/
|
|
2726
|
+
attrib = rec.SiAttr.Attrib;
|
|
2727
|
+
if (item.IsDir())
|
|
2728
|
+
attrib |= FILE_ATTRIBUTE_DIRECTORY;
|
|
2729
|
+
|
|
2730
|
+
/* some system entries can contain extra flags (Index View).
|
|
2731
|
+
// 0x10000000 (Directory)
|
|
2732
|
+
// 0x20000000 FILE_ATTR_VIEW_INDEX_PRESENT MFT_RECORD_IS_VIEW_INDEX (Index View)
|
|
2733
|
+
But we don't need them */
|
|
2734
|
+
attrib &= 0xFFFF;
|
|
2735
|
+
}
|
|
2736
|
+
|
|
2737
|
+
prop = attrib;
|
|
2738
|
+
break;
|
|
2739
|
+
}
|
|
2740
|
+
case kpidLinks: if (rec.MyNumNameLinks != 1) prop = (UInt32)rec.MyNumNameLinks; break;
|
|
2741
|
+
|
|
2742
|
+
case kpidNumAltStreams:
|
|
2743
|
+
{
|
|
2744
|
+
if (!item.IsAltStream())
|
|
2745
|
+
{
|
|
2746
|
+
unsigned num = 0;
|
|
2747
|
+
for (unsigned i = 0; i < rec.DataAttrs.Size(); num++)
|
|
2748
|
+
i = rec.DataAttrs[i].NextAttrIndex;
|
|
2749
|
+
if (num)
|
|
2750
|
+
{
|
|
2751
|
+
if (!rec.IsDir() && rec.DataAttrs[0].Name.IsEmpty())
|
|
2752
|
+
num--;
|
|
2753
|
+
if (num)
|
|
2754
|
+
prop = (UInt32)num;
|
|
2755
|
+
}
|
|
2756
|
+
}
|
|
2757
|
+
break;
|
|
2758
|
+
}
|
|
2759
|
+
|
|
2760
|
+
case kpidSize: if (data) prop = data->GetSize(); else if (!item.IsDir()) prop = (UInt64)0; break;
|
|
2761
|
+
case kpidPackSize: if (data) prop = data->GetPackSize(); else if (!item.IsDir()) prop = (UInt64)0; break;
|
|
2762
|
+
case kpidNumBlocks: if (data) prop = (UInt32)rec.GetNumExtents(item.DataIndex, Header.ClusterSizeLog, Header.NumClusters); break;
|
|
2763
|
+
}
|
|
2764
|
+
}
|
|
2765
|
+
prop.Detach(value);
|
|
2766
|
+
return S_OK;
|
|
2767
|
+
COM_TRY_END
|
|
2768
|
+
}
|
|
2769
|
+
|
|
2770
|
+
|
|
2771
|
+
Z7_COM7F_IMF(CHandler::Open(IInStream *stream, const UInt64 *, IArchiveOpenCallback *callback))
|
|
2772
|
+
{
|
|
2773
|
+
COM_TRY_BEGIN
|
|
2774
|
+
{
|
|
2775
|
+
OpenCallback = callback;
|
|
2776
|
+
InStream = stream;
|
|
2777
|
+
HRESULT res;
|
|
2778
|
+
try
|
|
2779
|
+
{
|
|
2780
|
+
res = CDatabase::Open();
|
|
2781
|
+
if (res == S_OK)
|
|
2782
|
+
return S_OK;
|
|
2783
|
+
}
|
|
2784
|
+
catch(...)
|
|
2785
|
+
{
|
|
2786
|
+
Close();
|
|
2787
|
+
throw;
|
|
2788
|
+
}
|
|
2789
|
+
Close();
|
|
2790
|
+
return res;
|
|
2791
|
+
}
|
|
2792
|
+
COM_TRY_END
|
|
2793
|
+
}
|
|
2794
|
+
|
|
2795
|
+
Z7_COM7F_IMF(CHandler::Close())
|
|
2796
|
+
{
|
|
2797
|
+
ClearAndClose();
|
|
2798
|
+
return S_OK;
|
|
2799
|
+
}
|
|
2800
|
+
|
|
2801
|
+
Z7_COM7F_IMF(CHandler::Extract(const UInt32 *indices, UInt32 numItems,
|
|
2802
|
+
Int32 testMode, IArchiveExtractCallback *extractCallback))
|
|
2803
|
+
{
|
|
2804
|
+
COM_TRY_BEGIN
|
|
2805
|
+
const bool allFilesMode = (numItems == (UInt32)(Int32)-1);
|
|
2806
|
+
if (allFilesMode)
|
|
2807
|
+
numItems = Items.Size() + VirtFolderNames.Size();
|
|
2808
|
+
if (numItems == 0)
|
|
2809
|
+
return S_OK;
|
|
2810
|
+
UInt32 i;
|
|
2811
|
+
UInt64 totalSize = 0;
|
|
2812
|
+
for (i = 0; i < numItems; i++)
|
|
2813
|
+
{
|
|
2814
|
+
const UInt32 index = allFilesMode ? i : indices[i];
|
|
2815
|
+
if (index >= Items.Size())
|
|
2816
|
+
continue;
|
|
2817
|
+
const CItem &item = Items[allFilesMode ? i : indices[i]];
|
|
2818
|
+
const CMftRec &rec = Recs[item.RecIndex];
|
|
2819
|
+
if (item.DataIndex >= 0)
|
|
2820
|
+
totalSize += rec.GetSize((unsigned)item.DataIndex);
|
|
2821
|
+
}
|
|
2822
|
+
RINOK(extractCallback->SetTotal(totalSize))
|
|
2823
|
+
|
|
2824
|
+
CMyComPtr2_Create<ICompressProgressInfo, CLocalProgress> lps;
|
|
2825
|
+
lps->Init(extractCallback, false);
|
|
2826
|
+
CMyComPtr2_Create<ICompressCoder, NCompress::CCopyCoder> copyCoder;
|
|
2827
|
+
CMyComPtr2_Create<ISequentialOutStream, CDummyOutStream> outStream;
|
|
2828
|
+
CMyComPtr2<IInStream, CInStream> inStream_Object;
|
|
2829
|
+
UInt64 totalPackSize;
|
|
2830
|
+
totalSize = totalPackSize = 0;
|
|
2831
|
+
|
|
2832
|
+
for (i = 0;; i++)
|
|
2833
|
+
{
|
|
2834
|
+
lps->InSize = totalPackSize;
|
|
2835
|
+
lps->OutSize = totalSize;
|
|
2836
|
+
RINOK(lps->SetCur())
|
|
2837
|
+
if (i >= numItems)
|
|
2838
|
+
break;
|
|
2839
|
+
|
|
2840
|
+
CMyComPtr<ISequentialOutStream> realOutStream;
|
|
2841
|
+
const Int32 askMode = testMode ?
|
|
2842
|
+
NExtract::NAskMode::kTest :
|
|
2843
|
+
NExtract::NAskMode::kExtract;
|
|
2844
|
+
const UInt32 index = allFilesMode ? i : indices[i];
|
|
2845
|
+
RINOK(extractCallback->GetStream(index, &realOutStream, askMode))
|
|
2846
|
+
|
|
2847
|
+
if (index >= Items.Size() || Items[index].IsDir())
|
|
2848
|
+
{
|
|
2849
|
+
RINOK(extractCallback->PrepareOperation(askMode))
|
|
2850
|
+
RINOK(extractCallback->SetOperationResult(NExtract::NOperationResult::kOK))
|
|
2851
|
+
continue;
|
|
2852
|
+
}
|
|
2853
|
+
|
|
2854
|
+
if (!testMode && !realOutStream)
|
|
2855
|
+
continue;
|
|
2856
|
+
RINOK(extractCallback->PrepareOperation(askMode))
|
|
2857
|
+
|
|
2858
|
+
outStream->SetStream(realOutStream);
|
|
2859
|
+
realOutStream.Release();
|
|
2860
|
+
outStream->Init();
|
|
2861
|
+
|
|
2862
|
+
const CItem &item = Items[index];
|
|
2863
|
+
const CMftRec &rec = Recs[item.RecIndex];
|
|
2864
|
+
UInt64 unpackSize = 0;
|
|
2865
|
+
if (item.DataIndex >= 0)
|
|
2866
|
+
{
|
|
2867
|
+
const CAttr &data = rec.DataAttrs[item.DataIndex];
|
|
2868
|
+
totalPackSize += data.GetPackSize();
|
|
2869
|
+
unpackSize = data.GetSize();
|
|
2870
|
+
totalSize += unpackSize;
|
|
2871
|
+
}
|
|
2872
|
+
int res = NExtract::NOperationResult::kDataError;
|
|
2873
|
+
{
|
|
2874
|
+
CMyComPtr<IInStream> inStream;
|
|
2875
|
+
HRESULT hres = rec.GetStream(InStream, item.DataIndex,
|
|
2876
|
+
Header.ClusterSizeLog, Header.NumClusters, &inStream, &inStream_Object);
|
|
2877
|
+
if (hres == S_FALSE)
|
|
2878
|
+
res = NExtract::NOperationResult::kUnsupportedMethod;
|
|
2879
|
+
else
|
|
2880
|
+
{
|
|
2881
|
+
RINOK(hres)
|
|
2882
|
+
if (inStream)
|
|
2883
|
+
{
|
|
2884
|
+
hres = copyCoder.Interface()->Code(inStream, outStream, NULL, NULL, lps);
|
|
2885
|
+
if (hres == S_OK)
|
|
2886
|
+
{
|
|
2887
|
+
// if (copyCoder->TotalSize == unpackSize)
|
|
2888
|
+
res = NExtract::NOperationResult::kOK;
|
|
2889
|
+
}
|
|
2890
|
+
else if (hres != S_FALSE)
|
|
2891
|
+
return hres;
|
|
2892
|
+
}
|
|
2893
|
+
}
|
|
2894
|
+
}
|
|
2895
|
+
outStream->ReleaseStream();
|
|
2896
|
+
RINOK(extractCallback->SetOperationResult(res))
|
|
2897
|
+
}
|
|
2898
|
+
return S_OK;
|
|
2899
|
+
COM_TRY_END
|
|
2900
|
+
}
|
|
2901
|
+
|
|
2902
|
+
Z7_COM7F_IMF(CHandler::GetNumberOfItems(UInt32 *numItems))
|
|
2903
|
+
{
|
|
2904
|
+
*numItems = Items.Size() + VirtFolderNames.Size();
|
|
2905
|
+
return S_OK;
|
|
2906
|
+
}
|
|
2907
|
+
|
|
2908
|
+
Z7_COM7F_IMF(CHandler::SetProperties(const wchar_t * const *names, const PROPVARIANT *values, UInt32 numProps))
|
|
2909
|
+
{
|
|
2910
|
+
InitProps();
|
|
2911
|
+
|
|
2912
|
+
for (UInt32 i = 0; i < numProps; i++)
|
|
2913
|
+
{
|
|
2914
|
+
const wchar_t *name = names[i];
|
|
2915
|
+
const PROPVARIANT &prop = values[i];
|
|
2916
|
+
|
|
2917
|
+
if (StringsAreEqualNoCase_Ascii(name, "ld"))
|
|
2918
|
+
{
|
|
2919
|
+
RINOK(PROPVARIANT_to_bool(prop, _showDeletedFiles))
|
|
2920
|
+
}
|
|
2921
|
+
else if (StringsAreEqualNoCase_Ascii(name, "ls"))
|
|
2922
|
+
{
|
|
2923
|
+
RINOK(PROPVARIANT_to_bool(prop, _showSystemFiles))
|
|
2924
|
+
}
|
|
2925
|
+
else if (IsString1PrefixedByString2_NoCase_Ascii(name, "mt"))
|
|
2926
|
+
{
|
|
2927
|
+
}
|
|
2928
|
+
else if (IsString1PrefixedByString2_NoCase_Ascii(name, "memuse"))
|
|
2929
|
+
{
|
|
2930
|
+
}
|
|
2931
|
+
else
|
|
2932
|
+
return E_INVALIDARG;
|
|
2933
|
+
}
|
|
2934
|
+
return S_OK;
|
|
2935
|
+
}
|
|
2936
|
+
|
|
2937
|
+
REGISTER_ARC_I(
|
|
2938
|
+
"NTFS", "ntfs img", NULL, 0xD9,
|
|
2939
|
+
k_Signature,
|
|
2940
|
+
3,
|
|
2941
|
+
0,
|
|
2942
|
+
NULL)
|
|
2943
|
+
|
|
2944
|
+
}}
|