seven_zip_ruby 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +25 -0
- data/.travis.yml +10 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +39 -0
- data/README.md +176 -0
- data/Rakefile +47 -0
- data/ext/C/Types.h +254 -0
- data/ext/CPP/7zip/Archive/IArchive.h +234 -0
- data/ext/CPP/7zip/IDecl.h +15 -0
- data/ext/CPP/7zip/IPassword.h +24 -0
- data/ext/CPP/7zip/IProgress.h +33 -0
- data/ext/CPP/7zip/IStream.h +58 -0
- data/ext/CPP/7zip/PropID.h +76 -0
- data/ext/CPP/Common/MyCom.h +225 -0
- data/ext/CPP/Common/MyGuidDef.h +54 -0
- data/ext/CPP/Common/MyInitGuid.h +22 -0
- data/ext/CPP/Common/MyUnknown.h +13 -0
- data/ext/CPP/Common/MyWindows.h +204 -0
- data/ext/CPP/Common/Types.h +11 -0
- data/ext/CPP/Windows/PropVariant.h +56 -0
- data/ext/CPP/include_windows/basetyps.h +19 -0
- data/ext/CPP/include_windows/tchar.h +89 -0
- data/ext/CPP/include_windows/windows.h +194 -0
- data/ext/p7zip/Asm/x64/7zCrcT8U.asm +103 -0
- data/ext/p7zip/Asm/x86/7zCrcT8U.asm +101 -0
- data/ext/p7zip/C/7zBuf.h +39 -0
- data/ext/p7zip/C/7zBuf2.c +45 -0
- data/ext/p7zip/C/7zCrc.c +76 -0
- data/ext/p7zip/C/7zCrc.h +25 -0
- data/ext/p7zip/C/7zCrcOpt.c +34 -0
- data/ext/p7zip/C/7zCrcT8.c +43 -0
- data/ext/p7zip/C/7zStream.c +169 -0
- data/ext/p7zip/C/7zVersion.h +7 -0
- data/ext/p7zip/C/Aes.c +284 -0
- data/ext/p7zip/C/Aes.h +38 -0
- data/ext/p7zip/C/Alloc.back3 +238 -0
- data/ext/p7zip/C/Alloc.c +280 -0
- data/ext/p7zip/C/Alloc.c.back +243 -0
- data/ext/p7zip/C/Alloc.c.back2 +222 -0
- data/ext/p7zip/C/Alloc.h +27 -0
- data/ext/p7zip/C/Bra.c +133 -0
- data/ext/p7zip/C/Bra.h +68 -0
- data/ext/p7zip/C/Bra86.c +85 -0
- data/ext/p7zip/C/BraIA64.c +67 -0
- data/ext/p7zip/C/BwtSort.c +516 -0
- data/ext/p7zip/C/BwtSort.h +30 -0
- data/ext/p7zip/C/CpuArch.c +168 -0
- data/ext/p7zip/C/CpuArch.h +155 -0
- data/ext/p7zip/C/Delta.c +62 -0
- data/ext/p7zip/C/Delta.h +23 -0
- data/ext/p7zip/C/HuffEnc.c +146 -0
- data/ext/p7zip/C/HuffEnc.h +27 -0
- data/ext/p7zip/C/LzFind.c +761 -0
- data/ext/p7zip/C/LzFind.h +115 -0
- data/ext/p7zip/C/LzFindMt.c +793 -0
- data/ext/p7zip/C/LzFindMt.h +105 -0
- data/ext/p7zip/C/LzHash.h +54 -0
- data/ext/p7zip/C/Lzma2Dec.c +356 -0
- data/ext/p7zip/C/Lzma2Dec.h +84 -0
- data/ext/p7zip/C/Lzma2Enc.c +477 -0
- data/ext/p7zip/C/Lzma2Enc.h +66 -0
- data/ext/p7zip/C/LzmaDec.c +999 -0
- data/ext/p7zip/C/LzmaDec.h +231 -0
- data/ext/p7zip/C/LzmaEnc.c +2268 -0
- data/ext/p7zip/C/LzmaEnc.h +80 -0
- data/ext/p7zip/C/LzmaUtil/Lzma86Dec.c +61 -0
- data/ext/p7zip/C/LzmaUtil/Lzma86Dec.h +51 -0
- data/ext/p7zip/C/LzmaUtil/Lzma86Enc.c +113 -0
- data/ext/p7zip/C/LzmaUtil/Lzma86Enc.h +78 -0
- data/ext/p7zip/C/MtCoder.c +327 -0
- data/ext/p7zip/C/MtCoder.h +98 -0
- data/ext/p7zip/C/Ppmd.h +85 -0
- data/ext/p7zip/C/Ppmd7.c +708 -0
- data/ext/p7zip/C/Ppmd7.h +140 -0
- data/ext/p7zip/C/Ppmd7Dec.c +187 -0
- data/ext/p7zip/C/Ppmd7Enc.c +185 -0
- data/ext/p7zip/C/Ppmd8.c +1120 -0
- data/ext/p7zip/C/Ppmd8.h +133 -0
- data/ext/p7zip/C/Ppmd8Dec.c +155 -0
- data/ext/p7zip/C/Ppmd8Enc.c +161 -0
- data/ext/p7zip/C/RotateDefs.h +20 -0
- data/ext/p7zip/C/Sha256.c +204 -0
- data/ext/p7zip/C/Sha256.h +26 -0
- data/ext/p7zip/C/Sort.c +93 -0
- data/ext/p7zip/C/Sort.h +20 -0
- data/ext/p7zip/C/Threads.c +582 -0
- data/ext/p7zip/C/Threads.h +123 -0
- data/ext/p7zip/C/Types.h +254 -0
- data/ext/p7zip/C/Xz.c +88 -0
- data/ext/p7zip/C/Xz.h +252 -0
- data/ext/p7zip/C/XzCrc64.c +33 -0
- data/ext/p7zip/C/XzCrc64.h +26 -0
- data/ext/p7zip/C/XzDec.c +875 -0
- data/ext/p7zip/C/XzEnc.c +497 -0
- data/ext/p7zip/C/XzEnc.h +25 -0
- data/ext/p7zip/C/XzIn.c +306 -0
- data/ext/p7zip/CPP/7zip/Archive/7z/7zCompressionMode.cpp +3 -0
- data/ext/p7zip/CPP/7zip/Archive/7z/7zCompressionMode.h +50 -0
- data/ext/p7zip/CPP/7zip/Archive/7z/7zDecode.cpp +332 -0
- data/ext/p7zip/CPP/7zip/Archive/7z/7zDecode.h +68 -0
- data/ext/p7zip/CPP/7zip/Archive/7z/7zEncode.cpp +444 -0
- data/ext/p7zip/CPP/7zip/Archive/7z/7zEncode.h +55 -0
- data/ext/p7zip/CPP/7zip/Archive/7z/7zExtract.cpp +270 -0
- data/ext/p7zip/CPP/7zip/Archive/7z/7zFolderInStream.cpp +123 -0
- data/ext/p7zip/CPP/7zip/Archive/7z/7zFolderInStream.h +58 -0
- data/ext/p7zip/CPP/7zip/Archive/7z/7zFolderOutStream.cpp +149 -0
- data/ext/p7zip/CPP/7zip/Archive/7z/7zFolderOutStream.h +58 -0
- data/ext/p7zip/CPP/7zip/Archive/7z/7zHandler.cpp +482 -0
- data/ext/p7zip/CPP/7zip/Archive/7z/7zHandler.h +119 -0
- data/ext/p7zip/CPP/7zip/Archive/7z/7zHandlerOut.cpp +483 -0
- data/ext/p7zip/CPP/7zip/Archive/7z/7zHeader.cpp +14 -0
- data/ext/p7zip/CPP/7zip/Archive/7z/7zHeader.h +97 -0
- data/ext/p7zip/CPP/7zip/Archive/7z/7zIn.cpp +1276 -0
- data/ext/p7zip/CPP/7zip/Archive/7z/7zIn.h +245 -0
- data/ext/p7zip/CPP/7zip/Archive/7z/7zItem.h +268 -0
- data/ext/p7zip/CPP/7zip/Archive/7z/7zOut.cpp +866 -0
- data/ext/p7zip/CPP/7zip/Archive/7z/7zOut.h +152 -0
- data/ext/p7zip/CPP/7zip/Archive/7z/7zProperties.cpp +164 -0
- data/ext/p7zip/CPP/7zip/Archive/7z/7zProperties.h +22 -0
- data/ext/p7zip/CPP/7zip/Archive/7z/7zRegister.cpp +18 -0
- data/ext/p7zip/CPP/7zip/Archive/7z/7zSpecStream.cpp +24 -0
- data/ext/p7zip/CPP/7zip/Archive/7z/7zSpecStream.h +35 -0
- data/ext/p7zip/CPP/7zip/Archive/7z/7zUpdate.cpp +1216 -0
- data/ext/p7zip/CPP/7zip/Archive/7z/7zUpdate.h +88 -0
- data/ext/p7zip/CPP/7zip/Archive/ApmHandler.cpp +356 -0
- data/ext/p7zip/CPP/7zip/Archive/ArchiveExports.cpp +135 -0
- data/ext/p7zip/CPP/7zip/Archive/ArjHandler.cpp +798 -0
- data/ext/p7zip/CPP/7zip/Archive/Bz2Handler.cpp +423 -0
- data/ext/p7zip/CPP/7zip/Archive/Cab/CabBlockInStream.cpp +189 -0
- data/ext/p7zip/CPP/7zip/Archive/Cab/CabBlockInStream.h +44 -0
- data/ext/p7zip/CPP/7zip/Archive/Cab/CabHandler.cpp +929 -0
- data/ext/p7zip/CPP/7zip/Archive/Cab/CabHandler.h +28 -0
- data/ext/p7zip/CPP/7zip/Archive/Cab/CabHeader.cpp +15 -0
- data/ext/p7zip/CPP/7zip/Archive/Cab/CabHeader.h +44 -0
- data/ext/p7zip/CPP/7zip/Archive/Cab/CabIn.cpp +272 -0
- data/ext/p7zip/CPP/7zip/Archive/Cab/CabIn.h +161 -0
- data/ext/p7zip/CPP/7zip/Archive/Cab/CabItem.h +63 -0
- data/ext/p7zip/CPP/7zip/Archive/Cab/CabRegister.cpp +13 -0
- data/ext/p7zip/CPP/7zip/Archive/Chm/ChmHandler.cpp +721 -0
- data/ext/p7zip/CPP/7zip/Archive/Chm/ChmHandler.h +29 -0
- data/ext/p7zip/CPP/7zip/Archive/Chm/ChmHeader.cpp +24 -0
- data/ext/p7zip/CPP/7zip/Archive/Chm/ChmHeader.h +28 -0
- data/ext/p7zip/CPP/7zip/Archive/Chm/ChmIn.cpp +937 -0
- data/ext/p7zip/CPP/7zip/Archive/Chm/ChmIn.h +244 -0
- data/ext/p7zip/CPP/7zip/Archive/Chm/ChmRegister.cpp +13 -0
- data/ext/p7zip/CPP/7zip/Archive/Com/ComHandler.cpp +239 -0
- data/ext/p7zip/CPP/7zip/Archive/Com/ComHandler.h +28 -0
- data/ext/p7zip/CPP/7zip/Archive/Com/ComIn.cpp +389 -0
- data/ext/p7zip/CPP/7zip/Archive/Com/ComIn.h +119 -0
- data/ext/p7zip/CPP/7zip/Archive/Com/ComRegister.cpp +13 -0
- data/ext/p7zip/CPP/7zip/Archive/Common/CoderMixer2.cpp +121 -0
- data/ext/p7zip/CPP/7zip/Archive/Common/CoderMixer2.h +174 -0
- data/ext/p7zip/CPP/7zip/Archive/Common/CoderMixer2MT.cpp +240 -0
- data/ext/p7zip/CPP/7zip/Archive/Common/CoderMixer2MT.h +80 -0
- data/ext/p7zip/CPP/7zip/Archive/Common/CoderMixer2ST.cpp +239 -0
- data/ext/p7zip/CPP/7zip/Archive/Common/CoderMixer2ST.h +88 -0
- data/ext/p7zip/CPP/7zip/Archive/Common/CrossThreadProgress.cpp +15 -0
- data/ext/p7zip/CPP/7zip/Archive/Common/CrossThreadProgress.h +37 -0
- data/ext/p7zip/CPP/7zip/Archive/Common/DummyOutStream.cpp +22 -0
- data/ext/p7zip/CPP/7zip/Archive/Common/DummyOutStream.h +24 -0
- data/ext/p7zip/CPP/7zip/Archive/Common/FindSignature.cpp +62 -0
- data/ext/p7zip/CPP/7zip/Archive/Common/FindSignature.h +12 -0
- data/ext/p7zip/CPP/7zip/Archive/Common/HandlerOut.cpp +623 -0
- data/ext/p7zip/CPP/7zip/Archive/Common/HandlerOut.h +87 -0
- data/ext/p7zip/CPP/7zip/Archive/Common/InStreamWithCRC.cpp +42 -0
- data/ext/p7zip/CPP/7zip/Archive/Common/InStreamWithCRC.h +67 -0
- data/ext/p7zip/CPP/7zip/Archive/Common/ItemNameUtils.cpp +61 -0
- data/ext/p7zip/CPP/7zip/Archive/Common/ItemNameUtils.h +24 -0
- data/ext/p7zip/CPP/7zip/Archive/Common/MultiStream.cpp +190 -0
- data/ext/p7zip/CPP/7zip/Archive/Common/MultiStream.h +84 -0
- data/ext/p7zip/CPP/7zip/Archive/Common/OutStreamWithCRC.cpp +18 -0
- data/ext/p7zip/CPP/7zip/Archive/Common/OutStreamWithCRC.h +36 -0
- data/ext/p7zip/CPP/7zip/Archive/Common/OutStreamWithSha1.cpp +18 -0
- data/ext/p7zip/CPP/7zip/Archive/Common/OutStreamWithSha1.h +36 -0
- data/ext/p7zip/CPP/7zip/Archive/Common/ParseProperties.cpp +177 -0
- data/ext/p7zip/CPP/7zip/Archive/Common/ParseProperties.h +18 -0
- data/ext/p7zip/CPP/7zip/Archive/CpioHandler.cpp +624 -0
- data/ext/p7zip/CPP/7zip/Archive/CramfsHandler.cpp +644 -0
- data/ext/p7zip/CPP/7zip/Archive/DebHandler.cpp +413 -0
- data/ext/p7zip/CPP/7zip/Archive/DeflateProps.cpp +118 -0
- data/ext/p7zip/CPP/7zip/Archive/DeflateProps.h +35 -0
- data/ext/p7zip/CPP/7zip/Archive/DllExports2.cpp +76 -0
- data/ext/p7zip/CPP/7zip/Archive/DmgHandler.cpp +918 -0
- data/ext/p7zip/CPP/7zip/Archive/ElfHandler.cpp +534 -0
- data/ext/p7zip/CPP/7zip/Archive/FatHandler.cpp +996 -0
- data/ext/p7zip/CPP/7zip/Archive/FlvHandler.cpp +544 -0
- data/ext/p7zip/CPP/7zip/Archive/GzHandler.cpp +698 -0
- data/ext/p7zip/CPP/7zip/Archive/Hfs/HfsHandler.cpp +243 -0
- data/ext/p7zip/CPP/7zip/Archive/Hfs/HfsHandler.h +26 -0
- data/ext/p7zip/CPP/7zip/Archive/Hfs/HfsIn.cpp +480 -0
- data/ext/p7zip/CPP/7zip/Archive/Hfs/HfsIn.h +154 -0
- data/ext/p7zip/CPP/7zip/Archive/Hfs/HfsRegister.cpp +13 -0
- data/ext/p7zip/CPP/7zip/Archive/IArchive.h +234 -0
- data/ext/p7zip/CPP/7zip/Archive/Iso/IsoHandler.cpp +326 -0
- data/ext/p7zip/CPP/7zip/Archive/Iso/IsoHandler.h +30 -0
- data/ext/p7zip/CPP/7zip/Archive/Iso/IsoHeader.cpp +21 -0
- data/ext/p7zip/CPP/7zip/Archive/Iso/IsoHeader.h +61 -0
- data/ext/p7zip/CPP/7zip/Archive/Iso/IsoIn.cpp +453 -0
- data/ext/p7zip/CPP/7zip/Archive/Iso/IsoIn.h +315 -0
- data/ext/p7zip/CPP/7zip/Archive/Iso/IsoItem.h +141 -0
- data/ext/p7zip/CPP/7zip/Archive/Iso/IsoRegister.cpp +13 -0
- data/ext/p7zip/CPP/7zip/Archive/LzhHandler.cpp +775 -0
- data/ext/p7zip/CPP/7zip/Archive/LzmaHandler.cpp +430 -0
- data/ext/p7zip/CPP/7zip/Archive/MachoHandler.cpp +500 -0
- data/ext/p7zip/CPP/7zip/Archive/MbrHandler.cpp +507 -0
- data/ext/p7zip/CPP/7zip/Archive/MslzHandler.cpp +257 -0
- data/ext/p7zip/CPP/7zip/Archive/MubHandler.cpp +266 -0
- data/ext/p7zip/CPP/7zip/Archive/Nsis/NsisDecode.cpp +130 -0
- data/ext/p7zip/CPP/7zip/Archive/Nsis/NsisDecode.h +47 -0
- data/ext/p7zip/CPP/7zip/Archive/Nsis/NsisHandler.cpp +510 -0
- data/ext/p7zip/CPP/7zip/Archive/Nsis/NsisHandler.h +43 -0
- data/ext/p7zip/CPP/7zip/Archive/Nsis/NsisIn.cpp +1461 -0
- data/ext/p7zip/CPP/7zip/Archive/Nsis/NsisIn.h +181 -0
- data/ext/p7zip/CPP/7zip/Archive/Nsis/NsisRegister.cpp +13 -0
- data/ext/p7zip/CPP/7zip/Archive/NtfsHandler.cpp +1764 -0
- data/ext/p7zip/CPP/7zip/Archive/PeHandler.cpp +1752 -0
- data/ext/p7zip/CPP/7zip/Archive/PpmdHandler.cpp +456 -0
- data/ext/p7zip/CPP/7zip/Archive/Rar/RarHandler.cpp +869 -0
- data/ext/p7zip/CPP/7zip/Archive/Rar/RarHandler.h +66 -0
- data/ext/p7zip/CPP/7zip/Archive/Rar/RarHeader.cpp +21 -0
- data/ext/p7zip/CPP/7zip/Archive/Rar/RarHeader.h +205 -0
- data/ext/p7zip/CPP/7zip/Archive/Rar/RarIn.cpp +478 -0
- data/ext/p7zip/CPP/7zip/Archive/Rar/RarIn.h +123 -0
- data/ext/p7zip/CPP/7zip/Archive/Rar/RarItem.cpp +55 -0
- data/ext/p7zip/CPP/7zip/Archive/Rar/RarItem.h +79 -0
- data/ext/p7zip/CPP/7zip/Archive/Rar/RarRegister.cpp +13 -0
- data/ext/p7zip/CPP/7zip/Archive/Rar/RarVolumeInStream.cpp +78 -0
- data/ext/p7zip/CPP/7zip/Archive/Rar/RarVolumeInStream.h +49 -0
- data/ext/p7zip/CPP/7zip/Archive/RpmHandler.cpp +292 -0
- data/ext/p7zip/CPP/7zip/Archive/SplitHandler.cpp +366 -0
- data/ext/p7zip/CPP/7zip/Archive/SquashfsHandler.cpp +2155 -0
- data/ext/p7zip/CPP/7zip/Archive/SwfHandler.cpp +706 -0
- data/ext/p7zip/CPP/7zip/Archive/Tar/TarHandler.cpp +386 -0
- data/ext/p7zip/CPP/7zip/Archive/Tar/TarHandler.h +61 -0
- data/ext/p7zip/CPP/7zip/Archive/Tar/TarHandlerOut.cpp +122 -0
- data/ext/p7zip/CPP/7zip/Archive/Tar/TarHeader.cpp +25 -0
- data/ext/p7zip/CPP/7zip/Archive/Tar/TarHeader.h +108 -0
- data/ext/p7zip/CPP/7zip/Archive/Tar/TarIn.cpp +207 -0
- data/ext/p7zip/CPP/7zip/Archive/Tar/TarIn.h +17 -0
- data/ext/p7zip/CPP/7zip/Archive/Tar/TarItem.h +72 -0
- data/ext/p7zip/CPP/7zip/Archive/Tar/TarOut.cpp +187 -0
- data/ext/p7zip/CPP/7zip/Archive/Tar/TarOut.h +28 -0
- data/ext/p7zip/CPP/7zip/Archive/Tar/TarRegister.cpp +18 -0
- data/ext/p7zip/CPP/7zip/Archive/Tar/TarUpdate.cpp +139 -0
- data/ext/p7zip/CPP/7zip/Archive/Tar/TarUpdate.h +34 -0
- data/ext/p7zip/CPP/7zip/Archive/Udf/UdfHandler.cpp +451 -0
- data/ext/p7zip/CPP/7zip/Archive/Udf/UdfHandler.h +37 -0
- data/ext/p7zip/CPP/7zip/Archive/Udf/UdfIn.cpp +876 -0
- data/ext/p7zip/CPP/7zip/Archive/Udf/UdfIn.h +375 -0
- data/ext/p7zip/CPP/7zip/Archive/Udf/UdfRegister.cpp +13 -0
- data/ext/p7zip/CPP/7zip/Archive/VhdHandler.cpp +734 -0
- data/ext/p7zip/CPP/7zip/Archive/Wim/WimHandler.cpp +660 -0
- data/ext/p7zip/CPP/7zip/Archive/Wim/WimHandler.h +77 -0
- data/ext/p7zip/CPP/7zip/Archive/Wim/WimHandlerOut.cpp +639 -0
- data/ext/p7zip/CPP/7zip/Archive/Wim/WimIn.cpp +855 -0
- data/ext/p7zip/CPP/7zip/Archive/Wim/WimIn.h +297 -0
- data/ext/p7zip/CPP/7zip/Archive/Wim/WimRegister.cpp +18 -0
- data/ext/p7zip/CPP/7zip/Archive/XarHandler.cpp +588 -0
- data/ext/p7zip/CPP/7zip/Archive/XzHandler.cpp +707 -0
- data/ext/p7zip/CPP/7zip/Archive/ZHandler.cpp +161 -0
- data/ext/p7zip/CPP/7zip/Archive/Zip/ZipAddCommon.cpp +379 -0
- data/ext/p7zip/CPP/7zip/Archive/Zip/ZipAddCommon.h +56 -0
- data/ext/p7zip/CPP/7zip/Archive/Zip/ZipCompressionMode.h +42 -0
- data/ext/p7zip/CPP/7zip/Archive/Zip/ZipHandler.cpp +822 -0
- data/ext/p7zip/CPP/7zip/Archive/Zip/ZipHandler.h +101 -0
- data/ext/p7zip/CPP/7zip/Archive/Zip/ZipHandlerOut.cpp +537 -0
- data/ext/p7zip/CPP/7zip/Archive/Zip/ZipHeader.cpp +36 -0
- data/ext/p7zip/CPP/7zip/Archive/Zip/ZipHeader.h +284 -0
- data/ext/p7zip/CPP/7zip/Archive/Zip/ZipIn.cpp +893 -0
- data/ext/p7zip/CPP/7zip/Archive/Zip/ZipIn.h +125 -0
- data/ext/p7zip/CPP/7zip/Archive/Zip/ZipItem.cpp +181 -0
- data/ext/p7zip/CPP/7zip/Archive/Zip/ZipItem.h +281 -0
- data/ext/p7zip/CPP/7zip/Archive/Zip/ZipItemEx.h +34 -0
- data/ext/p7zip/CPP/7zip/Archive/Zip/ZipOut.cpp +289 -0
- data/ext/p7zip/CPP/7zip/Archive/Zip/ZipOut.h +56 -0
- data/ext/p7zip/CPP/7zip/Archive/Zip/ZipRegister.cpp +18 -0
- data/ext/p7zip/CPP/7zip/Archive/Zip/ZipUpdate.cpp +1076 -0
- data/ext/p7zip/CPP/7zip/Archive/Zip/ZipUpdate.h +58 -0
- data/ext/p7zip/CPP/7zip/Bundles/Format7zFree/makefile +328 -0
- data/ext/p7zip/CPP/7zip/Bundles/Format7zFree/makefile.depend +4962 -0
- data/ext/p7zip/CPP/7zip/Bundles/Format7zFree/makefile.list +265 -0
- data/ext/p7zip/CPP/7zip/CMAKE/CMakeLists_7zFM.txt +163 -0
- data/ext/p7zip/CPP/7zip/CMAKE/CMakeLists_7zG.txt +131 -0
- data/ext/p7zip/CPP/7zip/CMAKE/CMakeLists_7za.txt +253 -0
- data/ext/p7zip/CPP/7zip/CMAKE/CMakeLists_ALL.txt +32 -0
- data/ext/p7zip/CPP/7zip/CMAKE/CMakeLists_Format7zFree.txt +290 -0
- data/ext/p7zip/CPP/7zip/CMAKE/generate.sh +37 -0
- data/ext/p7zip/CPP/7zip/CMAKE/generate_xcode.sh +32 -0
- data/ext/p7zip/CPP/7zip/Common/CWrappers.cpp +226 -0
- data/ext/p7zip/CPP/7zip/Common/CWrappers.h +109 -0
- data/ext/p7zip/CPP/7zip/Common/CreateCoder.cpp +293 -0
- data/ext/p7zip/CPP/7zip/Common/CreateCoder.h +98 -0
- data/ext/p7zip/CPP/7zip/Common/FilePathAutoRename.cpp +55 -0
- data/ext/p7zip/CPP/7zip/Common/FilePathAutoRename.h +10 -0
- data/ext/p7zip/CPP/7zip/Common/FileStreams.cpp +273 -0
- data/ext/p7zip/CPP/7zip/Common/FileStreams.h +134 -0
- data/ext/p7zip/CPP/7zip/Common/FilterCoder.cpp +247 -0
- data/ext/p7zip/CPP/7zip/Common/FilterCoder.h +128 -0
- data/ext/p7zip/CPP/7zip/Common/InBuffer.cpp +83 -0
- data/ext/p7zip/CPP/7zip/Common/InBuffer.h +81 -0
- data/ext/p7zip/CPP/7zip/Common/InOutTempBuffer.cpp +122 -0
- data/ext/p7zip/CPP/7zip/Common/InOutTempBuffer.h +48 -0
- data/ext/p7zip/CPP/7zip/Common/LimitedStreams.cpp +154 -0
- data/ext/p7zip/CPP/7zip/Common/LimitedStreams.h +125 -0
- data/ext/p7zip/CPP/7zip/Common/LockedStream.cpp +23 -0
- data/ext/p7zip/CPP/7zip/Common/LockedStream.h +38 -0
- data/ext/p7zip/CPP/7zip/Common/MemBlocks.cpp +183 -0
- data/ext/p7zip/CPP/7zip/Common/MemBlocks.h +71 -0
- data/ext/p7zip/CPP/7zip/Common/MethodId.cpp +27 -0
- data/ext/p7zip/CPP/7zip/Common/MethodId.h +10 -0
- data/ext/p7zip/CPP/7zip/Common/MethodProps.cpp +99 -0
- data/ext/p7zip/CPP/7zip/Common/MethodProps.h +41 -0
- data/ext/p7zip/CPP/7zip/Common/OffsetStream.cpp +35 -0
- data/ext/p7zip/CPP/7zip/Common/OffsetStream.h +25 -0
- data/ext/p7zip/CPP/7zip/Common/OutBuffer.cpp +116 -0
- data/ext/p7zip/CPP/7zip/Common/OutBuffer.h +64 -0
- data/ext/p7zip/CPP/7zip/Common/OutMemStream.cpp +142 -0
- data/ext/p7zip/CPP/7zip/Common/OutMemStream.h +96 -0
- data/ext/p7zip/CPP/7zip/Common/ProgressMt.cpp +53 -0
- data/ext/p7zip/CPP/7zip/Common/ProgressMt.h +46 -0
- data/ext/p7zip/CPP/7zip/Common/ProgressUtils.cpp +42 -0
- data/ext/p7zip/CPP/7zip/Common/ProgressUtils.h +34 -0
- data/ext/p7zip/CPP/7zip/Common/RegisterArc.h +32 -0
- data/ext/p7zip/CPP/7zip/Common/RegisterCodec.h +33 -0
- data/ext/p7zip/CPP/7zip/Common/StreamBinder.cpp +152 -0
- data/ext/p7zip/CPP/7zip/Common/StreamBinder.h +38 -0
- data/ext/p7zip/CPP/7zip/Common/StreamObjects.cpp +221 -0
- data/ext/p7zip/CPP/7zip/Common/StreamObjects.h +135 -0
- data/ext/p7zip/CPP/7zip/Common/StreamUtils.cpp +56 -0
- data/ext/p7zip/CPP/7zip/Common/StreamUtils.h +13 -0
- data/ext/p7zip/CPP/7zip/Common/VirtThread.cpp +46 -0
- data/ext/p7zip/CPP/7zip/Common/VirtThread.h +23 -0
- data/ext/p7zip/CPP/7zip/Compress/ArjDecoder1.cpp +309 -0
- data/ext/p7zip/CPP/7zip/Compress/ArjDecoder1.h +98 -0
- data/ext/p7zip/CPP/7zip/Compress/ArjDecoder2.cpp +90 -0
- data/ext/p7zip/CPP/7zip/Compress/ArjDecoder2.h +59 -0
- data/ext/p7zip/CPP/7zip/Compress/BZip2Const.h +54 -0
- data/ext/p7zip/CPP/7zip/Compress/BZip2Crc.cpp +26 -0
- data/ext/p7zip/CPP/7zip/Compress/BZip2Crc.h +31 -0
- data/ext/p7zip/CPP/7zip/Compress/BZip2Decoder.cpp +943 -0
- data/ext/p7zip/CPP/7zip/Compress/BZip2Decoder.h +205 -0
- data/ext/p7zip/CPP/7zip/Compress/BZip2Encoder.cpp +895 -0
- data/ext/p7zip/CPP/7zip/Compress/BZip2Encoder.h +245 -0
- data/ext/p7zip/CPP/7zip/Compress/BZip2Register.cpp +20 -0
- data/ext/p7zip/CPP/7zip/Compress/Bcj2Coder.cpp +386 -0
- data/ext/p7zip/CPP/7zip/Compress/Bcj2Coder.h +115 -0
- data/ext/p7zip/CPP/7zip/Compress/Bcj2Register.cpp +19 -0
- data/ext/p7zip/CPP/7zip/Compress/BcjCoder.cpp +15 -0
- data/ext/p7zip/CPP/7zip/Compress/BcjCoder.h +19 -0
- data/ext/p7zip/CPP/7zip/Compress/BcjRegister.cpp +19 -0
- data/ext/p7zip/CPP/7zip/Compress/BitlDecoder.cpp +24 -0
- data/ext/p7zip/CPP/7zip/Compress/BitlDecoder.h +141 -0
- data/ext/p7zip/CPP/7zip/Compress/BitlEncoder.h +57 -0
- data/ext/p7zip/CPP/7zip/Compress/BitmDecoder.h +66 -0
- data/ext/p7zip/CPP/7zip/Compress/BitmEncoder.h +50 -0
- data/ext/p7zip/CPP/7zip/Compress/BranchCoder.cpp +19 -0
- data/ext/p7zip/CPP/7zip/Compress/BranchCoder.h +44 -0
- data/ext/p7zip/CPP/7zip/Compress/BranchMisc.cpp +37 -0
- data/ext/p7zip/CPP/7zip/Compress/BranchMisc.h +14 -0
- data/ext/p7zip/CPP/7zip/Compress/BranchRegister.cpp +30 -0
- data/ext/p7zip/CPP/7zip/Compress/ByteSwap.cpp +73 -0
- data/ext/p7zip/CPP/7zip/Compress/CodecExports.cpp +160 -0
- data/ext/p7zip/CPP/7zip/Compress/CopyCoder.cpp +67 -0
- data/ext/p7zip/CPP/7zip/Compress/CopyCoder.h +34 -0
- data/ext/p7zip/CPP/7zip/Compress/CopyRegister.cpp +14 -0
- data/ext/p7zip/CPP/7zip/Compress/Deflate64Register.cpp +20 -0
- data/ext/p7zip/CPP/7zip/Compress/DeflateConst.h +134 -0
- data/ext/p7zip/CPP/7zip/Compress/DeflateDecoder.cpp +353 -0
- data/ext/p7zip/CPP/7zip/Compress/DeflateDecoder.h +157 -0
- data/ext/p7zip/CPP/7zip/Compress/DeflateEncoder.cpp +986 -0
- data/ext/p7zip/CPP/7zip/Compress/DeflateEncoder.h +211 -0
- data/ext/p7zip/CPP/7zip/Compress/DeflateRegister.cpp +21 -0
- data/ext/p7zip/CPP/7zip/Compress/DeltaFilter.cpp +112 -0
- data/ext/p7zip/CPP/7zip/Compress/DllExports.cpp +39 -0
- data/ext/p7zip/CPP/7zip/Compress/DllExports2.cpp +28 -0
- data/ext/p7zip/CPP/7zip/Compress/HuffmanDecoder.h +89 -0
- data/ext/p7zip/CPP/7zip/Compress/ImplodeDecoder.cpp +219 -0
- data/ext/p7zip/CPP/7zip/Compress/ImplodeDecoder.h +57 -0
- data/ext/p7zip/CPP/7zip/Compress/ImplodeHuffmanDecoder.cpp +89 -0
- data/ext/p7zip/CPP/7zip/Compress/ImplodeHuffmanDecoder.h +34 -0
- data/ext/p7zip/CPP/7zip/Compress/LZMA_Alone/LzmaAlone.cpp +531 -0
- data/ext/p7zip/CPP/7zip/Compress/LZMA_Alone/LzmaBench.cpp +1018 -0
- data/ext/p7zip/CPP/7zip/Compress/LZMA_Alone/LzmaBench.h +48 -0
- data/ext/p7zip/CPP/7zip/Compress/LZMA_Alone/LzmaBenchCon.cpp +311 -0
- data/ext/p7zip/CPP/7zip/Compress/LZMA_Alone/LzmaBenchCon.h +20 -0
- data/ext/p7zip/CPP/7zip/Compress/LZMA_Alone/makefile +173 -0
- data/ext/p7zip/CPP/7zip/Compress/LzOutWindow.cpp +14 -0
- data/ext/p7zip/CPP/7zip/Compress/LzOutWindow.h +66 -0
- data/ext/p7zip/CPP/7zip/Compress/LzhDecoder.cpp +220 -0
- data/ext/p7zip/CPP/7zip/Compress/LzhDecoder.h +106 -0
- data/ext/p7zip/CPP/7zip/Compress/Lzma2Decoder.cpp +189 -0
- data/ext/p7zip/CPP/7zip/Compress/Lzma2Decoder.h +73 -0
- data/ext/p7zip/CPP/7zip/Compress/Lzma2Encoder.cpp +94 -0
- data/ext/p7zip/CPP/7zip/Compress/Lzma2Encoder.h +36 -0
- data/ext/p7zip/CPP/7zip/Compress/Lzma2Register.cpp +20 -0
- data/ext/p7zip/CPP/7zip/Compress/LzmaDecoder.cpp +252 -0
- data/ext/p7zip/CPP/7zip/Compress/LzmaDecoder.h +84 -0
- data/ext/p7zip/CPP/7zip/Compress/LzmaEncoder.cpp +149 -0
- data/ext/p7zip/CPP/7zip/Compress/LzmaEncoder.h +36 -0
- data/ext/p7zip/CPP/7zip/Compress/LzmaRegister.cpp +20 -0
- data/ext/p7zip/CPP/7zip/Compress/Lzx.h +61 -0
- data/ext/p7zip/CPP/7zip/Compress/Lzx86Converter.cpp +90 -0
- data/ext/p7zip/CPP/7zip/Compress/Lzx86Converter.h +46 -0
- data/ext/p7zip/CPP/7zip/Compress/LzxDecoder.cpp +387 -0
- data/ext/p7zip/CPP/7zip/Compress/LzxDecoder.h +159 -0
- data/ext/p7zip/CPP/7zip/Compress/Mtf8.h +193 -0
- data/ext/p7zip/CPP/7zip/Compress/PpmdDecoder.cpp +167 -0
- data/ext/p7zip/CPP/7zip/Compress/PpmdDecoder.h +78 -0
- data/ext/p7zip/CPP/7zip/Compress/PpmdEncoder.cpp +119 -0
- data/ext/p7zip/CPP/7zip/Compress/PpmdEncoder.h +48 -0
- data/ext/p7zip/CPP/7zip/Compress/PpmdRegister.cpp +21 -0
- data/ext/p7zip/CPP/7zip/Compress/PpmdZip.cpp +223 -0
- data/ext/p7zip/CPP/7zip/Compress/PpmdZip.h +72 -0
- data/ext/p7zip/CPP/7zip/Compress/QuantumDecoder.cpp +175 -0
- data/ext/p7zip/CPP/7zip/Compress/QuantumDecoder.h +264 -0
- data/ext/p7zip/CPP/7zip/Compress/RangeCoder.h +205 -0
- data/ext/p7zip/CPP/7zip/Compress/RangeCoderBit.h +114 -0
- data/ext/p7zip/CPP/7zip/Compress/Rar/makefile +34 -0
- data/ext/p7zip/CPP/7zip/Compress/Rar/makefile.depend +158 -0
- data/ext/p7zip/CPP/7zip/Compress/Rar/makefile.list +64 -0
- data/ext/p7zip/CPP/7zip/Compress/Rar1Decoder.cpp +480 -0
- data/ext/p7zip/CPP/7zip/Compress/Rar1Decoder.h +88 -0
- data/ext/p7zip/CPP/7zip/Compress/Rar2Decoder.cpp +391 -0
- data/ext/p7zip/CPP/7zip/Compress/Rar2Decoder.h +174 -0
- data/ext/p7zip/CPP/7zip/Compress/Rar3Decoder.cpp +897 -0
- data/ext/p7zip/CPP/7zip/Compress/Rar3Decoder.h +267 -0
- data/ext/p7zip/CPP/7zip/Compress/Rar3Vm.cpp +1091 -0
- data/ext/p7zip/CPP/7zip/Compress/Rar3Vm.h +179 -0
- data/ext/p7zip/CPP/7zip/Compress/RarCodecsRegister.cpp +26 -0
- data/ext/p7zip/CPP/7zip/Compress/ShrinkDecoder.cpp +145 -0
- data/ext/p7zip/CPP/7zip/Compress/ShrinkDecoder.h +38 -0
- data/ext/p7zip/CPP/7zip/Compress/ZDecoder.cpp +159 -0
- data/ext/p7zip/CPP/7zip/Compress/ZDecoder.h +42 -0
- data/ext/p7zip/CPP/7zip/Compress/ZlibDecoder.cpp +89 -0
- data/ext/p7zip/CPP/7zip/Compress/ZlibDecoder.h +48 -0
- data/ext/p7zip/CPP/7zip/Compress/ZlibEncoder.cpp +61 -0
- data/ext/p7zip/CPP/7zip/Compress/ZlibEncoder.h +48 -0
- data/ext/p7zip/CPP/7zip/Crypto/7zAes.cpp +244 -0
- data/ext/p7zip/CPP/7zip/Crypto/7zAes.h +117 -0
- data/ext/p7zip/CPP/7zip/Crypto/7zAesRegister.cpp +18 -0
- data/ext/p7zip/CPP/7zip/Crypto/HmacSha1.cpp +109 -0
- data/ext/p7zip/CPP/7zip/Crypto/HmacSha1.h +39 -0
- data/ext/p7zip/CPP/7zip/Crypto/MyAes.cpp +48 -0
- data/ext/p7zip/CPP/7zip/Crypto/MyAes.h +38 -0
- data/ext/p7zip/CPP/7zip/Crypto/Pbkdf2HmacSha1.cpp +83 -0
- data/ext/p7zip/CPP/7zip/Crypto/Pbkdf2HmacSha1.h +21 -0
- data/ext/p7zip/CPP/7zip/Crypto/RandGen.cpp +107 -0
- data/ext/p7zip/CPP/7zip/Crypto/RandGen.h +21 -0
- data/ext/p7zip/CPP/7zip/Crypto/Rar20Crypto.cpp +133 -0
- data/ext/p7zip/CPP/7zip/Crypto/Rar20Crypto.h +50 -0
- data/ext/p7zip/CPP/7zip/Crypto/RarAes.cpp +134 -0
- data/ext/p7zip/CPP/7zip/Crypto/RarAes.h +47 -0
- data/ext/p7zip/CPP/7zip/Crypto/Sha1.cpp +229 -0
- data/ext/p7zip/CPP/7zip/Crypto/Sha1.h +68 -0
- data/ext/p7zip/CPP/7zip/Crypto/WzAes.cpp +221 -0
- data/ext/p7zip/CPP/7zip/Crypto/WzAes.h +125 -0
- data/ext/p7zip/CPP/7zip/Crypto/ZipCrypto.cpp +88 -0
- data/ext/p7zip/CPP/7zip/Crypto/ZipCrypto.h +56 -0
- data/ext/p7zip/CPP/7zip/Crypto/ZipStrong.cpp +164 -0
- data/ext/p7zip/CPP/7zip/Crypto/ZipStrong.h +47 -0
- data/ext/p7zip/CPP/7zip/Guid.txt +170 -0
- data/ext/p7zip/CPP/7zip/ICoder.h +186 -0
- data/ext/p7zip/CPP/7zip/IDecl.h +15 -0
- data/ext/p7zip/CPP/7zip/IPassword.h +24 -0
- data/ext/p7zip/CPP/7zip/IProgress.h +33 -0
- data/ext/p7zip/CPP/7zip/IStream.h +58 -0
- data/ext/p7zip/CPP/7zip/MyVersion.h +11 -0
- data/ext/p7zip/CPP/7zip/PREMAKE/generate.sh +18 -0
- data/ext/p7zip/CPP/7zip/PREMAKE/premake4.lua +263 -0
- data/ext/p7zip/CPP/7zip/PropID.h +76 -0
- data/ext/p7zip/CPP/7zip/QMAKE/7ZA/7ZA.pro +228 -0
- data/ext/p7zip/CPP/7zip/QMAKE/7ZA/7ZA_osx.pro +228 -0
- data/ext/p7zip/CPP/7zip/QMAKE/test_emul/test_emul.pro +26 -0
- data/ext/p7zip/CPP/7zip/TEST/TestUI/TestUI.cpp +560 -0
- data/ext/p7zip/CPP/7zip/TEST/TestUI/makefile +33 -0
- data/ext/p7zip/CPP/7zip/TEST/TestUI/makefile.depend +577 -0
- data/ext/p7zip/CPP/7zip/TEST/TestUI/makefile.list +16 -0
- data/ext/p7zip/CPP/Common/AutoPtr.h +35 -0
- data/ext/p7zip/CPP/Common/Buffer.h +77 -0
- data/ext/p7zip/CPP/Common/CRC.cpp +7 -0
- data/ext/p7zip/CPP/Common/C_FileIO.cpp +88 -0
- data/ext/p7zip/CPP/Common/C_FileIO.h +47 -0
- data/ext/p7zip/CPP/Common/ComTry.h +18 -0
- data/ext/p7zip/CPP/Common/CommandLineParser.cpp +230 -0
- data/ext/p7zip/CPP/Common/CommandLineParser.h +72 -0
- data/ext/p7zip/CPP/Common/Defs.h +20 -0
- data/ext/p7zip/CPP/Common/DynamicBuffer.h +50 -0
- data/ext/p7zip/CPP/Common/IntToString.cpp +77 -0
- data/ext/p7zip/CPP/Common/IntToString.h +19 -0
- data/ext/p7zip/CPP/Common/Lang.cpp +130 -0
- data/ext/p7zip/CPP/Common/Lang.h +28 -0
- data/ext/p7zip/CPP/Common/ListFileUtils.cpp +75 -0
- data/ext/p7zip/CPP/Common/ListFileUtils.h +11 -0
- data/ext/p7zip/CPP/Common/MyCom.h +225 -0
- data/ext/p7zip/CPP/Common/MyException.h +14 -0
- data/ext/p7zip/CPP/Common/MyGuidDef.h +54 -0
- data/ext/p7zip/CPP/Common/MyInitGuid.h +22 -0
- data/ext/p7zip/CPP/Common/MyMap.cpp +140 -0
- data/ext/p7zip/CPP/Common/MyMap.h +28 -0
- data/ext/p7zip/CPP/Common/MyString.cpp +206 -0
- data/ext/p7zip/CPP/Common/MyString.h +601 -0
- data/ext/p7zip/CPP/Common/MyUnknown.h +13 -0
- data/ext/p7zip/CPP/Common/MyVector.cpp +87 -0
- data/ext/p7zip/CPP/Common/MyVector.h +266 -0
- data/ext/p7zip/CPP/Common/MyWindows.cpp +111 -0
- data/ext/p7zip/CPP/Common/MyWindows.h +218 -0
- data/ext/p7zip/CPP/Common/MyXml.cpp +209 -0
- data/ext/p7zip/CPP/Common/MyXml.h +40 -0
- data/ext/p7zip/CPP/Common/NewHandler.h +16 -0
- data/ext/p7zip/CPP/Common/StdInStream.cpp +100 -0
- data/ext/p7zip/CPP/Common/StdInStream.h +32 -0
- data/ext/p7zip/CPP/Common/StdOutStream.cpp +93 -0
- data/ext/p7zip/CPP/Common/StdOutStream.h +35 -0
- data/ext/p7zip/CPP/Common/StringConvert.cpp +181 -0
- data/ext/p7zip/CPP/Common/StringConvert.h +73 -0
- data/ext/p7zip/CPP/Common/StringToInt.cpp +90 -0
- data/ext/p7zip/CPP/Common/StringToInt.h +18 -0
- data/ext/p7zip/CPP/Common/TextConfig.cpp +138 -0
- data/ext/p7zip/CPP/Common/TextConfig.h +22 -0
- data/ext/p7zip/CPP/Common/Types.h +11 -0
- data/ext/p7zip/CPP/Common/UTFConvert.cpp +145 -0
- data/ext/p7zip/CPP/Common/UTFConvert.h +11 -0
- data/ext/p7zip/CPP/Common/Wildcard.cpp +462 -0
- data/ext/p7zip/CPP/Common/Wildcard.h +80 -0
- data/ext/p7zip/CPP/Windows/COM.cpp +37 -0
- data/ext/p7zip/CPP/Windows/COM.h +69 -0
- data/ext/p7zip/CPP/Windows/Clipboard.cpp +160 -0
- data/ext/p7zip/CPP/Windows/Clipboard.h +28 -0
- data/ext/p7zip/CPP/Windows/CommonDialog.h +19 -0
- data/ext/p7zip/CPP/Windows/Control/ComboBox.h +82 -0
- data/ext/p7zip/CPP/Windows/Control/Controls.cpp +515 -0
- data/ext/p7zip/CPP/Windows/Control/Dialog.cpp +560 -0
- data/ext/p7zip/CPP/Windows/Control/Dialog.h +179 -0
- data/ext/p7zip/CPP/Windows/Control/DialogImpl.h +73 -0
- data/ext/p7zip/CPP/Windows/Control/Edit.h +24 -0
- data/ext/p7zip/CPP/Windows/Control/ListView.h +164 -0
- data/ext/p7zip/CPP/Windows/Control/ProgressBar.h +34 -0
- data/ext/p7zip/CPP/Windows/Control/Static.h +23 -0
- data/ext/p7zip/CPP/Windows/Control/StatusBar.h +56 -0
- data/ext/p7zip/CPP/Windows/Control/Window2.cpp +211 -0
- data/ext/p7zip/CPP/Windows/Control/Window2.h +111 -0
- data/ext/p7zip/CPP/Windows/DLL.cpp +193 -0
- data/ext/p7zip/CPP/Windows/DLL.h +48 -0
- data/ext/p7zip/CPP/Windows/Defs.h +17 -0
- data/ext/p7zip/CPP/Windows/Error.cpp +58 -0
- data/ext/p7zip/CPP/Windows/Error.h +33 -0
- data/ext/p7zip/CPP/Windows/FileDir.cpp +927 -0
- data/ext/p7zip/CPP/Windows/FileDir.h +115 -0
- data/ext/p7zip/CPP/Windows/FileFind.cpp +604 -0
- data/ext/p7zip/CPP/Windows/FileFind.h +126 -0
- data/ext/p7zip/CPP/Windows/FileIO.cpp +475 -0
- data/ext/p7zip/CPP/Windows/FileIO.h +110 -0
- data/ext/p7zip/CPP/Windows/FileName.cpp +50 -0
- data/ext/p7zip/CPP/Windows/FileName.h +27 -0
- data/ext/p7zip/CPP/Windows/Menu.h +4 -0
- data/ext/p7zip/CPP/Windows/NtCheck.h +44 -0
- data/ext/p7zip/CPP/Windows/PropVariant.cpp +243 -0
- data/ext/p7zip/CPP/Windows/PropVariant.h +56 -0
- data/ext/p7zip/CPP/Windows/PropVariantConversions.cpp +142 -0
- data/ext/p7zip/CPP/Windows/PropVariantConversions.h +14 -0
- data/ext/p7zip/CPP/Windows/PropVariantUtils.cpp +78 -0
- data/ext/p7zip/CPP/Windows/PropVariantUtils.h +28 -0
- data/ext/p7zip/CPP/Windows/Registry.cpp +313 -0
- data/ext/p7zip/CPP/Windows/Registry.h +113 -0
- data/ext/p7zip/CPP/Windows/ResourceString.h +22 -0
- data/ext/p7zip/CPP/Windows/Shell.h +21 -0
- data/ext/p7zip/CPP/Windows/Synchronization.cpp +157 -0
- data/ext/p7zip/CPP/Windows/Synchronization.h +187 -0
- data/ext/p7zip/CPP/Windows/Synchronization2.h +218 -0
- data/ext/p7zip/CPP/Windows/System.cpp +166 -0
- data/ext/p7zip/CPP/Windows/System.h +16 -0
- data/ext/p7zip/CPP/Windows/Thread.h +41 -0
- data/ext/p7zip/CPP/Windows/Time.cpp +88 -0
- data/ext/p7zip/CPP/Windows/Time.h +21 -0
- data/ext/p7zip/CPP/Windows/Window.cpp +101 -0
- data/ext/p7zip/CPP/Windows/Window.h +43 -0
- data/ext/p7zip/CPP/include_windows/basetyps.h +19 -0
- data/ext/p7zip/CPP/include_windows/tchar.h +89 -0
- data/ext/p7zip/CPP/include_windows/windows.h +194 -0
- data/ext/p7zip/CPP/myWindows/StdAfx.h +124 -0
- data/ext/p7zip/CPP/myWindows/config.h +67 -0
- data/ext/p7zip/CPP/myWindows/initguid.h +4 -0
- data/ext/p7zip/CPP/myWindows/makefile +21 -0
- data/ext/p7zip/CPP/myWindows/makefile.depend +32 -0
- data/ext/p7zip/CPP/myWindows/makefile.list +28 -0
- data/ext/p7zip/CPP/myWindows/myAddExeFlag.cpp +20 -0
- data/ext/p7zip/CPP/myWindows/myGetTickCount.cpp +8 -0
- data/ext/p7zip/CPP/myWindows/myPrivate.h +17 -0
- data/ext/p7zip/CPP/myWindows/mySplitCommandLine.cpp +82 -0
- data/ext/p7zip/CPP/myWindows/test_emul.cpp +745 -0
- data/ext/p7zip/CPP/myWindows/wine_GetXXXDefaultLangID.cpp +741 -0
- data/ext/p7zip/CPP/myWindows/wine_date_and_time.cpp +434 -0
- data/ext/p7zip/ChangeLog +914 -0
- data/ext/p7zip/DOCS/7zC.txt +194 -0
- data/ext/p7zip/DOCS/7zFormat.txt +469 -0
- data/ext/p7zip/DOCS/License.txt +52 -0
- data/ext/p7zip/DOCS/MANUAL/commands/add.htm +87 -0
- data/ext/p7zip/DOCS/MANUAL/commands/bench.htm +79 -0
- data/ext/p7zip/DOCS/MANUAL/commands/delete.htm +59 -0
- data/ext/p7zip/DOCS/MANUAL/commands/extract.htm +91 -0
- data/ext/p7zip/DOCS/MANUAL/commands/extract_full.htm +68 -0
- data/ext/p7zip/DOCS/MANUAL/commands/index.htm +33 -0
- data/ext/p7zip/DOCS/MANUAL/commands/list.htm +77 -0
- data/ext/p7zip/DOCS/MANUAL/commands/style.css +232 -0
- data/ext/p7zip/DOCS/MANUAL/commands/test.htm +46 -0
- data/ext/p7zip/DOCS/MANUAL/commands/update.htm +66 -0
- data/ext/p7zip/DOCS/MANUAL/exit_codes.htm +27 -0
- data/ext/p7zip/DOCS/MANUAL/index.htm +29 -0
- data/ext/p7zip/DOCS/MANUAL/style.css +232 -0
- data/ext/p7zip/DOCS/MANUAL/switches/ar_exclude.htm +56 -0
- data/ext/p7zip/DOCS/MANUAL/switches/ar_include.htm +83 -0
- data/ext/p7zip/DOCS/MANUAL/switches/ar_no.htm +52 -0
- data/ext/p7zip/DOCS/MANUAL/switches/charset.htm +49 -0
- data/ext/p7zip/DOCS/MANUAL/switches/exclude.htm +60 -0
- data/ext/p7zip/DOCS/MANUAL/switches/include.htm +87 -0
- data/ext/p7zip/DOCS/MANUAL/switches/index.htm +64 -0
- data/ext/p7zip/DOCS/MANUAL/switches/large_pages.htm +50 -0
- data/ext/p7zip/DOCS/MANUAL/switches/list_tech.htm +36 -0
- data/ext/p7zip/DOCS/MANUAL/switches/method.htm +625 -0
- data/ext/p7zip/DOCS/MANUAL/switches/output_dir.htm +53 -0
- data/ext/p7zip/DOCS/MANUAL/switches/overwrite.htm +56 -0
- data/ext/p7zip/DOCS/MANUAL/switches/password.htm +54 -0
- data/ext/p7zip/DOCS/MANUAL/switches/recurse.htm +83 -0
- data/ext/p7zip/DOCS/MANUAL/switches/sfx.htm +156 -0
- data/ext/p7zip/DOCS/MANUAL/switches/ssc.htm +50 -0
- data/ext/p7zip/DOCS/MANUAL/switches/stdin.htm +55 -0
- data/ext/p7zip/DOCS/MANUAL/switches/stdout.htm +50 -0
- data/ext/p7zip/DOCS/MANUAL/switches/stop_switch.htm +31 -0
- data/ext/p7zip/DOCS/MANUAL/switches/style.css +232 -0
- data/ext/p7zip/DOCS/MANUAL/switches/type.htm +83 -0
- data/ext/p7zip/DOCS/MANUAL/switches/update.htm +176 -0
- data/ext/p7zip/DOCS/MANUAL/switches/volume.htm +49 -0
- data/ext/p7zip/DOCS/MANUAL/switches/working_dir.htm +55 -0
- data/ext/p7zip/DOCS/MANUAL/switches/yes.htm +48 -0
- data/ext/p7zip/DOCS/MANUAL/syntax.htm +120 -0
- data/ext/p7zip/DOCS/Methods.txt +152 -0
- data/ext/p7zip/DOCS/copying.txt +504 -0
- data/ext/p7zip/DOCS/history.txt +456 -0
- data/ext/p7zip/DOCS/lzma.txt +598 -0
- data/ext/p7zip/DOCS/readme.txt +181 -0
- data/ext/p7zip/DOCS/unRarLicense.txt +41 -0
- data/ext/p7zip/README +358 -0
- data/ext/p7zip/TODO +39 -0
- data/ext/p7zip/contrib/VirtualFileSystemForMidnightCommander/ChangeLog +41 -0
- data/ext/p7zip/contrib/VirtualFileSystemForMidnightCommander/readme +21 -0
- data/ext/p7zip/contrib/VirtualFileSystemForMidnightCommander/readme.u7z +30 -0
- data/ext/p7zip/contrib/VirtualFileSystemForMidnightCommander/u7z +133 -0
- data/ext/p7zip/contrib/gzip-like_CLI_wrapper_for_7z/README +21 -0
- data/ext/p7zip/contrib/gzip-like_CLI_wrapper_for_7z/check/check.sh +117 -0
- data/ext/p7zip/contrib/gzip-like_CLI_wrapper_for_7z/check/files.tar +0 -0
- data/ext/p7zip/contrib/gzip-like_CLI_wrapper_for_7z/man1/p7zip.1 +33 -0
- data/ext/p7zip/contrib/gzip-like_CLI_wrapper_for_7z/p7zip +144 -0
- data/ext/p7zip/contrib/qnx630sp3/qnx630sp3-shared +14 -0
- data/ext/p7zip/contrib/qnx630sp3/qnx630sp3-static +10 -0
- data/ext/p7zip/install.sh +206 -0
- data/ext/p7zip/install_local_context_menu.sh +18 -0
- data/ext/p7zip/integration_context_menu.txt +51 -0
- data/ext/p7zip/makefile +181 -0
- data/ext/p7zip/makefile.aix_gcc +22 -0
- data/ext/p7zip/makefile.beos +18 -0
- data/ext/p7zip/makefile.crc32 +8 -0
- data/ext/p7zip/makefile.cygwin +20 -0
- data/ext/p7zip/makefile.cygwin_asm +21 -0
- data/ext/p7zip/makefile.djgpp_old +21 -0
- data/ext/p7zip/makefile.djgpp_watt +47 -0
- data/ext/p7zip/makefile.freebsd5 +20 -0
- data/ext/p7zip/makefile.freebsd6 +20 -0
- data/ext/p7zip/makefile.glb +39 -0
- data/ext/p7zip/makefile.gprof +18 -0
- data/ext/p7zip/makefile.hpux-acc +17 -0
- data/ext/p7zip/makefile.hpux-acc_64 +19 -0
- data/ext/p7zip/makefile.hpux-gcc +21 -0
- data/ext/p7zip/makefile.linux_amd64 +22 -0
- data/ext/p7zip/makefile.linux_amd64_asm +24 -0
- data/ext/p7zip/makefile.linux_amd64_asm_icc +27 -0
- data/ext/p7zip/makefile.linux_any_cpu +22 -0
- data/ext/p7zip/makefile.linux_any_cpu_gcc_4.X +24 -0
- data/ext/p7zip/makefile.linux_clang_amd64 +22 -0
- data/ext/p7zip/makefile.linux_cross_arm +22 -0
- data/ext/p7zip/makefile.linux_gcc_2.95_no_need_for_libstdc +20 -0
- data/ext/p7zip/makefile.linux_other +23 -0
- data/ext/p7zip/makefile.linux_s390x +23 -0
- data/ext/p7zip/makefile.linux_x86_asm_gcc_4.X +26 -0
- data/ext/p7zip/makefile.linux_x86_asm_gcc_4.X_fltk +26 -0
- data/ext/p7zip/makefile.linux_x86_asm_gcc_mudflap_4.X +26 -0
- data/ext/p7zip/makefile.linux_x86_asm_icc +25 -0
- data/ext/p7zip/makefile.linux_x86_icc +24 -0
- data/ext/p7zip/makefile.machine_base +22 -0
- data/ext/p7zip/makefile.macosx_32bits +20 -0
- data/ext/p7zip/makefile.macosx_32bits_asm +23 -0
- data/ext/p7zip/makefile.macosx_32bits_ppc +21 -0
- data/ext/p7zip/makefile.macosx_64bits +20 -0
- data/ext/p7zip/makefile.macosx_llvm_64bits +20 -0
- data/ext/p7zip/makefile.netbsd +21 -0
- data/ext/p7zip/makefile.netware_asm_gcc_3.X +41 -0
- data/ext/p7zip/makefile.oldmake +174 -0
- data/ext/p7zip/makefile.openbsd +20 -0
- data/ext/p7zip/makefile.openbsd_no_port +20 -0
- data/ext/p7zip/makefile.qnx_shared.bin +21 -0
- data/ext/p7zip/makefile.qnx_static +21 -0
- data/ext/p7zip/makefile.rules +661 -0
- data/ext/p7zip/makefile.solaris_sparc_CC_32 +21 -0
- data/ext/p7zip/makefile.solaris_sparc_CC_64 +23 -0
- data/ext/p7zip/makefile.solaris_sparc_gcc +21 -0
- data/ext/p7zip/makefile.solaris_x86 +19 -0
- data/ext/p7zip/makefile.tru64 +22 -0
- data/ext/seven_zip_ruby/depend +5 -0
- data/ext/seven_zip_ruby/extconf.rb +131 -0
- data/ext/seven_zip_ruby/guid_defs.h +29 -0
- data/ext/seven_zip_ruby/mutex.h +10 -0
- data/ext/seven_zip_ruby/posix/mutex.h +94 -0
- data/ext/seven_zip_ruby/seven_zip_archive.cpp +1614 -0
- data/ext/seven_zip_ruby/seven_zip_archive.h +515 -0
- data/ext/seven_zip_ruby/util_common.h +444 -0
- data/ext/seven_zip_ruby/utils.cpp +576 -0
- data/ext/seven_zip_ruby/utils.h +25 -0
- data/ext/seven_zip_ruby/win32/mutex.h +130 -0
- data/lib/seven_zip_ruby.rb +16 -0
- data/lib/seven_zip_ruby/7z.dll +0 -0
- data/lib/seven_zip_ruby/7z64.dll +0 -0
- data/lib/seven_zip_ruby/archive_info.rb +21 -0
- data/lib/seven_zip_ruby/entry_info.rb +45 -0
- data/lib/seven_zip_ruby/exception.rb +7 -0
- data/lib/seven_zip_ruby/seven_zip_reader.rb +180 -0
- data/lib/seven_zip_ruby/seven_zip_writer.rb +143 -0
- data/lib/seven_zip_ruby/update_info.rb +116 -0
- data/lib/seven_zip_ruby/version.rb +3 -0
- data/seven_zip_ruby.gemspec +26 -0
- data/spec/seven_zip_ruby_spec.rb +490 -0
- data/spec/seven_zip_ruby_spec_helper.rb +122 -0
- metadata +820 -0
@@ -0,0 +1,37 @@
|
|
1
|
+
// Udf/Handler.h
|
2
|
+
|
3
|
+
#ifndef __UDF_HANDLER_H
|
4
|
+
#define __UDF_HANDLER_H
|
5
|
+
|
6
|
+
#include "Common/MyCom.h"
|
7
|
+
#include "../IArchive.h"
|
8
|
+
|
9
|
+
#include "UdfIn.h"
|
10
|
+
|
11
|
+
namespace NArchive {
|
12
|
+
namespace NUdf {
|
13
|
+
|
14
|
+
struct CRef2
|
15
|
+
{
|
16
|
+
int Vol;
|
17
|
+
int Fs;
|
18
|
+
int Ref;
|
19
|
+
};
|
20
|
+
|
21
|
+
class CHandler:
|
22
|
+
public IInArchive,
|
23
|
+
public IInArchiveGetStream,
|
24
|
+
public CMyUnknownImp
|
25
|
+
{
|
26
|
+
CMyComPtr<IInStream> _inStream;
|
27
|
+
CInArchive _archive;
|
28
|
+
CRecordVector<CRef2> _refs2;
|
29
|
+
public:
|
30
|
+
MY_UNKNOWN_IMP2(IInArchive, IInArchiveGetStream)
|
31
|
+
INTERFACE_IInArchive(;)
|
32
|
+
STDMETHOD(GetStream)(UInt32 index, ISequentialInStream **stream);
|
33
|
+
};
|
34
|
+
|
35
|
+
}}
|
36
|
+
|
37
|
+
#endif
|
@@ -0,0 +1,876 @@
|
|
1
|
+
// Archive/UdfIn.cpp
|
2
|
+
|
3
|
+
#include "StdAfx.h"
|
4
|
+
|
5
|
+
#include "../../../../C/CpuArch.h"
|
6
|
+
|
7
|
+
#include "../../Common/StreamUtils.h"
|
8
|
+
|
9
|
+
#include "UdfIn.h"
|
10
|
+
|
11
|
+
#define Get16(p) GetUi16(p)
|
12
|
+
#define Get32(p) GetUi32(p)
|
13
|
+
#define Get64(p) GetUi64(p)
|
14
|
+
|
15
|
+
namespace NArchive {
|
16
|
+
namespace NUdf {
|
17
|
+
|
18
|
+
const int kNumPartitionsMax = 64;
|
19
|
+
const int kNumLogVolumesMax = 64;
|
20
|
+
const int kNumRecureseLevelsMax = 1 << 10;
|
21
|
+
const int kNumItemsMax = 1 << 27;
|
22
|
+
const int kNumFilesMax = 1 << 28;
|
23
|
+
const int kNumRefsMax = 1 << 28;
|
24
|
+
const UInt32 kNumExtentsMax = (UInt32)1 << 30;
|
25
|
+
const UInt64 kFileNameLengthTotalMax = (UInt64)1 << 33;
|
26
|
+
const UInt64 kInlineExtentsSizeMax = (UInt64)1 << 33;
|
27
|
+
|
28
|
+
void MY_FAST_CALL Crc16GenerateTable(void);
|
29
|
+
|
30
|
+
#define CRC16_INIT_VAL 0
|
31
|
+
#define CRC16_GET_DIGEST(crc) (crc)
|
32
|
+
#define CRC16_UPDATE_BYTE(crc, b) (g_Crc16Table[(((crc) >> 8) ^ (b)) & 0xFF] ^ ((crc) << 8))
|
33
|
+
|
34
|
+
#define kCrc16Poly 0x1021
|
35
|
+
UInt16 g_Crc16Table[256];
|
36
|
+
|
37
|
+
void MY_FAST_CALL Crc16GenerateTable(void)
|
38
|
+
{
|
39
|
+
UInt32 i;
|
40
|
+
for (i = 0; i < 256; i++)
|
41
|
+
{
|
42
|
+
UInt32 r = (i << 8);
|
43
|
+
for (int j = 8; j > 0; j--)
|
44
|
+
r = ((r & 0x8000) ? ((r << 1) ^ kCrc16Poly) : (r << 1)) & 0xFFFF;
|
45
|
+
g_Crc16Table[i] = (UInt16)r;
|
46
|
+
}
|
47
|
+
}
|
48
|
+
|
49
|
+
UInt16 MY_FAST_CALL Crc16_Update(UInt16 v, const void *data, size_t size)
|
50
|
+
{
|
51
|
+
const Byte *p = (const Byte *)data;
|
52
|
+
for (; size > 0 ; size--, p++)
|
53
|
+
v = CRC16_UPDATE_BYTE(v, *p);
|
54
|
+
return v;
|
55
|
+
}
|
56
|
+
|
57
|
+
UInt16 MY_FAST_CALL Crc16Calc(const void *data, size_t size)
|
58
|
+
{
|
59
|
+
return Crc16_Update(CRC16_INIT_VAL, data, size);
|
60
|
+
}
|
61
|
+
|
62
|
+
struct CCrc16TableInit { CCrc16TableInit() { Crc16GenerateTable(); } } g_Crc16TableInit;
|
63
|
+
|
64
|
+
void CDString128::Parse(const Byte *buf) { memcpy(Data, buf, sizeof(Data)); }
|
65
|
+
|
66
|
+
void CDString::Parse(const Byte *p, unsigned size)
|
67
|
+
{
|
68
|
+
Data.SetCapacity(size);
|
69
|
+
memcpy(Data, p, size);
|
70
|
+
}
|
71
|
+
|
72
|
+
static UString ParseDString(const Byte *data, int size)
|
73
|
+
{
|
74
|
+
UString res;
|
75
|
+
wchar_t *p;
|
76
|
+
if (size > 0)
|
77
|
+
{
|
78
|
+
Byte type = data[0];
|
79
|
+
if (type == 8)
|
80
|
+
{
|
81
|
+
p = res.GetBuffer((int)size + 1);
|
82
|
+
for (int i = 1; i < size; i++)
|
83
|
+
{
|
84
|
+
wchar_t c = data[i];
|
85
|
+
if (c == 0)
|
86
|
+
break;
|
87
|
+
*p++ = c;
|
88
|
+
}
|
89
|
+
}
|
90
|
+
else if (type == 16)
|
91
|
+
{
|
92
|
+
p = res.GetBuffer((int)size / 2 + 1);
|
93
|
+
for (int i = 1; i + 2 <= size; i += 2)
|
94
|
+
{
|
95
|
+
wchar_t c = ((wchar_t)data[i] << 8) | data[i + 1];
|
96
|
+
if (c == 0)
|
97
|
+
break;
|
98
|
+
*p++ = c;
|
99
|
+
}
|
100
|
+
}
|
101
|
+
else
|
102
|
+
return L"[unknow]";
|
103
|
+
*p++ = 0;
|
104
|
+
res.ReleaseBuffer();
|
105
|
+
}
|
106
|
+
return res;
|
107
|
+
}
|
108
|
+
|
109
|
+
UString CDString:: GetString() const { return ParseDString(Data, (int)Data.GetCapacity()); }
|
110
|
+
UString CDString128::GetString() const
|
111
|
+
{
|
112
|
+
int size = Data[sizeof(Data) - 1];
|
113
|
+
return ParseDString(Data, MyMin(size, (int)(sizeof(Data) - 1)));
|
114
|
+
}
|
115
|
+
|
116
|
+
void CTime::Parse(const Byte *buf) { memcpy(Data, buf, sizeof(Data)); }
|
117
|
+
|
118
|
+
/*
|
119
|
+
void CRegId::Parse(const Byte *buf)
|
120
|
+
{
|
121
|
+
Flags = buf[0];
|
122
|
+
memcpy(Id, buf + 1, sizeof(Id));
|
123
|
+
memcpy(Suffix, buf + 24, sizeof(Suffix));
|
124
|
+
}
|
125
|
+
*/
|
126
|
+
|
127
|
+
// ECMA 3/7.1
|
128
|
+
|
129
|
+
struct CExtent
|
130
|
+
{
|
131
|
+
UInt32 Len;
|
132
|
+
UInt32 Pos;
|
133
|
+
|
134
|
+
void Parse(const Byte *buf);
|
135
|
+
};
|
136
|
+
|
137
|
+
void CExtent::Parse(const Byte *buf)
|
138
|
+
{
|
139
|
+
Len = Get32(buf);
|
140
|
+
Pos = Get32(buf + 4);
|
141
|
+
}
|
142
|
+
|
143
|
+
// ECMA 3/7.2
|
144
|
+
|
145
|
+
struct CTag
|
146
|
+
{
|
147
|
+
UInt16 Id;
|
148
|
+
UInt16 Version;
|
149
|
+
// Byte Checksum;
|
150
|
+
// UInt16 SerialNumber;
|
151
|
+
// UInt16 Crc;
|
152
|
+
// UInt16 CrcLen;
|
153
|
+
// UInt32 TagLocation;
|
154
|
+
|
155
|
+
HRESULT Parse(const Byte *buf, size_t size);
|
156
|
+
};
|
157
|
+
|
158
|
+
HRESULT CTag::Parse(const Byte *buf, size_t size)
|
159
|
+
{
|
160
|
+
if (size < 16)
|
161
|
+
return S_FALSE;
|
162
|
+
Byte sum = 0;
|
163
|
+
int i;
|
164
|
+
for (i = 0; i < 4; i++) sum = sum + buf[i];
|
165
|
+
for (i = 5; i < 16; i++) sum = sum + buf[i];
|
166
|
+
if (sum != buf[4] || buf[5] != 0) return S_FALSE;
|
167
|
+
|
168
|
+
Id = Get16(buf);
|
169
|
+
Version = Get16(buf + 2);
|
170
|
+
// SerialNumber = Get16(buf + 6);
|
171
|
+
UInt16 crc = Get16(buf + 8);
|
172
|
+
UInt16 crcLen = Get16(buf + 10);
|
173
|
+
// TagLocation = Get32(buf + 12);
|
174
|
+
|
175
|
+
if (size >= 16 + (size_t)crcLen)
|
176
|
+
if (crc == Crc16Calc(buf + 16, crcLen))
|
177
|
+
return S_OK;
|
178
|
+
return S_FALSE;
|
179
|
+
}
|
180
|
+
|
181
|
+
// ECMA 3/7.2.1
|
182
|
+
|
183
|
+
enum EDescriptorType
|
184
|
+
{
|
185
|
+
DESC_TYPE_SpoaringTable = 0, // UDF
|
186
|
+
DESC_TYPE_PrimVol = 1,
|
187
|
+
DESC_TYPE_AnchorVolPtr = 2,
|
188
|
+
DESC_TYPE_VolPtr = 3,
|
189
|
+
DESC_TYPE_ImplUseVol = 4,
|
190
|
+
DESC_TYPE_Partition = 5,
|
191
|
+
DESC_TYPE_LogicalVol = 6,
|
192
|
+
DESC_TYPE_UnallocSpace = 7,
|
193
|
+
DESC_TYPE_Terminating = 8,
|
194
|
+
DESC_TYPE_LogicalVolIntegrity = 9,
|
195
|
+
DESC_TYPE_FileSet = 256,
|
196
|
+
DESC_TYPE_FileId = 257,
|
197
|
+
DESC_TYPE_AllocationExtent = 258,
|
198
|
+
DESC_TYPE_Indirect = 259,
|
199
|
+
DESC_TYPE_Terminal = 260,
|
200
|
+
DESC_TYPE_File = 261,
|
201
|
+
DESC_TYPE_ExtendedAttrHeader = 262,
|
202
|
+
DESC_TYPE_UnallocatedSpace = 263,
|
203
|
+
DESC_TYPE_SpaceBitmap = 264,
|
204
|
+
DESC_TYPE_PartitionIntegrity = 265,
|
205
|
+
DESC_TYPE_ExtendedFile = 266
|
206
|
+
};
|
207
|
+
|
208
|
+
|
209
|
+
void CLogBlockAddr::Parse(const Byte *buf)
|
210
|
+
{
|
211
|
+
Pos = Get32(buf);
|
212
|
+
PartitionRef = Get16(buf + 4);
|
213
|
+
}
|
214
|
+
|
215
|
+
void CShortAllocDesc::Parse(const Byte *buf)
|
216
|
+
{
|
217
|
+
Len = Get32(buf);
|
218
|
+
Pos = Get32(buf + 4);
|
219
|
+
}
|
220
|
+
|
221
|
+
/*
|
222
|
+
void CADImpUse::Parse(const Byte *buf)
|
223
|
+
{
|
224
|
+
Flags = Get16(buf);
|
225
|
+
UdfUniqueId = Get32(buf + 2);
|
226
|
+
}
|
227
|
+
*/
|
228
|
+
|
229
|
+
void CLongAllocDesc::Parse(const Byte *buf)
|
230
|
+
{
|
231
|
+
Len = Get32(buf);
|
232
|
+
Location.Parse(buf + 4);
|
233
|
+
// memcpy(ImplUse, buf + 10, sizeof(ImplUse));
|
234
|
+
// adImpUse.Parse(ImplUse);
|
235
|
+
}
|
236
|
+
|
237
|
+
bool CInArchive::CheckExtent(int volIndex, int partitionRef, UInt32 blockPos, UInt32 len) const
|
238
|
+
{
|
239
|
+
const CLogVol &vol = LogVols[volIndex];
|
240
|
+
const CPartition &partition = Partitions[vol.PartitionMaps[partitionRef].PartitionIndex];
|
241
|
+
UInt64 offset = ((UInt64)partition.Pos << SecLogSize) + (UInt64)blockPos * vol.BlockSize;
|
242
|
+
return (offset + len) <= (((UInt64)partition.Pos + partition.Len) << SecLogSize);
|
243
|
+
}
|
244
|
+
|
245
|
+
bool CInArchive::CheckItemExtents(int volIndex, const CItem &item) const
|
246
|
+
{
|
247
|
+
for (int i = 0; i < item.Extents.Size(); i++)
|
248
|
+
{
|
249
|
+
const CMyExtent &e = item.Extents[i];
|
250
|
+
if (!CheckExtent(volIndex, e.PartitionRef, e.Pos, e.GetLen()))
|
251
|
+
return false;
|
252
|
+
}
|
253
|
+
return true;
|
254
|
+
}
|
255
|
+
|
256
|
+
HRESULT CInArchive::Read(int volIndex, int partitionRef, UInt32 blockPos, UInt32 len, Byte *buf)
|
257
|
+
{
|
258
|
+
if (!CheckExtent(volIndex, partitionRef, blockPos, len))
|
259
|
+
return S_FALSE;
|
260
|
+
const CLogVol &vol = LogVols[volIndex];
|
261
|
+
const CPartition &partition = Partitions[vol.PartitionMaps[partitionRef].PartitionIndex];
|
262
|
+
RINOK(_stream->Seek(((UInt64)partition.Pos << SecLogSize) +
|
263
|
+
(UInt64)blockPos * vol.BlockSize, STREAM_SEEK_SET, NULL));
|
264
|
+
return ReadStream_FALSE(_stream, buf, len);
|
265
|
+
}
|
266
|
+
|
267
|
+
HRESULT CInArchive::Read(int volIndex, const CLongAllocDesc &lad, Byte *buf)
|
268
|
+
{
|
269
|
+
return Read(volIndex, lad.Location.PartitionRef, lad.Location.Pos, lad.GetLen(), (Byte *)buf);
|
270
|
+
}
|
271
|
+
|
272
|
+
HRESULT CInArchive::ReadFromFile(int volIndex, const CItem &item, CByteBuffer &buf)
|
273
|
+
{
|
274
|
+
if (item.Size >= (UInt32)1 << 30)
|
275
|
+
return S_FALSE;
|
276
|
+
if (item.IsInline)
|
277
|
+
{
|
278
|
+
buf = item.InlineData;
|
279
|
+
return S_OK;
|
280
|
+
}
|
281
|
+
buf.SetCapacity((size_t)item.Size);
|
282
|
+
size_t pos = 0;
|
283
|
+
for (int i = 0; i < item.Extents.Size(); i++)
|
284
|
+
{
|
285
|
+
const CMyExtent &e = item.Extents[i];
|
286
|
+
UInt32 len = e.GetLen();
|
287
|
+
RINOK(Read(volIndex, e.PartitionRef, e.Pos, len, (Byte *)buf + pos));
|
288
|
+
pos += len;
|
289
|
+
}
|
290
|
+
return S_OK;
|
291
|
+
}
|
292
|
+
|
293
|
+
|
294
|
+
void CIcbTag::Parse(const Byte *p)
|
295
|
+
{
|
296
|
+
// PriorDirectNum = Get32(p);
|
297
|
+
// StrategyType = Get16(p + 4);
|
298
|
+
// StrategyParam = Get16(p + 6);
|
299
|
+
// MaxNumOfEntries = Get16(p + 8);
|
300
|
+
FileType = p[11];
|
301
|
+
// ParentIcb.Parse(p + 12);
|
302
|
+
Flags = Get16(p + 18);
|
303
|
+
}
|
304
|
+
|
305
|
+
void CItem::Parse(const Byte *p)
|
306
|
+
{
|
307
|
+
// Uid = Get32(p + 36);
|
308
|
+
// Gid = Get32(p + 40);
|
309
|
+
// Permissions = Get32(p + 44);
|
310
|
+
// FileLinkCount = Get16(p + 48);
|
311
|
+
// RecordFormat = p[50];
|
312
|
+
// RecordDisplayAttr = p[51];
|
313
|
+
// RecordLen = Get32(p + 52);
|
314
|
+
Size = Get64(p + 56);
|
315
|
+
NumLogBlockRecorded = Get64(p + 64);
|
316
|
+
ATime.Parse(p + 72);
|
317
|
+
MTime.Parse(p + 84);
|
318
|
+
// AttrtTime.Parse(p + 96);
|
319
|
+
// CheckPoint = Get32(p + 108);
|
320
|
+
// ExtendedAttrIcb.Parse(p + 112);
|
321
|
+
// ImplId.Parse(p + 128);
|
322
|
+
// UniqueId = Get64(p + 160);
|
323
|
+
}
|
324
|
+
|
325
|
+
// 4/14.4
|
326
|
+
struct CFileId
|
327
|
+
{
|
328
|
+
// UInt16 FileVersion;
|
329
|
+
Byte FileCharacteristics;
|
330
|
+
// CByteBuffer ImplUse;
|
331
|
+
CDString Id;
|
332
|
+
CLongAllocDesc Icb;
|
333
|
+
|
334
|
+
bool IsItLinkParent() const { return (FileCharacteristics & FILEID_CHARACS_Parent) != 0; }
|
335
|
+
HRESULT Parse(const Byte *p, size_t size, size_t &processed);
|
336
|
+
};
|
337
|
+
|
338
|
+
HRESULT CFileId::Parse(const Byte *p, size_t size, size_t &processed)
|
339
|
+
{
|
340
|
+
processed = 0;
|
341
|
+
if (size < 38)
|
342
|
+
return S_FALSE;
|
343
|
+
CTag tag;
|
344
|
+
RINOK(tag.Parse(p, size));
|
345
|
+
if (tag.Id != DESC_TYPE_FileId)
|
346
|
+
return S_FALSE;
|
347
|
+
// FileVersion = Get16(p + 16);
|
348
|
+
FileCharacteristics = p[18];
|
349
|
+
unsigned idLen = p[19];
|
350
|
+
Icb.Parse(p + 20);
|
351
|
+
unsigned impLen = Get16(p + 36);
|
352
|
+
if (size < 38 + idLen + impLen)
|
353
|
+
return S_FALSE;
|
354
|
+
// ImplUse.SetCapacity(impLen);
|
355
|
+
processed = 38;
|
356
|
+
// memcpy(ImplUse, p + processed, impLen);
|
357
|
+
processed += impLen;
|
358
|
+
Id.Parse(p + processed, idLen);
|
359
|
+
processed += idLen;
|
360
|
+
for (;(processed & 3) != 0; processed++)
|
361
|
+
if (p[processed] != 0)
|
362
|
+
return S_FALSE;
|
363
|
+
return (processed <= size) ? S_OK : S_FALSE;
|
364
|
+
}
|
365
|
+
|
366
|
+
HRESULT CInArchive::ReadFileItem(int volIndex, int fsIndex, const CLongAllocDesc &lad, int numRecurseAllowed)
|
367
|
+
{
|
368
|
+
if (Files.Size() % 100 == 0)
|
369
|
+
RINOK(_progress->SetCompleted(Files.Size(), _processedProgressBytes));
|
370
|
+
if (numRecurseAllowed-- == 0)
|
371
|
+
return S_FALSE;
|
372
|
+
CFile &file = Files.Back();
|
373
|
+
const CLogVol &vol = LogVols[volIndex];
|
374
|
+
CPartition &partition = Partitions[vol.PartitionMaps[lad.Location.PartitionRef].PartitionIndex];
|
375
|
+
|
376
|
+
UInt32 key = lad.Location.Pos;
|
377
|
+
UInt32 value;
|
378
|
+
const UInt32 kRecursedErrorValue = (UInt32)(Int32)-1;
|
379
|
+
if (partition.Map.Find(key, value))
|
380
|
+
{
|
381
|
+
if (value == kRecursedErrorValue)
|
382
|
+
return S_FALSE;
|
383
|
+
file.ItemIndex = value;
|
384
|
+
}
|
385
|
+
else
|
386
|
+
{
|
387
|
+
value = Items.Size();
|
388
|
+
file.ItemIndex = (int)value;
|
389
|
+
if (partition.Map.Set(key, kRecursedErrorValue))
|
390
|
+
return S_FALSE;
|
391
|
+
RINOK(ReadItem(volIndex, fsIndex, lad, numRecurseAllowed));
|
392
|
+
if (!partition.Map.Set(key, value))
|
393
|
+
return S_FALSE;
|
394
|
+
}
|
395
|
+
return S_OK;
|
396
|
+
}
|
397
|
+
|
398
|
+
HRESULT CInArchive::ReadItem(int volIndex, int fsIndex, const CLongAllocDesc &lad, int numRecurseAllowed)
|
399
|
+
{
|
400
|
+
if (Items.Size() > kNumItemsMax)
|
401
|
+
return S_FALSE;
|
402
|
+
Items.Add(CItem());
|
403
|
+
CItem &item = Items.Back();
|
404
|
+
|
405
|
+
const CLogVol &vol = LogVols[volIndex];
|
406
|
+
|
407
|
+
if (lad.GetLen() != vol.BlockSize)
|
408
|
+
return S_FALSE;
|
409
|
+
|
410
|
+
CByteBuffer buf;
|
411
|
+
size_t size = lad.GetLen();
|
412
|
+
buf.SetCapacity(size);
|
413
|
+
RINOK(Read(volIndex, lad, buf));
|
414
|
+
|
415
|
+
CTag tag;
|
416
|
+
const Byte *p = buf;
|
417
|
+
RINOK(tag.Parse(p, size));
|
418
|
+
if (tag.Id != DESC_TYPE_File)
|
419
|
+
return S_FALSE;
|
420
|
+
|
421
|
+
item.IcbTag.Parse(p + 16);
|
422
|
+
if (item.IcbTag.FileType != ICB_FILE_TYPE_DIR &&
|
423
|
+
item.IcbTag.FileType != ICB_FILE_TYPE_FILE)
|
424
|
+
return S_FALSE;
|
425
|
+
|
426
|
+
item.Parse(p);
|
427
|
+
|
428
|
+
_processedProgressBytes += (UInt64)item.NumLogBlockRecorded * vol.BlockSize + size;
|
429
|
+
|
430
|
+
UInt32 extendedAttrLen = Get32(p + 168);
|
431
|
+
UInt32 allocDescriptorsLen = Get32(p + 172);
|
432
|
+
|
433
|
+
if ((extendedAttrLen & 3) != 0)
|
434
|
+
return S_FALSE;
|
435
|
+
int pos = 176;
|
436
|
+
if (extendedAttrLen > size - pos)
|
437
|
+
return S_FALSE;
|
438
|
+
/*
|
439
|
+
if (extendedAttrLen != 16)
|
440
|
+
{
|
441
|
+
if (extendedAttrLen < 24)
|
442
|
+
return S_FALSE;
|
443
|
+
CTag attrTag;
|
444
|
+
RINOK(attrTag.Parse(p + pos, size));
|
445
|
+
if (attrTag.Id != DESC_TYPE_ExtendedAttrHeader)
|
446
|
+
return S_FALSE;
|
447
|
+
// UInt32 implAttrLocation = Get32(p + pos + 16);
|
448
|
+
// UInt32 applicationlAttrLocation = Get32(p + pos + 20);
|
449
|
+
}
|
450
|
+
*/
|
451
|
+
pos += extendedAttrLen;
|
452
|
+
|
453
|
+
int desctType = item.IcbTag.GetDescriptorType();
|
454
|
+
if (allocDescriptorsLen > size - pos)
|
455
|
+
return S_FALSE;
|
456
|
+
if (desctType == ICB_DESC_TYPE_INLINE)
|
457
|
+
{
|
458
|
+
item.IsInline = true;
|
459
|
+
item.InlineData.SetCapacity(allocDescriptorsLen);
|
460
|
+
memcpy(item.InlineData, p + pos, allocDescriptorsLen);
|
461
|
+
}
|
462
|
+
else
|
463
|
+
{
|
464
|
+
item.IsInline = false;
|
465
|
+
if (desctType != ICB_DESC_TYPE_SHORT && desctType != ICB_DESC_TYPE_LONG)
|
466
|
+
return S_FALSE;
|
467
|
+
for (UInt32 i = 0; i < allocDescriptorsLen;)
|
468
|
+
{
|
469
|
+
CMyExtent e;
|
470
|
+
if (desctType == ICB_DESC_TYPE_SHORT)
|
471
|
+
{
|
472
|
+
if (i + 8 > allocDescriptorsLen)
|
473
|
+
return S_FALSE;
|
474
|
+
CShortAllocDesc sad;
|
475
|
+
sad.Parse(p + pos + i);
|
476
|
+
e.Pos = sad.Pos;
|
477
|
+
e.Len = sad.Len;
|
478
|
+
e.PartitionRef = lad.Location.PartitionRef;
|
479
|
+
i += 8;
|
480
|
+
}
|
481
|
+
else
|
482
|
+
{
|
483
|
+
if (i + 16 > allocDescriptorsLen)
|
484
|
+
return S_FALSE;
|
485
|
+
CLongAllocDesc ladNew;
|
486
|
+
ladNew.Parse(p + pos + i);
|
487
|
+
e.Pos = ladNew.Location.Pos;
|
488
|
+
e.PartitionRef = ladNew.Location.PartitionRef;
|
489
|
+
e.Len = ladNew.Len;
|
490
|
+
i += 16;
|
491
|
+
}
|
492
|
+
item.Extents.Add(e);
|
493
|
+
}
|
494
|
+
}
|
495
|
+
|
496
|
+
if (item.IcbTag.IsDir())
|
497
|
+
{
|
498
|
+
if (!item.CheckChunkSizes() || !CheckItemExtents(volIndex, item))
|
499
|
+
return S_FALSE;
|
500
|
+
CByteBuffer buf;
|
501
|
+
RINOK(ReadFromFile(volIndex, item, buf));
|
502
|
+
item.Size = 0;
|
503
|
+
item.Extents.ClearAndFree();
|
504
|
+
item.InlineData.Free();
|
505
|
+
|
506
|
+
const Byte *p = buf;
|
507
|
+
size = buf.GetCapacity();
|
508
|
+
size_t processedTotal = 0;
|
509
|
+
for (; processedTotal < size;)
|
510
|
+
{
|
511
|
+
size_t processedCur;
|
512
|
+
CFileId fileId;
|
513
|
+
RINOK(fileId.Parse(p + processedTotal, size - processedTotal, processedCur));
|
514
|
+
if (!fileId.IsItLinkParent())
|
515
|
+
{
|
516
|
+
CFile file;
|
517
|
+
// file.FileVersion = fileId.FileVersion;
|
518
|
+
// file.FileCharacteristics = fileId.FileCharacteristics;
|
519
|
+
// file.ImplUse = fileId.ImplUse;
|
520
|
+
file.Id = fileId.Id;
|
521
|
+
|
522
|
+
_fileNameLengthTotal += file.Id.Data.GetCapacity();
|
523
|
+
if (_fileNameLengthTotal > kFileNameLengthTotalMax)
|
524
|
+
return S_FALSE;
|
525
|
+
|
526
|
+
item.SubFiles.Add(Files.Size());
|
527
|
+
if (Files.Size() > kNumFilesMax)
|
528
|
+
return S_FALSE;
|
529
|
+
Files.Add(file);
|
530
|
+
RINOK(ReadFileItem(volIndex, fsIndex, fileId.Icb, numRecurseAllowed));
|
531
|
+
}
|
532
|
+
processedTotal += processedCur;
|
533
|
+
}
|
534
|
+
}
|
535
|
+
else
|
536
|
+
{
|
537
|
+
if ((UInt32)item.Extents.Size() > kNumExtentsMax - _numExtents)
|
538
|
+
return S_FALSE;
|
539
|
+
_numExtents += item.Extents.Size();
|
540
|
+
|
541
|
+
if (item.InlineData.GetCapacity() > kInlineExtentsSizeMax - _inlineExtentsSize)
|
542
|
+
return S_FALSE;
|
543
|
+
_inlineExtentsSize += item.InlineData.GetCapacity();
|
544
|
+
}
|
545
|
+
|
546
|
+
return S_OK;
|
547
|
+
}
|
548
|
+
|
549
|
+
HRESULT CInArchive::FillRefs(CFileSet &fs, int fileIndex, int parent, int numRecurseAllowed)
|
550
|
+
{
|
551
|
+
if (_numRefs % 10000 == 0)
|
552
|
+
{
|
553
|
+
RINOK(_progress->SetCompleted());
|
554
|
+
}
|
555
|
+
if (numRecurseAllowed-- == 0)
|
556
|
+
return S_FALSE;
|
557
|
+
if (_numRefs >= kNumRefsMax)
|
558
|
+
return S_FALSE;
|
559
|
+
_numRefs++;
|
560
|
+
CRef ref;
|
561
|
+
ref.FileIndex = fileIndex;
|
562
|
+
ref.Parent = parent;
|
563
|
+
parent = fs.Refs.Size();
|
564
|
+
fs.Refs.Add(ref);
|
565
|
+
const CItem &item = Items[Files[fileIndex].ItemIndex];
|
566
|
+
for (int i = 0; i < item.SubFiles.Size(); i++)
|
567
|
+
{
|
568
|
+
RINOK(FillRefs(fs, item.SubFiles[i], parent, numRecurseAllowed));
|
569
|
+
}
|
570
|
+
return S_OK;
|
571
|
+
}
|
572
|
+
|
573
|
+
HRESULT CInArchive::Open2()
|
574
|
+
{
|
575
|
+
Clear();
|
576
|
+
|
577
|
+
UInt64 fileSize;
|
578
|
+
RINOK(_stream->Seek(0, STREAM_SEEK_END, &fileSize));
|
579
|
+
|
580
|
+
// Some UDFs contain additional 2 KB of zeros, so we also check 12, corrected to 11.
|
581
|
+
const int kSecLogSizeMax = 12;
|
582
|
+
Byte buf[1 << kSecLogSizeMax];
|
583
|
+
Byte kSizesLog[] = { 11, 8, 12 };
|
584
|
+
|
585
|
+
for (int i = 0;; i++)
|
586
|
+
{
|
587
|
+
if (i == sizeof(kSizesLog) / sizeof(kSizesLog[0]))
|
588
|
+
return S_FALSE;
|
589
|
+
SecLogSize = kSizesLog[i];
|
590
|
+
Int32 bufSize = 1 << SecLogSize;
|
591
|
+
if (bufSize > fileSize)
|
592
|
+
return S_FALSE;
|
593
|
+
RINOK(_stream->Seek(-bufSize, STREAM_SEEK_END, NULL));
|
594
|
+
RINOK(ReadStream_FALSE(_stream, buf, bufSize));
|
595
|
+
CTag tag;
|
596
|
+
if (tag.Parse(buf, bufSize) == S_OK)
|
597
|
+
if (tag.Id == DESC_TYPE_AnchorVolPtr)
|
598
|
+
break;
|
599
|
+
}
|
600
|
+
if (SecLogSize == 12)
|
601
|
+
SecLogSize = 11;
|
602
|
+
|
603
|
+
CExtent extentVDS;
|
604
|
+
extentVDS.Parse(buf + 16);
|
605
|
+
|
606
|
+
for (UInt32 location = extentVDS.Pos; ; location++)
|
607
|
+
{
|
608
|
+
size_t bufSize = 1 << SecLogSize;
|
609
|
+
size_t pos = 0;
|
610
|
+
RINOK(_stream->Seek((UInt64)location << SecLogSize, STREAM_SEEK_SET, NULL));
|
611
|
+
RINOK(ReadStream_FALSE(_stream, buf, bufSize));
|
612
|
+
CTag tag;
|
613
|
+
RINOK(tag.Parse(buf + pos, bufSize - pos));
|
614
|
+
if (tag.Id == DESC_TYPE_Terminating)
|
615
|
+
break;
|
616
|
+
if (tag.Id == DESC_TYPE_Partition)
|
617
|
+
{
|
618
|
+
if (Partitions.Size() >= kNumPartitionsMax)
|
619
|
+
return S_FALSE;
|
620
|
+
CPartition partition;
|
621
|
+
// UInt32 volDescSeqNumer = Get32(buf + 16);
|
622
|
+
// partition.Flags = Get16(buf + 20);
|
623
|
+
partition.Number = Get16(buf + 22);
|
624
|
+
// partition.ContentsId.Parse(buf + 24);
|
625
|
+
|
626
|
+
// memcpy(partition.ContentsUse, buf + 56, sizeof(partition.ContentsUse));
|
627
|
+
// ContentsUse is Partition Header Description.
|
628
|
+
|
629
|
+
// partition.AccessType = Get32(buf + 184);
|
630
|
+
partition.Pos = Get32(buf + 188);
|
631
|
+
partition.Len = Get32(buf + 192);
|
632
|
+
// partition.ImplId.Parse(buf + 196);
|
633
|
+
// memcpy(partition.ImplUse, buf + 228, sizeof(partition.ImplUse));
|
634
|
+
|
635
|
+
Partitions.Add(partition);
|
636
|
+
}
|
637
|
+
else if (tag.Id == DESC_TYPE_LogicalVol)
|
638
|
+
{
|
639
|
+
if (LogVols.Size() >= kNumLogVolumesMax)
|
640
|
+
return S_FALSE;
|
641
|
+
CLogVol vol;
|
642
|
+
vol.Id.Parse(buf + 84);
|
643
|
+
vol.BlockSize = Get32(buf + 212);
|
644
|
+
// vol.DomainId.Parse(buf + 216);
|
645
|
+
|
646
|
+
if (vol.BlockSize < 512 || vol.BlockSize > ((UInt32)1 << 30))
|
647
|
+
return S_FALSE;
|
648
|
+
|
649
|
+
// memcpy(vol.ContentsUse, buf + 248, sizeof(vol.ContentsUse));
|
650
|
+
vol.FileSetLocation.Parse(buf + 248);
|
651
|
+
|
652
|
+
// UInt32 mapTableLength = Get32(buf + 264);
|
653
|
+
UInt32 numPartitionMaps = Get32(buf + 268);
|
654
|
+
if (numPartitionMaps > kNumPartitionsMax)
|
655
|
+
return S_FALSE;
|
656
|
+
// vol.ImplId.Parse(buf + 272);
|
657
|
+
// memcpy(vol.ImplUse, buf + 128, sizeof(vol.ImplUse));
|
658
|
+
size_t pos = 440;
|
659
|
+
for (UInt32 i = 0; i < numPartitionMaps; i++)
|
660
|
+
{
|
661
|
+
if (pos + 2 > bufSize)
|
662
|
+
return S_FALSE;
|
663
|
+
CPartitionMap pm;
|
664
|
+
pm.Type = buf[pos];
|
665
|
+
// pm.Length = buf[pos + 1];
|
666
|
+
Byte len = buf[pos + 1];
|
667
|
+
|
668
|
+
if (pos + len > bufSize)
|
669
|
+
return S_FALSE;
|
670
|
+
|
671
|
+
// memcpy(pm.Data, buf + pos + 2, pm.Length - 2);
|
672
|
+
if (pm.Type == 1)
|
673
|
+
{
|
674
|
+
if (pos + 6 > bufSize)
|
675
|
+
return S_FALSE;
|
676
|
+
// pm.VolSeqNumber = Get16(buf + pos + 2);
|
677
|
+
pm.PartitionNumber = Get16(buf + pos + 4);
|
678
|
+
}
|
679
|
+
else
|
680
|
+
return S_FALSE;
|
681
|
+
pos += len;
|
682
|
+
vol.PartitionMaps.Add(pm);
|
683
|
+
}
|
684
|
+
LogVols.Add(vol);
|
685
|
+
}
|
686
|
+
}
|
687
|
+
|
688
|
+
UInt64 totalSize = 0;
|
689
|
+
|
690
|
+
int volIndex;
|
691
|
+
for (volIndex = 0; volIndex < LogVols.Size(); volIndex++)
|
692
|
+
{
|
693
|
+
CLogVol &vol = LogVols[volIndex];
|
694
|
+
for (int pmIndex = 0; pmIndex < vol.PartitionMaps.Size(); pmIndex++)
|
695
|
+
{
|
696
|
+
CPartitionMap &pm = vol.PartitionMaps[pmIndex];
|
697
|
+
int i;
|
698
|
+
for (i = 0; i < Partitions.Size(); i++)
|
699
|
+
{
|
700
|
+
CPartition &part = Partitions[i];
|
701
|
+
if (part.Number == pm.PartitionNumber)
|
702
|
+
{
|
703
|
+
if (part.VolIndex >= 0)
|
704
|
+
return S_FALSE;
|
705
|
+
pm.PartitionIndex = i;
|
706
|
+
part.VolIndex = volIndex;
|
707
|
+
|
708
|
+
totalSize += (UInt64)part.Len << SecLogSize;
|
709
|
+
break;
|
710
|
+
}
|
711
|
+
}
|
712
|
+
if (i == Partitions.Size())
|
713
|
+
return S_FALSE;
|
714
|
+
}
|
715
|
+
}
|
716
|
+
|
717
|
+
RINOK(_progress->SetTotal(totalSize));
|
718
|
+
|
719
|
+
for (volIndex = 0; volIndex < LogVols.Size(); volIndex++)
|
720
|
+
{
|
721
|
+
CLogVol &vol = LogVols[volIndex];
|
722
|
+
|
723
|
+
CLongAllocDesc nextExtent = vol.FileSetLocation;
|
724
|
+
// while (nextExtent.ExtentLen != 0)
|
725
|
+
// for (int i = 0; i < 1; i++)
|
726
|
+
{
|
727
|
+
if (nextExtent.GetLen() < 512)
|
728
|
+
return S_FALSE;
|
729
|
+
CByteBuffer buf;
|
730
|
+
buf.SetCapacity(nextExtent.GetLen());
|
731
|
+
RINOK(Read(volIndex, nextExtent, buf));
|
732
|
+
const Byte *p = buf;
|
733
|
+
size_t size = nextExtent.GetLen();
|
734
|
+
|
735
|
+
CTag tag;
|
736
|
+
RINOK(tag.Parse(p, size));
|
737
|
+
if (tag.Id != DESC_TYPE_FileSet)
|
738
|
+
return S_FALSE;
|
739
|
+
|
740
|
+
CFileSet fs;
|
741
|
+
fs.RecodringTime.Parse(p + 16);
|
742
|
+
// fs.InterchangeLevel = Get16(p + 18);
|
743
|
+
// fs.MaxInterchangeLevel = Get16(p + 20);
|
744
|
+
// fs.FileSetNumber = Get32(p + 40);
|
745
|
+
// fs.FileSetDescNumber = Get32(p + 44);
|
746
|
+
|
747
|
+
// fs.Id.Parse(p + 304);
|
748
|
+
// fs.CopyrightId.Parse(p + 336);
|
749
|
+
// fs.AbstractId.Parse(p + 368);
|
750
|
+
|
751
|
+
fs.RootDirICB.Parse(p + 400);
|
752
|
+
// fs.DomainId.Parse(p + 416);
|
753
|
+
|
754
|
+
// fs.SystemStreamDirICB.Parse(p + 464);
|
755
|
+
|
756
|
+
vol.FileSets.Add(fs);
|
757
|
+
|
758
|
+
// nextExtent.Parse(p + 448);
|
759
|
+
}
|
760
|
+
|
761
|
+
for (int fsIndex = 0; fsIndex < vol.FileSets.Size(); fsIndex++)
|
762
|
+
{
|
763
|
+
CFileSet &fs = vol.FileSets[fsIndex];
|
764
|
+
int fileIndex = Files.Size();
|
765
|
+
Files.Add(CFile());
|
766
|
+
RINOK(ReadFileItem(volIndex, fsIndex, fs.RootDirICB, kNumRecureseLevelsMax));
|
767
|
+
RINOK(FillRefs(fs, fileIndex, -1, kNumRecureseLevelsMax));
|
768
|
+
}
|
769
|
+
}
|
770
|
+
|
771
|
+
return S_OK;
|
772
|
+
}
|
773
|
+
|
774
|
+
HRESULT CInArchive::Open(IInStream *inStream, CProgressVirt *progress)
|
775
|
+
{
|
776
|
+
_progress = progress;
|
777
|
+
_stream = inStream;
|
778
|
+
HRESULT res;
|
779
|
+
try { res = Open2(); }
|
780
|
+
catch(...) { Clear(); res = S_FALSE; }
|
781
|
+
_stream.Release();
|
782
|
+
return res;
|
783
|
+
}
|
784
|
+
|
785
|
+
void CInArchive::Clear()
|
786
|
+
{
|
787
|
+
Partitions.Clear();
|
788
|
+
LogVols.Clear();
|
789
|
+
Items.Clear();
|
790
|
+
Files.Clear();
|
791
|
+
_fileNameLengthTotal = 0;
|
792
|
+
_numRefs = 0;
|
793
|
+
_numExtents = 0;
|
794
|
+
_inlineExtentsSize = 0;
|
795
|
+
_processedProgressBytes = 0;
|
796
|
+
}
|
797
|
+
|
798
|
+
UString CInArchive::GetComment() const
|
799
|
+
{
|
800
|
+
UString res;
|
801
|
+
for (int i = 0; i < LogVols.Size(); i++)
|
802
|
+
{
|
803
|
+
if (i > 0)
|
804
|
+
res += L" ";
|
805
|
+
res += LogVols[i].GetName();
|
806
|
+
}
|
807
|
+
return res;
|
808
|
+
}
|
809
|
+
|
810
|
+
static UString GetSpecName(const UString &name)
|
811
|
+
{
|
812
|
+
UString name2 = name;
|
813
|
+
name2.Trim();
|
814
|
+
if (name2.IsEmpty())
|
815
|
+
{
|
816
|
+
/*
|
817
|
+
wchar_t s[32];
|
818
|
+
ConvertUInt64ToString(id, s);
|
819
|
+
return L"[" + (UString)s + L"]";
|
820
|
+
*/
|
821
|
+
return L"[]";
|
822
|
+
}
|
823
|
+
return name;
|
824
|
+
}
|
825
|
+
|
826
|
+
static void UpdateWithName(UString &res, const UString &addString)
|
827
|
+
{
|
828
|
+
if (res.IsEmpty())
|
829
|
+
res = addString;
|
830
|
+
else
|
831
|
+
res = addString + WCHAR_PATH_SEPARATOR + res;
|
832
|
+
}
|
833
|
+
|
834
|
+
UString CInArchive::GetItemPath(int volIndex, int fsIndex, int refIndex,
|
835
|
+
bool showVolName, bool showFsName) const
|
836
|
+
{
|
837
|
+
// showVolName = true;
|
838
|
+
const CLogVol &vol = LogVols[volIndex];
|
839
|
+
const CFileSet &fs = vol.FileSets[fsIndex];
|
840
|
+
|
841
|
+
UString name;
|
842
|
+
|
843
|
+
for (;;)
|
844
|
+
{
|
845
|
+
const CRef &ref = fs.Refs[refIndex];
|
846
|
+
refIndex = ref.Parent;
|
847
|
+
if (refIndex < 0)
|
848
|
+
break;
|
849
|
+
UpdateWithName(name, GetSpecName(Files[ref.FileIndex].GetName()));
|
850
|
+
}
|
851
|
+
|
852
|
+
if (showFsName)
|
853
|
+
{
|
854
|
+
wchar_t s[32];
|
855
|
+
ConvertUInt64ToString(fsIndex, s);
|
856
|
+
UString newName = L"File Set ";
|
857
|
+
newName += s;
|
858
|
+
UpdateWithName(name, newName);
|
859
|
+
}
|
860
|
+
|
861
|
+
if (showVolName)
|
862
|
+
{
|
863
|
+
wchar_t s[32];
|
864
|
+
ConvertUInt64ToString(volIndex, s);
|
865
|
+
UString newName = s;
|
866
|
+
UString newName2 = vol.GetName();
|
867
|
+
if (newName2.IsEmpty())
|
868
|
+
newName2 = L"Volume";
|
869
|
+
newName += L'-';
|
870
|
+
newName += newName2;
|
871
|
+
UpdateWithName(name, newName);
|
872
|
+
}
|
873
|
+
return name;
|
874
|
+
}
|
875
|
+
|
876
|
+
}}
|