7zip-native 0.0.0-stage → 0.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1327) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +293 -2
  3. package/THIRD_PARTY_NOTICES.md +23 -0
  4. package/bench/args.mts +69 -0
  5. package/bench/benchmark.mts +102 -0
  6. package/bench/compare.mts +546 -0
  7. package/bench/concurrency.mts +196 -0
  8. package/binding.gyp +51 -0
  9. package/dist/index.cjs +528 -0
  10. package/dist/index.d.cts +63 -0
  11. package/dist/index.d.mts +63 -0
  12. package/dist/index.d.ts +63 -0
  13. package/dist/index.mjs +524 -0
  14. package/docs/architecture.md +112 -0
  15. package/examples/basic.mts +19 -0
  16. package/native/addon.cpp +2154 -0
  17. package/package.json +85 -5
  18. package/prebuilds/darwin-arm64/7zip_native.node +0 -0
  19. package/prebuilds/darwin-arm64/lib7z.dylib +0 -0
  20. package/prebuilds/darwin-x64/7zip_native.node +0 -0
  21. package/prebuilds/darwin-x64/lib7z.dylib +0 -0
  22. package/prebuilds/linux-arm/7z.so +0 -0
  23. package/prebuilds/linux-arm/7zip_native.node +0 -0
  24. package/prebuilds/linux-arm64/7z.so +0 -0
  25. package/prebuilds/linux-arm64/7zip_native.node +0 -0
  26. package/prebuilds/linux-ia32/7z.so +0 -0
  27. package/prebuilds/linux-ia32/7zip_native.node +0 -0
  28. package/prebuilds/linux-x64/7z.so +0 -0
  29. package/prebuilds/linux-x64/7zip_native.node +0 -0
  30. package/prebuilds/win32-arm64/7z.dll +0 -0
  31. package/prebuilds/win32-arm64/7zip_native.node +0 -0
  32. package/prebuilds/win32-x64/7z.dll +0 -0
  33. package/prebuilds/win32-x64/7zip_native.node +0 -0
  34. package/vendor/7zip/.gitattributes +2 -0
  35. package/vendor/7zip/Asm/arm/7zCrcOpt.asm +100 -0
  36. package/vendor/7zip/Asm/arm64/7zAsm.S +187 -0
  37. package/vendor/7zip/Asm/arm64/LzmaDecOpt.S +1487 -0
  38. package/vendor/7zip/Asm/x86/7zAsm.asm +341 -0
  39. package/vendor/7zip/Asm/x86/7zCrcOpt.asm +258 -0
  40. package/vendor/7zip/Asm/x86/AesOpt.asm +742 -0
  41. package/vendor/7zip/Asm/x86/LzFindOpt.asm +540 -0
  42. package/vendor/7zip/Asm/x86/LzmaDecOpt.asm +1339 -0
  43. package/vendor/7zip/Asm/x86/Sha1Opt.asm +263 -0
  44. package/vendor/7zip/Asm/x86/Sha256Opt.asm +275 -0
  45. package/vendor/7zip/Asm/x86/Sort.asm +860 -0
  46. package/vendor/7zip/Asm/x86/XzCrc64Opt.asm +523 -0
  47. package/vendor/7zip/C/7z.h +204 -0
  48. package/vendor/7zip/C/7zAlloc.c +89 -0
  49. package/vendor/7zip/C/7zAlloc.h +19 -0
  50. package/vendor/7zip/C/7zArcIn.c +1701 -0
  51. package/vendor/7zip/C/7zBuf.c +36 -0
  52. package/vendor/7zip/C/7zBuf.h +35 -0
  53. package/vendor/7zip/C/7zBuf2.c +52 -0
  54. package/vendor/7zip/C/7zCrc.c +420 -0
  55. package/vendor/7zip/C/7zCrc.h +28 -0
  56. package/vendor/7zip/C/7zCrcOpt.c +199 -0
  57. package/vendor/7zip/C/7zDec.c +672 -0
  58. package/vendor/7zip/C/7zFile.c +443 -0
  59. package/vendor/7zip/C/7zFile.h +91 -0
  60. package/vendor/7zip/C/7zStream.c +199 -0
  61. package/vendor/7zip/C/7zTypes.h +600 -0
  62. package/vendor/7zip/C/7zVersion.h +27 -0
  63. package/vendor/7zip/C/7zVersion.rc +55 -0
  64. package/vendor/7zip/C/7zWindows.h +107 -0
  65. package/vendor/7zip/C/7zip_gcc_c.mak +366 -0
  66. package/vendor/7zip/C/Aes.c +429 -0
  67. package/vendor/7zip/C/Aes.h +60 -0
  68. package/vendor/7zip/C/AesOpt.c +1002 -0
  69. package/vendor/7zip/C/Alloc.c +774 -0
  70. package/vendor/7zip/C/Alloc.h +76 -0
  71. package/vendor/7zip/C/Asm_c.mak +12 -0
  72. package/vendor/7zip/C/Bcj2.c +290 -0
  73. package/vendor/7zip/C/Bcj2.h +332 -0
  74. package/vendor/7zip/C/Bcj2Enc.c +509 -0
  75. package/vendor/7zip/C/Blake2.h +105 -0
  76. package/vendor/7zip/C/Blake2s.c +2672 -0
  77. package/vendor/7zip/C/Bra.c +709 -0
  78. package/vendor/7zip/C/Bra.h +105 -0
  79. package/vendor/7zip/C/Bra86.c +187 -0
  80. package/vendor/7zip/C/BraIA64.c +14 -0
  81. package/vendor/7zip/C/BwtSort.c +630 -0
  82. package/vendor/7zip/C/BwtSort.h +27 -0
  83. package/vendor/7zip/C/Compiler.h +287 -0
  84. package/vendor/7zip/C/CpuArch.c +970 -0
  85. package/vendor/7zip/C/CpuArch.h +719 -0
  86. package/vendor/7zip/C/Delta.c +169 -0
  87. package/vendor/7zip/C/Delta.h +19 -0
  88. package/vendor/7zip/C/DllSecur.c +99 -0
  89. package/vendor/7zip/C/DllSecur.h +20 -0
  90. package/vendor/7zip/C/HuffEnc.c +361 -0
  91. package/vendor/7zip/C/HuffEnc.h +23 -0
  92. package/vendor/7zip/C/LzFind.c +1746 -0
  93. package/vendor/7zip/C/LzFind.h +160 -0
  94. package/vendor/7zip/C/LzFindMt.c +1422 -0
  95. package/vendor/7zip/C/LzFindMt.h +114 -0
  96. package/vendor/7zip/C/LzFindOpt.c +578 -0
  97. package/vendor/7zip/C/LzHash.h +34 -0
  98. package/vendor/7zip/C/Lzma2Dec.c +493 -0
  99. package/vendor/7zip/C/Lzma2Dec.h +121 -0
  100. package/vendor/7zip/C/Lzma2DecMt.c +1095 -0
  101. package/vendor/7zip/C/Lzma2DecMt.h +81 -0
  102. package/vendor/7zip/C/Lzma2Enc.c +799 -0
  103. package/vendor/7zip/C/Lzma2Enc.h +58 -0
  104. package/vendor/7zip/C/Lzma86.h +111 -0
  105. package/vendor/7zip/C/Lzma86Dec.c +53 -0
  106. package/vendor/7zip/C/Lzma86Enc.c +103 -0
  107. package/vendor/7zip/C/LzmaDec.c +1367 -0
  108. package/vendor/7zip/C/LzmaDec.h +237 -0
  109. package/vendor/7zip/C/LzmaEnc.c +3154 -0
  110. package/vendor/7zip/C/LzmaEnc.h +85 -0
  111. package/vendor/7zip/C/LzmaLib.c +42 -0
  112. package/vendor/7zip/C/LzmaLib.h +138 -0
  113. package/vendor/7zip/C/Md5.c +206 -0
  114. package/vendor/7zip/C/Md5.h +34 -0
  115. package/vendor/7zip/C/MtCoder.c +604 -0
  116. package/vendor/7zip/C/MtCoder.h +144 -0
  117. package/vendor/7zip/C/MtDec.c +1124 -0
  118. package/vendor/7zip/C/MtDec.h +202 -0
  119. package/vendor/7zip/C/Ppmd.h +169 -0
  120. package/vendor/7zip/C/Ppmd7.c +1131 -0
  121. package/vendor/7zip/C/Ppmd7.h +181 -0
  122. package/vendor/7zip/C/Ppmd7Dec.c +312 -0
  123. package/vendor/7zip/C/Ppmd7Enc.c +340 -0
  124. package/vendor/7zip/C/Ppmd7aDec.c +295 -0
  125. package/vendor/7zip/C/Ppmd8.c +1574 -0
  126. package/vendor/7zip/C/Ppmd8.h +181 -0
  127. package/vendor/7zip/C/Ppmd8Dec.c +295 -0
  128. package/vendor/7zip/C/Ppmd8Enc.c +337 -0
  129. package/vendor/7zip/C/Precomp.h +127 -0
  130. package/vendor/7zip/C/RotateDefs.h +50 -0
  131. package/vendor/7zip/C/Sha1.c +441 -0
  132. package/vendor/7zip/C/Sha1.h +86 -0
  133. package/vendor/7zip/C/Sha1Opt.c +424 -0
  134. package/vendor/7zip/C/Sha256.c +492 -0
  135. package/vendor/7zip/C/Sha256.h +86 -0
  136. package/vendor/7zip/C/Sha256Opt.c +451 -0
  137. package/vendor/7zip/C/Sha3.c +359 -0
  138. package/vendor/7zip/C/Sha3.h +36 -0
  139. package/vendor/7zip/C/Sha512.c +711 -0
  140. package/vendor/7zip/C/Sha512.h +86 -0
  141. package/vendor/7zip/C/Sha512Opt.c +395 -0
  142. package/vendor/7zip/C/Sort.c +268 -0
  143. package/vendor/7zip/C/Sort.h +15 -0
  144. package/vendor/7zip/C/SwapBytes.c +835 -0
  145. package/vendor/7zip/C/SwapBytes.h +17 -0
  146. package/vendor/7zip/C/Threads.c +826 -0
  147. package/vendor/7zip/C/Threads.h +260 -0
  148. package/vendor/7zip/C/Util/7z/7z.dsp +249 -0
  149. package/vendor/7zip/C/Util/7z/7z.dsw +29 -0
  150. package/vendor/7zip/C/Util/7z/7zMain.c +1210 -0
  151. package/vendor/7zip/C/Util/7z/Precomp.c +4 -0
  152. package/vendor/7zip/C/Util/7z/Precomp.h +13 -0
  153. package/vendor/7zip/C/Util/7z/makefile +44 -0
  154. package/vendor/7zip/C/Util/7z/makefile.gcc +32 -0
  155. package/vendor/7zip/C/Util/7zipInstall/7zip.ico +0 -0
  156. package/vendor/7zip/C/Util/7zipInstall/7zipInstall.c +1699 -0
  157. package/vendor/7zip/C/Util/7zipInstall/7zipInstall.dsp +248 -0
  158. package/vendor/7zip/C/Util/7zipInstall/7zipInstall.dsw +29 -0
  159. package/vendor/7zip/C/Util/7zipInstall/7zipInstall.manifest +18 -0
  160. package/vendor/7zip/C/Util/7zipInstall/Precomp.c +4 -0
  161. package/vendor/7zip/C/Util/7zipInstall/Precomp.h +13 -0
  162. package/vendor/7zip/C/Util/7zipInstall/makefile +47 -0
  163. package/vendor/7zip/C/Util/7zipInstall/resource.h +9 -0
  164. package/vendor/7zip/C/Util/7zipInstall/resource.rc +48 -0
  165. package/vendor/7zip/C/Util/7zipUninstall/7zipUninstall.c +1234 -0
  166. package/vendor/7zip/C/Util/7zipUninstall/7zipUninstall.dsp +132 -0
  167. package/vendor/7zip/C/Util/7zipUninstall/7zipUninstall.dsw +29 -0
  168. package/vendor/7zip/C/Util/7zipUninstall/7zipUninstall.ico +0 -0
  169. package/vendor/7zip/C/Util/7zipUninstall/7zipUninstall.manifest +18 -0
  170. package/vendor/7zip/C/Util/7zipUninstall/Precomp.c +4 -0
  171. package/vendor/7zip/C/Util/7zipUninstall/Precomp.h +13 -0
  172. package/vendor/7zip/C/Util/7zipUninstall/makefile +18 -0
  173. package/vendor/7zip/C/Util/7zipUninstall/resource.h +9 -0
  174. package/vendor/7zip/C/Util/7zipUninstall/resource.rc +48 -0
  175. package/vendor/7zip/C/Util/Lzma/LzmaUtil.c +313 -0
  176. package/vendor/7zip/C/Util/Lzma/LzmaUtil.dsp +192 -0
  177. package/vendor/7zip/C/Util/Lzma/LzmaUtil.dsw +29 -0
  178. package/vendor/7zip/C/Util/Lzma/Precomp.h +13 -0
  179. package/vendor/7zip/C/Util/Lzma/makefile +30 -0
  180. package/vendor/7zip/C/Util/Lzma/makefile.gcc +21 -0
  181. package/vendor/7zip/C/Util/LzmaLib/LzmaLib.def +4 -0
  182. package/vendor/7zip/C/Util/LzmaLib/LzmaLib.dsp +206 -0
  183. package/vendor/7zip/C/Util/LzmaLib/LzmaLib.dsw +29 -0
  184. package/vendor/7zip/C/Util/LzmaLib/LzmaLibExports.c +15 -0
  185. package/vendor/7zip/C/Util/LzmaLib/Precomp.c +4 -0
  186. package/vendor/7zip/C/Util/LzmaLib/Precomp.h +13 -0
  187. package/vendor/7zip/C/Util/LzmaLib/makefile +59 -0
  188. package/vendor/7zip/C/Util/LzmaLib/resource.rc +3 -0
  189. package/vendor/7zip/C/Util/SfxSetup/Precomp.c +4 -0
  190. package/vendor/7zip/C/Util/SfxSetup/Precomp.h +13 -0
  191. package/vendor/7zip/C/Util/SfxSetup/SfxSetup.c +657 -0
  192. package/vendor/7zip/C/Util/SfxSetup/SfxSetup.dsp +231 -0
  193. package/vendor/7zip/C/Util/SfxSetup/SfxSetup.dsw +29 -0
  194. package/vendor/7zip/C/Util/SfxSetup/makefile +44 -0
  195. package/vendor/7zip/C/Util/SfxSetup/makefile_con +40 -0
  196. package/vendor/7zip/C/Util/SfxSetup/resource.rc +5 -0
  197. package/vendor/7zip/C/Util/SfxSetup/setup.ico +0 -0
  198. package/vendor/7zip/C/Xxh64.c +389 -0
  199. package/vendor/7zip/C/Xxh64.h +50 -0
  200. package/vendor/7zip/C/Xz.c +92 -0
  201. package/vendor/7zip/C/Xz.h +542 -0
  202. package/vendor/7zip/C/XzCrc64.c +140 -0
  203. package/vendor/7zip/C/XzCrc64.h +26 -0
  204. package/vendor/7zip/C/XzCrc64Opt.c +261 -0
  205. package/vendor/7zip/C/XzDec.c +2865 -0
  206. package/vendor/7zip/C/XzEnc.c +1374 -0
  207. package/vendor/7zip/C/XzEnc.h +62 -0
  208. package/vendor/7zip/C/XzIn.c +385 -0
  209. package/vendor/7zip/C/ZstdDec.c +4067 -0
  210. package/vendor/7zip/C/ZstdDec.h +173 -0
  211. package/vendor/7zip/C/var_clang.mak +11 -0
  212. package/vendor/7zip/C/var_clang_arm64.mak +12 -0
  213. package/vendor/7zip/C/var_clang_x64.mak +11 -0
  214. package/vendor/7zip/C/var_clang_x86.mak +11 -0
  215. package/vendor/7zip/C/var_gcc.mak +12 -0
  216. package/vendor/7zip/C/var_gcc_arm64.mak +12 -0
  217. package/vendor/7zip/C/var_gcc_x64.mak +10 -0
  218. package/vendor/7zip/C/var_gcc_x86.mak +10 -0
  219. package/vendor/7zip/C/var_mac_arm64.mak +13 -0
  220. package/vendor/7zip/C/var_mac_x64.mak +13 -0
  221. package/vendor/7zip/C/warn_clang.mak +1 -0
  222. package/vendor/7zip/C/warn_clang_mac.mak +1 -0
  223. package/vendor/7zip/C/warn_gcc.mak +51 -0
  224. package/vendor/7zip/CPP/7zip/7zip.mak +240 -0
  225. package/vendor/7zip/CPP/7zip/7zip_gcc.mak +1376 -0
  226. package/vendor/7zip/CPP/7zip/Aes.mak +10 -0
  227. package/vendor/7zip/CPP/7zip/Archive/7z/7z.dsp +650 -0
  228. package/vendor/7zip/CPP/7zip/Archive/7z/7z.dsw +29 -0
  229. package/vendor/7zip/CPP/7zip/Archive/7z/7zCompressionMode.cpp +3 -0
  230. package/vendor/7zip/CPP/7zip/Archive/7z/7zCompressionMode.h +92 -0
  231. package/vendor/7zip/CPP/7zip/Archive/7z/7zDecode.cpp +599 -0
  232. package/vendor/7zip/CPP/7zip/Archive/7z/7zDecode.h +73 -0
  233. package/vendor/7zip/CPP/7zip/Archive/7z/7zEncode.cpp +702 -0
  234. package/vendor/7zip/CPP/7zip/Archive/7z/7zEncode.h +95 -0
  235. package/vendor/7zip/CPP/7zip/Archive/7z/7zExtract.cpp +444 -0
  236. package/vendor/7zip/CPP/7zip/Archive/7z/7zFolderInStream.cpp +264 -0
  237. package/vendor/7zip/CPP/7zip/Archive/7z/7zFolderInStream.h +101 -0
  238. package/vendor/7zip/CPP/7zip/Archive/7z/7zHandler.cpp +800 -0
  239. package/vendor/7zip/CPP/7zip/Archive/7z/7zHandler.h +178 -0
  240. package/vendor/7zip/CPP/7zip/Archive/7z/7zHandlerOut.cpp +1162 -0
  241. package/vendor/7zip/CPP/7zip/Archive/7z/7zHeader.cpp +19 -0
  242. package/vendor/7zip/CPP/7zip/Archive/7z/7zHeader.h +156 -0
  243. package/vendor/7zip/CPP/7zip/Archive/7z/7zIn.cpp +1815 -0
  244. package/vendor/7zip/CPP/7zip/Archive/7z/7zIn.h +454 -0
  245. package/vendor/7zip/CPP/7zip/Archive/7z/7zItem.h +207 -0
  246. package/vendor/7zip/CPP/7zip/Archive/7z/7zOut.cpp +1026 -0
  247. package/vendor/7zip/CPP/7zip/Archive/7z/7zOut.h +346 -0
  248. package/vendor/7zip/CPP/7zip/Archive/7z/7zProperties.cpp +182 -0
  249. package/vendor/7zip/CPP/7zip/Archive/7z/7zProperties.h +26 -0
  250. package/vendor/7zip/CPP/7zip/Archive/7z/7zRegister.cpp +27 -0
  251. package/vendor/7zip/CPP/7zip/Archive/7z/7zSpecStream.cpp +31 -0
  252. package/vendor/7zip/CPP/7zip/Archive/7z/7zSpecStream.h +49 -0
  253. package/vendor/7zip/CPP/7zip/Archive/7z/7zUpdate.cpp +3087 -0
  254. package/vendor/7zip/CPP/7zip/Archive/7z/7zUpdate.h +167 -0
  255. package/vendor/7zip/CPP/7zip/Archive/7z/StdAfx.cpp +3 -0
  256. package/vendor/7zip/CPP/7zip/Archive/7z/StdAfx.h +11 -0
  257. package/vendor/7zip/CPP/7zip/Archive/7z/makefile +81 -0
  258. package/vendor/7zip/CPP/7zip/Archive/7z/resource.rc +11 -0
  259. package/vendor/7zip/CPP/7zip/Archive/ApfsHandler.cpp +4470 -0
  260. package/vendor/7zip/CPP/7zip/Archive/ApmHandler.cpp +420 -0
  261. package/vendor/7zip/CPP/7zip/Archive/ArHandler.cpp +844 -0
  262. package/vendor/7zip/CPP/7zip/Archive/Archive.def +15 -0
  263. package/vendor/7zip/CPP/7zip/Archive/Archive2.def +22 -0
  264. package/vendor/7zip/CPP/7zip/Archive/ArchiveExports.cpp +158 -0
  265. package/vendor/7zip/CPP/7zip/Archive/ArjHandler.cpp +977 -0
  266. package/vendor/7zip/CPP/7zip/Archive/AvbHandler.cpp +616 -0
  267. package/vendor/7zip/CPP/7zip/Archive/Base64Handler.cpp +488 -0
  268. package/vendor/7zip/CPP/7zip/Archive/Bz2Handler.cpp +482 -0
  269. package/vendor/7zip/CPP/7zip/Archive/Cab/CabBlockInStream.cpp +122 -0
  270. package/vendor/7zip/CPP/7zip/Archive/Cab/CabBlockInStream.h +28 -0
  271. package/vendor/7zip/CPP/7zip/Archive/Cab/CabHandler.cpp +1270 -0
  272. package/vendor/7zip/CPP/7zip/Archive/Cab/CabHandler.h +29 -0
  273. package/vendor/7zip/CPP/7zip/Archive/Cab/CabHeader.cpp +15 -0
  274. package/vendor/7zip/CPP/7zip/Archive/Cab/CabHeader.h +41 -0
  275. package/vendor/7zip/CPP/7zip/Archive/Cab/CabIn.cpp +485 -0
  276. package/vendor/7zip/CPP/7zip/Archive/Cab/CabIn.h +169 -0
  277. package/vendor/7zip/CPP/7zip/Archive/Cab/CabItem.h +69 -0
  278. package/vendor/7zip/CPP/7zip/Archive/Cab/CabRegister.cpp +19 -0
  279. package/vendor/7zip/CPP/7zip/Archive/Cab/StdAfx.h +11 -0
  280. package/vendor/7zip/CPP/7zip/Archive/Chm/ChmHandler.cpp +790 -0
  281. package/vendor/7zip/CPP/7zip/Archive/Chm/ChmHandler.h +27 -0
  282. package/vendor/7zip/CPP/7zip/Archive/Chm/ChmIn.cpp +1026 -0
  283. package/vendor/7zip/CPP/7zip/Archive/Chm/ChmIn.h +282 -0
  284. package/vendor/7zip/CPP/7zip/Archive/Chm/StdAfx.h +11 -0
  285. package/vendor/7zip/CPP/7zip/Archive/ComHandler.cpp +1449 -0
  286. package/vendor/7zip/CPP/7zip/Archive/Common/CoderMixer2.cpp +1144 -0
  287. package/vendor/7zip/CPP/7zip/Archive/Common/CoderMixer2.h +447 -0
  288. package/vendor/7zip/CPP/7zip/Archive/Common/DummyOutStream.cpp +17 -0
  289. package/vendor/7zip/CPP/7zip/Archive/Common/DummyOutStream.h +23 -0
  290. package/vendor/7zip/CPP/7zip/Archive/Common/FindSignature.cpp +90 -0
  291. package/vendor/7zip/CPP/7zip/Archive/Common/FindSignature.h +12 -0
  292. package/vendor/7zip/CPP/7zip/Archive/Common/HandlerOut.cpp +315 -0
  293. package/vendor/7zip/CPP/7zip/Archive/Common/HandlerOut.h +169 -0
  294. package/vendor/7zip/CPP/7zip/Archive/Common/InStreamWithCRC.cpp +57 -0
  295. package/vendor/7zip/CPP/7zip/Archive/Common/InStreamWithCRC.h +64 -0
  296. package/vendor/7zip/CPP/7zip/Archive/Common/ItemNameUtils.cpp +140 -0
  297. package/vendor/7zip/CPP/7zip/Archive/Common/ItemNameUtils.h +33 -0
  298. package/vendor/7zip/CPP/7zip/Archive/Common/MultiStream.cpp +193 -0
  299. package/vendor/7zip/CPP/7zip/Archive/Common/MultiStream.h +86 -0
  300. package/vendor/7zip/CPP/7zip/Archive/Common/OutStreamWithCRC.cpp +18 -0
  301. package/vendor/7zip/CPP/7zip/Archive/Common/OutStreamWithCRC.h +35 -0
  302. package/vendor/7zip/CPP/7zip/Archive/Common/OutStreamWithSha1.cpp +29 -0
  303. package/vendor/7zip/CPP/7zip/Archive/Common/OutStreamWithSha1.h +61 -0
  304. package/vendor/7zip/CPP/7zip/Archive/Common/ParseProperties.cpp +3 -0
  305. package/vendor/7zip/CPP/7zip/Archive/Common/ParseProperties.h +6 -0
  306. package/vendor/7zip/CPP/7zip/Archive/Common/StdAfx.h +11 -0
  307. package/vendor/7zip/CPP/7zip/Archive/CpioHandler.cpp +1110 -0
  308. package/vendor/7zip/CPP/7zip/Archive/CramfsHandler.cpp +784 -0
  309. package/vendor/7zip/CPP/7zip/Archive/DeflateProps.cpp +3 -0
  310. package/vendor/7zip/CPP/7zip/Archive/DeflateProps.h +6 -0
  311. package/vendor/7zip/CPP/7zip/Archive/DllExports.cpp +96 -0
  312. package/vendor/7zip/CPP/7zip/Archive/DllExports2.cpp +184 -0
  313. package/vendor/7zip/CPP/7zip/Archive/DmgHandler.cpp +2336 -0
  314. package/vendor/7zip/CPP/7zip/Archive/ElfHandler.cpp +1284 -0
  315. package/vendor/7zip/CPP/7zip/Archive/ExtHandler.cpp +2860 -0
  316. package/vendor/7zip/CPP/7zip/Archive/FatHandler.cpp +1325 -0
  317. package/vendor/7zip/CPP/7zip/Archive/FlvHandler.cpp +521 -0
  318. package/vendor/7zip/CPP/7zip/Archive/GptHandler.cpp +473 -0
  319. package/vendor/7zip/CPP/7zip/Archive/GzHandler.cpp +1200 -0
  320. package/vendor/7zip/CPP/7zip/Archive/HandlerCont.cpp +320 -0
  321. package/vendor/7zip/CPP/7zip/Archive/HandlerCont.h +134 -0
  322. package/vendor/7zip/CPP/7zip/Archive/HfsHandler.cpp +2631 -0
  323. package/vendor/7zip/CPP/7zip/Archive/HfsHandler.h +87 -0
  324. package/vendor/7zip/CPP/7zip/Archive/IArchive.h +755 -0
  325. package/vendor/7zip/CPP/7zip/Archive/Icons/7z.ico +0 -0
  326. package/vendor/7zip/CPP/7zip/Archive/Icons/apfs.ico +0 -0
  327. package/vendor/7zip/CPP/7zip/Archive/Icons/arj.ico +0 -0
  328. package/vendor/7zip/CPP/7zip/Archive/Icons/bz2.ico +0 -0
  329. package/vendor/7zip/CPP/7zip/Archive/Icons/cab.ico +0 -0
  330. package/vendor/7zip/CPP/7zip/Archive/Icons/cpio.ico +0 -0
  331. package/vendor/7zip/CPP/7zip/Archive/Icons/deb.ico +0 -0
  332. package/vendor/7zip/CPP/7zip/Archive/Icons/dmg.ico +0 -0
  333. package/vendor/7zip/CPP/7zip/Archive/Icons/fat.ico +0 -0
  334. package/vendor/7zip/CPP/7zip/Archive/Icons/gz.ico +0 -0
  335. package/vendor/7zip/CPP/7zip/Archive/Icons/hfs.ico +0 -0
  336. package/vendor/7zip/CPP/7zip/Archive/Icons/iso.ico +0 -0
  337. package/vendor/7zip/CPP/7zip/Archive/Icons/lzh.ico +0 -0
  338. package/vendor/7zip/CPP/7zip/Archive/Icons/lzma.ico +0 -0
  339. package/vendor/7zip/CPP/7zip/Archive/Icons/ntfs.ico +0 -0
  340. package/vendor/7zip/CPP/7zip/Archive/Icons/rar.ico +0 -0
  341. package/vendor/7zip/CPP/7zip/Archive/Icons/rpm.ico +0 -0
  342. package/vendor/7zip/CPP/7zip/Archive/Icons/split.ico +0 -0
  343. package/vendor/7zip/CPP/7zip/Archive/Icons/squashfs.ico +0 -0
  344. package/vendor/7zip/CPP/7zip/Archive/Icons/tar.ico +0 -0
  345. package/vendor/7zip/CPP/7zip/Archive/Icons/vhd.ico +0 -0
  346. package/vendor/7zip/CPP/7zip/Archive/Icons/wim.ico +0 -0
  347. package/vendor/7zip/CPP/7zip/Archive/Icons/xar.ico +0 -0
  348. package/vendor/7zip/CPP/7zip/Archive/Icons/xz.ico +0 -0
  349. package/vendor/7zip/CPP/7zip/Archive/Icons/z.ico +0 -0
  350. package/vendor/7zip/CPP/7zip/Archive/Icons/zip.ico +0 -0
  351. package/vendor/7zip/CPP/7zip/Archive/Icons/zst.ico +0 -0
  352. package/vendor/7zip/CPP/7zip/Archive/IhexHandler.cpp +493 -0
  353. package/vendor/7zip/CPP/7zip/Archive/Iso/IsoHandler.cpp +498 -0
  354. package/vendor/7zip/CPP/7zip/Archive/Iso/IsoHandler.h +24 -0
  355. package/vendor/7zip/CPP/7zip/Archive/Iso/IsoHeader.cpp +12 -0
  356. package/vendor/7zip/CPP/7zip/Archive/Iso/IsoHeader.h +64 -0
  357. package/vendor/7zip/CPP/7zip/Archive/Iso/IsoIn.cpp +801 -0
  358. package/vendor/7zip/CPP/7zip/Archive/Iso/IsoIn.h +328 -0
  359. package/vendor/7zip/CPP/7zip/Archive/Iso/IsoItem.h +316 -0
  360. package/vendor/7zip/CPP/7zip/Archive/Iso/IsoRegister.cpp +21 -0
  361. package/vendor/7zip/CPP/7zip/Archive/Iso/StdAfx.h +11 -0
  362. package/vendor/7zip/CPP/7zip/Archive/LpHandler.cpp +1172 -0
  363. package/vendor/7zip/CPP/7zip/Archive/LvmHandler.cpp +1108 -0
  364. package/vendor/7zip/CPP/7zip/Archive/LzhHandler.cpp +719 -0
  365. package/vendor/7zip/CPP/7zip/Archive/LzmaHandler.cpp +606 -0
  366. package/vendor/7zip/CPP/7zip/Archive/MachoHandler.cpp +1075 -0
  367. package/vendor/7zip/CPP/7zip/Archive/MbrHandler.cpp +648 -0
  368. package/vendor/7zip/CPP/7zip/Archive/MslzHandler.cpp +389 -0
  369. package/vendor/7zip/CPP/7zip/Archive/MubHandler.cpp +248 -0
  370. package/vendor/7zip/CPP/7zip/Archive/Nsis/NsisDecode.cpp +295 -0
  371. package/vendor/7zip/CPP/7zip/Archive/Nsis/NsisDecode.h +97 -0
  372. package/vendor/7zip/CPP/7zip/Archive/Nsis/NsisHandler.cpp +703 -0
  373. package/vendor/7zip/CPP/7zip/Archive/Nsis/NsisHandler.h +30 -0
  374. package/vendor/7zip/CPP/7zip/Archive/Nsis/NsisIn.cpp +6231 -0
  375. package/vendor/7zip/CPP/7zip/Archive/Nsis/NsisIn.h +462 -0
  376. package/vendor/7zip/CPP/7zip/Archive/Nsis/NsisRegister.cpp +20 -0
  377. package/vendor/7zip/CPP/7zip/Archive/Nsis/StdAfx.h +11 -0
  378. package/vendor/7zip/CPP/7zip/Archive/NtfsHandler.cpp +2944 -0
  379. package/vendor/7zip/CPP/7zip/Archive/PeHandler.cpp +3427 -0
  380. package/vendor/7zip/CPP/7zip/Archive/PpmdHandler.cpp +414 -0
  381. package/vendor/7zip/CPP/7zip/Archive/QcowHandler.cpp +713 -0
  382. package/vendor/7zip/CPP/7zip/Archive/Rar/Rar5Handler.cpp +3483 -0
  383. package/vendor/7zip/CPP/7zip/Archive/Rar/Rar5Handler.h +527 -0
  384. package/vendor/7zip/CPP/7zip/Archive/Rar/RarHandler.cpp +1775 -0
  385. package/vendor/7zip/CPP/7zip/Archive/Rar/RarHandler.h +115 -0
  386. package/vendor/7zip/CPP/7zip/Archive/Rar/RarHeader.h +209 -0
  387. package/vendor/7zip/CPP/7zip/Archive/Rar/RarItem.h +97 -0
  388. package/vendor/7zip/CPP/7zip/Archive/Rar/RarVol.h +136 -0
  389. package/vendor/7zip/CPP/7zip/Archive/Rar/StdAfx.cpp +3 -0
  390. package/vendor/7zip/CPP/7zip/Archive/Rar/StdAfx.h +11 -0
  391. package/vendor/7zip/CPP/7zip/Archive/RpmHandler.cpp +775 -0
  392. package/vendor/7zip/CPP/7zip/Archive/SparseHandler.cpp +558 -0
  393. package/vendor/7zip/CPP/7zip/Archive/SplitHandler.cpp +353 -0
  394. package/vendor/7zip/CPP/7zip/Archive/SquashfsHandler.cpp +2373 -0
  395. package/vendor/7zip/CPP/7zip/Archive/StdAfx.h +11 -0
  396. package/vendor/7zip/CPP/7zip/Archive/SwfHandler.cpp +996 -0
  397. package/vendor/7zip/CPP/7zip/Archive/Tar/StdAfx.h +11 -0
  398. package/vendor/7zip/CPP/7zip/Archive/Tar/TarHandler.cpp +1105 -0
  399. package/vendor/7zip/CPP/7zip/Archive/Tar/TarHandler.h +57 -0
  400. package/vendor/7zip/CPP/7zip/Archive/Tar/TarHandlerOut.cpp +332 -0
  401. package/vendor/7zip/CPP/7zip/Archive/Tar/TarHeader.cpp +99 -0
  402. package/vendor/7zip/CPP/7zip/Archive/Tar/TarHeader.h +90 -0
  403. package/vendor/7zip/CPP/7zip/Archive/Tar/TarIn.cpp +1151 -0
  404. package/vendor/7zip/CPP/7zip/Archive/Tar/TarIn.h +151 -0
  405. package/vendor/7zip/CPP/7zip/Archive/Tar/TarItem.h +365 -0
  406. package/vendor/7zip/CPP/7zip/Archive/Tar/TarOut.cpp +644 -0
  407. package/vendor/7zip/CPP/7zip/Archive/Tar/TarOut.h +53 -0
  408. package/vendor/7zip/CPP/7zip/Archive/Tar/TarRegister.cpp +31 -0
  409. package/vendor/7zip/CPP/7zip/Archive/Tar/TarUpdate.cpp +563 -0
  410. package/vendor/7zip/CPP/7zip/Archive/Tar/TarUpdate.h +74 -0
  411. package/vendor/7zip/CPP/7zip/Archive/Udf/StdAfx.h +11 -0
  412. package/vendor/7zip/CPP/7zip/Archive/Udf/UdfHandler.cpp +427 -0
  413. package/vendor/7zip/CPP/7zip/Archive/Udf/UdfHandler.h +32 -0
  414. package/vendor/7zip/CPP/7zip/Archive/Udf/UdfIn.cpp +1756 -0
  415. package/vendor/7zip/CPP/7zip/Archive/Udf/UdfIn.h +508 -0
  416. package/vendor/7zip/CPP/7zip/Archive/UefiHandler.cpp +1884 -0
  417. package/vendor/7zip/CPP/7zip/Archive/VdiHandler.cpp +433 -0
  418. package/vendor/7zip/CPP/7zip/Archive/VhdHandler.cpp +1106 -0
  419. package/vendor/7zip/CPP/7zip/Archive/VhdxHandler.cpp +2085 -0
  420. package/vendor/7zip/CPP/7zip/Archive/VmdkHandler.cpp +1530 -0
  421. package/vendor/7zip/CPP/7zip/Archive/Wim/StdAfx.h +11 -0
  422. package/vendor/7zip/CPP/7zip/Archive/Wim/WimHandler.cpp +1291 -0
  423. package/vendor/7zip/CPP/7zip/Archive/Wim/WimHandler.h +117 -0
  424. package/vendor/7zip/CPP/7zip/Archive/Wim/WimHandlerOut.cpp +2008 -0
  425. package/vendor/7zip/CPP/7zip/Archive/Wim/WimIn.cpp +2104 -0
  426. package/vendor/7zip/CPP/7zip/Archive/Wim/WimIn.h +719 -0
  427. package/vendor/7zip/CPP/7zip/Archive/Wim/WimRegister.cpp +29 -0
  428. package/vendor/7zip/CPP/7zip/Archive/XarHandler.cpp +1316 -0
  429. package/vendor/7zip/CPP/7zip/Archive/XzHandler.cpp +1452 -0
  430. package/vendor/7zip/CPP/7zip/Archive/XzHandler.h +11 -0
  431. package/vendor/7zip/CPP/7zip/Archive/ZHandler.cpp +208 -0
  432. package/vendor/7zip/CPP/7zip/Archive/Zip/StdAfx.h +11 -0
  433. package/vendor/7zip/CPP/7zip/Archive/Zip/ZipAddCommon.cpp +484 -0
  434. package/vendor/7zip/CPP/7zip/Archive/Zip/ZipAddCommon.h +76 -0
  435. package/vendor/7zip/CPP/7zip/Archive/Zip/ZipCompressionMode.h +62 -0
  436. package/vendor/7zip/CPP/7zip/Archive/Zip/ZipHandler.cpp +1679 -0
  437. package/vendor/7zip/CPP/7zip/Archive/Zip/ZipHandler.h +94 -0
  438. package/vendor/7zip/CPP/7zip/Archive/Zip/ZipHandlerOut.cpp +626 -0
  439. package/vendor/7zip/CPP/7zip/Archive/Zip/ZipHeader.h +201 -0
  440. package/vendor/7zip/CPP/7zip/Archive/Zip/ZipIn.cpp +3474 -0
  441. package/vendor/7zip/CPP/7zip/Archive/Zip/ZipIn.h +456 -0
  442. package/vendor/7zip/CPP/7zip/Archive/Zip/ZipItem.cpp +464 -0
  443. package/vendor/7zip/CPP/7zip/Archive/Zip/ZipItem.h +356 -0
  444. package/vendor/7zip/CPP/7zip/Archive/Zip/ZipOut.cpp +428 -0
  445. package/vendor/7zip/CPP/7zip/Archive/Zip/ZipOut.h +103 -0
  446. package/vendor/7zip/CPP/7zip/Archive/Zip/ZipRegister.cpp +38 -0
  447. package/vendor/7zip/CPP/7zip/Archive/Zip/ZipUpdate.cpp +2165 -0
  448. package/vendor/7zip/CPP/7zip/Archive/Zip/ZipUpdate.h +107 -0
  449. package/vendor/7zip/CPP/7zip/Archive/ZstdHandler.cpp +1147 -0
  450. package/vendor/7zip/CPP/7zip/Archive/makefile +23 -0
  451. package/vendor/7zip/CPP/7zip/Asm.mak +12 -0
  452. package/vendor/7zip/CPP/7zip/Bundles/Alone/Alone.dsp +3324 -0
  453. package/vendor/7zip/CPP/7zip/Bundles/Alone/Alone.dsw +29 -0
  454. package/vendor/7zip/CPP/7zip/Bundles/Alone/StdAfx.cpp +3 -0
  455. package/vendor/7zip/CPP/7zip/Bundles/Alone/StdAfx.h +11 -0
  456. package/vendor/7zip/CPP/7zip/Bundles/Alone/makefile +245 -0
  457. package/vendor/7zip/CPP/7zip/Bundles/Alone/makefile.gcc +354 -0
  458. package/vendor/7zip/CPP/7zip/Bundles/Alone/resource.rc +7 -0
  459. package/vendor/7zip/CPP/7zip/Bundles/Alone2/StdAfx.cpp +3 -0
  460. package/vendor/7zip/CPP/7zip/Bundles/Alone2/StdAfx.h +11 -0
  461. package/vendor/7zip/CPP/7zip/Bundles/Alone2/makefile +31 -0
  462. package/vendor/7zip/CPP/7zip/Bundles/Alone2/makefile.gcc +108 -0
  463. package/vendor/7zip/CPP/7zip/Bundles/Alone2/resource.rc +7 -0
  464. package/vendor/7zip/CPP/7zip/Bundles/Alone7z/Alone.dsp +2090 -0
  465. package/vendor/7zip/CPP/7zip/Bundles/Alone7z/Alone.dsw +29 -0
  466. package/vendor/7zip/CPP/7zip/Bundles/Alone7z/StdAfx.cpp +3 -0
  467. package/vendor/7zip/CPP/7zip/Bundles/Alone7z/StdAfx.h +11 -0
  468. package/vendor/7zip/CPP/7zip/Bundles/Alone7z/makefile +168 -0
  469. package/vendor/7zip/CPP/7zip/Bundles/Alone7z/makefile.gcc +276 -0
  470. package/vendor/7zip/CPP/7zip/Bundles/Alone7z/resource.rc +7 -0
  471. package/vendor/7zip/CPP/7zip/Bundles/Fm/FM.dsp +2275 -0
  472. package/vendor/7zip/CPP/7zip/Bundles/Fm/FM.dsw +29 -0
  473. package/vendor/7zip/CPP/7zip/Bundles/Fm/StdAfx.cpp +3 -0
  474. package/vendor/7zip/CPP/7zip/Bundles/Fm/StdAfx.h +6 -0
  475. package/vendor/7zip/CPP/7zip/Bundles/Fm/makefile +82 -0
  476. package/vendor/7zip/CPP/7zip/Bundles/Fm/resource.rc +7 -0
  477. package/vendor/7zip/CPP/7zip/Bundles/Format7z/StdAfx.cpp +3 -0
  478. package/vendor/7zip/CPP/7zip/Bundles/Format7z/StdAfx.h +11 -0
  479. package/vendor/7zip/CPP/7zip/Bundles/Format7z/makefile +148 -0
  480. package/vendor/7zip/CPP/7zip/Bundles/Format7z/resource.rc +5 -0
  481. package/vendor/7zip/CPP/7zip/Bundles/Format7zExtract/StdAfx.cpp +3 -0
  482. package/vendor/7zip/CPP/7zip/Bundles/Format7zExtract/StdAfx.h +11 -0
  483. package/vendor/7zip/CPP/7zip/Bundles/Format7zExtract/makefile +116 -0
  484. package/vendor/7zip/CPP/7zip/Bundles/Format7zExtract/resource.rc +5 -0
  485. package/vendor/7zip/CPP/7zip/Bundles/Format7zExtractR/StdAfx.cpp +3 -0
  486. package/vendor/7zip/CPP/7zip/Bundles/Format7zExtractR/StdAfx.h +11 -0
  487. package/vendor/7zip/CPP/7zip/Bundles/Format7zExtractR/makefile +98 -0
  488. package/vendor/7zip/CPP/7zip/Bundles/Format7zExtractR/resource.rc +5 -0
  489. package/vendor/7zip/CPP/7zip/Bundles/Format7zF/Arc.mak +310 -0
  490. package/vendor/7zip/CPP/7zip/Bundles/Format7zF/Arc_gcc.mak +395 -0
  491. package/vendor/7zip/CPP/7zip/Bundles/Format7zF/Format7z.dsp +3486 -0
  492. package/vendor/7zip/CPP/7zip/Bundles/Format7zF/Format7z.dsw +29 -0
  493. package/vendor/7zip/CPP/7zip/Bundles/Format7zF/StdAfx.cpp +3 -0
  494. package/vendor/7zip/CPP/7zip/Bundles/Format7zF/StdAfx.h +11 -0
  495. package/vendor/7zip/CPP/7zip/Bundles/Format7zF/makefile +20 -0
  496. package/vendor/7zip/CPP/7zip/Bundles/Format7zF/makefile.gcc +55 -0
  497. package/vendor/7zip/CPP/7zip/Bundles/Format7zF/resource.rc +39 -0
  498. package/vendor/7zip/CPP/7zip/Bundles/Format7zR/StdAfx.cpp +3 -0
  499. package/vendor/7zip/CPP/7zip/Bundles/Format7zR/StdAfx.h +11 -0
  500. package/vendor/7zip/CPP/7zip/Bundles/Format7zR/makefile +121 -0
  501. package/vendor/7zip/CPP/7zip/Bundles/Format7zR/resource.rc +5 -0
  502. package/vendor/7zip/CPP/7zip/Bundles/LzmaCon/LzmaAlone.cpp +815 -0
  503. package/vendor/7zip/CPP/7zip/Bundles/LzmaCon/LzmaCon.dsp +540 -0
  504. package/vendor/7zip/CPP/7zip/Bundles/LzmaCon/LzmaCon.dsw +29 -0
  505. package/vendor/7zip/CPP/7zip/Bundles/LzmaCon/StdAfx.cpp +3 -0
  506. package/vendor/7zip/CPP/7zip/Bundles/LzmaCon/StdAfx.h +11 -0
  507. package/vendor/7zip/CPP/7zip/Bundles/LzmaCon/makefile +68 -0
  508. package/vendor/7zip/CPP/7zip/Bundles/LzmaCon/makefile.gcc +131 -0
  509. package/vendor/7zip/CPP/7zip/Bundles/LzmaCon/resource.rc +3 -0
  510. package/vendor/7zip/CPP/7zip/Bundles/SFXCon/7z.ico +0 -0
  511. package/vendor/7zip/CPP/7zip/Bundles/SFXCon/SFXCon.dsp +1017 -0
  512. package/vendor/7zip/CPP/7zip/Bundles/SFXCon/SFXCon.dsw +29 -0
  513. package/vendor/7zip/CPP/7zip/Bundles/SFXCon/SfxCon.cpp +521 -0
  514. package/vendor/7zip/CPP/7zip/Bundles/SFXCon/StdAfx.cpp +3 -0
  515. package/vendor/7zip/CPP/7zip/Bundles/SFXCon/StdAfx.h +11 -0
  516. package/vendor/7zip/CPP/7zip/Bundles/SFXCon/makefile +137 -0
  517. package/vendor/7zip/CPP/7zip/Bundles/SFXCon/makefile.gcc +215 -0
  518. package/vendor/7zip/CPP/7zip/Bundles/SFXCon/resource.rc +9 -0
  519. package/vendor/7zip/CPP/7zip/Bundles/SFXSetup/ExtractCallbackSfx.cpp +246 -0
  520. package/vendor/7zip/CPP/7zip/Bundles/SFXSetup/ExtractCallbackSfx.h +83 -0
  521. package/vendor/7zip/CPP/7zip/Bundles/SFXSetup/ExtractEngine.cpp +135 -0
  522. package/vendor/7zip/CPP/7zip/Bundles/SFXSetup/ExtractEngine.h +11 -0
  523. package/vendor/7zip/CPP/7zip/Bundles/SFXSetup/SFXSetup.dsp +872 -0
  524. package/vendor/7zip/CPP/7zip/Bundles/SFXSetup/SFXSetup.dsw +29 -0
  525. package/vendor/7zip/CPP/7zip/Bundles/SFXSetup/SfxSetup.cpp +359 -0
  526. package/vendor/7zip/CPP/7zip/Bundles/SFXSetup/StdAfx.cpp +3 -0
  527. package/vendor/7zip/CPP/7zip/Bundles/SFXSetup/StdAfx.h +6 -0
  528. package/vendor/7zip/CPP/7zip/Bundles/SFXSetup/makefile +121 -0
  529. package/vendor/7zip/CPP/7zip/Bundles/SFXSetup/resource.h +6 -0
  530. package/vendor/7zip/CPP/7zip/Bundles/SFXSetup/resource.rc +16 -0
  531. package/vendor/7zip/CPP/7zip/Bundles/SFXSetup/setup.ico +0 -0
  532. package/vendor/7zip/CPP/7zip/Bundles/SFXWin/7z.ico +0 -0
  533. package/vendor/7zip/CPP/7zip/Bundles/SFXWin/SFXWin.dsp +1074 -0
  534. package/vendor/7zip/CPP/7zip/Bundles/SFXWin/SFXWin.dsw +29 -0
  535. package/vendor/7zip/CPP/7zip/Bundles/SFXWin/SfxWin.cpp +268 -0
  536. package/vendor/7zip/CPP/7zip/Bundles/SFXWin/StdAfx.cpp +3 -0
  537. package/vendor/7zip/CPP/7zip/Bundles/SFXWin/StdAfx.h +6 -0
  538. package/vendor/7zip/CPP/7zip/Bundles/SFXWin/makefile +159 -0
  539. package/vendor/7zip/CPP/7zip/Bundles/SFXWin/resource.h +1 -0
  540. package/vendor/7zip/CPP/7zip/Bundles/SFXWin/resource.rc +55 -0
  541. package/vendor/7zip/CPP/7zip/Bundles/makefile +19 -0
  542. package/vendor/7zip/CPP/7zip/Common/CWrappers.cpp +358 -0
  543. package/vendor/7zip/CPP/7zip/Common/CWrappers.h +182 -0
  544. package/vendor/7zip/CPP/7zip/Common/CreateCoder.cpp +548 -0
  545. package/vendor/7zip/CPP/7zip/Common/CreateCoder.h +200 -0
  546. package/vendor/7zip/CPP/7zip/Common/FilePathAutoRename.cpp +46 -0
  547. package/vendor/7zip/CPP/7zip/Common/FilePathAutoRename.h +10 -0
  548. package/vendor/7zip/CPP/7zip/Common/FileStreams.cpp +923 -0
  549. package/vendor/7zip/CPP/7zip/Common/FileStreams.h +205 -0
  550. package/vendor/7zip/CPP/7zip/Common/FilterCoder.cpp +582 -0
  551. package/vendor/7zip/CPP/7zip/Common/FilterCoder.h +201 -0
  552. package/vendor/7zip/CPP/7zip/Common/InBuffer.cpp +182 -0
  553. package/vendor/7zip/CPP/7zip/Common/InBuffer.h +121 -0
  554. package/vendor/7zip/CPP/7zip/Common/InOutTempBuffer.cpp +237 -0
  555. package/vendor/7zip/CPP/7zip/Common/InOutTempBuffer.h +45 -0
  556. package/vendor/7zip/CPP/7zip/Common/LimitedStreams.cpp +395 -0
  557. package/vendor/7zip/CPP/7zip/Common/LimitedStreams.h +221 -0
  558. package/vendor/7zip/CPP/7zip/Common/LockedStream.cpp +3 -0
  559. package/vendor/7zip/CPP/7zip/Common/LockedStream.h +6 -0
  560. package/vendor/7zip/CPP/7zip/Common/MemBlocks.cpp +215 -0
  561. package/vendor/7zip/CPP/7zip/Common/MemBlocks.h +72 -0
  562. package/vendor/7zip/CPP/7zip/Common/MethodId.cpp +3 -0
  563. package/vendor/7zip/CPP/7zip/Common/MethodId.h +10 -0
  564. package/vendor/7zip/CPP/7zip/Common/MethodProps.cpp +765 -0
  565. package/vendor/7zip/CPP/7zip/Common/MethodProps.h +348 -0
  566. package/vendor/7zip/CPP/7zip/Common/MultiOutStream.cpp +855 -0
  567. package/vendor/7zip/CPP/7zip/Common/MultiOutStream.h +160 -0
  568. package/vendor/7zip/CPP/7zip/Common/OffsetStream.cpp +37 -0
  569. package/vendor/7zip/CPP/7zip/Common/OffsetStream.h +22 -0
  570. package/vendor/7zip/CPP/7zip/Common/OutBuffer.cpp +111 -0
  571. package/vendor/7zip/CPP/7zip/Common/OutBuffer.h +133 -0
  572. package/vendor/7zip/CPP/7zip/Common/OutMemStream.cpp +158 -0
  573. package/vendor/7zip/CPP/7zip/Common/OutMemStream.h +104 -0
  574. package/vendor/7zip/CPP/7zip/Common/ProgressMt.cpp +53 -0
  575. package/vendor/7zip/CPP/7zip/Common/ProgressMt.h +43 -0
  576. package/vendor/7zip/CPP/7zip/Common/ProgressUtils.cpp +51 -0
  577. package/vendor/7zip/CPP/7zip/Common/ProgressUtils.h +33 -0
  578. package/vendor/7zip/CPP/7zip/Common/PropId.cpp +115 -0
  579. package/vendor/7zip/CPP/7zip/Common/RegisterArc.h +80 -0
  580. package/vendor/7zip/CPP/7zip/Common/RegisterCodec.h +106 -0
  581. package/vendor/7zip/CPP/7zip/Common/StdAfx.h +11 -0
  582. package/vendor/7zip/CPP/7zip/Common/StreamBinder.cpp +151 -0
  583. package/vendor/7zip/CPP/7zip/Common/StreamBinder.h +78 -0
  584. package/vendor/7zip/CPP/7zip/Common/StreamObjects.cpp +290 -0
  585. package/vendor/7zip/CPP/7zip/Common/StreamObjects.h +146 -0
  586. package/vendor/7zip/CPP/7zip/Common/StreamUtils.cpp +101 -0
  587. package/vendor/7zip/CPP/7zip/Common/StreamUtils.h +31 -0
  588. package/vendor/7zip/CPP/7zip/Common/UniqBlocks.cpp +57 -0
  589. package/vendor/7zip/CPP/7zip/Common/UniqBlocks.h +41 -0
  590. package/vendor/7zip/CPP/7zip/Common/VirtThread.cpp +47 -0
  591. package/vendor/7zip/CPP/7zip/Common/VirtThread.h +24 -0
  592. package/vendor/7zip/CPP/7zip/Compress/BZip2Const.h +71 -0
  593. package/vendor/7zip/CPP/7zip/Compress/BZip2Crc.cpp +28 -0
  594. package/vendor/7zip/CPP/7zip/Compress/BZip2Crc.h +31 -0
  595. package/vendor/7zip/CPP/7zip/Compress/BZip2Decoder.cpp +1777 -0
  596. package/vendor/7zip/CPP/7zip/Compress/BZip2Decoder.h +388 -0
  597. package/vendor/7zip/CPP/7zip/Compress/BZip2Encoder.cpp +1116 -0
  598. package/vendor/7zip/CPP/7zip/Compress/BZip2Encoder.h +273 -0
  599. package/vendor/7zip/CPP/7zip/Compress/BZip2Register.cpp +25 -0
  600. package/vendor/7zip/CPP/7zip/Compress/Bcj2Coder.cpp +867 -0
  601. package/vendor/7zip/CPP/7zip/Compress/Bcj2Coder.h +127 -0
  602. package/vendor/7zip/CPP/7zip/Compress/Bcj2Register.cpp +24 -0
  603. package/vendor/7zip/CPP/7zip/Compress/BcjCoder.cpp +24 -0
  604. package/vendor/7zip/CPP/7zip/Compress/BcjCoder.h +37 -0
  605. package/vendor/7zip/CPP/7zip/Compress/BcjRegister.cpp +17 -0
  606. package/vendor/7zip/CPP/7zip/Compress/BitlDecoder.cpp +32 -0
  607. package/vendor/7zip/CPP/7zip/Compress/BitlDecoder.h +225 -0
  608. package/vendor/7zip/CPP/7zip/Compress/BitlEncoder.h +57 -0
  609. package/vendor/7zip/CPP/7zip/Compress/BitmDecoder.h +106 -0
  610. package/vendor/7zip/CPP/7zip/Compress/BitmEncoder.h +90 -0
  611. package/vendor/7zip/CPP/7zip/Compress/BranchMisc.cpp +106 -0
  612. package/vendor/7zip/CPP/7zip/Compress/BranchMisc.h +59 -0
  613. package/vendor/7zip/CPP/7zip/Compress/BranchRegister.cpp +58 -0
  614. package/vendor/7zip/CPP/7zip/Compress/ByteSwap.cpp +91 -0
  615. package/vendor/7zip/CPP/7zip/Compress/Codec.def +7 -0
  616. package/vendor/7zip/CPP/7zip/Compress/CodecExports.cpp +378 -0
  617. package/vendor/7zip/CPP/7zip/Compress/CopyCoder.cpp +153 -0
  618. package/vendor/7zip/CPP/7zip/Compress/CopyCoder.h +34 -0
  619. package/vendor/7zip/CPP/7zip/Compress/CopyRegister.cpp +15 -0
  620. package/vendor/7zip/CPP/7zip/Compress/Deflate64Register.cpp +25 -0
  621. package/vendor/7zip/CPP/7zip/Compress/DeflateConst.h +131 -0
  622. package/vendor/7zip/CPP/7zip/Compress/DeflateDecoder.cpp +566 -0
  623. package/vendor/7zip/CPP/7zip/Compress/DeflateDecoder.h +154 -0
  624. package/vendor/7zip/CPP/7zip/Compress/DeflateEncoder.cpp +1045 -0
  625. package/vendor/7zip/CPP/7zip/Compress/DeflateEncoder.h +203 -0
  626. package/vendor/7zip/CPP/7zip/Compress/DeflateRegister.cpp +25 -0
  627. package/vendor/7zip/CPP/7zip/Compress/DeltaFilter.cpp +126 -0
  628. package/vendor/7zip/CPP/7zip/Compress/DllExports2Compress.cpp +38 -0
  629. package/vendor/7zip/CPP/7zip/Compress/DllExportsCompress.cpp +59 -0
  630. package/vendor/7zip/CPP/7zip/Compress/HuffmanDecoder.h +528 -0
  631. package/vendor/7zip/CPP/7zip/Compress/ImplodeDecoder.cpp +250 -0
  632. package/vendor/7zip/CPP/7zip/Compress/ImplodeDecoder.h +61 -0
  633. package/vendor/7zip/CPP/7zip/Compress/ImplodeHuffmanDecoder.cpp +3 -0
  634. package/vendor/7zip/CPP/7zip/Compress/ImplodeHuffmanDecoder.h +6 -0
  635. package/vendor/7zip/CPP/7zip/Compress/LzOutWindow.cpp +14 -0
  636. package/vendor/7zip/CPP/7zip/Compress/LzOutWindow.h +102 -0
  637. package/vendor/7zip/CPP/7zip/Compress/LzfseDecoder.cpp +950 -0
  638. package/vendor/7zip/CPP/7zip/Compress/LzfseDecoder.h +63 -0
  639. package/vendor/7zip/CPP/7zip/Compress/LzhDecoder.cpp +220 -0
  640. package/vendor/7zip/CPP/7zip/Compress/LzhDecoder.h +68 -0
  641. package/vendor/7zip/CPP/7zip/Compress/Lzma2Decoder.cpp +267 -0
  642. package/vendor/7zip/CPP/7zip/Compress/Lzma2Decoder.h +87 -0
  643. package/vendor/7zip/CPP/7zip/Compress/Lzma2Encoder.cpp +134 -0
  644. package/vendor/7zip/CPP/7zip/Compress/Lzma2Encoder.h +30 -0
  645. package/vendor/7zip/CPP/7zip/Compress/Lzma2Register.cpp +22 -0
  646. package/vendor/7zip/CPP/7zip/Compress/LzmaDecoder.cpp +350 -0
  647. package/vendor/7zip/CPP/7zip/Compress/LzmaDecoder.h +113 -0
  648. package/vendor/7zip/CPP/7zip/Compress/LzmaEncoder.cpp +374 -0
  649. package/vendor/7zip/CPP/7zip/Compress/LzmaEncoder.h +45 -0
  650. package/vendor/7zip/CPP/7zip/Compress/LzmaRegister.cpp +22 -0
  651. package/vendor/7zip/CPP/7zip/Compress/LzmsDecoder.cpp +619 -0
  652. package/vendor/7zip/CPP/7zip/Compress/LzmsDecoder.h +209 -0
  653. package/vendor/7zip/CPP/7zip/Compress/Lzx.h +61 -0
  654. package/vendor/7zip/CPP/7zip/Compress/LzxDecoder.cpp +1517 -0
  655. package/vendor/7zip/CPP/7zip/Compress/LzxDecoder.h +106 -0
  656. package/vendor/7zip/CPP/7zip/Compress/Mtf8.h +225 -0
  657. package/vendor/7zip/CPP/7zip/Compress/PpmdDecoder.cpp +219 -0
  658. package/vendor/7zip/CPP/7zip/Compress/PpmdDecoder.h +87 -0
  659. package/vendor/7zip/CPP/7zip/Compress/PpmdEncoder.cpp +193 -0
  660. package/vendor/7zip/CPP/7zip/Compress/PpmdEncoder.h +49 -0
  661. package/vendor/7zip/CPP/7zip/Compress/PpmdRegister.cpp +22 -0
  662. package/vendor/7zip/CPP/7zip/Compress/PpmdZip.cpp +309 -0
  663. package/vendor/7zip/CPP/7zip/Compress/PpmdZip.h +78 -0
  664. package/vendor/7zip/CPP/7zip/Compress/QuantumDecoder.cpp +355 -0
  665. package/vendor/7zip/CPP/7zip/Compress/QuantumDecoder.h +60 -0
  666. package/vendor/7zip/CPP/7zip/Compress/Rar1Decoder.cpp +518 -0
  667. package/vendor/7zip/CPP/7zip/Compress/Rar1Decoder.h +70 -0
  668. package/vendor/7zip/CPP/7zip/Compress/Rar2Decoder.cpp +472 -0
  669. package/vendor/7zip/CPP/7zip/Compress/Rar2Decoder.h +111 -0
  670. package/vendor/7zip/CPP/7zip/Compress/Rar3Decoder.cpp +939 -0
  671. package/vendor/7zip/CPP/7zip/Compress/Rar3Decoder.h +283 -0
  672. package/vendor/7zip/CPP/7zip/Compress/Rar3Vm.cpp +1153 -0
  673. package/vendor/7zip/CPP/7zip/Compress/Rar3Vm.h +195 -0
  674. package/vendor/7zip/CPP/7zip/Compress/Rar5Decoder.cpp +2060 -0
  675. package/vendor/7zip/CPP/7zip/Compress/Rar5Decoder.h +132 -0
  676. package/vendor/7zip/CPP/7zip/Compress/RarCodecsRegister.cpp +33 -0
  677. package/vendor/7zip/CPP/7zip/Compress/ShrinkDecoder.cpp +290 -0
  678. package/vendor/7zip/CPP/7zip/Compress/ShrinkDecoder.h +38 -0
  679. package/vendor/7zip/CPP/7zip/Compress/StdAfx.h +11 -0
  680. package/vendor/7zip/CPP/7zip/Compress/XpressDecoder.cpp +399 -0
  681. package/vendor/7zip/CPP/7zip/Compress/XpressDecoder.h +18 -0
  682. package/vendor/7zip/CPP/7zip/Compress/XzDecoder.cpp +151 -0
  683. package/vendor/7zip/CPP/7zip/Compress/XzDecoder.h +86 -0
  684. package/vendor/7zip/CPP/7zip/Compress/XzEncoder.cpp +243 -0
  685. package/vendor/7zip/CPP/7zip/Compress/XzEncoder.h +35 -0
  686. package/vendor/7zip/CPP/7zip/Compress/ZDecoder.cpp +392 -0
  687. package/vendor/7zip/CPP/7zip/Compress/ZDecoder.h +41 -0
  688. package/vendor/7zip/CPP/7zip/Compress/ZlibDecoder.cpp +136 -0
  689. package/vendor/7zip/CPP/7zip/Compress/ZlibDecoder.h +78 -0
  690. package/vendor/7zip/CPP/7zip/Compress/ZlibEncoder.cpp +61 -0
  691. package/vendor/7zip/CPP/7zip/Compress/ZlibEncoder.h +42 -0
  692. package/vendor/7zip/CPP/7zip/Compress/ZstdDecoder.cpp +437 -0
  693. package/vendor/7zip/CPP/7zip/Compress/ZstdDecoder.h +98 -0
  694. package/vendor/7zip/CPP/7zip/Compress/makefile +7 -0
  695. package/vendor/7zip/CPP/7zip/Crc.mak +8 -0
  696. package/vendor/7zip/CPP/7zip/Crc64.mak +8 -0
  697. package/vendor/7zip/CPP/7zip/Crypto/7zAes.cpp +315 -0
  698. package/vendor/7zip/CPP/7zip/Crypto/7zAes.h +130 -0
  699. package/vendor/7zip/CPP/7zip/Crypto/7zAesRegister.cpp +17 -0
  700. package/vendor/7zip/CPP/7zip/Crypto/Codec.def +4 -0
  701. package/vendor/7zip/CPP/7zip/Crypto/HmacSha1.cpp +94 -0
  702. package/vendor/7zip/CPP/7zip/Crypto/HmacSha1.h +31 -0
  703. package/vendor/7zip/CPP/7zip/Crypto/HmacSha256.cpp +53 -0
  704. package/vendor/7zip/CPP/7zip/Crypto/HmacSha256.h +27 -0
  705. package/vendor/7zip/CPP/7zip/Crypto/MyAes.cpp +277 -0
  706. package/vendor/7zip/CPP/7zip/Crypto/MyAes.h +122 -0
  707. package/vendor/7zip/CPP/7zip/Crypto/MyAesReg.cpp +29 -0
  708. package/vendor/7zip/CPP/7zip/Crypto/Pbkdf2HmacSha1.cpp +48 -0
  709. package/vendor/7zip/CPP/7zip/Crypto/Pbkdf2HmacSha1.h +19 -0
  710. package/vendor/7zip/CPP/7zip/Crypto/RandGen.cpp +242 -0
  711. package/vendor/7zip/CPP/7zip/Crypto/RandGen.h +41 -0
  712. package/vendor/7zip/CPP/7zip/Crypto/Rar20Crypto.cpp +130 -0
  713. package/vendor/7zip/CPP/7zip/Crypto/Rar20Crypto.h +54 -0
  714. package/vendor/7zip/CPP/7zip/Crypto/Rar5Aes.cpp +273 -0
  715. package/vendor/7zip/CPP/7zip/Crypto/Rar5Aes.h +97 -0
  716. package/vendor/7zip/CPP/7zip/Crypto/RarAes.cpp +202 -0
  717. package/vendor/7zip/CPP/7zip/Crypto/RarAes.h +54 -0
  718. package/vendor/7zip/CPP/7zip/Crypto/Sha1Cls.h +37 -0
  719. package/vendor/7zip/CPP/7zip/Crypto/StdAfx.h +11 -0
  720. package/vendor/7zip/CPP/7zip/Crypto/WzAes.cpp +231 -0
  721. package/vendor/7zip/CPP/7zip/Crypto/WzAes.h +161 -0
  722. package/vendor/7zip/CPP/7zip/Crypto/ZipCrypto.cpp +114 -0
  723. package/vendor/7zip/CPP/7zip/Crypto/ZipCrypto.h +80 -0
  724. package/vendor/7zip/CPP/7zip/Crypto/ZipStrong.cpp +265 -0
  725. package/vendor/7zip/CPP/7zip/Crypto/ZipStrong.h +73 -0
  726. package/vendor/7zip/CPP/7zip/GuiCommon.rc +119 -0
  727. package/vendor/7zip/CPP/7zip/Guid.txt +243 -0
  728. package/vendor/7zip/CPP/7zip/ICoder.h +480 -0
  729. package/vendor/7zip/CPP/7zip/IDecl.h +76 -0
  730. package/vendor/7zip/CPP/7zip/IPassword.h +54 -0
  731. package/vendor/7zip/CPP/7zip/IProgress.h +20 -0
  732. package/vendor/7zip/CPP/7zip/IStream.h +210 -0
  733. package/vendor/7zip/CPP/7zip/LzFindOpt.mak +7 -0
  734. package/vendor/7zip/CPP/7zip/LzmaDec.mak +7 -0
  735. package/vendor/7zip/CPP/7zip/LzmaDec_gcc.mak +14 -0
  736. package/vendor/7zip/CPP/7zip/MyVersion.h +2 -0
  737. package/vendor/7zip/CPP/7zip/MyVersionInfo.rc +2 -0
  738. package/vendor/7zip/CPP/7zip/PropID.h +178 -0
  739. package/vendor/7zip/CPP/7zip/Sha1.mak +13 -0
  740. package/vendor/7zip/CPP/7zip/Sha256.mak +13 -0
  741. package/vendor/7zip/CPP/7zip/Sort.mak +6 -0
  742. package/vendor/7zip/CPP/7zip/SubBuild.mak +3 -0
  743. package/vendor/7zip/CPP/7zip/UI/Agent/Agent.cpp +2003 -0
  744. package/vendor/7zip/CPP/7zip/UI/Agent/Agent.h +365 -0
  745. package/vendor/7zip/CPP/7zip/UI/Agent/AgentOut.cpp +776 -0
  746. package/vendor/7zip/CPP/7zip/UI/Agent/AgentProxy.cpp +1098 -0
  747. package/vendor/7zip/CPP/7zip/UI/Agent/AgentProxy.h +198 -0
  748. package/vendor/7zip/CPP/7zip/UI/Agent/ArchiveFolder.cpp +57 -0
  749. package/vendor/7zip/CPP/7zip/UI/Agent/ArchiveFolderOpen.cpp +243 -0
  750. package/vendor/7zip/CPP/7zip/UI/Agent/ArchiveFolderOut.cpp +457 -0
  751. package/vendor/7zip/CPP/7zip/UI/Agent/IFolderArchive.h +123 -0
  752. package/vendor/7zip/CPP/7zip/UI/Agent/StdAfx.h +11 -0
  753. package/vendor/7zip/CPP/7zip/UI/Agent/UpdateCallbackAgent.cpp +208 -0
  754. package/vendor/7zip/CPP/7zip/UI/Agent/UpdateCallbackAgent.h +22 -0
  755. package/vendor/7zip/CPP/7zip/UI/Client7z/Client7z.cpp +1145 -0
  756. package/vendor/7zip/CPP/7zip/UI/Client7z/Client7z.dsp +331 -0
  757. package/vendor/7zip/CPP/7zip/UI/Client7z/Client7z.dsw +29 -0
  758. package/vendor/7zip/CPP/7zip/UI/Client7z/StdAfx.cpp +3 -0
  759. package/vendor/7zip/CPP/7zip/UI/Client7z/StdAfx.h +11 -0
  760. package/vendor/7zip/CPP/7zip/UI/Client7z/makefile +29 -0
  761. package/vendor/7zip/CPP/7zip/UI/Client7z/makefile.gcc +72 -0
  762. package/vendor/7zip/CPP/7zip/UI/Client7z/resource.rc +3 -0
  763. package/vendor/7zip/CPP/7zip/UI/Common/ArchiveCommandLine.cpp +1913 -0
  764. package/vendor/7zip/CPP/7zip/UI/Common/ArchiveCommandLine.h +170 -0
  765. package/vendor/7zip/CPP/7zip/UI/Common/ArchiveExtractCallback.cpp +3243 -0
  766. package/vendor/7zip/CPP/7zip/UI/Common/ArchiveExtractCallback.h +640 -0
  767. package/vendor/7zip/CPP/7zip/UI/Common/ArchiveName.cpp +176 -0
  768. package/vendor/7zip/CPP/7zip/UI/Common/ArchiveName.h +16 -0
  769. package/vendor/7zip/CPP/7zip/UI/Common/ArchiveOpenCallback.cpp +403 -0
  770. package/vendor/7zip/CPP/7zip/UI/Common/ArchiveOpenCallback.h +182 -0
  771. package/vendor/7zip/CPP/7zip/UI/Common/Bench.cpp +5036 -0
  772. package/vendor/7zip/CPP/7zip/UI/Common/Bench.h +121 -0
  773. package/vendor/7zip/CPP/7zip/UI/Common/CompressCall.cpp +343 -0
  774. package/vendor/7zip/CPP/7zip/UI/Common/CompressCall.h +28 -0
  775. package/vendor/7zip/CPP/7zip/UI/Common/CompressCall2.cpp +327 -0
  776. package/vendor/7zip/CPP/7zip/UI/Common/DefaultName.cpp +37 -0
  777. package/vendor/7zip/CPP/7zip/UI/Common/DefaultName.h +11 -0
  778. package/vendor/7zip/CPP/7zip/UI/Common/DirItem.h +407 -0
  779. package/vendor/7zip/CPP/7zip/UI/Common/EnumDirItems.cpp +1637 -0
  780. package/vendor/7zip/CPP/7zip/UI/Common/EnumDirItems.h +38 -0
  781. package/vendor/7zip/CPP/7zip/UI/Common/ExitCode.h +27 -0
  782. package/vendor/7zip/CPP/7zip/UI/Common/Extract.cpp +593 -0
  783. package/vendor/7zip/CPP/7zip/UI/Common/Extract.h +118 -0
  784. package/vendor/7zip/CPP/7zip/UI/Common/ExtractMode.h +44 -0
  785. package/vendor/7zip/CPP/7zip/UI/Common/ExtractingFilePath.cpp +299 -0
  786. package/vendor/7zip/CPP/7zip/UI/Common/ExtractingFilePath.h +31 -0
  787. package/vendor/7zip/CPP/7zip/UI/Common/HashCalc.cpp +2273 -0
  788. package/vendor/7zip/CPP/7zip/UI/Common/HashCalc.h +322 -0
  789. package/vendor/7zip/CPP/7zip/UI/Common/IFileExtractCallback.h +112 -0
  790. package/vendor/7zip/CPP/7zip/UI/Common/LoadCodecs.cpp +1354 -0
  791. package/vendor/7zip/CPP/7zip/UI/Common/LoadCodecs.h +482 -0
  792. package/vendor/7zip/CPP/7zip/UI/Common/OpenArchive.cpp +3690 -0
  793. package/vendor/7zip/CPP/7zip/UI/Common/OpenArchive.h +469 -0
  794. package/vendor/7zip/CPP/7zip/UI/Common/PropIDUtils.cpp +746 -0
  795. package/vendor/7zip/CPP/7zip/UI/Common/PropIDUtils.h +18 -0
  796. package/vendor/7zip/CPP/7zip/UI/Common/Property.h +14 -0
  797. package/vendor/7zip/CPP/7zip/UI/Common/SetProperties.cpp +88 -0
  798. package/vendor/7zip/CPP/7zip/UI/Common/SetProperties.h +10 -0
  799. package/vendor/7zip/CPP/7zip/UI/Common/SortUtils.cpp +25 -0
  800. package/vendor/7zip/CPP/7zip/UI/Common/SortUtils.h +10 -0
  801. package/vendor/7zip/CPP/7zip/UI/Common/StdAfx.h +11 -0
  802. package/vendor/7zip/CPP/7zip/UI/Common/TempFiles.cpp +20 -0
  803. package/vendor/7zip/CPP/7zip/UI/Common/TempFiles.h +19 -0
  804. package/vendor/7zip/CPP/7zip/UI/Common/Update.cpp +1931 -0
  805. package/vendor/7zip/CPP/7zip/UI/Common/Update.h +221 -0
  806. package/vendor/7zip/CPP/7zip/UI/Common/UpdateAction.cpp +64 -0
  807. package/vendor/7zip/CPP/7zip/UI/Common/UpdateAction.h +66 -0
  808. package/vendor/7zip/CPP/7zip/UI/Common/UpdateCallback.cpp +1078 -0
  809. package/vendor/7zip/CPP/7zip/UI/Common/UpdateCallback.h +197 -0
  810. package/vendor/7zip/CPP/7zip/UI/Common/UpdatePair.cpp +303 -0
  811. package/vendor/7zip/CPP/7zip/UI/Common/UpdatePair.h +27 -0
  812. package/vendor/7zip/CPP/7zip/UI/Common/UpdateProduce.cpp +75 -0
  813. package/vendor/7zip/CPP/7zip/UI/Common/UpdateProduce.h +60 -0
  814. package/vendor/7zip/CPP/7zip/UI/Common/WorkDir.cpp +84 -0
  815. package/vendor/7zip/CPP/7zip/UI/Common/WorkDir.h +30 -0
  816. package/vendor/7zip/CPP/7zip/UI/Common/ZipRegistry.cpp +599 -0
  817. package/vendor/7zip/CPP/7zip/UI/Common/ZipRegistry.h +212 -0
  818. package/vendor/7zip/CPP/7zip/UI/Console/BenchCon.cpp +41 -0
  819. package/vendor/7zip/CPP/7zip/UI/Console/BenchCon.h +14 -0
  820. package/vendor/7zip/CPP/7zip/UI/Console/Console.dsp +1052 -0
  821. package/vendor/7zip/CPP/7zip/UI/Console/Console.dsw +29 -0
  822. package/vendor/7zip/CPP/7zip/UI/Console/Console.mak +45 -0
  823. package/vendor/7zip/CPP/7zip/UI/Console/Console.manifest +16 -0
  824. package/vendor/7zip/CPP/7zip/UI/Console/ConsoleClose.cpp +98 -0
  825. package/vendor/7zip/CPP/7zip/UI/Console/ConsoleClose.h +39 -0
  826. package/vendor/7zip/CPP/7zip/UI/Console/ExtractCallbackConsole.cpp +954 -0
  827. package/vendor/7zip/CPP/7zip/UI/Console/ExtractCallbackConsole.h +211 -0
  828. package/vendor/7zip/CPP/7zip/UI/Console/HashCon.cpp +426 -0
  829. package/vendor/7zip/CPP/7zip/UI/Console/HashCon.h +58 -0
  830. package/vendor/7zip/CPP/7zip/UI/Console/List.cpp +1417 -0
  831. package/vendor/7zip/CPP/7zip/UI/Console/List.h +42 -0
  832. package/vendor/7zip/CPP/7zip/UI/Console/Main.cpp +1663 -0
  833. package/vendor/7zip/CPP/7zip/UI/Console/MainAr.cpp +235 -0
  834. package/vendor/7zip/CPP/7zip/UI/Console/OpenCallbackConsole.cpp +115 -0
  835. package/vendor/7zip/CPP/7zip/UI/Console/OpenCallbackConsole.h +73 -0
  836. package/vendor/7zip/CPP/7zip/UI/Console/PercentPrinter.cpp +186 -0
  837. package/vendor/7zip/CPP/7zip/UI/Console/PercentPrinter.h +66 -0
  838. package/vendor/7zip/CPP/7zip/UI/Console/StdAfx.cpp +3 -0
  839. package/vendor/7zip/CPP/7zip/UI/Console/StdAfx.h +11 -0
  840. package/vendor/7zip/CPP/7zip/UI/Console/UpdateCallbackConsole.cpp +1012 -0
  841. package/vendor/7zip/CPP/7zip/UI/Console/UpdateCallbackConsole.h +148 -0
  842. package/vendor/7zip/CPP/7zip/UI/Console/UserInputUtils.cpp +118 -0
  843. package/vendor/7zip/CPP/7zip/UI/Console/UserInputUtils.h +27 -0
  844. package/vendor/7zip/CPP/7zip/UI/Console/makefile +68 -0
  845. package/vendor/7zip/CPP/7zip/UI/Console/makefile.gcc +184 -0
  846. package/vendor/7zip/CPP/7zip/UI/Console/resource.rc +7 -0
  847. package/vendor/7zip/CPP/7zip/UI/Explorer/7-zip.dll.manifest +1 -0
  848. package/vendor/7zip/CPP/7zip/UI/Explorer/ContextMenu.cpp +1837 -0
  849. package/vendor/7zip/CPP/7zip/UI/Explorer/ContextMenu.h +173 -0
  850. package/vendor/7zip/CPP/7zip/UI/Explorer/ContextMenuFlags.h +27 -0
  851. package/vendor/7zip/CPP/7zip/UI/Explorer/DllExportsExplorer.cpp +268 -0
  852. package/vendor/7zip/CPP/7zip/UI/Explorer/Explorer.def +9 -0
  853. package/vendor/7zip/CPP/7zip/UI/Explorer/Explorer.dsp +620 -0
  854. package/vendor/7zip/CPP/7zip/UI/Explorer/Explorer.dsw +29 -0
  855. package/vendor/7zip/CPP/7zip/UI/Explorer/MenuLogo.bmp +0 -0
  856. package/vendor/7zip/CPP/7zip/UI/Explorer/MyExplorerCommand.h +217 -0
  857. package/vendor/7zip/CPP/7zip/UI/Explorer/MyMessages.cpp +43 -0
  858. package/vendor/7zip/CPP/7zip/UI/Explorer/MyMessages.h +16 -0
  859. package/vendor/7zip/CPP/7zip/UI/Explorer/RegistryContextMenu.cpp +225 -0
  860. package/vendor/7zip/CPP/7zip/UI/Explorer/RegistryContextMenu.h +13 -0
  861. package/vendor/7zip/CPP/7zip/UI/Explorer/StdAfx.cpp +3 -0
  862. package/vendor/7zip/CPP/7zip/UI/Explorer/StdAfx.h +6 -0
  863. package/vendor/7zip/CPP/7zip/UI/Explorer/makefile +76 -0
  864. package/vendor/7zip/CPP/7zip/UI/Explorer/resource.h +15 -0
  865. package/vendor/7zip/CPP/7zip/UI/Explorer/resource.rc +10 -0
  866. package/vendor/7zip/CPP/7zip/UI/Explorer/resource2.rc +19 -0
  867. package/vendor/7zip/CPP/7zip/UI/Far/ExtractEngine.cpp +274 -0
  868. package/vendor/7zip/CPP/7zip/UI/Far/ExtractEngine.h +43 -0
  869. package/vendor/7zip/CPP/7zip/UI/Far/Far.cpp +588 -0
  870. package/vendor/7zip/CPP/7zip/UI/Far/Far.def +35 -0
  871. package/vendor/7zip/CPP/7zip/UI/Far/Far.dsp +831 -0
  872. package/vendor/7zip/CPP/7zip/UI/Far/Far.dsw +29 -0
  873. package/vendor/7zip/CPP/7zip/UI/Far/FarPlugin.h +560 -0
  874. package/vendor/7zip/CPP/7zip/UI/Far/FarUtils.cpp +523 -0
  875. package/vendor/7zip/CPP/7zip/UI/Far/FarUtils.h +203 -0
  876. package/vendor/7zip/CPP/7zip/UI/Far/Messages.h +136 -0
  877. package/vendor/7zip/CPP/7zip/UI/Far/OverwriteDialogFar.cpp +145 -0
  878. package/vendor/7zip/CPP/7zip/UI/Far/OverwriteDialogFar.h +37 -0
  879. package/vendor/7zip/CPP/7zip/UI/Far/Plugin.cpp +937 -0
  880. package/vendor/7zip/CPP/7zip/UI/Far/Plugin.h +97 -0
  881. package/vendor/7zip/CPP/7zip/UI/Far/PluginCommon.cpp +50 -0
  882. package/vendor/7zip/CPP/7zip/UI/Far/PluginDelete.cpp +144 -0
  883. package/vendor/7zip/CPP/7zip/UI/Far/PluginRead.cpp +301 -0
  884. package/vendor/7zip/CPP/7zip/UI/Far/PluginWrite.cpp +840 -0
  885. package/vendor/7zip/CPP/7zip/UI/Far/ProgressBox.cpp +305 -0
  886. package/vendor/7zip/CPP/7zip/UI/Far/ProgressBox.h +85 -0
  887. package/vendor/7zip/CPP/7zip/UI/Far/StdAfx.cpp +3 -0
  888. package/vendor/7zip/CPP/7zip/UI/Far/StdAfx.h +11 -0
  889. package/vendor/7zip/CPP/7zip/UI/Far/UpdateCallbackFar.cpp +327 -0
  890. package/vendor/7zip/CPP/7zip/UI/Far/UpdateCallbackFar.h +58 -0
  891. package/vendor/7zip/CPP/7zip/UI/Far/makefile +105 -0
  892. package/vendor/7zip/CPP/7zip/UI/Far/resource.rc +3 -0
  893. package/vendor/7zip/CPP/7zip/UI/FileManager/7zFM.exe.manifest +23 -0
  894. package/vendor/7zip/CPP/7zip/UI/FileManager/7zipLogo.ico +0 -0
  895. package/vendor/7zip/CPP/7zip/UI/FileManager/AboutDialog.cpp +81 -0
  896. package/vendor/7zip/CPP/7zip/UI/FileManager/AboutDialog.h +19 -0
  897. package/vendor/7zip/CPP/7zip/UI/FileManager/AboutDialog.rc +26 -0
  898. package/vendor/7zip/CPP/7zip/UI/FileManager/AboutDialogRes.h +8 -0
  899. package/vendor/7zip/CPP/7zip/UI/FileManager/Add.bmp +0 -0
  900. package/vendor/7zip/CPP/7zip/UI/FileManager/Add2.bmp +0 -0
  901. package/vendor/7zip/CPP/7zip/UI/FileManager/AltStreamsFolder.cpp +865 -0
  902. package/vendor/7zip/CPP/7zip/UI/FileManager/AltStreamsFolder.h +92 -0
  903. package/vendor/7zip/CPP/7zip/UI/FileManager/App.cpp +1004 -0
  904. package/vendor/7zip/CPP/7zip/UI/FileManager/App.h +314 -0
  905. package/vendor/7zip/CPP/7zip/UI/FileManager/AppState.h +95 -0
  906. package/vendor/7zip/CPP/7zip/UI/FileManager/BrowseDialog.cpp +1132 -0
  907. package/vendor/7zip/CPP/7zip/UI/FileManager/BrowseDialog.h +32 -0
  908. package/vendor/7zip/CPP/7zip/UI/FileManager/BrowseDialog.rc +25 -0
  909. package/vendor/7zip/CPP/7zip/UI/FileManager/BrowseDialog2.cpp +1873 -0
  910. package/vendor/7zip/CPP/7zip/UI/FileManager/BrowseDialog2.h +10 -0
  911. package/vendor/7zip/CPP/7zip/UI/FileManager/BrowseDialog2.rc +32 -0
  912. package/vendor/7zip/CPP/7zip/UI/FileManager/BrowseDialog2Res.h +9 -0
  913. package/vendor/7zip/CPP/7zip/UI/FileManager/BrowseDialogRes.h +9 -0
  914. package/vendor/7zip/CPP/7zip/UI/FileManager/ClassDefs.cpp +12 -0
  915. package/vendor/7zip/CPP/7zip/UI/FileManager/ComboDialog.cpp +64 -0
  916. package/vendor/7zip/CPP/7zip/UI/FileManager/ComboDialog.h +28 -0
  917. package/vendor/7zip/CPP/7zip/UI/FileManager/ComboDialog.rc +16 -0
  918. package/vendor/7zip/CPP/7zip/UI/FileManager/ComboDialogRes.h +4 -0
  919. package/vendor/7zip/CPP/7zip/UI/FileManager/Copy.bmp +0 -0
  920. package/vendor/7zip/CPP/7zip/UI/FileManager/Copy2.bmp +0 -0
  921. package/vendor/7zip/CPP/7zip/UI/FileManager/CopyDialog.cpp +103 -0
  922. package/vendor/7zip/CPP/7zip/UI/FileManager/CopyDialog.h +31 -0
  923. package/vendor/7zip/CPP/7zip/UI/FileManager/CopyDialog.rc +20 -0
  924. package/vendor/7zip/CPP/7zip/UI/FileManager/CopyDialogRes.h +8 -0
  925. package/vendor/7zip/CPP/7zip/UI/FileManager/Delete.bmp +0 -0
  926. package/vendor/7zip/CPP/7zip/UI/FileManager/Delete2.bmp +0 -0
  927. package/vendor/7zip/CPP/7zip/UI/FileManager/DialogSize.h +16 -0
  928. package/vendor/7zip/CPP/7zip/UI/FileManager/EditDialog.cpp +57 -0
  929. package/vendor/7zip/CPP/7zip/UI/FileManager/EditDialog.h +25 -0
  930. package/vendor/7zip/CPP/7zip/UI/FileManager/EditDialog.rc +15 -0
  931. package/vendor/7zip/CPP/7zip/UI/FileManager/EditDialogRes.h +2 -0
  932. package/vendor/7zip/CPP/7zip/UI/FileManager/EditPage.cpp +159 -0
  933. package/vendor/7zip/CPP/7zip/UI/FileManager/EditPage.h +30 -0
  934. package/vendor/7zip/CPP/7zip/UI/FileManager/EditPage.rc +19 -0
  935. package/vendor/7zip/CPP/7zip/UI/FileManager/EditPage2.rc +14 -0
  936. package/vendor/7zip/CPP/7zip/UI/FileManager/EditPageRes.h +15 -0
  937. package/vendor/7zip/CPP/7zip/UI/FileManager/EnumFormatEtc.cpp +109 -0
  938. package/vendor/7zip/CPP/7zip/UI/FileManager/EnumFormatEtc.h +10 -0
  939. package/vendor/7zip/CPP/7zip/UI/FileManager/Extract.bmp +0 -0
  940. package/vendor/7zip/CPP/7zip/UI/FileManager/Extract2.bmp +0 -0
  941. package/vendor/7zip/CPP/7zip/UI/FileManager/ExtractCallback.cpp +1284 -0
  942. package/vendor/7zip/CPP/7zip/UI/FileManager/ExtractCallback.h +347 -0
  943. package/vendor/7zip/CPP/7zip/UI/FileManager/FM.cpp +1230 -0
  944. package/vendor/7zip/CPP/7zip/UI/FileManager/FM.dsp +1699 -0
  945. package/vendor/7zip/CPP/7zip/UI/FileManager/FM.dsw +29 -0
  946. package/vendor/7zip/CPP/7zip/UI/FileManager/FM.ico +0 -0
  947. package/vendor/7zip/CPP/7zip/UI/FileManager/FM.mak +102 -0
  948. package/vendor/7zip/CPP/7zip/UI/FileManager/FSDrives.cpp +512 -0
  949. package/vendor/7zip/CPP/7zip/UI/FileManager/FSDrives.h +52 -0
  950. package/vendor/7zip/CPP/7zip/UI/FileManager/FSFolder.cpp +1179 -0
  951. package/vendor/7zip/CPP/7zip/UI/FileManager/FSFolder.h +220 -0
  952. package/vendor/7zip/CPP/7zip/UI/FileManager/FSFolderCopy.cpp +871 -0
  953. package/vendor/7zip/CPP/7zip/UI/FileManager/FileFolderPluginOpen.cpp +394 -0
  954. package/vendor/7zip/CPP/7zip/UI/FileManager/FileFolderPluginOpen.h +27 -0
  955. package/vendor/7zip/CPP/7zip/UI/FileManager/FilePlugins.cpp +78 -0
  956. package/vendor/7zip/CPP/7zip/UI/FileManager/FilePlugins.h +33 -0
  957. package/vendor/7zip/CPP/7zip/UI/FileManager/FoldersPage.cpp +172 -0
  958. package/vendor/7zip/CPP/7zip/UI/FileManager/FoldersPage.h +32 -0
  959. package/vendor/7zip/CPP/7zip/UI/FileManager/FoldersPage.rc +23 -0
  960. package/vendor/7zip/CPP/7zip/UI/FileManager/FoldersPage2.rc +11 -0
  961. package/vendor/7zip/CPP/7zip/UI/FileManager/FoldersPageRes.h +12 -0
  962. package/vendor/7zip/CPP/7zip/UI/FileManager/FormatUtils.cpp +28 -0
  963. package/vendor/7zip/CPP/7zip/UI/FileManager/FormatUtils.h +14 -0
  964. package/vendor/7zip/CPP/7zip/UI/FileManager/HelpUtils.cpp +78 -0
  965. package/vendor/7zip/CPP/7zip/UI/FileManager/HelpUtils.h +10 -0
  966. package/vendor/7zip/CPP/7zip/UI/FileManager/IFolder.h +187 -0
  967. package/vendor/7zip/CPP/7zip/UI/FileManager/Info.bmp +0 -0
  968. package/vendor/7zip/CPP/7zip/UI/FileManager/Info2.bmp +0 -0
  969. package/vendor/7zip/CPP/7zip/UI/FileManager/LangPage.cpp +359 -0
  970. package/vendor/7zip/CPP/7zip/UI/FileManager/LangPage.h +36 -0
  971. package/vendor/7zip/CPP/7zip/UI/FileManager/LangPage.rc +40 -0
  972. package/vendor/7zip/CPP/7zip/UI/FileManager/LangPageRes.h +9 -0
  973. package/vendor/7zip/CPP/7zip/UI/FileManager/LangUtils.cpp +333 -0
  974. package/vendor/7zip/CPP/7zip/UI/FileManager/LangUtils.h +48 -0
  975. package/vendor/7zip/CPP/7zip/UI/FileManager/LinkDialog.cpp +402 -0
  976. package/vendor/7zip/CPP/7zip/UI/FileManager/LinkDialog.h +34 -0
  977. package/vendor/7zip/CPP/7zip/UI/FileManager/LinkDialog.rc +38 -0
  978. package/vendor/7zip/CPP/7zip/UI/FileManager/LinkDialogRes.h +22 -0
  979. package/vendor/7zip/CPP/7zip/UI/FileManager/ListViewDialog.cpp +321 -0
  980. package/vendor/7zip/CPP/7zip/UI/FileManager/ListViewDialog.h +46 -0
  981. package/vendor/7zip/CPP/7zip/UI/FileManager/ListViewDialog.rc +14 -0
  982. package/vendor/7zip/CPP/7zip/UI/FileManager/ListViewDialogRes.h +2 -0
  983. package/vendor/7zip/CPP/7zip/UI/FileManager/MemDialog.cpp +218 -0
  984. package/vendor/7zip/CPP/7zip/UI/FileManager/MemDialog.h +48 -0
  985. package/vendor/7zip/CPP/7zip/UI/FileManager/MemDialog.rc +49 -0
  986. package/vendor/7zip/CPP/7zip/UI/FileManager/MemDialogRes.h +13 -0
  987. package/vendor/7zip/CPP/7zip/UI/FileManager/MenuPage.cpp +439 -0
  988. package/vendor/7zip/CPP/7zip/UI/FileManager/MenuPage.h +57 -0
  989. package/vendor/7zip/CPP/7zip/UI/FileManager/MenuPage.rc +24 -0
  990. package/vendor/7zip/CPP/7zip/UI/FileManager/MenuPage2.rc +28 -0
  991. package/vendor/7zip/CPP/7zip/UI/FileManager/MenuPageRes.h +15 -0
  992. package/vendor/7zip/CPP/7zip/UI/FileManager/MessagesDialog.cpp +76 -0
  993. package/vendor/7zip/CPP/7zip/UI/FileManager/MessagesDialog.h +25 -0
  994. package/vendor/7zip/CPP/7zip/UI/FileManager/MessagesDialog.rc +14 -0
  995. package/vendor/7zip/CPP/7zip/UI/FileManager/MessagesDialogRes.h +3 -0
  996. package/vendor/7zip/CPP/7zip/UI/FileManager/Move.bmp +0 -0
  997. package/vendor/7zip/CPP/7zip/UI/FileManager/Move2.bmp +0 -0
  998. package/vendor/7zip/CPP/7zip/UI/FileManager/MyCom2.h +46 -0
  999. package/vendor/7zip/CPP/7zip/UI/FileManager/MyLoadMenu.cpp +964 -0
  1000. package/vendor/7zip/CPP/7zip/UI/FileManager/MyLoadMenu.h +40 -0
  1001. package/vendor/7zip/CPP/7zip/UI/FileManager/MyWindowsNew.h +119 -0
  1002. package/vendor/7zip/CPP/7zip/UI/FileManager/NetFolder.cpp +276 -0
  1003. package/vendor/7zip/CPP/7zip/UI/FileManager/NetFolder.h +36 -0
  1004. package/vendor/7zip/CPP/7zip/UI/FileManager/OpenCallback.cpp +86 -0
  1005. package/vendor/7zip/CPP/7zip/UI/FileManager/OpenCallback.h +69 -0
  1006. package/vendor/7zip/CPP/7zip/UI/FileManager/OptionsDialog.cpp +89 -0
  1007. package/vendor/7zip/CPP/7zip/UI/FileManager/OverwriteDialog.cpp +288 -0
  1008. package/vendor/7zip/CPP/7zip/UI/FileManager/OverwriteDialog.h +89 -0
  1009. package/vendor/7zip/CPP/7zip/UI/FileManager/OverwriteDialog.rc +93 -0
  1010. package/vendor/7zip/CPP/7zip/UI/FileManager/OverwriteDialogRes.h +19 -0
  1011. package/vendor/7zip/CPP/7zip/UI/FileManager/Panel.cpp +1177 -0
  1012. package/vendor/7zip/CPP/7zip/UI/FileManager/Panel.h +1020 -0
  1013. package/vendor/7zip/CPP/7zip/UI/FileManager/PanelCopy.cpp +477 -0
  1014. package/vendor/7zip/CPP/7zip/UI/FileManager/PanelCrc.cpp +422 -0
  1015. package/vendor/7zip/CPP/7zip/UI/FileManager/PanelDrag.cpp +3006 -0
  1016. package/vendor/7zip/CPP/7zip/UI/FileManager/PanelFolderChange.cpp +1122 -0
  1017. package/vendor/7zip/CPP/7zip/UI/FileManager/PanelItemOpen.cpp +1836 -0
  1018. package/vendor/7zip/CPP/7zip/UI/FileManager/PanelItems.cpp +1476 -0
  1019. package/vendor/7zip/CPP/7zip/UI/FileManager/PanelKey.cpp +357 -0
  1020. package/vendor/7zip/CPP/7zip/UI/FileManager/PanelListNotify.cpp +838 -0
  1021. package/vendor/7zip/CPP/7zip/UI/FileManager/PanelMenu.cpp +1160 -0
  1022. package/vendor/7zip/CPP/7zip/UI/FileManager/PanelOperations.cpp +533 -0
  1023. package/vendor/7zip/CPP/7zip/UI/FileManager/PanelSelect.cpp +317 -0
  1024. package/vendor/7zip/CPP/7zip/UI/FileManager/PanelSort.cpp +288 -0
  1025. package/vendor/7zip/CPP/7zip/UI/FileManager/PanelSplitFile.cpp +562 -0
  1026. package/vendor/7zip/CPP/7zip/UI/FileManager/PasswordDialog.cpp +58 -0
  1027. package/vendor/7zip/CPP/7zip/UI/FileManager/PasswordDialog.h +28 -0
  1028. package/vendor/7zip/CPP/7zip/UI/FileManager/PasswordDialog.rc +18 -0
  1029. package/vendor/7zip/CPP/7zip/UI/FileManager/PasswordDialogRes.h +5 -0
  1030. package/vendor/7zip/CPP/7zip/UI/FileManager/PluginInterface.h +32 -0
  1031. package/vendor/7zip/CPP/7zip/UI/FileManager/PluginLoader.h +33 -0
  1032. package/vendor/7zip/CPP/7zip/UI/FileManager/ProgramLocation.cpp +3 -0
  1033. package/vendor/7zip/CPP/7zip/UI/FileManager/ProgramLocation.h +6 -0
  1034. package/vendor/7zip/CPP/7zip/UI/FileManager/ProgressDialog.cpp +201 -0
  1035. package/vendor/7zip/CPP/7zip/UI/FileManager/ProgressDialog.h +171 -0
  1036. package/vendor/7zip/CPP/7zip/UI/FileManager/ProgressDialog.rc +12 -0
  1037. package/vendor/7zip/CPP/7zip/UI/FileManager/ProgressDialog2.cpp +1484 -0
  1038. package/vendor/7zip/CPP/7zip/UI/FileManager/ProgressDialog2.h +355 -0
  1039. package/vendor/7zip/CPP/7zip/UI/FileManager/ProgressDialog2.rc +40 -0
  1040. package/vendor/7zip/CPP/7zip/UI/FileManager/ProgressDialog2Res.h +49 -0
  1041. package/vendor/7zip/CPP/7zip/UI/FileManager/ProgressDialog2a.rc +85 -0
  1042. package/vendor/7zip/CPP/7zip/UI/FileManager/ProgressDialogRes.h +3 -0
  1043. package/vendor/7zip/CPP/7zip/UI/FileManager/PropertyName.cpp +23 -0
  1044. package/vendor/7zip/CPP/7zip/UI/FileManager/PropertyName.h +10 -0
  1045. package/vendor/7zip/CPP/7zip/UI/FileManager/PropertyName.rc +109 -0
  1046. package/vendor/7zip/CPP/7zip/UI/FileManager/PropertyNameRes.h +104 -0
  1047. package/vendor/7zip/CPP/7zip/UI/FileManager/RegistryAssociations.cpp +167 -0
  1048. package/vendor/7zip/CPP/7zip/UI/FileManager/RegistryAssociations.h +31 -0
  1049. package/vendor/7zip/CPP/7zip/UI/FileManager/RegistryPlugins.cpp +145 -0
  1050. package/vendor/7zip/CPP/7zip/UI/FileManager/RegistryPlugins.h +29 -0
  1051. package/vendor/7zip/CPP/7zip/UI/FileManager/RegistryUtils.cpp +194 -0
  1052. package/vendor/7zip/CPP/7zip/UI/FileManager/RegistryUtils.h +50 -0
  1053. package/vendor/7zip/CPP/7zip/UI/FileManager/RootFolder.cpp +342 -0
  1054. package/vendor/7zip/CPP/7zip/UI/FileManager/RootFolder.h +24 -0
  1055. package/vendor/7zip/CPP/7zip/UI/FileManager/SettingsPage.cpp +453 -0
  1056. package/vendor/7zip/CPP/7zip/UI/FileManager/SettingsPage.h +37 -0
  1057. package/vendor/7zip/CPP/7zip/UI/FileManager/SettingsPage.rc +22 -0
  1058. package/vendor/7zip/CPP/7zip/UI/FileManager/SettingsPage2.rc +37 -0
  1059. package/vendor/7zip/CPP/7zip/UI/FileManager/SettingsPageRes.h +23 -0
  1060. package/vendor/7zip/CPP/7zip/UI/FileManager/SplitDialog.cpp +114 -0
  1061. package/vendor/7zip/CPP/7zip/UI/FileManager/SplitDialog.h +28 -0
  1062. package/vendor/7zip/CPP/7zip/UI/FileManager/SplitDialog.rc +16 -0
  1063. package/vendor/7zip/CPP/7zip/UI/FileManager/SplitDialogRes.h +8 -0
  1064. package/vendor/7zip/CPP/7zip/UI/FileManager/SplitUtils.cpp +96 -0
  1065. package/vendor/7zip/CPP/7zip/UI/FileManager/SplitUtils.h +15 -0
  1066. package/vendor/7zip/CPP/7zip/UI/FileManager/StdAfx.cpp +3 -0
  1067. package/vendor/7zip/CPP/7zip/UI/FileManager/StdAfx.h +67 -0
  1068. package/vendor/7zip/CPP/7zip/UI/FileManager/StringUtils.cpp +39 -0
  1069. package/vendor/7zip/CPP/7zip/UI/FileManager/StringUtils.h +11 -0
  1070. package/vendor/7zip/CPP/7zip/UI/FileManager/SysIconUtils.cpp +352 -0
  1071. package/vendor/7zip/CPP/7zip/UI/FileManager/SysIconUtils.h +65 -0
  1072. package/vendor/7zip/CPP/7zip/UI/FileManager/SystemPage.cpp +472 -0
  1073. package/vendor/7zip/CPP/7zip/UI/FileManager/SystemPage.h +126 -0
  1074. package/vendor/7zip/CPP/7zip/UI/FileManager/SystemPage.rc +43 -0
  1075. package/vendor/7zip/CPP/7zip/UI/FileManager/SystemPageRes.h +9 -0
  1076. package/vendor/7zip/CPP/7zip/UI/FileManager/Test.bmp +0 -0
  1077. package/vendor/7zip/CPP/7zip/UI/FileManager/Test2.bmp +0 -0
  1078. package/vendor/7zip/CPP/7zip/UI/FileManager/TextPairs.cpp +193 -0
  1079. package/vendor/7zip/CPP/7zip/UI/FileManager/TextPairs.h +32 -0
  1080. package/vendor/7zip/CPP/7zip/UI/FileManager/UpdateCallback100.cpp +147 -0
  1081. package/vendor/7zip/CPP/7zip/UI/FileManager/UpdateCallback100.h +49 -0
  1082. package/vendor/7zip/CPP/7zip/UI/FileManager/VerCtrl.cpp +428 -0
  1083. package/vendor/7zip/CPP/7zip/UI/FileManager/ViewSettings.cpp +315 -0
  1084. package/vendor/7zip/CPP/7zip/UI/FileManager/ViewSettings.h +115 -0
  1085. package/vendor/7zip/CPP/7zip/UI/FileManager/makefile +110 -0
  1086. package/vendor/7zip/CPP/7zip/UI/FileManager/resource.h +199 -0
  1087. package/vendor/7zip/CPP/7zip/UI/FileManager/resource.rc +296 -0
  1088. package/vendor/7zip/CPP/7zip/UI/FileManager/resourceGui.h +25 -0
  1089. package/vendor/7zip/CPP/7zip/UI/FileManager/resourceGui.rc +30 -0
  1090. package/vendor/7zip/CPP/7zip/UI/GUI/7zG.exe.manifest +23 -0
  1091. package/vendor/7zip/CPP/7zip/UI/GUI/BenchmarkDialog.cpp +1921 -0
  1092. package/vendor/7zip/CPP/7zip/UI/GUI/BenchmarkDialog.h +15 -0
  1093. package/vendor/7zip/CPP/7zip/UI/GUI/BenchmarkDialog.rc +288 -0
  1094. package/vendor/7zip/CPP/7zip/UI/GUI/BenchmarkDialogRes.h +79 -0
  1095. package/vendor/7zip/CPP/7zip/UI/GUI/CompressDialog.cpp +3821 -0
  1096. package/vendor/7zip/CPP/7zip/UI/GUI/CompressDialog.h +483 -0
  1097. package/vendor/7zip/CPP/7zip/UI/GUI/CompressDialog.rc +233 -0
  1098. package/vendor/7zip/CPP/7zip/UI/GUI/CompressDialogRes.h +125 -0
  1099. package/vendor/7zip/CPP/7zip/UI/GUI/CompressOptionsDialog.rc +79 -0
  1100. package/vendor/7zip/CPP/7zip/UI/GUI/Extract.rc +59 -0
  1101. package/vendor/7zip/CPP/7zip/UI/GUI/ExtractDialog.cpp +420 -0
  1102. package/vendor/7zip/CPP/7zip/UI/GUI/ExtractDialog.h +113 -0
  1103. package/vendor/7zip/CPP/7zip/UI/GUI/ExtractDialog.rc +98 -0
  1104. package/vendor/7zip/CPP/7zip/UI/GUI/ExtractDialogRes.h +24 -0
  1105. package/vendor/7zip/CPP/7zip/UI/GUI/ExtractGUI.cpp +297 -0
  1106. package/vendor/7zip/CPP/7zip/UI/GUI/ExtractGUI.h +39 -0
  1107. package/vendor/7zip/CPP/7zip/UI/GUI/ExtractRes.h +51 -0
  1108. package/vendor/7zip/CPP/7zip/UI/GUI/FM.ico +0 -0
  1109. package/vendor/7zip/CPP/7zip/UI/GUI/GUI.cpp +502 -0
  1110. package/vendor/7zip/CPP/7zip/UI/GUI/GUI.dsp +1275 -0
  1111. package/vendor/7zip/CPP/7zip/UI/GUI/GUI.dsw +29 -0
  1112. package/vendor/7zip/CPP/7zip/UI/GUI/HashGUI.cpp +341 -0
  1113. package/vendor/7zip/CPP/7zip/UI/GUI/HashGUI.h +27 -0
  1114. package/vendor/7zip/CPP/7zip/UI/GUI/StdAfx.cpp +3 -0
  1115. package/vendor/7zip/CPP/7zip/UI/GUI/StdAfx.h +6 -0
  1116. package/vendor/7zip/CPP/7zip/UI/GUI/UpdateCallbackGUI.cpp +295 -0
  1117. package/vendor/7zip/CPP/7zip/UI/GUI/UpdateCallbackGUI.h +31 -0
  1118. package/vendor/7zip/CPP/7zip/UI/GUI/UpdateCallbackGUI2.cpp +130 -0
  1119. package/vendor/7zip/CPP/7zip/UI/GUI/UpdateCallbackGUI2.h +53 -0
  1120. package/vendor/7zip/CPP/7zip/UI/GUI/UpdateGUI.cpp +605 -0
  1121. package/vendor/7zip/CPP/7zip/UI/GUI/UpdateGUI.h +33 -0
  1122. package/vendor/7zip/CPP/7zip/UI/GUI/makefile +148 -0
  1123. package/vendor/7zip/CPP/7zip/UI/GUI/resource.rc +26 -0
  1124. package/vendor/7zip/CPP/7zip/UI/GUI/resource2.h +2 -0
  1125. package/vendor/7zip/CPP/7zip/UI/GUI/resource2.rc +10 -0
  1126. package/vendor/7zip/CPP/7zip/UI/GUI/resource3.h +10 -0
  1127. package/vendor/7zip/CPP/7zip/UI/GUI/resource3.rc +15 -0
  1128. package/vendor/7zip/CPP/7zip/UI/makefile +12 -0
  1129. package/vendor/7zip/CPP/7zip/cmpl_clang.mak +3 -0
  1130. package/vendor/7zip/CPP/7zip/cmpl_clang_arm64.mak +3 -0
  1131. package/vendor/7zip/CPP/7zip/cmpl_clang_x64.mak +3 -0
  1132. package/vendor/7zip/CPP/7zip/cmpl_clang_x86.mak +3 -0
  1133. package/vendor/7zip/CPP/7zip/cmpl_gcc.mak +3 -0
  1134. package/vendor/7zip/CPP/7zip/cmpl_gcc_arm.mak +3 -0
  1135. package/vendor/7zip/CPP/7zip/cmpl_gcc_arm64.mak +3 -0
  1136. package/vendor/7zip/CPP/7zip/cmpl_gcc_x64.mak +3 -0
  1137. package/vendor/7zip/CPP/7zip/cmpl_gcc_x86.mak +3 -0
  1138. package/vendor/7zip/CPP/7zip/cmpl_mac_arm64.mak +3 -0
  1139. package/vendor/7zip/CPP/7zip/cmpl_mac_x64.mak +3 -0
  1140. package/vendor/7zip/CPP/7zip/makefile +10 -0
  1141. package/vendor/7zip/CPP/7zip/var_clang.mak +11 -0
  1142. package/vendor/7zip/CPP/7zip/var_clang_arm64.mak +19 -0
  1143. package/vendor/7zip/CPP/7zip/var_clang_x64.mak +11 -0
  1144. package/vendor/7zip/CPP/7zip/var_clang_x86.mak +11 -0
  1145. package/vendor/7zip/CPP/7zip/var_gcc.mak +12 -0
  1146. package/vendor/7zip/CPP/7zip/var_gcc_arm.mak +34 -0
  1147. package/vendor/7zip/CPP/7zip/var_gcc_arm64.mak +12 -0
  1148. package/vendor/7zip/CPP/7zip/var_gcc_x64.mak +11 -0
  1149. package/vendor/7zip/CPP/7zip/var_gcc_x86.mak +10 -0
  1150. package/vendor/7zip/CPP/7zip/var_mac_arm64.mak +13 -0
  1151. package/vendor/7zip/CPP/7zip/var_mac_x64.mak +13 -0
  1152. package/vendor/7zip/CPP/7zip/warn_clang.mak +3 -0
  1153. package/vendor/7zip/CPP/7zip/warn_clang_mac.mak +9 -0
  1154. package/vendor/7zip/CPP/7zip/warn_gcc.mak +55 -0
  1155. package/vendor/7zip/CPP/Build.mak +259 -0
  1156. package/vendor/7zip/CPP/Common/AutoPtr.h +46 -0
  1157. package/vendor/7zip/CPP/Common/CRC.cpp +7 -0
  1158. package/vendor/7zip/CPP/Common/C_FileIO.cpp +3 -0
  1159. package/vendor/7zip/CPP/Common/C_FileIO.h +6 -0
  1160. package/vendor/7zip/CPP/Common/CksumReg.cpp +55 -0
  1161. package/vendor/7zip/CPP/Common/ComTry.h +21 -0
  1162. package/vendor/7zip/CPP/Common/CommandLineParser.cpp +231 -0
  1163. package/vendor/7zip/CPP/Common/CommandLineParser.h +63 -0
  1164. package/vendor/7zip/CPP/Common/Common.h +28 -0
  1165. package/vendor/7zip/CPP/Common/Common0.h +342 -0
  1166. package/vendor/7zip/CPP/Common/CrcReg.cpp +77 -0
  1167. package/vendor/7zip/CPP/Common/Defs.h +16 -0
  1168. package/vendor/7zip/CPP/Common/DynLimBuf.cpp +93 -0
  1169. package/vendor/7zip/CPP/Common/DynLimBuf.h +41 -0
  1170. package/vendor/7zip/CPP/Common/DynamicBuffer.h +76 -0
  1171. package/vendor/7zip/CPP/Common/IntToString.cpp +215 -0
  1172. package/vendor/7zip/CPP/Common/IntToString.h +54 -0
  1173. package/vendor/7zip/CPP/Common/Lang.cpp +173 -0
  1174. package/vendor/7zip/CPP/Common/Lang.h +30 -0
  1175. package/vendor/7zip/CPP/Common/ListFileUtils.cpp +150 -0
  1176. package/vendor/7zip/CPP/Common/ListFileUtils.h +18 -0
  1177. package/vendor/7zip/CPP/Common/LzFindPrepare.cpp +7 -0
  1178. package/vendor/7zip/CPP/Common/Md5Reg.cpp +44 -0
  1179. package/vendor/7zip/CPP/Common/MyBuffer.h +343 -0
  1180. package/vendor/7zip/CPP/Common/MyBuffer2.h +185 -0
  1181. package/vendor/7zip/CPP/Common/MyCom.h +693 -0
  1182. package/vendor/7zip/CPP/Common/MyException.h +14 -0
  1183. package/vendor/7zip/CPP/Common/MyGuidDef.h +63 -0
  1184. package/vendor/7zip/CPP/Common/MyInitGuid.h +57 -0
  1185. package/vendor/7zip/CPP/Common/MyLinux.h +75 -0
  1186. package/vendor/7zip/CPP/Common/MyMap.cpp +140 -0
  1187. package/vendor/7zip/CPP/Common/MyMap.h +28 -0
  1188. package/vendor/7zip/CPP/Common/MyString.cpp +1842 -0
  1189. package/vendor/7zip/CPP/Common/MyString.h +1079 -0
  1190. package/vendor/7zip/CPP/Common/MyTypes.h +38 -0
  1191. package/vendor/7zip/CPP/Common/MyUnknown.h +8 -0
  1192. package/vendor/7zip/CPP/Common/MyVector.cpp +3 -0
  1193. package/vendor/7zip/CPP/Common/MyVector.h +772 -0
  1194. package/vendor/7zip/CPP/Common/MyWindows.cpp +292 -0
  1195. package/vendor/7zip/CPP/Common/MyWindows.h +325 -0
  1196. package/vendor/7zip/CPP/Common/MyXml.cpp +349 -0
  1197. package/vendor/7zip/CPP/Common/MyXml.h +45 -0
  1198. package/vendor/7zip/CPP/Common/NewHandler.cpp +340 -0
  1199. package/vendor/7zip/CPP/Common/NewHandler.h +121 -0
  1200. package/vendor/7zip/CPP/Common/Random.cpp +28 -0
  1201. package/vendor/7zip/CPP/Common/Random.h +14 -0
  1202. package/vendor/7zip/CPP/Common/Sha1Prepare.cpp +7 -0
  1203. package/vendor/7zip/CPP/Common/Sha1Reg.cpp +67 -0
  1204. package/vendor/7zip/CPP/Common/Sha256Prepare.cpp +7 -0
  1205. package/vendor/7zip/CPP/Common/Sha256Reg.cpp +67 -0
  1206. package/vendor/7zip/CPP/Common/Sha3Reg.cpp +76 -0
  1207. package/vendor/7zip/CPP/Common/Sha512Prepare.cpp +7 -0
  1208. package/vendor/7zip/CPP/Common/Sha512Reg.cpp +83 -0
  1209. package/vendor/7zip/CPP/Common/StdAfx.h +8 -0
  1210. package/vendor/7zip/CPP/Common/StdInStream.cpp +98 -0
  1211. package/vendor/7zip/CPP/Common/StdInStream.h +46 -0
  1212. package/vendor/7zip/CPP/Common/StdOutStream.cpp +271 -0
  1213. package/vendor/7zip/CPP/Common/StdOutStream.h +87 -0
  1214. package/vendor/7zip/CPP/Common/StringConvert.cpp +762 -0
  1215. package/vendor/7zip/CPP/Common/StringConvert.h +110 -0
  1216. package/vendor/7zip/CPP/Common/StringToInt.cpp +154 -0
  1217. package/vendor/7zip/CPP/Common/StringToInt.h +38 -0
  1218. package/vendor/7zip/CPP/Common/TextConfig.cpp +123 -0
  1219. package/vendor/7zip/CPP/Common/TextConfig.h +19 -0
  1220. package/vendor/7zip/CPP/Common/UTFConvert.cpp +863 -0
  1221. package/vendor/7zip/CPP/Common/UTFConvert.h +384 -0
  1222. package/vendor/7zip/CPP/Common/Wildcard.cpp +789 -0
  1223. package/vendor/7zip/CPP/Common/Wildcard.h +231 -0
  1224. package/vendor/7zip/CPP/Common/Xxh64Reg.cpp +97 -0
  1225. package/vendor/7zip/CPP/Common/XzCrc64Init.cpp +7 -0
  1226. package/vendor/7zip/CPP/Common/XzCrc64Reg.cpp +39 -0
  1227. package/vendor/7zip/CPP/Windows/COM.cpp +41 -0
  1228. package/vendor/7zip/CPP/Windows/COM.h +86 -0
  1229. package/vendor/7zip/CPP/Windows/Clipboard.cpp +130 -0
  1230. package/vendor/7zip/CPP/Windows/Clipboard.h +28 -0
  1231. package/vendor/7zip/CPP/Windows/CommonDialog.cpp +269 -0
  1232. package/vendor/7zip/CPP/Windows/CommonDialog.h +43 -0
  1233. package/vendor/7zip/CPP/Windows/Console.cpp +10 -0
  1234. package/vendor/7zip/CPP/Windows/Console.h +52 -0
  1235. package/vendor/7zip/CPP/Windows/Control/ComboBox.cpp +75 -0
  1236. package/vendor/7zip/CPP/Windows/Control/ComboBox.h +79 -0
  1237. package/vendor/7zip/CPP/Windows/Control/CommandBar.h +52 -0
  1238. package/vendor/7zip/CPP/Windows/Control/Dialog.cpp +446 -0
  1239. package/vendor/7zip/CPP/Windows/Control/Dialog.h +213 -0
  1240. package/vendor/7zip/CPP/Windows/Control/Edit.h +19 -0
  1241. package/vendor/7zip/CPP/Windows/Control/ImageList.cpp +10 -0
  1242. package/vendor/7zip/CPP/Windows/Control/ImageList.h +87 -0
  1243. package/vendor/7zip/CPP/Windows/Control/ListView.cpp +162 -0
  1244. package/vendor/7zip/CPP/Windows/Control/ListView.h +156 -0
  1245. package/vendor/7zip/CPP/Windows/Control/ProgressBar.h +35 -0
  1246. package/vendor/7zip/CPP/Windows/Control/PropertyPage.cpp +165 -0
  1247. package/vendor/7zip/CPP/Windows/Control/PropertyPage.h +50 -0
  1248. package/vendor/7zip/CPP/Windows/Control/ReBar.h +34 -0
  1249. package/vendor/7zip/CPP/Windows/Control/Static.h +28 -0
  1250. package/vendor/7zip/CPP/Windows/Control/StatusBar.h +42 -0
  1251. package/vendor/7zip/CPP/Windows/Control/StdAfx.h +11 -0
  1252. package/vendor/7zip/CPP/Windows/Control/ToolBar.h +43 -0
  1253. package/vendor/7zip/CPP/Windows/Control/Trackbar.h +27 -0
  1254. package/vendor/7zip/CPP/Windows/Control/Window2.cpp +202 -0
  1255. package/vendor/7zip/CPP/Windows/Control/Window2.h +53 -0
  1256. package/vendor/7zip/CPP/Windows/DLL.cpp +178 -0
  1257. package/vendor/7zip/CPP/Windows/DLL.h +103 -0
  1258. package/vendor/7zip/CPP/Windows/ErrorMsg.cpp +133 -0
  1259. package/vendor/7zip/CPP/Windows/ErrorMsg.h +16 -0
  1260. package/vendor/7zip/CPP/Windows/FileDir.cpp +1388 -0
  1261. package/vendor/7zip/CPP/Windows/FileDir.h +173 -0
  1262. package/vendor/7zip/CPP/Windows/FileFind.cpp +1458 -0
  1263. package/vendor/7zip/CPP/Windows/FileFind.h +345 -0
  1264. package/vendor/7zip/CPP/Windows/FileIO.cpp +1188 -0
  1265. package/vendor/7zip/CPP/Windows/FileIO.h +508 -0
  1266. package/vendor/7zip/CPP/Windows/FileLink.cpp +697 -0
  1267. package/vendor/7zip/CPP/Windows/FileMapping.cpp +12 -0
  1268. package/vendor/7zip/CPP/Windows/FileMapping.h +66 -0
  1269. package/vendor/7zip/CPP/Windows/FileName.cpp +911 -0
  1270. package/vendor/7zip/CPP/Windows/FileName.h +142 -0
  1271. package/vendor/7zip/CPP/Windows/FileSystem.cpp +187 -0
  1272. package/vendor/7zip/CPP/Windows/FileSystem.h +31 -0
  1273. package/vendor/7zip/CPP/Windows/Handle.h +39 -0
  1274. package/vendor/7zip/CPP/Windows/MemoryGlobal.cpp +36 -0
  1275. package/vendor/7zip/CPP/Windows/MemoryGlobal.h +55 -0
  1276. package/vendor/7zip/CPP/Windows/MemoryLock.cpp +127 -0
  1277. package/vendor/7zip/CPP/Windows/MemoryLock.h +40 -0
  1278. package/vendor/7zip/CPP/Windows/Menu.cpp +265 -0
  1279. package/vendor/7zip/CPP/Windows/Menu.h +170 -0
  1280. package/vendor/7zip/CPP/Windows/NationalTime.cpp +37 -0
  1281. package/vendor/7zip/CPP/Windows/NationalTime.h +20 -0
  1282. package/vendor/7zip/CPP/Windows/Net.cpp +398 -0
  1283. package/vendor/7zip/CPP/Windows/Net.h +87 -0
  1284. package/vendor/7zip/CPP/Windows/NtCheck.h +58 -0
  1285. package/vendor/7zip/CPP/Windows/ProcessMessages.cpp +22 -0
  1286. package/vendor/7zip/CPP/Windows/ProcessMessages.h +12 -0
  1287. package/vendor/7zip/CPP/Windows/ProcessUtils.cpp +102 -0
  1288. package/vendor/7zip/CPP/Windows/ProcessUtils.h +138 -0
  1289. package/vendor/7zip/CPP/Windows/PropVariant.cpp +393 -0
  1290. package/vendor/7zip/CPP/Windows/PropVariant.h +173 -0
  1291. package/vendor/7zip/CPP/Windows/PropVariantConv.cpp +274 -0
  1292. package/vendor/7zip/CPP/Windows/PropVariantConv.h +47 -0
  1293. package/vendor/7zip/CPP/Windows/PropVariantUtils.cpp +161 -0
  1294. package/vendor/7zip/CPP/Windows/PropVariantUtils.h +34 -0
  1295. package/vendor/7zip/CPP/Windows/Registry.cpp +474 -0
  1296. package/vendor/7zip/CPP/Windows/Registry.h +96 -0
  1297. package/vendor/7zip/CPP/Windows/ResourceString.cpp +103 -0
  1298. package/vendor/7zip/CPP/Windows/ResourceString.h +17 -0
  1299. package/vendor/7zip/CPP/Windows/SecurityUtils.cpp +186 -0
  1300. package/vendor/7zip/CPP/Windows/SecurityUtils.h +154 -0
  1301. package/vendor/7zip/CPP/Windows/Shell.cpp +839 -0
  1302. package/vendor/7zip/CPP/Windows/Shell.h +129 -0
  1303. package/vendor/7zip/CPP/Windows/StdAfx.h +11 -0
  1304. package/vendor/7zip/CPP/Windows/Synchronization.cpp +87 -0
  1305. package/vendor/7zip/CPP/Windows/Synchronization.h +386 -0
  1306. package/vendor/7zip/CPP/Windows/System.cpp +423 -0
  1307. package/vendor/7zip/CPP/Windows/System.h +209 -0
  1308. package/vendor/7zip/CPP/Windows/SystemInfo.cpp +1312 -0
  1309. package/vendor/7zip/CPP/Windows/SystemInfo.h +19 -0
  1310. package/vendor/7zip/CPP/Windows/Thread.h +46 -0
  1311. package/vendor/7zip/CPP/Windows/TimeUtils.cpp +467 -0
  1312. package/vendor/7zip/CPP/Windows/TimeUtils.h +154 -0
  1313. package/vendor/7zip/CPP/Windows/WinDefs.h +17 -0
  1314. package/vendor/7zip/CPP/Windows/Window.cpp +179 -0
  1315. package/vendor/7zip/CPP/Windows/Window.h +363 -0
  1316. package/vendor/7zip/DOC/7zC.txt +187 -0
  1317. package/vendor/7zip/DOC/7zFormat.txt +469 -0
  1318. package/vendor/7zip/DOC/7zip.hhp +84 -0
  1319. package/vendor/7zip/DOC/7zip.wxs +403 -0
  1320. package/vendor/7zip/DOC/License.txt +151 -0
  1321. package/vendor/7zip/DOC/Methods.txt +177 -0
  1322. package/vendor/7zip/DOC/copying.txt +502 -0
  1323. package/vendor/7zip/DOC/lzma.txt +345 -0
  1324. package/vendor/7zip/DOC/readme.txt +299 -0
  1325. package/vendor/7zip/DOC/src-history.txt +884 -0
  1326. package/vendor/7zip/DOC/unRarLicense.txt +41 -0
  1327. package/vendor/7zip/README.md +2 -0
