react-native-update 10.34.3 → 10.34.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/harmony/pushy/src/main/cpp/HDiffPatch/CHANGELOG.md +34 -172
- package/harmony/pushy/src/main/cpp/HDiffPatch/LICENSE +4 -4
- package/harmony/pushy/src/main/cpp/HDiffPatch/Makefile +63 -379
- package/harmony/pushy/src/main/cpp/HDiffPatch/README.md +170 -415
- package/harmony/pushy/src/main/cpp/HDiffPatch/_atosize.h +10 -54
- package/harmony/pushy/src/main/cpp/HDiffPatch/_clock_for_demo.h +1 -13
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/android_ndk_jni_mk/Android.mk +18 -171
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/android_ndk_jni_mk/Application.mk +4 -5
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/android_ndk_jni_mk/hpatch.c +7 -38
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/android_ndk_jni_mk/hpatch.h +4 -15
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/android_ndk_jni_mk/hpatch_jni.c +12 -22
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/android_ndk_jni_mk/java/com/github/sisong/HPatch.java +4 -22
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/codeblocks/HDiffPatch.workspace +8 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/codeblocks/HDiffZ.cbp +219 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/codeblocks/HPatchZ.cbp +156 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/codeblocks/unitTest.cbp +65 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/vc/HDiffPatch.sln +105 -155
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/vc/HDiffZ.vcxproj +236 -363
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/vc/HDiffZ.vcxproj.user +3 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/vc/HPatchZ.vcxproj +317 -347
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/vc/HPatchZ.vcxproj.user +3 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/vc/unitTest.vcxproj +181 -295
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/vc/unitTest.vcxproj.user +3 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/xcode/HDiffPatch.xcworkspace/contents.xcworkspacedata +0 -9
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/xcode/bestParams.xcodeproj/project.pbxproj +14 -53
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/xcode/hdiffz.xcodeproj/project.pbxproj +32 -162
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/xcode/hpatchz.xcodeproj/project.pbxproj +22 -89
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/xcode/lzma.xcodeproj/project.pbxproj +13 -237
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/xcode/testHashClash.xcodeproj/project.pbxproj +2 -2
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/xcode/unitTest.xcodeproj/project.pbxproj +14 -194
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/xcode/zstd.xcodeproj/project.pbxproj +10 -30
- package/harmony/pushy/src/main/cpp/HDiffPatch/checksum_plugin_demo.h +3 -458
- package/harmony/pushy/src/main/cpp/HDiffPatch/compress_parallel.cpp +71 -106
- package/harmony/pushy/src/main/cpp/HDiffPatch/compress_parallel.h +3 -3
- package/harmony/pushy/src/main/cpp/HDiffPatch/compress_plugin_demo.h +110 -484
- package/harmony/pushy/src/main/cpp/HDiffPatch/decompress_plugin_demo.h +193 -835
- package/harmony/pushy/src/main/cpp/HDiffPatch/dirDiffPatch/dir_diff/dir_diff.cpp +50 -99
- package/harmony/pushy/src/main/cpp/HDiffPatch/dirDiffPatch/dir_diff/dir_diff.h +4 -18
- package/harmony/pushy/src/main/cpp/HDiffPatch/dirDiffPatch/dir_diff/dir_diff_tools.cpp +8 -147
- package/harmony/pushy/src/main/cpp/HDiffPatch/dirDiffPatch/dir_diff/dir_diff_tools.h +6 -18
- package/harmony/pushy/src/main/cpp/HDiffPatch/dirDiffPatch/dir_diff/dir_manifest.cpp +25 -7
- package/harmony/pushy/src/main/cpp/HDiffPatch/dirDiffPatch/dir_diff/file_for_dirDiff.h +113 -5
- package/harmony/pushy/src/main/cpp/HDiffPatch/dirDiffPatch/dir_patch/dir_patch.c +97 -163
- package/harmony/pushy/src/main/cpp/HDiffPatch/dirDiffPatch/dir_patch/dir_patch.h +39 -49
- package/harmony/pushy/src/main/cpp/HDiffPatch/dirDiffPatch/dir_patch/dir_patch_tools.c +15 -15
- package/harmony/pushy/src/main/cpp/HDiffPatch/dirDiffPatch/dir_patch/dir_patch_tools.h +2 -18
- package/harmony/pushy/src/main/cpp/HDiffPatch/dirDiffPatch/dir_patch/dir_patch_types.h +4 -8
- package/harmony/pushy/src/main/cpp/HDiffPatch/dirDiffPatch/dir_patch/new_dir_output.c +57 -72
- package/harmony/pushy/src/main/cpp/HDiffPatch/dirDiffPatch/dir_patch/new_dir_output.h +13 -18
- package/harmony/pushy/src/main/cpp/HDiffPatch/dirDiffPatch/dir_patch/new_stream.c +1 -1
- package/harmony/pushy/src/main/cpp/HDiffPatch/dirDiffPatch/dir_patch/new_stream.h +2 -2
- package/harmony/pushy/src/main/cpp/HDiffPatch/dirDiffPatch/dir_patch/ref_stream.c +2 -2
- package/harmony/pushy/src/main/cpp/HDiffPatch/dirDiffPatch/dir_patch/ref_stream.h +2 -2
- package/harmony/pushy/src/main/cpp/HDiffPatch/dirDiffPatch/dir_patch/res_handle_limit.c +2 -2
- package/harmony/pushy/src/main/cpp/HDiffPatch/dirDiffPatch/dir_patch/res_handle_limit.h +1 -1
- package/harmony/pushy/src/main/cpp/HDiffPatch/file_for_patch.c +100 -311
- package/harmony/pushy/src/main/cpp/HDiffPatch/file_for_patch.h +72 -53
- package/harmony/pushy/src/main/cpp/HDiffPatch/hdiffz.cpp +487 -888
- package/harmony/pushy/src/main/cpp/HDiffPatch/hpatch_dir_listener.h +28 -45
- package/harmony/pushy/src/main/cpp/HDiffPatch/hpatchz.c +247 -812
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/diff.cpp +544 -1265
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/diff.h +38 -123
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/diff_types.h +0 -115
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/bytes_rle.cpp +102 -272
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/bytes_rle.h +12 -22
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/compress_detect.cpp +4 -18
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/compress_detect.h +5 -7
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/libdivsufsort/{divsufsort.cpp → divsufsort.c} +8 -5
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/libdivsufsort/divsufsort.c.inc.h +164 -91
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/libdivsufsort/divsufsort.h +102 -5
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/libdivsufsort/divsufsort64.c +13 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/libdivsufsort/divsufsort64.h +97 -1
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/libdivsufsort/divsufsort_private.h +44 -23
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/libdivsufsort/sssort.c.inc.h +89 -54
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/libdivsufsort/trsort.c.inc.h +55 -48
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/libdivsufsort/utils.c.inc.h +381 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/limit_mem_diff/adler_roll.c +47 -110
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/limit_mem_diff/adler_roll.h +4 -11
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/limit_mem_diff/bloom_filter.h +26 -53
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/limit_mem_diff/covers.h +25 -103
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/limit_mem_diff/digest_matcher.cpp +130 -271
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/limit_mem_diff/digest_matcher.h +7 -17
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/limit_mem_diff/stream_serialize.cpp +37 -628
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/limit_mem_diff/stream_serialize.h +43 -203
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/mem_buf.h +10 -14
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/pack_uint.h +7 -22
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/suffix_string.cpp +46 -132
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/suffix_string.h +9 -48
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HPatch/patch.c +299 -650
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HPatch/patch.h +82 -120
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HPatch/patch_private.h +7 -87
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HPatch/patch_types.h +9 -119
- package/harmony/pushy/src/main/cpp/HDiffPatch/libParallel/parallel_channel.cpp +6 -2
- package/harmony/pushy/src/main/cpp/HDiffPatch/libParallel/parallel_channel.h +15 -192
- package/harmony/pushy/src/main/cpp/HDiffPatch/libParallel/parallel_import.cpp +367 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/libParallel/parallel_import.h +56 -31
- package/harmony/pushy/src/main/cpp/HDiffPatch/test/_private_searchBestParams.cpp +1 -1
- package/harmony/pushy/src/main/cpp/HDiffPatch/test/hpatchz_test.cpp +1 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/test/testHashClash.cpp +31 -225
- package/harmony/pushy/src/main/cpp/HDiffPatch/test/unit_test.cpp +94 -566
- package/harmony/pushy/src/main/cpp/lzma/Asm/x86/7zAsm.asm +28 -222
- package/harmony/pushy/src/main/cpp/lzma/Asm/x86/7zCrcOpt.asm +117 -228
- package/harmony/pushy/src/main/cpp/lzma/Asm/x86/AesOpt.asm +173 -678
- package/harmony/pushy/src/main/cpp/lzma/Asm/x86/LzmaDecOpt.asm +22 -103
- package/harmony/pushy/src/main/cpp/lzma/Asm/x86/XzCrc64Opt.asm +167 -485
- package/harmony/pushy/src/main/cpp/lzma/C/7z.h +6 -8
- package/harmony/pushy/src/main/cpp/lzma/C/7zAlloc.c +30 -39
- package/harmony/pushy/src/main/cpp/lzma/C/7zAlloc.h +3 -3
- package/harmony/pushy/src/main/cpp/lzma/C/7zArcIn.c +217 -232
- package/harmony/pushy/src/main/cpp/lzma/C/7zBuf.h +3 -3
- package/harmony/pushy/src/main/cpp/lzma/C/7zCrc.c +68 -404
- package/harmony/pushy/src/main/cpp/lzma/C/7zCrc.h +6 -9
- package/harmony/pushy/src/main/cpp/lzma/C/7zCrcOpt.c +79 -163
- package/harmony/pushy/src/main/cpp/lzma/C/7zDec.c +78 -160
- package/harmony/pushy/src/main/cpp/lzma/C/7zFile.c +58 -215
- package/harmony/pushy/src/main/cpp/lzma/C/7zFile.h +6 -15
- package/harmony/pushy/src/main/cpp/lzma/C/7zStream.c +23 -46
- package/harmony/pushy/src/main/cpp/lzma/C/7zTypes.h +89 -311
- package/harmony/pushy/src/main/cpp/lzma/C/7zVersion.h +5 -5
- package/harmony/pushy/src/main/cpp/lzma/C/Aes.c +68 -191
- package/harmony/pushy/src/main/cpp/lzma/C/Aes.h +8 -30
- package/harmony/pushy/src/main/cpp/lzma/C/AesOpt.c +108 -926
- package/harmony/pushy/src/main/cpp/lzma/C/Alloc.c +96 -246
- package/harmony/pushy/src/main/cpp/lzma/C/Alloc.h +8 -33
- package/harmony/pushy/src/main/cpp/lzma/C/Bcj2.c +144 -177
- package/harmony/pushy/src/main/cpp/lzma/C/Bcj2.h +42 -228
- package/harmony/pushy/src/main/cpp/lzma/C/Bcj2Enc.c +182 -377
- package/harmony/pushy/src/main/cpp/lzma/C/Bra.c +143 -622
- package/harmony/pushy/src/main/cpp/lzma/C/Bra.h +40 -81
- package/harmony/pushy/src/main/cpp/lzma/C/Bra86.c +58 -163
- package/harmony/pushy/src/main/cpp/lzma/C/BraIA64.c +48 -9
- package/harmony/pushy/src/main/cpp/lzma/C/Compiler.h +15 -228
- package/harmony/pushy/src/main/cpp/lzma/C/CpuArch.c +133 -885
- package/harmony/pushy/src/main/cpp/lzma/C/CpuArch.h +78 -428
- package/harmony/pushy/src/main/cpp/lzma/C/Delta.c +31 -136
- package/harmony/pushy/src/main/cpp/lzma/C/Delta.h +3 -3
- package/harmony/pushy/src/main/cpp/lzma/C/DllSecur.c +62 -53
- package/harmony/pushy/src/main/cpp/lzma/C/DllSecur.h +5 -5
- package/harmony/pushy/src/main/cpp/lzma/C/LzFind.c +495 -1114
- package/harmony/pushy/src/main/cpp/lzma/C/LzFind.h +25 -64
- package/harmony/pushy/src/main/cpp/lzma/C/LzFindMt.c +400 -969
- package/harmony/pushy/src/main/cpp/lzma/C/LzFindMt.h +24 -37
- package/harmony/pushy/src/main/cpp/lzma/C/LzHash.h +48 -25
- package/harmony/pushy/src/main/cpp/lzma/C/Lzma2Dec.c +7 -12
- package/harmony/pushy/src/main/cpp/lzma/C/Lzma2Dec.h +7 -8
- package/harmony/pushy/src/main/cpp/lzma/C/Lzma2DecMt.c +83 -96
- package/harmony/pushy/src/main/cpp/lzma/C/Lzma2DecMt.h +9 -11
- package/harmony/pushy/src/main/cpp/lzma/C/Lzma2Enc.c +92 -96
- package/harmony/pushy/src/main/cpp/lzma/C/Lzma2Enc.h +9 -12
- package/harmony/pushy/src/main/cpp/lzma/C/Lzma86.h +3 -3
- package/harmony/pushy/src/main/cpp/lzma/C/Lzma86Dec.c +4 -3
- package/harmony/pushy/src/main/cpp/lzma/C/Lzma86Enc.c +6 -3
- package/harmony/pushy/src/main/cpp/lzma/C/LzmaDec.c +206 -384
- package/harmony/pushy/src/main/cpp/lzma/C/LzmaDec.h +8 -11
- package/harmony/pushy/src/main/cpp/lzma/C/LzmaEnc.c +315 -489
- package/harmony/pushy/src/main/cpp/lzma/C/LzmaEnc.h +9 -18
- package/harmony/pushy/src/main/cpp/lzma/C/LzmaLib.c +3 -5
- package/harmony/pushy/src/main/cpp/lzma/C/LzmaLib.h +14 -21
- package/harmony/pushy/src/main/cpp/lzma/C/MtCoder.c +87 -90
- package/harmony/pushy/src/main/cpp/lzma/C/MtCoder.h +25 -28
- package/harmony/pushy/src/main/cpp/lzma/C/MtDec.c +88 -74
- package/harmony/pushy/src/main/cpp/lzma/C/MtDec.h +20 -21
- package/harmony/pushy/src/main/cpp/lzma/C/Ppmd.h +34 -118
- package/harmony/pushy/src/main/cpp/lzma/C/Ppmd7.c +293 -712
- package/harmony/pushy/src/main/cpp/lzma/C/Ppmd7.h +70 -109
- package/harmony/pushy/src/main/cpp/lzma/C/Ppmd7Dec.c +116 -237
- package/harmony/pushy/src/main/cpp/lzma/C/Ppmd7Enc.c +95 -245
- package/harmony/pushy/src/main/cpp/lzma/C/Precomp.h +5 -122
- package/harmony/pushy/src/main/cpp/lzma/C/RotateDefs.h +4 -24
- package/harmony/pushy/src/main/cpp/lzma/C/Sha256.c +143 -387
- package/harmony/pushy/src/main/cpp/lzma/C/Sha256.h +7 -67
- package/harmony/pushy/src/main/cpp/lzma/C/Sort.c +114 -241
- package/harmony/pushy/src/main/cpp/lzma/C/Sort.h +7 -4
- package/harmony/pushy/src/main/cpp/lzma/C/Threads.c +14 -731
- package/harmony/pushy/src/main/cpp/lzma/C/Threads.h +14 -204
- package/harmony/pushy/src/main/cpp/lzma/C/ThreadsP.c +396 -0
- package/harmony/pushy/src/main/cpp/lzma/C/ThreadsP.h +31 -0
- package/harmony/pushy/src/main/cpp/lzma/C/Util/7z/7z.dsp +2 -10
- package/harmony/pushy/src/main/cpp/lzma/C/Util/7z/7zMain.c +79 -282
- package/harmony/pushy/src/main/cpp/lzma/C/Util/7z/Precomp.h +7 -10
- package/harmony/pushy/src/main/cpp/lzma/C/Util/7z/makefile +3 -7
- package/harmony/pushy/src/main/cpp/lzma/C/Util/7z/makefile.gcc +75 -32
- package/harmony/pushy/src/main/cpp/lzma/C/Util/Lzma/LzmaUtil.c +56 -111
- package/harmony/pushy/src/main/cpp/lzma/C/Util/Lzma/LzmaUtil.dsp +0 -24
- package/harmony/pushy/src/main/cpp/lzma/C/Util/Lzma/makefile +0 -2
- package/harmony/pushy/src/main/cpp/lzma/C/Util/Lzma/makefile.gcc +41 -18
- package/harmony/pushy/src/main/cpp/lzma/C/Util/LzmaLib/LzmaLib.dsp +2 -30
- package/harmony/pushy/src/main/cpp/lzma/C/Util/LzmaLib/LzmaLibExports.c +6 -7
- package/harmony/pushy/src/main/cpp/lzma/C/Util/LzmaLib/makefile +2 -27
- package/harmony/pushy/src/main/cpp/lzma/C/Util/SfxSetup/Precomp.h +7 -10
- package/harmony/pushy/src/main/cpp/lzma/C/Util/SfxSetup/SfxSetup.c +22 -39
- package/harmony/pushy/src/main/cpp/lzma/C/Util/SfxSetup/makefile +2 -9
- package/harmony/pushy/src/main/cpp/lzma/C/Util/SfxSetup/makefile_con +1 -3
- package/harmony/pushy/src/main/cpp/lzma/C/Xz.c +3 -5
- package/harmony/pushy/src/main/cpp/lzma/C/Xz.h +47 -129
- package/harmony/pushy/src/main/cpp/lzma/C/XzCrc64.c +43 -97
- package/harmony/pushy/src/main/cpp/lzma/C/XzCrc64.h +8 -8
- package/harmony/pushy/src/main/cpp/lzma/C/XzCrc64Opt.c +36 -228
- package/harmony/pushy/src/main/cpp/lzma/C/XzDec.c +295 -405
- package/harmony/pushy/src/main/cpp/lzma/C/XzEnc.c +139 -194
- package/harmony/pushy/src/main/cpp/lzma/C/XzEnc.h +11 -15
- package/harmony/pushy/src/main/cpp/lzma/C/XzIn.c +134 -200
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/7zip.mak +6 -6
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Aes.mak +1 -4
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zCompressionMode.h +13 -29
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zDecode.cpp +90 -120
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zDecode.h +6 -9
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zEncode.cpp +140 -183
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zEncode.h +20 -23
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zExtract.cpp +57 -78
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zFolderInStream.cpp +44 -169
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zFolderInStream.h +17 -57
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zHandler.cpp +109 -141
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zHandler.h +57 -54
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zHandlerOut.cpp +116 -336
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zHeader.cpp +1 -1
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zHeader.h +9 -17
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zIn.cpp +136 -234
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zIn.h +26 -35
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zItem.h +5 -10
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zOut.cpp +155 -280
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zOut.h +40 -51
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zProperties.cpp +59 -67
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zProperties.h +2 -6
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zRegister.cpp +2 -8
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zSpecStream.cpp +3 -12
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zSpecStream.h +9 -23
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zUpdate.cpp +387 -975
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zUpdate.h +16 -44
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/StdAfx.h +2 -5
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/Archive.def +0 -2
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/Archive2.def +0 -2
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/ArchiveExports.cpp +8 -15
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/Common/CoderMixer2.cpp +87 -106
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/Common/CoderMixer2.h +57 -57
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/Common/DummyOutStream.cpp +1 -1
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/Common/DummyOutStream.h +8 -6
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/Common/HandlerOut.cpp +43 -126
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/Common/HandlerOut.h +18 -77
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/Common/InStreamWithCRC.cpp +9 -20
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/Common/InStreamWithCRC.h +23 -20
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/Common/ItemNameUtils.cpp +9 -61
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/Common/ItemNameUtils.h +3 -8
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/Common/MultiStream.cpp +27 -29
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/Common/MultiStream.h +26 -23
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/Common/OutStreamWithCRC.cpp +2 -2
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/Common/OutStreamWithCRC.h +8 -6
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/Common/ParseProperties.h +2 -2
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/Common/StdAfx.h +2 -5
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/DllExports2.cpp +10 -63
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/IArchive.h +173 -319
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/LzmaHandler.cpp +113 -92
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/SplitHandler.cpp +53 -47
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/StdAfx.h +2 -5
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/XzHandler.cpp +208 -352
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/XzHandler.h +2 -2
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Asm.mak +3 -6
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/Alone7z/Alone.dsp +47 -227
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/Alone7z/StdAfx.h +2 -5
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/Alone7z/makefile +5 -19
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/Format7zExtractR/StdAfx.h +2 -5
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/Format7zExtractR/makefile +2 -4
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/Format7zR/StdAfx.h +2 -5
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/Format7zR/makefile +1 -6
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/LzmaCon/LzmaAlone.cpp +53 -71
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/LzmaCon/LzmaCon.dsp +22 -85
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/LzmaCon/StdAfx.h +2 -5
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/LzmaCon/makefile +4 -13
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/LzmaCon/makefile.gcc +166 -102
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXCon/SFXCon.dsp +4 -109
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXCon/SfxCon.cpp +30 -69
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXCon/StdAfx.h +2 -5
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXCon/makefile +7 -10
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXCon/resource.rc +1 -5
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXSetup/ExtractCallbackSfx.cpp +16 -16
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXSetup/ExtractCallbackSfx.h +12 -9
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXSetup/ExtractEngine.cpp +9 -7
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXSetup/ExtractEngine.h +2 -2
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXSetup/SFXSetup.dsp +5 -74
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXSetup/SfxSetup.cpp +51 -58
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXSetup/StdAfx.h +10 -3
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXSetup/makefile +5 -9
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXWin/SFXWin.dsp +6 -92
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXWin/SfxWin.cpp +19 -46
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXWin/StdAfx.h +11 -3
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXWin/makefile +5 -11
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXWin/resource.rc +0 -5
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/CWrappers.cpp +28 -136
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/CWrappers.h +5 -67
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/CreateCoder.cpp +62 -74
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/CreateCoder.h +24 -32
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/FilePathAutoRename.cpp +7 -7
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/FilePathAutoRename.h +2 -2
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/FileStreams.cpp +100 -548
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/FileStreams.h +86 -125
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/FilterCoder.cpp +116 -258
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/FilterCoder.h +76 -72
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/InBuffer.cpp +15 -34
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/InBuffer.h +9 -38
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/InOutTempBuffer.cpp +82 -192
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/InOutTempBuffer.h +28 -25
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/LimitedStreams.cpp +52 -78
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/LimitedStreams.h +83 -52
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/LockedStream.h +2 -2
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/MethodId.h +2 -2
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/MethodProps.cpp +67 -323
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/MethodProps.h +38 -123
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/OffsetStream.cpp +8 -6
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/OffsetStream.h +13 -9
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/OutBuffer.cpp +12 -12
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/OutBuffer.h +7 -74
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/ProgressUtils.cpp +5 -5
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/ProgressUtils.h +13 -11
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/PropId.cpp +1 -10
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/RegisterArc.h +14 -16
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/RegisterCodec.h +16 -16
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/StdAfx.h +2 -5
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/StreamBinder.cpp +50 -45
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/StreamBinder.h +21 -39
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/StreamObjects.cpp +42 -47
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/StreamObjects.h +53 -42
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/StreamUtils.cpp +4 -49
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/StreamUtils.h +2 -20
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/UniqBlocks.cpp +4 -4
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/UniqBlocks.h +5 -20
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/VirtThread.cpp +9 -8
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/VirtThread.h +5 -5
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/Bcj2Coder.cpp +355 -556
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/Bcj2Coder.h +59 -66
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/Bcj2Register.cpp +2 -2
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/BcjCoder.cpp +6 -6
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/BcjCoder.h +13 -19
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/BcjRegister.cpp +2 -2
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/BranchMisc.cpp +5 -88
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/BranchMisc.h +18 -42
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/BranchRegister.cpp +16 -33
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/ByteSwap.cpp +53 -52
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/CodecExports.cpp +30 -64
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/CopyCoder.cpp +22 -55
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/CopyCoder.h +26 -11
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/DeltaFilter.cpp +28 -26
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/Lzma2Decoder.cpp +28 -30
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/Lzma2Decoder.h +54 -45
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/Lzma2Encoder.cpp +12 -24
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/Lzma2Encoder.h +22 -10
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/Lzma2Register.cpp +1 -1
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/LzmaDecoder.cpp +26 -33
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/LzmaDecoder.h +51 -51
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/LzmaEncoder.cpp +40 -232
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/LzmaEncoder.h +14 -13
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/LzmaRegister.cpp +1 -1
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/PpmdDecoder.cpp +35 -84
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/PpmdDecoder.h +41 -42
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/PpmdEncoder.cpp +25 -66
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/PpmdEncoder.h +17 -8
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/PpmdRegister.cpp +1 -1
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/StdAfx.h +2 -5
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/XzDecoder.cpp +12 -13
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/XzDecoder.h +32 -26
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/XzEncoder.cpp +16 -14
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/XzEncoder.h +20 -9
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Crc.mak +1 -1
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Crc64.mak +1 -1
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Crypto/7zAes.cpp +32 -67
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Crypto/7zAes.h +18 -30
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Crypto/7zAesRegister.cpp +3 -3
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Crypto/MyAes.cpp +43 -208
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Crypto/MyAes.h +25 -90
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Crypto/MyAesReg.cpp +4 -17
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Crypto/RandGen.cpp +21 -29
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Crypto/RandGen.h +3 -4
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Crypto/StdAfx.h +2 -5
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/GuiCommon.rc +3 -38
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Guid.txt +3 -26
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/ICoder.h +172 -253
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/IDecl.h +7 -55
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/IPassword.h +12 -43
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/IProgress.h +9 -10
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/IStream.h +50 -133
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/LzmaDec.mak +2 -4
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/MyVersionInfo.rc +1 -1
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/PropID.h +2 -53
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Client7z/Client7z.cpp +177 -329
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Client7z/Client7z.dsp +1 -97
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Client7z/StdAfx.h +2 -5
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Client7z/makefile +1 -2
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/ArchiveCommandLine.cpp +183 -687
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/ArchiveCommandLine.h +15 -49
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/ArchiveExtractCallback.cpp +913 -2275
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/ArchiveExtractCallback.h +115 -353
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/ArchiveName.cpp +106 -127
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/ArchiveName.h +3 -9
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/ArchiveOpenCallback.cpp +35 -272
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/ArchiveOpenCallback.h +64 -134
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/Bench.cpp +1200 -2608
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/Bench.h +20 -64
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/DefaultName.cpp +1 -1
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/DefaultName.h +2 -2
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/DirItem.h +36 -253
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/EnumDirItems.cpp +233 -774
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/EnumDirItems.h +6 -2
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/ExitCode.h +2 -2
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/Extract.cpp +63 -156
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/Extract.h +10 -23
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/ExtractMode.h +2 -12
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/ExtractingFilePath.cpp +6 -22
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/ExtractingFilePath.h +4 -4
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/HashCalc.cpp +65 -1991
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/HashCalc.h +29 -241
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/IFileExtractCallback.h +47 -45
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/LoadCodecs.cpp +179 -442
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/LoadCodecs.h +89 -147
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/OpenArchive.cpp +380 -529
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/OpenArchive.h +42 -75
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/PropIDUtils.cpp +86 -163
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/PropIDUtils.h +5 -5
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/Property.h +2 -2
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/SetProperties.cpp +15 -23
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/SetProperties.h +2 -2
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/SortUtils.h +2 -2
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/StdAfx.h +2 -5
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/TempFiles.cpp +1 -2
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/TempFiles.h +2 -5
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/Update.cpp +368 -595
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/Update.h +47 -68
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/UpdateAction.h +2 -2
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/UpdateCallback.cpp +146 -444
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/UpdateCallback.h +68 -103
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/UpdatePair.cpp +42 -111
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/UpdatePair.h +2 -2
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/UpdateProduce.cpp +3 -7
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/UpdateProduce.h +6 -11
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/WorkDir.cpp +35 -25
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/WorkDir.h +4 -8
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/ZipRegistry.h +9 -91
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/BenchCon.cpp +4 -4
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/BenchCon.h +2 -2
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/Console.mak +1 -4
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/Console.manifest +0 -3
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/ConsoleClose.cpp +19 -48
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/ConsoleClose.h +12 -18
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/ExtractCallbackConsole.cpp +41 -162
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/ExtractCallbackConsole.h +41 -88
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/HashCon.cpp +81 -140
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/HashCon.h +17 -27
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/List.cpp +124 -182
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/List.h +7 -22
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/Main.cpp +109 -590
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/MainAr.cpp +2 -62
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/OpenCallbackConsole.cpp +3 -3
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/OpenCallbackConsole.h +10 -17
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/PercentPrinter.cpp +10 -13
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/PercentPrinter.h +9 -13
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/StdAfx.h +2 -5
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/UpdateCallbackConsole.cpp +24 -320
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/UpdateCallbackConsole.h +26 -50
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/UserInputUtils.cpp +5 -13
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/UserInputUtils.h +2 -2
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/makefile +2 -6
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Explorer/MyMessages.cpp +6 -12
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Explorer/MyMessages.h +4 -4
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/BrowseDialog.cpp +195 -302
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/BrowseDialog.h +4 -15
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/ComboDialog.cpp +2 -2
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/ComboDialog.h +6 -6
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/DialogSize.h +2 -2
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/ExtractCallback.cpp +181 -416
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/ExtractCallback.h +197 -216
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/FormatUtils.h +2 -2
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/LangUtils.h +5 -13
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/MyWindowsNew.h +5 -48
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/OverwriteDialog.cpp +49 -215
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/OverwriteDialog.h +30 -50
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/OverwriteDialog.rc +1 -3
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/OverwriteDialogRes.h +3 -5
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/PasswordDialog.cpp +5 -5
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/PasswordDialog.h +6 -6
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/PasswordDialog.rc +0 -4
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/ProgressDialog.cpp +10 -15
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/ProgressDialog.h +17 -18
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/ProgressDialog2.cpp +130 -276
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/ProgressDialog2.h +52 -56
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/ProgressDialog2Res.h +1 -2
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/ProgressDialog2a.rc +3 -8
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/PropertyName.h +2 -2
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/PropertyNameRes.h +0 -9
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/SysIconUtils.cpp +89 -185
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/SysIconUtils.h +20 -23
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/resource.h +1 -23
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/resourceGui.h +0 -10
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/GUI/Extract.rc +4 -4
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/GUI/ExtractDialog.cpp +33 -36
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/GUI/ExtractDialog.h +15 -15
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/GUI/ExtractGUI.cpp +22 -39
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/GUI/ExtractGUI.h +3 -4
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/GUI/HashGUI.h +2 -2
- package/harmony/pushy/src/main/cpp/lzma/CPP/Build.mak +13 -109
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/AutoPtr.h +14 -25
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/CRC.cpp +1 -1
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/C_FileIO.cpp +90 -1
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/C_FileIO.h +49 -2
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/ComTry.h +2 -2
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/CommandLineParser.cpp +7 -41
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/CommandLineParser.h +3 -3
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/Common.h +29 -14
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/CrcReg.cpp +45 -24
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/Defs.h +2 -3
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/DynamicBuffer.h +5 -17
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/IntToString.cpp +110 -132
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/IntToString.h +9 -35
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/Lang.h +5 -12
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/ListFileUtils.cpp +31 -49
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/ListFileUtils.h +4 -4
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/MyBuffer.h +21 -59
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/MyBuffer2.h +10 -95
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/MyCom.h +81 -497
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/MyException.h +2 -2
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/MyGuidDef.h +9 -18
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/MyInitGuid.h +5 -17
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/MyLinux.h +2 -35
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/MyString.cpp +164 -347
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/MyString.h +35 -246
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/MyTypes.h +8 -11
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/MyUnknown.h +11 -2
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/MyVector.h +94 -184
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/MyWindows.cpp +11 -158
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/MyWindows.h +54 -148
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/NewHandler.cpp +27 -204
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/NewHandler.h +5 -38
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/Sha256Reg.cpp +16 -43
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/StdAfx.h +2 -2
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/StdInStream.cpp +11 -20
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/StdInStream.h +5 -13
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/StdOutStream.cpp +39 -124
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/StdOutStream.h +11 -27
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/StringConvert.cpp +15 -458
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/StringConvert.h +2 -24
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/StringToInt.cpp +89 -99
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/StringToInt.h +2 -19
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/TextConfig.cpp +11 -10
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/TextConfig.h +2 -2
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/UTFConvert.cpp +102 -677
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/UTFConvert.h +5 -377
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/Wildcard.cpp +84 -197
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/Wildcard.h +25 -107
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/XzCrc64Reg.cpp +14 -11
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/COM.h +8 -24
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/CommonDialog.cpp +113 -197
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/CommonDialog.h +12 -32
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Control/ComboBox.cpp +4 -4
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Control/ComboBox.h +10 -22
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Control/CommandBar.h +6 -6
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Control/Dialog.cpp +47 -242
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Control/Dialog.h +51 -94
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Control/Edit.h +2 -2
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Control/ImageList.h +4 -4
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Control/ListView.cpp +26 -33
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Control/ListView.h +22 -32
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Control/ProgressBar.h +13 -13
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Control/PropertyPage.cpp +34 -56
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Control/PropertyPage.h +9 -9
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Control/ReBar.h +3 -3
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Control/Static.h +2 -2
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Control/StatusBar.h +5 -5
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Control/StdAfx.h +2 -5
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Control/ToolBar.h +3 -3
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Control/Trackbar.h +2 -2
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Control/Window2.cpp +6 -8
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Control/Window2.h +7 -9
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/DLL.cpp +8 -77
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/DLL.h +10 -55
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Defs.h +4 -4
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/ErrorMsg.cpp +2 -69
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/ErrorMsg.h +2 -3
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/FileDir.cpp +80 -728
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/FileDir.h +7 -62
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/FileFind.cpp +56 -756
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/FileFind.h +19 -205
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/FileIO.cpp +47 -569
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/FileIO.h +28 -283
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/FileLink.cpp +112 -369
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/FileMapping.h +3 -3
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/FileName.cpp +113 -185
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/FileName.h +14 -41
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/FileSystem.cpp +10 -66
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/FileSystem.h +2 -6
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Handle.h +4 -6
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/MemoryLock.cpp +14 -29
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/MemoryLock.h +2 -2
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/NtCheck.h +2 -14
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/PropVariant.cpp +56 -102
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/PropVariant.h +9 -68
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/PropVariantConv.cpp +14 -150
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/PropVariantConv.h +3 -13
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Registry.cpp +128 -212
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Registry.h +20 -32
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/ResourceString.cpp +4 -4
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/ResourceString.h +2 -3
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/SecurityUtils.cpp +18 -23
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/SecurityUtils.h +56 -39
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Shell.cpp +58 -539
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Shell.h +14 -49
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/StdAfx.h +2 -5
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Synchronization.cpp +0 -77
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Synchronization.h +18 -240
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/System.cpp +38 -317
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/System.h +5 -154
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Thread.h +10 -18
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/TimeUtils.cpp +37 -291
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/TimeUtils.h +10 -124
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Window.cpp +7 -7
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Window.h +19 -98
- package/harmony/pushy/src/main/cpp/lzma/CS/7zip/Compress/LzmaAlone/LzmaAlone.csproj +90 -0
- package/harmony/pushy/src/main/cpp/lzma/DOC/Methods.txt +2 -6
- package/harmony/pushy/src/main/cpp/lzma/DOC/lzma-history.txt +0 -205
- package/harmony/pushy/src/main/cpp/lzma/DOC/lzma-sdk.txt +13 -93
- package/harmony/pushy/src/main/cpp/lzma/DOC/lzma.txt +13 -30
- package/harmony/pushy/src/main/cpp/lzma/bin/7zS2.sfx +0 -0
- package/harmony/pushy/src/main/cpp/lzma/bin/7zS2con.sfx +0 -0
- package/harmony/pushy/src/main/cpp/lzma/bin/7zSD.sfx +0 -0
- package/harmony/pushy/src/main/cpp/lzma/bin/7zdec.exe +0 -0
- package/harmony/pushy/src/main/cpp/lzma/bin/7zr.exe +0 -0
- package/harmony/pushy/src/main/cpp/lzma/bin/lzma.exe +0 -0
- package/harmony/pushy/src/main/cpp/lzma/bin/x64/7zr.exe +0 -0
- package/package.json +1 -1
- package/react-native-update.podspec +0 -1
- package/react-native.config.js +1 -0
- package/src/client.ts +1 -2
- package/src/type.ts +1 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/README_cn.md +0 -547
- package/harmony/pushy/src/main/cpp/HDiffPatch/_hextobytes.h +0 -112
- package/harmony/pushy/src/main/cpp/HDiffPatch/bsdiff_wrapper/bsdiff_wrapper.cpp +0 -389
- package/harmony/pushy/src/main/cpp/HDiffPatch/bsdiff_wrapper/bsdiff_wrapper.h +0 -73
- package/harmony/pushy/src/main/cpp/HDiffPatch/bsdiff_wrapper/bspatch_wrapper.c +0 -266
- package/harmony/pushy/src/main/cpp/HDiffPatch/bsdiff_wrapper/bspatch_wrapper.h +0 -58
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/android_ndk_jni_mk/build_libs_patchers.bat +0 -1
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/android_ndk_jni_mk/build_libs_patchers.sh +0 -1
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/vc/bzip2.vcxproj +0 -228
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/vc/hpatchz_test.vcxproj +0 -215
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/vc/libdeflate.vcxproj +0 -256
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/vc/longPathAware.exe.manifest +0 -7
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/vc/lzma.vcxproj +0 -271
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/vc/testHashClash.vcxproj +0 -228
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/vc/zlib.vcxproj +0 -242
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/vc/zstd.vcxproj +0 -287
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/xcode/HDiffPatch.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings +0 -8
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/xcode/libdeflate.xcodeproj/project.pbxproj +0 -286
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/xcode/zlib.xcodeproj/project.pbxproj +0 -308
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/xcode_iOS_hpatchz/hpatch_objc/hpatch_objc.h +0 -33
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/xcode_iOS_hpatchz/hpatch_objc/hpatch_objc.m +0 -33
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/xcode_iOS_hpatchz/hpatchz.xcodeproj/project.pbxproj +0 -774
- package/harmony/pushy/src/main/cpp/HDiffPatch/hdiffz_import_patch.c +0 -31
- package/harmony/pushy/src/main/cpp/HDiffPatch/hdiffz_import_patch.h +0 -42
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/diff_for_hpatch_lite.h +0 -74
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/match_block.cpp +0 -478
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/match_block.h +0 -222
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/libdivsufsort/divsufsort64.cpp +0 -14
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/match_inplace.cpp +0 -168
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/match_inplace.h +0 -44
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/qsort_parallel.h +0 -125
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HPatch/hpatch_mt/_hcache_old_mt.c +0 -243
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HPatch/hpatch_mt/_hcache_old_mt.h +0 -51
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HPatch/hpatch_mt/_hinput_mt.c +0 -153
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HPatch/hpatch_mt/_hinput_mt.h +0 -54
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HPatch/hpatch_mt/_houtput_mt.c +0 -158
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HPatch/hpatch_mt/_houtput_mt.h +0 -49
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HPatch/hpatch_mt/_hpatch_mt.c +0 -294
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HPatch/hpatch_mt/_hpatch_mt.h +0 -59
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HPatch/hpatch_mt/_patch_private_mt.h +0 -217
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HPatch/hpatch_mt/hpatch_mt.c +0 -349
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HPatch/hpatch_mt/hpatch_mt.h +0 -110
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HPatchLite/hpatch_lite.c +0 -366
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HPatchLite/hpatch_lite.h +0 -91
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HPatchLite/hpatch_lite_input_cache.h +0 -31
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HPatchLite/hpatch_lite_types.h +0 -106
- package/harmony/pushy/src/main/cpp/HDiffPatch/libParallel/parallel_import_c.c +0 -497
- package/harmony/pushy/src/main/cpp/HDiffPatch/libParallel/parallel_import_c.h +0 -106
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sign_diff/_match_in_old_sign.cpp +0 -254
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sign_diff/_match_in_old_sign.h +0 -39
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sign_diff/_sign_diff_type.h +0 -37
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sign_diff/sign_diff.cpp +0 -62
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sign_diff/sign_diff.h +0 -44
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_client/dict_decompress_plugin.h +0 -156
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_client/dir_sync_client.cpp +0 -440
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_client/dir_sync_client.h +0 -88
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_client/match_in_old.cpp +0 -332
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_client/match_in_old.h +0 -48
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_client/match_in_types.h +0 -198
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_client/sync_client.cpp +0 -697
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_client/sync_client.h +0 -74
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_client/sync_client_private.h +0 -262
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_client/sync_client_type.h +0 -174
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_client/sync_client_type_private.h +0 -174
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_client/sync_diff_data.cpp +0 -252
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_client/sync_diff_data.h +0 -67
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_client/sync_info_client.cpp +0 -680
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_client/sync_info_client.h +0 -137
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_make/dict_compress_plugin.h +0 -83
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_make/dir_sync_make.cpp +0 -125
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_make/dir_sync_make.h +0 -56
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_make/hsynz_plugin.h +0 -55
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_make/match_in_new.cpp +0 -147
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_make/match_in_new.h +0 -38
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_make/sync_info_make.cpp +0 -354
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_make/sync_info_make.h +0 -76
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_make/sync_make.cpp +0 -521
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_make/sync_make.h +0 -69
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_make/sync_make_hash_clash.h +0 -122
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_make/sync_make_private.h +0 -66
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/zsync_client_wrapper/zsync_client_type.h +0 -36
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/zsync_client_wrapper/zsync_client_type_private.h +0 -81
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/zsync_client_wrapper/zsync_client_wrapper.cpp +0 -247
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/zsync_client_wrapper/zsync_client_wrapper.h +0 -71
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/zsync_client_wrapper/zsync_info_client.cpp +0 -351
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/zsync_client_wrapper/zsync_info_client.h +0 -42
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/zsync_client_wrapper/zsync_match_in_old.cpp +0 -124
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/zsync_client_wrapper/zsync_match_in_old.h +0 -38
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/zsync_make_wrapper/zsync_info_make.cpp +0 -203
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/zsync_make_wrapper/zsync_info_make.h +0 -55
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/zsync_make_wrapper/zsync_make_wrapper.cpp +0 -79
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/zsync_make_wrapper/zsync_make_wrapper.h +0 -66
- package/harmony/pushy/src/main/cpp/HDiffPatch/vcdiff_wrapper/vcdiff_wrapper.cpp +0 -628
- package/harmony/pushy/src/main/cpp/HDiffPatch/vcdiff_wrapper/vcdiff_wrapper.h +0 -95
- package/harmony/pushy/src/main/cpp/HDiffPatch/vcdiff_wrapper/vcpatch_code_table.h +0 -78
- package/harmony/pushy/src/main/cpp/HDiffPatch/vcdiff_wrapper/vcpatch_wrapper.c +0 -950
- package/harmony/pushy/src/main/cpp/HDiffPatch/vcdiff_wrapper/vcpatch_wrapper.h +0 -72
- package/harmony/pushy/src/main/cpp/lzma/Asm/arm64/7zAsm.S +0 -181
- package/harmony/pushy/src/main/cpp/lzma/Asm/arm64/LzmaDecOpt.S +0 -1487
- package/harmony/pushy/src/main/cpp/lzma/Asm/x86/LzFindOpt.asm +0 -540
- package/harmony/pushy/src/main/cpp/lzma/Asm/x86/Sha256Opt.asm +0 -275
- package/harmony/pushy/src/main/cpp/lzma/Asm/x86/Sort.asm +0 -860
- package/harmony/pushy/src/main/cpp/lzma/C/7zWindows.h +0 -101
- package/harmony/pushy/src/main/cpp/lzma/C/7zip_gcc_c.mak +0 -360
- package/harmony/pushy/src/main/cpp/lzma/C/Asm_c.mak +0 -12
- package/harmony/pushy/src/main/cpp/lzma/C/LzFindOpt.c +0 -578
- package/harmony/pushy/src/main/cpp/lzma/C/Sha256Opt.c +0 -451
- package/harmony/pushy/src/main/cpp/lzma/C/SwapBytes.c +0 -835
- package/harmony/pushy/src/main/cpp/lzma/C/SwapBytes.h +0 -17
- package/harmony/pushy/src/main/cpp/lzma/C/Util/Lzma/Precomp.h +0 -13
- package/harmony/pushy/src/main/cpp/lzma/C/Util/LzmaLib/Precomp.c +0 -4
- package/harmony/pushy/src/main/cpp/lzma/C/Util/LzmaLib/Precomp.h +0 -13
- package/harmony/pushy/src/main/cpp/lzma/C/var_clang.mak +0 -11
- package/harmony/pushy/src/main/cpp/lzma/C/var_clang_arm64.mak +0 -12
- package/harmony/pushy/src/main/cpp/lzma/C/var_clang_x64.mak +0 -11
- package/harmony/pushy/src/main/cpp/lzma/C/var_clang_x86.mak +0 -11
- package/harmony/pushy/src/main/cpp/lzma/C/var_gcc.mak +0 -12
- package/harmony/pushy/src/main/cpp/lzma/C/var_gcc_arm64.mak +0 -12
- package/harmony/pushy/src/main/cpp/lzma/C/var_gcc_x64.mak +0 -10
- package/harmony/pushy/src/main/cpp/lzma/C/var_gcc_x86.mak +0 -10
- package/harmony/pushy/src/main/cpp/lzma/C/var_mac_arm64.mak +0 -11
- package/harmony/pushy/src/main/cpp/lzma/C/var_mac_x64.mak +0 -11
- package/harmony/pushy/src/main/cpp/lzma/C/warn_clang.mak +0 -1
- package/harmony/pushy/src/main/cpp/lzma/C/warn_clang_mac.mak +0 -1
- package/harmony/pushy/src/main/cpp/lzma/C/warn_gcc.mak +0 -51
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/7zip_gcc.mak +0 -1370
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/Alone7z/makefile.gcc +0 -279
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXCon/makefile.gcc +0 -215
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/MultiOutStream.cpp +0 -855
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/MultiOutStream.h +0 -160
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/LzFindOpt.mak +0 -7
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/LzmaDec_gcc.mak +0 -14
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Sha256.mak +0 -13
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Sort.mak +0 -6
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Client7z/makefile.gcc +0 -72
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/makefile.gcc +0 -187
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/MemDialog.cpp +0 -218
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/MemDialog.h +0 -48
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/MemDialogRes.h +0 -13
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/StdAfx.h +0 -67
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/GUI/7zG.exe.manifest +0 -23
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/cmpl_clang.mak +0 -3
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/cmpl_clang_arm64.mak +0 -3
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/cmpl_clang_x64.mak +0 -3
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/cmpl_clang_x86.mak +0 -3
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/cmpl_gcc.mak +0 -3
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/cmpl_gcc_arm64.mak +0 -3
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/cmpl_gcc_x64.mak +0 -3
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/cmpl_gcc_x86.mak +0 -3
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/cmpl_mac_arm64.mak +0 -3
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/cmpl_mac_x64.mak +0 -3
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/var_clang.mak +0 -11
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/var_clang_arm64.mak +0 -19
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/var_clang_x64.mak +0 -11
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/var_clang_x86.mak +0 -11
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/var_gcc.mak +0 -12
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/var_gcc_arm64.mak +0 -12
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/var_gcc_x64.mak +0 -11
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/var_gcc_x86.mak +0 -10
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/var_mac_arm64.mak +0 -13
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/var_mac_x64.mak +0 -11
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/warn_clang.mak +0 -3
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/warn_clang_mac.mak +0 -9
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/warn_gcc.mak +0 -55
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/Common0.h +0 -330
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/DynLimBuf.cpp +0 -93
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/DynLimBuf.h +0 -41
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/LzFindPrepare.cpp +0 -7
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/Sha256Prepare.cpp +0 -7
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Clipboard.cpp +0 -130
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Clipboard.h +0 -28
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/MemoryGlobal.cpp +0 -36
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/MemoryGlobal.h +0 -55
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/SystemInfo.cpp +0 -1251
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/SystemInfo.h +0 -19
- package/ios/ImportReact.h +0 -2
|
@@ -3,41 +3,29 @@
|
|
|
3
3
|
#include "StdAfx.h"
|
|
4
4
|
|
|
5
5
|
#include "../../../../C/Alloc.h"
|
|
6
|
-
#include "../../../../C/CpuArch.h"
|
|
7
6
|
|
|
8
|
-
#include "../../../Common/DynLimBuf.h"
|
|
9
|
-
#include "../../../Common/IntToString.h"
|
|
10
7
|
#include "../../../Common/StringToInt.h"
|
|
11
8
|
|
|
12
9
|
#include "../../Common/FileStreams.h"
|
|
13
|
-
#include "../../Common/ProgressUtils.h"
|
|
14
|
-
#include "../../Common/StreamObjects.h"
|
|
15
10
|
#include "../../Common/StreamUtils.h"
|
|
16
11
|
|
|
17
|
-
#include "../../Archive/Common/ItemNameUtils.h"
|
|
18
|
-
#include "../../Archive/IArchive.h"
|
|
19
|
-
|
|
20
12
|
#include "EnumDirItems.h"
|
|
21
13
|
#include "HashCalc.h"
|
|
22
14
|
|
|
23
15
|
using namespace NWindows;
|
|
24
16
|
|
|
25
|
-
#ifdef Z7_EXTERNAL_CODECS
|
|
26
|
-
extern const CExternalCodecs *g_ExternalCodecs_Ptr;
|
|
27
|
-
#endif
|
|
28
|
-
|
|
29
17
|
class CHashMidBuf
|
|
30
18
|
{
|
|
31
19
|
void *_data;
|
|
32
20
|
public:
|
|
33
|
-
CHashMidBuf(): _data(
|
|
21
|
+
CHashMidBuf(): _data(0) {}
|
|
34
22
|
operator void *() { return _data; }
|
|
35
23
|
bool Alloc(size_t size)
|
|
36
24
|
{
|
|
37
|
-
if (_data)
|
|
25
|
+
if (_data != 0)
|
|
38
26
|
return false;
|
|
39
27
|
_data = ::MidAlloc(size);
|
|
40
|
-
return _data !=
|
|
28
|
+
return _data != 0;
|
|
41
29
|
}
|
|
42
30
|
~CHashMidBuf() { ::MidFree(_data); }
|
|
43
31
|
};
|
|
@@ -57,12 +45,12 @@ HRESULT CHashBundle::SetMethods(DECL_EXTERNAL_CODECS_LOC_VARS const UStringVecto
|
|
|
57
45
|
for (i = 0; i < names.Size(); i++)
|
|
58
46
|
{
|
|
59
47
|
COneMethodInfo m;
|
|
60
|
-
RINOK(m.ParseMethodFromString(names[i]))
|
|
48
|
+
RINOK(m.ParseMethodFromString(names[i]));
|
|
61
49
|
|
|
62
50
|
if (m.MethodName.IsEmpty())
|
|
63
51
|
m.MethodName = k_DefaultHashMethod;
|
|
64
52
|
|
|
65
|
-
if (m.MethodName
|
|
53
|
+
if (m.MethodName == "*")
|
|
66
54
|
{
|
|
67
55
|
CRecordVector<CMethodId> tempMethods;
|
|
68
56
|
GetHashMethods(EXTERNAL_CODECS_LOC_VARS tempMethods);
|
|
@@ -92,7 +80,7 @@ HRESULT CHashBundle::SetMethods(DECL_EXTERNAL_CODECS_LOC_VARS const UStringVecto
|
|
|
92
80
|
{
|
|
93
81
|
CMyComPtr<IHasher> hasher;
|
|
94
82
|
AString name;
|
|
95
|
-
RINOK(CreateHasher(EXTERNAL_CODECS_LOC_VARS ids[i], name, hasher))
|
|
83
|
+
RINOK(CreateHasher(EXTERNAL_CODECS_LOC_VARS ids[i], name, hasher));
|
|
96
84
|
if (!hasher)
|
|
97
85
|
throw "Can't create hasher";
|
|
98
86
|
const COneMethodInfo &m = methods[i];
|
|
@@ -100,17 +88,17 @@ HRESULT CHashBundle::SetMethods(DECL_EXTERNAL_CODECS_LOC_VARS const UStringVecto
|
|
|
100
88
|
CMyComPtr<ICompressSetCoderProperties> scp;
|
|
101
89
|
hasher.QueryInterface(IID_ICompressSetCoderProperties, &scp);
|
|
102
90
|
if (scp)
|
|
103
|
-
RINOK(m.SetCoderProps(scp, NULL))
|
|
91
|
+
RINOK(m.SetCoderProps(scp, NULL));
|
|
104
92
|
}
|
|
105
|
-
|
|
93
|
+
UInt32 digestSize = hasher->GetDigestSize();
|
|
106
94
|
if (digestSize > k_HashCalc_DigestSize_Max)
|
|
107
95
|
return E_NOTIMPL;
|
|
108
96
|
CHasherState &h = Hashers.AddNew();
|
|
109
|
-
h.DigestSize = digestSize;
|
|
110
97
|
h.Hasher = hasher;
|
|
111
98
|
h.Name = name;
|
|
99
|
+
h.DigestSize = digestSize;
|
|
112
100
|
for (unsigned k = 0; k < k_HashCalc_NumGroups; k++)
|
|
113
|
-
h.
|
|
101
|
+
memset(h.Digests[k], 0, digestSize);
|
|
114
102
|
}
|
|
115
103
|
|
|
116
104
|
return S_OK;
|
|
@@ -123,7 +111,7 @@ void CHashBundle::InitForNewFile()
|
|
|
123
111
|
{
|
|
124
112
|
CHasherState &h = Hashers[i];
|
|
125
113
|
h.Hasher->Init();
|
|
126
|
-
h.
|
|
114
|
+
memset(h.Digests[k_HashCalc_Index_Current], 0, h.DigestSize);
|
|
127
115
|
}
|
|
128
116
|
}
|
|
129
117
|
|
|
@@ -142,46 +130,14 @@ void CHashBundle::SetSize(UInt64 size)
|
|
|
142
130
|
static void AddDigests(Byte *dest, const Byte *src, UInt32 size)
|
|
143
131
|
{
|
|
144
132
|
unsigned next = 0;
|
|
145
|
-
|
|
146
|
-
// we could use big-endian addition for sha-1 and sha-256
|
|
147
|
-
// but another hashers are little-endian
|
|
148
|
-
if (size > 8)
|
|
149
|
-
{
|
|
150
|
-
for (unsigned i = size; i != 0;)
|
|
151
|
-
{
|
|
152
|
-
i--;
|
|
153
|
-
next += (unsigned)dest[i] + (unsigned)src[i];
|
|
154
|
-
dest[i] = (Byte)next;
|
|
155
|
-
next >>= 8;
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
else
|
|
159
|
-
*/
|
|
160
|
-
{
|
|
161
|
-
for (unsigned i = 0; i < size; i++)
|
|
162
|
-
{
|
|
163
|
-
next += (unsigned)dest[i] + (unsigned)src[i];
|
|
164
|
-
dest[i] = (Byte)next;
|
|
165
|
-
next >>= 8;
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
// we use little-endian to store extra bytes
|
|
170
|
-
dest += k_HashCalc_DigestSize_Max;
|
|
171
|
-
for (unsigned i = 0; i < k_HashCalc_ExtraSize; i++)
|
|
133
|
+
for (UInt32 i = 0; i < size; i++)
|
|
172
134
|
{
|
|
173
|
-
next += (unsigned)dest[i];
|
|
135
|
+
next += (unsigned)dest[i] + (unsigned)src[i];
|
|
174
136
|
dest[i] = (Byte)next;
|
|
175
137
|
next >>= 8;
|
|
176
138
|
}
|
|
177
139
|
}
|
|
178
140
|
|
|
179
|
-
void CHasherState::AddDigest(unsigned groupIndex, const Byte *data)
|
|
180
|
-
{
|
|
181
|
-
NumSums[groupIndex]++;
|
|
182
|
-
AddDigests(Digests[groupIndex], data, DigestSize);
|
|
183
|
-
}
|
|
184
|
-
|
|
185
141
|
void CHashBundle::Final(bool isDir, bool isAltStream, const UString &path)
|
|
186
142
|
{
|
|
187
143
|
if (isDir)
|
|
@@ -207,9 +163,9 @@ void CHashBundle::Final(bool isDir, bool isAltStream, const UString &path)
|
|
|
207
163
|
CHasherState &h = Hashers[i];
|
|
208
164
|
if (!isDir)
|
|
209
165
|
{
|
|
210
|
-
h.Hasher->Final(h.Digests[0]);
|
|
166
|
+
h.Hasher->Final(h.Digests[0]);
|
|
211
167
|
if (!isAltStream)
|
|
212
|
-
h.
|
|
168
|
+
AddDigests(h.Digests[k_HashCalc_Index_DataSum], h.Digests[0], h.DigestSize);
|
|
213
169
|
}
|
|
214
170
|
|
|
215
171
|
h.Hasher->Init();
|
|
@@ -219,15 +175,6 @@ void CHashBundle::Final(bool isDir, bool isAltStream, const UString &path)
|
|
|
219
175
|
for (unsigned k = 0; k < path.Len(); k++)
|
|
220
176
|
{
|
|
221
177
|
wchar_t c = path[k];
|
|
222
|
-
|
|
223
|
-
// 21.04: we want same hash for linux and windows paths
|
|
224
|
-
#if CHAR_PATH_SEPARATOR != '/'
|
|
225
|
-
if (c == CHAR_PATH_SEPARATOR)
|
|
226
|
-
c = '/';
|
|
227
|
-
// if (c == (wchar_t)('\\' + 0xf000)) c = '\\'; // to debug WSL
|
|
228
|
-
// if (c > 0xf000 && c < 0xf080) c -= 0xf000; // to debug WSL
|
|
229
|
-
#endif
|
|
230
|
-
|
|
231
178
|
Byte temp[2] = { (Byte)(c & 0xFF), (Byte)((c >> 8) & 0xFF) };
|
|
232
179
|
h.Hasher->Update(temp, 2);
|
|
233
180
|
}
|
|
@@ -235,231 +182,9 @@ void CHashBundle::Final(bool isDir, bool isAltStream, const UString &path)
|
|
|
235
182
|
Byte tempDigest[k_HashCalc_DigestSize_Max];
|
|
236
183
|
h.Hasher->Final(tempDigest);
|
|
237
184
|
if (!isAltStream)
|
|
238
|
-
h.
|
|
239
|
-
h.
|
|
240
|
-
}
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
static void CSum_Name_OriginalToEscape(const AString &src, AString &dest)
|
|
245
|
-
{
|
|
246
|
-
dest.Empty();
|
|
247
|
-
for (unsigned i = 0; i < src.Len();)
|
|
248
|
-
{
|
|
249
|
-
char c = src[i++];
|
|
250
|
-
if (c == '\n')
|
|
251
|
-
{
|
|
252
|
-
dest.Add_Char('\\');
|
|
253
|
-
c = 'n';
|
|
254
|
-
}
|
|
255
|
-
else if (c == '\\')
|
|
256
|
-
dest.Add_Char('\\');
|
|
257
|
-
dest.Add_Char(c);
|
|
258
|
-
}
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
static bool CSum_Name_EscapeToOriginal(const char *s, AString &dest)
|
|
263
|
-
{
|
|
264
|
-
bool isOK = true;
|
|
265
|
-
dest.Empty();
|
|
266
|
-
for (;;)
|
|
267
|
-
{
|
|
268
|
-
char c = *s++;
|
|
269
|
-
if (c == 0)
|
|
270
|
-
break;
|
|
271
|
-
if (c == '\\')
|
|
272
|
-
{
|
|
273
|
-
const char c1 = *s;
|
|
274
|
-
if (c1 == 'n')
|
|
275
|
-
{
|
|
276
|
-
c = '\n';
|
|
277
|
-
s++;
|
|
278
|
-
}
|
|
279
|
-
else if (c1 == '\\')
|
|
280
|
-
{
|
|
281
|
-
c = c1;
|
|
282
|
-
s++;
|
|
283
|
-
}
|
|
284
|
-
else
|
|
285
|
-
{
|
|
286
|
-
// original md5sum returns NULL for such bad strings
|
|
287
|
-
isOK = false;
|
|
288
|
-
}
|
|
289
|
-
}
|
|
290
|
-
dest.Add_Char(c);
|
|
291
|
-
}
|
|
292
|
-
return isOK;
|
|
293
|
-
}
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
static void SetSpacesAndNul(char *s, unsigned num)
|
|
298
|
-
{
|
|
299
|
-
for (unsigned i = 0; i < num; i++)
|
|
300
|
-
s[i] = ' ';
|
|
301
|
-
s[num] = 0;
|
|
302
|
-
}
|
|
303
|
-
|
|
304
|
-
static const unsigned kHashColumnWidth_Min = 4 * 2;
|
|
305
|
-
|
|
306
|
-
static unsigned GetColumnWidth(unsigned digestSize)
|
|
307
|
-
{
|
|
308
|
-
const unsigned width = digestSize * 2;
|
|
309
|
-
return width < kHashColumnWidth_Min ? kHashColumnWidth_Min: width;
|
|
310
|
-
}
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
static void AddHashResultLine(
|
|
314
|
-
AString &_s,
|
|
315
|
-
// bool showHash,
|
|
316
|
-
// UInt64 fileSize, bool showSize,
|
|
317
|
-
const CObjectVector<CHasherState> &hashers
|
|
318
|
-
// unsigned digestIndex, = k_HashCalc_Index_Current
|
|
319
|
-
)
|
|
320
|
-
{
|
|
321
|
-
FOR_VECTOR (i, hashers)
|
|
322
|
-
{
|
|
323
|
-
const CHasherState &h = hashers[i];
|
|
324
|
-
char s[k_HashCalc_DigestSize_Max * 2 + 64];
|
|
325
|
-
s[0] = 0;
|
|
326
|
-
// if (showHash)
|
|
327
|
-
HashHexToString(s, h.Digests[k_HashCalc_Index_Current], h.DigestSize);
|
|
328
|
-
const unsigned pos = (unsigned)strlen(s);
|
|
329
|
-
const int numSpaces = (int)GetColumnWidth(h.DigestSize) - (int)pos;
|
|
330
|
-
if (numSpaces > 0)
|
|
331
|
-
SetSpacesAndNul(s + pos, (unsigned)numSpaces);
|
|
332
|
-
if (i != 0)
|
|
333
|
-
_s.Add_Space();
|
|
334
|
-
_s += s;
|
|
335
|
-
}
|
|
336
|
-
|
|
337
|
-
/*
|
|
338
|
-
if (showSize)
|
|
339
|
-
{
|
|
340
|
-
_s.Add_Space();
|
|
341
|
-
static const unsigned kSizeField_Len = 13; // same as in HashCon.cpp
|
|
342
|
-
char s[kSizeField_Len + 32];
|
|
343
|
-
char *p = s;
|
|
344
|
-
SetSpacesAndNul(s, kSizeField_Len);
|
|
345
|
-
p = s + kSizeField_Len;
|
|
346
|
-
ConvertUInt64ToString(fileSize, p);
|
|
347
|
-
int numSpaces = (int)kSizeField_Len - (int)strlen(p);
|
|
348
|
-
if (numSpaces > 0)
|
|
349
|
-
p -= (unsigned)numSpaces;
|
|
350
|
-
_s += p;
|
|
351
|
-
}
|
|
352
|
-
*/
|
|
353
|
-
}
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
static void Add_LF(CDynLimBuf &hashFileString, const CHashOptionsLocal &options)
|
|
357
|
-
{
|
|
358
|
-
hashFileString += (char)(options.HashMode_Zero.Val ? 0 : '\n');
|
|
359
|
-
}
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
static void WriteLine(CDynLimBuf &hashFileString,
|
|
365
|
-
const CHashOptionsLocal &options,
|
|
366
|
-
const UString &path2,
|
|
367
|
-
bool isDir,
|
|
368
|
-
const AString &methodName,
|
|
369
|
-
const AString &hashesString)
|
|
370
|
-
{
|
|
371
|
-
if (options.HashMode_OnlyHash.Val)
|
|
372
|
-
{
|
|
373
|
-
hashFileString += hashesString;
|
|
374
|
-
Add_LF(hashFileString, options);
|
|
375
|
-
return;
|
|
376
|
-
}
|
|
377
|
-
|
|
378
|
-
UString path = path2;
|
|
379
|
-
|
|
380
|
-
bool isBin = false;
|
|
381
|
-
const bool zeroMode = options.HashMode_Zero.Val;
|
|
382
|
-
const bool tagMode = options.HashMode_Tag.Val;
|
|
383
|
-
|
|
384
|
-
#if CHAR_PATH_SEPARATOR != '/'
|
|
385
|
-
path.Replace(WCHAR_PATH_SEPARATOR, L'/');
|
|
386
|
-
// path.Replace((wchar_t)('\\' + 0xf000), L'\\'); // to debug WSL
|
|
387
|
-
#endif
|
|
388
|
-
|
|
389
|
-
AString utf8;
|
|
390
|
-
ConvertUnicodeToUTF8(path, utf8);
|
|
391
|
-
|
|
392
|
-
AString esc;
|
|
393
|
-
CSum_Name_OriginalToEscape(utf8, esc);
|
|
394
|
-
|
|
395
|
-
if (!zeroMode)
|
|
396
|
-
{
|
|
397
|
-
if (esc != utf8)
|
|
398
|
-
{
|
|
399
|
-
/* Original md5sum writes escape in that case.
|
|
400
|
-
We do same for compatibility with original md5sum. */
|
|
401
|
-
hashFileString += '\\';
|
|
402
|
-
}
|
|
403
|
-
}
|
|
404
|
-
|
|
405
|
-
if (isDir && !esc.IsEmpty() && esc.Back() != '/')
|
|
406
|
-
esc.Add_Slash();
|
|
407
|
-
|
|
408
|
-
if (tagMode)
|
|
409
|
-
{
|
|
410
|
-
if (!methodName.IsEmpty())
|
|
411
|
-
{
|
|
412
|
-
hashFileString += methodName;
|
|
413
|
-
hashFileString += ' ';
|
|
414
|
-
}
|
|
415
|
-
hashFileString += '(';
|
|
416
|
-
hashFileString += esc;
|
|
417
|
-
hashFileString += ')';
|
|
418
|
-
hashFileString += " = ";
|
|
419
|
-
}
|
|
420
|
-
|
|
421
|
-
hashFileString += hashesString;
|
|
422
|
-
|
|
423
|
-
if (!tagMode)
|
|
424
|
-
{
|
|
425
|
-
hashFileString += ' ';
|
|
426
|
-
hashFileString += (char)(isBin ? '*' : ' ');
|
|
427
|
-
hashFileString += esc;
|
|
428
|
-
}
|
|
429
|
-
|
|
430
|
-
Add_LF(hashFileString, options);
|
|
431
|
-
}
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
static void Convert_TagName_to_MethodName(AString &method)
|
|
435
|
-
{
|
|
436
|
-
// we need to convert at least SHA512/256 to SHA512-256, and SHA512/224 to SHA512-224
|
|
437
|
-
// but we convert any '/' to '-'.
|
|
438
|
-
method.Replace('/', '-');
|
|
439
|
-
}
|
|
440
|
-
|
|
441
|
-
static void Convert_MethodName_to_TagName(AString &method)
|
|
442
|
-
{
|
|
443
|
-
if (method.IsPrefixedBy_Ascii_NoCase("SHA512-2"))
|
|
444
|
-
method.ReplaceOneCharAtPos(6, '/');
|
|
445
|
-
}
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
static void WriteLine(CDynLimBuf &hashFileString,
|
|
449
|
-
const CHashOptionsLocal &options,
|
|
450
|
-
const UString &path,
|
|
451
|
-
bool isDir,
|
|
452
|
-
const CHashBundle &hb)
|
|
453
|
-
{
|
|
454
|
-
AString methodName;
|
|
455
|
-
if (!hb.Hashers.IsEmpty())
|
|
456
|
-
{
|
|
457
|
-
methodName = hb.Hashers[0].Name;
|
|
458
|
-
Convert_MethodName_to_TagName(methodName);
|
|
185
|
+
AddDigests(h.Digests[k_HashCalc_Index_NamesSum], tempDigest, h.DigestSize);
|
|
186
|
+
AddDigests(h.Digests[k_HashCalc_Index_StreamsSum], tempDigest, h.DigestSize);
|
|
459
187
|
}
|
|
460
|
-
AString hashesString;
|
|
461
|
-
AddHashResultLine(hashesString, hb.Hashers);
|
|
462
|
-
WriteLine(hashFileString, options, path, isDir, methodName, hashesString);
|
|
463
188
|
}
|
|
464
189
|
|
|
465
190
|
|
|
@@ -476,20 +201,17 @@ HRESULT HashCalc(
|
|
|
476
201
|
if (options.StdInMode)
|
|
477
202
|
{
|
|
478
203
|
CDirItem di;
|
|
479
|
-
|
|
480
|
-
|
|
204
|
+
di.Size = (UInt64)(Int64)-1;
|
|
205
|
+
di.Attrib = 0;
|
|
206
|
+
di.MTime.dwLowDateTime = 0;
|
|
207
|
+
di.MTime.dwHighDateTime = 0;
|
|
208
|
+
di.CTime = di.ATime = di.MTime;
|
|
481
209
|
dirItems.Items.Add(di);
|
|
482
210
|
}
|
|
483
211
|
else
|
|
484
212
|
{
|
|
485
|
-
RINOK(callback->StartScanning())
|
|
486
|
-
|
|
487
|
-
dirItems.SymLinks = options.SymLinks.Val;
|
|
213
|
+
RINOK(callback->StartScanning());
|
|
488
214
|
dirItems.ScanAltStreams = options.AltStreamsMode;
|
|
489
|
-
dirItems.ExcludeDirItems = censor.ExcludeDirItems;
|
|
490
|
-
dirItems.ExcludeFileItems = censor.ExcludeFileItems;
|
|
491
|
-
|
|
492
|
-
dirItems.ShareForWrite = options.OpenShareForWrite;
|
|
493
215
|
|
|
494
216
|
HRESULT res = EnumerateItems(censor,
|
|
495
217
|
options.PathMode,
|
|
@@ -502,25 +224,23 @@ HRESULT HashCalc(
|
|
|
502
224
|
errorInfo = "Scanning error";
|
|
503
225
|
return res;
|
|
504
226
|
}
|
|
505
|
-
RINOK(callback->FinishScanning(dirItems.Stat))
|
|
227
|
+
RINOK(callback->FinishScanning(dirItems.Stat));
|
|
506
228
|
}
|
|
507
229
|
|
|
508
230
|
unsigned i;
|
|
509
231
|
CHashBundle hb;
|
|
510
|
-
RINOK(hb.SetMethods(EXTERNAL_CODECS_LOC_VARS options.Methods))
|
|
232
|
+
RINOK(hb.SetMethods(EXTERNAL_CODECS_LOC_VARS options.Methods));
|
|
511
233
|
// hb.Init();
|
|
512
234
|
|
|
513
235
|
hb.NumErrors = dirItems.Stat.NumErrors;
|
|
514
|
-
|
|
515
|
-
UInt64 totalSize = 0;
|
|
236
|
+
|
|
516
237
|
if (options.StdInMode)
|
|
517
238
|
{
|
|
518
|
-
RINOK(callback->SetNumFiles(1))
|
|
239
|
+
RINOK(callback->SetNumFiles(1));
|
|
519
240
|
}
|
|
520
241
|
else
|
|
521
242
|
{
|
|
522
|
-
|
|
523
|
-
RINOK(callback->SetTotal(totalSize))
|
|
243
|
+
RINOK(callback->SetTotal(dirItems.Stat.GetTotalBytes()));
|
|
524
244
|
}
|
|
525
245
|
|
|
526
246
|
const UInt32 kBufSize = 1 << 15;
|
|
@@ -530,12 +250,7 @@ HRESULT HashCalc(
|
|
|
530
250
|
|
|
531
251
|
UInt64 completeValue = 0;
|
|
532
252
|
|
|
533
|
-
RINOK(callback->BeforeFirstFile(hb))
|
|
534
|
-
|
|
535
|
-
/*
|
|
536
|
-
CDynLimBuf hashFileString((size_t)1 << 31);
|
|
537
|
-
const bool needGenerate = !options.HashFilePath.IsEmpty();
|
|
538
|
-
*/
|
|
253
|
+
RINOK(callback->BeforeFirstFile(hb));
|
|
539
254
|
|
|
540
255
|
for (i = 0; i < dirItems.Items.Size(); i++)
|
|
541
256
|
{
|
|
@@ -543,91 +258,43 @@ HRESULT HashCalc(
|
|
|
543
258
|
UString path;
|
|
544
259
|
bool isDir = false;
|
|
545
260
|
bool isAltStream = false;
|
|
546
|
-
|
|
547
261
|
if (options.StdInMode)
|
|
548
262
|
{
|
|
549
|
-
#if 1
|
|
550
263
|
inStream = new CStdInFileStream;
|
|
551
|
-
#else
|
|
552
|
-
if (!CreateStdInStream(inStream))
|
|
553
|
-
{
|
|
554
|
-
const DWORD lastError = ::GetLastError();
|
|
555
|
-
const HRESULT res = callback->OpenFileError(FString("stdin"), lastError);
|
|
556
|
-
hb.NumErrors++;
|
|
557
|
-
if (res != S_FALSE && res != S_OK)
|
|
558
|
-
return res;
|
|
559
|
-
continue;
|
|
560
|
-
}
|
|
561
|
-
#endif
|
|
562
264
|
}
|
|
563
265
|
else
|
|
564
266
|
{
|
|
267
|
+
CInFileStream *inStreamSpec = new CInFileStream;
|
|
268
|
+
inStream = inStreamSpec;
|
|
269
|
+
const CDirItem &dirItem = dirItems.Items[i];
|
|
270
|
+
isDir = dirItem.IsDir();
|
|
271
|
+
isAltStream = dirItem.IsAltStream;
|
|
565
272
|
path = dirItems.GetLogPath(i);
|
|
566
|
-
|
|
567
|
-
#ifdef _WIN32
|
|
568
|
-
isAltStream = di.IsAltStream;
|
|
569
|
-
#endif
|
|
570
|
-
|
|
571
|
-
#ifndef UNDER_CE
|
|
572
|
-
// if (di.AreReparseData())
|
|
573
|
-
if (di.ReparseData.Size() != 0)
|
|
574
|
-
{
|
|
575
|
-
CBufInStream *inStreamSpec = new CBufInStream();
|
|
576
|
-
inStream = inStreamSpec;
|
|
577
|
-
inStreamSpec->Init(di.ReparseData, di.ReparseData.Size());
|
|
578
|
-
}
|
|
579
|
-
else
|
|
580
|
-
#endif
|
|
273
|
+
if (!isDir)
|
|
581
274
|
{
|
|
582
|
-
|
|
583
|
-
inStreamSpec->
|
|
584
|
-
inStream = inStreamSpec;
|
|
585
|
-
isDir = di.IsDir();
|
|
586
|
-
if (!isDir)
|
|
275
|
+
FString phyPath = dirItems.GetPhyPath(i);
|
|
276
|
+
if (!inStreamSpec->OpenShared(phyPath, options.OpenShareForWrite))
|
|
587
277
|
{
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
if (res != S_FALSE)
|
|
594
|
-
return res;
|
|
595
|
-
continue;
|
|
596
|
-
}
|
|
597
|
-
if (!options.StdInMode)
|
|
598
|
-
{
|
|
599
|
-
UInt64 curSize = 0;
|
|
600
|
-
if (inStreamSpec->GetSize(&curSize) == S_OK)
|
|
601
|
-
{
|
|
602
|
-
if (curSize > di.Size)
|
|
603
|
-
{
|
|
604
|
-
totalSize += curSize - di.Size;
|
|
605
|
-
RINOK(callback->SetTotal(totalSize))
|
|
606
|
-
// printf("\ntotal = %d MiB\n", (unsigned)(totalSize >> 20));
|
|
607
|
-
}
|
|
608
|
-
}
|
|
609
|
-
}
|
|
610
|
-
// inStreamSpec->ReloadProps();
|
|
278
|
+
HRESULT res = callback->OpenFileError(phyPath, ::GetLastError());
|
|
279
|
+
hb.NumErrors++;
|
|
280
|
+
if (res != S_FALSE)
|
|
281
|
+
return res;
|
|
282
|
+
continue;
|
|
611
283
|
}
|
|
612
284
|
}
|
|
613
285
|
}
|
|
614
|
-
|
|
615
|
-
RINOK(callback->GetStream(path, isDir))
|
|
286
|
+
RINOK(callback->GetStream(path, isDir));
|
|
616
287
|
UInt64 fileSize = 0;
|
|
617
288
|
|
|
618
289
|
hb.InitForNewFile();
|
|
619
|
-
|
|
620
290
|
if (!isDir)
|
|
621
291
|
{
|
|
622
292
|
for (UInt32 step = 0;; step++)
|
|
623
293
|
{
|
|
624
294
|
if ((step & 0xFF) == 0)
|
|
625
|
-
|
|
626
|
-
// printf("\ncompl = %d\n", (unsigned)(completeValue >> 20));
|
|
627
|
-
RINOK(callback->SetCompleted(&completeValue))
|
|
628
|
-
}
|
|
295
|
+
RINOK(callback->SetCompleted(&completeValue));
|
|
629
296
|
UInt32 size;
|
|
630
|
-
RINOK(inStream->Read(buf, kBufSize, &size))
|
|
297
|
+
RINOK(inStream->Read(buf, kBufSize, &size));
|
|
631
298
|
if (size == 0)
|
|
632
299
|
break;
|
|
633
300
|
hb.Update(buf, size);
|
|
@@ -635,1639 +302,46 @@ HRESULT HashCalc(
|
|
|
635
302
|
completeValue += size;
|
|
636
303
|
}
|
|
637
304
|
}
|
|
638
|
-
|
|
639
305
|
hb.Final(isDir, isAltStream, path);
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
if (needGenerate
|
|
643
|
-
&& (options.HashMode_Dirs.Val || !isDir))
|
|
644
|
-
{
|
|
645
|
-
WriteLine(hashFileString,
|
|
646
|
-
options,
|
|
647
|
-
path, // change it
|
|
648
|
-
isDir,
|
|
649
|
-
hb);
|
|
650
|
-
|
|
651
|
-
if (hashFileString.IsError())
|
|
652
|
-
return E_OUTOFMEMORY;
|
|
653
|
-
}
|
|
654
|
-
*/
|
|
655
|
-
|
|
656
|
-
RINOK(callback->SetOperationResult(fileSize, hb, !isDir))
|
|
657
|
-
RINOK(callback->SetCompleted(&completeValue))
|
|
658
|
-
}
|
|
659
|
-
|
|
660
|
-
/*
|
|
661
|
-
if (needGenerate)
|
|
662
|
-
{
|
|
663
|
-
NFile::NIO::COutFile file;
|
|
664
|
-
if (!file.Create(us2fs(options.HashFilePath), true)) // createAlways
|
|
665
|
-
return GetLastError_noZero_HRESULT();
|
|
666
|
-
if (!file.WriteFull(hashFileString, hashFileString.Len()))
|
|
667
|
-
return GetLastError_noZero_HRESULT();
|
|
306
|
+
RINOK(callback->SetOperationResult(fileSize, hb, !isDir));
|
|
307
|
+
RINOK(callback->SetCompleted(&completeValue));
|
|
668
308
|
}
|
|
669
|
-
*/
|
|
670
|
-
|
|
671
309
|
return callback->AfterLastFile(hb);
|
|
672
310
|
}
|
|
673
311
|
|
|
674
312
|
|
|
675
|
-
|
|
313
|
+
static inline char GetHex(unsigned v)
|
|
314
|
+
{
|
|
315
|
+
return (char)((v < 10) ? ('0' + v) : ('A' + (v - 10)));
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
void AddHashHexToString(char *dest, const Byte *data, UInt32 size)
|
|
676
319
|
{
|
|
320
|
+
dest[size * 2] = 0;
|
|
321
|
+
|
|
677
322
|
if (!data)
|
|
678
323
|
{
|
|
679
|
-
for (
|
|
324
|
+
for (UInt32 i = 0; i < size; i++)
|
|
680
325
|
{
|
|
681
326
|
dest[0] = ' ';
|
|
682
327
|
dest[1] = ' ';
|
|
683
328
|
dest += 2;
|
|
684
329
|
}
|
|
685
|
-
*dest = 0;
|
|
686
|
-
return;
|
|
687
|
-
}
|
|
688
|
-
|
|
689
|
-
if (size > 8)
|
|
690
|
-
ConvertDataToHex_Lower(dest, data, size);
|
|
691
|
-
else if (size == 0)
|
|
692
|
-
{
|
|
693
|
-
*dest = 0;
|
|
694
330
|
return;
|
|
695
331
|
}
|
|
696
|
-
else
|
|
697
|
-
{
|
|
698
|
-
const char *dest_start = dest;
|
|
699
|
-
dest += size * 2;
|
|
700
|
-
*dest = 0;
|
|
701
|
-
do
|
|
702
|
-
{
|
|
703
|
-
const size_t b = *data++;
|
|
704
|
-
dest -= 2;
|
|
705
|
-
dest[0] = GET_HEX_CHAR_UPPER(b >> 4);
|
|
706
|
-
dest[1] = GET_HEX_CHAR_UPPER(b & 15);
|
|
707
|
-
}
|
|
708
|
-
while (dest != dest_start);
|
|
709
|
-
}
|
|
710
|
-
}
|
|
711
|
-
|
|
712
|
-
void CHasherState::WriteToString(unsigned digestIndex, char *s) const
|
|
713
|
-
{
|
|
714
|
-
HashHexToString(s, Digests[digestIndex], DigestSize);
|
|
715
|
-
|
|
716
|
-
if (digestIndex != 0 && NumSums[digestIndex] != 1)
|
|
717
|
-
{
|
|
718
|
-
unsigned numExtraBytes = GetNumExtraBytes_for_Group(digestIndex);
|
|
719
|
-
if (numExtraBytes > 4)
|
|
720
|
-
numExtraBytes = 8;
|
|
721
|
-
else // if (numExtraBytes >= 0)
|
|
722
|
-
numExtraBytes = 4;
|
|
723
|
-
// if (numExtraBytes != 0)
|
|
724
|
-
{
|
|
725
|
-
s += strlen(s);
|
|
726
|
-
*s++ = '-';
|
|
727
|
-
// *s = 0;
|
|
728
|
-
HashHexToString(s, GetExtraData_for_Group(digestIndex), numExtraBytes);
|
|
729
|
-
}
|
|
730
|
-
}
|
|
731
|
-
}
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
// ---------- Hash Handler ----------
|
|
736
|
-
|
|
737
|
-
namespace NHash {
|
|
738
|
-
|
|
739
|
-
#define IsWhite(c) ((c) == ' ' || (c) == '\t')
|
|
740
|
-
|
|
741
|
-
bool CHashPair::IsDir() const
|
|
742
|
-
{
|
|
743
|
-
if (Name.IsEmpty() || Name.Back() != '/')
|
|
744
|
-
return false;
|
|
745
|
-
// here we expect that Dir items contain only zeros or no Hash
|
|
746
|
-
for (size_t i = 0; i < Hash.Size(); i++)
|
|
747
|
-
if (Hash.ConstData()[i] != 0)
|
|
748
|
-
return false;
|
|
749
|
-
return true;
|
|
750
|
-
}
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
bool CHashPair::ParseCksum(const char *s)
|
|
754
|
-
{
|
|
755
|
-
const char *end;
|
|
756
|
-
|
|
757
|
-
const UInt32 crc = ConvertStringToUInt32(s, &end);
|
|
758
|
-
if (*end != ' ')
|
|
759
|
-
return false;
|
|
760
|
-
end++;
|
|
761
|
-
|
|
762
|
-
const UInt64 size = ConvertStringToUInt64(end, &end);
|
|
763
|
-
if (*end != ' ')
|
|
764
|
-
return false;
|
|
765
|
-
end++;
|
|
766
|
-
|
|
767
|
-
Name = end;
|
|
768
|
-
|
|
769
|
-
Hash.Alloc(4);
|
|
770
|
-
SetBe32a(Hash, crc)
|
|
771
|
-
|
|
772
|
-
Size_from_Arc = size;
|
|
773
|
-
Size_from_Arc_Defined = true;
|
|
774
|
-
|
|
775
|
-
return true;
|
|
776
|
-
}
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
static const char *SkipWhite(const char *s)
|
|
781
|
-
{
|
|
782
|
-
while (IsWhite(*s))
|
|
783
|
-
s++;
|
|
784
|
-
return s;
|
|
785
|
-
}
|
|
786
|
-
|
|
787
|
-
static const char * const k_CsumMethodNames[] =
|
|
788
|
-
{
|
|
789
|
-
"sha256"
|
|
790
|
-
, "sha224"
|
|
791
|
-
, "sha512-224"
|
|
792
|
-
, "sha512-256"
|
|
793
|
-
, "sha384"
|
|
794
|
-
, "sha512"
|
|
795
|
-
, "sha3-224"
|
|
796
|
-
, "sha3-256"
|
|
797
|
-
, "sha3-384"
|
|
798
|
-
, "sha3-512"
|
|
799
|
-
// , "shake128"
|
|
800
|
-
// , "shake256"
|
|
801
|
-
, "sha1"
|
|
802
|
-
, "sha2"
|
|
803
|
-
, "sha3"
|
|
804
|
-
, "sha"
|
|
805
|
-
, "md5"
|
|
806
|
-
, "blake2s"
|
|
807
|
-
, "blake2b"
|
|
808
|
-
, "blake2sp"
|
|
809
|
-
, "xxh64"
|
|
810
|
-
, "crc32"
|
|
811
|
-
, "crc64"
|
|
812
|
-
, "cksum"
|
|
813
|
-
};
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
// returns true, if (method) is known hash method or hash method group name.
|
|
817
|
-
static bool GetMethod_from_FileName(const UString &name, AString &method)
|
|
818
|
-
{
|
|
819
|
-
method.Empty();
|
|
820
|
-
AString s;
|
|
821
|
-
ConvertUnicodeToUTF8(name, s);
|
|
822
|
-
const int dotPos = s.ReverseFind_Dot();
|
|
823
|
-
if (dotPos >= 0)
|
|
824
|
-
{
|
|
825
|
-
method = s.Ptr(dotPos + 1);
|
|
826
|
-
if (method.IsEqualTo_Ascii_NoCase("txt") ||
|
|
827
|
-
method.IsEqualTo_Ascii_NoCase("asc"))
|
|
828
|
-
{
|
|
829
|
-
method.Empty();
|
|
830
|
-
const int dotPos2 = s.Find('.');
|
|
831
|
-
if (dotPos2 >= 0)
|
|
832
|
-
s.DeleteFrom(dotPos2);
|
|
833
|
-
}
|
|
834
|
-
}
|
|
835
|
-
if (method.IsEmpty())
|
|
836
|
-
{
|
|
837
|
-
// we support file names with "sum" and "sums" postfixes: "sha256sum", "sha256sums"
|
|
838
|
-
unsigned size;
|
|
839
|
-
if (s.Len() > 4 && StringsAreEqualNoCase_Ascii(s.RightPtr(4), "sums"))
|
|
840
|
-
size = 4;
|
|
841
|
-
else if (s.Len() > 3 && StringsAreEqualNoCase_Ascii(s.RightPtr(3), "sum"))
|
|
842
|
-
size = 3;
|
|
843
|
-
else
|
|
844
|
-
return false;
|
|
845
|
-
method = s;
|
|
846
|
-
method.DeleteFrom(s.Len() - size);
|
|
847
|
-
}
|
|
848
|
-
|
|
849
|
-
unsigned i;
|
|
850
|
-
for (i = 0; i < Z7_ARRAY_SIZE(k_CsumMethodNames); i++)
|
|
851
|
-
{
|
|
852
|
-
const char *m = k_CsumMethodNames[i];
|
|
853
|
-
if (method.IsEqualTo_Ascii_NoCase(m))
|
|
854
|
-
{
|
|
855
|
-
// method = m; // we can get lowcase
|
|
856
|
-
return true;
|
|
857
|
-
}
|
|
858
|
-
}
|
|
859
|
-
|
|
860
|
-
/*
|
|
861
|
-
for (i = 0; i < Z7_ARRAY_SIZE(k_CsumMethodNames); i++)
|
|
862
|
-
{
|
|
863
|
-
const char *m = k_CsumMethodNames[i];
|
|
864
|
-
if (method.IsPrefixedBy_Ascii_NoCase(m))
|
|
865
|
-
{
|
|
866
|
-
method = m; // we get lowcase
|
|
867
|
-
return true;
|
|
868
|
-
}
|
|
869
|
-
}
|
|
870
|
-
*/
|
|
871
|
-
return false;
|
|
872
|
-
}
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
bool CHashPair::Parse(const char *s)
|
|
876
|
-
{
|
|
877
|
-
// here we keep compatibility with original md5sum / shasum
|
|
878
|
-
bool escape = false;
|
|
879
|
-
|
|
880
|
-
s = SkipWhite(s);
|
|
881
|
-
|
|
882
|
-
if (*s == '\\')
|
|
883
|
-
{
|
|
884
|
-
s++;
|
|
885
|
-
escape = true;
|
|
886
|
-
}
|
|
887
|
-
Escape = escape;
|
|
888
332
|
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
if ((size_t)(FindNonHexChar(s) - s) < 4)
|
|
892
|
-
{
|
|
893
|
-
// BSD-style checksum line
|
|
894
|
-
{
|
|
895
|
-
const char *s2 = s;
|
|
896
|
-
for (; *s2 != 0; s2++)
|
|
897
|
-
{
|
|
898
|
-
const char c = *s2;
|
|
899
|
-
if (c == 0)
|
|
900
|
-
return false;
|
|
901
|
-
if (c == ' ' || c == '(')
|
|
902
|
-
break;
|
|
903
|
-
}
|
|
904
|
-
Method.SetFrom(s, (unsigned)(s2 - s));
|
|
905
|
-
s = s2;
|
|
906
|
-
}
|
|
907
|
-
IsBSD = true;
|
|
908
|
-
if (*s == ' ')
|
|
909
|
-
s++;
|
|
910
|
-
if (*s != '(')
|
|
911
|
-
return false;
|
|
912
|
-
s++;
|
|
913
|
-
{
|
|
914
|
-
const char *s2 = s;
|
|
915
|
-
for (; *s2 != 0; s2++)
|
|
916
|
-
{}
|
|
917
|
-
for (;;)
|
|
918
|
-
{
|
|
919
|
-
s2--;
|
|
920
|
-
if (s2 < s)
|
|
921
|
-
return false;
|
|
922
|
-
if (*s2 == ')')
|
|
923
|
-
break;
|
|
924
|
-
}
|
|
925
|
-
Name.SetFrom(s, (unsigned)(s2 - s));
|
|
926
|
-
s = s2 + 1;
|
|
927
|
-
}
|
|
928
|
-
|
|
929
|
-
s = SkipWhite(s);
|
|
930
|
-
if (*s != '=')
|
|
931
|
-
return false;
|
|
932
|
-
s++;
|
|
933
|
-
s = SkipWhite(s);
|
|
934
|
-
}
|
|
935
|
-
|
|
333
|
+
int step = 2;
|
|
334
|
+
if (size <= 8)
|
|
936
335
|
{
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
if ((size_t)(ParseHexString(s, Hash) - Hash) != numChars / 2)
|
|
940
|
-
throw 101;
|
|
941
|
-
HashString.SetFrom(s, (unsigned)numChars);
|
|
942
|
-
s += numChars;
|
|
336
|
+
step = -2;
|
|
337
|
+
dest += size * 2 - 2;
|
|
943
338
|
}
|
|
944
339
|
|
|
945
|
-
|
|
946
|
-
{
|
|
947
|
-
if (*s != 0)
|
|
948
|
-
return false;
|
|
949
|
-
if (escape)
|
|
950
|
-
{
|
|
951
|
-
const AString temp (Name);
|
|
952
|
-
return CSum_Name_EscapeToOriginal(temp, Name);
|
|
953
|
-
}
|
|
954
|
-
return true;
|
|
955
|
-
}
|
|
956
|
-
|
|
957
|
-
if (*s == 0)
|
|
958
|
-
return true;
|
|
959
|
-
|
|
960
|
-
if (*s != ' ')
|
|
961
|
-
return false;
|
|
962
|
-
s++;
|
|
963
|
-
const char c = *s;
|
|
964
|
-
if (c != ' '
|
|
965
|
-
&& c != '*'
|
|
966
|
-
&& c != 'U' // shasum Universal
|
|
967
|
-
&& c != '^' // shasum 0/1
|
|
968
|
-
)
|
|
969
|
-
return false;
|
|
970
|
-
Mode = c;
|
|
971
|
-
s++;
|
|
972
|
-
if (escape)
|
|
973
|
-
return CSum_Name_EscapeToOriginal(s, Name);
|
|
974
|
-
Name = s;
|
|
975
|
-
return true;
|
|
976
|
-
}
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
static bool GetLine(CByteBuffer &buf, bool zeroMode, bool cr_lf_Mode, size_t &posCur, AString &s)
|
|
980
|
-
{
|
|
981
|
-
s.Empty();
|
|
982
|
-
size_t pos = posCur;
|
|
983
|
-
const Byte *p = buf;
|
|
984
|
-
unsigned numDigits = 0;
|
|
985
|
-
for (; pos < buf.Size(); pos++)
|
|
986
|
-
{
|
|
987
|
-
const Byte b = p[pos];
|
|
988
|
-
if (b == 0)
|
|
989
|
-
{
|
|
990
|
-
numDigits = 1;
|
|
991
|
-
break;
|
|
992
|
-
}
|
|
993
|
-
if (zeroMode)
|
|
994
|
-
continue;
|
|
995
|
-
if (b == 0x0a)
|
|
996
|
-
{
|
|
997
|
-
numDigits = 1;
|
|
998
|
-
break;
|
|
999
|
-
}
|
|
1000
|
-
if (!cr_lf_Mode)
|
|
1001
|
-
continue;
|
|
1002
|
-
if (b == 0x0d)
|
|
1003
|
-
{
|
|
1004
|
-
if (pos + 1 >= buf.Size())
|
|
1005
|
-
{
|
|
1006
|
-
numDigits = 1;
|
|
1007
|
-
break;
|
|
1008
|
-
// return false;
|
|
1009
|
-
}
|
|
1010
|
-
if (p[pos + 1] == 0x0a)
|
|
1011
|
-
{
|
|
1012
|
-
numDigits = 2;
|
|
1013
|
-
break;
|
|
1014
|
-
}
|
|
1015
|
-
}
|
|
1016
|
-
}
|
|
1017
|
-
s.SetFrom((const char *)(p + posCur), (unsigned)(pos - posCur));
|
|
1018
|
-
posCur = pos + numDigits;
|
|
1019
|
-
return true;
|
|
1020
|
-
}
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
static bool Is_CR_LF_Data(const Byte *buf, size_t size)
|
|
1024
|
-
{
|
|
1025
|
-
bool isCrLf = false;
|
|
1026
|
-
for (size_t i = 0; i < size;)
|
|
340
|
+
for (UInt32 i = 0; i < size; i++)
|
|
1027
341
|
{
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
{
|
|
1033
|
-
if (i == size - 1)
|
|
1034
|
-
return false;
|
|
1035
|
-
if (buf[i + 1] != 0x0a)
|
|
1036
|
-
return false;
|
|
1037
|
-
isCrLf = true;
|
|
1038
|
-
i += 2;
|
|
1039
|
-
}
|
|
1040
|
-
else
|
|
1041
|
-
i++;
|
|
1042
|
-
}
|
|
1043
|
-
return isCrLf;
|
|
1044
|
-
}
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
static const Byte kArcProps[] =
|
|
1048
|
-
{
|
|
1049
|
-
// kpidComment,
|
|
1050
|
-
kpidCharacts
|
|
1051
|
-
};
|
|
1052
|
-
|
|
1053
|
-
static const Byte kProps[] =
|
|
1054
|
-
{
|
|
1055
|
-
kpidPath,
|
|
1056
|
-
kpidSize,
|
|
1057
|
-
kpidPackSize,
|
|
1058
|
-
kpidMethod
|
|
1059
|
-
};
|
|
1060
|
-
|
|
1061
|
-
static const Byte kRawProps[] =
|
|
1062
|
-
{
|
|
1063
|
-
kpidChecksum
|
|
1064
|
-
};
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
Z7_COM7F_IMF(CHandler::GetParent(UInt32 /* index */ , UInt32 *parent, UInt32 *parentType))
|
|
1068
|
-
{
|
|
1069
|
-
*parentType = NParentType::kDir;
|
|
1070
|
-
*parent = (UInt32)(Int32)-1;
|
|
1071
|
-
return S_OK;
|
|
1072
|
-
}
|
|
1073
|
-
|
|
1074
|
-
Z7_COM7F_IMF(CHandler::GetNumRawProps(UInt32 *numProps))
|
|
1075
|
-
{
|
|
1076
|
-
*numProps = Z7_ARRAY_SIZE(kRawProps);
|
|
1077
|
-
return S_OK;
|
|
1078
|
-
}
|
|
1079
|
-
|
|
1080
|
-
Z7_COM7F_IMF(CHandler::GetRawPropInfo(UInt32 index, BSTR *name, PROPID *propID))
|
|
1081
|
-
{
|
|
1082
|
-
*propID = kRawProps[index];
|
|
1083
|
-
*name = NULL;
|
|
1084
|
-
return S_OK;
|
|
1085
|
-
}
|
|
1086
|
-
|
|
1087
|
-
Z7_COM7F_IMF(CHandler::GetRawProp(UInt32 index, PROPID propID, const void **data, UInt32 *dataSize, UInt32 *propType))
|
|
1088
|
-
{
|
|
1089
|
-
*data = NULL;
|
|
1090
|
-
*dataSize = 0;
|
|
1091
|
-
*propType = 0;
|
|
1092
|
-
|
|
1093
|
-
if (propID == kpidChecksum)
|
|
1094
|
-
{
|
|
1095
|
-
const CHashPair &hp = HashPairs[index];
|
|
1096
|
-
if (hp.Hash.Size() != 0)
|
|
1097
|
-
{
|
|
1098
|
-
*data = hp.Hash;
|
|
1099
|
-
*dataSize = (UInt32)hp.Hash.Size();
|
|
1100
|
-
*propType = NPropDataType::kRaw;
|
|
1101
|
-
}
|
|
1102
|
-
return S_OK;
|
|
1103
|
-
}
|
|
1104
|
-
|
|
1105
|
-
return S_OK;
|
|
1106
|
-
}
|
|
1107
|
-
|
|
1108
|
-
IMP_IInArchive_Props
|
|
1109
|
-
IMP_IInArchive_ArcProps
|
|
1110
|
-
|
|
1111
|
-
Z7_COM7F_IMF(CHandler::GetNumberOfItems(UInt32 *numItems))
|
|
1112
|
-
{
|
|
1113
|
-
*numItems = HashPairs.Size();
|
|
1114
|
-
return S_OK;
|
|
1115
|
-
}
|
|
1116
|
-
|
|
1117
|
-
static void Add_OptSpace_String(UString &dest, const char *src)
|
|
1118
|
-
{
|
|
1119
|
-
dest.Add_Space_if_NotEmpty();
|
|
1120
|
-
dest += src;
|
|
1121
|
-
}
|
|
1122
|
-
|
|
1123
|
-
Z7_COM7F_IMF(CHandler::GetArchiveProperty(PROPID propID, PROPVARIANT *value))
|
|
1124
|
-
{
|
|
1125
|
-
NCOM::CPropVariant prop;
|
|
1126
|
-
switch (propID)
|
|
1127
|
-
{
|
|
1128
|
-
case kpidPhySize: if (_phySize != 0) prop = _phySize; break;
|
|
1129
|
-
/*
|
|
1130
|
-
case kpidErrorFlags:
|
|
1131
|
-
{
|
|
1132
|
-
UInt32 v = 0;
|
|
1133
|
-
if (!_isArc) v |= kpv_ErrorFlags_IsNotArc;
|
|
1134
|
-
// if (_sres == k_Base64_RES_NeedMoreInput) v |= kpv_ErrorFlags_UnexpectedEnd;
|
|
1135
|
-
if (v != 0)
|
|
1136
|
-
prop = v;
|
|
1137
|
-
break;
|
|
1138
|
-
}
|
|
1139
|
-
*/
|
|
1140
|
-
case kpidCharacts:
|
|
1141
|
-
{
|
|
1142
|
-
UString s;
|
|
1143
|
-
if (_hashSize_Defined)
|
|
1144
|
-
{
|
|
1145
|
-
s.Add_Space_if_NotEmpty();
|
|
1146
|
-
s.Add_UInt32(_hashSize * 8);
|
|
1147
|
-
s += "-bit";
|
|
1148
|
-
}
|
|
1149
|
-
if (_is_PgpMethod)
|
|
1150
|
-
{
|
|
1151
|
-
Add_OptSpace_String(s, "PGP");
|
|
1152
|
-
if (!_pgpMethod.IsEmpty())
|
|
1153
|
-
{
|
|
1154
|
-
s.Add_Colon();
|
|
1155
|
-
s += _pgpMethod;
|
|
1156
|
-
}
|
|
1157
|
-
}
|
|
1158
|
-
if (_is_ZeroMode)
|
|
1159
|
-
Add_OptSpace_String(s, "ZERO");
|
|
1160
|
-
if (_are_there_Tags)
|
|
1161
|
-
Add_OptSpace_String(s, "TAG");
|
|
1162
|
-
if (_are_there_Dirs)
|
|
1163
|
-
Add_OptSpace_String(s, "DIRS");
|
|
1164
|
-
if (!_method_from_FileName.IsEmpty())
|
|
1165
|
-
{
|
|
1166
|
-
Add_OptSpace_String(s, "filename_method:");
|
|
1167
|
-
s += _method_from_FileName;
|
|
1168
|
-
if (!_is_KnownMethod_in_FileName)
|
|
1169
|
-
s += ":UNKNOWN";
|
|
1170
|
-
}
|
|
1171
|
-
if (!_methods.IsEmpty())
|
|
1172
|
-
{
|
|
1173
|
-
Add_OptSpace_String(s, "cmd_method:");
|
|
1174
|
-
s += _methods[0];
|
|
1175
|
-
}
|
|
1176
|
-
prop = s;
|
|
1177
|
-
break;
|
|
1178
|
-
}
|
|
1179
|
-
|
|
1180
|
-
case kpidReadOnly:
|
|
1181
|
-
{
|
|
1182
|
-
if (_isArc)
|
|
1183
|
-
if (!CanUpdate())
|
|
1184
|
-
prop = true;
|
|
1185
|
-
break;
|
|
1186
|
-
}
|
|
1187
|
-
default: break;
|
|
1188
|
-
}
|
|
1189
|
-
prop.Detach(value);
|
|
1190
|
-
return S_OK;
|
|
1191
|
-
}
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
Z7_COM7F_IMF(CHandler::GetProperty(UInt32 index, PROPID propID, PROPVARIANT *value))
|
|
1195
|
-
{
|
|
1196
|
-
// COM_TRY_BEGIN
|
|
1197
|
-
NCOM::CPropVariant prop;
|
|
1198
|
-
const CHashPair &hp = HashPairs[index];
|
|
1199
|
-
switch (propID)
|
|
1200
|
-
{
|
|
1201
|
-
case kpidIsDir:
|
|
1202
|
-
{
|
|
1203
|
-
prop = hp.IsDir();
|
|
1204
|
-
break;
|
|
1205
|
-
}
|
|
1206
|
-
case kpidPath:
|
|
1207
|
-
{
|
|
1208
|
-
UString path;
|
|
1209
|
-
hp.Get_UString_Path(path);
|
|
1210
|
-
|
|
1211
|
-
bool useBackslashReplacement = true;
|
|
1212
|
-
if (_supportWindowsBackslash && !hp.Escape && path.Find(L"\\\\") < 0)
|
|
1213
|
-
{
|
|
1214
|
-
#if WCHAR_PATH_SEPARATOR == L'/'
|
|
1215
|
-
path.Replace(L'\\', L'/');
|
|
1216
|
-
#else
|
|
1217
|
-
useBackslashReplacement = false;
|
|
1218
|
-
#endif
|
|
1219
|
-
}
|
|
1220
|
-
NArchive::NItemName::ReplaceToOsSlashes_Remove_TailSlash(
|
|
1221
|
-
path, useBackslashReplacement);
|
|
1222
|
-
prop = path;
|
|
1223
|
-
break;
|
|
1224
|
-
}
|
|
1225
|
-
case kpidSize:
|
|
1226
|
-
{
|
|
1227
|
-
// client needs processed size of last file
|
|
1228
|
-
if (hp.Size_from_Disk_Defined)
|
|
1229
|
-
prop = (UInt64)hp.Size_from_Disk;
|
|
1230
|
-
else if (hp.Size_from_Arc_Defined)
|
|
1231
|
-
prop = (UInt64)hp.Size_from_Arc;
|
|
1232
|
-
break;
|
|
1233
|
-
}
|
|
1234
|
-
case kpidPackSize:
|
|
1235
|
-
{
|
|
1236
|
-
prop = (UInt64)hp.Hash.Size();
|
|
1237
|
-
break;
|
|
1238
|
-
}
|
|
1239
|
-
case kpidMethod:
|
|
1240
|
-
{
|
|
1241
|
-
if (!hp.Method.IsEmpty())
|
|
1242
|
-
prop = hp.Method;
|
|
1243
|
-
break;
|
|
1244
|
-
}
|
|
1245
|
-
default: break;
|
|
1246
|
-
}
|
|
1247
|
-
prop.Detach(value);
|
|
1248
|
-
return S_OK;
|
|
1249
|
-
// COM_TRY_END
|
|
1250
|
-
}
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
static HRESULT ReadStream_to_Buf(IInStream *stream, CByteBuffer &buf, IArchiveOpenCallback *openCallback)
|
|
1254
|
-
{
|
|
1255
|
-
buf.Free();
|
|
1256
|
-
UInt64 len;
|
|
1257
|
-
RINOK(InStream_AtBegin_GetSize(stream, len))
|
|
1258
|
-
if (len == 0 || len >= ((UInt64)1 << 31))
|
|
1259
|
-
return S_FALSE;
|
|
1260
|
-
buf.Alloc((size_t)len);
|
|
1261
|
-
UInt64 pos = 0;
|
|
1262
|
-
// return ReadStream_FALSE(stream, buf, (size_t)len);
|
|
1263
|
-
for (;;)
|
|
1264
|
-
{
|
|
1265
|
-
const UInt32 kBlockSize = ((UInt32)1 << 24);
|
|
1266
|
-
const UInt32 curSize = (len < kBlockSize) ? (UInt32)len : kBlockSize;
|
|
1267
|
-
UInt32 processedSizeLoc;
|
|
1268
|
-
RINOK(stream->Read((Byte *)buf + pos, curSize, &processedSizeLoc))
|
|
1269
|
-
if (processedSizeLoc == 0)
|
|
1270
|
-
return E_FAIL;
|
|
1271
|
-
len -= processedSizeLoc;
|
|
1272
|
-
pos += processedSizeLoc;
|
|
1273
|
-
if (len == 0)
|
|
1274
|
-
return S_OK;
|
|
1275
|
-
if (openCallback)
|
|
1276
|
-
{
|
|
1277
|
-
const UInt64 files = 0;
|
|
1278
|
-
RINOK(openCallback->SetCompleted(&files, &pos))
|
|
1279
|
-
}
|
|
1280
|
-
}
|
|
1281
|
-
}
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
static bool isThere_Zero_Byte(const Byte *data, size_t size)
|
|
1285
|
-
{
|
|
1286
|
-
for (size_t i = 0; i < size; i++)
|
|
1287
|
-
if (data[i] == 0)
|
|
1288
|
-
return true;
|
|
1289
|
-
return false;
|
|
1290
|
-
}
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
Z7_COM7F_IMF(CHandler::Open(IInStream *stream, const UInt64 *, IArchiveOpenCallback *openCallback))
|
|
1294
|
-
{
|
|
1295
|
-
COM_TRY_BEGIN
|
|
1296
|
-
{
|
|
1297
|
-
Close();
|
|
1298
|
-
|
|
1299
|
-
CByteBuffer buf;
|
|
1300
|
-
RINOK(ReadStream_to_Buf(stream, buf, openCallback))
|
|
1301
|
-
|
|
1302
|
-
CObjectVector<CHashPair> &pairs = HashPairs;
|
|
1303
|
-
|
|
1304
|
-
const bool zeroMode = isThere_Zero_Byte(buf, buf.Size());
|
|
1305
|
-
_is_ZeroMode = zeroMode;
|
|
1306
|
-
bool cr_lf_Mode = false;
|
|
1307
|
-
if (!zeroMode)
|
|
1308
|
-
cr_lf_Mode = Is_CR_LF_Data(buf, buf.Size());
|
|
1309
|
-
|
|
1310
|
-
if (openCallback)
|
|
1311
|
-
{
|
|
1312
|
-
Z7_DECL_CMyComPtr_QI_FROM(
|
|
1313
|
-
IArchiveOpenVolumeCallback,
|
|
1314
|
-
openVolumeCallback, openCallback)
|
|
1315
|
-
if (openVolumeCallback)
|
|
1316
|
-
{
|
|
1317
|
-
NCOM::CPropVariant prop;
|
|
1318
|
-
RINOK(openVolumeCallback->GetProperty(kpidName, &prop))
|
|
1319
|
-
if (prop.vt == VT_BSTR)
|
|
1320
|
-
_is_KnownMethod_in_FileName = GetMethod_from_FileName(prop.bstrVal, _method_from_FileName);
|
|
1321
|
-
}
|
|
1322
|
-
}
|
|
1323
|
-
|
|
1324
|
-
if (!_methods.IsEmpty())
|
|
1325
|
-
{
|
|
1326
|
-
ConvertUnicodeToUTF8(_methods[0], _method_for_Extraction);
|
|
1327
|
-
}
|
|
1328
|
-
if (_method_for_Extraction.IsEmpty())
|
|
1329
|
-
{
|
|
1330
|
-
// if (_is_KnownMethod_in_FileName)
|
|
1331
|
-
_method_for_Extraction = _method_from_FileName;
|
|
1332
|
-
}
|
|
1333
|
-
|
|
1334
|
-
const bool cksumMode = _method_for_Extraction.IsEqualTo_Ascii_NoCase("cksum");
|
|
1335
|
-
_is_CksumMode = cksumMode;
|
|
1336
|
-
|
|
1337
|
-
size_t pos = 0;
|
|
1338
|
-
AString s;
|
|
1339
|
-
bool minusMode = false;
|
|
1340
|
-
unsigned numLines = 0;
|
|
1341
|
-
|
|
1342
|
-
while (pos < buf.Size())
|
|
1343
|
-
{
|
|
1344
|
-
if (!GetLine(buf, zeroMode, cr_lf_Mode, pos, s))
|
|
1345
|
-
return S_FALSE;
|
|
1346
|
-
numLines++;
|
|
1347
|
-
if (s.IsEmpty())
|
|
1348
|
-
continue;
|
|
1349
|
-
|
|
1350
|
-
if (s.IsPrefixedBy_Ascii_NoCase("; "))
|
|
1351
|
-
{
|
|
1352
|
-
if (numLines != 1)
|
|
1353
|
-
return S_FALSE;
|
|
1354
|
-
// comment line of FileVerifier++
|
|
1355
|
-
continue;
|
|
1356
|
-
}
|
|
1357
|
-
|
|
1358
|
-
if (s.IsPrefixedBy_Ascii_NoCase("-----"))
|
|
1359
|
-
{
|
|
1360
|
-
if (minusMode)
|
|
1361
|
-
break; // end of pgp mode
|
|
1362
|
-
minusMode = true;
|
|
1363
|
-
if (s.IsPrefixedBy_Ascii_NoCase("-----BEGIN PGP SIGNED MESSAGE"))
|
|
1364
|
-
{
|
|
1365
|
-
if (_is_PgpMethod)
|
|
1366
|
-
return S_FALSE;
|
|
1367
|
-
if (!GetLine(buf, zeroMode, cr_lf_Mode, pos, s))
|
|
1368
|
-
return S_FALSE;
|
|
1369
|
-
const char *kStart = "Hash: ";
|
|
1370
|
-
if (!s.IsPrefixedBy_Ascii_NoCase(kStart))
|
|
1371
|
-
return S_FALSE;
|
|
1372
|
-
_pgpMethod = s.Ptr((unsigned)strlen(kStart));
|
|
1373
|
-
_is_PgpMethod = true;
|
|
1374
|
-
}
|
|
1375
|
-
continue;
|
|
1376
|
-
}
|
|
1377
|
-
|
|
1378
|
-
CHashPair pair;
|
|
1379
|
-
pair.FullLine = s;
|
|
1380
|
-
if (cksumMode)
|
|
1381
|
-
{
|
|
1382
|
-
if (!pair.ParseCksum(s))
|
|
1383
|
-
return S_FALSE;
|
|
1384
|
-
}
|
|
1385
|
-
else if (!pair.Parse(s))
|
|
1386
|
-
return S_FALSE;
|
|
1387
|
-
pairs.Add(pair);
|
|
1388
|
-
}
|
|
1389
|
-
|
|
1390
|
-
{
|
|
1391
|
-
unsigned hashSize = 0;
|
|
1392
|
-
bool hashSize_Dismatch = false;
|
|
1393
|
-
for (unsigned i = 0; i < HashPairs.Size(); i++)
|
|
1394
|
-
{
|
|
1395
|
-
const CHashPair &hp = HashPairs[i];
|
|
1396
|
-
if (i == 0)
|
|
1397
|
-
hashSize = (unsigned)hp.Hash.Size();
|
|
1398
|
-
else
|
|
1399
|
-
if (hashSize != hp.Hash.Size())
|
|
1400
|
-
hashSize_Dismatch = true;
|
|
1401
|
-
|
|
1402
|
-
if (hp.IsBSD)
|
|
1403
|
-
_are_there_Tags = true;
|
|
1404
|
-
if (!_are_there_Dirs && hp.IsDir())
|
|
1405
|
-
_are_there_Dirs = true;
|
|
1406
|
-
}
|
|
1407
|
-
if (!hashSize_Dismatch && hashSize != 0)
|
|
1408
|
-
{
|
|
1409
|
-
_hashSize = hashSize;
|
|
1410
|
-
_hashSize_Defined = true;
|
|
1411
|
-
}
|
|
1412
|
-
}
|
|
1413
|
-
|
|
1414
|
-
_phySize = buf.Size();
|
|
1415
|
-
_isArc = true;
|
|
1416
|
-
return S_OK;
|
|
1417
|
-
}
|
|
1418
|
-
COM_TRY_END
|
|
1419
|
-
}
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
void CHandler::ClearVars()
|
|
1423
|
-
{
|
|
1424
|
-
_phySize = 0;
|
|
1425
|
-
_isArc = false;
|
|
1426
|
-
_is_CksumMode = false;
|
|
1427
|
-
_is_PgpMethod = false;
|
|
1428
|
-
_is_ZeroMode = false;
|
|
1429
|
-
_are_there_Tags = false;
|
|
1430
|
-
_are_there_Dirs = false;
|
|
1431
|
-
_is_KnownMethod_in_FileName = false;
|
|
1432
|
-
_hashSize_Defined = false;
|
|
1433
|
-
_hashSize = 0;
|
|
1434
|
-
}
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
Z7_COM7F_IMF(CHandler::Close())
|
|
1438
|
-
{
|
|
1439
|
-
ClearVars();
|
|
1440
|
-
_method_from_FileName.Empty();
|
|
1441
|
-
_method_for_Extraction.Empty();
|
|
1442
|
-
_pgpMethod.Empty();
|
|
1443
|
-
HashPairs.Clear();
|
|
1444
|
-
return S_OK;
|
|
1445
|
-
}
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
static bool CheckDigests(const Byte *a, const Byte *b, size_t size)
|
|
1449
|
-
{
|
|
1450
|
-
if (size <= 8)
|
|
1451
|
-
{
|
|
1452
|
-
/* we use reversed order for one digest, when text representation
|
|
1453
|
-
uses big-order for crc-32 and crc-64 */
|
|
1454
|
-
for (size_t i = 0; i < size; i++)
|
|
1455
|
-
if (a[i] != b[size - 1 - i])
|
|
1456
|
-
return false;
|
|
1457
|
-
return true;
|
|
1458
|
-
}
|
|
1459
|
-
{
|
|
1460
|
-
for (size_t i = 0; i < size; i++)
|
|
1461
|
-
if (a[i] != b[i])
|
|
1462
|
-
return false;
|
|
1463
|
-
return true;
|
|
1464
|
-
}
|
|
1465
|
-
}
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
static void AddDefaultMethod(UStringVector &methods,
|
|
1469
|
-
const char *name, unsigned size)
|
|
1470
|
-
{
|
|
1471
|
-
int shaVersion = -1;
|
|
1472
|
-
if (name)
|
|
1473
|
-
{
|
|
1474
|
-
if (StringsAreEqualNoCase_Ascii(name, "sha"))
|
|
1475
|
-
{
|
|
1476
|
-
shaVersion = 0;
|
|
1477
|
-
if (size == 0)
|
|
1478
|
-
size = 32;
|
|
1479
|
-
}
|
|
1480
|
-
else if (StringsAreEqualNoCase_Ascii(name, "sha1"))
|
|
1481
|
-
{
|
|
1482
|
-
shaVersion = 1;
|
|
1483
|
-
if (size == 0)
|
|
1484
|
-
size = 20;
|
|
1485
|
-
}
|
|
1486
|
-
else if (StringsAreEqualNoCase_Ascii(name, "sha2"))
|
|
1487
|
-
{
|
|
1488
|
-
shaVersion = 2;
|
|
1489
|
-
if (size == 0)
|
|
1490
|
-
size = 32;
|
|
1491
|
-
}
|
|
1492
|
-
else if (StringsAreEqualNoCase_Ascii(name, "sha3"))
|
|
1493
|
-
{
|
|
1494
|
-
if (size == 0 ||
|
|
1495
|
-
size == 32) name = "sha3-256";
|
|
1496
|
-
else if (size == 28) name = "sha3-224";
|
|
1497
|
-
else if (size == 48) name = "sha3-384";
|
|
1498
|
-
else if (size == 64) name = "sha3-512";
|
|
1499
|
-
}
|
|
1500
|
-
else if (StringsAreEqualNoCase_Ascii(name, "sha512"))
|
|
1501
|
-
{
|
|
1502
|
-
// we allow any sha512 derived hash inside .sha512 file:
|
|
1503
|
-
if (size == 48) name = "sha384";
|
|
1504
|
-
else if (size == 32) name = "sha512-256";
|
|
1505
|
-
else if (size == 28) name = "sha512-224";
|
|
1506
|
-
}
|
|
1507
|
-
if (shaVersion >= 0)
|
|
1508
|
-
name = NULL;
|
|
1509
|
-
}
|
|
1510
|
-
|
|
1511
|
-
const char *m = NULL;
|
|
1512
|
-
if (name)
|
|
1513
|
-
m = name;
|
|
1514
|
-
else
|
|
1515
|
-
{
|
|
1516
|
-
if (size == 64) m = "sha512";
|
|
1517
|
-
else if (size == 48) m = "sha384";
|
|
1518
|
-
else if (size == 32) m = "sha256";
|
|
1519
|
-
else if (size == 28) m = "sha224";
|
|
1520
|
-
else if (size == 20) m = "sha1";
|
|
1521
|
-
else if (shaVersion < 0)
|
|
1522
|
-
{
|
|
1523
|
-
if (size == 16) m = "md5";
|
|
1524
|
-
else if (size == 8) m = "crc64";
|
|
1525
|
-
else if (size == 4) m = "crc32";
|
|
1526
|
-
}
|
|
1527
|
-
}
|
|
1528
|
-
|
|
1529
|
-
if (!m)
|
|
1530
|
-
return;
|
|
1531
|
-
|
|
1532
|
-
#ifdef Z7_EXTERNAL_CODECS
|
|
1533
|
-
const CExternalCodecs *_externalCodecs = g_ExternalCodecs_Ptr;
|
|
1534
|
-
#endif
|
|
1535
|
-
CMethodId id;
|
|
1536
|
-
if (FindHashMethod(EXTERNAL_CODECS_LOC_VARS
|
|
1537
|
-
AString(m), id))
|
|
1538
|
-
methods.Add(UString(m));
|
|
1539
|
-
}
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
Z7_COM7F_IMF(CHandler::Extract(const UInt32 *indices, UInt32 numItems,
|
|
1543
|
-
Int32 testMode, IArchiveExtractCallback *extractCallback))
|
|
1544
|
-
{
|
|
1545
|
-
COM_TRY_BEGIN
|
|
1546
|
-
|
|
1547
|
-
/*
|
|
1548
|
-
if (testMode == 0)
|
|
1549
|
-
return E_NOTIMPL;
|
|
1550
|
-
*/
|
|
1551
|
-
|
|
1552
|
-
const bool allFilesMode = (numItems == (UInt32)(Int32)-1);
|
|
1553
|
-
if (allFilesMode)
|
|
1554
|
-
numItems = HashPairs.Size();
|
|
1555
|
-
if (numItems == 0)
|
|
1556
|
-
return S_OK;
|
|
1557
|
-
|
|
1558
|
-
#ifdef Z7_EXTERNAL_CODECS
|
|
1559
|
-
const CExternalCodecs *_externalCodecs = g_ExternalCodecs_Ptr;
|
|
1560
|
-
#endif
|
|
1561
|
-
|
|
1562
|
-
CHashBundle hb_Glob;
|
|
1563
|
-
// UStringVector methods = options.Methods;
|
|
1564
|
-
UStringVector methods;
|
|
1565
|
-
|
|
1566
|
-
/*
|
|
1567
|
-
if (methods.IsEmpty() && !utf_nameExtenstion.IsEmpty() && !_hashSize_Defined)
|
|
1568
|
-
{
|
|
1569
|
-
CMethodId id;
|
|
1570
|
-
if (FindHashMethod(EXTERNAL_CODECS_LOC_VARS utf_nameExtenstion, id))
|
|
1571
|
-
methods.Add(_nameExtenstion);
|
|
1572
|
-
}
|
|
1573
|
-
*/
|
|
1574
|
-
|
|
1575
|
-
if (methods.IsEmpty() && !_pgpMethod.IsEmpty())
|
|
1576
|
-
{
|
|
1577
|
-
CMethodId id;
|
|
1578
|
-
if (FindHashMethod(EXTERNAL_CODECS_LOC_VARS _pgpMethod, id))
|
|
1579
|
-
methods.Add(UString(_pgpMethod));
|
|
1580
|
-
}
|
|
1581
|
-
|
|
1582
|
-
/*
|
|
1583
|
-
if (methods.IsEmpty() && _pgpMethod.IsEmpty() && _hashSize_Defined)
|
|
1584
|
-
{
|
|
1585
|
-
AddDefaultMethod(methods,
|
|
1586
|
-
utf_nameExtenstion.IsEmpty() ? NULL : utf_nameExtenstion.Ptr(),
|
|
1587
|
-
_hashSize);
|
|
1588
|
-
}
|
|
1589
|
-
*/
|
|
1590
|
-
|
|
1591
|
-
if (!methods.IsEmpty())
|
|
1592
|
-
{
|
|
1593
|
-
RINOK(hb_Glob.SetMethods(
|
|
1594
|
-
EXTERNAL_CODECS_LOC_VARS
|
|
1595
|
-
methods))
|
|
1596
|
-
}
|
|
1597
|
-
|
|
1598
|
-
Z7_DECL_CMyComPtr_QI_FROM(
|
|
1599
|
-
IArchiveUpdateCallbackFile,
|
|
1600
|
-
updateCallbackFile, extractCallback)
|
|
1601
|
-
if (!updateCallbackFile)
|
|
1602
|
-
return E_NOTIMPL;
|
|
1603
|
-
{
|
|
1604
|
-
Z7_DECL_CMyComPtr_QI_FROM(
|
|
1605
|
-
IArchiveGetDiskProperty,
|
|
1606
|
-
GetDiskProperty, extractCallback)
|
|
1607
|
-
if (GetDiskProperty)
|
|
1608
|
-
{
|
|
1609
|
-
UInt64 totalSize = 0;
|
|
1610
|
-
UInt32 i;
|
|
1611
|
-
for (i = 0; i < numItems; i++)
|
|
1612
|
-
{
|
|
1613
|
-
const UInt32 index = allFilesMode ? i : indices[i];
|
|
1614
|
-
const CHashPair &hp = HashPairs[index];
|
|
1615
|
-
if (hp.IsDir())
|
|
1616
|
-
continue;
|
|
1617
|
-
{
|
|
1618
|
-
NCOM::CPropVariant prop;
|
|
1619
|
-
RINOK(GetDiskProperty->GetDiskProperty(index, kpidSize, &prop))
|
|
1620
|
-
if (prop.vt != VT_UI8)
|
|
1621
|
-
continue;
|
|
1622
|
-
totalSize += prop.uhVal.QuadPart;
|
|
1623
|
-
}
|
|
1624
|
-
}
|
|
1625
|
-
RINOK(extractCallback->SetTotal(totalSize))
|
|
1626
|
-
// RINOK(Hash_SetTotalUnpacked->Hash_SetTotalUnpacked(indices, numItems));
|
|
1627
|
-
}
|
|
1628
|
-
}
|
|
1629
|
-
|
|
1630
|
-
const UInt32 kBufSize = 1 << 15;
|
|
1631
|
-
CHashMidBuf buf;
|
|
1632
|
-
if (!buf.Alloc(kBufSize))
|
|
1633
|
-
return E_OUTOFMEMORY;
|
|
1634
|
-
|
|
1635
|
-
CMyComPtr2_Create<ICompressProgressInfo, CLocalProgress> lps;
|
|
1636
|
-
lps->Init(extractCallback, false);
|
|
1637
|
-
|
|
1638
|
-
for (UInt32 i = 0;; i++)
|
|
1639
|
-
{
|
|
1640
|
-
RINOK(lps->SetCur())
|
|
1641
|
-
if (i >= numItems)
|
|
1642
|
-
break;
|
|
1643
|
-
const UInt32 index = allFilesMode ? i : indices[i];
|
|
1644
|
-
|
|
1645
|
-
CHashPair &hp = HashPairs[index];
|
|
1646
|
-
|
|
1647
|
-
UString path;
|
|
1648
|
-
hp.Get_UString_Path(path);
|
|
1649
|
-
|
|
1650
|
-
CMyComPtr<ISequentialInStream> inStream;
|
|
1651
|
-
const bool isDir = hp.IsDir();
|
|
1652
|
-
if (!isDir)
|
|
1653
|
-
{
|
|
1654
|
-
RINOK(updateCallbackFile->GetStream2(index, &inStream, NUpdateNotifyOp::kHashRead))
|
|
1655
|
-
if (!inStream)
|
|
1656
|
-
{
|
|
1657
|
-
continue; // we have shown error in GetStream2()
|
|
1658
|
-
}
|
|
1659
|
-
// askMode = NArchive::NExtract::NAskMode::kSkip;
|
|
1660
|
-
}
|
|
1661
|
-
|
|
1662
|
-
Int32 askMode = testMode ?
|
|
1663
|
-
NArchive::NExtract::NAskMode::kTest :
|
|
1664
|
-
NArchive::NExtract::NAskMode::kExtract;
|
|
1665
|
-
|
|
1666
|
-
CMyComPtr<ISequentialOutStream> realOutStream;
|
|
1667
|
-
RINOK(extractCallback->GetStream(index, &realOutStream, askMode))
|
|
1668
|
-
|
|
1669
|
-
/* PrepareOperation() can expect kExtract to set
|
|
1670
|
-
Attrib and security of output file */
|
|
1671
|
-
askMode = NArchive::NExtract::NAskMode::kReadExternal;
|
|
1672
|
-
|
|
1673
|
-
RINOK(extractCallback->PrepareOperation(askMode))
|
|
1674
|
-
|
|
1675
|
-
const bool isAltStream = false;
|
|
1676
|
-
|
|
1677
|
-
UInt64 fileSize = 0;
|
|
1678
|
-
|
|
1679
|
-
CHashBundle hb_Loc;
|
|
1680
|
-
|
|
1681
|
-
CHashBundle *hb_Use = &hb_Glob;
|
|
1682
|
-
|
|
1683
|
-
HRESULT res_SetMethods = S_OK;
|
|
1684
|
-
|
|
1685
|
-
UStringVector methods_loc;
|
|
1686
|
-
|
|
1687
|
-
if (!hp.Method.IsEmpty())
|
|
1688
|
-
{
|
|
1689
|
-
hb_Use = &hb_Loc;
|
|
1690
|
-
CMethodId id;
|
|
1691
|
-
AString methodName = hp.Method;
|
|
1692
|
-
Convert_TagName_to_MethodName(methodName);
|
|
1693
|
-
if (FindHashMethod(EXTERNAL_CODECS_LOC_VARS methodName, id))
|
|
1694
|
-
{
|
|
1695
|
-
methods_loc.Add(UString(methodName));
|
|
1696
|
-
RINOK(hb_Loc.SetMethods(
|
|
1697
|
-
EXTERNAL_CODECS_LOC_VARS
|
|
1698
|
-
methods_loc))
|
|
1699
|
-
}
|
|
1700
|
-
else
|
|
1701
|
-
res_SetMethods = E_NOTIMPL;
|
|
1702
|
-
}
|
|
1703
|
-
else if (methods.IsEmpty())
|
|
1704
|
-
{
|
|
1705
|
-
AddDefaultMethod(methods_loc,
|
|
1706
|
-
_method_for_Extraction.IsEmpty() ? NULL :
|
|
1707
|
-
_method_for_Extraction.Ptr(),
|
|
1708
|
-
(unsigned)hp.Hash.Size());
|
|
1709
|
-
if (!methods_loc.IsEmpty())
|
|
1710
|
-
{
|
|
1711
|
-
hb_Use = &hb_Loc;
|
|
1712
|
-
RINOK(hb_Loc.SetMethods(
|
|
1713
|
-
EXTERNAL_CODECS_LOC_VARS
|
|
1714
|
-
methods_loc))
|
|
1715
|
-
}
|
|
1716
|
-
}
|
|
1717
|
-
|
|
1718
|
-
const bool isSupportedMode = hp.IsSupportedMode();
|
|
1719
|
-
hb_Use->InitForNewFile();
|
|
1720
|
-
|
|
1721
|
-
if (inStream)
|
|
1722
|
-
{
|
|
1723
|
-
for (UInt32 step = 0;; step++)
|
|
1724
|
-
{
|
|
1725
|
-
if ((step & 0xFF) == 0)
|
|
1726
|
-
{
|
|
1727
|
-
RINOK(lps.Interface()->SetRatioInfo(NULL, &fileSize))
|
|
1728
|
-
}
|
|
1729
|
-
UInt32 size;
|
|
1730
|
-
RINOK(inStream->Read(buf, kBufSize, &size))
|
|
1731
|
-
if (size == 0)
|
|
1732
|
-
break;
|
|
1733
|
-
hb_Use->Update(buf, size);
|
|
1734
|
-
if (realOutStream)
|
|
1735
|
-
{
|
|
1736
|
-
RINOK(WriteStream(realOutStream, buf, size))
|
|
1737
|
-
}
|
|
1738
|
-
fileSize += size;
|
|
1739
|
-
}
|
|
1740
|
-
|
|
1741
|
-
hp.Size_from_Disk = fileSize;
|
|
1742
|
-
hp.Size_from_Disk_Defined = true;
|
|
1743
|
-
}
|
|
1744
|
-
|
|
1745
|
-
realOutStream.Release();
|
|
1746
|
-
inStream.Release();
|
|
1747
|
-
|
|
1748
|
-
lps->InSize += hp.Hash.Size();
|
|
1749
|
-
lps->OutSize += fileSize;
|
|
1750
|
-
|
|
1751
|
-
hb_Use->Final(isDir, isAltStream, path);
|
|
1752
|
-
|
|
1753
|
-
Int32 opRes = NArchive::NExtract::NOperationResult::kUnsupportedMethod;
|
|
1754
|
-
if (isSupportedMode
|
|
1755
|
-
&& res_SetMethods != E_NOTIMPL
|
|
1756
|
-
&& !hb_Use->Hashers.IsEmpty()
|
|
1757
|
-
)
|
|
1758
|
-
{
|
|
1759
|
-
const CHasherState &hs = hb_Use->Hashers[0];
|
|
1760
|
-
if (hs.DigestSize == hp.Hash.Size())
|
|
1761
|
-
{
|
|
1762
|
-
opRes = NArchive::NExtract::NOperationResult::kCRCError;
|
|
1763
|
-
if (CheckDigests(hp.Hash, hs.Digests[0], hs.DigestSize))
|
|
1764
|
-
if (!hp.Size_from_Arc_Defined || hp.Size_from_Arc == fileSize)
|
|
1765
|
-
opRes = NArchive::NExtract::NOperationResult::kOK;
|
|
1766
|
-
}
|
|
1767
|
-
}
|
|
1768
|
-
|
|
1769
|
-
RINOK(extractCallback->SetOperationResult(opRes))
|
|
1770
|
-
}
|
|
1771
|
-
|
|
1772
|
-
return S_OK;
|
|
1773
|
-
COM_TRY_END
|
|
1774
|
-
}
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
// ---------- UPDATE ----------
|
|
1778
|
-
|
|
1779
|
-
struct CUpdateItem
|
|
1780
|
-
{
|
|
1781
|
-
int IndexInArc;
|
|
1782
|
-
unsigned IndexInClient;
|
|
1783
|
-
UInt64 Size;
|
|
1784
|
-
bool NewData;
|
|
1785
|
-
bool NewProps;
|
|
1786
|
-
bool IsDir;
|
|
1787
|
-
UString Path;
|
|
1788
|
-
|
|
1789
|
-
CUpdateItem(): Size(0), IsDir(false) {}
|
|
1790
|
-
};
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
static HRESULT GetPropString(IArchiveUpdateCallback *callback, UInt32 index, PROPID propId,
|
|
1794
|
-
UString &res,
|
|
1795
|
-
bool convertSlash)
|
|
1796
|
-
{
|
|
1797
|
-
NCOM::CPropVariant prop;
|
|
1798
|
-
RINOK(callback->GetProperty(index, propId, &prop))
|
|
1799
|
-
if (prop.vt == VT_BSTR)
|
|
1800
|
-
{
|
|
1801
|
-
res = prop.bstrVal;
|
|
1802
|
-
if (convertSlash)
|
|
1803
|
-
NArchive::NItemName::ReplaceSlashes_OsToUnix(res);
|
|
1804
|
-
}
|
|
1805
|
-
else if (prop.vt != VT_EMPTY)
|
|
1806
|
-
return E_INVALIDARG;
|
|
1807
|
-
return S_OK;
|
|
1808
|
-
}
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
Z7_COM7F_IMF(CHandler::GetFileTimeType(UInt32 *type))
|
|
1812
|
-
{
|
|
1813
|
-
*type = NFileTimeType::kUnix;
|
|
1814
|
-
return S_OK;
|
|
1815
|
-
}
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
Z7_COM7F_IMF(CHandler::UpdateItems(ISequentialOutStream *outStream, UInt32 numItems,
|
|
1819
|
-
IArchiveUpdateCallback *callback))
|
|
1820
|
-
{
|
|
1821
|
-
COM_TRY_BEGIN
|
|
1822
|
-
|
|
1823
|
-
if (_isArc && !CanUpdate())
|
|
1824
|
-
return E_NOTIMPL;
|
|
1825
|
-
|
|
1826
|
-
/*
|
|
1827
|
-
Z7_DECL_CMyComPtr_QI_FROM(IArchiveUpdateCallbackArcProp,
|
|
1828
|
-
reportArcProp, callback)
|
|
1829
|
-
*/
|
|
1830
|
-
|
|
1831
|
-
CObjectVector<CUpdateItem> updateItems;
|
|
1832
|
-
|
|
1833
|
-
UInt64 complexity = 0;
|
|
1834
|
-
|
|
1835
|
-
UInt32 i;
|
|
1836
|
-
for (i = 0; i < numItems; i++)
|
|
1837
|
-
{
|
|
1838
|
-
CUpdateItem ui;
|
|
1839
|
-
Int32 newData;
|
|
1840
|
-
Int32 newProps;
|
|
1841
|
-
UInt32 indexInArc;
|
|
1842
|
-
|
|
1843
|
-
if (!callback)
|
|
1844
|
-
return E_FAIL;
|
|
1845
|
-
|
|
1846
|
-
RINOK(callback->GetUpdateItemInfo(i, &newData, &newProps, &indexInArc))
|
|
1847
|
-
|
|
1848
|
-
ui.NewProps = IntToBool(newProps);
|
|
1849
|
-
ui.NewData = IntToBool(newData);
|
|
1850
|
-
ui.IndexInArc = (int)indexInArc;
|
|
1851
|
-
ui.IndexInClient = i;
|
|
1852
|
-
if (IntToBool(newProps))
|
|
1853
|
-
{
|
|
1854
|
-
{
|
|
1855
|
-
NCOM::CPropVariant prop;
|
|
1856
|
-
RINOK(callback->GetProperty(i, kpidIsDir, &prop))
|
|
1857
|
-
if (prop.vt == VT_EMPTY)
|
|
1858
|
-
ui.IsDir = false;
|
|
1859
|
-
else if (prop.vt != VT_BOOL)
|
|
1860
|
-
return E_INVALIDARG;
|
|
1861
|
-
else
|
|
1862
|
-
ui.IsDir = (prop.boolVal != VARIANT_FALSE);
|
|
1863
|
-
}
|
|
1864
|
-
|
|
1865
|
-
RINOK(GetPropString(callback, i, kpidPath, ui.Path,
|
|
1866
|
-
true)) // convertSlash
|
|
1867
|
-
/*
|
|
1868
|
-
if (ui.IsDir && !ui.Name.IsEmpty() && ui.Name.Back() != '/')
|
|
1869
|
-
ui.Name += '/';
|
|
1870
|
-
*/
|
|
1871
|
-
}
|
|
1872
|
-
|
|
1873
|
-
if (IntToBool(newData))
|
|
1874
|
-
{
|
|
1875
|
-
NCOM::CPropVariant prop;
|
|
1876
|
-
RINOK(callback->GetProperty(i, kpidSize, &prop))
|
|
1877
|
-
if (prop.vt == VT_UI8)
|
|
1878
|
-
{
|
|
1879
|
-
ui.Size = prop.uhVal.QuadPart;
|
|
1880
|
-
complexity += ui.Size;
|
|
1881
|
-
}
|
|
1882
|
-
else if (prop.vt == VT_EMPTY)
|
|
1883
|
-
ui.Size = (UInt64)(Int64)-1;
|
|
1884
|
-
else
|
|
1885
|
-
return E_INVALIDARG;
|
|
1886
|
-
}
|
|
1887
|
-
|
|
1888
|
-
updateItems.Add(ui);
|
|
1889
|
-
}
|
|
1890
|
-
|
|
1891
|
-
if (complexity != 0)
|
|
1892
|
-
{
|
|
1893
|
-
RINOK(callback->SetTotal(complexity))
|
|
1894
|
-
}
|
|
1895
|
-
|
|
1896
|
-
#ifdef Z7_EXTERNAL_CODECS
|
|
1897
|
-
const CExternalCodecs *_externalCodecs = g_ExternalCodecs_Ptr;
|
|
1898
|
-
#endif
|
|
1899
|
-
|
|
1900
|
-
CHashBundle hb;
|
|
1901
|
-
UStringVector methods;
|
|
1902
|
-
if (!_methods.IsEmpty())
|
|
1903
|
-
{
|
|
1904
|
-
FOR_VECTOR(k, _methods)
|
|
1905
|
-
{
|
|
1906
|
-
methods.Add(_methods[k]);
|
|
1907
|
-
}
|
|
1908
|
-
}
|
|
1909
|
-
else
|
|
1910
|
-
{
|
|
1911
|
-
Z7_DECL_CMyComPtr_QI_FROM(
|
|
1912
|
-
IArchiveGetRootProps,
|
|
1913
|
-
getRootProps, callback)
|
|
1914
|
-
if (getRootProps)
|
|
1915
|
-
{
|
|
1916
|
-
NCOM::CPropVariant prop;
|
|
1917
|
-
RINOK(getRootProps->GetRootProp(kpidArcFileName, &prop))
|
|
1918
|
-
if (prop.vt == VT_BSTR)
|
|
1919
|
-
{
|
|
1920
|
-
AString method;
|
|
1921
|
-
/* const bool isKnownMethod = */ GetMethod_from_FileName(prop.bstrVal, method);
|
|
1922
|
-
if (!method.IsEmpty())
|
|
1923
|
-
{
|
|
1924
|
-
AddDefaultMethod(methods, method, _crcSize_WasSet ? _crcSize : 0);
|
|
1925
|
-
if (methods.IsEmpty())
|
|
1926
|
-
return E_NOTIMPL;
|
|
1927
|
-
}
|
|
1928
|
-
}
|
|
1929
|
-
}
|
|
1930
|
-
}
|
|
1931
|
-
if (methods.IsEmpty() && _crcSize_WasSet)
|
|
1932
|
-
{
|
|
1933
|
-
AddDefaultMethod(methods,
|
|
1934
|
-
NULL, // name
|
|
1935
|
-
_crcSize);
|
|
1936
|
-
}
|
|
1937
|
-
|
|
1938
|
-
RINOK(hb.SetMethods(EXTERNAL_CODECS_LOC_VARS methods))
|
|
1939
|
-
|
|
1940
|
-
CMyComPtr2_Create<ICompressProgressInfo, CLocalProgress> lps;
|
|
1941
|
-
lps->Init(callback, true);
|
|
1942
|
-
|
|
1943
|
-
const UInt32 kBufSize = 1 << 15;
|
|
1944
|
-
CHashMidBuf buf;
|
|
1945
|
-
if (!buf.Alloc(kBufSize))
|
|
1946
|
-
return E_OUTOFMEMORY;
|
|
1947
|
-
|
|
1948
|
-
CDynLimBuf hashFileString((size_t)1 << 31);
|
|
1949
|
-
|
|
1950
|
-
CHashOptionsLocal options = _options;
|
|
1951
|
-
|
|
1952
|
-
if (_isArc)
|
|
1953
|
-
{
|
|
1954
|
-
if (!options.HashMode_Zero.Def && _is_ZeroMode)
|
|
1955
|
-
options.HashMode_Zero.Val = true;
|
|
1956
|
-
if (!options.HashMode_Tag.Def && _are_there_Tags)
|
|
1957
|
-
options.HashMode_Tag.Val = true;
|
|
1958
|
-
if (!options.HashMode_Dirs.Def && _are_there_Dirs)
|
|
1959
|
-
options.HashMode_Dirs.Val = true;
|
|
1960
|
-
}
|
|
1961
|
-
if (options.HashMode_OnlyHash.Val && updateItems.Size() != 1)
|
|
1962
|
-
options.HashMode_OnlyHash.Val = false;
|
|
1963
|
-
|
|
1964
|
-
complexity = 0;
|
|
1965
|
-
|
|
1966
|
-
for (i = 0; i < updateItems.Size(); i++)
|
|
1967
|
-
{
|
|
1968
|
-
lps->InSize = complexity;
|
|
1969
|
-
RINOK(lps->SetCur())
|
|
1970
|
-
|
|
1971
|
-
const CUpdateItem &ui = updateItems[i];
|
|
1972
|
-
|
|
1973
|
-
/*
|
|
1974
|
-
CHashPair item;
|
|
1975
|
-
if (!ui.NewProps)
|
|
1976
|
-
item = HashPairs[(unsigned)ui.IndexInArc];
|
|
1977
|
-
*/
|
|
1978
|
-
|
|
1979
|
-
if (ui.NewData)
|
|
1980
|
-
{
|
|
1981
|
-
UInt64 currentComplexity = ui.Size;
|
|
1982
|
-
UInt64 fileSize = 0;
|
|
1983
|
-
|
|
1984
|
-
CMyComPtr<ISequentialInStream> fileInStream;
|
|
1985
|
-
bool needWrite = true;
|
|
1986
|
-
{
|
|
1987
|
-
HRESULT res = callback->GetStream(ui.IndexInClient, &fileInStream);
|
|
1988
|
-
|
|
1989
|
-
if (res == S_FALSE)
|
|
1990
|
-
needWrite = false;
|
|
1991
|
-
else
|
|
1992
|
-
{
|
|
1993
|
-
RINOK(res)
|
|
1994
|
-
|
|
1995
|
-
if (fileInStream)
|
|
1996
|
-
{
|
|
1997
|
-
Z7_DECL_CMyComPtr_QI_FROM(
|
|
1998
|
-
IStreamGetSize,
|
|
1999
|
-
streamGetSize, fileInStream)
|
|
2000
|
-
if (streamGetSize)
|
|
2001
|
-
{
|
|
2002
|
-
UInt64 size;
|
|
2003
|
-
if (streamGetSize->GetSize(&size) == S_OK)
|
|
2004
|
-
currentComplexity = size;
|
|
2005
|
-
}
|
|
2006
|
-
/*
|
|
2007
|
-
Z7_DECL_CMyComPtr_QI_FROM(
|
|
2008
|
-
IStreamGetProps,
|
|
2009
|
-
getProps, fileInStream)
|
|
2010
|
-
if (getProps)
|
|
2011
|
-
{
|
|
2012
|
-
FILETIME mTime;
|
|
2013
|
-
UInt64 size2;
|
|
2014
|
-
if (getProps->GetProps(&size2, NULL, NULL, &mTime, NULL) == S_OK)
|
|
2015
|
-
{
|
|
2016
|
-
currentComplexity = size2;
|
|
2017
|
-
// item.MTime = NTime::FileTimeToUnixTime64(mTime);;
|
|
2018
|
-
}
|
|
2019
|
-
}
|
|
2020
|
-
*/
|
|
2021
|
-
}
|
|
2022
|
-
else
|
|
2023
|
-
{
|
|
2024
|
-
currentComplexity = 0;
|
|
2025
|
-
}
|
|
2026
|
-
}
|
|
2027
|
-
}
|
|
2028
|
-
|
|
2029
|
-
hb.InitForNewFile();
|
|
2030
|
-
const bool isDir = ui.IsDir;
|
|
2031
|
-
|
|
2032
|
-
if (needWrite && fileInStream && !isDir)
|
|
2033
|
-
{
|
|
2034
|
-
for (UInt32 step = 0;; step++)
|
|
2035
|
-
{
|
|
2036
|
-
if ((step & 0xFF) == 0)
|
|
2037
|
-
{
|
|
2038
|
-
RINOK(lps.Interface()->SetRatioInfo(&fileSize, NULL))
|
|
2039
|
-
// RINOK(callback->SetCompleted(&completeValue));
|
|
2040
|
-
}
|
|
2041
|
-
UInt32 size;
|
|
2042
|
-
RINOK(fileInStream->Read(buf, kBufSize, &size))
|
|
2043
|
-
if (size == 0)
|
|
2044
|
-
break;
|
|
2045
|
-
hb.Update(buf, size);
|
|
2046
|
-
fileSize += size;
|
|
2047
|
-
}
|
|
2048
|
-
currentComplexity = fileSize;
|
|
2049
|
-
}
|
|
2050
|
-
|
|
2051
|
-
fileInStream.Release();
|
|
2052
|
-
const bool isAltStream = false;
|
|
2053
|
-
hb.Final(isDir, isAltStream, ui.Path);
|
|
2054
|
-
|
|
2055
|
-
if (options.HashMode_Dirs.Val || !isDir)
|
|
2056
|
-
{
|
|
2057
|
-
if (!hb.Hashers.IsEmpty())
|
|
2058
|
-
lps->OutSize += hb.Hashers[0].DigestSize;
|
|
2059
|
-
WriteLine(hashFileString,
|
|
2060
|
-
options,
|
|
2061
|
-
ui.Path,
|
|
2062
|
-
isDir,
|
|
2063
|
-
hb);
|
|
2064
|
-
if (hashFileString.IsError())
|
|
2065
|
-
return E_OUTOFMEMORY;
|
|
2066
|
-
}
|
|
2067
|
-
|
|
2068
|
-
complexity += currentComplexity;
|
|
2069
|
-
|
|
2070
|
-
/*
|
|
2071
|
-
if (reportArcProp)
|
|
2072
|
-
{
|
|
2073
|
-
PROPVARIANT prop;
|
|
2074
|
-
prop.vt = VT_EMPTY;
|
|
2075
|
-
prop.wReserved1 = 0;
|
|
2076
|
-
|
|
2077
|
-
NCOM::PropVarEm_Set_UInt64(&prop, fileSize);
|
|
2078
|
-
RINOK(reportArcProp->ReportProp(NArchive::NEventIndexType::kOutArcIndex, ui.IndexInClient, kpidSize, &prop));
|
|
2079
|
-
|
|
2080
|
-
for (unsigned k = 0; k < hb.Hashers.Size(); k++)
|
|
2081
|
-
{
|
|
2082
|
-
const CHasherState &hs = hb.Hashers[k];
|
|
2083
|
-
|
|
2084
|
-
if (hs.DigestSize == 4 && hs.Name.IsEqualTo_Ascii_NoCase("crc32"))
|
|
2085
|
-
{
|
|
2086
|
-
NCOM::PropVarEm_Set_UInt32(&prop, GetUi32(hs.Digests[k_HashCalc_Index_Current]));
|
|
2087
|
-
RINOK(reportArcProp->ReportProp(NArchive::NEventIndexType::kOutArcIndex, ui.IndexInClient, kpidCRC, &prop));
|
|
2088
|
-
}
|
|
2089
|
-
else
|
|
2090
|
-
{
|
|
2091
|
-
RINOK(reportArcProp->ReportRawProp(NArchive::NEventIndexType::kOutArcIndex, ui.IndexInClient,
|
|
2092
|
-
kpidChecksum, hs.Digests[k_HashCalc_Index_Current],
|
|
2093
|
-
hs.DigestSize, NPropDataType::kRaw));
|
|
2094
|
-
}
|
|
2095
|
-
RINOK(reportArcProp->ReportFinished(NArchive::NEventIndexType::kOutArcIndex, ui.IndexInClient, NArchive::NUpdate::NOperationResult::kOK));
|
|
2096
|
-
}
|
|
2097
|
-
}
|
|
2098
|
-
*/
|
|
2099
|
-
RINOK(callback->SetOperationResult(NArchive::NUpdate::NOperationResult::kOK))
|
|
2100
|
-
}
|
|
2101
|
-
else
|
|
2102
|
-
{
|
|
2103
|
-
// old data
|
|
2104
|
-
const CHashPair &existItem = HashPairs[(unsigned)ui.IndexInArc];
|
|
2105
|
-
if (ui.NewProps)
|
|
2106
|
-
{
|
|
2107
|
-
WriteLine(hashFileString,
|
|
2108
|
-
options,
|
|
2109
|
-
ui.Path,
|
|
2110
|
-
ui.IsDir,
|
|
2111
|
-
existItem.Method, existItem.HashString
|
|
2112
|
-
);
|
|
2113
|
-
}
|
|
2114
|
-
else
|
|
2115
|
-
{
|
|
2116
|
-
hashFileString += existItem.FullLine;
|
|
2117
|
-
Add_LF(hashFileString, options);
|
|
2118
|
-
}
|
|
2119
|
-
}
|
|
2120
|
-
if (hashFileString.IsError())
|
|
2121
|
-
return E_OUTOFMEMORY;
|
|
2122
|
-
}
|
|
2123
|
-
|
|
2124
|
-
RINOK(WriteStream(outStream, hashFileString, hashFileString.Len()))
|
|
2125
|
-
|
|
2126
|
-
return S_OK;
|
|
2127
|
-
COM_TRY_END
|
|
2128
|
-
}
|
|
2129
|
-
|
|
2130
|
-
|
|
2131
|
-
|
|
2132
|
-
HRESULT CHandler::SetProperty(const wchar_t *nameSpec, const PROPVARIANT &value)
|
|
2133
|
-
{
|
|
2134
|
-
UString name = nameSpec;
|
|
2135
|
-
name.MakeLower_Ascii();
|
|
2136
|
-
if (name.IsEmpty())
|
|
2137
|
-
return E_INVALIDARG;
|
|
2138
|
-
|
|
2139
|
-
if (name.IsEqualTo("m")) // "hm" hash method
|
|
2140
|
-
{
|
|
2141
|
-
// COneMethodInfo omi;
|
|
2142
|
-
// RINOK(omi.ParseMethodFromPROPVARIANT(L"", value));
|
|
2143
|
-
// _methods.Add(omi.MethodName); // change it. use omi.PropsString
|
|
2144
|
-
if (value.vt != VT_BSTR)
|
|
2145
|
-
return E_INVALIDARG;
|
|
2146
|
-
UString s (value.bstrVal);
|
|
2147
|
-
_methods.Add(s);
|
|
2148
|
-
return S_OK;
|
|
2149
|
-
}
|
|
2150
|
-
|
|
2151
|
-
if (name.IsEqualTo("flags"))
|
|
2152
|
-
{
|
|
2153
|
-
if (value.vt != VT_BSTR)
|
|
2154
|
-
return E_INVALIDARG;
|
|
2155
|
-
if (!_options.ParseString(value.bstrVal))
|
|
2156
|
-
return E_INVALIDARG;
|
|
2157
|
-
return S_OK;
|
|
2158
|
-
}
|
|
2159
|
-
|
|
2160
|
-
if (name.IsEqualTo("backslash"))
|
|
2161
|
-
return PROPVARIANT_to_bool(value, _supportWindowsBackslash);
|
|
2162
|
-
|
|
2163
|
-
if (name.IsPrefixedBy_Ascii_NoCase("crc"))
|
|
2164
|
-
{
|
|
2165
|
-
name.Delete(0, 3);
|
|
2166
|
-
_crcSize = 4;
|
|
2167
|
-
_crcSize_WasSet = true;
|
|
2168
|
-
return ParsePropToUInt32(name, value, _crcSize);
|
|
2169
|
-
}
|
|
2170
|
-
|
|
2171
|
-
// common properties
|
|
2172
|
-
if (name.IsPrefixedBy_Ascii_NoCase("mt")
|
|
2173
|
-
|| name.IsPrefixedBy_Ascii_NoCase("memuse"))
|
|
2174
|
-
return S_OK;
|
|
2175
|
-
|
|
2176
|
-
return E_INVALIDARG;
|
|
2177
|
-
}
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
void CHandler::InitProps()
|
|
2181
|
-
{
|
|
2182
|
-
_supportWindowsBackslash = true;
|
|
2183
|
-
_crcSize_WasSet = false;
|
|
2184
|
-
_crcSize = 4;
|
|
2185
|
-
_methods.Clear();
|
|
2186
|
-
_options.Init_HashOptionsLocal();
|
|
2187
|
-
}
|
|
2188
|
-
|
|
2189
|
-
Z7_COM7F_IMF(CHandler::SetProperties(const wchar_t * const *names, const PROPVARIANT *values, UInt32 numProps))
|
|
2190
|
-
{
|
|
2191
|
-
COM_TRY_BEGIN
|
|
2192
|
-
|
|
2193
|
-
InitProps();
|
|
2194
|
-
|
|
2195
|
-
for (UInt32 i = 0; i < numProps; i++)
|
|
2196
|
-
{
|
|
2197
|
-
RINOK(SetProperty(names[i], values[i]))
|
|
2198
|
-
}
|
|
2199
|
-
return S_OK;
|
|
2200
|
-
COM_TRY_END
|
|
2201
|
-
}
|
|
2202
|
-
|
|
2203
|
-
CHandler::CHandler()
|
|
2204
|
-
{
|
|
2205
|
-
ClearVars();
|
|
2206
|
-
InitProps();
|
|
2207
|
-
}
|
|
2208
|
-
|
|
2209
|
-
}
|
|
2210
|
-
|
|
2211
|
-
|
|
2212
|
-
|
|
2213
|
-
static IInArchive *CreateHashHandler_In() { return new NHash::CHandler; }
|
|
2214
|
-
static IOutArchive *CreateHashHandler_Out() { return new NHash::CHandler; }
|
|
2215
|
-
|
|
2216
|
-
void Codecs_AddHashArcHandler(CCodecs *codecs)
|
|
2217
|
-
{
|
|
2218
|
-
{
|
|
2219
|
-
CArcInfoEx item;
|
|
2220
|
-
|
|
2221
|
-
item.Name = "Hash";
|
|
2222
|
-
item.CreateInArchive = CreateHashHandler_In;
|
|
2223
|
-
item.CreateOutArchive = CreateHashHandler_Out;
|
|
2224
|
-
item.IsArcFunc = NULL;
|
|
2225
|
-
item.Flags =
|
|
2226
|
-
NArcInfoFlags::kKeepName
|
|
2227
|
-
| NArcInfoFlags::kStartOpen
|
|
2228
|
-
| NArcInfoFlags::kByExtOnlyOpen
|
|
2229
|
-
// | NArcInfoFlags::kPureStartOpen
|
|
2230
|
-
| NArcInfoFlags::kHashHandler
|
|
2231
|
-
;
|
|
2232
|
-
|
|
2233
|
-
// ubuntu uses "SHA256SUMS" file
|
|
2234
|
-
item.AddExts(UString (
|
|
2235
|
-
"sha256"
|
|
2236
|
-
" sha512"
|
|
2237
|
-
" sha384"
|
|
2238
|
-
" sha224"
|
|
2239
|
-
" sha512-224"
|
|
2240
|
-
" sha512-256"
|
|
2241
|
-
" sha3-224"
|
|
2242
|
-
" sha3-256"
|
|
2243
|
-
" sha3-384"
|
|
2244
|
-
" sha3-512"
|
|
2245
|
-
// " shake128"
|
|
2246
|
-
// " shake256"
|
|
2247
|
-
" sha1"
|
|
2248
|
-
" sha2"
|
|
2249
|
-
" sha3"
|
|
2250
|
-
" sha"
|
|
2251
|
-
" md5"
|
|
2252
|
-
" blake2s"
|
|
2253
|
-
" blake2b"
|
|
2254
|
-
" blake2sp"
|
|
2255
|
-
" xxh64"
|
|
2256
|
-
" crc32"
|
|
2257
|
-
" crc64"
|
|
2258
|
-
" cksum"
|
|
2259
|
-
" asc"
|
|
2260
|
-
// " b2sum"
|
|
2261
|
-
),
|
|
2262
|
-
UString());
|
|
2263
|
-
|
|
2264
|
-
item.UpdateEnabled = (item.CreateOutArchive != NULL);
|
|
2265
|
-
item.SignatureOffset = 0;
|
|
2266
|
-
// item.Version = MY_VER_MIX;
|
|
2267
|
-
item.NewInterface = true;
|
|
2268
|
-
|
|
2269
|
-
item.Signatures.AddNew().CopyFrom(NULL, 0);
|
|
2270
|
-
|
|
2271
|
-
codecs->Formats.Add(item);
|
|
342
|
+
unsigned b = data[i];
|
|
343
|
+
dest[0] = GetHex((b >> 4) & 0xF);
|
|
344
|
+
dest[1] = GetHex(b & 0xF);
|
|
345
|
+
dest += step;
|
|
2272
346
|
}
|
|
2273
347
|
}
|