seven-zip 1.4.2 → 1.7.0.rc1
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.
- checksums.yaml +4 -4
- data/.github/workflows/rake.yml +49 -0
- data/.github/workflows/release.yml +21 -0
- data/README.md +13 -2
- data/Rakefile +2 -0
- data/ext/p7zip/C/7zBuf.h +4 -8
- data/ext/p7zip/C/7zBuf2.c +9 -3
- data/ext/p7zip/C/7zCrc.c +84 -32
- data/ext/p7zip/C/7zCrc.h +2 -2
- data/ext/p7zip/C/7zCrcOpt.c +89 -8
- data/ext/p7zip/C/7zStream.c +4 -2
- data/ext/p7zip/C/{Types.h → 7zTypes.h} +8 -6
- data/ext/p7zip/C/7zVersion.h +21 -6
- data/ext/p7zip/C/Aes.c +28 -15
- data/ext/p7zip/C/Aes.h +2 -2
- data/ext/p7zip/C/Alloc.c +60 -12
- data/ext/p7zip/C/Alloc.h +6 -7
- data/ext/p7zip/C/Bcj2.c +256 -0
- data/ext/p7zip/C/Bcj2.h +146 -0
- data/ext/p7zip/C/Bcj2Enc.c +312 -0
- data/ext/p7zip/C/Blake2.h +48 -0
- data/ext/p7zip/C/Blake2s.c +244 -0
- data/ext/p7zip/C/Bra.c +2 -0
- data/ext/p7zip/C/Bra.h +4 -8
- data/ext/p7zip/C/Bra86.c +48 -51
- data/ext/p7zip/C/BraIA64.c +3 -1
- data/ext/p7zip/C/BwtSort.c +3 -4
- data/ext/p7zip/C/BwtSort.h +4 -8
- data/ext/p7zip/C/Compiler.h +32 -0
- data/ext/p7zip/C/CpuArch.c +50 -7
- data/ext/p7zip/C/CpuArch.h +112 -41
- data/ext/p7zip/C/Delta.c +2 -0
- data/ext/p7zip/C/Delta.h +4 -8
- data/ext/p7zip/C/HuffEnc.c +8 -6
- data/ext/p7zip/C/HuffEnc.h +4 -8
- data/ext/p7zip/C/LzFind.c +391 -108
- data/ext/p7zip/C/LzFind.h +20 -18
- data/ext/p7zip/C/LzFindMt.c +100 -90
- data/ext/p7zip/C/LzFindMt.h +4 -8
- data/ext/p7zip/C/LzHash.h +23 -20
- data/ext/p7zip/C/Lzma2Dec.c +48 -26
- data/ext/p7zip/C/Lzma2Dec.h +4 -8
- data/ext/p7zip/C/Lzma2Enc.c +58 -15
- data/ext/p7zip/C/Lzma2Enc.h +3 -7
- data/ext/p7zip/C/{LzmaUtil/Lzma86Enc.h → Lzma86.h} +47 -14
- data/ext/p7zip/C/{LzmaUtil/Lzma86Dec.c → Lzma86Dec.c} +6 -13
- data/ext/p7zip/C/{LzmaUtil/Lzma86Enc.c → Lzma86Enc.c} +8 -15
- data/ext/p7zip/C/LzmaDec.c +180 -79
- data/ext/p7zip/C/LzmaDec.h +4 -8
- data/ext/p7zip/C/LzmaEnc.c +230 -147
- data/ext/p7zip/C/LzmaEnc.h +6 -8
- data/ext/p7zip/C/MtCoder.c +3 -3
- data/ext/p7zip/C/Ppmd.h +5 -5
- data/ext/p7zip/C/Ppmd7.c +9 -7
- data/ext/p7zip/C/Ppmd7.h +3 -3
- data/ext/p7zip/C/Ppmd7Dec.c +2 -0
- data/ext/p7zip/C/Ppmd7Enc.c +4 -2
- data/ext/p7zip/C/Ppmd8.c +34 -31
- data/ext/p7zip/C/Ppmd8.h +5 -1
- data/ext/p7zip/C/Ppmd8Dec.c +2 -0
- data/ext/p7zip/C/Ppmd8Enc.c +2 -0
- data/ext/p7zip/C/Precomp.h +10 -0
- data/ext/p7zip/C/RotateDefs.h +11 -1
- data/ext/p7zip/C/Sha1.c +340 -0
- data/ext/p7zip/C/Sha1.h +38 -0
- data/ext/p7zip/C/Sha256.c +107 -63
- data/ext/p7zip/C/Sha256.h +2 -2
- data/ext/p7zip/C/Sort.c +59 -11
- data/ext/p7zip/C/Sort.h +8 -10
- data/ext/p7zip/C/Threads.h +1 -1
- data/ext/p7zip/C/Xz.c +7 -5
- data/ext/p7zip/C/Xz.h +40 -17
- data/ext/p7zip/C/XzCrc64.c +69 -16
- data/ext/p7zip/C/XzCrc64.h +2 -2
- data/ext/p7zip/C/XzCrc64Opt.c +69 -0
- data/ext/p7zip/C/XzDec.c +93 -55
- data/ext/p7zip/C/XzEnc.c +206 -165
- data/ext/p7zip/C/XzEnc.h +23 -9
- data/ext/p7zip/C/XzIn.c +50 -43
- data/ext/p7zip/CPP/7zip/Archive/7z/7zCompressionMode.h +37 -13
- data/ext/p7zip/CPP/7zip/Archive/7z/7zDecode.cpp +392 -181
- data/ext/p7zip/CPP/7zip/Archive/7z/7zDecode.h +29 -29
- data/ext/p7zip/CPP/7zip/Archive/7z/7zEncode.cpp +424 -212
- data/ext/p7zip/CPP/7zip/Archive/7z/7zEncode.h +53 -16
- data/ext/p7zip/CPP/7zip/Archive/7z/7zExtract.cpp +312 -174
- data/ext/p7zip/CPP/7zip/Archive/7z/7zFolderInStream.cpp +74 -61
- data/ext/p7zip/CPP/7zip/Archive/7z/7zFolderInStream.h +22 -19
- data/ext/p7zip/CPP/7zip/Archive/7z/7zHandler.cpp +505 -232
- data/ext/p7zip/CPP/7zip/Archive/7z/7zHandler.h +70 -16
- data/ext/p7zip/CPP/7zip/Archive/7z/7zHandlerOut.cpp +602 -172
- data/ext/p7zip/CPP/7zip/Archive/7z/7zHeader.cpp +5 -0
- data/ext/p7zip/CPP/7zip/Archive/7z/7zHeader.h +54 -3
- data/ext/p7zip/CPP/7zip/Archive/7z/7zIn.cpp +981 -616
- data/ext/p7zip/CPP/7zip/Archive/7z/7zIn.h +275 -89
- data/ext/p7zip/CPP/7zip/Archive/7z/7zItem.h +77 -162
- data/ext/p7zip/CPP/7zip/Archive/7z/7zOut.cpp +288 -238
- data/ext/p7zip/CPP/7zip/Archive/7z/7zOut.h +189 -20
- data/ext/p7zip/CPP/7zip/Archive/7z/7zProperties.cpp +59 -49
- data/ext/p7zip/CPP/7zip/Archive/7z/7zRegister.cpp +12 -9
- data/ext/p7zip/CPP/7zip/Archive/7z/7zSpecStream.cpp +4 -6
- data/ext/p7zip/CPP/7zip/Archive/7z/7zSpecStream.h +5 -5
- data/ext/p7zip/CPP/7zip/Archive/7z/7zUpdate.cpp +1743 -447
- data/ext/p7zip/CPP/7zip/Archive/7z/7zUpdate.h +61 -10
- data/ext/p7zip/CPP/7zip/Archive/ApmHandler.cpp +84 -120
- data/ext/p7zip/CPP/7zip/Archive/ArHandler.cpp +854 -0
- data/ext/p7zip/CPP/7zip/Archive/ArchiveExports.cpp +48 -32
- data/ext/p7zip/CPP/7zip/Archive/ArjHandler.cpp +519 -340
- data/ext/p7zip/CPP/7zip/Archive/Bz2Handler.cpp +223 -203
- data/ext/p7zip/CPP/7zip/Archive/Cab/CabBlockInStream.cpp +50 -139
- data/ext/p7zip/CPP/7zip/Archive/Cab/CabBlockInStream.h +17 -18
- data/ext/p7zip/CPP/7zip/Archive/Cab/CabHandler.cpp +566 -234
- data/ext/p7zip/CPP/7zip/Archive/Cab/CabHandler.h +10 -1
- data/ext/p7zip/CPP/7zip/Archive/Cab/CabHeader.cpp +2 -2
- data/ext/p7zip/CPP/7zip/Archive/Cab/CabHeader.h +12 -15
- data/ext/p7zip/CPP/7zip/Archive/Cab/CabIn.cpp +341 -122
- data/ext/p7zip/CPP/7zip/Archive/Cab/CabIn.h +81 -66
- data/ext/p7zip/CPP/7zip/Archive/Cab/CabItem.h +17 -14
- data/ext/p7zip/CPP/7zip/Archive/Cab/CabRegister.cpp +10 -4
- data/ext/p7zip/CPP/7zip/Archive/Chm/ChmHandler.cpp +190 -83
- data/ext/p7zip/CPP/7zip/Archive/Chm/ChmHandler.h +7 -1
- data/ext/p7zip/CPP/7zip/Archive/Chm/ChmIn.cpp +292 -174
- data/ext/p7zip/CPP/7zip/Archive/Chm/ChmIn.h +73 -47
- data/ext/p7zip/CPP/7zip/Archive/ComHandler.cpp +886 -0
- data/ext/p7zip/CPP/7zip/Archive/Common/CoderMixer2.cpp +994 -71
- data/ext/p7zip/CPP/7zip/Archive/Common/CoderMixer2.h +364 -101
- data/ext/p7zip/CPP/7zip/Archive/Common/DummyOutStream.cpp +7 -12
- data/ext/p7zip/CPP/7zip/Archive/Common/DummyOutStream.h +4 -3
- data/ext/p7zip/CPP/7zip/Archive/Common/FindSignature.cpp +6 -6
- data/ext/p7zip/CPP/7zip/Archive/Common/FindSignature.h +2 -2
- data/ext/p7zip/CPP/7zip/Archive/Common/HandlerOut.cpp +77 -543
- data/ext/p7zip/CPP/7zip/Archive/Common/HandlerOut.h +31 -51
- data/ext/p7zip/CPP/7zip/Archive/Common/InStreamWithCRC.cpp +18 -14
- data/ext/p7zip/CPP/7zip/Archive/Common/ItemNameUtils.cpp +34 -7
- data/ext/p7zip/CPP/7zip/Archive/Common/ItemNameUtils.h +5 -2
- data/ext/p7zip/CPP/7zip/Archive/Common/MultiStream.cpp +25 -24
- data/ext/p7zip/CPP/7zip/Archive/Common/MultiStream.h +8 -3
- data/ext/p7zip/CPP/7zip/Archive/Common/OutStreamWithCRC.h +1 -0
- data/ext/p7zip/CPP/7zip/Archive/Common/OutStreamWithSha1.cpp +2 -2
- data/ext/p7zip/CPP/7zip/Archive/Common/OutStreamWithSha1.h +5 -5
- data/ext/p7zip/CPP/7zip/Archive/Common/ParseProperties.cpp +0 -174
- data/ext/p7zip/CPP/7zip/Archive/Common/ParseProperties.h +2 -14
- data/ext/p7zip/CPP/7zip/Archive/CpioHandler.cpp +506 -335
- data/ext/p7zip/CPP/7zip/Archive/CramfsHandler.cpp +227 -84
- data/ext/p7zip/CPP/7zip/Archive/DeflateProps.cpp +0 -115
- data/ext/p7zip/CPP/7zip/Archive/DeflateProps.h +0 -29
- data/ext/p7zip/CPP/7zip/Archive/DllExports2.cpp +63 -17
- data/ext/p7zip/CPP/7zip/Archive/DmgHandler.cpp +1007 -339
- data/ext/p7zip/CPP/7zip/Archive/ElfHandler.cpp +618 -177
- data/ext/p7zip/CPP/7zip/Archive/ExtHandler.cpp +2867 -0
- data/ext/p7zip/CPP/7zip/Archive/FatHandler.cpp +136 -76
- data/ext/p7zip/CPP/7zip/Archive/FlvHandler.cpp +132 -150
- data/ext/p7zip/CPP/7zip/Archive/GptHandler.cpp +405 -0
- data/ext/p7zip/CPP/7zip/Archive/GzHandler.cpp +560 -214
- data/ext/p7zip/CPP/7zip/Archive/HandlerCont.cpp +288 -0
- data/ext/p7zip/CPP/7zip/Archive/HandlerCont.h +116 -0
- data/ext/p7zip/CPP/7zip/Archive/HfsHandler.cpp +1880 -0
- data/ext/p7zip/CPP/7zip/Archive/IArchive.h +415 -51
- data/ext/p7zip/CPP/7zip/Archive/IhexHandler.cpp +497 -0
- data/ext/p7zip/CPP/7zip/Archive/Iso/IsoHandler.cpp +158 -71
- data/ext/p7zip/CPP/7zip/Archive/Iso/IsoHandler.h +2 -1
- data/ext/p7zip/CPP/7zip/Archive/Iso/IsoHeader.cpp +0 -9
- data/ext/p7zip/CPP/7zip/Archive/Iso/IsoHeader.h +8 -5
- data/ext/p7zip/CPP/7zip/Archive/Iso/IsoIn.cpp +311 -91
- data/ext/p7zip/CPP/7zip/Archive/Iso/IsoIn.h +101 -83
- data/ext/p7zip/CPP/7zip/Archive/Iso/IsoItem.h +48 -39
- data/ext/p7zip/CPP/7zip/Archive/Iso/IsoRegister.cpp +12 -4
- data/ext/p7zip/CPP/7zip/Archive/LzhHandler.cpp +127 -114
- data/ext/p7zip/CPP/7zip/Archive/LzmaHandler.cpp +264 -121
- data/ext/p7zip/CPP/7zip/Archive/MachoHandler.cpp +402 -242
- data/ext/p7zip/CPP/7zip/Archive/MbrHandler.cpp +56 -114
- data/ext/p7zip/CPP/7zip/Archive/MslzHandler.cpp +230 -90
- data/ext/p7zip/CPP/7zip/Archive/MubHandler.cpp +129 -153
- data/ext/p7zip/CPP/7zip/Archive/Nsis/NsisDecode.cpp +179 -58
- data/ext/p7zip/CPP/7zip/Archive/Nsis/NsisDecode.h +36 -7
- data/ext/p7zip/CPP/7zip/Archive/Nsis/NsisHandler.cpp +407 -237
- data/ext/p7zip/CPP/7zip/Archive/Nsis/NsisHandler.h +9 -16
- data/ext/p7zip/CPP/7zip/Archive/Nsis/NsisIn.cpp +5535 -1098
- data/ext/p7zip/CPP/7zip/Archive/Nsis/NsisIn.h +345 -81
- data/ext/p7zip/CPP/7zip/Archive/Nsis/NsisRegister.cpp +11 -4
- data/ext/p7zip/CPP/7zip/Archive/NtfsHandler.cpp +1424 -434
- data/ext/p7zip/CPP/7zip/Archive/PeHandler.cpp +1831 -521
- data/ext/p7zip/CPP/7zip/Archive/PpmdHandler.cpp +50 -35
- data/ext/p7zip/CPP/7zip/Archive/QcowHandler.cpp +615 -0
- data/ext/p7zip/CPP/7zip/Archive/Rar/Rar5Handler.cpp +2746 -0
- data/ext/p7zip/CPP/7zip/Archive/Rar/Rar5Handler.h +411 -0
- data/ext/p7zip/CPP/7zip/Archive/Rar/RarHandler.cpp +1241 -355
- data/ext/p7zip/CPP/7zip/Archive/Rar/RarHandler.h +70 -20
- data/ext/p7zip/CPP/7zip/Archive/Rar/RarHeader.h +38 -34
- data/ext/p7zip/CPP/7zip/Archive/Rar/RarItem.h +34 -16
- data/ext/p7zip/CPP/7zip/Archive/Rar/RarVol.h +129 -0
- data/ext/p7zip/CPP/7zip/Archive/RpmHandler.cpp +641 -194
- data/ext/p7zip/CPP/7zip/Archive/SplitHandler.cpp +174 -181
- data/ext/p7zip/CPP/7zip/Archive/SquashfsHandler.cpp +237 -174
- data/ext/p7zip/CPP/7zip/Archive/SwfHandler.cpp +471 -192
- data/ext/p7zip/CPP/7zip/Archive/Tar/TarHandler.cpp +350 -59
- data/ext/p7zip/CPP/7zip/Archive/Tar/TarHandler.h +24 -7
- data/ext/p7zip/CPP/7zip/Archive/Tar/TarHandlerOut.cpp +79 -27
- data/ext/p7zip/CPP/7zip/Archive/Tar/TarHeader.cpp +5 -7
- data/ext/p7zip/CPP/7zip/Archive/Tar/TarHeader.h +20 -44
- data/ext/p7zip/CPP/7zip/Archive/Tar/TarIn.cpp +279 -64
- data/ext/p7zip/CPP/7zip/Archive/Tar/TarIn.h +10 -1
- data/ext/p7zip/CPP/7zip/Archive/Tar/TarItem.h +34 -8
- data/ext/p7zip/CPP/7zip/Archive/Tar/TarOut.cpp +145 -87
- data/ext/p7zip/CPP/7zip/Archive/Tar/TarOut.h +13 -5
- data/ext/p7zip/CPP/7zip/Archive/Tar/TarRegister.cpp +14 -9
- data/ext/p7zip/CPP/7zip/Archive/Tar/TarUpdate.cpp +154 -27
- data/ext/p7zip/CPP/7zip/Archive/Tar/TarUpdate.h +10 -6
- data/ext/p7zip/CPP/7zip/Archive/Udf/UdfHandler.cpp +53 -128
- data/ext/p7zip/CPP/7zip/Archive/Udf/UdfHandler.h +6 -5
- data/ext/p7zip/CPP/7zip/Archive/Udf/UdfIn.cpp +384 -119
- data/ext/p7zip/CPP/7zip/Archive/Udf/UdfIn.h +40 -21
- data/ext/p7zip/CPP/7zip/Archive/UefiHandler.cpp +1618 -0
- data/ext/p7zip/CPP/7zip/Archive/VdiHandler.cpp +362 -0
- data/ext/p7zip/CPP/7zip/Archive/VhdHandler.cpp +438 -247
- data/ext/p7zip/CPP/7zip/Archive/VmdkHandler.cpp +1518 -0
- data/ext/p7zip/CPP/7zip/Archive/Wim/WimHandler.cpp +837 -249
- data/ext/p7zip/CPP/7zip/Archive/Wim/WimHandler.h +73 -47
- data/ext/p7zip/CPP/7zip/Archive/Wim/WimHandlerOut.cpp +1614 -351
- data/ext/p7zip/CPP/7zip/Archive/Wim/WimIn.cpp +1519 -513
- data/ext/p7zip/CPP/7zip/Archive/Wim/WimIn.h +498 -139
- data/ext/p7zip/CPP/7zip/Archive/Wim/WimRegister.cpp +13 -9
- data/ext/p7zip/CPP/7zip/Archive/XarHandler.cpp +272 -128
- data/ext/p7zip/CPP/7zip/Archive/XzHandler.cpp +502 -253
- data/ext/p7zip/CPP/7zip/Archive/XzHandler.h +65 -0
- data/ext/p7zip/CPP/7zip/Archive/ZHandler.cpp +114 -39
- data/ext/p7zip/CPP/7zip/Archive/Zip/ZipAddCommon.cpp +118 -134
- data/ext/p7zip/CPP/7zip/Archive/Zip/ZipAddCommon.h +6 -0
- data/ext/p7zip/CPP/7zip/Archive/Zip/ZipCompressionMode.h +40 -20
- data/ext/p7zip/CPP/7zip/Archive/Zip/ZipHandler.cpp +541 -274
- data/ext/p7zip/CPP/7zip/Archive/Zip/ZipHandler.h +13 -40
- data/ext/p7zip/CPP/7zip/Archive/Zip/ZipHandlerOut.cpp +165 -254
- data/ext/p7zip/CPP/7zip/Archive/Zip/ZipHeader.h +70 -178
- data/ext/p7zip/CPP/7zip/Archive/Zip/ZipIn.cpp +1934 -550
- data/ext/p7zip/CPP/7zip/Archive/Zip/ZipIn.h +294 -63
- data/ext/p7zip/CPP/7zip/Archive/Zip/ZipItem.cpp +160 -86
- data/ext/p7zip/CPP/7zip/Archive/Zip/ZipItem.h +139 -110
- data/ext/p7zip/CPP/7zip/Archive/Zip/ZipOut.cpp +177 -154
- data/ext/p7zip/CPP/7zip/Archive/Zip/ZipOut.h +50 -18
- data/ext/p7zip/CPP/7zip/Archive/Zip/ZipRegister.cpp +18 -9
- data/ext/p7zip/CPP/7zip/Archive/Zip/ZipUpdate.cpp +367 -201
- data/ext/p7zip/CPP/7zip/Archive/Zip/ZipUpdate.h +11 -10
- data/ext/p7zip/CPP/7zip/Bundles/Format7zFree/makefile +2 -319
- data/ext/p7zip/CPP/7zip/Bundles/Format7zFree/makefile.depend +0 -4962
- data/ext/p7zip/CPP/7zip/Bundles/Format7zFree/makefile.list +1004 -259
- data/ext/p7zip/CPP/7zip/Common/CWrappers.cpp +26 -22
- data/ext/p7zip/CPP/7zip/Common/CWrappers.h +19 -14
- data/ext/p7zip/CPP/7zip/Common/CreateCoder.cpp +298 -130
- data/ext/p7zip/CPP/7zip/Common/CreateCoder.h +118 -34
- data/ext/p7zip/CPP/7zip/Common/FilePathAutoRename.cpp +24 -28
- data/ext/p7zip/CPP/7zip/Common/FilePathAutoRename.h +5 -5
- data/ext/p7zip/CPP/7zip/Common/FileStreams.cpp +268 -65
- data/ext/p7zip/CPP/7zip/Common/FileStreams.h +70 -33
- data/ext/p7zip/CPP/7zip/Common/FilterCoder.cpp +302 -131
- data/ext/p7zip/CPP/7zip/Common/FilterCoder.h +141 -43
- data/ext/p7zip/CPP/7zip/Common/InBuffer.cpp +87 -35
- data/ext/p7zip/CPP/7zip/Common/InBuffer.h +54 -45
- data/ext/p7zip/CPP/7zip/Common/InOutTempBuffer.cpp +22 -17
- data/ext/p7zip/CPP/7zip/Common/InOutTempBuffer.h +5 -5
- data/ext/p7zip/CPP/7zip/Common/LimitedStreams.cpp +256 -43
- data/ext/p7zip/CPP/7zip/Common/LimitedStreams.h +135 -8
- data/ext/p7zip/CPP/7zip/Common/MemBlocks.cpp +5 -5
- data/ext/p7zip/CPP/7zip/Common/MemBlocks.h +3 -3
- data/ext/p7zip/CPP/7zip/Common/MethodId.cpp +0 -24
- data/ext/p7zip/CPP/7zip/Common/MethodId.h +1 -1
- data/ext/p7zip/CPP/7zip/Common/MethodProps.cpp +430 -71
- data/ext/p7zip/CPP/7zip/Common/MethodProps.h +170 -17
- data/ext/p7zip/CPP/7zip/Common/OffsetStream.cpp +8 -4
- data/ext/p7zip/CPP/7zip/Common/OffsetStream.h +4 -3
- data/ext/p7zip/CPP/7zip/Common/OutBuffer.cpp +26 -31
- data/ext/p7zip/CPP/7zip/Common/OutBuffer.h +17 -18
- data/ext/p7zip/CPP/7zip/Common/OutMemStream.cpp +5 -5
- data/ext/p7zip/CPP/7zip/Common/OutMemStream.h +5 -4
- data/ext/p7zip/CPP/7zip/Common/ProgressUtils.cpp +22 -13
- data/ext/p7zip/CPP/7zip/Common/ProgressUtils.h +4 -3
- data/ext/p7zip/CPP/7zip/Common/PropId.cpp +108 -0
- data/ext/p7zip/CPP/7zip/Common/RegisterArc.h +63 -17
- data/ext/p7zip/CPP/7zip/Common/RegisterCodec.h +79 -6
- data/ext/p7zip/CPP/7zip/Common/StreamBinder.cpp +95 -90
- data/ext/p7zip/CPP/7zip/Common/StreamBinder.h +46 -23
- data/ext/p7zip/CPP/7zip/Common/StreamObjects.cpp +88 -24
- data/ext/p7zip/CPP/7zip/Common/StreamObjects.h +36 -14
- data/ext/p7zip/CPP/7zip/Common/StreamUtils.cpp +4 -4
- data/ext/p7zip/CPP/7zip/Common/StreamUtils.h +6 -6
- data/ext/p7zip/CPP/7zip/Common/UniqBlocks.cpp +57 -0
- data/ext/p7zip/CPP/7zip/Common/UniqBlocks.h +26 -0
- data/ext/p7zip/CPP/7zip/Common/VirtThread.cpp +8 -6
- data/ext/p7zip/CPP/7zip/Common/VirtThread.h +6 -5
- data/ext/p7zip/CPP/7zip/Compress/BZip2Const.h +13 -12
- data/ext/p7zip/CPP/7zip/Compress/BZip2Crc.h +1 -1
- data/ext/p7zip/CPP/7zip/Compress/BZip2Decoder.cpp +198 -147
- data/ext/p7zip/CPP/7zip/Compress/BZip2Decoder.h +60 -27
- data/ext/p7zip/CPP/7zip/Compress/BZip2Encoder.cpp +111 -116
- data/ext/p7zip/CPP/7zip/Compress/BZip2Encoder.h +53 -59
- data/ext/p7zip/CPP/7zip/Compress/BZip2Register.cpp +12 -7
- data/ext/p7zip/CPP/7zip/Compress/Bcj2Coder.cpp +554 -282
- data/ext/p7zip/CPP/7zip/Compress/Bcj2Coder.h +73 -71
- data/ext/p7zip/CPP/7zip/Compress/Bcj2Register.cpp +10 -5
- data/ext/p7zip/CPP/7zip/Compress/BcjCoder.cpp +13 -4
- data/ext/p7zip/CPP/7zip/Compress/BcjCoder.h +17 -5
- data/ext/p7zip/CPP/7zip/Compress/BcjRegister.cpp +7 -9
- data/ext/p7zip/CPP/7zip/Compress/BitlDecoder.cpp +2 -2
- data/ext/p7zip/CPP/7zip/Compress/BitlDecoder.h +58 -61
- data/ext/p7zip/CPP/7zip/Compress/BitlEncoder.h +24 -25
- data/ext/p7zip/CPP/7zip/Compress/BitmDecoder.h +46 -17
- data/ext/p7zip/CPP/7zip/Compress/BitmEncoder.h +18 -19
- data/ext/p7zip/CPP/7zip/Compress/BranchMisc.cpp +14 -28
- data/ext/p7zip/CPP/7zip/Compress/BranchMisc.h +27 -6
- data/ext/p7zip/CPP/7zip/Compress/BranchRegister.cpp +26 -15
- data/ext/p7zip/CPP/7zip/Compress/ByteSwap.cpp +45 -26
- data/ext/p7zip/CPP/7zip/Compress/CodecExports.cpp +254 -70
- data/ext/p7zip/CPP/7zip/Compress/CopyCoder.cpp +65 -17
- data/ext/p7zip/CPP/7zip/Compress/CopyCoder.h +15 -3
- data/ext/p7zip/CPP/7zip/Compress/CopyRegister.cpp +5 -4
- data/ext/p7zip/CPP/7zip/Compress/Deflate64Register.cpp +12 -6
- data/ext/p7zip/CPP/7zip/Compress/DeflateConst.h +43 -46
- data/ext/p7zip/CPP/7zip/Compress/DeflateDecoder.cpp +145 -81
- data/ext/p7zip/CPP/7zip/Compress/DeflateDecoder.h +31 -33
- data/ext/p7zip/CPP/7zip/Compress/DeflateEncoder.cpp +179 -162
- data/ext/p7zip/CPP/7zip/Compress/DeflateEncoder.h +35 -30
- data/ext/p7zip/CPP/7zip/Compress/DeflateRegister.cpp +11 -7
- data/ext/p7zip/CPP/7zip/Compress/DeltaFilter.cpp +55 -39
- data/ext/p7zip/CPP/7zip/Compress/{DllExports2.cpp → DllExports2Compress.cpp} +8 -8
- data/ext/p7zip/CPP/7zip/Compress/DllExportsCompress.cpp +48 -0
- data/ext/p7zip/CPP/7zip/Compress/HuffmanDecoder.h +220 -49
- data/ext/p7zip/CPP/7zip/Compress/ImplodeDecoder.cpp +14 -9
- data/ext/p7zip/CPP/7zip/Compress/ImplodeDecoder.h +2 -3
- data/ext/p7zip/CPP/7zip/Compress/ImplodeHuffmanDecoder.cpp +7 -7
- data/ext/p7zip/CPP/7zip/Compress/ImplodeHuffmanDecoder.h +1 -1
- data/ext/p7zip/CPP/7zip/Compress/LzOutWindow.cpp +1 -1
- data/ext/p7zip/CPP/7zip/Compress/LzOutWindow.h +21 -18
- data/ext/p7zip/CPP/7zip/Compress/LzhDecoder.cpp +171 -141
- data/ext/p7zip/CPP/7zip/Compress/LzhDecoder.h +32 -64
- data/ext/p7zip/CPP/7zip/Compress/Lzham/LICENSE +22 -0
- data/ext/p7zip/CPP/7zip/Compress/Lzham/LzhamRegister.cpp +783 -0
- data/ext/p7zip/CPP/7zip/Compress/Lzham/README.md +211 -0
- data/ext/p7zip/CPP/7zip/Compress/Lzham/include/lzham.h +803 -0
- data/ext/p7zip/CPP/7zip/Compress/Lzham/include/lzham_dynamic_lib.h +156 -0
- data/ext/p7zip/CPP/7zip/Compress/Lzham/include/lzham_exports.inc +31 -0
- data/ext/p7zip/CPP/7zip/Compress/Lzham/include/lzham_static_lib.h +59 -0
- data/ext/p7zip/CPP/7zip/Compress/Lzham/include/zlib.h +2 -0
- data/ext/p7zip/CPP/7zip/Compress/Lzham/lzhamcomp/CMakeLists.txt +69 -0
- data/ext/p7zip/CPP/7zip/Compress/Lzham/lzhamcomp/lzham_comp.h +38 -0
- data/ext/p7zip/CPP/7zip/Compress/Lzham/lzhamcomp/lzham_lzbase.cpp +244 -0
- data/ext/p7zip/CPP/7zip/Compress/Lzham/lzhamcomp/lzham_lzbase.h +46 -0
- data/ext/p7zip/CPP/7zip/Compress/Lzham/lzhamcomp/lzham_lzcomp.cpp +750 -0
- data/ext/p7zip/CPP/7zip/Compress/Lzham/lzhamcomp/lzham_lzcomp_internal.cpp +2240 -0
- data/ext/p7zip/CPP/7zip/Compress/Lzham/lzhamcomp/lzham_lzcomp_internal.h +503 -0
- data/ext/p7zip/CPP/7zip/Compress/Lzham/lzhamcomp/lzham_lzcomp_state.cpp +1684 -0
- data/ext/p7zip/CPP/7zip/Compress/Lzham/lzhamcomp/lzham_match_accel.cpp +947 -0
- data/ext/p7zip/CPP/7zip/Compress/Lzham/lzhamcomp/lzham_match_accel.h +164 -0
- data/ext/p7zip/CPP/7zip/Compress/Lzham/lzhamcomp/lzham_null_threading.h +98 -0
- data/ext/p7zip/CPP/7zip/Compress/Lzham/lzhamcomp/lzham_pthreads_threading.cpp +214 -0
- data/ext/p7zip/CPP/7zip/Compress/Lzham/lzhamcomp/lzham_pthreads_threading.h +535 -0
- data/ext/p7zip/CPP/7zip/Compress/Lzham/lzhamcomp/lzham_threading.h +12 -0
- data/ext/p7zip/CPP/7zip/Compress/Lzham/lzhamcomp/lzham_win32_threading.cpp +232 -0
- data/ext/p7zip/CPP/7zip/Compress/Lzham/lzhamcomp/lzham_win32_threading.h +387 -0
- data/ext/p7zip/CPP/7zip/Compress/Lzham/lzhamcomp/lzhamcomp.vcxproj +208 -0
- data/ext/p7zip/CPP/7zip/Compress/Lzham/lzhamdecomp/CMakeLists.txt +86 -0
- data/ext/p7zip/CPP/7zip/Compress/Lzham/lzhamdecomp/lzham_assert.cpp +80 -0
- data/ext/p7zip/CPP/7zip/Compress/Lzham/lzhamdecomp/lzham_assert.h +58 -0
- data/ext/p7zip/CPP/7zip/Compress/Lzham/lzhamdecomp/lzham_checksum.cpp +73 -0
- data/ext/p7zip/CPP/7zip/Compress/Lzham/lzhamdecomp/lzham_checksum.h +13 -0
- data/ext/p7zip/CPP/7zip/Compress/Lzham/lzhamdecomp/lzham_config.h +25 -0
- data/ext/p7zip/CPP/7zip/Compress/Lzham/lzhamdecomp/lzham_core.h +303 -0
- data/ext/p7zip/CPP/7zip/Compress/Lzham/lzhamdecomp/lzham_decomp.h +37 -0
- data/ext/p7zip/CPP/7zip/Compress/Lzham/lzhamdecomp/lzham_helpers.h +54 -0
- data/ext/p7zip/CPP/7zip/Compress/Lzham/lzhamdecomp/lzham_huffman_codes.cpp +286 -0
- data/ext/p7zip/CPP/7zip/Compress/Lzham/lzhamdecomp/lzham_huffman_codes.h +32 -0
- data/ext/p7zip/CPP/7zip/Compress/Lzham/lzhamdecomp/lzham_lzdecomp.cpp +1586 -0
- data/ext/p7zip/CPP/7zip/Compress/Lzham/lzhamdecomp/lzham_lzdecompbase.cpp +131 -0
- data/ext/p7zip/CPP/7zip/Compress/Lzham/lzhamdecomp/lzham_lzdecompbase.h +89 -0
- data/ext/p7zip/CPP/7zip/Compress/Lzham/lzhamdecomp/lzham_math.h +142 -0
- data/ext/p7zip/CPP/7zip/Compress/Lzham/lzhamdecomp/lzham_mem.cpp +463 -0
- data/ext/p7zip/CPP/7zip/Compress/Lzham/lzhamdecomp/lzham_mem.h +115 -0
- data/ext/p7zip/CPP/7zip/Compress/Lzham/lzhamdecomp/lzham_platform.cpp +159 -0
- data/ext/p7zip/CPP/7zip/Compress/Lzham/lzhamdecomp/lzham_platform.h +284 -0
- data/ext/p7zip/CPP/7zip/Compress/Lzham/lzhamdecomp/lzham_prefix_coding.cpp +431 -0
- data/ext/p7zip/CPP/7zip/Compress/Lzham/lzhamdecomp/lzham_prefix_coding.h +157 -0
- data/ext/p7zip/CPP/7zip/Compress/Lzham/lzhamdecomp/lzham_symbol_codec.cpp +1527 -0
- data/ext/p7zip/CPP/7zip/Compress/Lzham/lzhamdecomp/lzham_symbol_codec.h +494 -0
- data/ext/p7zip/CPP/7zip/Compress/Lzham/lzhamdecomp/lzham_timer.cpp +147 -0
- data/ext/p7zip/CPP/7zip/Compress/Lzham/lzhamdecomp/lzham_timer.h +99 -0
- data/ext/p7zip/CPP/7zip/Compress/Lzham/lzhamdecomp/lzham_traits.h +141 -0
- data/ext/p7zip/CPP/7zip/Compress/Lzham/lzhamdecomp/lzham_types.h +72 -0
- data/ext/p7zip/CPP/7zip/Compress/Lzham/lzhamdecomp/lzham_utils.h +58 -0
- data/ext/p7zip/CPP/7zip/Compress/Lzham/lzhamdecomp/lzham_vector.cpp +83 -0
- data/ext/p7zip/CPP/7zip/Compress/Lzham/lzhamdecomp/lzham_vector.h +628 -0
- data/ext/p7zip/CPP/7zip/Compress/Lzham/lzhamdecomp/lzhamdecomp.vcxproj +224 -0
- data/ext/p7zip/CPP/7zip/Compress/Lzham/lzhamlib/lzham_lib.cpp +179 -0
- data/ext/p7zip/CPP/7zip/Compress/Lzham/lzhamlib/lzhamlib.vcxproj +187 -0
- data/ext/p7zip/CPP/7zip/Compress/Lzham/makefile +10 -0
- data/ext/p7zip/CPP/7zip/Compress/Lzham/makefile.depend +0 -0
- data/ext/p7zip/CPP/7zip/Compress/Lzham/makefile.list +129 -0
- data/ext/p7zip/CPP/7zip/Compress/Lzma2Decoder.cpp +123 -46
- data/ext/p7zip/CPP/7zip/Compress/Lzma2Decoder.h +29 -14
- data/ext/p7zip/CPP/7zip/Compress/Lzma2Encoder.cpp +14 -9
- data/ext/p7zip/CPP/7zip/Compress/Lzma2Encoder.h +1 -1
- data/ext/p7zip/CPP/7zip/Compress/Lzma2Register.cpp +9 -7
- data/ext/p7zip/CPP/7zip/Compress/LzmaDecoder.cpp +24 -8
- data/ext/p7zip/CPP/7zip/Compress/LzmaDecoder.h +8 -1
- data/ext/p7zip/CPP/7zip/Compress/LzmaEncoder.cpp +30 -27
- data/ext/p7zip/CPP/7zip/Compress/LzmaEncoder.h +3 -1
- data/ext/p7zip/CPP/7zip/Compress/LzmaRegister.cpp +9 -7
- data/ext/p7zip/CPP/7zip/Compress/LzmsDecoder.cpp +576 -0
- data/ext/p7zip/CPP/7zip/Compress/LzmsDecoder.h +271 -0
- data/ext/p7zip/CPP/7zip/Compress/Lzx.h +32 -36
- data/ext/p7zip/CPP/7zip/Compress/LzxDecoder.cpp +380 -238
- data/ext/p7zip/CPP/7zip/Compress/LzxDecoder.h +170 -83
- data/ext/p7zip/CPP/7zip/Compress/Mtf8.h +7 -9
- data/ext/p7zip/CPP/7zip/Compress/PpmdDecoder.cpp +1 -5
- data/ext/p7zip/CPP/7zip/Compress/PpmdEncoder.cpp +51 -18
- data/ext/p7zip/CPP/7zip/Compress/PpmdEncoder.h +18 -8
- data/ext/p7zip/CPP/7zip/Compress/PpmdRegister.cpp +9 -8
- data/ext/p7zip/CPP/7zip/Compress/PpmdZip.cpp +61 -25
- data/ext/p7zip/CPP/7zip/Compress/PpmdZip.h +21 -6
- data/ext/p7zip/CPP/7zip/Compress/QuantumDecoder.cpp +122 -102
- data/ext/p7zip/CPP/7zip/Compress/QuantumDecoder.h +68 -157
- data/ext/p7zip/CPP/7zip/Compress/Rar/makefile +33 -18
- data/ext/p7zip/CPP/7zip/Compress/Rar/makefile.depend +0 -158
- data/ext/p7zip/CPP/7zip/Compress/Rar/makefile.list +105 -56
- data/ext/p7zip/CPP/7zip/Compress/Rar1Decoder.cpp +34 -21
- data/ext/p7zip/CPP/7zip/Compress/Rar1Decoder.h +2 -0
- data/ext/p7zip/CPP/7zip/Compress/Rar2Decoder.cpp +77 -67
- data/ext/p7zip/CPP/7zip/Compress/Rar2Decoder.h +12 -10
- data/ext/p7zip/CPP/7zip/Compress/Rar3Decoder.cpp +139 -118
- data/ext/p7zip/CPP/7zip/Compress/Rar3Decoder.h +48 -33
- data/ext/p7zip/CPP/7zip/Compress/Rar3Vm.cpp +148 -113
- data/ext/p7zip/CPP/7zip/Compress/Rar3Vm.h +35 -19
- data/ext/p7zip/CPP/7zip/Compress/Rar5Decoder.cpp +961 -0
- data/ext/p7zip/CPP/7zip/Compress/Rar5Decoder.h +335 -0
- data/ext/p7zip/CPP/7zip/Compress/RarCodecsRegister.cpp +13 -6
- data/ext/p7zip/CPP/7zip/Compress/ShrinkDecoder.cpp +91 -71
- data/ext/p7zip/CPP/7zip/Compress/ShrinkDecoder.h +2 -4
- data/ext/p7zip/CPP/7zip/Compress/XpressDecoder.cpp +129 -0
- data/ext/p7zip/CPP/7zip/Compress/XpressDecoder.h +13 -0
- data/ext/p7zip/CPP/7zip/Compress/ZDecoder.cpp +98 -20
- data/ext/p7zip/CPP/7zip/Compress/ZDecoder.h +19 -7
- data/ext/p7zip/CPP/7zip/Compress/ZlibDecoder.cpp +14 -11
- data/ext/p7zip/CPP/7zip/Compress/ZlibDecoder.h +32 -1
- data/ext/p7zip/CPP/7zip/Crypto/7zAes.cpp +137 -101
- data/ext/p7zip/CPP/7zip/Crypto/7zAes.h +31 -30
- data/ext/p7zip/CPP/7zip/Crypto/7zAesRegister.cpp +8 -9
- data/ext/p7zip/CPP/7zip/Crypto/HmacSha1.cpp +39 -28
- data/ext/p7zip/CPP/7zip/Crypto/HmacSha1.h +3 -3
- data/ext/p7zip/CPP/7zip/Crypto/HmacSha256.cpp +62 -0
- data/ext/p7zip/CPP/7zip/Crypto/HmacSha256.h +27 -0
- data/ext/p7zip/CPP/7zip/Crypto/MyAes.cpp +73 -7
- data/ext/p7zip/CPP/7zip/Crypto/MyAes.h +25 -8
- data/ext/p7zip/CPP/7zip/Crypto/MyAesReg.cpp +16 -0
- data/ext/p7zip/CPP/7zip/Crypto/Pbkdf2HmacSha1.cpp +29 -15
- data/ext/p7zip/CPP/7zip/Crypto/Pbkdf2HmacSha1.h +2 -1
- data/ext/p7zip/CPP/7zip/Crypto/RandGen.cpp +49 -34
- data/ext/p7zip/CPP/7zip/Crypto/RandGen.h +2 -2
- data/ext/p7zip/CPP/7zip/Crypto/Rar20Crypto.cpp +36 -39
- data/ext/p7zip/CPP/7zip/Crypto/Rar20Crypto.h +15 -17
- data/ext/p7zip/CPP/7zip/Crypto/Rar5Aes.cpp +257 -0
- data/ext/p7zip/CPP/7zip/Crypto/Rar5Aes.h +84 -0
- data/ext/p7zip/CPP/7zip/Crypto/RarAes.cpp +70 -71
- data/ext/p7zip/CPP/7zip/Crypto/RarAes.h +24 -19
- data/ext/p7zip/CPP/7zip/Crypto/Sha1Cls.h +51 -0
- data/ext/p7zip/CPP/7zip/Crypto/WzAes.cpp +68 -54
- data/ext/p7zip/CPP/7zip/Crypto/WzAes.h +37 -27
- data/ext/p7zip/CPP/7zip/Crypto/ZipCrypto.cpp +60 -34
- data/ext/p7zip/CPP/7zip/Crypto/ZipCrypto.h +28 -11
- data/ext/p7zip/CPP/7zip/Crypto/ZipStrong.cpp +90 -28
- data/ext/p7zip/CPP/7zip/Crypto/ZipStrong.h +13 -2
- data/ext/p7zip/CPP/7zip/Guid.txt +57 -11
- data/ext/p7zip/CPP/7zip/ICoder.h +202 -17
- data/ext/p7zip/CPP/7zip/IDecl.h +16 -3
- data/ext/p7zip/CPP/7zip/IPassword.h +1 -2
- data/ext/p7zip/CPP/7zip/IProgress.h +2 -16
- data/ext/p7zip/CPP/7zip/IStream.h +82 -13
- data/ext/p7zip/CPP/7zip/MyVersion.h +2 -11
- data/ext/p7zip/CPP/7zip/PropID.h +60 -9
- data/ext/p7zip/CPP/Common/C_FileIO.cpp +5 -1
- data/ext/p7zip/CPP/Common/C_FileIO.h +7 -1
- data/ext/p7zip/CPP/Common/CommandLineParser.cpp +122 -148
- data/ext/p7zip/CPP/Common/CommandLineParser.h +20 -29
- data/ext/p7zip/CPP/Common/Common.h +13 -0
- data/ext/p7zip/CPP/Common/CrcReg.cpp +98 -0
- data/ext/p7zip/CPP/Common/Defs.h +5 -10
- data/ext/p7zip/CPP/Common/DynLimBuf.cpp +93 -0
- data/ext/p7zip/CPP/Common/DynLimBuf.h +40 -0
- data/ext/p7zip/CPP/Common/DynamicBuffer.h +45 -31
- data/ext/p7zip/CPP/Common/IntToString.cpp +109 -40
- data/ext/p7zip/CPP/Common/IntToString.h +14 -9
- data/ext/p7zip/CPP/Common/Lang.cpp +120 -87
- data/ext/p7zip/CPP/Common/Lang.h +10 -15
- data/ext/p7zip/CPP/Common/ListFileUtils.cpp +82 -40
- data/ext/p7zip/CPP/Common/ListFileUtils.h +7 -4
- data/ext/p7zip/CPP/Common/MyBuffer.h +244 -0
- data/ext/p7zip/CPP/Common/MyCom.h +65 -28
- data/ext/p7zip/CPP/Common/MyGuidDef.h +1 -1
- data/ext/p7zip/CPP/Common/MyInitGuid.h +23 -0
- data/ext/p7zip/CPP/Common/MyLinux.h +42 -0
- data/ext/p7zip/CPP/Common/MyMap.cpp +8 -8
- data/ext/p7zip/CPP/Common/MyMap.h +2 -2
- data/ext/p7zip/CPP/Common/MyString.cpp +1643 -117
- data/ext/p7zip/CPP/Common/MyString.h +677 -486
- data/ext/p7zip/CPP/Common/MyTypes.h +38 -0
- data/ext/p7zip/CPP/Common/MyUnknown.h +4 -0
- data/ext/p7zip/CPP/Common/MyVector.cpp +0 -84
- data/ext/p7zip/CPP/Common/MyVector.h +472 -112
- data/ext/p7zip/CPP/Common/MyWindows.cpp +18 -1
- data/ext/p7zip/CPP/Common/MyWindows.h +8 -0
- data/ext/p7zip/CPP/Common/MyXml.cpp +169 -118
- data/ext/p7zip/CPP/Common/MyXml.h +14 -11
- data/ext/p7zip/CPP/Common/NewHandler.cpp +39 -0
- data/ext/p7zip/CPP/Common/NewHandler.h +55 -2
- data/ext/p7zip/CPP/Common/Random.h +14 -0
- data/ext/p7zip/CPP/Common/Sha1Reg.cpp +40 -0
- data/ext/p7zip/CPP/Common/Sha256Reg.cpp +40 -0
- data/ext/p7zip/CPP/Common/StdInStream.cpp +46 -27
- data/ext/p7zip/CPP/Common/StdInStream.h +11 -10
- data/ext/p7zip/CPP/Common/StdOutStream.cpp +48 -35
- data/ext/p7zip/CPP/Common/StdOutStream.h +44 -17
- data/ext/p7zip/CPP/Common/StringConvert.cpp +56 -17
- data/ext/p7zip/CPP/Common/StringConvert.h +7 -3
- data/ext/p7zip/CPP/Common/StringToInt.cpp +102 -48
- data/ext/p7zip/CPP/Common/StringToInt.h +13 -10
- data/ext/p7zip/CPP/Common/TextConfig.cpp +33 -47
- data/ext/p7zip/CPP/Common/TextConfig.h +3 -6
- data/ext/p7zip/CPP/Common/UTFConvert.cpp +218 -75
- data/ext/p7zip/CPP/Common/UTFConvert.h +4 -3
- data/ext/p7zip/CPP/Common/Wildcard.cpp +345 -125
- data/ext/p7zip/CPP/Common/Wildcard.h +82 -13
- data/ext/p7zip/CPP/Common/XzCrc64Reg.cpp +42 -0
- data/ext/p7zip/CPP/Windows/FileDir.cpp +427 -475
- data/ext/p7zip/CPP/Windows/FileDir.h +94 -72
- data/ext/p7zip/CPP/Windows/FileFind.cpp +235 -244
- data/ext/p7zip/CPP/Windows/FileFind.h +63 -59
- data/ext/p7zip/CPP/Windows/FileIO.cpp +29 -46
- data/ext/p7zip/CPP/Windows/FileIO.h +40 -42
- data/ext/p7zip/CPP/Windows/FileName.cpp +696 -17
- data/ext/p7zip/CPP/Windows/FileName.h +11 -3
- data/ext/p7zip/CPP/Windows/NtCheck.h +2 -0
- data/ext/p7zip/CPP/Windows/PropVariant.cpp +134 -30
- data/ext/p7zip/CPP/Windows/PropVariant.h +80 -24
- data/ext/p7zip/CPP/Windows/PropVariantUtils.cpp +89 -18
- data/ext/p7zip/CPP/Windows/PropVariantUtils.h +12 -7
- data/ext/p7zip/CPP/Windows/System.cpp +20 -15
- data/ext/p7zip/CPP/Windows/System.h +3 -2
- data/ext/p7zip/CPP/Windows/TimeUtils.cpp +203 -0
- data/ext/p7zip/CPP/Windows/TimeUtils.h +24 -0
- data/ext/p7zip/CPP/include_windows/basetyps.h +4 -4
- data/ext/p7zip/CPP/include_windows/windows.h +17 -11
- data/ext/p7zip/CPP/myWindows/StdAfx.h +97 -5
- data/ext/p7zip/CPP/myWindows/config.h +20 -5
- data/ext/p7zip/CPP/myWindows/myPrivate.h +8 -0
- data/ext/p7zip/CPP/myWindows/wine_date_and_time.cpp +34 -0
- data/ext/p7zip/ChangeLog +283 -35
- data/ext/p7zip/{DOCS → DOC}/7zC.txt +6 -13
- data/ext/p7zip/{DOCS → DOC}/License.txt +3 -2
- data/ext/p7zip/{DOCS/MANUAL → DOC/MANUAL/cmdline}/commands/add.htm +93 -87
- data/ext/p7zip/{DOCS/MANUAL → DOC/MANUAL/cmdline}/commands/bench.htm +88 -79
- data/ext/p7zip/{DOCS/MANUAL → DOC/MANUAL/cmdline}/commands/delete.htm +62 -59
- data/ext/p7zip/{DOCS/MANUAL → DOC/MANUAL/cmdline}/commands/extract.htm +96 -91
- data/ext/p7zip/{DOCS/MANUAL → DOC/MANUAL/cmdline}/commands/extract_full.htm +73 -68
- data/ext/p7zip/DOC/MANUAL/cmdline/commands/hash.htm +65 -0
- data/ext/p7zip/{DOCS/MANUAL → DOC/MANUAL/cmdline}/commands/index.htm +36 -33
- data/ext/p7zip/{DOCS/MANUAL → DOC/MANUAL/cmdline}/commands/list.htm +78 -77
- data/ext/p7zip/DOC/MANUAL/cmdline/commands/rename.htm +51 -0
- data/ext/p7zip/{DOCS/MANUAL → DOC/MANUAL/cmdline}/commands/style.css +232 -232
- data/ext/p7zip/{DOCS/MANUAL → DOC/MANUAL/cmdline}/commands/test.htm +47 -46
- data/ext/p7zip/{DOCS/MANUAL → DOC/MANUAL/cmdline}/commands/update.htm +71 -66
- data/ext/p7zip/{DOCS/MANUAL → DOC/MANUAL/cmdline}/exit_codes.htm +27 -27
- data/ext/p7zip/{DOCS/MANUAL → DOC/MANUAL/cmdline}/index.htm +29 -29
- data/ext/p7zip/{DOCS/MANUAL/switches → DOC/MANUAL/cmdline}/style.css +232 -232
- data/ext/p7zip/{DOCS/MANUAL → DOC/MANUAL/cmdline}/switches/ar_exclude.htm +56 -56
- data/ext/p7zip/{DOCS/MANUAL → DOC/MANUAL/cmdline}/switches/ar_include.htm +80 -83
- data/ext/p7zip/{DOCS/MANUAL → DOC/MANUAL/cmdline}/switches/ar_no.htm +52 -52
- data/ext/p7zip/DOC/MANUAL/cmdline/switches/bb.htm +61 -0
- data/ext/p7zip/DOC/MANUAL/cmdline/switches/bs.htm +67 -0
- data/ext/p7zip/DOC/MANUAL/cmdline/switches/charset.htm +61 -0
- data/ext/p7zip/{DOCS/MANUAL → DOC/MANUAL/cmdline}/switches/exclude.htm +71 -60
- data/ext/p7zip/{DOCS/MANUAL → DOC/MANUAL/cmdline}/switches/include.htm +89 -87
- data/ext/p7zip/{DOCS/MANUAL → DOC/MANUAL/cmdline}/switches/index.htm +95 -64
- data/ext/p7zip/{DOCS/MANUAL → DOC/MANUAL/cmdline}/switches/large_pages.htm +59 -50
- data/ext/p7zip/{DOCS/MANUAL → DOC/MANUAL/cmdline}/switches/list_tech.htm +36 -36
- data/ext/p7zip/{DOCS/MANUAL → DOC/MANUAL/cmdline}/switches/method.htm +738 -625
- data/ext/p7zip/{DOCS/MANUAL → DOC/MANUAL/cmdline}/switches/output_dir.htm +53 -53
- data/ext/p7zip/{DOCS/MANUAL → DOC/MANUAL/cmdline}/switches/overwrite.htm +56 -56
- data/ext/p7zip/{DOCS/MANUAL → DOC/MANUAL/cmdline}/switches/password.htm +55 -54
- data/ext/p7zip/{DOCS/MANUAL → DOC/MANUAL/cmdline}/switches/recurse.htm +85 -83
- data/ext/p7zip/DOC/MANUAL/cmdline/switches/sa.htm +58 -0
- data/ext/p7zip/DOC/MANUAL/cmdline/switches/scc.htm +42 -0
- data/ext/p7zip/DOC/MANUAL/cmdline/switches/scrc.htm +53 -0
- data/ext/p7zip/DOC/MANUAL/cmdline/switches/sdel.htm +39 -0
- data/ext/p7zip/{DOCS/MANUAL → DOC/MANUAL/cmdline}/switches/sfx.htm +153 -156
- data/ext/p7zip/DOC/MANUAL/cmdline/switches/shared.htm +40 -0
- data/ext/p7zip/DOC/MANUAL/cmdline/switches/sni.htm +56 -0
- data/ext/p7zip/DOC/MANUAL/cmdline/switches/sns.htm +77 -0
- data/ext/p7zip/DOC/MANUAL/cmdline/switches/spf.htm +80 -0
- data/ext/p7zip/{DOCS/MANUAL → DOC/MANUAL/cmdline}/switches/ssc.htm +50 -50
- data/ext/p7zip/{DOCS/MANUAL → DOC/MANUAL/cmdline}/switches/stdin.htm +56 -55
- data/ext/p7zip/{DOCS/MANUAL → DOC/MANUAL/cmdline}/switches/stdout.htm +54 -50
- data/ext/p7zip/DOC/MANUAL/cmdline/switches/stl.htm +39 -0
- data/ext/p7zip/{DOCS/MANUAL → DOC/MANUAL/cmdline}/switches/stop_switch.htm +31 -31
- data/ext/p7zip/DOC/MANUAL/cmdline/switches/stx.htm +50 -0
- data/ext/p7zip/{DOCS/MANUAL → DOC/MANUAL/cmdline/switches}/style.css +232 -232
- data/ext/p7zip/{DOCS/MANUAL → DOC/MANUAL/cmdline}/switches/type.htm +121 -83
- data/ext/p7zip/{DOCS/MANUAL → DOC/MANUAL/cmdline}/switches/update.htm +177 -176
- data/ext/p7zip/{DOCS/MANUAL → DOC/MANUAL/cmdline}/switches/volume.htm +49 -49
- data/ext/p7zip/{DOCS/MANUAL → DOC/MANUAL/cmdline}/switches/working_dir.htm +56 -55
- data/ext/p7zip/{DOCS/MANUAL → DOC/MANUAL/cmdline}/switches/yes.htm +48 -48
- data/ext/p7zip/{DOCS/MANUAL → DOC/MANUAL/cmdline}/syntax.htm +120 -120
- data/ext/p7zip/DOC/MANUAL/fm/about.htm +21 -0
- data/ext/p7zip/DOC/MANUAL/fm/benchmark.htm +56 -0
- data/ext/p7zip/DOC/MANUAL/fm/index.htm +54 -0
- data/ext/p7zip/DOC/MANUAL/fm/menu.htm +154 -0
- data/ext/p7zip/DOC/MANUAL/fm/options.htm +152 -0
- data/ext/p7zip/DOC/MANUAL/fm/plugins/7-zip/add.htm +311 -0
- data/ext/p7zip/DOC/MANUAL/fm/plugins/7-zip/extract.htm +78 -0
- data/ext/p7zip/DOC/MANUAL/fm/plugins/7-zip/index.htm +63 -0
- data/ext/p7zip/DOC/MANUAL/fm/plugins/7-zip/style.css +232 -0
- data/ext/p7zip/DOC/MANUAL/fm/plugins/index.htm +22 -0
- data/ext/p7zip/DOC/MANUAL/fm/plugins/style.css +232 -0
- data/ext/p7zip/DOC/MANUAL/fm/style.css +232 -0
- data/ext/p7zip/DOC/MANUAL/general/7z.htm +117 -0
- data/ext/p7zip/DOC/MANUAL/general/faq.htm +125 -0
- data/ext/p7zip/DOC/MANUAL/general/formats.htm +100 -0
- data/ext/p7zip/DOC/MANUAL/general/index.htm +27 -0
- data/ext/p7zip/DOC/MANUAL/general/license.htm +30 -0
- data/ext/p7zip/DOC/MANUAL/general/performance.htm +98 -0
- data/ext/p7zip/DOC/MANUAL/general/style.css +232 -0
- data/ext/p7zip/DOC/MANUAL/general/thanks.htm +43 -0
- data/ext/p7zip/DOC/MANUAL/start.htm +37 -0
- data/ext/p7zip/DOC/MANUAL/style.css +232 -0
- data/ext/p7zip/DOC/Methods.txt +158 -0
- data/ext/p7zip/{DOCS → DOC}/copying.txt +9 -11
- data/ext/p7zip/DOC/lzma.txt +328 -0
- data/ext/p7zip/{DOCS → DOC}/readme.txt +42 -65
- data/ext/p7zip/{DOCS/history.txt → DOC/src-history.txt} +88 -2
- data/ext/p7zip/README +117 -91
- data/ext/p7zip/TODO +0 -2
- data/ext/p7zip/install.sh +31 -29
- data/ext/p7zip/last_error +1 -0
- data/ext/p7zip/makefile +29 -125
- data/ext/p7zip/makefile.afl +23 -0
- data/ext/p7zip/makefile.aix_gcc +5 -4
- data/ext/p7zip/makefile.android_arm +49 -0
- data/ext/p7zip/makefile.beos +5 -4
- data/ext/p7zip/makefile.common +150 -0
- data/ext/p7zip/makefile.crc32 +3 -3
- data/ext/p7zip/makefile.cygwin +5 -4
- data/ext/p7zip/makefile.cygwin64 +21 -0
- data/ext/p7zip/makefile.cygwin64_asm +22 -0
- data/ext/p7zip/makefile.cygwin_asm +6 -4
- data/ext/p7zip/makefile.cygwin_clang +21 -0
- data/ext/p7zip/makefile.cygwin_clang_asm +23 -0
- data/ext/p7zip/{makefile.djgpp_old → makefile.djgpp} +5 -4
- data/ext/p7zip/makefile.djgpp_watt +7 -5
- data/ext/p7zip/makefile.freebsd5 +5 -4
- data/ext/p7zip/{makefile.freebsd6 → makefile.freebsd6+} +6 -5
- data/ext/p7zip/makefile.glb +27 -18
- data/ext/p7zip/makefile.gprof +3 -2
- data/ext/p7zip/makefile.haiku +19 -0
- data/ext/p7zip/makefile.hpux-acc +3 -2
- data/ext/p7zip/makefile.hpux-acc_64 +3 -2
- data/ext/p7zip/makefile.hpux-gcc +5 -4
- data/ext/p7zip/makefile.linux_amd64 +5 -4
- data/ext/p7zip/makefile.linux_amd64_asm +12 -5
- data/ext/p7zip/makefile.linux_amd64_asm_icc +5 -3
- data/ext/p7zip/makefile.linux_amd64_sanitizer +26 -0
- data/ext/p7zip/makefile.linux_any_cpu +5 -4
- data/ext/p7zip/makefile.linux_any_cpu_gcc_4.X +7 -4
- data/ext/p7zip/makefile.linux_clang_amd64_asm +25 -0
- data/ext/p7zip/makefile.linux_clang_amd64_asm_sanitize +27 -0
- data/ext/p7zip/makefile.linux_cross_aarch64 +25 -0
- data/ext/p7zip/makefile.linux_cross_arm +7 -4
- data/ext/p7zip/makefile.linux_cross_djgpp +27 -0
- data/ext/p7zip/makefile.linux_cross_m68k +26 -0
- data/ext/p7zip/makefile.linux_cross_mipsel +27 -0
- data/ext/p7zip/makefile.linux_cross_ppc +25 -0
- data/ext/p7zip/makefile.linux_cross_ppc64 +25 -0
- data/ext/p7zip/makefile.linux_cross_ppc64le +25 -0
- data/ext/p7zip/makefile.linux_cross_s390x +25 -0
- data/ext/p7zip/makefile.linux_cross_sparc64 +25 -0
- data/ext/p7zip/makefile.linux_gcc6_sanitize +23 -0
- data/ext/p7zip/makefile.linux_gcc_2.95_no_need_for_libstdc +6 -4
- data/ext/p7zip/makefile.linux_other +6 -5
- data/ext/p7zip/makefile.linux_s390x +5 -4
- data/ext/p7zip/{makefile.machine_base → makefile.linux_scan-build} +5 -4
- data/ext/p7zip/makefile.linux_valgrind +25 -0
- data/ext/p7zip/{makefile.linux_clang_amd64 → makefile.linux_x32} +6 -5
- data/ext/p7zip/makefile.linux_x86_asm_gcc_4.X +10 -5
- data/ext/p7zip/makefile.linux_x86_asm_gcc_4.X_fltk +8 -4
- data/ext/p7zip/makefile.linux_x86_asm_gcc_mudflap_4.X +4 -2
- data/ext/p7zip/makefile.linux_x86_asm_icc +4 -2
- data/ext/p7zip/makefile.linux_x86_icc +3 -2
- data/ext/p7zip/makefile.macosx_arm64 +17 -0
- data/ext/p7zip/{makefile.macosx_32bits → makefile.macosx_gcc_32bits} +3 -2
- data/ext/p7zip/{makefile.macosx_32bits_asm → makefile.macosx_gcc_32bits_asm} +5 -3
- data/ext/p7zip/{makefile.macosx_32bits_ppc → makefile.macosx_gcc_32bits_ppc} +3 -2
- data/ext/p7zip/{makefile.macosx_64bits → makefile.macosx_gcc_64bits} +3 -2
- data/ext/p7zip/makefile.macosx_llvm_64bits +9 -3
- data/ext/p7zip/makefile.netbsd +5 -4
- data/ext/p7zip/makefile.netware_asm_gcc_3.X +6 -4
- data/ext/p7zip/makefile.oldmake +41 -130
- data/ext/p7zip/makefile.openbsd +7 -3
- data/ext/p7zip/makefile.openbsd_no_port +9 -5
- data/ext/p7zip/makefile.qnx_shared.bin +5 -4
- data/ext/p7zip/makefile.qnx_static +5 -4
- data/ext/p7zip/makefile.solaris_sparc_CC_32 +5 -4
- data/ext/p7zip/makefile.solaris_sparc_CC_64 +6 -4
- data/ext/p7zip/makefile.solaris_sparc_gcc +7 -6
- data/ext/p7zip/makefile.solaris_x86 +5 -4
- data/ext/p7zip/makefile.tru64 +5 -4
- data/ext/seven_zip_ruby/extconf.rb +92 -6
- data/ext/seven_zip_ruby/seven_zip_archive.cpp +40 -17
- data/ext/seven_zip_ruby/seven_zip_archive.h +1 -1
- data/ext/seven_zip_ruby/utils.cpp +267 -124
- data/ext/seven_zip_ruby/utils.h +2 -0
- data/lib/seven_zip_ruby/7z.dll +0 -0
- data/lib/seven_zip_ruby/7z.sfx +0 -0
- data/lib/seven_zip_ruby/7z64.dll +0 -0
- data/lib/seven_zip_ruby/7zCon.sfx +0 -0
- data/lib/seven_zip_ruby/seven_zip_reader.rb +16 -1
- data/lib/seven_zip_ruby/version.rb +1 -1
- data/p7zip/.gitignore +7 -0
- data/p7zip/README.txt +29 -0
- data/p7zip/extract.sh +134 -0
- data/spec/seven_zip_ruby_spec.rb +22 -13
- data/test/res/The Flying Spaghetti Monster.txt +3 -0
- data/test/res/The Three Little Pigs.txt +5 -0
- data/test/res/UTF_content.txt +3 -0
- data/test/res/test_reader_data.7z +0 -0
- data/test/res/test_reader_filename_cp932.7z +0 -0
- data/test/res/test_reader_files.7z +0 -0
- data/test/test_seven_zip_reader.rb +187 -0
- data/test/test_seven_zip_writer.rb +184 -0
- metadata +267 -219
- data/.github/workflows/test-and-release.yml +0 -43
- data/ext/C/Types.h +0 -254
- data/ext/CPP/7zip/Archive/IArchive.h +0 -234
- data/ext/CPP/7zip/IDecl.h +0 -15
- data/ext/CPP/7zip/IPassword.h +0 -24
- data/ext/CPP/7zip/IProgress.h +0 -33
- data/ext/CPP/7zip/IStream.h +0 -58
- data/ext/CPP/7zip/PropID.h +0 -76
- data/ext/CPP/Common/MyCom.h +0 -225
- data/ext/CPP/Common/MyGuidDef.h +0 -54
- data/ext/CPP/Common/MyInitGuid.h +0 -22
- data/ext/CPP/Common/MyUnknown.h +0 -13
- data/ext/CPP/Common/MyWindows.h +0 -204
- data/ext/CPP/Common/Types.h +0 -11
- data/ext/CPP/Windows/PropVariant.h +0 -56
- data/ext/CPP/include_windows/basetyps.h +0 -19
- data/ext/CPP/include_windows/tchar.h +0 -89
- data/ext/CPP/include_windows/windows.h +0 -194
- data/ext/p7zip/Asm/x64/7zCrcT8U.asm +0 -103
- data/ext/p7zip/Asm/x86/7zCrcT8U.asm +0 -101
- data/ext/p7zip/C/7zCrcT8.c +0 -43
- data/ext/p7zip/C/Alloc.back3 +0 -238
- data/ext/p7zip/C/Alloc.c.back +0 -243
- data/ext/p7zip/C/Alloc.c.back2 +0 -222
- data/ext/p7zip/C/LzmaUtil/Lzma86Dec.h +0 -51
- data/ext/p7zip/CPP/7zip/Archive/7z/7zFolderOutStream.cpp +0 -149
- data/ext/p7zip/CPP/7zip/Archive/7z/7zFolderOutStream.h +0 -58
- data/ext/p7zip/CPP/7zip/Archive/Chm/ChmHeader.cpp +0 -24
- data/ext/p7zip/CPP/7zip/Archive/Chm/ChmHeader.h +0 -28
- data/ext/p7zip/CPP/7zip/Archive/Chm/ChmRegister.cpp +0 -13
- data/ext/p7zip/CPP/7zip/Archive/Com/ComHandler.cpp +0 -239
- data/ext/p7zip/CPP/7zip/Archive/Com/ComHandler.h +0 -28
- data/ext/p7zip/CPP/7zip/Archive/Com/ComIn.cpp +0 -389
- data/ext/p7zip/CPP/7zip/Archive/Com/ComIn.h +0 -119
- data/ext/p7zip/CPP/7zip/Archive/Com/ComRegister.cpp +0 -13
- data/ext/p7zip/CPP/7zip/Archive/Common/CoderMixer2MT.cpp +0 -240
- data/ext/p7zip/CPP/7zip/Archive/Common/CoderMixer2MT.h +0 -80
- data/ext/p7zip/CPP/7zip/Archive/Common/CoderMixer2ST.cpp +0 -239
- data/ext/p7zip/CPP/7zip/Archive/Common/CoderMixer2ST.h +0 -88
- data/ext/p7zip/CPP/7zip/Archive/Common/CrossThreadProgress.cpp +0 -15
- data/ext/p7zip/CPP/7zip/Archive/Common/CrossThreadProgress.h +0 -37
- data/ext/p7zip/CPP/7zip/Archive/DebHandler.cpp +0 -413
- data/ext/p7zip/CPP/7zip/Archive/Hfs/HfsHandler.cpp +0 -243
- data/ext/p7zip/CPP/7zip/Archive/Hfs/HfsHandler.h +0 -26
- data/ext/p7zip/CPP/7zip/Archive/Hfs/HfsIn.cpp +0 -480
- data/ext/p7zip/CPP/7zip/Archive/Hfs/HfsIn.h +0 -154
- data/ext/p7zip/CPP/7zip/Archive/Hfs/HfsRegister.cpp +0 -13
- data/ext/p7zip/CPP/7zip/Archive/Rar/RarHeader.cpp +0 -21
- data/ext/p7zip/CPP/7zip/Archive/Rar/RarIn.cpp +0 -478
- data/ext/p7zip/CPP/7zip/Archive/Rar/RarIn.h +0 -123
- data/ext/p7zip/CPP/7zip/Archive/Rar/RarItem.cpp +0 -55
- data/ext/p7zip/CPP/7zip/Archive/Rar/RarRegister.cpp +0 -13
- data/ext/p7zip/CPP/7zip/Archive/Rar/RarVolumeInStream.cpp +0 -78
- data/ext/p7zip/CPP/7zip/Archive/Rar/RarVolumeInStream.h +0 -49
- data/ext/p7zip/CPP/7zip/Archive/Udf/UdfRegister.cpp +0 -13
- data/ext/p7zip/CPP/7zip/Archive/Zip/ZipHeader.cpp +0 -36
- data/ext/p7zip/CPP/7zip/Archive/Zip/ZipItemEx.h +0 -34
- data/ext/p7zip/CPP/7zip/CMAKE/CMakeLists_7zFM.txt +0 -163
- data/ext/p7zip/CPP/7zip/CMAKE/CMakeLists_7zG.txt +0 -131
- data/ext/p7zip/CPP/7zip/CMAKE/CMakeLists_7za.txt +0 -253
- data/ext/p7zip/CPP/7zip/CMAKE/CMakeLists_ALL.txt +0 -32
- data/ext/p7zip/CPP/7zip/CMAKE/CMakeLists_Format7zFree.txt +0 -290
- data/ext/p7zip/CPP/7zip/CMAKE/generate.sh +0 -37
- data/ext/p7zip/CPP/7zip/CMAKE/generate_xcode.sh +0 -32
- data/ext/p7zip/CPP/7zip/Common/LockedStream.cpp +0 -23
- data/ext/p7zip/CPP/7zip/Common/LockedStream.h +0 -38
- data/ext/p7zip/CPP/7zip/Compress/ArjDecoder1.cpp +0 -309
- data/ext/p7zip/CPP/7zip/Compress/ArjDecoder1.h +0 -98
- data/ext/p7zip/CPP/7zip/Compress/ArjDecoder2.cpp +0 -90
- data/ext/p7zip/CPP/7zip/Compress/ArjDecoder2.h +0 -59
- data/ext/p7zip/CPP/7zip/Compress/BranchCoder.cpp +0 -19
- data/ext/p7zip/CPP/7zip/Compress/BranchCoder.h +0 -44
- data/ext/p7zip/CPP/7zip/Compress/DllExports.cpp +0 -39
- data/ext/p7zip/CPP/7zip/Compress/LZMA_Alone/LzmaAlone.cpp +0 -531
- data/ext/p7zip/CPP/7zip/Compress/LZMA_Alone/LzmaBench.cpp +0 -1018
- data/ext/p7zip/CPP/7zip/Compress/LZMA_Alone/LzmaBench.h +0 -48
- data/ext/p7zip/CPP/7zip/Compress/LZMA_Alone/LzmaBenchCon.cpp +0 -311
- data/ext/p7zip/CPP/7zip/Compress/LZMA_Alone/LzmaBenchCon.h +0 -20
- data/ext/p7zip/CPP/7zip/Compress/LZMA_Alone/makefile +0 -173
- data/ext/p7zip/CPP/7zip/Compress/Lzx86Converter.cpp +0 -90
- data/ext/p7zip/CPP/7zip/Compress/Lzx86Converter.h +0 -46
- data/ext/p7zip/CPP/7zip/Compress/RangeCoder.h +0 -205
- data/ext/p7zip/CPP/7zip/Compress/RangeCoderBit.h +0 -114
- data/ext/p7zip/CPP/7zip/Crypto/Sha1.cpp +0 -229
- data/ext/p7zip/CPP/7zip/Crypto/Sha1.h +0 -68
- data/ext/p7zip/CPP/7zip/PREMAKE/generate.sh +0 -18
- data/ext/p7zip/CPP/7zip/PREMAKE/premake4.lua +0 -263
- data/ext/p7zip/CPP/7zip/QMAKE/7ZA/7ZA.pro +0 -228
- data/ext/p7zip/CPP/7zip/QMAKE/7ZA/7ZA_osx.pro +0 -228
- data/ext/p7zip/CPP/7zip/QMAKE/test_emul/test_emul.pro +0 -26
- data/ext/p7zip/CPP/7zip/TEST/TestUI/TestUI.cpp +0 -560
- data/ext/p7zip/CPP/7zip/TEST/TestUI/makefile +0 -33
- data/ext/p7zip/CPP/7zip/TEST/TestUI/makefile.depend +0 -577
- data/ext/p7zip/CPP/7zip/TEST/TestUI/makefile.list +0 -16
- data/ext/p7zip/CPP/Common/Buffer.h +0 -77
- data/ext/p7zip/CPP/Common/Types.h +0 -11
- data/ext/p7zip/CPP/Windows/COM.cpp +0 -37
- data/ext/p7zip/CPP/Windows/COM.h +0 -69
- data/ext/p7zip/CPP/Windows/Clipboard.cpp +0 -160
- data/ext/p7zip/CPP/Windows/Clipboard.h +0 -28
- data/ext/p7zip/CPP/Windows/CommonDialog.h +0 -19
- data/ext/p7zip/CPP/Windows/Control/ComboBox.h +0 -82
- data/ext/p7zip/CPP/Windows/Control/Controls.cpp +0 -515
- data/ext/p7zip/CPP/Windows/Control/Dialog.cpp +0 -560
- data/ext/p7zip/CPP/Windows/Control/Dialog.h +0 -179
- data/ext/p7zip/CPP/Windows/Control/DialogImpl.h +0 -73
- data/ext/p7zip/CPP/Windows/Control/Edit.h +0 -24
- data/ext/p7zip/CPP/Windows/Control/ListView.h +0 -164
- data/ext/p7zip/CPP/Windows/Control/ProgressBar.h +0 -34
- data/ext/p7zip/CPP/Windows/Control/Static.h +0 -23
- data/ext/p7zip/CPP/Windows/Control/StatusBar.h +0 -56
- data/ext/p7zip/CPP/Windows/Control/Window2.cpp +0 -211
- data/ext/p7zip/CPP/Windows/Control/Window2.h +0 -111
- data/ext/p7zip/CPP/Windows/DLL.cpp +0 -193
- data/ext/p7zip/CPP/Windows/DLL.h +0 -48
- data/ext/p7zip/CPP/Windows/Error.cpp +0 -58
- data/ext/p7zip/CPP/Windows/Error.h +0 -33
- data/ext/p7zip/CPP/Windows/Menu.h +0 -4
- data/ext/p7zip/CPP/Windows/PropVariantConversions.cpp +0 -142
- data/ext/p7zip/CPP/Windows/PropVariantConversions.h +0 -14
- data/ext/p7zip/CPP/Windows/Registry.cpp +0 -313
- data/ext/p7zip/CPP/Windows/Registry.h +0 -113
- data/ext/p7zip/CPP/Windows/ResourceString.h +0 -22
- data/ext/p7zip/CPP/Windows/Shell.h +0 -21
- data/ext/p7zip/CPP/Windows/Time.cpp +0 -88
- data/ext/p7zip/CPP/Windows/Time.h +0 -21
- data/ext/p7zip/CPP/Windows/Window.cpp +0 -101
- data/ext/p7zip/CPP/Windows/Window.h +0 -43
- data/ext/p7zip/CPP/myWindows/initguid.h +0 -4
- data/ext/p7zip/CPP/myWindows/makefile +0 -21
- data/ext/p7zip/CPP/myWindows/makefile.depend +0 -32
- data/ext/p7zip/CPP/myWindows/makefile.list +0 -28
- data/ext/p7zip/CPP/myWindows/myAddExeFlag.cpp +0 -20
- data/ext/p7zip/CPP/myWindows/myGetTickCount.cpp +0 -8
- data/ext/p7zip/CPP/myWindows/mySplitCommandLine.cpp +0 -82
- data/ext/p7zip/CPP/myWindows/test_emul.cpp +0 -745
- data/ext/p7zip/CPP/myWindows/wine_GetXXXDefaultLangID.cpp +0 -741
- data/ext/p7zip/DOCS/MANUAL/switches/charset.htm +0 -49
- data/ext/p7zip/DOCS/Methods.txt +0 -152
- data/ext/p7zip/DOCS/lzma.txt +0 -598
- data/ext/p7zip/contrib/VirtualFileSystemForMidnightCommander/ChangeLog +0 -41
- data/ext/p7zip/contrib/VirtualFileSystemForMidnightCommander/readme +0 -21
- data/ext/p7zip/contrib/VirtualFileSystemForMidnightCommander/readme.u7z +0 -30
- data/ext/p7zip/contrib/VirtualFileSystemForMidnightCommander/u7z +0 -133
- data/ext/p7zip/contrib/gzip-like_CLI_wrapper_for_7z/README +0 -21
- data/ext/p7zip/contrib/gzip-like_CLI_wrapper_for_7z/check/check.sh +0 -117
- 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 +0 -33
- data/ext/p7zip/contrib/gzip-like_CLI_wrapper_for_7z/p7zip +0 -144
- data/ext/p7zip/contrib/qnx630sp3/qnx630sp3-shared +0 -14
- data/ext/p7zip/contrib/qnx630sp3/qnx630sp3-static +0 -10
- data/ext/p7zip/integration_context_menu.txt +0 -51
- data/ext/p7zip/makefile.rules +0 -661
- /data/ext/p7zip/{DOCS → DOC}/7zFormat.txt +0 -0
- /data/ext/p7zip/{DOCS → DOC}/unRarLicense.txt +0 -0
@@ -0,0 +1,1880 @@
|
|
1
|
+
// HfsHandler.cpp
|
2
|
+
|
3
|
+
#include "StdAfx.h"
|
4
|
+
|
5
|
+
#include "../../../C/CpuArch.h"
|
6
|
+
|
7
|
+
#include "../../Common/ComTry.h"
|
8
|
+
#include "../../Common/MyString.h"
|
9
|
+
|
10
|
+
#include "../../Windows/PropVariant.h"
|
11
|
+
|
12
|
+
#include "../Common/LimitedStreams.h"
|
13
|
+
#include "../Common/RegisterArc.h"
|
14
|
+
#include "../Common/StreamObjects.h"
|
15
|
+
#include "../Common/StreamUtils.h"
|
16
|
+
|
17
|
+
#include "../Compress/ZlibDecoder.h"
|
18
|
+
|
19
|
+
/* if HFS_SHOW_ALT_STREAMS is defined, the handler will show attribute files
|
20
|
+
and resource forks. In most cases it looks useless. So we disable it. */
|
21
|
+
|
22
|
+
// #define HFS_SHOW_ALT_STREAMS
|
23
|
+
|
24
|
+
#define Get16(p) GetBe16(p)
|
25
|
+
#define Get32(p) GetBe32(p)
|
26
|
+
#define Get64(p) GetBe64(p)
|
27
|
+
|
28
|
+
namespace NArchive {
|
29
|
+
namespace NHfs {
|
30
|
+
|
31
|
+
static const char *kResFileName = "rsrc"; // "com.apple.ResourceFork";
|
32
|
+
|
33
|
+
struct CExtent
|
34
|
+
{
|
35
|
+
UInt32 Pos;
|
36
|
+
UInt32 NumBlocks;
|
37
|
+
};
|
38
|
+
|
39
|
+
struct CIdExtents
|
40
|
+
{
|
41
|
+
UInt32 ID;
|
42
|
+
UInt32 StartBlock;
|
43
|
+
CRecordVector<CExtent> Extents;
|
44
|
+
};
|
45
|
+
|
46
|
+
struct CFork
|
47
|
+
{
|
48
|
+
UInt64 Size;
|
49
|
+
UInt32 NumBlocks;
|
50
|
+
// UInt32 ClumpSize;
|
51
|
+
CRecordVector<CExtent> Extents;
|
52
|
+
|
53
|
+
CFork(): Size(0), NumBlocks(0) {}
|
54
|
+
|
55
|
+
void Parse(const Byte *p);
|
56
|
+
|
57
|
+
bool IsEmpty() const { return Size == 0 && NumBlocks == 0 && Extents.Size() == 0; }
|
58
|
+
|
59
|
+
UInt32 Calc_NumBlocks_from_Extents() const;
|
60
|
+
bool Check_NumBlocks() const;
|
61
|
+
|
62
|
+
bool Check_Size_with_NumBlocks(unsigned blockSizeLog) const
|
63
|
+
{
|
64
|
+
return Size <= ((UInt64)NumBlocks << blockSizeLog);
|
65
|
+
}
|
66
|
+
|
67
|
+
bool IsOk(unsigned blockSizeLog) const
|
68
|
+
{
|
69
|
+
// we don't check cases with extra (empty) blocks in last extent
|
70
|
+
return Check_NumBlocks() && Check_Size_with_NumBlocks(blockSizeLog);
|
71
|
+
}
|
72
|
+
|
73
|
+
bool Upgrade(const CObjectVector<CIdExtents> &items, UInt32 id);
|
74
|
+
bool UpgradeAndTest(const CObjectVector<CIdExtents> &items, UInt32 id, unsigned blockSizeLog)
|
75
|
+
{
|
76
|
+
if (!Upgrade(items, id))
|
77
|
+
return false;
|
78
|
+
return IsOk(blockSizeLog);
|
79
|
+
}
|
80
|
+
};
|
81
|
+
|
82
|
+
static const unsigned kNumFixedExtents = 8;
|
83
|
+
|
84
|
+
void CFork::Parse(const Byte *p)
|
85
|
+
{
|
86
|
+
Extents.Clear();
|
87
|
+
Size = Get64(p);
|
88
|
+
// ClumpSize = Get32(p + 8);
|
89
|
+
NumBlocks = Get32(p + 12);
|
90
|
+
p += 16;
|
91
|
+
for (unsigned i = 0; i < kNumFixedExtents; i++, p += 8)
|
92
|
+
{
|
93
|
+
CExtent e;
|
94
|
+
e.Pos = Get32(p);
|
95
|
+
e.NumBlocks = Get32(p + 4);
|
96
|
+
if (e.NumBlocks != 0)
|
97
|
+
Extents.Add(e);
|
98
|
+
}
|
99
|
+
}
|
100
|
+
|
101
|
+
UInt32 CFork::Calc_NumBlocks_from_Extents() const
|
102
|
+
{
|
103
|
+
UInt32 num = 0;
|
104
|
+
FOR_VECTOR (i, Extents)
|
105
|
+
{
|
106
|
+
num += Extents[i].NumBlocks;
|
107
|
+
}
|
108
|
+
return num;
|
109
|
+
}
|
110
|
+
|
111
|
+
bool CFork::Check_NumBlocks() const
|
112
|
+
{
|
113
|
+
UInt32 num = 0;
|
114
|
+
FOR_VECTOR (i, Extents)
|
115
|
+
{
|
116
|
+
UInt32 next = num + Extents[i].NumBlocks;
|
117
|
+
if (next < num)
|
118
|
+
return false;
|
119
|
+
num = next;
|
120
|
+
}
|
121
|
+
return num == NumBlocks;
|
122
|
+
}
|
123
|
+
|
124
|
+
struct CIdIndexPair
|
125
|
+
{
|
126
|
+
UInt32 ID;
|
127
|
+
int Index;
|
128
|
+
|
129
|
+
int Compare(const CIdIndexPair &a) const;
|
130
|
+
};
|
131
|
+
|
132
|
+
#define RINOZ(x) { int __tt = (x); if (__tt != 0) return __tt; }
|
133
|
+
|
134
|
+
int CIdIndexPair::Compare(const CIdIndexPair &a) const
|
135
|
+
{
|
136
|
+
RINOZ(MyCompare(ID, a.ID));
|
137
|
+
return MyCompare(Index, a.Index);
|
138
|
+
}
|
139
|
+
|
140
|
+
static int FindItemIndex(const CRecordVector<CIdIndexPair> &items, UInt32 id)
|
141
|
+
{
|
142
|
+
unsigned left = 0, right = items.Size();
|
143
|
+
while (left != right)
|
144
|
+
{
|
145
|
+
unsigned mid = (left + right) / 2;
|
146
|
+
UInt32 midVal = items[mid].ID;
|
147
|
+
if (id == midVal)
|
148
|
+
return items[mid].Index;
|
149
|
+
if (id < midVal)
|
150
|
+
right = mid;
|
151
|
+
else
|
152
|
+
left = mid + 1;
|
153
|
+
}
|
154
|
+
return -1;
|
155
|
+
}
|
156
|
+
|
157
|
+
static int Find_in_IdExtents(const CObjectVector<CIdExtents> &items, UInt32 id)
|
158
|
+
{
|
159
|
+
unsigned left = 0, right = items.Size();
|
160
|
+
while (left != right)
|
161
|
+
{
|
162
|
+
unsigned mid = (left + right) / 2;
|
163
|
+
UInt32 midVal = items[mid].ID;
|
164
|
+
if (id == midVal)
|
165
|
+
return mid;
|
166
|
+
if (id < midVal)
|
167
|
+
right = mid;
|
168
|
+
else
|
169
|
+
left = mid + 1;
|
170
|
+
}
|
171
|
+
return -1;
|
172
|
+
}
|
173
|
+
|
174
|
+
bool CFork::Upgrade(const CObjectVector<CIdExtents> &items, UInt32 id)
|
175
|
+
{
|
176
|
+
int index = Find_in_IdExtents(items, id);
|
177
|
+
if (index < 0)
|
178
|
+
return true;
|
179
|
+
const CIdExtents &item = items[index];
|
180
|
+
if (Calc_NumBlocks_from_Extents() != item.StartBlock)
|
181
|
+
return false;
|
182
|
+
Extents += item.Extents;
|
183
|
+
return true;
|
184
|
+
}
|
185
|
+
|
186
|
+
|
187
|
+
struct CVolHeader
|
188
|
+
{
|
189
|
+
Byte Header[2];
|
190
|
+
UInt16 Version;
|
191
|
+
// UInt32 Attr;
|
192
|
+
// UInt32 LastMountedVersion;
|
193
|
+
// UInt32 JournalInfoBlock;
|
194
|
+
|
195
|
+
UInt32 CTime;
|
196
|
+
UInt32 MTime;
|
197
|
+
// UInt32 BackupTime;
|
198
|
+
// UInt32 CheckedTime;
|
199
|
+
|
200
|
+
UInt32 NumFiles;
|
201
|
+
UInt32 NumFolders;
|
202
|
+
unsigned BlockSizeLog;
|
203
|
+
UInt32 NumBlocks;
|
204
|
+
UInt32 NumFreeBlocks;
|
205
|
+
|
206
|
+
// UInt32 WriteCount;
|
207
|
+
// UInt32 FinderInfo[8];
|
208
|
+
// UInt64 VolID;
|
209
|
+
|
210
|
+
UInt64 GetPhySize() const { return (UInt64)NumBlocks << BlockSizeLog; }
|
211
|
+
UInt64 GetFreeSize() const { return (UInt64)NumFreeBlocks << BlockSizeLog; }
|
212
|
+
bool IsHfsX() const { return Version > 4; }
|
213
|
+
};
|
214
|
+
|
215
|
+
inline void HfsTimeToFileTime(UInt32 hfsTime, FILETIME &ft)
|
216
|
+
{
|
217
|
+
UInt64 v = ((UInt64)3600 * 24 * (365 * 303 + 24 * 3) + hfsTime) * 10000000;
|
218
|
+
ft.dwLowDateTime = (DWORD)v;
|
219
|
+
ft.dwHighDateTime = (DWORD)(v >> 32);
|
220
|
+
}
|
221
|
+
|
222
|
+
enum ERecordType
|
223
|
+
{
|
224
|
+
RECORD_TYPE_FOLDER = 1,
|
225
|
+
RECORD_TYPE_FILE,
|
226
|
+
RECORD_TYPE_FOLDER_THREAD,
|
227
|
+
RECORD_TYPE_FILE_THREAD
|
228
|
+
};
|
229
|
+
|
230
|
+
struct CItem
|
231
|
+
{
|
232
|
+
UString Name;
|
233
|
+
|
234
|
+
UInt32 ParentID;
|
235
|
+
|
236
|
+
UInt16 Type;
|
237
|
+
UInt16 FileMode;
|
238
|
+
// UInt16 Flags;
|
239
|
+
// UInt32 Valence;
|
240
|
+
UInt32 ID;
|
241
|
+
UInt32 CTime;
|
242
|
+
UInt32 MTime;
|
243
|
+
// UInt32 AttrMTime;
|
244
|
+
UInt32 ATime;
|
245
|
+
// UInt32 BackupDate;
|
246
|
+
|
247
|
+
/*
|
248
|
+
UInt32 OwnerID;
|
249
|
+
UInt32 GroupID;
|
250
|
+
Byte AdminFlags;
|
251
|
+
Byte OwnerFlags;
|
252
|
+
union
|
253
|
+
{
|
254
|
+
UInt32 iNodeNum;
|
255
|
+
UInt32 LinkCount;
|
256
|
+
UInt32 RawDevice;
|
257
|
+
} special;
|
258
|
+
|
259
|
+
UInt32 FileType;
|
260
|
+
UInt32 FileCreator;
|
261
|
+
UInt16 FinderFlags;
|
262
|
+
UInt16 Point[2];
|
263
|
+
*/
|
264
|
+
|
265
|
+
CFork DataFork;
|
266
|
+
CFork ResourceFork;
|
267
|
+
|
268
|
+
// for compressed attribute
|
269
|
+
UInt64 UnpackSize;
|
270
|
+
size_t DataPos;
|
271
|
+
UInt32 PackSize;
|
272
|
+
unsigned Method;
|
273
|
+
bool UseAttr;
|
274
|
+
bool UseInlineData;
|
275
|
+
|
276
|
+
CItem(): UseAttr(false), UseInlineData(false) {}
|
277
|
+
bool IsDir() const { return Type == RECORD_TYPE_FOLDER; }
|
278
|
+
const CFork &GetFork(bool isResource) const { return (CFork & )*(isResource ? &ResourceFork: &DataFork ); }
|
279
|
+
};
|
280
|
+
|
281
|
+
struct CAttr
|
282
|
+
{
|
283
|
+
UInt32 ID;
|
284
|
+
UInt32 Size;
|
285
|
+
size_t Pos;
|
286
|
+
UString Name;
|
287
|
+
};
|
288
|
+
|
289
|
+
struct CRef
|
290
|
+
{
|
291
|
+
unsigned ItemIndex;
|
292
|
+
int AttrIndex;
|
293
|
+
int Parent;
|
294
|
+
bool IsResource;
|
295
|
+
|
296
|
+
bool IsAltStream() const { return IsResource || AttrIndex >= 0; }
|
297
|
+
CRef(): AttrIndex(-1), Parent(-1), IsResource(false) {}
|
298
|
+
};
|
299
|
+
|
300
|
+
class CDatabase
|
301
|
+
{
|
302
|
+
HRESULT ReadFile(const CFork &fork, CByteBuffer &buf, IInStream *inStream);
|
303
|
+
HRESULT LoadExtentFile(const CFork &fork, IInStream *inStream, CObjectVector<CIdExtents> *overflowExtentsArray);
|
304
|
+
HRESULT LoadAttrs(const CFork &fork, IInStream *inStream, IArchiveOpenCallback *progress);
|
305
|
+
HRESULT LoadCatalog(const CFork &fork, const CObjectVector<CIdExtents> *overflowExtentsArray, IInStream *inStream, IArchiveOpenCallback *progress);
|
306
|
+
bool Parse_decmpgfs(const CAttr &attr, CItem &item, bool &skip);
|
307
|
+
public:
|
308
|
+
CRecordVector<CRef> Refs;
|
309
|
+
CObjectVector<CItem> Items;
|
310
|
+
CObjectVector<CAttr> Attrs;
|
311
|
+
|
312
|
+
CByteBuffer AttrBuf;
|
313
|
+
|
314
|
+
CVolHeader Header;
|
315
|
+
bool HeadersError;
|
316
|
+
bool ThereAreAltStreams;
|
317
|
+
// bool CaseSensetive;
|
318
|
+
UString ResFileName;
|
319
|
+
|
320
|
+
UInt64 PhySize;
|
321
|
+
|
322
|
+
void Clear()
|
323
|
+
{
|
324
|
+
PhySize = 0;
|
325
|
+
HeadersError = false;
|
326
|
+
ThereAreAltStreams = false;
|
327
|
+
// CaseSensetive = false;
|
328
|
+
Refs.Clear();
|
329
|
+
Items.Clear();
|
330
|
+
Attrs.Clear();
|
331
|
+
AttrBuf.Free();
|
332
|
+
}
|
333
|
+
|
334
|
+
UInt64 Get_UnpackSize_of_Ref(const CRef &ref) const
|
335
|
+
{
|
336
|
+
if (ref.AttrIndex >= 0)
|
337
|
+
return Attrs[ref.AttrIndex].Size;
|
338
|
+
const CItem &item = Items[ref.ItemIndex];
|
339
|
+
if (item.IsDir())
|
340
|
+
return 0;
|
341
|
+
if (item.UseAttr)
|
342
|
+
return item.UnpackSize;
|
343
|
+
return item.GetFork(ref.IsResource).Size;
|
344
|
+
}
|
345
|
+
|
346
|
+
void GetItemPath(unsigned index, NWindows::NCOM::CPropVariant &path) const;
|
347
|
+
HRESULT Open2(IInStream *inStream, IArchiveOpenCallback *progress);
|
348
|
+
};
|
349
|
+
|
350
|
+
enum
|
351
|
+
{
|
352
|
+
kHfsID_Root = 1,
|
353
|
+
kHfsID_RootFolder = 2,
|
354
|
+
kHfsID_ExtentsFile = 3,
|
355
|
+
kHfsID_CatalogFile = 4,
|
356
|
+
kHfsID_BadBlockFile = 5,
|
357
|
+
kHfsID_AllocationFile = 6,
|
358
|
+
kHfsID_StartupFile = 7,
|
359
|
+
kHfsID_AttributesFile = 8,
|
360
|
+
kHfsID_RepairCatalogFile = 14,
|
361
|
+
kHfsID_BogusExtentFile = 15,
|
362
|
+
kHfsID_FirstUserCatalogNode = 16
|
363
|
+
};
|
364
|
+
|
365
|
+
void CDatabase::GetItemPath(unsigned index, NWindows::NCOM::CPropVariant &path) const
|
366
|
+
{
|
367
|
+
unsigned len = 0;
|
368
|
+
const unsigned kNumLevelsMax = (1 << 10);
|
369
|
+
int cur = index;
|
370
|
+
unsigned i;
|
371
|
+
|
372
|
+
for (i = 0; i < kNumLevelsMax; i++)
|
373
|
+
{
|
374
|
+
const CRef &ref = Refs[cur];
|
375
|
+
const UString *s;
|
376
|
+
|
377
|
+
if (ref.IsResource)
|
378
|
+
s = &ResFileName;
|
379
|
+
else if (ref.AttrIndex >= 0)
|
380
|
+
s = &Attrs[ref.AttrIndex].Name;
|
381
|
+
else
|
382
|
+
s = &Items[ref.ItemIndex].Name;
|
383
|
+
|
384
|
+
len += s->Len();
|
385
|
+
len++;
|
386
|
+
cur = ref.Parent;
|
387
|
+
if (cur < 0)
|
388
|
+
break;
|
389
|
+
}
|
390
|
+
|
391
|
+
len--;
|
392
|
+
wchar_t *p = path.AllocBstr(len);
|
393
|
+
p[len] = 0;
|
394
|
+
cur = index;
|
395
|
+
|
396
|
+
for (;;)
|
397
|
+
{
|
398
|
+
const CRef &ref = Refs[cur];
|
399
|
+
const UString *s;
|
400
|
+
wchar_t delimChar = L':';
|
401
|
+
|
402
|
+
if (ref.IsResource)
|
403
|
+
s = &ResFileName;
|
404
|
+
else if (ref.AttrIndex >= 0)
|
405
|
+
s = &Attrs[ref.AttrIndex].Name;
|
406
|
+
else
|
407
|
+
{
|
408
|
+
delimChar = WCHAR_PATH_SEPARATOR;
|
409
|
+
s = &Items[ref.ItemIndex].Name;
|
410
|
+
}
|
411
|
+
|
412
|
+
unsigned curLen = s->Len();
|
413
|
+
len -= curLen;
|
414
|
+
|
415
|
+
const wchar_t *src = (const wchar_t *)*s;
|
416
|
+
wchar_t *dest = p + len;
|
417
|
+
for (unsigned j = 0; j < curLen; j++)
|
418
|
+
dest[j] = src[j];
|
419
|
+
|
420
|
+
if (len == 0)
|
421
|
+
break;
|
422
|
+
p[--len] = delimChar;
|
423
|
+
cur = ref.Parent;
|
424
|
+
}
|
425
|
+
}
|
426
|
+
|
427
|
+
// Actually we read all blocks. It can be larger than fork.Size
|
428
|
+
|
429
|
+
HRESULT CDatabase::ReadFile(const CFork &fork, CByteBuffer &buf, IInStream *inStream)
|
430
|
+
{
|
431
|
+
if (fork.NumBlocks >= Header.NumBlocks)
|
432
|
+
return S_FALSE;
|
433
|
+
size_t totalSize = (size_t)fork.NumBlocks << Header.BlockSizeLog;
|
434
|
+
if ((totalSize >> Header.BlockSizeLog) != fork.NumBlocks)
|
435
|
+
return S_FALSE;
|
436
|
+
buf.Alloc(totalSize);
|
437
|
+
UInt32 curBlock = 0;
|
438
|
+
FOR_VECTOR (i, fork.Extents)
|
439
|
+
{
|
440
|
+
if (curBlock >= fork.NumBlocks)
|
441
|
+
return S_FALSE;
|
442
|
+
const CExtent &e = fork.Extents[i];
|
443
|
+
if (e.Pos > Header.NumBlocks ||
|
444
|
+
e.NumBlocks > fork.NumBlocks - curBlock ||
|
445
|
+
e.NumBlocks > Header.NumBlocks - e.Pos)
|
446
|
+
return S_FALSE;
|
447
|
+
RINOK(inStream->Seek((UInt64)e.Pos << Header.BlockSizeLog, STREAM_SEEK_SET, NULL));
|
448
|
+
RINOK(ReadStream_FALSE(inStream,
|
449
|
+
(Byte *)buf + ((size_t)curBlock << Header.BlockSizeLog),
|
450
|
+
(size_t)e.NumBlocks << Header.BlockSizeLog));
|
451
|
+
curBlock += e.NumBlocks;
|
452
|
+
}
|
453
|
+
return S_OK;
|
454
|
+
}
|
455
|
+
|
456
|
+
static const unsigned kNodeDescriptor_Size = 14;
|
457
|
+
|
458
|
+
struct CNodeDescriptor
|
459
|
+
{
|
460
|
+
UInt32 fLink;
|
461
|
+
// UInt32 bLink;
|
462
|
+
Byte Kind;
|
463
|
+
// Byte Height;
|
464
|
+
unsigned NumRecords;
|
465
|
+
|
466
|
+
bool CheckNumRecords(unsigned nodeSizeLog)
|
467
|
+
{
|
468
|
+
return (kNodeDescriptor_Size + ((UInt32)NumRecords + 1) * 2 <= ((UInt32)1 << nodeSizeLog));
|
469
|
+
}
|
470
|
+
void Parse(const Byte *p);
|
471
|
+
};
|
472
|
+
|
473
|
+
void CNodeDescriptor::Parse(const Byte *p)
|
474
|
+
{
|
475
|
+
fLink = Get32(p);
|
476
|
+
// bLink = Get32(p + 4);
|
477
|
+
Kind = p[8];
|
478
|
+
// Height = p[9];
|
479
|
+
NumRecords = Get16(p + 10);
|
480
|
+
}
|
481
|
+
|
482
|
+
struct CHeaderRec
|
483
|
+
{
|
484
|
+
// UInt16 TreeDepth;
|
485
|
+
// UInt32 RootNode;
|
486
|
+
// UInt32 LeafRecords;
|
487
|
+
UInt32 FirstLeafNode;
|
488
|
+
// UInt32 LastLeafNode;
|
489
|
+
unsigned NodeSizeLog;
|
490
|
+
// UInt16 MaxKeyLength;
|
491
|
+
UInt32 TotalNodes;
|
492
|
+
// UInt32 FreeNodes;
|
493
|
+
// UInt16 Reserved1;
|
494
|
+
// UInt32 ClumpSize;
|
495
|
+
// Byte BtreeType;
|
496
|
+
// Byte KeyCompareType;
|
497
|
+
// UInt32 Attributes;
|
498
|
+
// UInt32 Reserved3[16];
|
499
|
+
|
500
|
+
HRESULT Parse(const Byte *p);
|
501
|
+
};
|
502
|
+
|
503
|
+
HRESULT CHeaderRec::Parse(const Byte *p)
|
504
|
+
{
|
505
|
+
// TreeDepth = Get16(p);
|
506
|
+
// RootNode = Get32(p + 2);
|
507
|
+
// LeafRecords = Get32(p + 6);
|
508
|
+
FirstLeafNode = Get32(p + 0xA);
|
509
|
+
// LastLeafNode = Get32(p + 0xE);
|
510
|
+
UInt32 nodeSize = Get16(p + 0x12);
|
511
|
+
|
512
|
+
unsigned i;
|
513
|
+
for (i = 9; ((UInt32)1 << i) != nodeSize; i++)
|
514
|
+
if (i == 16)
|
515
|
+
return S_FALSE;
|
516
|
+
NodeSizeLog = i;
|
517
|
+
|
518
|
+
// MaxKeyLength = Get16(p + 0x14);
|
519
|
+
TotalNodes = Get32(p + 0x16);
|
520
|
+
// FreeNodes = Get32(p + 0x1A);
|
521
|
+
// Reserved1 = Get16(p + 0x1E);
|
522
|
+
// ClumpSize = Get32(p + 0x20);
|
523
|
+
// BtreeType = p[0x24];
|
524
|
+
// KeyCompareType = p[0x25];
|
525
|
+
// Attributes = Get32(p + 0x26);
|
526
|
+
/*
|
527
|
+
for (int i = 0; i < 16; i++)
|
528
|
+
Reserved3[i] = Get32(p + 0x2A + i * 4);
|
529
|
+
*/
|
530
|
+
return S_OK;
|
531
|
+
}
|
532
|
+
|
533
|
+
|
534
|
+
static const Byte kNodeType_Leaf = 0xFF;
|
535
|
+
// static const Byte kNodeType_Index = 0;
|
536
|
+
// static const Byte kNodeType_Header = 1;
|
537
|
+
// static const Byte kNodeType_Mode = 2;
|
538
|
+
|
539
|
+
static const Byte kExtentForkType_Data = 0;
|
540
|
+
static const Byte kExtentForkType_Resource = 0xFF;
|
541
|
+
|
542
|
+
/* It loads data extents from Extents Overflow File
|
543
|
+
Most dmg installers are not fragmented. So there are no extents in Overflow File. */
|
544
|
+
|
545
|
+
HRESULT CDatabase::LoadExtentFile(const CFork &fork, IInStream *inStream, CObjectVector<CIdExtents> *overflowExtentsArray)
|
546
|
+
{
|
547
|
+
if (fork.NumBlocks == 0)
|
548
|
+
return S_OK;
|
549
|
+
CByteBuffer buf;
|
550
|
+
RINOK(ReadFile(fork, buf, inStream));
|
551
|
+
const Byte *p = (const Byte *)buf;
|
552
|
+
|
553
|
+
// CNodeDescriptor nodeDesc;
|
554
|
+
// nodeDesc.Parse(p);
|
555
|
+
CHeaderRec hr;
|
556
|
+
RINOK(hr.Parse(p + kNodeDescriptor_Size));
|
557
|
+
|
558
|
+
if ((buf.Size() >> hr.NodeSizeLog) < hr.TotalNodes)
|
559
|
+
return S_FALSE;
|
560
|
+
|
561
|
+
UInt32 node = hr.FirstLeafNode;
|
562
|
+
if (node == 0)
|
563
|
+
return S_OK;
|
564
|
+
|
565
|
+
CByteBuffer usedBuf(hr.TotalNodes);
|
566
|
+
memset(usedBuf, 0, hr.TotalNodes);
|
567
|
+
|
568
|
+
while (node != 0)
|
569
|
+
{
|
570
|
+
if (node >= hr.TotalNodes || usedBuf[node] != 0)
|
571
|
+
return S_FALSE;
|
572
|
+
usedBuf[node] = 1;
|
573
|
+
|
574
|
+
size_t nodeOffset = (size_t)node << hr.NodeSizeLog;
|
575
|
+
CNodeDescriptor desc;
|
576
|
+
desc.Parse(p + nodeOffset);
|
577
|
+
if (!desc.CheckNumRecords(hr.NodeSizeLog))
|
578
|
+
return S_FALSE;
|
579
|
+
if (desc.Kind != kNodeType_Leaf)
|
580
|
+
return S_FALSE;
|
581
|
+
|
582
|
+
UInt32 endBlock = 0;
|
583
|
+
|
584
|
+
for (unsigned i = 0; i < desc.NumRecords; i++)
|
585
|
+
{
|
586
|
+
UInt32 nodeSize = (UInt32)1 << hr.NodeSizeLog;
|
587
|
+
UInt32 offs = Get16(p + nodeOffset + nodeSize - (i + 1) * 2);
|
588
|
+
UInt32 offsNext = Get16(p + nodeOffset + nodeSize - (i + 2) * 2);
|
589
|
+
if (offs > nodeSize || offsNext > nodeSize)
|
590
|
+
return S_FALSE;
|
591
|
+
UInt32 recSize = offsNext - offs;
|
592
|
+
const unsigned kKeyLen = 10;
|
593
|
+
|
594
|
+
if (recSize != 2 + kKeyLen + kNumFixedExtents * 8)
|
595
|
+
return S_FALSE;
|
596
|
+
|
597
|
+
const Byte *r = p + nodeOffset + offs;
|
598
|
+
if (Get16(r) != kKeyLen)
|
599
|
+
return S_FALSE;
|
600
|
+
|
601
|
+
Byte forkType = r[2];
|
602
|
+
unsigned forkTypeIndex;
|
603
|
+
if (forkType == kExtentForkType_Data)
|
604
|
+
forkTypeIndex = 0;
|
605
|
+
else if (forkType == kExtentForkType_Resource)
|
606
|
+
forkTypeIndex = 1;
|
607
|
+
else
|
608
|
+
continue;
|
609
|
+
CObjectVector<CIdExtents> &overflowExtents = overflowExtentsArray[forkTypeIndex];
|
610
|
+
|
611
|
+
UInt32 id = Get32(r + 4);
|
612
|
+
UInt32 startBlock = Get32(r + 8);
|
613
|
+
r += 2 + kKeyLen;
|
614
|
+
|
615
|
+
bool needNew = true;
|
616
|
+
|
617
|
+
if (overflowExtents.Size() != 0)
|
618
|
+
{
|
619
|
+
CIdExtents &e = overflowExtents.Back();
|
620
|
+
if (e.ID == id)
|
621
|
+
{
|
622
|
+
if (endBlock != startBlock)
|
623
|
+
return S_FALSE;
|
624
|
+
needNew = false;
|
625
|
+
}
|
626
|
+
}
|
627
|
+
|
628
|
+
if (needNew)
|
629
|
+
{
|
630
|
+
CIdExtents &e = overflowExtents.AddNew();
|
631
|
+
e.ID = id;
|
632
|
+
e.StartBlock = startBlock;
|
633
|
+
endBlock = startBlock;
|
634
|
+
}
|
635
|
+
|
636
|
+
CIdExtents &e = overflowExtents.Back();
|
637
|
+
|
638
|
+
for (unsigned k = 0; k < kNumFixedExtents; k++, r += 8)
|
639
|
+
{
|
640
|
+
CExtent ee;
|
641
|
+
ee.Pos = Get32(r);
|
642
|
+
ee.NumBlocks = Get32(r + 4);
|
643
|
+
if (ee.NumBlocks != 0)
|
644
|
+
{
|
645
|
+
e.Extents.Add(ee);
|
646
|
+
endBlock += ee.NumBlocks;
|
647
|
+
}
|
648
|
+
}
|
649
|
+
}
|
650
|
+
|
651
|
+
node = desc.fLink;
|
652
|
+
}
|
653
|
+
return S_OK;
|
654
|
+
}
|
655
|
+
|
656
|
+
static void LoadName(const Byte *data, unsigned len, UString &dest)
|
657
|
+
{
|
658
|
+
wchar_t *p = dest.GetBuf(len);
|
659
|
+
unsigned i;
|
660
|
+
for (i = 0; i < len; i++)
|
661
|
+
{
|
662
|
+
wchar_t c = Get16(data + i * 2);
|
663
|
+
if (c == 0)
|
664
|
+
break;
|
665
|
+
p[i] = c;
|
666
|
+
}
|
667
|
+
p[i] = 0;
|
668
|
+
dest.ReleaseBuf_SetLen(i);
|
669
|
+
}
|
670
|
+
|
671
|
+
static bool IsNameEqualTo(const Byte *data, const char *name)
|
672
|
+
{
|
673
|
+
for (unsigned i = 0;; i++)
|
674
|
+
{
|
675
|
+
char c = name[i];
|
676
|
+
if (c == 0)
|
677
|
+
return true;
|
678
|
+
if (Get16(data + i * 2) != (Byte)c)
|
679
|
+
return false;
|
680
|
+
}
|
681
|
+
}
|
682
|
+
|
683
|
+
static const UInt32 kAttrRecordType_Inline = 0x10;
|
684
|
+
// static const UInt32 kAttrRecordType_Fork = 0x20;
|
685
|
+
// static const UInt32 kAttrRecordType_Extents = 0x30;
|
686
|
+
|
687
|
+
HRESULT CDatabase::LoadAttrs(const CFork &fork, IInStream *inStream, IArchiveOpenCallback *progress)
|
688
|
+
{
|
689
|
+
if (fork.NumBlocks == 0)
|
690
|
+
return S_OK;
|
691
|
+
|
692
|
+
RINOK(ReadFile(fork, AttrBuf, inStream));
|
693
|
+
const Byte *p = (const Byte *)AttrBuf;
|
694
|
+
|
695
|
+
// CNodeDescriptor nodeDesc;
|
696
|
+
// nodeDesc.Parse(p);
|
697
|
+
CHeaderRec hr;
|
698
|
+
RINOK(hr.Parse(p + kNodeDescriptor_Size));
|
699
|
+
|
700
|
+
// CaseSensetive = (Header.IsHfsX() && hr.KeyCompareType == 0xBC);
|
701
|
+
|
702
|
+
if ((AttrBuf.Size() >> hr.NodeSizeLog) < hr.TotalNodes)
|
703
|
+
return S_FALSE;
|
704
|
+
|
705
|
+
UInt32 node = hr.FirstLeafNode;
|
706
|
+
if (node == 0)
|
707
|
+
return S_OK;
|
708
|
+
|
709
|
+
CByteBuffer usedBuf(hr.TotalNodes);
|
710
|
+
memset(usedBuf, 0, hr.TotalNodes);
|
711
|
+
|
712
|
+
CFork resFork;
|
713
|
+
|
714
|
+
while (node != 0)
|
715
|
+
{
|
716
|
+
if (node >= hr.TotalNodes || usedBuf[node] != 0)
|
717
|
+
return S_FALSE;
|
718
|
+
usedBuf[node] = 1;
|
719
|
+
|
720
|
+
size_t nodeOffset = (size_t)node << hr.NodeSizeLog;
|
721
|
+
CNodeDescriptor desc;
|
722
|
+
desc.Parse(p + nodeOffset);
|
723
|
+
if (!desc.CheckNumRecords(hr.NodeSizeLog))
|
724
|
+
return S_FALSE;
|
725
|
+
if (desc.Kind != kNodeType_Leaf)
|
726
|
+
return S_FALSE;
|
727
|
+
|
728
|
+
for (unsigned i = 0; i < desc.NumRecords; i++)
|
729
|
+
{
|
730
|
+
UInt32 nodeSize = (1 << hr.NodeSizeLog);
|
731
|
+
UInt32 offs = Get16(p + nodeOffset + nodeSize - (i + 1) * 2);
|
732
|
+
UInt32 offsNext = Get16(p + nodeOffset + nodeSize - (i + 2) * 2);
|
733
|
+
UInt32 recSize = offsNext - offs;
|
734
|
+
if (offs >= nodeSize
|
735
|
+
|| offsNext >= nodeSize
|
736
|
+
|| offsNext < offs)
|
737
|
+
return S_FALSE;
|
738
|
+
|
739
|
+
const unsigned kHeadSize = 14;
|
740
|
+
if (recSize < kHeadSize)
|
741
|
+
return S_FALSE;
|
742
|
+
|
743
|
+
const Byte *r = p + nodeOffset + offs;
|
744
|
+
UInt32 keyLen = Get16(r);
|
745
|
+
|
746
|
+
// UInt16 pad = Get16(r + 2);
|
747
|
+
UInt32 fileID = Get32(r + 4);
|
748
|
+
unsigned startBlock = Get32(r + 8);
|
749
|
+
if (startBlock != 0)
|
750
|
+
{
|
751
|
+
// that case is still unsupported
|
752
|
+
HeadersError = true;
|
753
|
+
continue;
|
754
|
+
}
|
755
|
+
unsigned nameLen = Get16(r + 12);
|
756
|
+
|
757
|
+
if (keyLen + 2 > recSize ||
|
758
|
+
keyLen != kHeadSize - 2 + nameLen * 2)
|
759
|
+
return S_FALSE;
|
760
|
+
r += kHeadSize;
|
761
|
+
recSize -= kHeadSize;
|
762
|
+
|
763
|
+
const Byte *name = r;
|
764
|
+
r += nameLen * 2;
|
765
|
+
recSize -= nameLen * 2;
|
766
|
+
|
767
|
+
if (recSize < 4)
|
768
|
+
return S_FALSE;
|
769
|
+
|
770
|
+
UInt32 recordType = Get32(r);
|
771
|
+
if (recordType != kAttrRecordType_Inline)
|
772
|
+
{
|
773
|
+
// Probably only kAttrRecordType_Inline now is used in real HFS files
|
774
|
+
HeadersError = true;
|
775
|
+
continue;
|
776
|
+
}
|
777
|
+
|
778
|
+
const UInt32 kRecordHeaderSize = 16;
|
779
|
+
if (recSize < kRecordHeaderSize)
|
780
|
+
return S_FALSE;
|
781
|
+
UInt32 dataSize = Get32(r + 12);
|
782
|
+
|
783
|
+
r += kRecordHeaderSize;
|
784
|
+
recSize -= kRecordHeaderSize;
|
785
|
+
|
786
|
+
if (recSize < dataSize)
|
787
|
+
return S_FALSE;
|
788
|
+
|
789
|
+
CAttr &attr = Attrs.AddNew();
|
790
|
+
attr.ID = fileID;
|
791
|
+
attr.Pos = nodeOffset + offs + 2 + keyLen + kRecordHeaderSize;
|
792
|
+
attr.Size = dataSize;
|
793
|
+
LoadName(name, nameLen, attr.Name);
|
794
|
+
|
795
|
+
if (progress && (i & 0xFFF) == 0)
|
796
|
+
{
|
797
|
+
UInt64 numFiles = 0;
|
798
|
+
RINOK(progress->SetCompleted(&numFiles, NULL));
|
799
|
+
}
|
800
|
+
}
|
801
|
+
|
802
|
+
node = desc.fLink;
|
803
|
+
}
|
804
|
+
return S_OK;
|
805
|
+
}
|
806
|
+
|
807
|
+
static const UInt32 kMethod_Attr = 3; // data stored in attribute file
|
808
|
+
static const UInt32 kMethod_Resource = 4; // data stored in resource fork
|
809
|
+
|
810
|
+
bool CDatabase::Parse_decmpgfs(const CAttr &attr, CItem &item, bool &skip)
|
811
|
+
{
|
812
|
+
skip = false;
|
813
|
+
if (!attr.Name.IsEqualTo("com.apple.decmpfs"))
|
814
|
+
return true;
|
815
|
+
if (item.UseAttr || !item.DataFork.IsEmpty())
|
816
|
+
return false;
|
817
|
+
|
818
|
+
const UInt32 k_decmpfs_headerSize = 16;
|
819
|
+
UInt32 dataSize = attr.Size;
|
820
|
+
if (dataSize < k_decmpfs_headerSize)
|
821
|
+
return false;
|
822
|
+
const Byte *r = AttrBuf + attr.Pos;
|
823
|
+
if (GetUi32(r) != 0x636D7066) // magic == "fpmc"
|
824
|
+
return false;
|
825
|
+
item.Method = GetUi32(r + 4);
|
826
|
+
item.UnpackSize = GetUi64(r + 8);
|
827
|
+
dataSize -= k_decmpfs_headerSize;
|
828
|
+
r += k_decmpfs_headerSize;
|
829
|
+
if (item.Method == kMethod_Resource)
|
830
|
+
{
|
831
|
+
if (dataSize != 0)
|
832
|
+
return false;
|
833
|
+
item.UseAttr = true;
|
834
|
+
}
|
835
|
+
else if (item.Method == kMethod_Attr)
|
836
|
+
{
|
837
|
+
if (dataSize == 0)
|
838
|
+
return false;
|
839
|
+
Byte b = r[0];
|
840
|
+
if ((b & 0xF) == 0xF)
|
841
|
+
{
|
842
|
+
dataSize--;
|
843
|
+
if (item.UnpackSize > dataSize)
|
844
|
+
return false;
|
845
|
+
item.DataPos = attr.Pos + k_decmpfs_headerSize + 1;
|
846
|
+
item.PackSize = dataSize;
|
847
|
+
item.UseAttr = true;
|
848
|
+
item.UseInlineData = true;
|
849
|
+
}
|
850
|
+
else
|
851
|
+
{
|
852
|
+
item.DataPos = attr.Pos + k_decmpfs_headerSize;
|
853
|
+
item.PackSize = dataSize;
|
854
|
+
item.UseAttr = true;
|
855
|
+
}
|
856
|
+
}
|
857
|
+
else
|
858
|
+
return false;
|
859
|
+
skip = true;
|
860
|
+
return true;
|
861
|
+
}
|
862
|
+
|
863
|
+
HRESULT CDatabase::LoadCatalog(const CFork &fork, const CObjectVector<CIdExtents> *overflowExtentsArray, IInStream *inStream, IArchiveOpenCallback *progress)
|
864
|
+
{
|
865
|
+
unsigned reserveSize = (unsigned)(Header.NumFolders + 1 + Header.NumFiles);
|
866
|
+
Items.ClearAndReserve(reserveSize);
|
867
|
+
Refs.ClearAndReserve(reserveSize);
|
868
|
+
|
869
|
+
CRecordVector<CIdIndexPair> IdToIndexMap;
|
870
|
+
IdToIndexMap.ClearAndReserve(reserveSize);
|
871
|
+
|
872
|
+
CByteBuffer buf;
|
873
|
+
RINOK(ReadFile(fork, buf, inStream));
|
874
|
+
const Byte *p = (const Byte *)buf;
|
875
|
+
|
876
|
+
// CNodeDescriptor nodeDesc;
|
877
|
+
// nodeDesc.Parse(p);
|
878
|
+
CHeaderRec hr;
|
879
|
+
RINOK(hr.Parse(p + kNodeDescriptor_Size));
|
880
|
+
|
881
|
+
// CaseSensetive = (Header.IsHfsX() && hr.KeyCompareType == 0xBC);
|
882
|
+
|
883
|
+
if ((buf.Size() >> hr.NodeSizeLog) < hr.TotalNodes)
|
884
|
+
return S_FALSE;
|
885
|
+
|
886
|
+
CByteBuffer usedBuf(hr.TotalNodes);
|
887
|
+
memset(usedBuf, 0, hr.TotalNodes);
|
888
|
+
|
889
|
+
CFork resFork;
|
890
|
+
|
891
|
+
UInt32 node = hr.FirstLeafNode;
|
892
|
+
UInt32 numFiles = 0;
|
893
|
+
UInt32 numFolders = 0;
|
894
|
+
|
895
|
+
while (node != 0)
|
896
|
+
{
|
897
|
+
if (node >= hr.TotalNodes || usedBuf[node] != 0)
|
898
|
+
return S_FALSE;
|
899
|
+
usedBuf[node] = 1;
|
900
|
+
|
901
|
+
size_t nodeOffset = (size_t)node << hr.NodeSizeLog;
|
902
|
+
CNodeDescriptor desc;
|
903
|
+
desc.Parse(p + nodeOffset);
|
904
|
+
if (!desc.CheckNumRecords(hr.NodeSizeLog))
|
905
|
+
return S_FALSE;
|
906
|
+
if (desc.Kind != kNodeType_Leaf)
|
907
|
+
return S_FALSE;
|
908
|
+
|
909
|
+
for (unsigned i = 0; i < desc.NumRecords; i++)
|
910
|
+
{
|
911
|
+
UInt32 nodeSize = (1 << hr.NodeSizeLog);
|
912
|
+
UInt32 offs = Get16(p + nodeOffset + nodeSize - (i + 1) * 2);
|
913
|
+
UInt32 offsNext = Get16(p + nodeOffset + nodeSize - (i + 2) * 2);
|
914
|
+
UInt32 recSize = offsNext - offs;
|
915
|
+
if (offs >= nodeSize
|
916
|
+
|| offs >= nodeSize
|
917
|
+
|| offsNext < offs
|
918
|
+
|| recSize < 6)
|
919
|
+
return S_FALSE;
|
920
|
+
|
921
|
+
const Byte *r = p + nodeOffset + offs;
|
922
|
+
UInt32 keyLen = Get16(r);
|
923
|
+
UInt32 parentID = Get32(r + 2);
|
924
|
+
if (keyLen < 6 || (keyLen & 1) != 0 || keyLen + 2 > recSize)
|
925
|
+
return S_FALSE;
|
926
|
+
r += 6;
|
927
|
+
recSize -= 6;
|
928
|
+
keyLen -= 6;
|
929
|
+
|
930
|
+
unsigned nameLen = Get16(r);
|
931
|
+
if (nameLen * 2 != (unsigned)keyLen)
|
932
|
+
return S_FALSE;
|
933
|
+
r += 2;
|
934
|
+
recSize -= 2;
|
935
|
+
|
936
|
+
r += nameLen * 2;
|
937
|
+
recSize -= nameLen * 2;
|
938
|
+
|
939
|
+
if (recSize < 2)
|
940
|
+
return S_FALSE;
|
941
|
+
UInt16 type = Get16(r);
|
942
|
+
|
943
|
+
if (type != RECORD_TYPE_FOLDER &&
|
944
|
+
type != RECORD_TYPE_FILE)
|
945
|
+
continue;
|
946
|
+
|
947
|
+
const unsigned kBasicRecSize = 0x58;
|
948
|
+
if (recSize < kBasicRecSize)
|
949
|
+
return S_FALSE;
|
950
|
+
|
951
|
+
CItem &item = Items.AddNew();
|
952
|
+
item.ParentID = parentID;
|
953
|
+
item.Type = type;
|
954
|
+
// item.Flags = Get16(r + 2);
|
955
|
+
// item.Valence = Get32(r + 4);
|
956
|
+
item.ID = Get32(r + 8);
|
957
|
+
{
|
958
|
+
const Byte *name = r - (nameLen * 2);
|
959
|
+
LoadName(name, nameLen, item.Name);
|
960
|
+
if (item.Name.Len() <= 1)
|
961
|
+
{
|
962
|
+
if (item.Name.IsEmpty() && nameLen == 21)
|
963
|
+
{
|
964
|
+
if (GetUi32(name) == 0 &&
|
965
|
+
GetUi32(name + 4) == 0 &&
|
966
|
+
IsNameEqualTo(name + 8, "HFS+ Private Data"))
|
967
|
+
{
|
968
|
+
// it's folder for "Hard Links" files
|
969
|
+
item.Name.SetFromAscii("[HFS+ Private Data]");
|
970
|
+
}
|
971
|
+
}
|
972
|
+
|
973
|
+
// Some dmg files have ' ' folder item.
|
974
|
+
if (item.Name.IsEmpty() || item.Name[0] == L' ')
|
975
|
+
item.Name.SetFromAscii("[]");
|
976
|
+
}
|
977
|
+
}
|
978
|
+
|
979
|
+
item.CTime = Get32(r + 0xC);
|
980
|
+
item.MTime = Get32(r + 0x10);
|
981
|
+
// item.AttrMTime = Get32(r + 0x14);
|
982
|
+
item.ATime = Get32(r + 0x18);
|
983
|
+
// item.BackupDate = Get32(r + 0x1C);
|
984
|
+
|
985
|
+
/*
|
986
|
+
item.OwnerID = Get32(r + 0x20);
|
987
|
+
item.GroupID = Get32(r + 0x24);
|
988
|
+
item.AdminFlags = r[0x28];
|
989
|
+
item.OwnerFlags = r[0x29];
|
990
|
+
*/
|
991
|
+
item.FileMode = Get16(r + 0x2A);
|
992
|
+
/*
|
993
|
+
item.special.iNodeNum = Get16(r + 0x2C); // or .linkCount
|
994
|
+
item.FileType = Get32(r + 0x30);
|
995
|
+
item.FileCreator = Get32(r + 0x34);
|
996
|
+
item.FinderFlags = Get16(r + 0x38);
|
997
|
+
item.Point[0] = Get16(r + 0x3A); // v
|
998
|
+
item.Point[1] = Get16(r + 0x3C); // h
|
999
|
+
*/
|
1000
|
+
|
1001
|
+
// const refIndex = Refs.Size();
|
1002
|
+
CIdIndexPair pair;
|
1003
|
+
pair.ID = item.ID;
|
1004
|
+
pair.Index = Items.Size() - 1;
|
1005
|
+
IdToIndexMap.Add(pair);
|
1006
|
+
|
1007
|
+
recSize -= kBasicRecSize;
|
1008
|
+
r += kBasicRecSize;
|
1009
|
+
if (item.IsDir())
|
1010
|
+
{
|
1011
|
+
numFolders++;
|
1012
|
+
if (recSize != 0)
|
1013
|
+
return S_FALSE;
|
1014
|
+
}
|
1015
|
+
else
|
1016
|
+
{
|
1017
|
+
numFiles++;
|
1018
|
+
const unsigned kForkRecSize = 16 + kNumFixedExtents * 8;
|
1019
|
+
if (recSize != kForkRecSize * 2)
|
1020
|
+
return S_FALSE;
|
1021
|
+
|
1022
|
+
item.DataFork.Parse(r);
|
1023
|
+
|
1024
|
+
if (!item.DataFork.UpgradeAndTest(overflowExtentsArray[0], item.ID, Header.BlockSizeLog))
|
1025
|
+
HeadersError = true;
|
1026
|
+
|
1027
|
+
item.ResourceFork.Parse(r + kForkRecSize);
|
1028
|
+
if (!item.ResourceFork.IsEmpty())
|
1029
|
+
{
|
1030
|
+
if (!item.ResourceFork.UpgradeAndTest(overflowExtentsArray[1], item.ID, Header.BlockSizeLog))
|
1031
|
+
HeadersError = true;
|
1032
|
+
ThereAreAltStreams = true;
|
1033
|
+
}
|
1034
|
+
}
|
1035
|
+
if (progress && (Items.Size() & 0xFFF) == 0)
|
1036
|
+
{
|
1037
|
+
UInt64 numItems = Items.Size();
|
1038
|
+
RINOK(progress->SetCompleted(&numItems, NULL));
|
1039
|
+
}
|
1040
|
+
}
|
1041
|
+
node = desc.fLink;
|
1042
|
+
}
|
1043
|
+
|
1044
|
+
if (Header.NumFiles != numFiles ||
|
1045
|
+
Header.NumFolders + 1 != numFolders)
|
1046
|
+
HeadersError = true;
|
1047
|
+
|
1048
|
+
IdToIndexMap.Sort2();
|
1049
|
+
{
|
1050
|
+
for (unsigned i = 1; i < IdToIndexMap.Size(); i++)
|
1051
|
+
if (IdToIndexMap[i - 1].ID == IdToIndexMap[i].ID)
|
1052
|
+
return S_FALSE;
|
1053
|
+
}
|
1054
|
+
|
1055
|
+
|
1056
|
+
CBoolArr skipAttr(Attrs.Size());
|
1057
|
+
{
|
1058
|
+
for (unsigned i = 0; i < Attrs.Size(); i++)
|
1059
|
+
skipAttr[i] = false;
|
1060
|
+
}
|
1061
|
+
|
1062
|
+
{
|
1063
|
+
FOR_VECTOR (i, Attrs)
|
1064
|
+
{
|
1065
|
+
const CAttr &attr = Attrs[i];
|
1066
|
+
|
1067
|
+
int itemIndex = FindItemIndex(IdToIndexMap, attr.ID);
|
1068
|
+
if (itemIndex < 0)
|
1069
|
+
{
|
1070
|
+
HeadersError = true;
|
1071
|
+
continue;
|
1072
|
+
}
|
1073
|
+
if (!Parse_decmpgfs(attr, Items[itemIndex], skipAttr[i]))
|
1074
|
+
HeadersError = true;
|
1075
|
+
}
|
1076
|
+
}
|
1077
|
+
|
1078
|
+
IdToIndexMap.ClearAndReserve(Items.Size());
|
1079
|
+
|
1080
|
+
{
|
1081
|
+
FOR_VECTOR (i, Items)
|
1082
|
+
{
|
1083
|
+
const CItem &item = Items[i];
|
1084
|
+
|
1085
|
+
CIdIndexPair pair;
|
1086
|
+
pair.ID = item.ID;
|
1087
|
+
pair.Index = Refs.Size();
|
1088
|
+
IdToIndexMap.Add(pair);
|
1089
|
+
|
1090
|
+
CRef ref;
|
1091
|
+
ref.ItemIndex = i;
|
1092
|
+
Refs.Add(ref);
|
1093
|
+
|
1094
|
+
#ifdef HFS_SHOW_ALT_STREAMS
|
1095
|
+
|
1096
|
+
if (item.ResourceFork.IsEmpty())
|
1097
|
+
continue;
|
1098
|
+
if (item.UseAttr && item.Method == kMethod_Resource)
|
1099
|
+
continue;
|
1100
|
+
CRef resRef;
|
1101
|
+
resRef.ItemIndex = i;
|
1102
|
+
resRef.IsResource = true;
|
1103
|
+
resRef.Parent = Refs.Size() - 1;
|
1104
|
+
Refs.Add(resRef);
|
1105
|
+
|
1106
|
+
#endif
|
1107
|
+
}
|
1108
|
+
}
|
1109
|
+
|
1110
|
+
IdToIndexMap.Sort2();
|
1111
|
+
|
1112
|
+
{
|
1113
|
+
FOR_VECTOR (i, Refs)
|
1114
|
+
{
|
1115
|
+
CRef &ref = Refs[i];
|
1116
|
+
if (ref.IsResource)
|
1117
|
+
continue;
|
1118
|
+
CItem &item = Items[ref.ItemIndex];
|
1119
|
+
ref.Parent = FindItemIndex(IdToIndexMap, item.ParentID);
|
1120
|
+
if (ref.Parent >= 0)
|
1121
|
+
{
|
1122
|
+
if (!Items[Refs[ref.Parent].ItemIndex].IsDir())
|
1123
|
+
{
|
1124
|
+
ref.Parent = -1;
|
1125
|
+
HeadersError = true;
|
1126
|
+
}
|
1127
|
+
}
|
1128
|
+
}
|
1129
|
+
}
|
1130
|
+
|
1131
|
+
#ifdef HFS_SHOW_ALT_STREAMS
|
1132
|
+
{
|
1133
|
+
FOR_VECTOR (i, Attrs)
|
1134
|
+
{
|
1135
|
+
if (skipAttr[i])
|
1136
|
+
continue;
|
1137
|
+
const CAttr &attr = Attrs[i];
|
1138
|
+
|
1139
|
+
int refIndex = FindItemIndex(IdToIndexMap, attr.ID);
|
1140
|
+
if (refIndex < 0)
|
1141
|
+
{
|
1142
|
+
HeadersError = true;
|
1143
|
+
continue;
|
1144
|
+
}
|
1145
|
+
|
1146
|
+
CRef ref;
|
1147
|
+
ref.AttrIndex = i;
|
1148
|
+
ref.Parent = refIndex;
|
1149
|
+
ref.ItemIndex = Refs[refIndex].ItemIndex;
|
1150
|
+
Refs.Add(ref);
|
1151
|
+
}
|
1152
|
+
}
|
1153
|
+
#endif
|
1154
|
+
|
1155
|
+
return S_OK;
|
1156
|
+
}
|
1157
|
+
|
1158
|
+
static const unsigned kHeaderPadSize = (1 << 10);
|
1159
|
+
|
1160
|
+
HRESULT CDatabase::Open2(IInStream *inStream, IArchiveOpenCallback *progress)
|
1161
|
+
{
|
1162
|
+
Clear();
|
1163
|
+
static const unsigned kHeaderSize = kHeaderPadSize + 512;
|
1164
|
+
Byte buf[kHeaderSize];
|
1165
|
+
RINOK(ReadStream_FALSE(inStream, buf, kHeaderSize));
|
1166
|
+
{
|
1167
|
+
for (unsigned i = 0; i < kHeaderPadSize; i++)
|
1168
|
+
if (buf[i] != 0)
|
1169
|
+
return S_FALSE;
|
1170
|
+
}
|
1171
|
+
const Byte *p = buf + kHeaderPadSize;
|
1172
|
+
CVolHeader &h = Header;
|
1173
|
+
|
1174
|
+
h.Header[0] = p[0];
|
1175
|
+
h.Header[1] = p[1];
|
1176
|
+
if (p[0] != 'H' || (p[1] != '+' && p[1] != 'X'))
|
1177
|
+
return S_FALSE;
|
1178
|
+
h.Version = Get16(p + 2);
|
1179
|
+
if (h.Version < 4 || h.Version > 5)
|
1180
|
+
return S_FALSE;
|
1181
|
+
|
1182
|
+
// h.Attr = Get32(p + 4);
|
1183
|
+
// h.LastMountedVersion = Get32(p + 8);
|
1184
|
+
// h.JournalInfoBlock = Get32(p + 0xC);
|
1185
|
+
|
1186
|
+
h.CTime = Get32(p + 0x10);
|
1187
|
+
h.MTime = Get32(p + 0x14);
|
1188
|
+
// h.BackupTime = Get32(p + 0x18);
|
1189
|
+
// h.CheckedTime = Get32(p + 0x1C);
|
1190
|
+
|
1191
|
+
h.NumFiles = Get32(p + 0x20);
|
1192
|
+
h.NumFolders = Get32(p + 0x24);
|
1193
|
+
|
1194
|
+
if (h.NumFolders > ((UInt32)1 << 29) ||
|
1195
|
+
h.NumFiles > ((UInt32)1 << 30))
|
1196
|
+
return S_FALSE;
|
1197
|
+
if (progress)
|
1198
|
+
{
|
1199
|
+
UInt64 numFiles = (UInt64)h.NumFiles + h.NumFolders + 1;
|
1200
|
+
RINOK(progress->SetTotal(&numFiles, NULL));
|
1201
|
+
}
|
1202
|
+
|
1203
|
+
UInt32 blockSize = Get32(p + 0x28);
|
1204
|
+
|
1205
|
+
{
|
1206
|
+
unsigned i;
|
1207
|
+
for (i = 9; ((UInt32)1 << i) != blockSize; i++)
|
1208
|
+
if (i == 31)
|
1209
|
+
return S_FALSE;
|
1210
|
+
h.BlockSizeLog = i;
|
1211
|
+
}
|
1212
|
+
|
1213
|
+
h.NumBlocks = Get32(p + 0x2C);
|
1214
|
+
h.NumFreeBlocks = Get32(p + 0x30);
|
1215
|
+
|
1216
|
+
/*
|
1217
|
+
h.NextCalatlogNodeID = Get32(p + 0x40);
|
1218
|
+
h.WriteCount = Get32(p + 0x44);
|
1219
|
+
for (i = 0; i < 6; i++)
|
1220
|
+
h.FinderInfo[i] = Get32(p + 0x50 + i * 4);
|
1221
|
+
h.VolID = Get64(p + 0x68);
|
1222
|
+
*/
|
1223
|
+
|
1224
|
+
/*
|
1225
|
+
UInt64 endPos;
|
1226
|
+
RINOK(inStream->Seek(0, STREAM_SEEK_END, &endPos));
|
1227
|
+
if ((endPos >> h.BlockSizeLog) < h.NumBlocks)
|
1228
|
+
return S_FALSE;
|
1229
|
+
*/
|
1230
|
+
|
1231
|
+
ResFileName.SetFromAscii(kResFileName);
|
1232
|
+
|
1233
|
+
CFork extentsFork, catalogFork, attrFork;
|
1234
|
+
// allocationFork.Parse(p + 0x70 + 0x50 * 0);
|
1235
|
+
extentsFork.Parse(p + 0x70 + 0x50 * 1);
|
1236
|
+
catalogFork.Parse(p + 0x70 + 0x50 * 2);
|
1237
|
+
attrFork.Parse (p + 0x70 + 0x50 * 3);
|
1238
|
+
// startupFork.Parse(p + 0x70 + 0x50 * 4);
|
1239
|
+
|
1240
|
+
CObjectVector<CIdExtents> overflowExtents[2];
|
1241
|
+
if (!extentsFork.IsOk(Header.BlockSizeLog))
|
1242
|
+
HeadersError = true;
|
1243
|
+
else
|
1244
|
+
{
|
1245
|
+
HRESULT res = LoadExtentFile(extentsFork, inStream, overflowExtents);
|
1246
|
+
if (res == S_FALSE)
|
1247
|
+
HeadersError = true;
|
1248
|
+
else if (res != S_OK)
|
1249
|
+
return res;
|
1250
|
+
}
|
1251
|
+
|
1252
|
+
if (!catalogFork.UpgradeAndTest(overflowExtents[0], kHfsID_CatalogFile, Header.BlockSizeLog))
|
1253
|
+
return S_FALSE;
|
1254
|
+
|
1255
|
+
if (!attrFork.UpgradeAndTest(overflowExtents[0], kHfsID_AttributesFile, Header.BlockSizeLog))
|
1256
|
+
HeadersError = true;
|
1257
|
+
else
|
1258
|
+
{
|
1259
|
+
if (attrFork.Size != 0)
|
1260
|
+
RINOK(LoadAttrs(attrFork, inStream, progress));
|
1261
|
+
}
|
1262
|
+
|
1263
|
+
RINOK(LoadCatalog(catalogFork, overflowExtents, inStream, progress));
|
1264
|
+
|
1265
|
+
PhySize = Header.GetPhySize();
|
1266
|
+
return S_OK;
|
1267
|
+
}
|
1268
|
+
|
1269
|
+
|
1270
|
+
|
1271
|
+
class CHandler:
|
1272
|
+
public IInArchive,
|
1273
|
+
public IArchiveGetRawProps,
|
1274
|
+
public IInArchiveGetStream,
|
1275
|
+
public CMyUnknownImp,
|
1276
|
+
public CDatabase
|
1277
|
+
{
|
1278
|
+
CMyComPtr<IInStream> _stream;
|
1279
|
+
|
1280
|
+
HRESULT GetForkStream(const CFork &fork, ISequentialInStream **stream);
|
1281
|
+
|
1282
|
+
HRESULT ExtractZlibFile(
|
1283
|
+
ISequentialOutStream *realOutStream,
|
1284
|
+
const CItem &item,
|
1285
|
+
NCompress::NZlib::CDecoder *_zlibDecoderSpec,
|
1286
|
+
CByteBuffer &buf,
|
1287
|
+
UInt64 progressStart,
|
1288
|
+
IArchiveExtractCallback *extractCallback);
|
1289
|
+
public:
|
1290
|
+
MY_UNKNOWN_IMP3(IInArchive, IArchiveGetRawProps, IInArchiveGetStream)
|
1291
|
+
INTERFACE_IInArchive(;)
|
1292
|
+
INTERFACE_IArchiveGetRawProps(;)
|
1293
|
+
STDMETHOD(GetStream)(UInt32 index, ISequentialInStream **stream);
|
1294
|
+
};
|
1295
|
+
|
1296
|
+
static const Byte kProps[] =
|
1297
|
+
{
|
1298
|
+
kpidPath,
|
1299
|
+
kpidIsDir,
|
1300
|
+
kpidSize,
|
1301
|
+
kpidPackSize,
|
1302
|
+
kpidCTime,
|
1303
|
+
kpidMTime,
|
1304
|
+
kpidATime,
|
1305
|
+
kpidPosixAttrib
|
1306
|
+
};
|
1307
|
+
|
1308
|
+
static const Byte kArcProps[] =
|
1309
|
+
{
|
1310
|
+
kpidMethod,
|
1311
|
+
kpidClusterSize,
|
1312
|
+
kpidFreeSpace,
|
1313
|
+
kpidCTime,
|
1314
|
+
kpidMTime
|
1315
|
+
};
|
1316
|
+
|
1317
|
+
IMP_IInArchive_Props
|
1318
|
+
IMP_IInArchive_ArcProps
|
1319
|
+
|
1320
|
+
static void HfsTimeToProp(UInt32 hfsTime, NWindows::NCOM::CPropVariant &prop)
|
1321
|
+
{
|
1322
|
+
FILETIME ft;
|
1323
|
+
HfsTimeToFileTime(hfsTime, ft);
|
1324
|
+
prop = ft;
|
1325
|
+
}
|
1326
|
+
|
1327
|
+
STDMETHODIMP CHandler::GetArchiveProperty(PROPID propID, PROPVARIANT *value)
|
1328
|
+
{
|
1329
|
+
COM_TRY_BEGIN
|
1330
|
+
NWindows::NCOM::CPropVariant prop;
|
1331
|
+
switch (propID)
|
1332
|
+
{
|
1333
|
+
case kpidExtension: prop = Header.IsHfsX() ? "hfsx" : "hfs"; break;
|
1334
|
+
case kpidMethod: prop = Header.IsHfsX() ? "HFSX" : "HFS+"; break;
|
1335
|
+
case kpidPhySize: prop = PhySize; break;
|
1336
|
+
case kpidClusterSize: prop = (UInt32)1 << Header.BlockSizeLog; break;
|
1337
|
+
case kpidFreeSpace: prop = (UInt64)Header.GetFreeSize(); break;
|
1338
|
+
case kpidMTime: HfsTimeToProp(Header.MTime, prop); break;
|
1339
|
+
case kpidCTime:
|
1340
|
+
{
|
1341
|
+
FILETIME localFt, ft;
|
1342
|
+
HfsTimeToFileTime(Header.CTime, localFt);
|
1343
|
+
if (LocalFileTimeToFileTime(&localFt, &ft))
|
1344
|
+
prop = ft;
|
1345
|
+
break;
|
1346
|
+
}
|
1347
|
+
case kpidIsTree: prop = true; break;
|
1348
|
+
case kpidErrorFlags:
|
1349
|
+
{
|
1350
|
+
UInt32 flags = 0;
|
1351
|
+
if (HeadersError) flags |= kpv_ErrorFlags_HeadersError;
|
1352
|
+
if (flags != 0)
|
1353
|
+
prop = flags;
|
1354
|
+
break;
|
1355
|
+
}
|
1356
|
+
case kpidIsAltStream: prop = ThereAreAltStreams; break;
|
1357
|
+
}
|
1358
|
+
prop.Detach(value);
|
1359
|
+
return S_OK;
|
1360
|
+
COM_TRY_END
|
1361
|
+
}
|
1362
|
+
|
1363
|
+
STDMETHODIMP CHandler::GetNumRawProps(UInt32 *numProps)
|
1364
|
+
{
|
1365
|
+
*numProps = 0;
|
1366
|
+
return S_OK;
|
1367
|
+
}
|
1368
|
+
|
1369
|
+
STDMETHODIMP CHandler::GetRawPropInfo(UInt32 /* index */, BSTR *name, PROPID *propID)
|
1370
|
+
{
|
1371
|
+
*name = NULL;
|
1372
|
+
*propID = 0;
|
1373
|
+
return S_OK;
|
1374
|
+
}
|
1375
|
+
|
1376
|
+
STDMETHODIMP CHandler::GetParent(UInt32 index, UInt32 *parent, UInt32 *parentType)
|
1377
|
+
{
|
1378
|
+
const CRef &ref = Refs[index];
|
1379
|
+
*parentType = ref.IsAltStream() ?
|
1380
|
+
NParentType::kAltStream :
|
1381
|
+
NParentType::kDir;
|
1382
|
+
*parent = (UInt32)(Int32)ref.Parent;
|
1383
|
+
return S_OK;
|
1384
|
+
}
|
1385
|
+
|
1386
|
+
STDMETHODIMP CHandler::GetRawProp(UInt32 index, PROPID propID, const void **data, UInt32 *dataSize, UInt32 *propType)
|
1387
|
+
{
|
1388
|
+
*data = NULL;
|
1389
|
+
*dataSize = 0;
|
1390
|
+
*propType = 0;
|
1391
|
+
#ifdef MY_CPU_LE
|
1392
|
+
if (propID == kpidName)
|
1393
|
+
{
|
1394
|
+
const CRef &ref = Refs[index];
|
1395
|
+
const UString *s;
|
1396
|
+
if (ref.IsResource)
|
1397
|
+
s = &ResFileName;
|
1398
|
+
else if (ref.AttrIndex >= 0)
|
1399
|
+
s = &Attrs[ref.AttrIndex].Name;
|
1400
|
+
else
|
1401
|
+
s = &Items[ref.ItemIndex].Name;
|
1402
|
+
*data = (const wchar_t *)(*s);
|
1403
|
+
*dataSize = (s->Len() + 1) * sizeof(wchar_t);
|
1404
|
+
*propType = PROP_DATA_TYPE_wchar_t_PTR_Z_LE;
|
1405
|
+
return S_OK;
|
1406
|
+
}
|
1407
|
+
#endif
|
1408
|
+
return S_OK;
|
1409
|
+
}
|
1410
|
+
|
1411
|
+
STDMETHODIMP CHandler::GetProperty(UInt32 index, PROPID propID, PROPVARIANT *value)
|
1412
|
+
{
|
1413
|
+
COM_TRY_BEGIN
|
1414
|
+
NWindows::NCOM::CPropVariant prop;
|
1415
|
+
const CRef &ref = Refs[index];
|
1416
|
+
const CItem &item = Items[ref.ItemIndex];
|
1417
|
+
switch (propID)
|
1418
|
+
{
|
1419
|
+
case kpidPath: GetItemPath(index, prop); break;
|
1420
|
+
case kpidName:
|
1421
|
+
const UString *s;
|
1422
|
+
if (ref.IsResource)
|
1423
|
+
s = &ResFileName;
|
1424
|
+
else if (ref.AttrIndex >= 0)
|
1425
|
+
s = &Attrs[ref.AttrIndex].Name;
|
1426
|
+
else
|
1427
|
+
s = &item.Name;
|
1428
|
+
prop = *s;
|
1429
|
+
break;
|
1430
|
+
case kpidPackSize:
|
1431
|
+
{
|
1432
|
+
UInt64 size;
|
1433
|
+
if (ref.AttrIndex >= 0)
|
1434
|
+
size = Attrs[ref.AttrIndex].Size;
|
1435
|
+
else if (item.IsDir())
|
1436
|
+
break;
|
1437
|
+
else if (item.UseAttr)
|
1438
|
+
{
|
1439
|
+
if (item.Method == kMethod_Resource)
|
1440
|
+
size = item.ResourceFork.NumBlocks << Header.BlockSizeLog;
|
1441
|
+
else
|
1442
|
+
size = item.PackSize;
|
1443
|
+
}
|
1444
|
+
else
|
1445
|
+
size = item.GetFork(ref.IsResource).NumBlocks << Header.BlockSizeLog;
|
1446
|
+
prop = size;
|
1447
|
+
break;
|
1448
|
+
}
|
1449
|
+
case kpidSize:
|
1450
|
+
{
|
1451
|
+
UInt64 size;
|
1452
|
+
if (ref.AttrIndex >= 0)
|
1453
|
+
size = Attrs[ref.AttrIndex].Size;
|
1454
|
+
else if (item.IsDir())
|
1455
|
+
break;
|
1456
|
+
else if (item.UseAttr)
|
1457
|
+
size = item.UnpackSize;
|
1458
|
+
else
|
1459
|
+
size = item.GetFork(ref.IsResource).Size;
|
1460
|
+
prop = size;
|
1461
|
+
break;
|
1462
|
+
}
|
1463
|
+
case kpidIsDir: prop = item.IsDir(); break;
|
1464
|
+
case kpidIsAltStream: prop = ref.IsAltStream(); break;
|
1465
|
+
|
1466
|
+
case kpidCTime: HfsTimeToProp(item.CTime, prop); break;
|
1467
|
+
case kpidMTime: HfsTimeToProp(item.MTime, prop); break;
|
1468
|
+
case kpidATime: HfsTimeToProp(item.ATime, prop); break;
|
1469
|
+
|
1470
|
+
case kpidPosixAttrib: if (ref.AttrIndex < 0) prop = (UInt32)item.FileMode; break;
|
1471
|
+
}
|
1472
|
+
prop.Detach(value);
|
1473
|
+
return S_OK;
|
1474
|
+
COM_TRY_END
|
1475
|
+
}
|
1476
|
+
|
1477
|
+
STDMETHODIMP CHandler::Open(IInStream *inStream,
|
1478
|
+
const UInt64 * /* maxCheckStartPosition */,
|
1479
|
+
IArchiveOpenCallback *callback)
|
1480
|
+
{
|
1481
|
+
COM_TRY_BEGIN
|
1482
|
+
Close();
|
1483
|
+
RINOK(Open2(inStream, callback));
|
1484
|
+
_stream = inStream;
|
1485
|
+
return S_OK;
|
1486
|
+
COM_TRY_END
|
1487
|
+
}
|
1488
|
+
|
1489
|
+
STDMETHODIMP CHandler::Close()
|
1490
|
+
{
|
1491
|
+
_stream.Release();
|
1492
|
+
Clear();
|
1493
|
+
return S_OK;
|
1494
|
+
}
|
1495
|
+
|
1496
|
+
static const UInt32 kCompressionBlockSize = 1 << 16;
|
1497
|
+
|
1498
|
+
HRESULT CHandler::ExtractZlibFile(
|
1499
|
+
ISequentialOutStream *outStream,
|
1500
|
+
const CItem &item,
|
1501
|
+
NCompress::NZlib::CDecoder *_zlibDecoderSpec,
|
1502
|
+
CByteBuffer &buf,
|
1503
|
+
UInt64 progressStart,
|
1504
|
+
IArchiveExtractCallback *extractCallback)
|
1505
|
+
{
|
1506
|
+
CMyComPtr<ISequentialInStream> inStream;
|
1507
|
+
const CFork &fork = item.ResourceFork;
|
1508
|
+
RINOK(GetForkStream(fork, &inStream));
|
1509
|
+
const unsigned kHeaderSize = 0x100 + 8;
|
1510
|
+
RINOK(ReadStream_FALSE(inStream, buf, kHeaderSize));
|
1511
|
+
UInt32 dataPos = Get32(buf);
|
1512
|
+
UInt32 mapPos = Get32(buf + 4);
|
1513
|
+
UInt32 dataSize = Get32(buf + 8);
|
1514
|
+
UInt32 mapSize = Get32(buf + 12);
|
1515
|
+
|
1516
|
+
const UInt32 kResMapSize = 50;
|
1517
|
+
|
1518
|
+
if (mapSize != kResMapSize
|
1519
|
+
|| dataPos + dataSize != mapPos
|
1520
|
+
|| mapPos + mapSize != fork.Size)
|
1521
|
+
return S_FALSE;
|
1522
|
+
|
1523
|
+
UInt32 dataSize2 = Get32(buf + 0x100);
|
1524
|
+
if (4 + dataSize2 != dataSize || dataSize2 < 8)
|
1525
|
+
return S_FALSE;
|
1526
|
+
|
1527
|
+
UInt32 numBlocks = GetUi32(buf + 0x100 + 4);
|
1528
|
+
if (((dataSize2 - 4) >> 3) < numBlocks)
|
1529
|
+
return S_FALSE;
|
1530
|
+
if (item.UnpackSize > (UInt64)numBlocks * kCompressionBlockSize)
|
1531
|
+
return S_FALSE;
|
1532
|
+
|
1533
|
+
if (item.UnpackSize + kCompressionBlockSize < (UInt64)numBlocks * kCompressionBlockSize)
|
1534
|
+
return S_FALSE;
|
1535
|
+
|
1536
|
+
UInt32 tableSize = (numBlocks << 3);
|
1537
|
+
|
1538
|
+
CByteBuffer tableBuf(tableSize);
|
1539
|
+
|
1540
|
+
RINOK(ReadStream_FALSE(inStream, tableBuf, tableSize));
|
1541
|
+
|
1542
|
+
UInt32 prev = 4 + tableSize;
|
1543
|
+
|
1544
|
+
UInt32 i;
|
1545
|
+
for (i = 0; i < numBlocks; i++)
|
1546
|
+
{
|
1547
|
+
UInt32 offset = GetUi32(tableBuf + i * 8);
|
1548
|
+
UInt32 size = GetUi32(tableBuf + i * 8 + 4);
|
1549
|
+
if (size == 0)
|
1550
|
+
return S_FALSE;
|
1551
|
+
if (prev != offset)
|
1552
|
+
return S_FALSE;
|
1553
|
+
if (offset > dataSize2 ||
|
1554
|
+
size > dataSize2 - offset)
|
1555
|
+
return S_FALSE;
|
1556
|
+
prev = offset + size;
|
1557
|
+
}
|
1558
|
+
|
1559
|
+
if (prev != dataSize2)
|
1560
|
+
return S_FALSE;
|
1561
|
+
|
1562
|
+
CBufInStream *bufInStreamSpec = new CBufInStream;
|
1563
|
+
CMyComPtr<ISequentialInStream> bufInStream = bufInStreamSpec;
|
1564
|
+
|
1565
|
+
UInt64 outPos = 0;
|
1566
|
+
for (i = 0; i < numBlocks; i++)
|
1567
|
+
{
|
1568
|
+
UInt64 rem = item.UnpackSize - outPos;
|
1569
|
+
if (rem == 0)
|
1570
|
+
return S_FALSE;
|
1571
|
+
UInt32 blockSize = kCompressionBlockSize;
|
1572
|
+
if (rem < kCompressionBlockSize)
|
1573
|
+
blockSize = (UInt32)rem;
|
1574
|
+
|
1575
|
+
UInt32 size = GetUi32(tableBuf + i * 8 + 4);
|
1576
|
+
|
1577
|
+
if (size > buf.Size() || size > kCompressionBlockSize + 1)
|
1578
|
+
return S_FALSE;
|
1579
|
+
|
1580
|
+
RINOK(ReadStream_FALSE(inStream, buf, size));
|
1581
|
+
|
1582
|
+
if ((buf[0] & 0xF) == 0xF)
|
1583
|
+
{
|
1584
|
+
// that code was not tested. Are there HFS archives with uncompressed block
|
1585
|
+
if (size - 1 != blockSize)
|
1586
|
+
return S_FALSE;
|
1587
|
+
|
1588
|
+
if (outStream)
|
1589
|
+
{
|
1590
|
+
RINOK(WriteStream(outStream, buf, blockSize));
|
1591
|
+
}
|
1592
|
+
}
|
1593
|
+
else
|
1594
|
+
{
|
1595
|
+
UInt64 blockSize64 = blockSize;
|
1596
|
+
bufInStreamSpec->Init(buf, size);
|
1597
|
+
RINOK(_zlibDecoderSpec->Code(bufInStream, outStream, NULL, &blockSize64, NULL));
|
1598
|
+
if (_zlibDecoderSpec->GetOutputProcessedSize() != blockSize ||
|
1599
|
+
_zlibDecoderSpec->GetInputProcessedSize() != size)
|
1600
|
+
return S_FALSE;
|
1601
|
+
}
|
1602
|
+
|
1603
|
+
outPos += blockSize;
|
1604
|
+
UInt64 progressPos = progressStart + outPos;
|
1605
|
+
RINOK(extractCallback->SetCompleted(&progressPos));
|
1606
|
+
}
|
1607
|
+
|
1608
|
+
if (outPos != item.UnpackSize)
|
1609
|
+
return S_FALSE;
|
1610
|
+
|
1611
|
+
/* We check Resource Map
|
1612
|
+
Are there HFS files with another values in Resource Map ??? */
|
1613
|
+
|
1614
|
+
RINOK(ReadStream_FALSE(inStream, buf, mapSize));
|
1615
|
+
UInt32 types = Get16(buf + 24);
|
1616
|
+
UInt32 names = Get16(buf + 26);
|
1617
|
+
UInt32 numTypes = Get16(buf + 28);
|
1618
|
+
if (numTypes != 0 || types != 28 || names != kResMapSize)
|
1619
|
+
return S_FALSE;
|
1620
|
+
UInt32 resType = Get32(buf + 30);
|
1621
|
+
UInt32 numResources = Get16(buf + 34);
|
1622
|
+
UInt32 resListOffset = Get16(buf + 36);
|
1623
|
+
if (resType != 0x636D7066) // cmpf
|
1624
|
+
return S_FALSE;
|
1625
|
+
if (numResources != 0 || resListOffset != 10)
|
1626
|
+
return S_FALSE;
|
1627
|
+
|
1628
|
+
UInt32 entryId = Get16(buf + 38);
|
1629
|
+
UInt32 nameOffset = Get16(buf + 40);
|
1630
|
+
// Byte attrib = buf[42];
|
1631
|
+
UInt32 resourceOffset = Get32(buf + 42) & 0xFFFFFF;
|
1632
|
+
if (entryId != 1 || nameOffset != 0xFFFF || resourceOffset != 0)
|
1633
|
+
return S_FALSE;
|
1634
|
+
|
1635
|
+
return S_OK;
|
1636
|
+
}
|
1637
|
+
|
1638
|
+
STDMETHODIMP CHandler::Extract(const UInt32 *indices, UInt32 numItems,
|
1639
|
+
Int32 testMode, IArchiveExtractCallback *extractCallback)
|
1640
|
+
{
|
1641
|
+
COM_TRY_BEGIN
|
1642
|
+
bool allFilesMode = (numItems == (UInt32)(Int32)-1);
|
1643
|
+
if (allFilesMode)
|
1644
|
+
numItems = Refs.Size();
|
1645
|
+
if (numItems == 0)
|
1646
|
+
return S_OK;
|
1647
|
+
UInt32 i;
|
1648
|
+
UInt64 totalSize = 0;
|
1649
|
+
for (i = 0; i < numItems; i++)
|
1650
|
+
{
|
1651
|
+
const CRef &ref = Refs[allFilesMode ? i : indices[i]];
|
1652
|
+
totalSize += Get_UnpackSize_of_Ref(ref);
|
1653
|
+
}
|
1654
|
+
RINOK(extractCallback->SetTotal(totalSize));
|
1655
|
+
|
1656
|
+
UInt64 currentTotalSize = 0, currentItemSize = 0;
|
1657
|
+
|
1658
|
+
const size_t kBufSize = kCompressionBlockSize;
|
1659
|
+
CByteBuffer buf(kBufSize + 0x10); // we need 1 additional bytes for uncompressed chunk header
|
1660
|
+
|
1661
|
+
NCompress::NZlib::CDecoder *_zlibDecoderSpec = NULL;
|
1662
|
+
CMyComPtr<ICompressCoder> _zlibDecoder;
|
1663
|
+
|
1664
|
+
for (i = 0; i < numItems; i++, currentTotalSize += currentItemSize)
|
1665
|
+
{
|
1666
|
+
RINOK(extractCallback->SetCompleted(¤tTotalSize));
|
1667
|
+
UInt32 index = allFilesMode ? i : indices[i];
|
1668
|
+
const CRef &ref = Refs[index];
|
1669
|
+
const CItem &item = Items[ref.ItemIndex];
|
1670
|
+
currentItemSize = Get_UnpackSize_of_Ref(ref);
|
1671
|
+
|
1672
|
+
CMyComPtr<ISequentialOutStream> realOutStream;
|
1673
|
+
Int32 askMode = testMode ?
|
1674
|
+
NExtract::NAskMode::kTest :
|
1675
|
+
NExtract::NAskMode::kExtract;
|
1676
|
+
RINOK(extractCallback->GetStream(index, &realOutStream, askMode));
|
1677
|
+
|
1678
|
+
if (ref.AttrIndex < 0 && item.IsDir())
|
1679
|
+
{
|
1680
|
+
RINOK(extractCallback->PrepareOperation(askMode));
|
1681
|
+
RINOK(extractCallback->SetOperationResult(NExtract::NOperationResult::kOK));
|
1682
|
+
continue;
|
1683
|
+
}
|
1684
|
+
if (!testMode && !realOutStream)
|
1685
|
+
continue;
|
1686
|
+
RINOK(extractCallback->PrepareOperation(askMode));
|
1687
|
+
UInt64 pos = 0;
|
1688
|
+
int res = NExtract::NOperationResult::kDataError;
|
1689
|
+
if (ref.AttrIndex >= 0)
|
1690
|
+
{
|
1691
|
+
res = NExtract::NOperationResult::kOK;
|
1692
|
+
if (realOutStream)
|
1693
|
+
{
|
1694
|
+
const CAttr &attr = Attrs[ref.AttrIndex];
|
1695
|
+
RINOK(WriteStream(realOutStream, AttrBuf + attr.Pos, attr.Size));
|
1696
|
+
}
|
1697
|
+
}
|
1698
|
+
else if (item.UseAttr)
|
1699
|
+
{
|
1700
|
+
if (item.UseInlineData)
|
1701
|
+
{
|
1702
|
+
res = NExtract::NOperationResult::kOK;
|
1703
|
+
if (realOutStream)
|
1704
|
+
{
|
1705
|
+
RINOK(WriteStream(realOutStream, AttrBuf + item.DataPos, (size_t)item.UnpackSize));
|
1706
|
+
}
|
1707
|
+
}
|
1708
|
+
else
|
1709
|
+
{
|
1710
|
+
if (!_zlibDecoder)
|
1711
|
+
{
|
1712
|
+
_zlibDecoderSpec = new NCompress::NZlib::CDecoder();
|
1713
|
+
_zlibDecoder = _zlibDecoderSpec;
|
1714
|
+
}
|
1715
|
+
|
1716
|
+
if (item.Method == kMethod_Attr)
|
1717
|
+
{
|
1718
|
+
CBufInStream *bufInStreamSpec = new CBufInStream;
|
1719
|
+
CMyComPtr<ISequentialInStream> bufInStream = bufInStreamSpec;
|
1720
|
+
bufInStreamSpec->Init(AttrBuf + item.DataPos, item.PackSize);
|
1721
|
+
|
1722
|
+
HRESULT hres = _zlibDecoder->Code(bufInStream, realOutStream, NULL, &item.UnpackSize, NULL);
|
1723
|
+
if (hres != S_FALSE)
|
1724
|
+
{
|
1725
|
+
if (hres != S_OK)
|
1726
|
+
return hres;
|
1727
|
+
if (_zlibDecoderSpec->GetOutputProcessedSize() == item.UnpackSize &&
|
1728
|
+
_zlibDecoderSpec->GetInputProcessedSize() == item.PackSize)
|
1729
|
+
res = NExtract::NOperationResult::kOK;
|
1730
|
+
}
|
1731
|
+
}
|
1732
|
+
else
|
1733
|
+
{
|
1734
|
+
HRESULT hres = ExtractZlibFile(realOutStream, item, _zlibDecoderSpec, buf,
|
1735
|
+
currentTotalSize, extractCallback);
|
1736
|
+
if (hres != S_FALSE)
|
1737
|
+
{
|
1738
|
+
if (hres != S_OK)
|
1739
|
+
return hres;
|
1740
|
+
res = NExtract::NOperationResult::kOK;
|
1741
|
+
}
|
1742
|
+
}
|
1743
|
+
}
|
1744
|
+
}
|
1745
|
+
else
|
1746
|
+
{
|
1747
|
+
const CFork &fork = item.GetFork(ref.IsResource);
|
1748
|
+
if (fork.IsOk(Header.BlockSizeLog))
|
1749
|
+
{
|
1750
|
+
res = NExtract::NOperationResult::kOK;
|
1751
|
+
unsigned extentIndex;
|
1752
|
+
for (extentIndex = 0; extentIndex < fork.Extents.Size(); extentIndex++)
|
1753
|
+
{
|
1754
|
+
if (res != NExtract::NOperationResult::kOK)
|
1755
|
+
break;
|
1756
|
+
if (fork.Size == pos)
|
1757
|
+
break;
|
1758
|
+
const CExtent &e = fork.Extents[extentIndex];
|
1759
|
+
RINOK(_stream->Seek((UInt64)e.Pos << Header.BlockSizeLog, STREAM_SEEK_SET, NULL));
|
1760
|
+
UInt64 extentRem = (UInt64)e.NumBlocks << Header.BlockSizeLog;
|
1761
|
+
while (extentRem != 0)
|
1762
|
+
{
|
1763
|
+
UInt64 rem = fork.Size - pos;
|
1764
|
+
if (rem == 0)
|
1765
|
+
{
|
1766
|
+
// Here we check that there are no extra (empty) blocks in last extent.
|
1767
|
+
if (extentRem >= ((UInt64)1 << Header.BlockSizeLog))
|
1768
|
+
res = NExtract::NOperationResult::kDataError;
|
1769
|
+
break;
|
1770
|
+
}
|
1771
|
+
size_t cur = kBufSize;
|
1772
|
+
if (cur > rem)
|
1773
|
+
cur = (size_t)rem;
|
1774
|
+
if (cur > extentRem)
|
1775
|
+
cur = (size_t)extentRem;
|
1776
|
+
RINOK(ReadStream(_stream, buf, &cur));
|
1777
|
+
if (cur == 0)
|
1778
|
+
{
|
1779
|
+
res = NExtract::NOperationResult::kDataError;
|
1780
|
+
break;
|
1781
|
+
}
|
1782
|
+
if (realOutStream)
|
1783
|
+
{
|
1784
|
+
RINOK(WriteStream(realOutStream, buf, cur));
|
1785
|
+
}
|
1786
|
+
pos += cur;
|
1787
|
+
extentRem -= cur;
|
1788
|
+
UInt64 processed = currentTotalSize + pos;
|
1789
|
+
RINOK(extractCallback->SetCompleted(&processed));
|
1790
|
+
}
|
1791
|
+
}
|
1792
|
+
if (extentIndex != fork.Extents.Size() || fork.Size != pos)
|
1793
|
+
res = NExtract::NOperationResult::kDataError;
|
1794
|
+
}
|
1795
|
+
}
|
1796
|
+
realOutStream.Release();
|
1797
|
+
RINOK(extractCallback->SetOperationResult(res));
|
1798
|
+
}
|
1799
|
+
return S_OK;
|
1800
|
+
COM_TRY_END
|
1801
|
+
}
|
1802
|
+
|
1803
|
+
STDMETHODIMP CHandler::GetNumberOfItems(UInt32 *numItems)
|
1804
|
+
{
|
1805
|
+
*numItems = Refs.Size();
|
1806
|
+
return S_OK;
|
1807
|
+
}
|
1808
|
+
|
1809
|
+
HRESULT CHandler::GetForkStream(const CFork &fork, ISequentialInStream **stream)
|
1810
|
+
{
|
1811
|
+
*stream = 0;
|
1812
|
+
|
1813
|
+
if (!fork.IsOk(Header.BlockSizeLog))
|
1814
|
+
return S_FALSE;
|
1815
|
+
|
1816
|
+
CExtentsStream *extentStreamSpec = new CExtentsStream();
|
1817
|
+
CMyComPtr<ISequentialInStream> extentStream = extentStreamSpec;
|
1818
|
+
|
1819
|
+
UInt64 rem = fork.Size;
|
1820
|
+
UInt64 virt = 0;
|
1821
|
+
|
1822
|
+
FOR_VECTOR (i, fork.Extents)
|
1823
|
+
{
|
1824
|
+
const CExtent &e = fork.Extents[i];
|
1825
|
+
if (e.NumBlocks == 0)
|
1826
|
+
continue;
|
1827
|
+
UInt64 cur = ((UInt64)e.NumBlocks << Header.BlockSizeLog);
|
1828
|
+
if (cur > rem)
|
1829
|
+
{
|
1830
|
+
cur = rem;
|
1831
|
+
if (i != fork.Extents.Size() - 1)
|
1832
|
+
return S_FALSE;
|
1833
|
+
}
|
1834
|
+
CSeekExtent se;
|
1835
|
+
se.Phy = (UInt64)e.Pos << Header.BlockSizeLog;
|
1836
|
+
se.Virt = virt;
|
1837
|
+
virt += cur;
|
1838
|
+
rem -= cur;
|
1839
|
+
extentStreamSpec->Extents.Add(se);
|
1840
|
+
}
|
1841
|
+
|
1842
|
+
if (rem != 0)
|
1843
|
+
return S_FALSE;
|
1844
|
+
|
1845
|
+
CSeekExtent se;
|
1846
|
+
se.Phy = 0;
|
1847
|
+
se.Virt = virt;
|
1848
|
+
extentStreamSpec->Extents.Add(se);
|
1849
|
+
extentStreamSpec->Stream = _stream;
|
1850
|
+
extentStreamSpec->Init();
|
1851
|
+
*stream = extentStream.Detach();
|
1852
|
+
return S_OK;
|
1853
|
+
}
|
1854
|
+
|
1855
|
+
STDMETHODIMP CHandler::GetStream(UInt32 index, ISequentialInStream **stream)
|
1856
|
+
{
|
1857
|
+
*stream = 0;
|
1858
|
+
|
1859
|
+
const CRef &ref = Refs[index];
|
1860
|
+
if (ref.AttrIndex >= 0)
|
1861
|
+
return S_FALSE;
|
1862
|
+
const CItem &item = Items[ref.ItemIndex];
|
1863
|
+
if (item.IsDir() || item.UseAttr)
|
1864
|
+
return S_FALSE;
|
1865
|
+
|
1866
|
+
return GetForkStream(item.GetFork(ref.IsResource), stream);
|
1867
|
+
}
|
1868
|
+
|
1869
|
+
static const Byte k_Signature[] = {
|
1870
|
+
4, 'H', '+', 0, 4,
|
1871
|
+
4, 'H', 'X', 0, 5 };
|
1872
|
+
|
1873
|
+
REGISTER_ARC_I(
|
1874
|
+
"HFS", "hfs hfsx", 0, 0xE3,
|
1875
|
+
k_Signature,
|
1876
|
+
kHeaderPadSize,
|
1877
|
+
NArcInfoFlags::kMultiSignature,
|
1878
|
+
NULL)
|
1879
|
+
|
1880
|
+
}}
|