@@ -0,0 +1,3243 @@
1
+ // ArchiveExtractCallback.cpp
2
+
3
+ #include "StdAfx.h"
4
+
5
+ #undef sprintf
6
+ #undef printf
7
+
8
+ // #include <stdio.h>
9
+
10
+ #include "../../../../C/Alloc.h"
11
+ #include "../../../../C/CpuArch.h"
12
+
13
+ #include "../../../Common/ComTry.h"
14
+ #include "../../../Common/IntToString.h"
15
+ #include "../../../Common/StringConvert.h"
16
+ #include "../../../Common/UTFConvert.h"
17
+ #include "../../../Common/Wildcard.h"
18
+
19
+ #include "../../../Windows/ErrorMsg.h"
20
+ #include "../../../Windows/FileDir.h"
21
+ #include "../../../Windows/FileFind.h"
22
+ #include "../../../Windows/FileName.h"
23
+ #include "../../../Windows/PropVariant.h"
24
+ #include "../../../Windows/PropVariantConv.h"
25
+
26
+ #if defined(_WIN32) && !defined(UNDER_CE) && !defined(Z7_SFX)
27
+ #define Z7_USE_SECURITY_CODE
28
+ #include "../../../Windows/SecurityUtils.h"
29
+ #endif
30
+
31
+ #include "../../Common/FilePathAutoRename.h"
32
+ #include "../../Common/StreamUtils.h"
33
+
34
+ #include "../../Archive/Common/ItemNameUtils.h"
35
+
36
+ #include "../Common/ExtractingFilePath.h"
37
+ #include "../Common/PropIDUtils.h"
38
+
39
+ #include "ArchiveExtractCallback.h"
40
+
41
+ using namespace NWindows;
42
+ using namespace NFile;
43
+ using namespace NDir;
44
+
45
+ static const char * const kCantAutoRename = "Cannot create file with auto name";
46
+ static const char * const kCantRenameFile = "Cannot rename existing file";
47
+ static const char * const kCantDeleteOutputFile = "Cannot delete output file";
48
+ static const char * const kCantDeleteOutputDir = "Cannot delete output folder";
49
+ static const char * const kCantOpenOutFile = "Cannot open output file";
50
+ #ifndef Z7_SFX
51
+ static const char * const kCantOpenInFile = "Cannot open input file";
52
+ #endif
53
+ static const char * const kCantSetFileLen = "Cannot set length for output file";
54
+ #ifdef SUPPORT_LINKS
55
+ static const char * const kCantCreateHardLink = "Cannot create hard link";
56
+ static const char * const kCantCreateSymLink = "Cannot create symbolic link";
57
+ static const char * const k_HardLink_to_SymLink_Ignored = "Hard link to symbolic link was ignored";
58
+ static const char * const k_CantDelete_File_for_SymLink = "Cannot delete file for symbolic link creation";
59
+ static const char * const k_CantDelete_Dir_for_SymLink = "Cannot delete directory for symbolic link creation";
60
+ #endif
61
+
62
+ static const unsigned k_LinkDataSize_LIMIT = 1 << 12;
63
+
64
+ #ifdef SUPPORT_LINKS
65
+ #if WCHAR_PATH_SEPARATOR != L'/'
66
+ // we convert linux slashes to windows slashes for further processing.
67
+ // also we convert linux backslashes to BackslashReplacement character.
68
+ #define REPLACE_SLASHES_from_Linux_to_Sys(s) \
69
+ { NArchive::NItemName::ReplaceToWinSlashes(s, true); } // useBackslashReplacement
70
+ // { s.Replace(L'/', WCHAR_PATH_SEPARATOR); }
71
+ #else
72
+ #define REPLACE_SLASHES_from_Linux_to_Sys(s)
73
+ #endif
74
+ #endif
75
+
76
+ #ifndef Z7_SFX
77
+
78
+ Z7_COM7F_IMF(COutStreamWithHash::Write(const void *data, UInt32 size, UInt32 *processedSize))
79
+ {
80
+ HRESULT result = S_OK;
81
+ if (_stream)
82
+ result = _stream->Write(data, size, &size);
83
+ if (_calculate)
84
+ _hash->Update(data, size);
85
+ _size += size;
86
+ if (processedSize)
87
+ *processedSize = size;
88
+ return result;
89
+ }
90
+
91
+ #endif // Z7_SFX
92
+
93
+
94
+ #ifdef Z7_USE_SECURITY_CODE
95
+ bool InitLocalPrivileges();
96
+ bool InitLocalPrivileges()
97
+ {
98
+ NSecurity::CAccessToken token;
99
+ if (!token.OpenProcessToken(GetCurrentProcess(),
100
+ TOKEN_QUERY | TOKEN_ADJUST_PRIVILEGES))
101
+ return false;
102
+
103
+ TOKEN_PRIVILEGES tp;
104
+
105
+ tp.PrivilegeCount = 1;
106
+ tp.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;
107
+
108
+ if (!::LookupPrivilegeValue(NULL, SE_SECURITY_NAME, &tp.Privileges[0].Luid))
109
+ return false;
110
+ if (!token.AdjustPrivileges(&tp))
111
+ return false;
112
+ return (GetLastError() == ERROR_SUCCESS);
113
+ }
114
+ #endif // Z7_USE_SECURITY_CODE
115
+
116
+
117
+
118
+ #if defined(_WIN32) && !defined(UNDER_CE) && !defined(Z7_SFX)
119
+
120
+ static const char * const kOfficeExtensions =
121
+ " doc dot wbk"
122
+ " docx docm dotx dotm docb wll wwl"
123
+ " xls xlt xlm"
124
+ " xlsx xlsm xltx xltm xlsb xla xlam"
125
+ " ppt pot pps ppa ppam"
126
+ " pptx pptm potx potm ppam ppsx ppsm sldx sldm"
127
+ " ";
128
+
129
+ static bool FindExt2(const char *p, const UString &name)
130
+ {
131
+ const int pathPos = name.ReverseFind_PathSepar();
132
+ const int dotPos = name.ReverseFind_Dot();
133
+ if (dotPos < 0
134
+ || dotPos < pathPos
135
+ || dotPos == (int)name.Len() - 1)
136
+ return false;
137
+
138
+ AString s;
139
+ for (unsigned pos = (unsigned)(dotPos + 1);; pos++)
140
+ {
141
+ const wchar_t c = name[pos];
142
+ if (c <= 0)
143
+ break;
144
+ if (c >= 0x80)
145
+ return false;
146
+ s.Add_Char((char)MyCharLower_Ascii((char)c));
147
+ }
148
+ for (unsigned i = 0; p[i] != 0;)
149
+ {
150
+ unsigned j;
151
+ for (j = i; p[j] != ' '; j++);
152
+ if (s.Len() == j - i && memcmp(p + i, (const char *)s, s.Len()) == 0)
153
+ return true;
154
+ i = j + 1;
155
+ }
156
+ return false;
157
+ }
158
+
159
+
160
+ static const char * const k_ZoneId_StreamName_With_Colon_Prefix = ":Zone.Identifier";
161
+
162
+ bool Is_ZoneId_StreamName(const wchar_t *s)
163
+ {
164
+ UString s2 = s;
165
+ Correct_AltStream_Name(s2);
166
+ return StringsAreEqualNoCase_Ascii(s2, k_ZoneId_StreamName_With_Colon_Prefix + 1);
167
+ }
168
+
169
+ void ReadZoneFile_Of_BaseFile(CFSTR fileName, CByteBuffer &buf)
170
+ {
171
+ buf.Free();
172
+ FString path (fileName);
173
+ path += k_ZoneId_StreamName_With_Colon_Prefix;
174
+ NIO::CInFile file;
175
+ if (!file.Open(path))
176
+ return;
177
+ UInt64 fileSize;
178
+ if (!file.GetLength(fileSize))
179
+ return;
180
+ if (fileSize == 0 || fileSize >= (1u << 15))
181
+ return;
182
+ buf.Alloc((size_t)fileSize);
183
+ size_t processed;
184
+ if (file.ReadFull(buf, (size_t)fileSize, processed) && processed == fileSize)
185
+ return;
186
+ buf.Free();
187
+ }
188
+
189
+ bool WriteZoneFile_To_BaseFile(CFSTR fileName, const CByteBuffer &buf)
190
+ {
191
+ FString path (fileName);
192
+ path += k_ZoneId_StreamName_With_Colon_Prefix;
193
+ NIO::COutFile file;
194
+ if (!file.Create_ALWAYS(path))
195
+ return false;
196
+ return file.WriteFull(buf, buf.Size());
197
+ }
198
+
199
+ #endif
200
+
201
+
202
+ #ifdef SUPPORT_LINKS
203
+
204
+ int CHardLinkNode::Compare(const CHardLinkNode &a) const
205
+ {
206
+ if (StreamId < a.StreamId) return -1;
207
+ if (StreamId > a.StreamId) return 1;
208
+ return MyCompare(INode, a.INode);
209
+ }
210
+
211
+ static HRESULT Archive_Get_HardLinkNode(IInArchive *archive, UInt32 index, CHardLinkNode &h, bool &defined)
212
+ {
213
+ h.INode = 0;
214
+ h.StreamId = (UInt64)(Int64)-1;
215
+ defined = false;
216
+ {
217
+ NCOM::CPropVariant prop;
218
+ RINOK(archive->GetProperty(index, kpidINode, &prop))
219
+ if (!ConvertPropVariantToUInt64(prop, h.INode))
220
+ return S_OK;
221
+ }
222
+ {
223
+ NCOM::CPropVariant prop;
224
+ RINOK(archive->GetProperty(index, kpidStreamId, &prop))
225
+ ConvertPropVariantToUInt64(prop, h.StreamId);
226
+ }
227
+ defined = true;
228
+ return S_OK;
229
+ }
230
+
231
+
232
+ HRESULT CArchiveExtractCallback::PrepareHardLinks(const CRecordVector<UInt32> *realIndices)
233
+ {
234
+ _hardLinks.Clear();
235
+
236
+ if (!_arc->Ask_INode)
237
+ return S_OK;
238
+
239
+ IInArchive * const archive = _arc->Archive;
240
+ CRecordVector<CHardLinkNode> &hardIDs = _hardLinks.IDs;
241
+
242
+ {
243
+ UInt32 numItems;
244
+ if (realIndices)
245
+ numItems = realIndices->Size();
246
+ else
247
+ {
248
+ RINOK(archive->GetNumberOfItems(&numItems))
249
+ }
250
+
251
+ for (UInt32 i = 0; i < numItems; i++)
252
+ {
253
+ CHardLinkNode h;
254
+ bool defined;
255
+ const UInt32 realIndex = realIndices ? (*realIndices)[i] : i;
256
+
257
+ RINOK(Archive_Get_HardLinkNode(archive, realIndex, h, defined))
258
+ if (defined)
259
+ {
260
+ bool isAltStream = false;
261
+ RINOK(Archive_IsItem_AltStream(archive, realIndex, isAltStream))
262
+ if (!isAltStream)
263
+ {
264
+ bool isDir = false;
265
+ RINOK(Archive_IsItem_Dir(archive, realIndex, isDir))
266
+ if (!isDir)
267
+ hardIDs.Add(h);
268
+ }
269
+ }
270
+ }
271
+ }
272
+
273
+ hardIDs.Sort2();
274
+
275
+ {
276
+ // we keep only items that have 2 or more items
277
+ unsigned k = 0;
278
+ unsigned numSame = 1;
279
+ for (unsigned i = 1; i < hardIDs.Size(); i++)
280
+ {
281
+ if (hardIDs[i].Compare(hardIDs[i - 1]) != 0)
282
+ numSame = 1;
283
+ else if (++numSame == 2)
284
+ {
285
+ if (i - 1 != k)
286
+ hardIDs[k] = hardIDs[i - 1];
287
+ k++;
288
+ }
289
+ }
290
+ hardIDs.DeleteFrom(k);
291
+ }
292
+
293
+ _hardLinks.PrepareLinks();
294
+ return S_OK;
295
+ }
296
+
297
+ #endif // SUPPORT_LINKS
298
+
299
+
300
+ CArchiveExtractCallback::CArchiveExtractCallback():
301
+ // Write_CTime(true),
302
+ // Write_ATime(true),
303
+ // Write_MTime(true),
304
+ Is_elimPrefix_Mode(false),
305
+ _arc(NULL),
306
+ _multiArchives(false)
307
+ {
308
+ #ifdef Z7_USE_SECURITY_CODE
309
+ _saclEnabled = InitLocalPrivileges();
310
+ #endif
311
+ }
312
+
313
+
314
+ void CArchiveExtractCallback::InitBeforeNewArchive()
315
+ {
316
+ #if defined(_WIN32) && !defined(UNDER_CE) && !defined(Z7_SFX)
317
+ ZoneBuf.Free();
318
+ #endif
319
+ }
320
+
321
+ void CArchiveExtractCallback::Init(
322
+ const CExtractNtOptions &ntOptions,
323
+ const NWildcard::CCensorNode *wildcardCensor,
324
+ const CArc *arc,
325
+ IFolderArchiveExtractCallback *extractCallback2,
326
+ bool stdOutMode, bool testMode,
327
+ const FString &directoryPath,
328
+ const UStringVector &removePathParts, bool removePartsForAltStreams,
329
+ UInt64 packSize)
330
+ {
331
+ ClearExtractedDirsInfo();
332
+ _outFileStream.Release();
333
+ _bufPtrSeqOutStream.Release();
334
+
335
+ #ifdef SUPPORT_LINKS
336
+ _hardLinks.Clear();
337
+ _postLinks.Clear();
338
+ #endif
339
+
340
+ #ifdef SUPPORT_ALT_STREAMS
341
+ _renamedFiles.Clear();
342
+ #endif
343
+
344
+ _ntOptions = ntOptions;
345
+ _wildcardCensor = wildcardCensor;
346
+ _stdOutMode = stdOutMode;
347
+ _testMode = testMode;
348
+ _packTotal = packSize;
349
+ _progressTotal = packSize;
350
+ // _progressTotal = 0;
351
+ // _progressTotal_Defined = false;
352
+ // _progressTotal_Defined = true;
353
+ _extractCallback2 = extractCallback2;
354
+ /*
355
+ _compressProgress.Release();
356
+ _extractCallback2.QueryInterface(IID_ICompressProgressInfo, &_compressProgress);
357
+ _callbackMessage.Release();
358
+ _extractCallback2.QueryInterface(IID_IArchiveExtractCallbackMessage2, &_callbackMessage);
359
+ */
360
+ _folderArchiveExtractCallback2.Release();
361
+ _extractCallback2.QueryInterface(IID_IFolderArchiveExtractCallback2, &_folderArchiveExtractCallback2);
362
+
363
+ #ifndef Z7_SFX
364
+ _baseParentFolder = (UInt32)(Int32)-1;
365
+ _use_baseParentFolder_mode = false;
366
+ ExtractToStreamCallback.Release();
367
+ _extractCallback2.QueryInterface(IID_IFolderExtractToStreamCallback, &ExtractToStreamCallback);
368
+ if (ExtractToStreamCallback)
369
+ {
370
+ Int32 useStreams = 0;
371
+ if (ExtractToStreamCallback->UseExtractToStream(&useStreams) != S_OK
372
+ || useStreams == 0)
373
+ ExtractToStreamCallback.Release();
374
+ }
375
+ #endif
376
+
377
+ LocalProgressSpec->Init(extractCallback2, true);
378
+ LocalProgressSpec->SendProgress = false;
379
+
380
+ _removePathParts = removePathParts;
381
+ _removePartsForAltStreams = removePartsForAltStreams;
382
+
383
+ _arc = arc;
384
+ _dirPathPrefix = directoryPath;
385
+ _dirPathPrefix_Full = directoryPath;
386
+ #if defined(_WIN32) && !defined(UNDER_CE)
387
+ if (!NName::IsAltPathPrefix(_dirPathPrefix))
388
+ #endif
389
+ {
390
+ NName::NormalizeDirPathPrefix(_dirPathPrefix);
391
+ NDir::MyGetFullPathName(directoryPath, _dirPathPrefix_Full);
392
+ NName::NormalizeDirPathPrefix(_dirPathPrefix_Full);
393
+ }
394
+ }
395
+
396
+
397
+ Z7_COM7F_IMF(CArchiveExtractCallback::SetTotal(UInt64 size))
398
+ {
399
+ COM_TRY_BEGIN
400
+ _progressTotal = size;
401
+ // _progressTotal_Defined = true;
402
+ if (!_multiArchives && _extractCallback2)
403
+ return _extractCallback2->SetTotal(size);
404
+ return S_OK;
405
+ COM_TRY_END
406
+ }
407
+
408
+
409
+ static void NormalizeVals(UInt64 &v1, UInt64 &v2)
410
+ {
411
+ const UInt64 kMax = (UInt64)1 << 31;
412
+ while (v1 > kMax)
413
+ {
414
+ v1 >>= 1;
415
+ v2 >>= 1;
416
+ }
417
+ }
418
+
419
+
420
+ static UInt64 MyMultDiv64(UInt64 unpCur, UInt64 unpTotal, UInt64 packTotal)
421
+ {
422
+ NormalizeVals(packTotal, unpTotal);
423
+ NormalizeVals(unpCur, unpTotal);
424
+ if (unpTotal == 0)
425
+ unpTotal = 1;
426
+ return unpCur * packTotal / unpTotal;
427
+ }
428
+
429
+
430
+ Z7_COM7F_IMF(CArchiveExtractCallback::SetCompleted(const UInt64 *completeValue))
431
+ {
432
+ COM_TRY_BEGIN
433
+
434
+ if (!_extractCallback2)
435
+ return S_OK;
436
+
437
+ UInt64 packCur;
438
+ if (_multiArchives)
439
+ {
440
+ packCur = LocalProgressSpec->InSize;
441
+ if (completeValue /* && _progressTotal_Defined */)
442
+ packCur += MyMultDiv64(*completeValue, _progressTotal, _packTotal);
443
+ completeValue = &packCur;
444
+ }
445
+ return _extractCallback2->SetCompleted(completeValue);
446
+
447
+ COM_TRY_END
448
+ }
449
+
450
+
451
+ Z7_COM7F_IMF(CArchiveExtractCallback::SetRatioInfo(const UInt64 *inSize, const UInt64 *outSize))
452
+ {
453
+ COM_TRY_BEGIN
454
+ return LocalProgressSpec.Interface()->SetRatioInfo(inSize, outSize);
455
+ COM_TRY_END
456
+ }
457
+
458
+
459
+ void CArchiveExtractCallback::CreateComplexDirectory(
460
+ const UStringVector &dirPathParts, bool isFinal, FString &fullPath)
461
+ {
462
+ // we use (_item.IsDir) in this function
463
+ bool isAbsPath = false;
464
+ if (!dirPathParts.IsEmpty())
465
+ {
466
+ const UString &s = dirPathParts[0];
467
+ if (s.IsEmpty())
468
+ isAbsPath = true;
469
+ #if defined(_WIN32) && !defined(UNDER_CE)
470
+ else if (NName::IsDrivePath2(s))
471
+ isAbsPath = true;
472
+ #endif
473
+ }
474
+
475
+ if (_pathMode == NExtract::NPathMode::kAbsPaths && isAbsPath)
476
+ fullPath.Empty();
477
+ else
478
+ fullPath = _dirPathPrefix;
479
+
480
+ FOR_VECTOR (i, dirPathParts)
481
+ {
482
+ if (i != 0)
483
+ fullPath.Add_PathSepar();
484
+ const UString &s = dirPathParts[i];
485
+ fullPath += us2fs(s);
486
+
487
+ const bool isFinalDir = (i == dirPathParts.Size() - 1 && isFinal && _item.IsDir);
488
+
489
+ if (fullPath.IsEmpty()
490
+ #if defined(_WIN32) && !defined(UNDER_CE)
491
+ || (_pathMode == NExtract::NPathMode::kAbsPaths
492
+ && i == 0 && s.Len() == 2 && NName::IsDrivePath2(s))
493
+ #endif
494
+ )
495
+ {
496
+ if (isFinalDir)
497
+ _itemFailure = true; // we don't want to set attributes for root (or root drive) path
498
+ continue;
499
+ }
500
+
501
+ // bool need_SetAttrib = isFinalDir;
502
+ if (!isFinalDir || !NFile::NFind::DoesDirExist(fullPath))
503
+ {
504
+ HRESULT hres = S_OK;
505
+ #ifdef _WIN32
506
+ if (!CreateDir(fullPath))
507
+ hres = GetLastError_noZero_HRESULT();
508
+ #else
509
+ mode_t mode = g_umask.mask;
510
+ if (isFinalDir && _fi.Attrib_Defined)
511
+ {
512
+ const UInt32 attrib = _fi.Attrib;
513
+ if (attrib & FILE_ATTRIBUTE_UNIX_EXTENSION)
514
+ {
515
+ mode = attrib >> 16;
516
+ if (S_ISDIR(mode))
517
+ mode |= (S_IRUSR | S_IWUSR | S_IXUSR); // user/7z must be able to create files in this directory
518
+ else
519
+ {
520
+ // we do not want to use attributes, if it's not directory type.
521
+ // SendMessageError("is not directory type in metadata", fullPath);
522
+ mode = g_umask.mask;
523
+ }
524
+ mode &= g_umask.mask;
525
+ }
526
+ }
527
+ // printf("\n mkdir mode = %o\n", (unsigned)mode);
528
+ if (mkdir(fullPath, mode) == 0)
529
+ {
530
+ if (isFinalDir)
531
+ _dirAttrib_wasSet = true;
532
+ // printf("\n mkdir OK\n");
533
+ // need_SetAttrib = false;
534
+ }
535
+ else
536
+ hres = GetLastError_noZero_HRESULT();
537
+ #endif
538
+
539
+ if (isFinalDir && !NFile::NFind::DoesDirExist(fullPath))
540
+ {
541
+ _itemFailure = true;
542
+ SendMessageError_with_Error(hres, "Cannot create folder", fullPath);
543
+ // need_SetAttrib = false;
544
+ }
545
+ }
546
+ /*
547
+ // this code doesn't process item excluded by "Eliminate duplication of root folder"
548
+ // so we will set attributes later
549
+ if (need_SetAttrib)
550
+ {
551
+ // printf("\n SetAttrib \n");
552
+ SetAttrib(fullPath);
553
+ _dirAttrib_wasSet = true;
554
+ }
555
+ */
556
+ }
557
+ }
558
+
559
+
560
+ HRESULT CArchiveExtractCallback::GetTime(UInt32 index, PROPID propID, CArcTime &ft)
561
+ {
562
+ ft.Clear();
563
+ NCOM::CPropVariant prop;
564
+ RINOK(_arc->Archive->GetProperty(index, propID, &prop))
565
+ if (prop.vt == VT_FILETIME)
566
+ ft.Set_From_Prop(prop);
567
+ else if (prop.vt != VT_EMPTY)
568
+ return E_FAIL;
569
+ return S_OK;
570
+ }
571
+
572
+
573
+ HRESULT CArchiveExtractCallback::GetUnpackSize()
574
+ {
575
+ return _arc->GetItem_Size(_index, _curSize, _curSize_Defined);
576
+ }
577
+
578
+ static void AddPathToMessage(UString &s, const FString &path)
579
+ {
580
+ s += " : ";
581
+ s += fs2us(path);
582
+ }
583
+
584
+ HRESULT CArchiveExtractCallback::SendMessageError(const char *message, const FString &path) const
585
+ {
586
+ UString s (message);
587
+ AddPathToMessage(s, path);
588
+ return _extractCallback2->MessageError(s);
589
+ }
590
+
591
+
592
+ HRESULT CArchiveExtractCallback::SendMessageError_with_Error(HRESULT errorCode, const char *message, const FString &path) const
593
+ {
594
+ UString s (message);
595
+ if (errorCode != S_OK)
596
+ {
597
+ s += " : ";
598
+ s += NError::MyFormatMessage(errorCode);
599
+ }
600
+ AddPathToMessage(s, path);
601
+ return _extractCallback2->MessageError(s);
602
+ }
603
+
604
+ HRESULT CArchiveExtractCallback::SendMessageError_with_LastError(const char *message, const FString &path) const
605
+ {
606
+ const HRESULT errorCode = GetLastError_noZero_HRESULT();
607
+ return SendMessageError_with_Error(errorCode, message, path);
608
+ }
609
+
610
+ HRESULT CArchiveExtractCallback::SendMessageError2(HRESULT errorCode, const char *message, const FString &path1, const FString &path2) const
611
+ {
612
+ UString s (message);
613
+ if (errorCode != 0)
614
+ {
615
+ s += " : ";
616
+ s += NError::MyFormatMessage(errorCode);
617
+ }
618
+ AddPathToMessage(s, path1);
619
+ AddPathToMessage(s, path2);
620
+ return _extractCallback2->MessageError(s);
621
+ }
622
+
623
+ HRESULT CArchiveExtractCallback::SendMessageError2_with_LastError(
624
+ const char *message, const FString &path1, const FString &path2) const
625
+ {
626
+ const HRESULT errorCode = GetLastError_noZero_HRESULT();
627
+ return SendMessageError2(errorCode, message, path1, path2);
628
+ }
629
+
630
+ #ifndef Z7_SFX
631
+
632
+ Z7_CLASS_IMP_COM_1(
633
+ CGetProp
634
+ , IGetProp
635
+ )
636
+ public:
637
+ UInt32 IndexInArc;
638
+ const CArc *Arc;
639
+ // UString BaseName; // relative path
640
+ };
641
+
642
+ Z7_COM7F_IMF(CGetProp::GetProp(PROPID propID, PROPVARIANT *value))
643
+ {
644
+ /*
645
+ if (propID == kpidBaseName)
646
+ {
647
+ COM_TRY_BEGIN
648
+ NCOM::CPropVariant prop = BaseName;
649
+ prop.Detach(value);
650
+ return S_OK;
651
+ COM_TRY_END
652
+ }
653
+ */
654
+ return Arc->Archive->GetProperty(IndexInArc, propID, value);
655
+ }
656
+
657
+ #endif // Z7_SFX
658
+
659
+
660
+ struct CLinkLevelsInfo
661
+ {
662
+ bool IsAbsolute;
663
+ bool ParentDirDots_after_NonParent;
664
+ int LowLevel;
665
+ int FinalLevel;
666
+
667
+ void Parse(const UString &path, bool isWSL);
668
+ };
669
+
670
+ void CLinkLevelsInfo::Parse(const UString &path, bool isWSL)
671
+ {
672
+ IsAbsolute = isWSL ?
673
+ IS_PATH_SEPAR(path[0]) :
674
+ NName::IsAbsolutePath(path);
675
+ LowLevel = 0;
676
+ FinalLevel = 0;
677
+ ParentDirDots_after_NonParent = false;
678
+ bool nonParentDir = false;
679
+
680
+ UStringVector parts;
681
+ SplitPathToParts(path, parts);
682
+ int level = 0;
683
+
684
+ FOR_VECTOR (i, parts)
685
+ {
686
+ const UString &s = parts[i];
687
+ if (s.IsEmpty())
688
+ {
689
+ if (i == 0)
690
+ IsAbsolute = true;
691
+ continue;
692
+ }
693
+ if (s.IsEqualTo("."))
694
+ continue;
695
+ if (s.IsEqualTo(".."))
696
+ {
697
+ if (IsAbsolute || nonParentDir)
698
+ ParentDirDots_after_NonParent = true;
699
+ level--;
700
+ if (LowLevel > level)
701
+ LowLevel = level;
702
+ }
703
+ else
704
+ {
705
+ nonParentDir = true;
706
+ level++;
707
+ }
708
+ }
709
+
710
+ FinalLevel = level;
711
+ }
712
+
713
+
714
+ static bool IsSafePath(const UString &path, bool isWSL)
715
+ {
716
+ CLinkLevelsInfo levelsInfo;
717
+ levelsInfo.Parse(path, isWSL);
718
+ return !levelsInfo.IsAbsolute
719
+ && levelsInfo.LowLevel >= 0
720
+ && levelsInfo.FinalLevel > 0;
721
+ }
722
+
723
+ bool IsSafePath(const UString &path);
724
+ bool IsSafePath(const UString &path)
725
+ {
726
+ return IsSafePath(path, false); // isWSL
727
+ }
728
+
729
+ bool CensorNode_CheckPath2(const NWildcard::CCensorNode &node, const CReadArcItem &item, bool &include);
730
+ bool CensorNode_CheckPath2(const NWildcard::CCensorNode &node, const CReadArcItem &item, bool &include)
731
+ {
732
+ bool found = false;
733
+
734
+ // CheckPathVect() doesn't check path to Parent nodes
735
+ if (node.CheckPathVect(item.PathParts, !item.MainIsDir, include))
736
+ {
737
+ if (!include)
738
+ return true;
739
+
740
+ #ifdef SUPPORT_ALT_STREAMS
741
+ if (!item.IsAltStream)
742
+ return true;
743
+ #endif
744
+
745
+ found = true;
746
+ }
747
+
748
+ #ifdef SUPPORT_ALT_STREAMS
749
+
750
+ if (!item.IsAltStream)
751
+ return false;
752
+
753
+ UStringVector pathParts2 = item.PathParts;
754
+ if (pathParts2.IsEmpty())
755
+ pathParts2.AddNew();
756
+ UString &back = pathParts2.Back();
757
+ back.Add_Colon();
758
+ back += item.AltStreamName;
759
+ bool include2;
760
+
761
+ if (node.CheckPathVect(pathParts2,
762
+ true, // isFile,
763
+ include2))
764
+ {
765
+ include = include2;
766
+ return true;
767
+ }
768
+
769
+ #endif // SUPPORT_ALT_STREAMS
770
+
771
+ return found;
772
+ }
773
+
774
+
775
+ bool CensorNode_CheckPath(const NWildcard::CCensorNode &node, const CReadArcItem &item)
776
+ {
777
+ bool include;
778
+ if (CensorNode_CheckPath2(node, item, include))
779
+ return include;
780
+ return false;
781
+ }
782
+
783
+
784
+ static FString MakePath_from_2_Parts(const FString &prefix, const FString &path)
785
+ {
786
+ FString s (prefix);
787
+ #if defined(_WIN32) && !defined(UNDER_CE)
788
+ if (!path.IsEmpty() && path[0] == ':' && !prefix.IsEmpty() && IsPathSepar(prefix.Back()))
789
+ {
790
+ if (!NName::IsDriveRootPath_SuperAllowed(prefix))
791
+ s.DeleteBack();
792
+ }
793
+ #endif
794
+ s += path;
795
+ return s;
796
+ }
797
+
798
+
799
+
800
+ #ifdef SUPPORT_LINKS
801
+
802
+ /*
803
+ struct CTempMidBuffer
804
+ {
805
+ void *Buf;
806
+
807
+ CTempMidBuffer(size_t size): Buf(NULL) { Buf = ::MidAlloc(size); }
808
+ ~CTempMidBuffer() { ::MidFree(Buf); }
809
+ };
810
+
811
+ HRESULT CArchiveExtractCallback::MyCopyFile(ISequentialOutStream *outStream)
812
+ {
813
+ const size_t kBufSize = 1 << 16;
814
+ CTempMidBuffer buf(kBufSize);
815
+ if (!buf.Buf)
816
+ return E_OUTOFMEMORY;
817
+
818
+ NIO::CInFile inFile;
819
+ NIO::COutFile outFile;
820
+
821
+ if (!inFile.Open(_copyFile_Path))
822
+ return SendMessageError_with_LastError("Open error", _copyFile_Path);
823
+
824
+ for (;;)
825
+ {
826
+ UInt32 num;
827
+
828
+ if (!inFile.Read(buf.Buf, kBufSize, num))
829
+ return SendMessageError_with_LastError("Read error", _copyFile_Path);
830
+
831
+ if (num == 0)
832
+ return S_OK;
833
+
834
+
835
+ RINOK(WriteStream(outStream, buf.Buf, num));
836
+ }
837
+ }
838
+ */
839
+
840
+
841
+ HRESULT CArchiveExtractCallback::ReadLink()
842
+ {
843
+ IInArchive * const archive = _arc->Archive;
844
+ const UInt32 index = _index;
845
+ // _link.Clear(); // _link.Clear() was called already.
846
+ {
847
+ NCOM::CPropVariant prop;
848
+ RINOK(archive->GetProperty(index, kpidHardLink, &prop))
849
+ if (prop.vt == VT_BSTR)
850
+ {
851
+ _link.LinkType = k_LinkType_HardLink;
852
+ _link.isRelative = false; // RAR5, TAR: hard links are from root folder of archive
853
+ _link.LinkPath.SetFromBstr(prop.bstrVal);
854
+ // 7-Zip 24-: tar handler returned original path (with linux slash in most case)
855
+ // 7-Zip 24-: rar5 handler returned path with system slash.
856
+ // 7-Zip 25+: tar/rar5 handlers return linux path in most cases.
857
+ }
858
+ else if (prop.vt != VT_EMPTY)
859
+ return E_FAIL;
860
+ }
861
+ /*
862
+ {
863
+ NCOM::CPropVariant prop;
864
+ RINOK(archive->GetProperty(index, kpidCopyLink, &prop));
865
+ if (prop.vt == VT_BSTR)
866
+ {
867
+ _link.LinkType = k_LinkType_CopyLink;
868
+ _link.isRelative = false; // RAR5: copy links are from root folder of archive
869
+ _link.LinkPath.SetFromBstr(prop.bstrVal);
870
+ }
871
+ else if (prop.vt != VT_EMPTY)
872
+ return E_FAIL;
873
+ }
874
+ */
875
+ {
876
+ NCOM::CPropVariant prop;
877
+ RINOK(archive->GetProperty(index, kpidSymLink, &prop))
878
+ if (prop.vt == VT_BSTR)
879
+ {
880
+ _link.LinkType = k_LinkType_PureSymLink;
881
+ _link.isRelative = true; // RAR5, TAR: symbolic links are relative by default
882
+ _link.LinkPath.SetFromBstr(prop.bstrVal);
883
+ // 7-Zip 24-: (tar, cpio, xar, ext, iso) handlers returned returned original path (with linux slash in most case)
884
+ // 7-Zip 24-: rar5 handler returned path with system slash.
885
+ // 7-Zip 25+: all handlers return linux path in most cases.
886
+ }
887
+ else if (prop.vt != VT_EMPTY)
888
+ return E_FAIL;
889
+ }
890
+
891
+ // linux path separator in (_link.LinkPath) is expected for most cases,
892
+ // if new handler code is used, and if data in archive is correct.
893
+ // NtReparse_Data = NULL;
894
+ // NtReparse_Size = 0;
895
+ if (!_link.LinkPath.IsEmpty())
896
+ {
897
+ REPLACE_SLASHES_from_Linux_to_Sys(_link.LinkPath)
898
+ }
899
+ else if (_arc->GetRawProps)
900
+ {
901
+ const void *data;
902
+ UInt32 dataSize, propType;
903
+ if (_arc->GetRawProps->GetRawProp(_index, kpidNtReparse, &data, &dataSize, &propType) == S_OK
904
+ // && dataSize == 1234567 // for debug: unpacking without reparse
905
+ && dataSize)
906
+ {
907
+ if (propType != NPropDataType::kRaw)
908
+ return E_FAIL;
909
+ // 21.06: we need kpidNtReparse in linux for wim archives created in Windows
910
+ // NtReparse_Data = data;
911
+ // NtReparse_Size = dataSize;
912
+ // we ignore error code here, if there is failure of parsing:
913
+ _link.Parse_from_WindowsReparseData((const Byte *)data, dataSize);
914
+ }
915
+ }
916
+
917
+ if (_link.LinkPath.IsEmpty())
918
+ return S_OK;
919
+ // (_link.LinkPath) uses system path separator.
920
+ // windows: (_link.LinkPath) doesn't contain linux separator (slash).
921
+ {
922
+ // _link.LinkPath = "\\??\\r:\\1\\2"; // for debug
923
+ // rar5+ returns kpidSymLink absolute link path with "\??\" prefix.
924
+ // we normalize such prefix:
925
+ if (_link.LinkPath.IsPrefixedBy(STRING_PATH_SEPARATOR "??" STRING_PATH_SEPARATOR))
926
+ {
927
+ _link.isRelative = false;
928
+ // we normalize prefix from "\??\" to "\\?\":
929
+ _link.LinkPath.ReplaceOneCharAtPos(1, WCHAR_PATH_SEPARATOR);
930
+ _link.isWindowsPath = true;
931
+ if (_link.LinkPath.IsPrefixedBy_Ascii_NoCase(
932
+ STRING_PATH_SEPARATOR
933
+ STRING_PATH_SEPARATOR "?"
934
+ STRING_PATH_SEPARATOR "UNC"
935
+ STRING_PATH_SEPARATOR))
936
+ {
937
+ // we normalize prefix from "\\?\UNC\path" to "\\path":
938
+ _link.LinkPath.DeleteFrontal(6);
939
+ _link.LinkPath.ReplaceOneCharAtPos(0, WCHAR_PATH_SEPARATOR);
940
+ }
941
+ else
942
+ {
943
+ const unsigned k_prefix_Size = 4;
944
+ if (NName::IsDrivePath(_link.LinkPath.Ptr(k_prefix_Size)))
945
+ _link.LinkPath.DeleteFrontal(k_prefix_Size);
946
+ }
947
+ }
948
+ }
949
+ _link.Normalize_to_RelativeSafe(_removePathParts);
950
+ return S_OK;
951
+ }
952
+
953
+ #endif // SUPPORT_LINKS
954
+
955
+
956
+ #ifdef _WIN32
957
+
958
+ #define SET_OWNER
959
+ #define SET_NEED_SET_OWNER
960
+
961
+ #else
962
+
963
+ #define SET_OWNER { SetOwner(); }
964
+ #define SET_NEED_SET_OWNER { _needSetOwner = true; }
965
+
966
+ void CArchiveExtractCallback::SetOwner()
967
+ {
968
+ if (!_needSetOwner)
969
+ return;
970
+ _needSetOwner = false;
971
+ // we want to call chown() only for file itself.
972
+ // we don't want to follow link.
973
+ // if (_isSymLinkCreated) return;
974
+ const FString &path = _diskFilePath;
975
+ if (_itemFailure
976
+ || path.IsEmpty()
977
+ || _stdOutMode
978
+ || !_extractMode)
979
+ return;
980
+ if (_fi.Owner.Id_Defined &&
981
+ _fi.Group.Id_Defined)
982
+ {
983
+ // printf("\n SetOwner() %s\n", path.Ptr());
984
+ if (my_chown(path, _fi.Owner.Id, _fi.Group.Id) != 0)
985
+ SendMessageError_with_LastError("Cannot set owner", path);
986
+ }
987
+ }
988
+
989
+ static HRESULT GetOwner(IInArchive *archive,
990
+ UInt32 index, UInt32 pidName, UInt32 pidId, CProcessedFileInfo::COwnerInfo &res)
991
+ {
992
+ {
993
+ NWindows::NCOM::CPropVariant prop;
994
+ RINOK(archive->GetProperty(index, pidId, &prop))
995
+ if (prop.vt == VT_UI4)
996
+ {
997
+ res.Id_Defined = true;
998
+ res.Id = prop.ulVal;
999
+ // res.Id++; // for debug
1000
+ // if (pidId == kpidGroupId) res.Id += 7; // for debug
1001
+ // res.Id = 0; // for debug
1002
+ }
1003
+ else if (prop.vt != VT_EMPTY)
1004
+ return E_INVALIDARG;
1005
+ }
1006
+ {
1007
+ NWindows::NCOM::CPropVariant prop;
1008
+ RINOK(archive->GetProperty(index, pidName, &prop))
1009
+ if (prop.vt == VT_BSTR)
1010
+ {
1011
+ const UString s = prop.bstrVal;
1012
+ ConvertUnicodeToUTF8(s, res.Name);
1013
+ }
1014
+ else if (prop.vt == VT_UI4)
1015
+ {
1016
+ res.Id_Defined = true;
1017
+ res.Id = prop.ulVal;
1018
+ }
1019
+ else if (prop.vt != VT_EMPTY)
1020
+ return E_INVALIDARG;
1021
+ }
1022
+ return S_OK;
1023
+ }
1024
+
1025
+ #endif
1026
+
1027
+
1028
+ HRESULT CArchiveExtractCallback::Read_fi_Props()
1029
+ {
1030
+ IInArchive * const archive = _arc->Archive;
1031
+ const UInt32 index = _index;
1032
+
1033
+ _fi.Attrib_Defined = false;
1034
+
1035
+ #ifndef _WIN32
1036
+ _fi.Owner.Clear();
1037
+ _fi.Group.Clear();
1038
+ #endif
1039
+
1040
+ {
1041
+ NCOM::CPropVariant prop;
1042
+ RINOK(archive->GetProperty(index, kpidPosixAttrib, &prop))
1043
+ if (prop.vt == VT_UI4)
1044
+ {
1045
+ _fi.SetFromPosixAttrib(prop.ulVal);
1046
+ }
1047
+ else if (prop.vt != VT_EMPTY)
1048
+ return E_FAIL;
1049
+ }
1050
+
1051
+ {
1052
+ NCOM::CPropVariant prop;
1053
+ RINOK(archive->GetProperty(index, kpidAttrib, &prop))
1054
+ if (prop.vt == VT_UI4)
1055
+ {
1056
+ _fi.Attrib = prop.ulVal;
1057
+ _fi.Attrib_Defined = true;
1058
+ }
1059
+ else if (prop.vt != VT_EMPTY)
1060
+ return E_FAIL;
1061
+ }
1062
+
1063
+ RINOK(GetTime(index, kpidCTime, _fi.CTime))
1064
+ RINOK(GetTime(index, kpidATime, _fi.ATime))
1065
+ RINOK(GetTime(index, kpidMTime, _fi.MTime))
1066
+
1067
+ #ifndef _WIN32
1068
+ if (_ntOptions.ExtractOwner)
1069
+ {
1070
+ // SendMessageError("_ntOptions.ExtractOwner", _diskFilePath);
1071
+ GetOwner(archive, index, kpidUser, kpidUserId, _fi.Owner);
1072
+ GetOwner(archive, index, kpidGroup, kpidGroupId, _fi.Group);
1073
+ }
1074
+ #endif
1075
+
1076
+ return S_OK;
1077
+ }
1078
+
1079
+
1080
+
1081
+ void CArchiveExtractCallback::CorrectPathParts()
1082
+ {
1083
+ UStringVector &pathParts = _item.PathParts;
1084
+
1085
+ #ifdef SUPPORT_ALT_STREAMS
1086
+ if (!_item.IsAltStream
1087
+ || !pathParts.IsEmpty()
1088
+ || !(_removePartsForAltStreams || _pathMode == NExtract::NPathMode::kNoPathsAlt))
1089
+ #endif
1090
+ Correct_FsPath(_pathMode == NExtract::NPathMode::kAbsPaths, _keepAndReplaceEmptyDirPrefixes, pathParts, _item.MainIsDir);
1091
+
1092
+ #ifdef SUPPORT_ALT_STREAMS
1093
+
1094
+ if (_item.IsAltStream)
1095
+ {
1096
+ UString s (_item.AltStreamName);
1097
+ Correct_AltStream_Name(s);
1098
+ bool needColon = true;
1099
+
1100
+ if (pathParts.IsEmpty())
1101
+ {
1102
+ pathParts.AddNew();
1103
+ if (_removePartsForAltStreams || _pathMode == NExtract::NPathMode::kNoPathsAlt)
1104
+ {
1105
+ const UString s2 = Get_Correct_FsFile_Name(s);
1106
+ s = s2;
1107
+ needColon = false;
1108
+ }
1109
+ }
1110
+ #ifdef _WIN32
1111
+ else if (_pathMode == NExtract::NPathMode::kAbsPaths &&
1112
+ NWildcard::GetNumPrefixParts_if_DrivePath(pathParts) == pathParts.Size())
1113
+ pathParts.AddNew();
1114
+ #endif
1115
+
1116
+ UString &name = pathParts.Back();
1117
+ if (needColon)
1118
+ name.Add_Char((char)(_ntOptions.ReplaceColonForAltStream ? '_' : ':'));
1119
+ name += s;
1120
+ }
1121
+
1122
+ #endif // SUPPORT_ALT_STREAMS
1123
+ }
1124
+
1125
+
1126
+ static void GetFiTimesCAM(const CProcessedFileInfo &fi, CFiTimesCAM &pt, const CArc &arc)
1127
+ {
1128
+ pt.CTime_Defined = false;
1129
+ pt.ATime_Defined = false;
1130
+ pt.MTime_Defined = false;
1131
+
1132
+ // if (Write_MTime)
1133
+ {
1134
+ if (fi.MTime.Def)
1135
+ {
1136
+ fi.MTime.Write_To_FiTime(pt.MTime);
1137
+ pt.MTime_Defined = true;
1138
+ }
1139
+ else if (arc.MTime.Def)
1140
+ {
1141
+ arc.MTime.Write_To_FiTime(pt.MTime);
1142
+ pt.MTime_Defined = true;
1143
+ }
1144
+ }
1145
+
1146
+ if (/* Write_CTime && */ fi.CTime.Def)
1147
+ {
1148
+ fi.CTime.Write_To_FiTime(pt.CTime);
1149
+ pt.CTime_Defined = true;
1150
+ }
1151
+
1152
+ if (/* Write_ATime && */ fi.ATime.Def)
1153
+ {
1154
+ fi.ATime.Write_To_FiTime(pt.ATime);
1155
+ pt.ATime_Defined = true;
1156
+ }
1157
+ }
1158
+
1159
+
1160
+ void CArchiveExtractCallback::CreateFolders()
1161
+ {
1162
+ // 21.04 : we don't change original (_item.PathParts) here
1163
+ UStringVector pathParts = _item.PathParts;
1164
+
1165
+ bool isFinal = true;
1166
+ // bool is_DirOp = false;
1167
+ if (!pathParts.IsEmpty())
1168
+ {
1169
+ /* v23: if we extract symlink, and we know that it links to dir:
1170
+ Linux: we don't create dir item (symlink_from_path) here.
1171
+ Windows: SetReparseData() will create dir item, if it doesn't exist,
1172
+ but if we create dir item here, it's not problem. */
1173
+ if (!_item.IsDir
1174
+ #ifdef SUPPORT_LINKS
1175
+ // #ifndef WIN32
1176
+ || !_link.LinkPath.IsEmpty()
1177
+ // #endif
1178
+ #endif
1179
+ )
1180
+ {
1181
+ pathParts.DeleteBack();
1182
+ isFinal = false; // last path part was excluded
1183
+ }
1184
+ // else is_DirOp = true;
1185
+ }
1186
+
1187
+ if (pathParts.IsEmpty())
1188
+ {
1189
+ /* if (_some_pathParts_wereRemoved && Is_elimPrefix_Mode),
1190
+ then we can have empty pathParts() here for root folder.
1191
+ v24.00: fixed: we set timestamps for such folder still.
1192
+ */
1193
+ if (!_some_pathParts_wereRemoved ||
1194
+ !Is_elimPrefix_Mode)
1195
+ return;
1196
+ // return; // ignore empty paths case
1197
+ }
1198
+ /*
1199
+ if (is_DirOp)
1200
+ {
1201
+ RINOK(PrepareOperation(NArchive::NExtract::NAskMode::kExtract))
1202
+ _op_WasReported = true;
1203
+ }
1204
+ */
1205
+
1206
+ FString fullPathNew;
1207
+ CreateComplexDirectory(pathParts, isFinal, fullPathNew);
1208
+
1209
+ /*
1210
+ if (is_DirOp)
1211
+ {
1212
+ RINOK(SetOperationResult(
1213
+ // _itemFailure ? NArchive::NExtract::NOperationResult::kDataError :
1214
+ NArchive::NExtract::NOperationResult::kOK
1215
+ ))
1216
+ }
1217
+ */
1218
+
1219
+ if (!_item.IsDir)
1220
+ return;
1221
+ if (fullPathNew.IsEmpty())
1222
+ return;
1223
+
1224
+ if (_itemFailure)
1225
+ return;
1226
+
1227
+ CDirPathTime pt;
1228
+ GetFiTimesCAM(_fi, pt, *_arc);
1229
+
1230
+ if (pt.IsSomeTimeDefined())
1231
+ {
1232
+ pt.Path = fullPathNew;
1233
+ pt.SetDirTime_to_FS_2();
1234
+ _extractedFolders.Add(pt);
1235
+ }
1236
+ }
1237
+
1238
+
1239
+
1240
+ /*
1241
+ CheckExistFile(fullProcessedPath)
1242
+ it can change: fullProcessedPath, _isRenamed, _overwriteMode
1243
+ (needExit = true) means that we must exit GetStream() even for S_OK result.
1244
+ */
1245
+
1246
+ HRESULT CArchiveExtractCallback::CheckExistFile(FString &fullProcessedPath, bool &needExit)
1247
+ {
1248
+ needExit = true; // it was set already before
1249
+
1250
+ NFind::CFileInfo fileInfo;
1251
+
1252
+ if (fileInfo.Find(fullProcessedPath))
1253
+ {
1254
+ if (_overwriteMode == NExtract::NOverwriteMode::kSkip)
1255
+ return S_OK;
1256
+
1257
+ if (_overwriteMode == NExtract::NOverwriteMode::kAsk)
1258
+ {
1259
+ const int slashPos = fullProcessedPath.ReverseFind_PathSepar();
1260
+ const FString realFullProcessedPath = fullProcessedPath.Left((unsigned)(slashPos + 1)) + fileInfo.Name;
1261
+
1262
+ /* (fileInfo) can be symbolic link.
1263
+ we can show final file properties here. */
1264
+
1265
+ FILETIME ft1;
1266
+ FiTime_To_FILETIME(fileInfo.MTime, ft1);
1267
+
1268
+ Int32 overwriteResult;
1269
+ RINOK(_extractCallback2->AskOverwrite(
1270
+ fs2us(realFullProcessedPath), &ft1, &fileInfo.Size, _item.Path,
1271
+ _fi.MTime.Def ? &_fi.MTime.FT : NULL,
1272
+ _curSize_Defined ? &_curSize : NULL,
1273
+ &overwriteResult))
1274
+
1275
+ switch (overwriteResult)
1276
+ {
1277
+ case NOverwriteAnswer::kCancel:
1278
+ return E_ABORT;
1279
+ case NOverwriteAnswer::kNo:
1280
+ return S_OK;
1281
+ case NOverwriteAnswer::kNoToAll:
1282
+ _overwriteMode = NExtract::NOverwriteMode::kSkip;
1283
+ return S_OK;
1284
+
1285
+ case NOverwriteAnswer::kYes:
1286
+ break;
1287
+ case NOverwriteAnswer::kYesToAll:
1288
+ _overwriteMode = NExtract::NOverwriteMode::kOverwrite;
1289
+ break;
1290
+ case NOverwriteAnswer::kAutoRename:
1291
+ _overwriteMode = NExtract::NOverwriteMode::kRename;
1292
+ break;
1293
+ default:
1294
+ return E_FAIL;
1295
+ }
1296
+ } // NExtract::NOverwriteMode::kAsk
1297
+
1298
+ if (_overwriteMode == NExtract::NOverwriteMode::kRename)
1299
+ {
1300
+ if (!AutoRenamePath(fullProcessedPath))
1301
+ {
1302
+ RINOK(SendMessageError(kCantAutoRename, fullProcessedPath))
1303
+ return E_FAIL;
1304
+ }
1305
+ _isRenamed = true;
1306
+ }
1307
+ else if (_overwriteMode == NExtract::NOverwriteMode::kRenameExisting)
1308
+ {
1309
+ FString existPath (fullProcessedPath);
1310
+ if (!AutoRenamePath(existPath))
1311
+ {
1312
+ RINOK(SendMessageError(kCantAutoRename, fullProcessedPath))
1313
+ return E_FAIL;
1314
+ }
1315
+ // MyMoveFile can rename folders. So it's OK to use it for folders too
1316
+ if (!MyMoveFile(fullProcessedPath, existPath))
1317
+ {
1318
+ RINOK(SendMessageError2_with_LastError(kCantRenameFile, existPath, fullProcessedPath))
1319
+ return E_FAIL;
1320
+ }
1321
+ }
1322
+ else // not Rename*
1323
+ {
1324
+ if (fileInfo.IsDir())
1325
+ {
1326
+ // do we need to delete all files in folder?
1327
+ if (!RemoveDir(fullProcessedPath))
1328
+ {
1329
+ RINOK(SendMessageError_with_LastError(kCantDeleteOutputDir, fullProcessedPath))
1330
+ return S_OK;
1331
+ }
1332
+ }
1333
+ else // fileInfo is not Dir
1334
+ {
1335
+ if (NFind::DoesFileExist_Raw(fullProcessedPath))
1336
+ if (!DeleteFileAlways(fullProcessedPath))
1337
+ if (GetLastError() != ERROR_FILE_NOT_FOUND) // check it in linux
1338
+ {
1339
+ RINOK(SendMessageError_with_LastError(kCantDeleteOutputFile, fullProcessedPath))
1340
+ return S_OK;
1341
+ // return E_FAIL;
1342
+ }
1343
+ } // fileInfo is not Dir
1344
+ } // not Rename*
1345
+ }
1346
+ else // not Find(fullProcessedPath)
1347
+ {
1348
+ #if defined(_WIN32) && !defined(UNDER_CE)
1349
+ // we need to clear READ-ONLY of parent before creating alt stream
1350
+ const int colonPos = NName::FindAltStreamColon(fullProcessedPath);
1351
+ if (colonPos >= 0 && fullProcessedPath[(unsigned)colonPos + 1] != 0)
1352
+ {
1353
+ FString parentFsPath (fullProcessedPath);
1354
+ parentFsPath.DeleteFrom((unsigned)colonPos);
1355
+ NFind::CFileInfo parentFi;
1356
+ if (parentFi.Find(parentFsPath))
1357
+ {
1358
+ if (parentFi.IsReadOnly())
1359
+ {
1360
+ _altStream_NeedRestore_Attrib_for_parentFsPath = parentFsPath;
1361
+ _altStream_NeedRestore_AttribVal = parentFi.Attrib;
1362
+ SetFileAttrib(parentFsPath, parentFi.Attrib & ~(DWORD)FILE_ATTRIBUTE_READONLY);
1363
+ }
1364
+ }
1365
+ }
1366
+ #endif // defined(_WIN32) && !defined(UNDER_CE)
1367
+ }
1368
+
1369
+ needExit = false;
1370
+ return S_OK;
1371
+ }
1372
+
1373
+
1374
+
1375
+ /*
1376
+ return:
1377
+ needExit = false: caller will use (outStreamLoc) and _hashStreamSpec
1378
+ needExit = true : caller will not use (outStreamLoc) and _hashStreamSpec.
1379
+ */
1380
+ HRESULT CArchiveExtractCallback::GetExtractStream(CMyComPtr<ISequentialOutStream> &outStreamLoc, bool &needExit)
1381
+ {
1382
+ needExit = true;
1383
+
1384
+ RINOK(Read_fi_Props())
1385
+
1386
+ #ifdef SUPPORT_LINKS
1387
+ IInArchive * const archive = _arc->Archive;
1388
+ #endif
1389
+
1390
+ const UInt32 index = _index;
1391
+
1392
+ bool isAnti = false;
1393
+ RINOK(_arc->IsItem_Anti(index, isAnti))
1394
+
1395
+ CorrectPathParts();
1396
+ UString processedPath (MakePathFromParts(_item.PathParts));
1397
+
1398
+ if (!isAnti)
1399
+ {
1400
+ // 21.04: CreateFolders doesn't change (_item.PathParts)
1401
+ CreateFolders();
1402
+ }
1403
+
1404
+ FString fullProcessedPath (us2fs(processedPath));
1405
+ if (_pathMode != NExtract::NPathMode::kAbsPaths
1406
+ || !NName::IsAbsolutePath(processedPath))
1407
+ {
1408
+ fullProcessedPath = MakePath_from_2_Parts(_dirPathPrefix, fullProcessedPath);
1409
+ }
1410
+
1411
+ #ifdef SUPPORT_ALT_STREAMS
1412
+ if (_item.IsAltStream && _item.ParentIndex != (UInt32)(Int32)-1)
1413
+ {
1414
+ const int renIndex = _renamedFiles.FindInSorted(CIndexToPathPair(_item.ParentIndex));
1415
+ if (renIndex != -1)
1416
+ {
1417
+ const CIndexToPathPair &pair = _renamedFiles[(unsigned)renIndex];
1418
+ fullProcessedPath = pair.Path;
1419
+ fullProcessedPath.Add_Colon();
1420
+ UString s (_item.AltStreamName);
1421
+ Correct_AltStream_Name(s);
1422
+ fullProcessedPath += us2fs(s);
1423
+ }
1424
+ }
1425
+ #endif // SUPPORT_ALT_STREAMS
1426
+
1427
+ if (_item.IsDir)
1428
+ {
1429
+ _diskFilePath = fullProcessedPath;
1430
+ if (isAnti)
1431
+ RemoveDir(_diskFilePath);
1432
+ #ifdef SUPPORT_LINKS
1433
+ if (_link.LinkPath.IsEmpty())
1434
+ #endif
1435
+ {
1436
+ /* here we can set directory attributes for usual any items and for
1437
+ root directory excluded from processing by "Eliminate duplication of root folder" feature. */
1438
+ if (!isAnti)
1439
+ {
1440
+ if (!_dirAttrib_wasSet)
1441
+ SetAttrib(_diskFilePath);
1442
+ SET_NEED_SET_OWNER
1443
+ SET_OWNER
1444
+ }
1445
+ needExit = false; // v26.04 : we want (_hashStreamWasUsed = true) for dir items.
1446
+ return S_OK;
1447
+ }
1448
+ }
1449
+ else if (!_isSplit)
1450
+ {
1451
+ RINOK(CheckExistFile(fullProcessedPath, needExit))
1452
+ if (needExit)
1453
+ return S_OK;
1454
+ needExit = true;
1455
+ }
1456
+
1457
+ _diskFilePath = fullProcessedPath;
1458
+
1459
+
1460
+ if (isAnti)
1461
+ {
1462
+ needExit = false;
1463
+ return S_OK;
1464
+ }
1465
+
1466
+ // not anti
1467
+
1468
+ #ifdef SUPPORT_LINKS
1469
+
1470
+ if (!_link.LinkPath.IsEmpty())
1471
+ {
1472
+ #ifndef UNDER_CE
1473
+ {
1474
+ bool linkWasSet = false;
1475
+ RINOK(SetLink(fullProcessedPath, _link, linkWasSet))
1476
+ /*
1477
+ // we don't set attributes for placeholder.
1478
+ if (linkWasSet)
1479
+ {
1480
+ _isSymLinkCreated = _link.Is_AnySymLink();
1481
+ SetAttrib();
1482
+ // printf("\nlinkWasSet %s\n", GetAnsiString(_diskFilePath));
1483
+ }
1484
+ */
1485
+ }
1486
+ #endif // UNDER_CE
1487
+
1488
+ // if (_copyFile_Path.IsEmpty())
1489
+ {
1490
+ needExit = false;
1491
+ return S_OK;
1492
+ }
1493
+ }
1494
+
1495
+ if (!_hardLinks.IDs.IsEmpty() && !_item.IsAltStream && !_item.IsDir)
1496
+ {
1497
+ CHardLinkNode h;
1498
+ bool defined;
1499
+ RINOK(Archive_Get_HardLinkNode(archive, index, h, defined))
1500
+ if (defined)
1501
+ {
1502
+ const int linkIndex = _hardLinks.IDs.FindInSorted2(h);
1503
+ if (linkIndex != -1)
1504
+ {
1505
+ FString &hl = _hardLinks.Links[(unsigned)linkIndex];
1506
+ if (hl.IsEmpty())
1507
+ hl = fullProcessedPath;
1508
+ else
1509
+ {
1510
+ bool link_was_Created = false;
1511
+ RINOK(CreateHardLink2(fullProcessedPath, hl, link_was_Created))
1512
+ if (!link_was_Created)
1513
+ return S_OK;
1514
+ // printf("\nHard linkWasSet Archive_Get_HardLinkNode %s\n", GetAnsiString(_diskFilePath));
1515
+ // _needSetAttrib = true; // do we need to set attribute ?
1516
+ SetAttrib(_diskFilePath);
1517
+ SET_NEED_SET_OWNER
1518
+ SET_OWNER
1519
+ /* if we set (needExit = false) here, _hashStreamSpec will be used,
1520
+ and hash will be calulated for all hard links files (it's slower).
1521
+ But "Test" operation also calculates hashes.
1522
+ */
1523
+ needExit = false;
1524
+ return S_OK;
1525
+ }
1526
+ }
1527
+ }
1528
+ }
1529
+
1530
+ #endif // SUPPORT_LINKS
1531
+
1532
+
1533
+ // ---------- CREATE WRITE FILE -----
1534
+
1535
+ _outFileStreamSpec = new COutFileStream;
1536
+ CMyComPtr<IOutStream> outFileStream_Loc(_outFileStreamSpec);
1537
+
1538
+ bool needSetAttrib = true;
1539
+ #ifndef _WIN32
1540
+ if (_fi.Attrib_Defined)
1541
+ {
1542
+ /*
1543
+ system open() function uses system umask.
1544
+ our (g_umask.mask) is more restricted mask.
1545
+ So we use (mode) parameter in open(,, mode), because our mask for (mode)
1546
+ is more restricted than system umask.
1547
+ If we want to set unrestricted (mode) bits for file, then we must
1548
+ call additional fchmod() function later.
1549
+ */
1550
+ mode_t mode = NWindows::NFile::NIO::k_OutFile_mode_default; // 0666
1551
+ const UInt32 attrib = _fi.Attrib;
1552
+ if (attrib & FILE_ATTRIBUTE_UNIX_EXTENSION)
1553
+ {
1554
+ mode = (attrib >> 16);
1555
+ // mode &= 07777; // for debug
1556
+ if (!S_ISREG(mode))
1557
+ {
1558
+ // printf("\n !S_ISREG(mode) = %o\n", (unsigned)mode);
1559
+ needSetAttrib = false;
1560
+ }
1561
+ }
1562
+ else if (attrib & FILE_ATTRIBUTE_READONLY)
1563
+ mode &= (mode_t)~(mode_t)(S_IWUSR | S_IWGRP | S_IWOTH); // octal: ~0222; // disable write permissions
1564
+ if (needSetAttrib)
1565
+ {
1566
+ // printf("\n File.mode_for_Create = %o\n", (unsigned)mode);
1567
+ mode &= g_umask.mask;
1568
+ // mode = 0777; // for debug
1569
+ // mode |= S_ISUID | S_ISGID | S_ISVTX; // for debug
1570
+ _outFileStreamSpec->File.mode_for_Create = mode;
1571
+ }
1572
+ needSetAttrib = false;
1573
+ }
1574
+ #endif
1575
+
1576
+ // printf("\n GetExtractStream Create_ALWAYS_or_Open_ALWAYS : %s\n", fullProcessedPath.Ptr());
1577
+ if (!_outFileStreamSpec->Create_ALWAYS_or_Open_ALWAYS(fullProcessedPath, !_isSplit))
1578
+ {
1579
+ // if (::GetLastError() != ERROR_FILE_EXISTS || !isSplit)
1580
+ {
1581
+ RINOK(SendMessageError_with_LastError(kCantOpenOutFile, fullProcessedPath))
1582
+ return S_OK;
1583
+ }
1584
+ }
1585
+
1586
+ SET_NEED_SET_OWNER
1587
+ _needSetAttrib = needSetAttrib;
1588
+
1589
+ bool is_SymLink_in_Data = false;
1590
+
1591
+ if (_curSize_Defined && _curSize && _curSize < k_LinkDataSize_LIMIT)
1592
+ {
1593
+ if (_fi.IsLinuxSymLink())
1594
+ {
1595
+ is_SymLink_in_Data = true;
1596
+ _is_SymLink_in_Data_Linux = true;
1597
+ }
1598
+ else if (_fi.IsReparse())
1599
+ {
1600
+ is_SymLink_in_Data = true;
1601
+ _is_SymLink_in_Data_Linux = false;
1602
+ }
1603
+ }
1604
+
1605
+ if (is_SymLink_in_Data)
1606
+ {
1607
+ _outMemBuf.Alloc((size_t)_curSize);
1608
+ _bufPtrSeqOutStream_Spec = new CBufPtrSeqOutStream;
1609
+ _bufPtrSeqOutStream = _bufPtrSeqOutStream_Spec;
1610
+ _bufPtrSeqOutStream_Spec->Init(_outMemBuf, _outMemBuf.Size());
1611
+ outStreamLoc = _bufPtrSeqOutStream;
1612
+ }
1613
+ else // not reparse
1614
+ {
1615
+ if (_ntOptions.PreAllocateOutFile && !_isSplit && _curSize_Defined && _curSize > (1 << 12))
1616
+ {
1617
+ // UInt64 ticks = GetCpuTicks();
1618
+ _fileLength_that_WasSet = _curSize;
1619
+ bool res = _outFileStreamSpec->File.SetLength(_curSize);
1620
+ _fileLength_WasSet = res;
1621
+
1622
+ // ticks = GetCpuTicks() - ticks;
1623
+ // printf("\nticks = %10d\n", (unsigned)ticks);
1624
+ if (!res)
1625
+ {
1626
+ RINOK(SendMessageError_with_LastError(kCantSetFileLen, fullProcessedPath))
1627
+ }
1628
+
1629
+ /*
1630
+ _outFileStreamSpec->File.Close();
1631
+ ticks = GetCpuTicks() - ticks;
1632
+ printf("\nticks = %10d\n", (unsigned)ticks);
1633
+ return S_FALSE;
1634
+ */
1635
+
1636
+ /*
1637
+ File.SetLength() on FAT (xp64): is fast, but then File.Close() can be slow,
1638
+ if we don't write any data.
1639
+ File.SetLength() for remote share file (exFAT) can be slow in some cases,
1640
+ and the Windows can return "network error" after 1 minute,
1641
+ while remote file still can grow.
1642
+ We need some way to detect such bad cases and disable PreAllocateOutFile mode.
1643
+ */
1644
+
1645
+ res = _outFileStreamSpec->SeekToBegin_bool();
1646
+ if (!res)
1647
+ {
1648
+ RINOK(SendMessageError_with_LastError("Cannot seek to begin of file", fullProcessedPath))
1649
+ }
1650
+ } // PreAllocateOutFile
1651
+
1652
+ #ifdef SUPPORT_ALT_STREAMS
1653
+ if (_isRenamed && !_item.IsAltStream)
1654
+ {
1655
+ CIndexToPathPair pair(index, fullProcessedPath);
1656
+ unsigned oldSize = _renamedFiles.Size();
1657
+ unsigned insertIndex = _renamedFiles.AddToUniqueSorted(pair);
1658
+ if (oldSize == _renamedFiles.Size())
1659
+ _renamedFiles[insertIndex].Path = fullProcessedPath;
1660
+ }
1661
+ #endif // SUPPORT_ALT_STREAMS
1662
+
1663
+ if (_isSplit)
1664
+ {
1665
+ RINOK(outFileStream_Loc->Seek((Int64)_position, STREAM_SEEK_SET, NULL))
1666
+ }
1667
+ outStreamLoc = outFileStream_Loc;
1668
+ } // if not reparse
1669
+
1670
+ _outFileStream = outFileStream_Loc;
1671
+
1672
+ needExit = false;
1673
+ return S_OK;
1674
+ }
1675
+
1676
+
1677
+
1678
+ HRESULT CArchiveExtractCallback::GetItem(UInt32 index)
1679
+ {
1680
+ #ifndef Z7_SFX
1681
+ _item._use_baseParentFolder_mode = _use_baseParentFolder_mode;
1682
+ if (_use_baseParentFolder_mode)
1683
+ {
1684
+ _item._baseParentFolder = (int)_baseParentFolder;
1685
+ if (_pathMode == NExtract::NPathMode::kFullPaths ||
1686
+ _pathMode == NExtract::NPathMode::kAbsPaths)
1687
+ _item._baseParentFolder = -1;
1688
+ }
1689
+ #endif // Z7_SFX
1690
+
1691
+ #ifdef SUPPORT_ALT_STREAMS
1692
+ _item.WriteToAltStreamIfColon = _ntOptions.WriteToAltStreamIfColon;
1693
+ #endif
1694
+
1695
+ return _arc->GetItem(index, _item);
1696
+ }
1697
+
1698
+
1699
+ Z7_COM7F_IMF(CArchiveExtractCallback::GetStream(const UInt32 index, ISequentialOutStream **outStream, const Int32 askExtractMode))
1700
+ {
1701
+ COM_TRY_BEGIN
1702
+
1703
+ *outStream = NULL;
1704
+
1705
+ #ifndef Z7_SFX
1706
+ if (_hashStream)
1707
+ _hashStreamSpec->ReleaseStream();
1708
+ _hashStreamWasUsed = false;
1709
+ #endif
1710
+
1711
+ _outFileStream.Release();
1712
+ _bufPtrSeqOutStream.Release();
1713
+
1714
+ _encrypted = false;
1715
+ _isSplit = false;
1716
+ _curSize_Defined = false;
1717
+ _fileLength_WasSet = false;
1718
+ _isRenamed = false;
1719
+ // _fi.Clear();
1720
+ _extractMode = false;
1721
+ _is_SymLink_in_Data_Linux = false;
1722
+ _needSetAttrib = false;
1723
+ _dirAttrib_wasSet = false;
1724
+ #ifndef _WIN32
1725
+ _needSetOwner = false;
1726
+ #endif
1727
+ // _isSymLinkCreated = false;
1728
+ _itemFailure = false;
1729
+ _some_pathParts_wereRemoved = false;
1730
+ // _op_WasReported = false;
1731
+
1732
+ _position = 0;
1733
+ _curSize = 0;
1734
+ _fileLength_that_WasSet = 0;
1735
+ _index = index;
1736
+
1737
+ #if defined(_WIN32) && !defined(UNDER_CE)
1738
+ _altStream_NeedRestore_AttribVal = 0;
1739
+ _altStream_NeedRestore_Attrib_for_parentFsPath.Empty();
1740
+ #endif
1741
+
1742
+ _diskFilePath.Empty();
1743
+
1744
+ #ifdef SUPPORT_LINKS
1745
+ // _copyFile_Path.Empty();
1746
+ _link.Clear();
1747
+ #endif
1748
+
1749
+
1750
+ switch (askExtractMode)
1751
+ {
1752
+ case NArchive::NExtract::NAskMode::kExtract:
1753
+ if (_testMode)
1754
+ {
1755
+ // askExtractMode = NArchive::NExtract::NAskMode::kTest;
1756
+ }
1757
+ else
1758
+ _extractMode = true;
1759
+ break;
1760
+ default: break;
1761
+ }
1762
+
1763
+
1764
+ IInArchive * const archive = _arc->Archive;
1765
+
1766
+ RINOK(GetItem(index))
1767
+
1768
+ {
1769
+ NCOM::CPropVariant prop;
1770
+ RINOK(archive->GetProperty(index, kpidPosition, &prop))
1771
+ if (prop.vt != VT_EMPTY)
1772
+ {
1773
+ if (prop.vt != VT_UI8)
1774
+ return E_FAIL;
1775
+ _position = prop.uhVal.QuadPart;
1776
+ _isSplit = true;
1777
+ }
1778
+ }
1779
+
1780
+ #ifdef SUPPORT_LINKS
1781
+ RINOK(ReadLink())
1782
+ #endif
1783
+
1784
+ RINOK(Archive_GetItemBoolProp(archive, index, kpidEncrypted, _encrypted))
1785
+
1786
+ RINOK(GetUnpackSize())
1787
+
1788
+ #ifdef SUPPORT_ALT_STREAMS
1789
+ if (!_ntOptions.AltStreams.Val && _item.IsAltStream)
1790
+ return S_OK;
1791
+ #endif // SUPPORT_ALT_STREAMS
1792
+
1793
+ // we can change (_item.PathParts) in this function
1794
+ UStringVector &pathParts = _item.PathParts;
1795
+
1796
+ if (_wildcardCensor)
1797
+ {
1798
+ if (!CensorNode_CheckPath(*_wildcardCensor, _item))
1799
+ return S_OK;
1800
+ }
1801
+
1802
+ #if defined(_WIN32) && !defined(UNDER_CE) && !defined(Z7_SFX)
1803
+ if (askExtractMode == NArchive::NExtract::NAskMode::kExtract
1804
+ && !_testMode
1805
+ && _item.IsAltStream
1806
+ && ZoneBuf.Size() != 0
1807
+ && Is_ZoneId_StreamName(_item.AltStreamName))
1808
+ if (ZoneMode != NExtract::NZoneIdMode::kOffice
1809
+ || _item.PathParts.IsEmpty()
1810
+ || FindExt2(kOfficeExtensions, _item.PathParts.Back()))
1811
+ return S_OK;
1812
+ #endif
1813
+
1814
+
1815
+ #ifndef Z7_SFX
1816
+ if (_use_baseParentFolder_mode)
1817
+ {
1818
+ if (!pathParts.IsEmpty())
1819
+ {
1820
+ unsigned numRemovePathParts = 0;
1821
+
1822
+ #ifdef SUPPORT_ALT_STREAMS
1823
+ if (_pathMode == NExtract::NPathMode::kNoPathsAlt && _item.IsAltStream)
1824
+ numRemovePathParts = pathParts.Size();
1825
+ else
1826
+ #endif
1827
+ if (_pathMode == NExtract::NPathMode::kNoPaths ||
1828
+ _pathMode == NExtract::NPathMode::kNoPathsAlt)
1829
+ numRemovePathParts = pathParts.Size() - 1;
1830
+ pathParts.DeleteFrontal(numRemovePathParts);
1831
+ }
1832
+ }
1833
+ else
1834
+ #endif // Z7_SFX
1835
+ {
1836
+ if (pathParts.IsEmpty())
1837
+ {
1838
+ if (_item.IsDir)
1839
+ return S_OK;
1840
+ /*
1841
+ #ifdef SUPPORT_ALT_STREAMS
1842
+ if (!_item.IsAltStream)
1843
+ #endif
1844
+ return E_FAIL;
1845
+ */
1846
+ }
1847
+
1848
+ unsigned numRemovePathParts = 0;
1849
+
1850
+ switch ((int)_pathMode)
1851
+ {
1852
+ case NExtract::NPathMode::kFullPaths:
1853
+ case NExtract::NPathMode::kCurPaths:
1854
+ {
1855
+ if (_removePathParts.IsEmpty())
1856
+ break;
1857
+ bool badPrefix = false;
1858
+
1859
+ if (pathParts.Size() < _removePathParts.Size())
1860
+ badPrefix = true;
1861
+ else
1862
+ {
1863
+ if (pathParts.Size() == _removePathParts.Size())
1864
+ {
1865
+ if (_removePartsForAltStreams)
1866
+ {
1867
+ #ifdef SUPPORT_ALT_STREAMS
1868
+ if (!_item.IsAltStream)
1869
+ #endif
1870
+ badPrefix = true;
1871
+ }
1872
+ else
1873
+ {
1874
+ if (!_item.MainIsDir)
1875
+ badPrefix = true;
1876
+ }
1877
+ }
1878
+
1879
+ if (!badPrefix)
1880
+ FOR_VECTOR (i, _removePathParts)
1881
+ {
1882
+ if (CompareFileNames(_removePathParts[i], pathParts[i]) != 0)
1883
+ {
1884
+ badPrefix = true;
1885
+ break;
1886
+ }
1887
+ }
1888
+ }
1889
+
1890
+ if (badPrefix)
1891
+ {
1892
+ if (askExtractMode == NArchive::NExtract::NAskMode::kExtract && !_testMode)
1893
+ return E_FAIL;
1894
+ }
1895
+ else
1896
+ {
1897
+ numRemovePathParts = _removePathParts.Size();
1898
+ _some_pathParts_wereRemoved = true;
1899
+ }
1900
+ break;
1901
+ }
1902
+
1903
+ case NExtract::NPathMode::kNoPaths:
1904
+ {
1905
+ if (!pathParts.IsEmpty())
1906
+ numRemovePathParts = pathParts.Size() - 1;
1907
+ break;
1908
+ }
1909
+ case NExtract::NPathMode::kNoPathsAlt:
1910
+ {
1911
+ #ifdef SUPPORT_ALT_STREAMS
1912
+ if (_item.IsAltStream)
1913
+ numRemovePathParts = pathParts.Size();
1914
+ else
1915
+ #endif
1916
+ if (!pathParts.IsEmpty())
1917
+ numRemovePathParts = pathParts.Size() - 1;
1918
+ break;
1919
+ }
1920
+ case NExtract::NPathMode::kAbsPaths:
1921
+ default:
1922
+ break;
1923
+ }
1924
+
1925
+ pathParts.DeleteFrontal(numRemovePathParts);
1926
+ }
1927
+
1928
+
1929
+ #ifndef Z7_SFX
1930
+
1931
+ if (ExtractToStreamCallback)
1932
+ {
1933
+ CMyComPtr2_Create<IGetProp, CGetProp> GetProp;
1934
+ GetProp->Arc = _arc;
1935
+ GetProp->IndexInArc = index;
1936
+ UString name (MakePathFromParts(pathParts));
1937
+ // GetProp->BaseName = name;
1938
+ #ifdef SUPPORT_ALT_STREAMS
1939
+ if (_item.IsAltStream)
1940
+ {
1941
+ if (!pathParts.IsEmpty() || (!_removePartsForAltStreams && _pathMode != NExtract::NPathMode::kNoPathsAlt))
1942
+ name.Add_Colon();
1943
+ name += _item.AltStreamName;
1944
+ }
1945
+ #endif
1946
+
1947
+ return ExtractToStreamCallback->GetStream7(name, BoolToInt(_item.IsDir), outStream, askExtractMode, GetProp);
1948
+ }
1949
+
1950
+ #endif // Z7_SFX
1951
+
1952
+
1953
+ CMyComPtr<ISequentialOutStream> outStreamLoc;
1954
+
1955
+ if (askExtractMode == NArchive::NExtract::NAskMode::kExtract && !_testMode)
1956
+ {
1957
+ if (_stdOutMode)
1958
+ outStreamLoc = new CStdOutFileStream;
1959
+ else
1960
+ {
1961
+ if (_isSplit)
1962
+ {
1963
+ RINOK(PrepareOperation(askExtractMode))
1964
+ return SetOperationResult(NArchive::NExtract::NOperationResult::kUnsupportedMethod);
1965
+ }
1966
+ bool needExit = true;
1967
+ RINOK(GetExtractStream(outStreamLoc, needExit))
1968
+ if (needExit)
1969
+ return S_OK;
1970
+ }
1971
+ }
1972
+
1973
+ #ifndef Z7_SFX
1974
+ if (_hashStream)
1975
+ {
1976
+ if (askExtractMode == NArchive::NExtract::NAskMode::kExtract ||
1977
+ askExtractMode == NArchive::NExtract::NAskMode::kTest)
1978
+ {
1979
+ _hashStreamSpec->SetStream(outStreamLoc);
1980
+ outStreamLoc = _hashStream;
1981
+ _hashStreamSpec->Init(true);
1982
+ _hashStreamWasUsed = true;
1983
+ }
1984
+ }
1985
+ #endif // Z7_SFX
1986
+
1987
+ if (outStreamLoc)
1988
+ {
1989
+ /*
1990
+ #ifdef SUPPORT_LINKS
1991
+ if (!_copyFile_Path.IsEmpty())
1992
+ {
1993
+ RINOK(PrepareOperation(askExtractMode));
1994
+ RINOK(MyCopyFile(outStreamLoc));
1995
+ return SetOperationResult(NArchive::NExtract::NOperationResult::kOK);
1996
+ }
1997
+ if (_link.isCopyLink && _testMode)
1998
+ return S_OK;
1999
+ #endif
2000
+ */
2001
+ *outStream = outStreamLoc.Detach();
2002
+ }
2003
+
2004
+ return S_OK;
2005
+
2006
+ COM_TRY_END
2007
+ }
2008
+
2009
+
2010
+
2011
+
2012
+
2013
+
2014
+
2015
+
2016
+
2017
+
2018
+
2019
+ Z7_COM7F_IMF(CArchiveExtractCallback::PrepareOperation(Int32 askExtractMode))
2020
+ {
2021
+ COM_TRY_BEGIN
2022
+
2023
+ #ifndef Z7_SFX
2024
+ // if (!_op_WasReported)
2025
+ if (ExtractToStreamCallback)
2026
+ return ExtractToStreamCallback->PrepareOperation7(askExtractMode);
2027
+ #endif
2028
+
2029
+ _extractMode = false;
2030
+
2031
+ switch (askExtractMode)
2032
+ {
2033
+ case NArchive::NExtract::NAskMode::kExtract:
2034
+ if (_testMode)
2035
+ askExtractMode = NArchive::NExtract::NAskMode::kTest;
2036
+ else
2037
+ _extractMode = true;
2038
+ break;
2039
+ default: break;
2040
+ }
2041
+
2042
+ // if (_op_WasReported) return S_OK;
2043
+
2044
+ return _extractCallback2->PrepareOperation(_item.Path, BoolToInt(_item.IsDir),
2045
+ askExtractMode, _isSplit ? &_position: NULL);
2046
+
2047
+ COM_TRY_END
2048
+ }
2049
+
2050
+
2051
+
2052
+
2053
+
2054
+ HRESULT CArchiveExtractCallback::CloseFile()
2055
+ {
2056
+ if (!_outFileStream)
2057
+ return S_OK;
2058
+
2059
+ HRESULT hres = S_OK;
2060
+
2061
+ const UInt64 processedSize = _outFileStreamSpec->ProcessedSize;
2062
+ if (_fileLength_WasSet && _fileLength_that_WasSet > processedSize)
2063
+ {
2064
+ const bool res = _outFileStreamSpec->File.SetLength(processedSize);
2065
+ _fileLength_WasSet = res;
2066
+ if (!res)
2067
+ {
2068
+ const HRESULT hres2 = SendMessageError_with_LastError(kCantSetFileLen, us2fs(_item.Path));
2069
+ if (hres == S_OK)
2070
+ hres = hres2;
2071
+ }
2072
+ }
2073
+
2074
+ _curSize = processedSize;
2075
+ _curSize_Defined = true;
2076
+
2077
+ #if defined(_WIN32) && !defined(UNDER_CE) && !defined(Z7_SFX)
2078
+ if (ZoneBuf.Size() != 0
2079
+ && !_item.IsAltStream)
2080
+ {
2081
+ // if (NFind::DoesFileExist_Raw(tempFilePath))
2082
+ if (ZoneMode != NExtract::NZoneIdMode::kOffice ||
2083
+ FindExt2(kOfficeExtensions, fs2us(_diskFilePath)))
2084
+ {
2085
+ // we must write zone file before setting of timestamps
2086
+ if (!WriteZoneFile_To_BaseFile(_diskFilePath, ZoneBuf))
2087
+ {
2088
+ // we can't write it in FAT
2089
+ // SendMessageError_with_LastError("Can't write Zone.Identifier stream", path);
2090
+ }
2091
+ }
2092
+ }
2093
+ #endif
2094
+
2095
+ CFiTimesCAM t;
2096
+ GetFiTimesCAM(_fi, t, *_arc);
2097
+
2098
+ const bool needSetAttrib = (_needSetAttrib && _fi.Attrib_Defined);
2099
+ if (t.IsSomeTimeDefined() || needSetAttrib)
2100
+ {
2101
+ bool needSetTime = true;
2102
+ if (needSetAttrib)
2103
+ {
2104
+ /*
2105
+ in Linux: { this code branch is not used,
2106
+ because (mode) was set in open() function in COutFile open function.
2107
+ If we call Set_Time_and_WinAttrib(), then later COutFile::Close() will call fchmod().
2108
+ So we need Set_Time_and_WinAttrib() in linux only if we need insecure nonrestricted (mode) bits with fchmod().
2109
+ }
2110
+
2111
+ win10: if (attrib & FILE_ATTRIBUTE_DIRECTORY)
2112
+ {
2113
+ NtSetInformationFile() returns (STATUS_INVALID_PARAMETER)
2114
+ SetFileAttributes() just ignores FILE_ATTRIBUTE_DIRECTORY()
2115
+ }
2116
+ */
2117
+ // _fi.Attrib |= 0xfffffff; // FOR DEBUG
2118
+ if (_outFileStreamSpec->File.Set_Time_and_WinAttrib(
2119
+ t.CTime_Defined ? &t.CTime : NULL,
2120
+ t.ATime_Defined ? &t.ATime : NULL,
2121
+ t.MTime_Defined ? &t.MTime : NULL,
2122
+ (DWORD)_fi.Attrib & ~(DWORD)FILE_ATTRIBUTE_DIRECTORY))
2123
+ {
2124
+ needSetTime = false;
2125
+ _needSetAttrib = false;
2126
+ }
2127
+ else
2128
+ {
2129
+ // it's unexpected case.
2130
+ // we will set timestamp/attributes with another code later
2131
+ // SendMessageError_with_LastError("Cannot set timestamp and file attribute", _diskFilePath);
2132
+ }
2133
+ }
2134
+ if (needSetTime)
2135
+ _outFileStreamSpec->SetTime(
2136
+ t.CTime_Defined ? &t.CTime : NULL,
2137
+ t.ATime_Defined ? &t.ATime : NULL,
2138
+ t.MTime_Defined ? &t.MTime : NULL);
2139
+ }
2140
+
2141
+ RINOK(_outFileStreamSpec->Close())
2142
+ _outFileStream.Release();
2143
+
2144
+ #if defined(_WIN32) && !defined(UNDER_CE)
2145
+ if (!_altStream_NeedRestore_Attrib_for_parentFsPath.IsEmpty())
2146
+ {
2147
+ SetFileAttrib(_altStream_NeedRestore_Attrib_for_parentFsPath, _altStream_NeedRestore_AttribVal);
2148
+ _altStream_NeedRestore_Attrib_for_parentFsPath.Empty();
2149
+ }
2150
+ #endif
2151
+
2152
+ return hres;
2153
+ }
2154
+
2155
+
2156
+ #ifdef SUPPORT_LINKS
2157
+
2158
+ static bool CheckLinkPath_in_FS_for_pathParts(const FString &path, const UStringVector &v)
2159
+ {
2160
+ FString path2 = path;
2161
+ FOR_VECTOR (i, v)
2162
+ {
2163
+ // if (i == v.Size() - 1) path = path2; // we don't need last part in returned path
2164
+ path2 += us2fs(v[i]);
2165
+ NFind::CFileInfo fi;
2166
+ // printf("\nCheckLinkPath_in_FS_for_pathParts(): %s\n", GetOemString(path2).Ptr());
2167
+ if (fi.Find(path2) && fi.IsOsSymLink())
2168
+ return false;
2169
+ path2.Add_PathSepar();
2170
+ }
2171
+ return true;
2172
+ }
2173
+
2174
+ /*
2175
+ link.isRelative / relative_item_PathPrefix
2176
+ false / empty
2177
+ true / item path without last part
2178
+ */
2179
+ static bool CheckLinkPath_in_FS(
2180
+ const FString &pathPrefix_in_FS,
2181
+ const CPostLink &postLink,
2182
+ const UString &relative_item_PathPrefix)
2183
+ {
2184
+ const CLinkInfo &link = postLink.LinkInfo;
2185
+ if (postLink.item_PathParts.IsEmpty() || link.LinkPath.IsEmpty())
2186
+ return false;
2187
+ FString path;
2188
+ {
2189
+ const UString &s = postLink.item_PathParts[0];
2190
+ if (!s.IsEmpty() && !NName::IsAbsolutePath(s))
2191
+ path = pathPrefix_in_FS; // item_PathParts is relative. So we use absolutre prefix
2192
+ }
2193
+ if (!CheckLinkPath_in_FS_for_pathParts(path, postLink.item_PathParts))
2194
+ return false;
2195
+ path += us2fs(relative_item_PathPrefix);
2196
+ UStringVector v;
2197
+ SplitPathToParts(link.LinkPath, v);
2198
+ // we check target paths:
2199
+ return CheckLinkPath_in_FS_for_pathParts(path, v);
2200
+ }
2201
+
2202
+ static const unsigned k_DangLevel_MAX_for_Link_over_Link = 9;
2203
+
2204
+ HRESULT CArchiveExtractCallback::CreateHardLink2(
2205
+ const FString &newFilePath, const FString &existFilePath, bool &link_was_Created) const
2206
+ {
2207
+ link_was_Created = false;
2208
+ if (_ntOptions.SymLinks_DangerousLevel <= k_DangLevel_MAX_for_Link_over_Link)
2209
+ {
2210
+ NFind::CFileInfo fi;
2211
+ if (fi.Find(existFilePath) && fi.IsOsSymLink())
2212
+ return SendMessageError2(0, k_HardLink_to_SymLink_Ignored, newFilePath, existFilePath);
2213
+ }
2214
+ if (!MyCreateHardLink(newFilePath, existFilePath))
2215
+ return SendMessageError2_with_LastError(kCantCreateHardLink, newFilePath, existFilePath);
2216
+ link_was_Created = true;
2217
+ return S_OK;
2218
+ }
2219
+
2220
+
2221
+
2222
+ HRESULT CArchiveExtractCallback::SetLink(
2223
+ const FString &fullProcessedPath_from,
2224
+ const CLinkInfo &link,
2225
+ bool &linkWasSet) // placeholder was created
2226
+ {
2227
+ linkWasSet = false;
2228
+ if (link.LinkPath.IsEmpty())
2229
+ return S_OK;
2230
+ if (!_ntOptions.SymLinks.Val && link.Is_AnySymLink())
2231
+ return S_OK;
2232
+ CPostLink postLink;
2233
+ postLink.Index_in_Arc = _index;
2234
+ postLink.item_IsDir = _item.IsDir;
2235
+ postLink.item_Path = _item.Path;
2236
+ postLink.item_PathParts = _item.PathParts;
2237
+ postLink.item_FileInfo = _fi;
2238
+ postLink.fullProcessedPath_from = fullProcessedPath_from;
2239
+ postLink.LinkInfo = link;
2240
+ _postLinks.Add(postLink);
2241
+
2242
+ // file doesn't exist in most cases. So we don't check for error.
2243
+ DeleteLinkFileAlways_or_RemoveEmptyDir(fullProcessedPath_from, false); // checkThatFileIsEmpty = false
2244
+
2245
+ NIO::COutFile outFile;
2246
+ if (!outFile.Create_NEW(fullProcessedPath_from))
2247
+ return SendMessageError("Cannot create temporary link file", fullProcessedPath_from);
2248
+ #if 0 // 1 for debug
2249
+ // here we can write link path to temporary link file placeholder,
2250
+ // but empty placeholder is better, because we don't want to get any non-empty data instead of link file.
2251
+ AString s;
2252
+ ConvertUnicodeToUTF8(link.LinkPath, s);
2253
+ outFile.WriteFull(s, s.Len());
2254
+ #endif
2255
+ linkWasSet = true;
2256
+ return S_OK;
2257
+ }
2258
+
2259
+
2260
+ // if file/dir is symbolic link it will remove only link itself
2261
+ HRESULT CArchiveExtractCallback::DeleteLinkFileAlways_or_RemoveEmptyDir(
2262
+ const FString &path, bool checkThatFileIsEmpty) const
2263
+ {
2264
+ NFile::NFind::CFileInfo fi;
2265
+ if (fi.Find(path)) // followLink = false
2266
+ {
2267
+ if (fi.IsDir())
2268
+ {
2269
+ if (RemoveDirAlways_if_Empty(path))
2270
+ return S_OK;
2271
+ }
2272
+ else
2273
+ {
2274
+ // link file placeholder must be empty
2275
+ if (checkThatFileIsEmpty && !fi.IsOsSymLink() && fi.Size != 0)
2276
+ return SendMessageError("Temporary link file is not empty", path);
2277
+ if (DeleteFileAlways(path))
2278
+ return S_OK;
2279
+ }
2280
+ if (GetLastError() != ERROR_FILE_NOT_FOUND)
2281
+ return SendMessageError_with_LastError(
2282
+ fi.IsDir() ?
2283
+ k_CantDelete_Dir_for_SymLink:
2284
+ k_CantDelete_File_for_SymLink,
2285
+ path);
2286
+ }
2287
+ return S_OK;
2288
+ }
2289
+
2290
+
2291
+ /*
2292
+ in:
2293
+ link.LinkPath : must be relative (non-absolute) path in any case !!!
2294
+ link.isRelative / target path that must stored as created link:
2295
+ == false / _dirPathPrefix_Full + link.LinkPath
2296
+ == true / link.LinkPath
2297
+ */
2298
+ static HRESULT SetLink2(const CArchiveExtractCallback &callback,
2299
+ const CPostLink &postLink, bool &linkWasSet)
2300
+ {
2301
+ const CLinkInfo &link = postLink.LinkInfo;
2302
+ const FString &fullProcessedPath_from = postLink.fullProcessedPath_from; // full file path in FS (fullProcessedPath_from)
2303
+
2304
+ const unsigned level = callback._ntOptions.SymLinks_DangerousLevel;
2305
+ if (level < 20)
2306
+ {
2307
+ /*
2308
+ We want to use additional check for links that can link to directory.
2309
+ - linux: all symbolic links are files.
2310
+ - windows: we can have file/directory symbolic link,
2311
+ but file symbolic link works like directory link in windows.
2312
+ So we use additional check for all relative links.
2313
+
2314
+ We don't allow decreasing of final level of link.
2315
+ So if some another extracted file will use this link,
2316
+ then number of real path parts (after link redirection) cannot be
2317
+ smaller than number of requested path parts from archive records.
2318
+
2319
+ here we check only (link.LinkPath) without (_item.PathParts).
2320
+ */
2321
+ CLinkLevelsInfo li;
2322
+ li.Parse(link.LinkPath, link.Is_WSL());
2323
+ bool isDang;
2324
+ UString relativePathPrefix;
2325
+ if (li.IsAbsolute // unexpected
2326
+ || li.ParentDirDots_after_NonParent
2327
+ || (level <= 5 && link.isRelative && li.FinalLevel < 1) // final level lower
2328
+ || (level <= 5 && link.isRelative && li.LowLevel < 0) // negative temporary levels
2329
+ )
2330
+ isDang = true;
2331
+ else // if (!isDang)
2332
+ {
2333
+ UString path;
2334
+ if (link.isRelative)
2335
+ {
2336
+ // item_PathParts : parts that will be created in output folder.
2337
+ // we want to get directory prefix of link item.
2338
+ // so we remove file name (last non-empty part) from PathParts:
2339
+ UStringVector v = postLink.item_PathParts;
2340
+ while (!v.IsEmpty())
2341
+ {
2342
+ const unsigned len = v.Back().Len();
2343
+ v.DeleteBack();
2344
+ if (len)
2345
+ break;
2346
+ }
2347
+ path = MakePathFromParts(v);
2348
+ NName::NormalizeDirPathPrefix(path);
2349
+ relativePathPrefix = path;
2350
+ }
2351
+ path += link.LinkPath;
2352
+ /*
2353
+ path is calculated virtual target path of link
2354
+ path is relative to root folder of extracted items
2355
+ if (!link.isRelative), then (path == link.LinkPath)
2356
+ */
2357
+ isDang = false;
2358
+ if (!IsSafePath(path, link.Is_WSL()))
2359
+ isDang = true;
2360
+ }
2361
+ const char *message = NULL;
2362
+ if (isDang)
2363
+ message = "Dangerous link path was ignored";
2364
+ else if (level <= k_DangLevel_MAX_for_Link_over_Link
2365
+ && !CheckLinkPath_in_FS(callback._dirPathPrefix_Full,
2366
+ postLink, relativePathPrefix))
2367
+ message = "Dangerous link via another link was ignored";
2368
+ if (message)
2369
+ return callback.SendMessageError2(0, // errorCode
2370
+ message, us2fs(postLink.item_Path), us2fs(link.LinkPath));
2371
+ }
2372
+
2373
+ FString target; // target path that will be stored to link field
2374
+ if (link.Is_HardLink() /* || link.IsCopyLink */ || !link.isRelative)
2375
+ {
2376
+ // isRelative == false
2377
+ // all hard links and absolute symbolic links
2378
+ // relatPath == link.LinkPath
2379
+ // we get absolute link path for target:
2380
+ if (!NName::GetFullPath(callback._dirPathPrefix_Full, us2fs(link.LinkPath), target))
2381
+ return callback.SendMessageError("Incorrect link path", us2fs(link.LinkPath));
2382
+ // (target) is (_dirPathPrefix_Full + relatPath)
2383
+ }
2384
+ else
2385
+ {
2386
+ // link.isRelative == true
2387
+ // relative symbolic links only
2388
+ target = us2fs(link.LinkPath);
2389
+ }
2390
+ if (target.IsEmpty())
2391
+ return callback.SendMessageError("Empty link", fullProcessedPath_from);
2392
+
2393
+ if (link.Is_HardLink() /* || link.IsCopyLink */)
2394
+ {
2395
+ // if (link.isHardLink)
2396
+ {
2397
+ RINOK(callback.DeleteLinkFileAlways_or_RemoveEmptyDir(fullProcessedPath_from, true)) // checkThatFileIsEmpty
2398
+ {
2399
+ // RINOK(SendMessageError_with_LastError(k_Cant_DeleteTempLinkFile, fullProcessedPath_from))
2400
+ }
2401
+ return callback.CreateHardLink2(fullProcessedPath_from, target, linkWasSet);
2402
+ /*
2403
+ RINOK(PrepareOperation(NArchive::NExtract::NAskMode::kExtract))
2404
+ _op_WasReported = true;
2405
+ RINOK(SetOperationResult(NArchive::NExtract::NOperationResult::kOK))
2406
+ linkWasSet = true;
2407
+ return S_OK;
2408
+ */
2409
+ }
2410
+ /*
2411
+ // IsCopyLink
2412
+ {
2413
+ NFind::CFileInfo fi;
2414
+ if (!fi.Find(target))
2415
+ {
2416
+ RINOK(SendMessageError2("Cannot find the file for copying", target, fullProcessedPath));
2417
+ }
2418
+ else
2419
+ {
2420
+ if (_curSize_Defined && _curSize == fi.Size)
2421
+ _copyFile_Path = target;
2422
+ else
2423
+ {
2424
+ RINOK(SendMessageError2("File size collision for file copying", target, fullProcessedPath));
2425
+ }
2426
+ // RINOK(MyCopyFile(target, fullProcessedPath));
2427
+ }
2428
+ }
2429
+ */
2430
+ }
2431
+
2432
+ // is Symbolic link
2433
+
2434
+ /*
2435
+ if (_item.IsDir && !isRelative)
2436
+ {
2437
+ // Windows before Vista doesn't support symbolic links.
2438
+ // we could convert such symbolic links to Junction Points
2439
+ // isJunction = true;
2440
+ }
2441
+ */
2442
+
2443
+ #ifdef _WIN32
2444
+ const bool isDir = (postLink.item_IsDir || link.LinkType == k_LinkType_Junction);
2445
+ #endif
2446
+
2447
+
2448
+ #ifdef _WIN32
2449
+ CByteBuffer data;
2450
+ // printf("\nFillLinkData(): %s\n", GetOemString(target).Ptr());
2451
+ if (link.Is_WSL())
2452
+ {
2453
+ Convert_WinPath_to_WslLinuxPath(target, !link.isRelative);
2454
+ FillLinkData_WslLink(data, fs2us(target));
2455
+ }
2456
+ else
2457
+ FillLinkData_WinLink(data, fs2us(target), link.LinkType != k_LinkType_Junction);
2458
+ if (data.Size() == 0)
2459
+ return callback.SendMessageError("Cannot fill link data", us2fs(postLink.item_Path));
2460
+ /*
2461
+ if (NtReparse_Size != data.Size() || memcmp(NtReparse_Data, data, data.Size()) != 0)
2462
+ SendMessageError("reconstructed Reparse is different", fs2us(target));
2463
+ */
2464
+ {
2465
+ // we check that reparse data is correct, but we ignore attr.MinorError.
2466
+ CReparseAttr attr;
2467
+ if (!attr.Parse(data, data.Size()))
2468
+ return callback.SendMessageError("Internal error for symbolic link file", us2fs(postLink.item_Path));
2469
+ }
2470
+ #endif
2471
+
2472
+ RINOK(callback.DeleteLinkFileAlways_or_RemoveEmptyDir(fullProcessedPath_from, true)) // checkThatFileIsEmpty
2473
+ #ifdef _WIN32
2474
+ if (!NFile::NIO::SetReparseData(fullProcessedPath_from, isDir, data, (DWORD)data.Size()))
2475
+ #else // ! _WIN32
2476
+ if (!NFile::NIO::SetSymLink(fullProcessedPath_from, target))
2477
+ #endif // ! _WIN32
2478
+ {
2479
+ return callback.SendMessageError_with_LastError(kCantCreateSymLink, fullProcessedPath_from);
2480
+ }
2481
+ linkWasSet = true;
2482
+ return S_OK;
2483
+ }
2484
+
2485
+
2486
+
2487
+ bool CLinkInfo::Parse_from_WindowsReparseData(const Byte *data, size_t dataSize)
2488
+ {
2489
+ CReparseAttr reparse;
2490
+ if (!reparse.Parse(data, dataSize))
2491
+ return false;
2492
+ // const AString s = GetAnsiString(LinkPath);
2493
+ // printf("\nlinkPath: %s\n", s.Ptr());
2494
+ LinkPath = reparse.GetPath();
2495
+ if (reparse.IsSymLink_WSL())
2496
+ {
2497
+ LinkType = k_LinkType_WSL;
2498
+ isRelative = reparse.IsRelative_WSL(); // detected from LinkPath[0]
2499
+ // LinkPath is original raw name converted to UString from AString
2500
+ // Linux separator '/' is expected here.
2501
+ REPLACE_SLASHES_from_Linux_to_Sys(LinkPath)
2502
+ }
2503
+ else
2504
+ {
2505
+ LinkType = reparse.IsMountPoint() ? k_LinkType_Junction : k_LinkType_PureSymLink;
2506
+ isRelative = reparse.IsRelative_Win(); // detected by (Flags == Z7_WIN_SYMLINK_FLAG_RELATIVE)
2507
+ isWindowsPath = true;
2508
+ // LinkPath is original windows link path from raparse data with \??\ prefix removed.
2509
+ // windows '\\' separator is expected here.
2510
+ // linux '/' separator is not expected here.
2511
+ // we translate both types of separators to system separator.
2512
+ LinkPath.Replace(
2513
+ #if WCHAR_PATH_SEPARATOR == L'\\'
2514
+ L'/'
2515
+ #else
2516
+ L'\\'
2517
+ #endif
2518
+ , WCHAR_PATH_SEPARATOR);
2519
+ }
2520
+ // (LinkPath) uses system path separator.
2521
+ // windows: (LinkPath) doesn't contain linux separator (slash).
2522
+ return true;
2523
+ }
2524
+
2525
+
2526
+ bool CLinkInfo::Parse_from_LinuxData(const Byte *data, size_t dataSize)
2527
+ {
2528
+ // Clear(); // *this object was cleared by constructor already.
2529
+ LinkType = k_LinkType_PureSymLink;
2530
+ AString utf;
2531
+ if (dataSize >= k_LinkDataSize_LIMIT)
2532
+ return false;
2533
+ utf.SetFrom_CalcLen((const char *)data, (unsigned)dataSize);
2534
+ UString u;
2535
+ if (!ConvertUTF8ToUnicode(utf, u))
2536
+ return false;
2537
+ if (u.IsEmpty())
2538
+ return false;
2539
+ const wchar_t c = u[0];
2540
+ isRelative = (c != L'/');
2541
+ // linux path separator is expected
2542
+ REPLACE_SLASHES_from_Linux_to_Sys(u)
2543
+ LinkPath = u;
2544
+ // (LinkPath) uses system path separator.
2545
+ // windows: (LinkPath) doesn't contain linux separator (slash).
2546
+ return true;
2547
+ }
2548
+
2549
+
2550
+ // in/out: (LinkPath) uses system path separator
2551
+ // in/out: windows: (LinkPath) doesn't contain linux separator (slash).
2552
+ // out: (LinkPath) is relative path, and LinkPath[0] is not path separator
2553
+ // out: isRelative changed to false, if any prefix was removed.
2554
+ // note: absolute windows links "c:\" to root will be reduced to empty string:
2555
+ void CLinkInfo::Remove_AbsPathPrefixes()
2556
+ {
2557
+ while (!LinkPath.IsEmpty())
2558
+ {
2559
+ unsigned n = 0;
2560
+ if (!Is_WSL())
2561
+ {
2562
+ n =
2563
+ #ifndef _WIN32
2564
+ isWindowsPath ?
2565
+ NName::GetRootPrefixSize_WINDOWS(LinkPath) :
2566
+ #endif
2567
+ NName::GetRootPrefixSize(LinkPath);
2568
+ /*
2569
+ // "c:path" will be ignored later as "Dangerous absolute path"
2570
+ // so check is not required
2571
+ if (n == 0
2572
+ #ifndef _WIN32
2573
+ && isWindowsPath
2574
+ #endif
2575
+ && NName::IsDrivePath2(LinkPath))
2576
+ n = 2;
2577
+ */
2578
+ }
2579
+ if (n == 0)
2580
+ {
2581
+ if (!IS_PATH_SEPAR(LinkPath[0]))
2582
+ break;
2583
+ n = 1;
2584
+ }
2585
+ isRelative = false; // (LinkPath) will be treated as relative to root folder of archive
2586
+ LinkPath.DeleteFrontal(n);
2587
+ }
2588
+ }
2589
+
2590
+
2591
+ /*
2592
+ it removes redundant separators, if there are double separators,
2593
+ but it keeps double separators at start of string //name/.
2594
+ in/out: system path separator is used
2595
+ windows: slash character (linux separator) is not treated as separator
2596
+ windows: (path) doesn't contain linux separator (slash).
2597
+ */
2598
+ static void RemoveRedundantPathSeparators(UString &path)
2599
+ {
2600
+ wchar_t *dest = path.GetBuf();
2601
+ const wchar_t * const start = dest;
2602
+ const wchar_t *src = dest;
2603
+ for (;;)
2604
+ {
2605
+ wchar_t c = *src++;
2606
+ if (c == 0)
2607
+ break;
2608
+ // if (IS_PATH_SEPAR(c)) // for Windows: we can change (/) to (\).
2609
+ if (c == WCHAR_PATH_SEPARATOR)
2610
+ {
2611
+ if (dest - start >= 2 && dest[-1] == WCHAR_PATH_SEPARATOR)
2612
+ continue;
2613
+ // c = WCHAR_PATH_SEPARATOR; // for Windows: we can change (/) to (\).
2614
+ }
2615
+ *dest++ = c;
2616
+ }
2617
+ *dest = 0;
2618
+ path.ReleaseBuf_SetLen((unsigned)(dest - path.Ptr()));
2619
+ }
2620
+
2621
+
2622
+ // in/out: (LinkPath) uses system path separator
2623
+ // in/out: windows: (LinkPath) doesn't contain linux separator (slash).
2624
+ // out: (LinkPath) is relative path, and LinkPath[0] is not path separator
2625
+ void CLinkInfo::Normalize_to_RelativeSafe(UStringVector &removePathParts)
2626
+ {
2627
+ // We WILL NOT WRITE original absolute link path from archive to filesystem.
2628
+ // So here we remove all root prefixes from (LinkPath).
2629
+ // If we see any absolute root prefix, then we suppose that this prefix is virtual prefix
2630
+ // that shows that link is relative to root folder of archive
2631
+ RemoveRedundantPathSeparators(LinkPath);
2632
+ // LinkPath = "\\\\?\\r:test\\test2"; // for debug
2633
+ Remove_AbsPathPrefixes();
2634
+ // (LinkPath) now is relative:
2635
+ // if (isRelative == false), then (LinkPath) is relative to root folder of archive
2636
+ // if (isRelative == true ), then (LinkPath) is relative to current item
2637
+ if (LinkPath.IsEmpty() || isRelative || removePathParts.Size() == 0)
2638
+ return;
2639
+
2640
+ // if LinkPath is prefixed by _removePathParts, we remove these paths
2641
+ UStringVector pathParts;
2642
+ SplitPathToParts(LinkPath, pathParts);
2643
+ bool badPrefix = false;
2644
+ {
2645
+ FOR_VECTOR (i, removePathParts)
2646
+ {
2647
+ if (i >= pathParts.Size()
2648
+ || CompareFileNames(removePathParts[i], pathParts[i]) != 0)
2649
+ {
2650
+ badPrefix = true;
2651
+ break;
2652
+ }
2653
+ }
2654
+ }
2655
+ if (!badPrefix)
2656
+ pathParts.DeleteFrontal(removePathParts.Size());
2657
+ LinkPath = MakePathFromParts(pathParts);
2658
+ Remove_AbsPathPrefixes();
2659
+ }
2660
+
2661
+ #endif // SUPPORT_LINKS
2662
+
2663
+
2664
+ HRESULT CArchiveExtractCallback::CloseReparseAndFile()
2665
+ {
2666
+ HRESULT res = S_OK;
2667
+
2668
+ #ifdef SUPPORT_LINKS
2669
+
2670
+ size_t reparseSize = 0;
2671
+ bool repraseMode = false;
2672
+ bool needSetReparse = false;
2673
+ CLinkInfo link;
2674
+
2675
+ if (_bufPtrSeqOutStream)
2676
+ {
2677
+ repraseMode = true;
2678
+ reparseSize = _bufPtrSeqOutStream_Spec->GetPos();
2679
+ if (_curSize_Defined && reparseSize == _outMemBuf.Size())
2680
+ {
2681
+ /*
2682
+ CReparseAttr reparse;
2683
+ DWORD errorCode = 0;
2684
+ needSetReparse = reparse.Parse(_outMemBuf, reparseSize, errorCode);
2685
+ if (needSetReparse)
2686
+ {
2687
+ UString LinkPath = reparse.GetPath();
2688
+ #ifndef _WIN32
2689
+ LinkPath.Replace(L'\\', WCHAR_PATH_SEPARATOR);
2690
+ #endif
2691
+ }
2692
+ */
2693
+ needSetReparse = _is_SymLink_in_Data_Linux ?
2694
+ link.Parse_from_LinuxData(_outMemBuf, reparseSize) :
2695
+ link.Parse_from_WindowsReparseData(_outMemBuf, reparseSize);
2696
+ if (!needSetReparse)
2697
+ res = SendMessageError("Incorrect reparse stream", us2fs(_item.Path));
2698
+ // (link.LinkPath) uses system path separator.
2699
+ // windows: (link.LinkPath) doesn't contain linux separator (slash).
2700
+ }
2701
+ else
2702
+ {
2703
+ res = SendMessageError("Unknown reparse stream", us2fs(_item.Path));
2704
+ }
2705
+ if (!needSetReparse && _outFileStream)
2706
+ {
2707
+ const HRESULT res2 = WriteStream(_outFileStream, _outMemBuf, reparseSize);
2708
+ if (res == S_OK)
2709
+ res = res2;
2710
+ }
2711
+ _bufPtrSeqOutStream.Release();
2712
+ }
2713
+
2714
+ #endif // SUPPORT_LINKS
2715
+
2716
+ const HRESULT res2 = CloseFile();
2717
+ if (res == S_OK)
2718
+ res = res2;
2719
+ RINOK(res)
2720
+
2721
+ #ifdef SUPPORT_LINKS
2722
+ if (repraseMode)
2723
+ {
2724
+ _curSize = reparseSize;
2725
+ _curSize_Defined = true;
2726
+ if (needSetReparse)
2727
+ {
2728
+ // empty file was created so we must delete it.
2729
+ // in Linux : we must delete empty file before symbolic link creation
2730
+ // in Windows : we can create symbolic link even without file deleting
2731
+ if (!DeleteFileAlways(_diskFilePath))
2732
+ {
2733
+ RINOK(SendMessageError_with_LastError("can't delete file", _diskFilePath))
2734
+ }
2735
+ {
2736
+ bool linkWasSet = false;
2737
+ // link.LinkPath = "r:\\1\\2"; // for debug
2738
+ // link.isJunction = true; // for debug
2739
+ link.Normalize_to_RelativeSafe(_removePathParts);
2740
+ RINOK(SetLink(_diskFilePath, link, linkWasSet))
2741
+ /* DOCs:
2742
+ posix: permissions are ignored for access via link.
2743
+ Linux: the permissions of an ordinary symbolic link are not
2744
+ used in any operations; the permissions are always 0777 (read,
2745
+ write, and execute for all user categories), and can't be changed.
2746
+ So we don't set attributes for placeholder.
2747
+ */
2748
+ /*
2749
+ if (linkWasSet)
2750
+ _isSymLinkCreated = true; // link.IsSymLink();
2751
+ else
2752
+ */
2753
+ _needSetAttrib = false;
2754
+ }
2755
+ }
2756
+ }
2757
+ #endif // SUPPORT_LINKS
2758
+ return res;
2759
+ }
2760
+
2761
+
2762
+ static void SetAttrib_Base(const FString &path, const CProcessedFileInfo &fi,
2763
+ const CArchiveExtractCallback &callback)
2764
+ {
2765
+ if (fi.Attrib_Defined)
2766
+ {
2767
+ // const AString s = GetAnsiString(_diskFilePath);
2768
+ // printf("\nSetFileAttrib_PosixHighDetect: %s: hex:%x\n", s.Ptr(), _fi.Attrib);
2769
+ if (!SetFileAttrib_PosixHighDetect(path, fi.Attrib))
2770
+ {
2771
+ // do we need error message here in Windows and in posix?
2772
+ callback.SendMessageError_with_LastError("Cannot set file attribute", path);
2773
+ }
2774
+ }
2775
+ }
2776
+
2777
+ void CArchiveExtractCallback::SetAttrib(const FString &path) const
2778
+ {
2779
+ #ifndef _WIN32
2780
+ // Linux now doesn't support permissions for symlinks
2781
+ // if (_isSymLinkCreated) return;
2782
+ #endif
2783
+ // printf("\n SetAttrib %s, \n", path.Ptr());
2784
+
2785
+ if (_itemFailure
2786
+ || path.IsEmpty()
2787
+ || _stdOutMode
2788
+ || !_extractMode)
2789
+ return;
2790
+
2791
+ SetAttrib_Base(path, _fi, *this);
2792
+ }
2793
+
2794
+
2795
+ #ifdef Z7_USE_SECURITY_CODE
2796
+ HRESULT CArchiveExtractCallback::SetSecurityInfo(UInt32 indexInArc, const FString &path) const
2797
+ {
2798
+ if (!_stdOutMode && _extractMode && _ntOptions.NtSecurity.Val && _arc->GetRawProps)
2799
+ {
2800
+ const void *data;
2801
+ UInt32 dataSize;
2802
+ UInt32 propType;
2803
+ _arc->GetRawProps->GetRawProp(indexInArc, kpidNtSecure, &data, &dataSize, &propType);
2804
+ if (dataSize != 0)
2805
+ {
2806
+ if (propType != NPropDataType::kRaw)
2807
+ return E_FAIL;
2808
+ if (CheckNtSecure((const Byte *)data, dataSize))
2809
+ {
2810
+ SECURITY_INFORMATION securInfo = DACL_SECURITY_INFORMATION | GROUP_SECURITY_INFORMATION | OWNER_SECURITY_INFORMATION;
2811
+ if (_saclEnabled)
2812
+ securInfo |= SACL_SECURITY_INFORMATION;
2813
+ // if (!
2814
+ ::SetFileSecurityW(fs2us(path), securInfo, (PSECURITY_DESCRIPTOR)(void *)(const Byte *)(data));
2815
+ {
2816
+ // RINOK(SendMessageError_with_LastError("SetFileSecurity FAILS", path))
2817
+ }
2818
+ }
2819
+ }
2820
+ }
2821
+ return S_OK;
2822
+ }
2823
+ #endif // Z7_USE_SECURITY_CODE
2824
+
2825
+
2826
+ Z7_COM7F_IMF(CArchiveExtractCallback::SetOperationResult(Int32 opRes))
2827
+ {
2828
+ COM_TRY_BEGIN
2829
+
2830
+ // if (_isSplit) opRes = NArchive::NExtract::NOperationResult::kUnsupportedMethod;
2831
+ // printf("\nCArchiveExtractCallback::SetOperationResult: %d %s\n", opRes, GetAnsiString(_diskFilePath));
2832
+
2833
+ #ifndef Z7_SFX
2834
+ if (ExtractToStreamCallback)
2835
+ {
2836
+ GetUnpackSize();
2837
+ return ExtractToStreamCallback->SetOperationResult8(opRes, BoolToInt(_encrypted), _curSize);
2838
+ }
2839
+
2840
+ if (_hashStreamWasUsed)
2841
+ {
2842
+ _hashStreamSpec->_hash->Final(_item.IsDir,
2843
+ #ifdef SUPPORT_ALT_STREAMS
2844
+ _item.IsAltStream
2845
+ #else
2846
+ false
2847
+ #endif
2848
+ , _item.Path);
2849
+ _curSize = _hashStreamSpec->GetSize();
2850
+ _curSize_Defined = true;
2851
+ _hashStreamSpec->ReleaseStream();
2852
+ _hashStreamWasUsed = false;
2853
+ }
2854
+
2855
+ #endif // Z7_SFX
2856
+
2857
+ RINOK(CloseReparseAndFile())
2858
+
2859
+ #ifdef Z7_USE_SECURITY_CODE
2860
+ RINOK(SetSecurityInfo(_index, _diskFilePath))
2861
+ #endif
2862
+
2863
+ if (!_curSize_Defined)
2864
+ GetUnpackSize();
2865
+
2866
+ if (_curSize_Defined)
2867
+ {
2868
+ #ifdef SUPPORT_ALT_STREAMS
2869
+ if (_item.IsAltStream)
2870
+ AltStreams_UnpackSize += _curSize;
2871
+ else
2872
+ #endif
2873
+ UnpackSize += _curSize;
2874
+ }
2875
+
2876
+ if (_item.IsDir)
2877
+ NumFolders++;
2878
+ #ifdef SUPPORT_ALT_STREAMS
2879
+ else if (_item.IsAltStream)
2880
+ NumAltStreams++;
2881
+ #endif
2882
+ else
2883
+ NumFiles++;
2884
+
2885
+ if (_needSetAttrib)
2886
+ SetAttrib(_diskFilePath);
2887
+
2888
+ SET_OWNER
2889
+
2890
+ return _extractCallback2->SetOperationResult(opRes, BoolToInt(_encrypted));
2891
+
2892
+ COM_TRY_END
2893
+ }
2894
+
2895
+
2896
+
2897
+ Z7_COM7F_IMF(CArchiveExtractCallback::ReportExtractResult(UInt32 indexType, UInt32 index, Int32 opRes))
2898
+ {
2899
+ if (_folderArchiveExtractCallback2)
2900
+ {
2901
+ bool isEncrypted = false;
2902
+ UString s;
2903
+
2904
+ if (indexType == NArchive::NEventIndexType::kInArcIndex && index != (UInt32)(Int32)-1)
2905
+ {
2906
+ CReadArcItem item;
2907
+ RINOK(_arc->GetItem(index, item))
2908
+ s = item.Path;
2909
+ RINOK(Archive_GetItemBoolProp(_arc->Archive, index, kpidEncrypted, isEncrypted))
2910
+ }
2911
+ else
2912
+ {
2913
+ s = '#';
2914
+ s.Add_UInt32(index);
2915
+ // if (indexType == NArchive::NEventIndexType::kBlockIndex) {}
2916
+ }
2917
+
2918
+ return _folderArchiveExtractCallback2->ReportExtractResult(opRes, isEncrypted, s);
2919
+ }
2920
+
2921
+ return S_OK;
2922
+ }
2923
+
2924
+
2925
+ Z7_COM7F_IMF(CArchiveExtractCallback::CryptoGetTextPassword(BSTR *password))
2926
+ {
2927
+ COM_TRY_BEGIN
2928
+ if (!_cryptoGetTextPassword)
2929
+ {
2930
+ RINOK(_extractCallback2.QueryInterface(IID_ICryptoGetTextPassword,
2931
+ &_cryptoGetTextPassword))
2932
+ }
2933
+ return _cryptoGetTextPassword->CryptoGetTextPassword(password);
2934
+ COM_TRY_END
2935
+ }
2936
+
2937
+
2938
+ #ifndef Z7_SFX
2939
+
2940
+ // ---------- HASH functions ----------
2941
+
2942
+ FString CArchiveExtractCallback::Hash_GetFullFilePath()
2943
+ {
2944
+ // this function changes _item.PathParts.
2945
+ CorrectPathParts();
2946
+ const UStringVector &pathParts = _item.PathParts;
2947
+ const UString processedPath (MakePathFromParts(pathParts));
2948
+ FString fullProcessedPath (us2fs(processedPath));
2949
+ if (_pathMode != NExtract::NPathMode::kAbsPaths
2950
+ || !NName::IsAbsolutePath(processedPath))
2951
+ {
2952
+ fullProcessedPath = MakePath_from_2_Parts(
2953
+ DirPathPrefix_for_HashFiles,
2954
+ // _dirPathPrefix,
2955
+ fullProcessedPath);
2956
+ }
2957
+ return fullProcessedPath;
2958
+ }
2959
+
2960
+
2961
+ Z7_COM7F_IMF(CArchiveExtractCallback::GetDiskProperty(UInt32 index, PROPID propID, PROPVARIANT *value))
2962
+ {
2963
+ COM_TRY_BEGIN
2964
+ NCOM::CPropVariant prop;
2965
+ if (propID == kpidSize)
2966
+ {
2967
+ RINOK(GetItem(index))
2968
+ const FString fullProcessedPath = Hash_GetFullFilePath();
2969
+ NFile::NFind::CFileInfo fi;
2970
+ if (fi.Find_FollowLink(fullProcessedPath))
2971
+ if (!fi.IsDir())
2972
+ prop = (UInt64)fi.Size;
2973
+ }
2974
+ prop.Detach(value);
2975
+ return S_OK;
2976
+ COM_TRY_END
2977
+ }
2978
+
2979
+
2980
+ Z7_COM7F_IMF(CArchiveExtractCallback::GetStream2(UInt32 index, ISequentialInStream **inStream, UInt32 mode))
2981
+ {
2982
+ COM_TRY_BEGIN
2983
+ *inStream = NULL;
2984
+ // if (index != _index) return E_FAIL;
2985
+ if (mode != NUpdateNotifyOp::kHashRead)
2986
+ return E_FAIL;
2987
+
2988
+ RINOK(GetItem(index))
2989
+ const FString fullProcessedPath = Hash_GetFullFilePath();
2990
+
2991
+ CInFileStream *inStreamSpec = new CInFileStream;
2992
+ CMyComPtr<ISequentialInStream> inStreamRef = inStreamSpec;
2993
+ inStreamSpec->Set_PreserveATime(_ntOptions.PreserveATime);
2994
+ if (!inStreamSpec->OpenShared(fullProcessedPath, _ntOptions.OpenShareForWrite))
2995
+ {
2996
+ RINOK(SendMessageError_with_LastError(kCantOpenInFile, fullProcessedPath))
2997
+ return S_OK;
2998
+ }
2999
+ *inStream = inStreamRef.Detach();
3000
+ return S_OK;
3001
+ COM_TRY_END
3002
+ }
3003
+
3004
+
3005
+ Z7_COM7F_IMF(CArchiveExtractCallback::ReportOperation(
3006
+ UInt32 /* indexType */, UInt32 /* index */, UInt32 /* op */))
3007
+ {
3008
+ // COM_TRY_BEGIN
3009
+ return S_OK;
3010
+ // COM_TRY_END
3011
+ }
3012
+
3013
+
3014
+ Z7_COM7F_IMF(CArchiveExtractCallback::RequestMemoryUse(
3015
+ UInt32 flags, UInt32 indexType, UInt32 index, const wchar_t *path,
3016
+ UInt64 requiredSize, UInt64 *allowedSize, UInt32 *answerFlags))
3017
+ {
3018
+ if ((flags & NRequestMemoryUseFlags::k_IsReport) == 0)
3019
+ {
3020
+ const UInt64 memLimit = _ntOptions.MemLimit;
3021
+ if (memLimit != (UInt64)(Int64)-1)
3022
+ {
3023
+ // we overwrite allowedSize
3024
+ *allowedSize = memLimit;
3025
+ if (requiredSize <= memLimit)
3026
+ {
3027
+ *answerFlags = NRequestMemoryAnswerFlags::k_Allow;
3028
+ return S_OK;
3029
+ }
3030
+ *answerFlags = NRequestMemoryAnswerFlags::k_Limit_Exceeded;
3031
+ if (flags & NRequestMemoryUseFlags::k_SkipArc_IsExpected)
3032
+ *answerFlags |= NRequestMemoryAnswerFlags::k_SkipArc;
3033
+ flags |= NRequestMemoryUseFlags::k_SLimit_Exceeded
3034
+ | NRequestMemoryUseFlags::k_AllowedSize_WasForced;
3035
+ }
3036
+ }
3037
+
3038
+ if (!_requestMemoryUseCallback)
3039
+ {
3040
+ _extractCallback2.QueryInterface(IID_IArchiveRequestMemoryUseCallback,
3041
+ &_requestMemoryUseCallback);
3042
+ if (!_requestMemoryUseCallback)
3043
+ {
3044
+ // keep default (answerFlags) from caller or (answerFlags) that was set in this function
3045
+ return S_OK;
3046
+ }
3047
+ }
3048
+
3049
+ #if 0
3050
+ if ((flags & NRequestMemoryUseFlags::k_IsReport) == 0)
3051
+ if (requiredSize <= *allowedSize)
3052
+ {
3053
+ // it's expected, that *answerFlags was set to NRequestMemoryAnswerFlags::k_Allow already,
3054
+ // because it's default answer for (requiredSize <= *allowedSize) case.
3055
+ *answerFlags = NRequestMemoryAnswerFlags::k_Allow; // optional code
3056
+ }
3057
+ else
3058
+ {
3059
+ // we clear *answerFlags, because we want to disable dafault "Allow", if it's set.
3060
+ // *answerFlags = 0;
3061
+ /*
3062
+ NRequestMemoryAnswerFlags::k_SkipArc |
3063
+ NRequestMemoryAnswerFlags::k_Limit_Exceeded;
3064
+ */
3065
+ }
3066
+ #endif
3067
+
3068
+ UString s;
3069
+ if (!path
3070
+ && indexType == NArchive::NEventIndexType::kInArcIndex
3071
+ && index != (UInt32)(Int32)-1
3072
+ && _arc)
3073
+ {
3074
+ RINOK(_arc->GetItem_Path(index, s))
3075
+ path = s.Ptr();
3076
+ }
3077
+
3078
+ return _requestMemoryUseCallback->RequestMemoryUse(
3079
+ flags, indexType, index, path,
3080
+ requiredSize, allowedSize, answerFlags);
3081
+ }
3082
+
3083
+ #endif // Z7_SFX
3084
+
3085
+
3086
+
3087
+ // ------------ After Extracting functions ------------
3088
+
3089
+ void CDirPathSortPair::SetNumSlashes(const FChar *s)
3090
+ {
3091
+ for (unsigned numSlashes = 0;;)
3092
+ {
3093
+ FChar c = *s++;
3094
+ if (c == 0)
3095
+ {
3096
+ Len = numSlashes;
3097
+ return;
3098
+ }
3099
+ if (IS_PATH_SEPAR(c))
3100
+ numSlashes++;
3101
+ }
3102
+ }
3103
+
3104
+
3105
+ bool CFiTimesCAM::SetDirTime_to_FS(CFSTR path) const
3106
+ {
3107
+ // it's same function for dir and for file
3108
+ return NDir::SetDirTime(path,
3109
+ CTime_Defined ? &CTime : NULL,
3110
+ ATime_Defined ? &ATime : NULL,
3111
+ MTime_Defined ? &MTime : NULL);
3112
+ }
3113
+
3114
+
3115
+ #ifdef SUPPORT_LINKS
3116
+
3117
+ bool CFiTimesCAM::SetLinkFileTime_to_FS(CFSTR path) const
3118
+ {
3119
+ // it's same function for dir and for file
3120
+ return NDir::SetLinkFileTime(path,
3121
+ CTime_Defined ? &CTime : NULL,
3122
+ ATime_Defined ? &ATime : NULL,
3123
+ MTime_Defined ? &MTime : NULL);
3124
+ }
3125
+
3126
+ HRESULT CArchiveExtractCallback::SetPostLinks() const
3127
+ {
3128
+ FOR_VECTOR (i, _postLinks)
3129
+ {
3130
+ const CPostLink &link = _postLinks[i];
3131
+ bool linkWasSet = false;
3132
+ RINOK(SetLink2(*this, link, linkWasSet))
3133
+ if (linkWasSet)
3134
+ {
3135
+ // we set timestamps before SetAttrib(),
3136
+ // because windows doesn't set timestamps, if file has read-only attribute
3137
+ CFiTimesCAM pt;
3138
+ GetFiTimesCAM(link.item_FileInfo, pt, *_arc);
3139
+ if (pt.IsSomeTimeDefined())
3140
+ if (!pt.SetLinkFileTime_to_FS(link.fullProcessedPath_from))
3141
+ {
3142
+ // SendMessageError_with_LastError("cannot set timestamp", link.fullProcessedPath_from);
3143
+ }
3144
+
3145
+ #ifdef _WIN32
3146
+ SetAttrib_Base(link.fullProcessedPath_from, link.item_FileInfo, *this);
3147
+ #else
3148
+ // Linux now doesn't support permissions for symlinks.
3149
+ // We set only owner
3150
+ {
3151
+ const CProcessedFileInfo &fi = link.item_FileInfo;
3152
+ if (fi.Owner.Id_Defined && fi.Group.Id_Defined)
3153
+ {
3154
+ if (my_chown_Link(link.fullProcessedPath_from, fi.Owner.Id, fi.Group.Id) != 0)
3155
+ SendMessageError_with_LastError("Cannot set owner", link.fullProcessedPath_from);
3156
+ }
3157
+ }
3158
+ #endif
3159
+
3160
+ #ifdef Z7_USE_SECURITY_CODE
3161
+ // we set security information after timestamps setting
3162
+ RINOK(SetSecurityInfo(link.Index_in_Arc, link.fullProcessedPath_from))
3163
+ #endif
3164
+ }
3165
+ }
3166
+ return S_OK;
3167
+ }
3168
+
3169
+ #endif
3170
+
3171
+
3172
+ HRESULT CArchiveExtractCallback::SetDirsTimes()
3173
+ {
3174
+ if (!_arc)
3175
+ return S_OK;
3176
+
3177
+ CRecordVector<CDirPathSortPair> pairs;
3178
+ pairs.ClearAndSetSize(_extractedFolders.Size());
3179
+ unsigned i;
3180
+
3181
+ for (i = 0; i < _extractedFolders.Size(); i++)
3182
+ {
3183
+ CDirPathSortPair &pair = pairs[i];
3184
+ pair.Index = i;
3185
+ pair.SetNumSlashes(_extractedFolders[i].Path);
3186
+ }
3187
+
3188
+ pairs.Sort2();
3189
+
3190
+ HRESULT res = S_OK;
3191
+
3192
+ for (i = 0; i < pairs.Size(); i++)
3193
+ {
3194
+ const CDirPathTime &dpt = _extractedFolders[pairs[i].Index];
3195
+ if (!dpt.SetDirTime_to_FS_2())
3196
+ {
3197
+ // result = E_FAIL;
3198
+ // do we need error message here in Windows and in posix?
3199
+ // SendMessageError_with_LastError("Cannot set directory time", dpt.Path);
3200
+ }
3201
+ }
3202
+
3203
+ /*
3204
+ #ifndef _WIN32
3205
+ for (i = 0; i < _delayedSymLinks.Size(); i++)
3206
+ {
3207
+ const CDelayedSymLink &link = _delayedSymLinks[i];
3208
+ if (!link.Create())
3209
+ {
3210
+ if (res == S_OK)
3211
+ res = GetLastError_noZero_HRESULT();
3212
+ // res = E_FAIL;
3213
+ // do we need error message here in Windows and in posix?
3214
+ SendMessageError_with_LastError("Cannot create Symbolic Link", link._source);
3215
+ }
3216
+ }
3217
+ #endif // _WIN32
3218
+ */
3219
+
3220
+ ClearExtractedDirsInfo();
3221
+ return res;
3222
+ }
3223
+
3224
+
3225
+ HRESULT CArchiveExtractCallback::CloseArc()
3226
+ {
3227
+ // we call CloseReparseAndFile() here because we can have non-closed file in some cases?
3228
+ HRESULT res = CloseReparseAndFile();
3229
+ #ifdef SUPPORT_LINKS
3230
+ {
3231
+ const HRESULT res2 = SetPostLinks();
3232
+ if (res == S_OK)
3233
+ res = res2;
3234
+ }
3235
+ #endif
3236
+ {
3237
+ const HRESULT res2 = SetDirsTimes();
3238
+ if (res == S_OK)
3239
+ res = res2;
3240
+ }
3241
+ _arc = NULL;
3242
+ return res;
3243
+ }