├── Asm ├── arm │ └── 7zCrcOpt.asm └── x86 │ ├── 7zAsm.asm │ ├── 7zCrcOpt.asm │ ├── AesOpt.asm │ └── XzCrc64Opt.asm ├── C ├── 7z.h ├── 7zAlloc.c ├── 7zAlloc.h ├── 7zArcIn.c ├── 7zBuf.c ├── 7zBuf.h ├── 7zBuf2.c ├── 7zCrc.c ├── 7zCrc.h ├── 7zCrcOpt.c ├── 7zDec.c ├── 7zFile.c ├── 7zFile.h ├── 7zStream.c ├── 7zTypes.h ├── 7zVersion.h ├── 7zVersion.rc ├── Aes.c ├── Aes.h ├── AesOpt.c ├── Alloc.c ├── Alloc.h ├── Bcj2.c ├── Bcj2.h ├── Bcj2Enc.c ├── Blake2.h ├── Blake2s.c ├── Bra.c ├── Bra.h ├── Bra86.c ├── BraIA64.c ├── BwtSort.c ├── BwtSort.h ├── Compiler.h ├── CpuArch.c ├── CpuArch.h ├── Delta.c ├── Delta.h ├── HuffEnc.c ├── HuffEnc.h ├── LzFind.c ├── LzFind.h ├── LzFindMt.c ├── LzFindMt.h ├── LzHash.h ├── Lzma2Dec.c ├── Lzma2Dec.h ├── Lzma2Enc.c ├── Lzma2Enc.h ├── Lzma86.h ├── Lzma86Dec.c ├── Lzma86Enc.c ├── LzmaDec.c ├── LzmaDec.h ├── LzmaEnc.c ├── LzmaEnc.h ├── LzmaLib.c ├── LzmaLib.h ├── MtCoder.c ├── MtCoder.h ├── Ppmd.h ├── Ppmd7.c ├── Ppmd7.h ├── Ppmd7Dec.c ├── Ppmd7Enc.c ├── Ppmd8.c ├── Ppmd8.h ├── Ppmd8Dec.c ├── Ppmd8Enc.c ├── Precomp.h ├── RotateDefs.h ├── Sha1.c ├── Sha1.h ├── Sha256.c ├── Sha256.h ├── Sort.c ├── Sort.h ├── Threads.c ├── Threads.h ├── Util │ ├── 7z │ │ ├── 7z.dsp │ │ ├── 7z.dsw │ │ ├── 7zMain.c │ │ ├── Precomp.c │ │ ├── Precomp.h │ │ ├── makefile │ │ └── makefile.gcc │ ├── 7zipInstall │ │ ├── 7zip.ico │ │ ├── 7zipInstall.c │ │ ├── 7zipInstall.dsp │ │ ├── 7zipInstall.dsw │ │ ├── 7zipInstall.manifest │ │ ├── Precomp.c │ │ ├── Precomp.h │ │ ├── makefile │ │ ├── resource.h │ │ └── resource.rc │ ├── 7zipUninstall │ │ ├── 7zipUninstall.c │ │ ├── 7zipUninstall.dsp │ │ ├── 7zipUninstall.dsw │ │ ├── 7zipUninstall.ico │ │ ├── 7zipUninstall.manifest │ │ ├── Precomp.c │ │ ├── Precomp.h │ │ ├── makefile │ │ ├── resource.h │ │ └── resource.rc │ ├── Lzma │ │ ├── LzmaUtil.c │ │ ├── LzmaUtil.dsp │ │ ├── LzmaUtil.dsw │ │ ├── makefile │ │ └── makefile.gcc │ ├── LzmaLib │ │ ├── LzmaLib.def │ │ ├── LzmaLib.dsp │ │ ├── LzmaLib.dsw │ │ ├── LzmaLibExports.c │ │ ├── makefile │ │ └── resource.rc │ └── SfxSetup │ │ ├── Precomp.c │ │ ├── Precomp.h │ │ ├── SfxSetup.c │ │ ├── SfxSetup.dsp │ │ ├── SfxSetup.dsw │ │ ├── makefile │ │ ├── makefile_con │ │ ├── resource.rc │ │ └── setup.ico ├── Xz.c ├── Xz.h ├── XzCrc64.c ├── XzCrc64.h ├── XzCrc64Opt.c ├── XzDec.c ├── XzEnc.c ├── XzEnc.h └── XzIn.c ├── CPP ├── 7zip │ ├── 7zip.mak │ ├── Aes.mak │ ├── Archive │ │ ├── 7z │ │ │ ├── 7z.dsp │ │ │ ├── 7z.dsw │ │ │ ├── 7zCompressionMode.cpp │ │ │ ├── 7zCompressionMode.h │ │ │ ├── 7zDecode.cpp │ │ │ ├── 7zDecode.h │ │ │ ├── 7zEncode.cpp │ │ │ ├── 7zEncode.h │ │ │ ├── 7zExtract.cpp │ │ │ ├── 7zFolderInStream.cpp │ │ │ ├── 7zFolderInStream.h │ │ │ ├── 7zHandler.cpp │ │ │ ├── 7zHandler.h │ │ │ ├── 7zHandlerOut.cpp │ │ │ ├── 7zHeader.cpp │ │ │ ├── 7zHeader.h │ │ │ ├── 7zIn.cpp │ │ │ ├── 7zIn.h │ │ │ ├── 7zItem.h │ │ │ ├── 7zOut.cpp │ │ │ ├── 7zOut.h │ │ │ ├── 7zProperties.cpp │ │ │ ├── 7zProperties.h │ │ │ ├── 7zRegister.cpp │ │ │ ├── 7zSpecStream.cpp │ │ │ ├── 7zSpecStream.h │ │ │ ├── 7zUpdate.cpp │ │ │ ├── 7zUpdate.h │ │ │ ├── StdAfx.cpp │ │ │ ├── StdAfx.h │ │ │ ├── makefile │ │ │ └── resource.rc │ │ ├── ApmHandler.cpp │ │ ├── ArHandler.cpp │ │ ├── Archive.def │ │ ├── Archive2.def │ │ ├── ArchiveExports.cpp │ │ ├── ArjHandler.cpp │ │ ├── Bz2Handler.cpp │ │ ├── Cab │ │ │ ├── CabBlockInStream.cpp │ │ │ ├── CabBlockInStream.h │ │ │ ├── CabHandler.cpp │ │ │ ├── CabHandler.h │ │ │ ├── CabHeader.cpp │ │ │ ├── CabHeader.h │ │ │ ├── CabIn.cpp │ │ │ ├── CabIn.h │ │ │ ├── CabItem.h │ │ │ ├── CabRegister.cpp │ │ │ └── StdAfx.h │ │ ├── Chm │ │ │ ├── ChmHandler.cpp │ │ │ ├── ChmHandler.h │ │ │ ├── ChmIn.cpp │ │ │ ├── ChmIn.h │ │ │ └── StdAfx.h │ │ ├── ComHandler.cpp │ │ ├── Common │ │ │ ├── CoderMixer2.cpp │ │ │ ├── CoderMixer2.h │ │ │ ├── DummyOutStream.cpp │ │ │ ├── DummyOutStream.h │ │ │ ├── FindSignature.cpp │ │ │ ├── FindSignature.h │ │ │ ├── HandlerOut.cpp │ │ │ ├── HandlerOut.h │ │ │ ├── InStreamWithCRC.cpp │ │ │ ├── InStreamWithCRC.h │ │ │ ├── ItemNameUtils.cpp │ │ │ ├── ItemNameUtils.h │ │ │ ├── MultiStream.cpp │ │ │ ├── MultiStream.h │ │ │ ├── OutStreamWithCRC.cpp │ │ │ ├── OutStreamWithCRC.h │ │ │ ├── OutStreamWithSha1.cpp │ │ │ ├── OutStreamWithSha1.h │ │ │ ├── ParseProperties.cpp │ │ │ ├── ParseProperties.h │ │ │ └── StdAfx.h │ │ ├── CpioHandler.cpp │ │ ├── CramfsHandler.cpp │ │ ├── DeflateProps.cpp │ │ ├── DeflateProps.h │ │ ├── DllExports.cpp │ │ ├── DllExports2.cpp │ │ ├── DmgHandler.cpp │ │ ├── ElfHandler.cpp │ │ ├── ExtHandler.cpp │ │ ├── FatHandler.cpp │ │ ├── FlvHandler.cpp │ │ ├── GptHandler.cpp │ │ ├── GzHandler.cpp │ │ ├── HandlerCont.cpp │ │ ├── HandlerCont.h │ │ ├── HfsHandler.cpp │ │ ├── IArchive.h │ │ ├── IhexHandler.cpp │ │ ├── Iso │ │ │ ├── IsoHandler.cpp │ │ │ ├── IsoHandler.h │ │ │ ├── IsoHeader.cpp │ │ │ ├── IsoHeader.h │ │ │ ├── IsoIn.cpp │ │ │ ├── IsoIn.h │ │ │ ├── IsoItem.h │ │ │ ├── IsoRegister.cpp │ │ │ └── StdAfx.h │ │ ├── LzhHandler.cpp │ │ ├── LzmaHandler.cpp │ │ ├── MachoHandler.cpp │ │ ├── MbrHandler.cpp │ │ ├── MslzHandler.cpp │ │ ├── MubHandler.cpp │ │ ├── Nsis │ │ │ ├── NsisDecode.cpp │ │ │ ├── NsisDecode.h │ │ │ ├── NsisHandler.cpp │ │ │ ├── NsisHandler.h │ │ │ ├── NsisIn.cpp │ │ │ ├── NsisIn.h │ │ │ ├── NsisRegister.cpp │ │ │ └── StdAfx.h │ │ ├── NtfsHandler.cpp │ │ ├── PeHandler.cpp │ │ ├── PpmdHandler.cpp │ │ ├── QcowHandler.cpp │ │ ├── Rar │ │ │ ├── Rar5Handler.cpp │ │ │ ├── Rar5Handler.h │ │ │ ├── RarHandler.cpp │ │ │ ├── RarHandler.h │ │ │ ├── RarHeader.h │ │ │ ├── RarItem.h │ │ │ ├── RarVol.h │ │ │ ├── StdAfx.cpp │ │ │ └── StdAfx.h │ │ ├── RpmHandler.cpp │ │ ├── SplitHandler.cpp │ │ ├── SquashfsHandler.cpp │ │ ├── StdAfx.h │ │ ├── SwfHandler.cpp │ │ ├── Tar │ │ │ ├── StdAfx.h │ │ │ ├── TarHandler.cpp │ │ │ ├── TarHandler.h │ │ │ ├── TarHandlerOut.cpp │ │ │ ├── TarHeader.cpp │ │ │ ├── TarHeader.h │ │ │ ├── TarIn.cpp │ │ │ ├── TarIn.h │ │ │ ├── TarItem.h │ │ │ ├── TarOut.cpp │ │ │ ├── TarOut.h │ │ │ ├── TarRegister.cpp │ │ │ ├── TarUpdate.cpp │ │ │ └── TarUpdate.h │ │ ├── Udf │ │ │ ├── StdAfx.h │ │ │ ├── UdfHandler.cpp │ │ │ ├── UdfHandler.h │ │ │ ├── UdfIn.cpp │ │ │ └── UdfIn.h │ │ ├── UefiHandler.cpp │ │ ├── VdiHandler.cpp │ │ ├── VhdHandler.cpp │ │ ├── VmdkHandler.cpp │ │ ├── Wim │ │ │ ├── StdAfx.h │ │ │ ├── WimHandler.cpp │ │ │ ├── WimHandler.h │ │ │ ├── WimHandlerOut.cpp │ │ │ ├── WimIn.cpp │ │ │ ├── WimIn.h │ │ │ └── WimRegister.cpp │ │ ├── XarHandler.cpp │ │ ├── XzHandler.cpp │ │ ├── XzHandler.h │ │ ├── ZHandler.cpp │ │ ├── Zip │ │ │ ├── StdAfx.h │ │ │ ├── ZipAddCommon.cpp │ │ │ ├── ZipAddCommon.h │ │ │ ├── ZipCompressionMode.h │ │ │ ├── ZipHandler.cpp │ │ │ ├── ZipHandler.h │ │ │ ├── ZipHandlerOut.cpp │ │ │ ├── ZipHeader.h │ │ │ ├── ZipIn.cpp │ │ │ ├── ZipIn.h │ │ │ ├── ZipItem.cpp │ │ │ ├── ZipItem.h │ │ │ ├── ZipOut.cpp │ │ │ ├── ZipOut.h │ │ │ ├── ZipRegister.cpp │ │ │ ├── ZipUpdate.cpp │ │ │ └── ZipUpdate.h │ │ └── makefile │ ├── Asm.mak │ ├── Bundles │ │ └── Format7zF │ │ │ ├── Arc.mak │ │ │ ├── Format7z.sln │ │ │ ├── Format7z.vcxproj │ │ │ ├── Format7z.vcxproj.filters │ │ │ ├── StdAfx.cpp │ │ │ ├── StdAfx.h │ │ │ ├── makefile │ │ │ └── resource.rc │ ├── Common │ │ ├── CWrappers.cpp │ │ ├── CWrappers.h │ │ ├── CreateCoder.cpp │ │ ├── CreateCoder.h │ │ ├── FilePathAutoRename.cpp │ │ ├── FilePathAutoRename.h │ │ ├── FileStreams.cpp │ │ ├── FileStreams.h │ │ ├── FilterCoder.cpp │ │ ├── FilterCoder.h │ │ ├── InBuffer.cpp │ │ ├── InBuffer.h │ │ ├── InOutTempBuffer.cpp │ │ ├── InOutTempBuffer.h │ │ ├── LimitedStreams.cpp │ │ ├── LimitedStreams.h │ │ ├── LockedStream.cpp │ │ ├── LockedStream.h │ │ ├── MemBlocks.cpp │ │ ├── MemBlocks.h │ │ ├── MethodId.cpp │ │ ├── MethodId.h │ │ ├── MethodProps.cpp │ │ ├── MethodProps.h │ │ ├── OffsetStream.cpp │ │ ├── OffsetStream.h │ │ ├── OutBuffer.cpp │ │ ├── OutBuffer.h │ │ ├── OutMemStream.cpp │ │ ├── OutMemStream.h │ │ ├── ProgressMt.cpp │ │ ├── ProgressMt.h │ │ ├── ProgressUtils.cpp │ │ ├── ProgressUtils.h │ │ ├── PropId.cpp │ │ ├── RegisterArc.h │ │ ├── RegisterCodec.h │ │ ├── StdAfx.h │ │ ├── StreamBinder.cpp │ │ ├── StreamBinder.h │ │ ├── StreamObjects.cpp │ │ ├── StreamObjects.h │ │ ├── StreamUtils.cpp │ │ ├── StreamUtils.h │ │ ├── UniqBlocks.cpp │ │ ├── UniqBlocks.h │ │ ├── VirtThread.cpp │ │ └── VirtThread.h │ ├── Compress │ │ ├── BZip2Const.h │ │ ├── BZip2Crc.cpp │ │ ├── BZip2Crc.h │ │ ├── BZip2Decoder.cpp │ │ ├── BZip2Decoder.h │ │ ├── BZip2Encoder.cpp │ │ ├── BZip2Encoder.h │ │ ├── BZip2Register.cpp │ │ ├── Bcj2Coder.cpp │ │ ├── Bcj2Coder.h │ │ ├── Bcj2Register.cpp │ │ ├── BcjCoder.cpp │ │ ├── BcjCoder.h │ │ ├── BcjRegister.cpp │ │ ├── BitlDecoder.cpp │ │ ├── BitlDecoder.h │ │ ├── BitlEncoder.h │ │ ├── BitmDecoder.h │ │ ├── BitmEncoder.h │ │ ├── BranchMisc.cpp │ │ ├── BranchMisc.h │ │ ├── BranchRegister.cpp │ │ ├── ByteSwap.cpp │ │ ├── Codec.def │ │ ├── CodecExports.cpp │ │ ├── CopyCoder.cpp │ │ ├── CopyCoder.h │ │ ├── CopyRegister.cpp │ │ ├── Deflate64Register.cpp │ │ ├── DeflateConst.h │ │ ├── DeflateDecoder.cpp │ │ ├── DeflateDecoder.h │ │ ├── DeflateEncoder.cpp │ │ ├── DeflateEncoder.h │ │ ├── DeflateRegister.cpp │ │ ├── DeltaFilter.cpp │ │ ├── DllExports2Compress.cpp │ │ ├── DllExportsCompress.cpp │ │ ├── HuffmanDecoder.h │ │ ├── ImplodeDecoder.cpp │ │ ├── ImplodeDecoder.h │ │ ├── ImplodeHuffmanDecoder.cpp │ │ ├── ImplodeHuffmanDecoder.h │ │ ├── LzOutWindow.cpp │ │ ├── LzOutWindow.h │ │ ├── LzhDecoder.cpp │ │ ├── LzhDecoder.h │ │ ├── Lzma2Decoder.cpp │ │ ├── Lzma2Decoder.h │ │ ├── Lzma2Encoder.cpp │ │ ├── Lzma2Encoder.h │ │ ├── Lzma2Register.cpp │ │ ├── LzmaDecoder.cpp │ │ ├── LzmaDecoder.h │ │ ├── LzmaEncoder.cpp │ │ ├── LzmaEncoder.h │ │ ├── LzmaRegister.cpp │ │ ├── LzmsDecoder.cpp │ │ ├── LzmsDecoder.h │ │ ├── Lzx.h │ │ ├── LzxDecoder.cpp │ │ ├── LzxDecoder.h │ │ ├── Mtf8.h │ │ ├── PpmdDecoder.cpp │ │ ├── PpmdDecoder.h │ │ ├── PpmdEncoder.cpp │ │ ├── PpmdEncoder.h │ │ ├── PpmdRegister.cpp │ │ ├── PpmdZip.cpp │ │ ├── PpmdZip.h │ │ ├── QuantumDecoder.cpp │ │ ├── QuantumDecoder.h │ │ ├── Rar1Decoder.cpp │ │ ├── Rar1Decoder.h │ │ ├── Rar2Decoder.cpp │ │ ├── Rar2Decoder.h │ │ ├── Rar3Decoder.cpp │ │ ├── Rar3Decoder.h │ │ ├── Rar3Vm.cpp │ │ ├── Rar3Vm.h │ │ ├── Rar5Decoder.cpp │ │ ├── Rar5Decoder.h │ │ ├── RarCodecsRegister.cpp │ │ ├── ShrinkDecoder.cpp │ │ ├── ShrinkDecoder.h │ │ ├── StdAfx.h │ │ ├── XpressDecoder.cpp │ │ ├── XpressDecoder.h │ │ ├── ZDecoder.cpp │ │ ├── ZDecoder.h │ │ ├── ZlibDecoder.cpp │ │ ├── ZlibDecoder.h │ │ ├── ZlibEncoder.cpp │ │ ├── ZlibEncoder.h │ │ └── makefile │ ├── Crc.mak │ ├── Crc64.mak │ ├── Crypto │ │ ├── 7zAes.cpp │ │ ├── 7zAes.h │ │ ├── 7zAesRegister.cpp │ │ ├── Codec.def │ │ ├── HmacSha1.cpp │ │ ├── HmacSha1.h │ │ ├── HmacSha256.cpp │ │ ├── HmacSha256.h │ │ ├── MyAes.cpp │ │ ├── MyAes.h │ │ ├── MyAesReg.cpp │ │ ├── Pbkdf2HmacSha1.cpp │ │ ├── Pbkdf2HmacSha1.h │ │ ├── RandGen.cpp │ │ ├── RandGen.h │ │ ├── Rar20Crypto.cpp │ │ ├── Rar20Crypto.h │ │ ├── Rar5Aes.cpp │ │ ├── Rar5Aes.h │ │ ├── RarAes.cpp │ │ ├── RarAes.h │ │ ├── Sha1Cls.h │ │ ├── StdAfx.h │ │ ├── WzAes.cpp │ │ ├── WzAes.h │ │ ├── ZipCrypto.cpp │ │ ├── ZipCrypto.h │ │ ├── ZipStrong.cpp │ │ └── ZipStrong.h │ ├── GuiCommon.rc │ ├── Guid.txt │ ├── ICoder.h │ ├── IDecl.h │ ├── IPassword.h │ ├── IProgress.h │ ├── IStream.h │ ├── MyVersion.h │ ├── MyVersionInfo.rc │ ├── PropID.h │ ├── SubBuild.mak │ ├── UI │ │ ├── Agent │ │ │ ├── Agent.cpp │ │ │ ├── Agent.h │ │ │ ├── AgentOut.cpp │ │ │ ├── AgentProxy.cpp │ │ │ ├── AgentProxy.h │ │ │ ├── ArchiveFolder.cpp │ │ │ ├── ArchiveFolderOpen.cpp │ │ │ ├── ArchiveFolderOut.cpp │ │ │ ├── IFolderArchive.h │ │ │ ├── StdAfx.h │ │ │ ├── UpdateCallbackAgent.cpp │ │ │ └── UpdateCallbackAgent.h │ │ ├── Client7z │ │ │ ├── Client7z.cpp │ │ │ ├── Client7z.dsp │ │ │ ├── Client7z.dsw │ │ │ ├── StdAfx.cpp │ │ │ ├── StdAfx.h │ │ │ ├── makefile │ │ │ └── resource.rc │ │ ├── Common │ │ │ ├── ArchiveCommandLine.cpp │ │ │ ├── ArchiveCommandLine.h │ │ │ ├── ArchiveExtractCallback.cpp │ │ │ ├── ArchiveExtractCallback.h │ │ │ ├── ArchiveName.cpp │ │ │ ├── ArchiveName.h │ │ │ ├── ArchiveOpenCallback.cpp │ │ │ ├── ArchiveOpenCallback.h │ │ │ ├── Bench.cpp │ │ │ ├── Bench.h │ │ │ ├── CompressCall.cpp │ │ │ ├── CompressCall.h │ │ │ ├── CompressCall2.cpp │ │ │ ├── DefaultName.cpp │ │ │ ├── DefaultName.h │ │ │ ├── DirItem.h │ │ │ ├── EnumDirItems.cpp │ │ │ ├── EnumDirItems.h │ │ │ ├── ExitCode.h │ │ │ ├── Extract.cpp │ │ │ ├── Extract.h │ │ │ ├── ExtractMode.h │ │ │ ├── ExtractingFilePath.cpp │ │ │ ├── ExtractingFilePath.h │ │ │ ├── HashCalc.cpp │ │ │ ├── HashCalc.h │ │ │ ├── IFileExtractCallback.h │ │ │ ├── LoadCodecs.cpp │ │ │ ├── LoadCodecs.h │ │ │ ├── OpenArchive.cpp │ │ │ ├── OpenArchive.h │ │ │ ├── PropIDUtils.cpp │ │ │ ├── PropIDUtils.h │ │ │ ├── Property.h │ │ │ ├── SetProperties.cpp │ │ │ ├── SetProperties.h │ │ │ ├── SortUtils.cpp │ │ │ ├── SortUtils.h │ │ │ ├── StdAfx.h │ │ │ ├── TempFiles.cpp │ │ │ ├── TempFiles.h │ │ │ ├── Update.cpp │ │ │ ├── Update.h │ │ │ ├── UpdateAction.cpp │ │ │ ├── UpdateAction.h │ │ │ ├── UpdateCallback.cpp │ │ │ ├── UpdateCallback.h │ │ │ ├── UpdatePair.cpp │ │ │ ├── UpdatePair.h │ │ │ ├── UpdateProduce.cpp │ │ │ ├── UpdateProduce.h │ │ │ ├── WorkDir.cpp │ │ │ ├── WorkDir.h │ │ │ ├── ZipRegistry.cpp │ │ │ └── ZipRegistry.h │ │ ├── Console │ │ │ ├── BenchCon.cpp │ │ │ ├── BenchCon.h │ │ │ ├── Console.dsp │ │ │ ├── Console.dsw │ │ │ ├── Console.mak │ │ │ ├── ConsoleClose.cpp │ │ │ ├── ConsoleClose.h │ │ │ ├── ExtractCallbackConsole.cpp │ │ │ ├── ExtractCallbackConsole.h │ │ │ ├── HashCon.cpp │ │ │ ├── HashCon.h │ │ │ ├── List.cpp │ │ │ ├── List.h │ │ │ ├── Main.cpp │ │ │ ├── MainAr.cpp │ │ │ ├── OpenCallbackConsole.cpp │ │ │ ├── OpenCallbackConsole.h │ │ │ ├── PercentPrinter.cpp │ │ │ ├── PercentPrinter.h │ │ │ ├── StdAfx.cpp │ │ │ ├── StdAfx.h │ │ │ ├── UpdateCallbackConsole.cpp │ │ │ ├── UpdateCallbackConsole.h │ │ │ ├── UserInputUtils.cpp │ │ │ ├── UserInputUtils.h │ │ │ ├── makefile │ │ │ └── resource.rc │ │ ├── Explorer │ │ │ ├── 7-zip.dll.manifest │ │ │ ├── ContextMenu.cpp │ │ │ ├── ContextMenu.h │ │ │ ├── ContextMenuFlags.h │ │ │ ├── DllExportsExplorer.cpp │ │ │ ├── Explorer.def │ │ │ ├── Explorer.dsp │ │ │ ├── Explorer.dsw │ │ │ ├── MenuLogo.bmp │ │ │ ├── MyMessages.cpp │ │ │ ├── MyMessages.h │ │ │ ├── RegistryContextMenu.cpp │ │ │ ├── RegistryContextMenu.h │ │ │ ├── StdAfx.cpp │ │ │ ├── StdAfx.h │ │ │ ├── makefile │ │ │ ├── resource.h │ │ │ ├── resource.rc │ │ │ └── resource2.rc │ │ ├── Far │ │ │ ├── ExtractEngine.cpp │ │ │ ├── ExtractEngine.h │ │ │ ├── Far.cpp │ │ │ ├── Far.def │ │ │ ├── Far.dsp │ │ │ ├── Far.dsw │ │ │ ├── FarPlugin.h │ │ │ ├── FarUtils.cpp │ │ │ ├── FarUtils.h │ │ │ ├── Messages.h │ │ │ ├── OverwriteDialogFar.cpp │ │ │ ├── OverwriteDialogFar.h │ │ │ ├── Plugin.cpp │ │ │ ├── Plugin.h │ │ │ ├── PluginCommon.cpp │ │ │ ├── PluginDelete.cpp │ │ │ ├── PluginRead.cpp │ │ │ ├── PluginWrite.cpp │ │ │ ├── ProgressBox.cpp │ │ │ ├── ProgressBox.h │ │ │ ├── StdAfx.cpp │ │ │ ├── StdAfx.h │ │ │ ├── UpdateCallbackFar.cpp │ │ │ ├── UpdateCallbackFar.h │ │ │ ├── makefile │ │ │ └── resource.rc │ │ ├── FileManager │ │ │ ├── 7zFM.exe.manifest │ │ │ ├── 7zipLogo.ico │ │ │ ├── AboutDialog.cpp │ │ │ ├── AboutDialog.h │ │ │ ├── AboutDialog.rc │ │ │ ├── AboutDialogRes.h │ │ │ ├── Add.bmp │ │ │ ├── Add2.bmp │ │ │ ├── AltStreamsFolder.cpp │ │ │ ├── AltStreamsFolder.h │ │ │ ├── App.cpp │ │ │ ├── App.h │ │ │ ├── AppState.h │ │ │ ├── BrowseDialog.cpp │ │ │ ├── BrowseDialog.h │ │ │ ├── BrowseDialog.rc │ │ │ ├── BrowseDialogRes.h │ │ │ ├── ClassDefs.cpp │ │ │ ├── ComboDialog.cpp │ │ │ ├── ComboDialog.h │ │ │ ├── ComboDialog.rc │ │ │ ├── ComboDialogRes.h │ │ │ ├── Copy.bmp │ │ │ ├── Copy2.bmp │ │ │ ├── CopyDialog.cpp │ │ │ ├── CopyDialog.h │ │ │ ├── CopyDialog.rc │ │ │ ├── CopyDialogRes.h │ │ │ ├── Delete.bmp │ │ │ ├── Delete2.bmp │ │ │ ├── DialogSize.h │ │ │ ├── EditPage.cpp │ │ │ ├── EditPage.h │ │ │ ├── EditPage.rc │ │ │ ├── EditPage2.rc │ │ │ ├── EditPageRes.h │ │ │ ├── EnumFormatEtc.cpp │ │ │ ├── EnumFormatEtc.h │ │ │ ├── Extract.bmp │ │ │ ├── Extract2.bmp │ │ │ ├── ExtractCallback.cpp │ │ │ ├── ExtractCallback.h │ │ │ ├── FM.cpp │ │ │ ├── FM.dsp │ │ │ ├── FM.dsw │ │ │ ├── FM.ico │ │ │ ├── FM.mak │ │ │ ├── FSDrives.cpp │ │ │ ├── FSDrives.h │ │ │ ├── FSFolder.cpp │ │ │ ├── FSFolder.h │ │ │ ├── FSFolderCopy.cpp │ │ │ ├── FileFolderPluginOpen.cpp │ │ │ ├── FileFolderPluginOpen.h │ │ │ ├── FilePlugins.cpp │ │ │ ├── FilePlugins.h │ │ │ ├── FoldersPage.cpp │ │ │ ├── FoldersPage.h │ │ │ ├── FoldersPage.rc │ │ │ ├── FoldersPage2.rc │ │ │ ├── FoldersPageRes.h │ │ │ ├── FormatUtils.cpp │ │ │ ├── FormatUtils.h │ │ │ ├── HelpUtils.cpp │ │ │ ├── HelpUtils.h │ │ │ ├── IFolder.h │ │ │ ├── Info.bmp │ │ │ ├── Info2.bmp │ │ │ ├── LangPage.cpp │ │ │ ├── LangPage.h │ │ │ ├── LangPage.rc │ │ │ ├── LangPageRes.h │ │ │ ├── LangUtils.cpp │ │ │ ├── LangUtils.h │ │ │ ├── LinkDialog.cpp │ │ │ ├── LinkDialog.h │ │ │ ├── LinkDialog.rc │ │ │ ├── LinkDialogRes.h │ │ │ ├── ListViewDialog.cpp │ │ │ ├── ListViewDialog.h │ │ │ ├── ListViewDialog.rc │ │ │ ├── ListViewDialogRes.h │ │ │ ├── MenuPage.cpp │ │ │ ├── MenuPage.h │ │ │ ├── MenuPage.rc │ │ │ ├── MenuPage2.rc │ │ │ ├── MenuPageRes.h │ │ │ ├── MessagesDialog.cpp │ │ │ ├── MessagesDialog.h │ │ │ ├── MessagesDialog.rc │ │ │ ├── MessagesDialogRes.h │ │ │ ├── Move.bmp │ │ │ ├── Move2.bmp │ │ │ ├── MyCom2.h │ │ │ ├── MyLoadMenu.cpp │ │ │ ├── MyLoadMenu.h │ │ │ ├── MyWindowsNew.h │ │ │ ├── NetFolder.cpp │ │ │ ├── NetFolder.h │ │ │ ├── OpenCallback.cpp │ │ │ ├── OpenCallback.h │ │ │ ├── OptionsDialog.cpp │ │ │ ├── OverwriteDialog.cpp │ │ │ ├── OverwriteDialog.h │ │ │ ├── OverwriteDialog.rc │ │ │ ├── OverwriteDialogRes.h │ │ │ ├── Panel.cpp │ │ │ ├── Panel.h │ │ │ ├── PanelCopy.cpp │ │ │ ├── PanelCrc.cpp │ │ │ ├── PanelDrag.cpp │ │ │ ├── PanelFolderChange.cpp │ │ │ ├── PanelItemOpen.cpp │ │ │ ├── PanelItems.cpp │ │ │ ├── PanelKey.cpp │ │ │ ├── PanelListNotify.cpp │ │ │ ├── PanelMenu.cpp │ │ │ ├── PanelOperations.cpp │ │ │ ├── PanelSelect.cpp │ │ │ ├── PanelSort.cpp │ │ │ ├── PanelSplitFile.cpp │ │ │ ├── PasswordDialog.cpp │ │ │ ├── PasswordDialog.h │ │ │ ├── PasswordDialog.rc │ │ │ ├── PasswordDialogRes.h │ │ │ ├── PluginInterface.h │ │ │ ├── PluginLoader.h │ │ │ ├── ProgramLocation.cpp │ │ │ ├── ProgramLocation.h │ │ │ ├── ProgressDialog.cpp │ │ │ ├── ProgressDialog.h │ │ │ ├── ProgressDialog.rc │ │ │ ├── ProgressDialog2.cpp │ │ │ ├── ProgressDialog2.h │ │ │ ├── ProgressDialog2.rc │ │ │ ├── ProgressDialog2Res.h │ │ │ ├── ProgressDialog2a.rc │ │ │ ├── ProgressDialogRes.h │ │ │ ├── PropertyName.cpp │ │ │ ├── PropertyName.h │ │ │ ├── PropertyName.rc │ │ │ ├── PropertyNameRes.h │ │ │ ├── RegistryAssociations.cpp │ │ │ ├── RegistryAssociations.h │ │ │ ├── RegistryPlugins.cpp │ │ │ ├── RegistryPlugins.h │ │ │ ├── RegistryUtils.cpp │ │ │ ├── RegistryUtils.h │ │ │ ├── RootFolder.cpp │ │ │ ├── RootFolder.h │ │ │ ├── SettingsPage.cpp │ │ │ ├── SettingsPage.h │ │ │ ├── SettingsPage.rc │ │ │ ├── SettingsPage2.rc │ │ │ ├── SettingsPageRes.h │ │ │ ├── SplitDialog.cpp │ │ │ ├── SplitDialog.h │ │ │ ├── SplitDialog.rc │ │ │ ├── SplitDialogRes.h │ │ │ ├── SplitUtils.cpp │ │ │ ├── SplitUtils.h │ │ │ ├── StdAfx.cpp │ │ │ ├── StdAfx.h │ │ │ ├── StringUtils.cpp │ │ │ ├── StringUtils.h │ │ │ ├── SysIconUtils.cpp │ │ │ ├── SysIconUtils.h │ │ │ ├── SystemPage.cpp │ │ │ ├── SystemPage.h │ │ │ ├── SystemPage.rc │ │ │ ├── SystemPageRes.h │ │ │ ├── Test.bmp │ │ │ ├── Test2.bmp │ │ │ ├── TextPairs.cpp │ │ │ ├── TextPairs.h │ │ │ ├── UpdateCallback100.cpp │ │ │ ├── UpdateCallback100.h │ │ │ ├── ViewSettings.cpp │ │ │ ├── ViewSettings.h │ │ │ ├── makefile │ │ │ ├── resource.h │ │ │ ├── resource.rc │ │ │ ├── resourceGui.h │ │ │ └── resourceGui.rc │ │ ├── GUI │ │ │ ├── 7zG.exe.manifest │ │ │ ├── BenchmarkDialog.cpp │ │ │ ├── BenchmarkDialog.h │ │ │ ├── BenchmarkDialog.rc │ │ │ ├── BenchmarkDialogRes.h │ │ │ ├── CompressDialog.cpp │ │ │ ├── CompressDialog.h │ │ │ ├── CompressDialog.rc │ │ │ ├── CompressDialogRes.h │ │ │ ├── Extract.rc │ │ │ ├── ExtractDialog.cpp │ │ │ ├── ExtractDialog.h │ │ │ ├── ExtractDialog.rc │ │ │ ├── ExtractDialogRes.h │ │ │ ├── ExtractGUI.cpp │ │ │ ├── ExtractGUI.h │ │ │ ├── ExtractRes.h │ │ │ ├── FM.ico │ │ │ ├── GUI.cpp │ │ │ ├── GUI.dsp │ │ │ ├── GUI.dsw │ │ │ ├── HashGUI.cpp │ │ │ ├── HashGUI.h │ │ │ ├── StdAfx.cpp │ │ │ ├── StdAfx.h │ │ │ ├── UpdateCallbackGUI.cpp │ │ │ ├── UpdateCallbackGUI.h │ │ │ ├── UpdateCallbackGUI2.cpp │ │ │ ├── UpdateCallbackGUI2.h │ │ │ ├── UpdateGUI.cpp │ │ │ ├── UpdateGUI.h │ │ │ ├── makefile │ │ │ ├── resource.rc │ │ │ ├── resource2.h │ │ │ ├── resource2.rc │ │ │ ├── resource3.h │ │ │ └── resource3.rc │ │ └── makefile │ └── makefile ├── Build.mak ├── Common │ ├── AutoPtr.h │ ├── CRC.cpp │ ├── C_FileIO.cpp │ ├── C_FileIO.h │ ├── ComTry.h │ ├── CommandLineParser.cpp │ ├── CommandLineParser.h │ ├── Common.h │ ├── CrcReg.cpp │ ├── Defs.h │ ├── DynLimBuf.cpp │ ├── DynLimBuf.h │ ├── DynamicBuffer.h │ ├── IntToString.cpp │ ├── IntToString.h │ ├── Lang.cpp │ ├── Lang.h │ ├── ListFileUtils.cpp │ ├── ListFileUtils.h │ ├── MyBuffer.h │ ├── MyCom.h │ ├── MyException.h │ ├── MyGuidDef.h │ ├── MyInitGuid.h │ ├── MyLinux.h │ ├── MyMap.cpp │ ├── MyMap.h │ ├── MyString.cpp │ ├── MyString.h │ ├── MyTypes.h │ ├── MyUnknown.h │ ├── MyVector.cpp │ ├── MyVector.h │ ├── MyWindows.cpp │ ├── MyWindows.h │ ├── MyXml.cpp │ ├── MyXml.h │ ├── NewHandler.cpp │ ├── NewHandler.h │ ├── Random.cpp │ ├── Random.h │ ├── Sha1Reg.cpp │ ├── Sha256Reg.cpp │ ├── StdAfx.h │ ├── StdInStream.cpp │ ├── StdInStream.h │ ├── StdOutStream.cpp │ ├── StdOutStream.h │ ├── StringConvert.cpp │ ├── StringConvert.h │ ├── StringToInt.cpp │ ├── StringToInt.h │ ├── TextConfig.cpp │ ├── TextConfig.h │ ├── UTFConvert.cpp │ ├── UTFConvert.h │ ├── Wildcard.cpp │ ├── Wildcard.h │ └── XzCrc64Reg.cpp └── Windows │ ├── COM.cpp │ ├── COM.h │ ├── Clipboard.cpp │ ├── Clipboard.h │ ├── CommonDialog.cpp │ ├── CommonDialog.h │ ├── Console.cpp │ ├── Console.h │ ├── Control │ ├── ComboBox.cpp │ ├── ComboBox.h │ ├── CommandBar.h │ ├── Dialog.cpp │ ├── Dialog.h │ ├── Edit.h │ ├── ImageList.cpp │ ├── ImageList.h │ ├── ListView.cpp │ ├── ListView.h │ ├── ProgressBar.h │ ├── PropertyPage.cpp │ ├── PropertyPage.h │ ├── ReBar.h │ ├── Static.h │ ├── StatusBar.h │ ├── StdAfx.h │ ├── ToolBar.h │ ├── Trackbar.h │ ├── Window2.cpp │ └── Window2.h │ ├── DLL.cpp │ ├── DLL.h │ ├── Defs.h │ ├── ErrorMsg.cpp │ ├── ErrorMsg.h │ ├── FileDir.cpp │ ├── FileDir.h │ ├── FileFind.cpp │ ├── FileFind.h │ ├── FileIO.cpp │ ├── FileIO.h │ ├── FileLink.cpp │ ├── FileMapping.cpp │ ├── FileMapping.h │ ├── FileName.cpp │ ├── FileName.h │ ├── FileSystem.cpp │ ├── FileSystem.h │ ├── Handle.h │ ├── MemoryGlobal.cpp │ ├── MemoryGlobal.h │ ├── MemoryLock.cpp │ ├── MemoryLock.h │ ├── Menu.cpp │ ├── Menu.h │ ├── NationalTime.cpp │ ├── NationalTime.h │ ├── Net.cpp │ ├── Net.h │ ├── NtCheck.h │ ├── ProcessMessages.cpp │ ├── ProcessMessages.h │ ├── ProcessUtils.cpp │ ├── ProcessUtils.h │ ├── PropVariant.cpp │ ├── PropVariant.h │ ├── PropVariantConv.cpp │ ├── PropVariantConv.h │ ├── PropVariantUtils.cpp │ ├── PropVariantUtils.h │ ├── Registry.cpp │ ├── Registry.h │ ├── ResourceString.cpp │ ├── ResourceString.h │ ├── SecurityUtils.cpp │ ├── SecurityUtils.h │ ├── Shell.cpp │ ├── Shell.h │ ├── StdAfx.h │ ├── Synchronization.cpp │ ├── Synchronization.h │ ├── System.cpp │ ├── System.h │ ├── Thread.h │ ├── TimeUtils.cpp │ ├── TimeUtils.h │ ├── Window.cpp │ └── Window.h ├── DOC ├── 7zC.txt ├── 7zFormat.txt ├── 7zip.hhp ├── 7zip.inf ├── 7zip.nsi ├── 7zip.wxs ├── License.txt ├── Methods.txt ├── copying.txt ├── lzma.txt ├── readme.txt ├── src-history.txt └── unRarLicense.txt ├── SevenZip.sln ├── SevenZip ├── ArchiveExtractCallback.cpp ├── ArchiveExtractCallback.h ├── ArchiveOpenCallback.cpp ├── ArchiveOpenCallback.h ├── ArchiveUpdateCallback.cpp ├── ArchiveUpdateCallback.h ├── CompressionFormat.h ├── CompressionLevel.h ├── Enum.h ├── FileInfo.h ├── FileSys.cpp ├── FileSys.h ├── GUIDs.cpp ├── GUIDs.h ├── InStreamWrapper.cpp ├── InStreamWrapper.h ├── ListCallback.h ├── OutStreamWrapper.cpp ├── OutStreamWrapper.h ├── PathScanner.cpp ├── PathScanner.h ├── ProgressCallback.h ├── PropVariant2.cpp ├── PropVariant2.h ├── SevenString.h ├── SevenZipArchive.cpp ├── SevenZipArchive.h ├── SevenZipCompressor.cpp ├── SevenZipCompressor.h ├── SevenZipException.cpp ├── SevenZipException.h ├── SevenZipExtractor.cpp ├── SevenZipExtractor.h ├── SevenZipLibrary.cpp ├── SevenZipLibrary.h ├── SevenZipLister.cpp ├── SevenZipLister.h ├── UsefulFunctions.cpp └── UsefulFunctions.h ├── StdAfx.cpp ├── StdAfx.h ├── include ├── 7zpp.h ├── 7zppMD.h ├── 7zppMT-ExactOnly.h └── 7zppMT.h ├── lib7zMD.vcxproj ├── lib7zMD.vcxproj.filters ├── lib7zMT-ExactOnly.vcxproj ├── lib7zMT-ExactOnly.vcxproj.filters ├── lib7zMT.vcxproj ├── lib7zMT.vcxproj.filters ├── targetver.h └── test ├── ReadMe.txt ├── stdafx.cpp ├── stdafx.h ├── targetver.h ├── test.cpp ├── test.vcxproj └── test.vcxproj.filters /C/7zAlloc.h: -------------------------------------------------------------------------------- 1 | /* 7zAlloc.h -- Allocation functions 2 | 2013-03-25 : Igor Pavlov : Public domain */ 3 | 4 | #ifndef __7Z_ALLOC_H 5 | #define __7Z_ALLOC_H 6 | 7 | #include 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | void *SzAlloc(void *p, size_t size); 14 | void SzFree(void *p, void *address); 15 | 16 | void *SzAllocTemp(void *p, size_t size); 17 | void SzFreeTemp(void *p, void *address); 18 | 19 | #ifdef __cplusplus 20 | } 21 | #endif 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /C/7zBuf.c: -------------------------------------------------------------------------------- 1 | /* 7zBuf.c -- Byte Buffer 2 | 2013-01-21 : Igor Pavlov : Public domain */ 3 | 4 | #include "Precomp.h" 5 | 6 | #include "7zBuf.h" 7 | 8 | void Buf_Init(CBuf *p) 9 | { 10 | p->data = 0; 11 | p->size = 0; 12 | } 13 | 14 | int Buf_Create(CBuf *p, size_t size, ISzAlloc *alloc) 15 | { 16 | p->size = 0; 17 | if (size == 0) 18 | { 19 | p->data = 0; 20 | return 1; 21 | } 22 | p->data = (Byte *)alloc->Alloc(alloc, size); 23 | if (p->data != 0) 24 | { 25 | p->size = size; 26 | return 1; 27 | } 28 | return 0; 29 | } 30 | 31 | void Buf_Free(CBuf *p, ISzAlloc *alloc) 32 | { 33 | alloc->Free(alloc, p->data); 34 | p->data = 0; 35 | p->size = 0; 36 | } 37 | -------------------------------------------------------------------------------- /C/7zBuf.h: -------------------------------------------------------------------------------- 1 | /* 7zBuf.h -- Byte Buffer 2 | 2013-01-18 : Igor Pavlov : Public domain */ 3 | 4 | #ifndef __7Z_BUF_H 5 | #define __7Z_BUF_H 6 | 7 | #include "7zTypes.h" 8 | 9 | EXTERN_C_BEGIN 10 | 11 | typedef struct 12 | { 13 | Byte *data; 14 | size_t size; 15 | } CBuf; 16 | 17 | void Buf_Init(CBuf *p); 18 | int Buf_Create(CBuf *p, size_t size, ISzAlloc *alloc); 19 | void Buf_Free(CBuf *p, ISzAlloc *alloc); 20 | 21 | typedef struct 22 | { 23 | Byte *data; 24 | size_t size; 25 | size_t pos; 26 | } CDynBuf; 27 | 28 | void DynBuf_Construct(CDynBuf *p); 29 | void DynBuf_SeekToBeg(CDynBuf *p); 30 | int DynBuf_Write(CDynBuf *p, const Byte *buf, size_t size, ISzAlloc *alloc); 31 | void DynBuf_Free(CDynBuf *p, ISzAlloc *alloc); 32 | 33 | EXTERN_C_END 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /C/7zCrc.h: -------------------------------------------------------------------------------- 1 | /* 7zCrc.h -- CRC32 calculation 2 | 2013-01-18 : Igor Pavlov : Public domain */ 3 | 4 | #ifndef __7Z_CRC_H 5 | #define __7Z_CRC_H 6 | 7 | #include "7zTypes.h" 8 | 9 | EXTERN_C_BEGIN 10 | 11 | extern UInt32 g_CrcTable[]; 12 | 13 | /* Call CrcGenerateTable one time before other CRC functions */ 14 | void MY_FAST_CALL CrcGenerateTable(void); 15 | 16 | #define CRC_INIT_VAL 0xFFFFFFFF 17 | #define CRC_GET_DIGEST(crc) ((crc) ^ CRC_INIT_VAL) 18 | #define CRC_UPDATE_BYTE(crc, b) (g_CrcTable[((crc) ^ (b)) & 0xFF] ^ ((crc) >> 8)) 19 | 20 | UInt32 MY_FAST_CALL CrcUpdate(UInt32 crc, const void *data, size_t size); 21 | UInt32 MY_FAST_CALL CrcCalc(const void *data, size_t size); 22 | 23 | EXTERN_C_END 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /C/7zVersion.h: -------------------------------------------------------------------------------- 1 | #define MY_VER_MAJOR 15 2 | #define MY_VER_MINOR 14 3 | #define MY_VER_BUILD 0 4 | #define MY_VERSION_NUMBERS "15.14" 5 | #define MY_VERSION "15.14" 6 | #define MY_DATE "2015-12-31" 7 | #undef MY_COPYRIGHT 8 | #undef MY_VERSION_COPYRIGHT_DATE 9 | #define MY_AUTHOR_NAME "Igor Pavlov" 10 | #define MY_COPYRIGHT_PD "Igor Pavlov : Public domain" 11 | #define MY_COPYRIGHT_CR "Copyright (c) 1999-2015 Igor Pavlov" 12 | 13 | #ifdef USE_COPYRIGHT_CR 14 | #define MY_COPYRIGHT MY_COPYRIGHT_CR 15 | #else 16 | #define MY_COPYRIGHT MY_COPYRIGHT_PD 17 | #endif 18 | 19 | #define MY_VERSION_COPYRIGHT_DATE MY_VERSION " : " MY_COPYRIGHT " : " MY_DATE 20 | -------------------------------------------------------------------------------- /C/Alloc.h: -------------------------------------------------------------------------------- 1 | /* Alloc.h -- Memory allocation functions 2 | 2015-02-21 : Igor Pavlov : Public domain */ 3 | 4 | #ifndef __COMMON_ALLOC_H 5 | #define __COMMON_ALLOC_H 6 | 7 | #include "7zTypes.h" 8 | 9 | EXTERN_C_BEGIN 10 | 11 | void *MyAlloc(size_t size); 12 | void MyFree(void *address); 13 | 14 | #ifdef _WIN32 15 | 16 | void SetLargePageSize(); 17 | 18 | void *MidAlloc(size_t size); 19 | void MidFree(void *address); 20 | void *BigAlloc(size_t size); 21 | void BigFree(void *address); 22 | 23 | #else 24 | 25 | #define MidAlloc(size) MyAlloc(size) 26 | #define MidFree(address) MyFree(address) 27 | #define BigAlloc(size) MyAlloc(size) 28 | #define BigFree(address) MyFree(address) 29 | 30 | #endif 31 | 32 | extern ISzAlloc g_Alloc; 33 | extern ISzAlloc g_BigAlloc; 34 | 35 | EXTERN_C_END 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /C/BwtSort.h: -------------------------------------------------------------------------------- 1 | /* BwtSort.h -- BWT block sorting 2 | 2013-01-18 : Igor Pavlov : Public domain */ 3 | 4 | #ifndef __BWT_SORT_H 5 | #define __BWT_SORT_H 6 | 7 | #include "7zTypes.h" 8 | 9 | EXTERN_C_BEGIN 10 | 11 | /* use BLOCK_SORT_EXTERNAL_FLAGS if blockSize can be > 1M */ 12 | /* #define BLOCK_SORT_EXTERNAL_FLAGS */ 13 | 14 | #ifdef BLOCK_SORT_EXTERNAL_FLAGS 15 | #define BLOCK_SORT_EXTERNAL_SIZE(blockSize) ((((blockSize) + 31) >> 5)) 16 | #else 17 | #define BLOCK_SORT_EXTERNAL_SIZE(blockSize) 0 18 | #endif 19 | 20 | #define BLOCK_SORT_BUF_SIZE(blockSize) ((blockSize) * 2 + BLOCK_SORT_EXTERNAL_SIZE(blockSize) + (1 << 16)) 21 | 22 | UInt32 BlockSort(UInt32 *indices, const Byte *data, UInt32 blockSize); 23 | 24 | EXTERN_C_END 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /C/Delta.h: -------------------------------------------------------------------------------- 1 | /* Delta.h -- Delta converter 2 | 2013-01-18 : Igor Pavlov : Public domain */ 3 | 4 | #ifndef __DELTA_H 5 | #define __DELTA_H 6 | 7 | #include "7zTypes.h" 8 | 9 | EXTERN_C_BEGIN 10 | 11 | #define DELTA_STATE_SIZE 256 12 | 13 | void Delta_Init(Byte *state); 14 | void Delta_Encode(Byte *state, unsigned delta, Byte *data, SizeT size); 15 | void Delta_Decode(Byte *state, unsigned delta, Byte *data, SizeT size); 16 | 17 | EXTERN_C_END 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /C/HuffEnc.h: -------------------------------------------------------------------------------- 1 | /* HuffEnc.h -- Huffman encoding 2 | 2013-01-18 : Igor Pavlov : Public domain */ 3 | 4 | #ifndef __HUFF_ENC_H 5 | #define __HUFF_ENC_H 6 | 7 | #include "7zTypes.h" 8 | 9 | EXTERN_C_BEGIN 10 | 11 | /* 12 | Conditions: 13 | num <= 1024 = 2 ^ NUM_BITS 14 | Sum(freqs) < 4M = 2 ^ (32 - NUM_BITS) 15 | maxLen <= 16 = kMaxLen 16 | Num_Items(p) >= HUFFMAN_TEMP_SIZE(num) 17 | */ 18 | 19 | void Huffman_Generate(const UInt32 *freqs, UInt32 *p, Byte *lens, UInt32 num, UInt32 maxLen); 20 | 21 | EXTERN_C_END 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /C/Precomp.h: -------------------------------------------------------------------------------- 1 | /* Precomp.h -- StdAfx 2 | 2013-11-12 : Igor Pavlov : Public domain */ 3 | 4 | #ifndef __7Z_PRECOMP_H 5 | #define __7Z_PRECOMP_H 6 | 7 | #include "Compiler.h" 8 | /* #include "7zTypes.h" */ 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /C/RotateDefs.h: -------------------------------------------------------------------------------- 1 | /* RotateDefs.h -- Rotate functions 2 | 2015-03-25 : Igor Pavlov : Public domain */ 3 | 4 | #ifndef __ROTATE_DEFS_H 5 | #define __ROTATE_DEFS_H 6 | 7 | #ifdef _MSC_VER 8 | 9 | #include 10 | 11 | /* don't use _rotl with MINGW. It can insert slow call to function. */ 12 | 13 | /* #if (_MSC_VER >= 1200) */ 14 | #pragma intrinsic(_rotl) 15 | #pragma intrinsic(_rotr) 16 | /* #endif */ 17 | 18 | #define rotlFixed(x, n) _rotl((x), (n)) 19 | #define rotrFixed(x, n) _rotr((x), (n)) 20 | 21 | #else 22 | 23 | /* new compilers can translate these macros to fast commands. */ 24 | 25 | #define rotlFixed(x, n) (((x) << (n)) | ((x) >> (32 - (n)))) 26 | #define rotrFixed(x, n) (((x) >> (n)) | ((x) << (32 - (n)))) 27 | 28 | #endif 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /C/Sha256.h: -------------------------------------------------------------------------------- 1 | /* Sha256.h -- SHA-256 Hash 2 | 2013-01-18 : Igor Pavlov : Public domain */ 3 | 4 | #ifndef __CRYPTO_SHA256_H 5 | #define __CRYPTO_SHA256_H 6 | 7 | #include "7zTypes.h" 8 | 9 | EXTERN_C_BEGIN 10 | 11 | #define SHA256_DIGEST_SIZE 32 12 | 13 | typedef struct 14 | { 15 | UInt32 state[8]; 16 | UInt64 count; 17 | Byte buffer[64]; 18 | } CSha256; 19 | 20 | void Sha256_Init(CSha256 *p); 21 | void Sha256_Update(CSha256 *p, const Byte *data, size_t size); 22 | void Sha256_Final(CSha256 *p, Byte *digest); 23 | 24 | EXTERN_C_END 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /C/Sort.h: -------------------------------------------------------------------------------- 1 | /* Sort.h -- Sort functions 2 | 2014-04-05 : Igor Pavlov : Public domain */ 3 | 4 | #ifndef __7Z_SORT_H 5 | #define __7Z_SORT_H 6 | 7 | #include "7zTypes.h" 8 | 9 | EXTERN_C_BEGIN 10 | 11 | void HeapSort(UInt32 *p, size_t size); 12 | void HeapSort64(UInt64 *p, size_t size); 13 | 14 | /* void HeapSortRef(UInt32 *p, UInt32 *vals, size_t size); */ 15 | 16 | EXTERN_C_END 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /C/Util/7z/7z.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 6.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "7z"=.\7z.dsp - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | }}} 15 | 16 | ############################################################################### 17 | 18 | Global: 19 | 20 | Package=<5> 21 | {{{ 22 | }}} 23 | 24 | Package=<3> 25 | {{{ 26 | }}} 27 | 28 | ############################################################################### 29 | 30 | -------------------------------------------------------------------------------- /C/Util/7z/Precomp.c: -------------------------------------------------------------------------------- 1 | /* Precomp.c -- StdAfx 2 | 2013-01-21 : Igor Pavlov : Public domain */ 3 | 4 | #include "Precomp.h" 5 | -------------------------------------------------------------------------------- /C/Util/7z/Precomp.h: -------------------------------------------------------------------------------- 1 | /* Precomp.h -- StdAfx 2 | 2013-06-16 : Igor Pavlov : Public domain */ 3 | 4 | #ifndef __7Z_PRECOMP_H 5 | #define __7Z_PRECOMP_H 6 | 7 | #include "../../Compiler.h" 8 | #include "../../7zTypes.h" 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /C/Util/7z/makefile: -------------------------------------------------------------------------------- 1 | CFLAGS = $(CFLAGS) -D_7ZIP_PPMD_SUPPPORT 2 | 3 | PROG = 7zDec.exe 4 | 5 | C_OBJS = \ 6 | $O\7zAlloc.obj \ 7 | $O\7zBuf.obj \ 8 | $O\7zCrc.obj \ 9 | $O\7zCrcOpt.obj \ 10 | $O\7zFile.obj \ 11 | $O\7zDec.obj \ 12 | $O\7zArcIn.obj \ 13 | $O\7zStream.obj \ 14 | $O\Bcj2.obj \ 15 | $O\Bra.obj \ 16 | $O\Bra86.obj \ 17 | $O\BraIA64.obj \ 18 | $O\CpuArch.obj \ 19 | $O\Delta.obj \ 20 | $O\Lzma2Dec.obj \ 21 | $O\LzmaDec.obj \ 22 | $O\Ppmd7.obj \ 23 | $O\Ppmd7Dec.obj \ 24 | 25 | 7Z_OBJS = \ 26 | $O\7zMain.obj \ 27 | 28 | OBJS = \ 29 | $O\Precomp.obj \ 30 | $(7Z_OBJS) \ 31 | $(C_OBJS) \ 32 | 33 | !include "../../../CPP/Build.mak" 34 | 35 | $(7Z_OBJS): $(*B).c 36 | $(CCOMPL_USE) 37 | $(C_OBJS): ../../$(*B).c 38 | $(CCOMPL_USE) 39 | $O\Precomp.obj: Precomp.c 40 | $(CCOMPL_PCH) 41 | -------------------------------------------------------------------------------- /C/Util/7zipInstall/7zip.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjieest/lib7z-static/c847005f0358c0c054fa2318aa38c1901703c425/C/Util/7zipInstall/7zip.ico -------------------------------------------------------------------------------- /C/Util/7zipInstall/7zipInstall.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 6.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "7zipInstall"=.\7zipInstall.dsp - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | }}} 15 | 16 | ############################################################################### 17 | 18 | Global: 19 | 20 | Package=<5> 21 | {{{ 22 | }}} 23 | 24 | Package=<3> 25 | {{{ 26 | }}} 27 | 28 | ############################################################################### 29 | 30 | -------------------------------------------------------------------------------- /C/Util/7zipInstall/Precomp.c: -------------------------------------------------------------------------------- 1 | /* Precomp.c -- StdAfx 2 | 2013-01-21 : Igor Pavlov : Public domain */ 3 | 4 | #include "Precomp.h" 5 | -------------------------------------------------------------------------------- /C/Util/7zipInstall/Precomp.h: -------------------------------------------------------------------------------- 1 | /* Precomp.h -- StdAfx 2 | 2015-05-24 : Igor Pavlov : Public domain */ 3 | 4 | #ifndef __7Z_PRECOMP_H 5 | #define __7Z_PRECOMP_H 6 | 7 | #include "../../Compiler.h" 8 | 9 | #include "../../7zTypes.h" 10 | 11 | #endif 12 | -------------------------------------------------------------------------------- /C/Util/7zipInstall/makefile: -------------------------------------------------------------------------------- 1 | PROG = 7zipInstall.exe 2 | 3 | !IFDEF _64BIT_INSTALLER 4 | CFLAGS = $(CFLAGS) -D_64BIT_INSTALLER 5 | !ENDIF 6 | 7 | CFLAGS = $(CFLAGS) -D_LZMA_SIZE_OPT 8 | 9 | CFLAGS = $(CFLAGS) \ 10 | -D_7Z_NO_METHOD_LZMA2 \ 11 | -D_7Z_NO_METHODS_FILTERS 12 | 13 | MAIN_OBJS = \ 14 | $O\7zipInstall.obj \ 15 | 16 | C_OBJS = \ 17 | $O\7zAlloc.obj \ 18 | $O\7zArcIn.obj \ 19 | $O\7zBuf.obj \ 20 | $O\7zBuf2.obj \ 21 | $O\7zCrc.obj \ 22 | $O\7zCrcOpt.obj \ 23 | $O\7zFile.obj \ 24 | $O\7zDec.obj \ 25 | $O\7zStream.obj \ 26 | $O\Bcj2.obj \ 27 | $O\CpuArch.obj \ 28 | $O\LzmaDec.obj \ 29 | 30 | OBJS = \ 31 | $(MAIN_OBJS) \ 32 | $(C_OBJS) \ 33 | $O\resource.res 34 | 35 | !include "../../../CPP/Build.mak" 36 | 37 | $(MAIN_OBJS): $(*B).c 38 | $(COMPL_O1) 39 | $(C_OBJS): ../../$(*B).c 40 | $(COMPL_O1) 41 | -------------------------------------------------------------------------------- /C/Util/7zipInstall/resource.h: -------------------------------------------------------------------------------- 1 | #define IDD_INSTALL 100 2 | 3 | #define IDT_EXTRACT_EXTRACT_TO 110 4 | #define IDE_EXTRACT_PATH 111 5 | #define IDB_EXTRACT_SET_PATH 112 6 | #define IDT_CUR_FILE 113 7 | #define IDC_PROGRESS 114 8 | 9 | #define IDI_ICON 1 10 | -------------------------------------------------------------------------------- /C/Util/7zipUninstall/7zipUninstall.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 6.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "7zipUninstall"=.\7zipUninstall.dsp - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | }}} 15 | 16 | ############################################################################### 17 | 18 | Global: 19 | 20 | Package=<5> 21 | {{{ 22 | }}} 23 | 24 | Package=<3> 25 | {{{ 26 | }}} 27 | 28 | ############################################################################### 29 | 30 | -------------------------------------------------------------------------------- /C/Util/7zipUninstall/7zipUninstall.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjieest/lib7z-static/c847005f0358c0c054fa2318aa38c1901703c425/C/Util/7zipUninstall/7zipUninstall.ico -------------------------------------------------------------------------------- /C/Util/7zipUninstall/Precomp.c: -------------------------------------------------------------------------------- 1 | /* Precomp.c -- StdAfx 2 | 2013-01-21 : Igor Pavlov : Public domain */ 3 | 4 | #include "Precomp.h" 5 | -------------------------------------------------------------------------------- /C/Util/7zipUninstall/Precomp.h: -------------------------------------------------------------------------------- 1 | /* Precomp.h -- StdAfx 2 | 2015-05-24 : Igor Pavlov : Public domain */ 3 | 4 | #ifndef __7Z_PRECOMP_H 5 | #define __7Z_PRECOMP_H 6 | 7 | #include "../../Compiler.h" 8 | 9 | #include "../../7zTypes.h" 10 | 11 | #endif 12 | -------------------------------------------------------------------------------- /C/Util/7zipUninstall/makefile: -------------------------------------------------------------------------------- 1 | PROG = 7zipUninstall.exe 2 | 3 | !IFDEF _64BIT_INSTALLER 4 | CFLAGS = $(CFLAGS) -D_64BIT_INSTALLER 5 | !ENDIF 6 | 7 | MAIN_OBJS = \ 8 | $O\7zipUninstall.obj \ 9 | 10 | OBJS = \ 11 | $(MAIN_OBJS) \ 12 | $O\resource.res 13 | 14 | !include "../../../CPP/Build.mak" 15 | 16 | $(MAIN_OBJS): $(*B).c 17 | $(COMPL_O1) 18 | -------------------------------------------------------------------------------- /C/Util/7zipUninstall/resource.h: -------------------------------------------------------------------------------- 1 | #define IDD_INSTALL 100 2 | 3 | #define IDT_EXTRACT_EXTRACT_TO 110 4 | #define IDE_EXTRACT_PATH 111 5 | 6 | #define IDT_CUR_FILE 113 7 | #define IDC_PROGRESS 114 8 | 9 | #define IDI_ICON 1 10 | -------------------------------------------------------------------------------- /C/Util/Lzma/LzmaUtil.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 6.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "LzmaUtil"=.\LzmaUtil.dsp - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | }}} 15 | 16 | ############################################################################### 17 | 18 | Global: 19 | 20 | Package=<5> 21 | {{{ 22 | }}} 23 | 24 | Package=<3> 25 | {{{ 26 | }}} 27 | 28 | ############################################################################### 29 | 30 | -------------------------------------------------------------------------------- /C/Util/Lzma/makefile: -------------------------------------------------------------------------------- 1 | # MY_STATIC_LINK=1 2 | PROG = LZMAc.exe 3 | 4 | CFLAGS = $(CFLAGS) \ 5 | 6 | LIB_OBJS = \ 7 | $O\LzmaUtil.obj \ 8 | 9 | C_OBJS = \ 10 | $O\Alloc.obj \ 11 | $O\LzFind.obj \ 12 | $O\LzFindMt.obj \ 13 | $O\LzmaDec.obj \ 14 | $O\LzmaEnc.obj \ 15 | $O\7zFile.obj \ 16 | $O\7zStream.obj \ 17 | $O\Threads.obj \ 18 | 19 | OBJS = \ 20 | $(LIB_OBJS) \ 21 | $(C_OBJS) \ 22 | 23 | !include "../../../CPP/Build.mak" 24 | 25 | $(LIB_OBJS): $(*B).c 26 | $(COMPL_O2) 27 | $(C_OBJS): ../../$(*B).c 28 | $(COMPL_O2) 29 | -------------------------------------------------------------------------------- /C/Util/Lzma/makefile.gcc: -------------------------------------------------------------------------------- 1 | PROG = lzma 2 | CXX = g++ 3 | LIB = 4 | RM = rm -f 5 | CFLAGS = -c -O2 -Wall -D_7ZIP_ST 6 | 7 | OBJS = \ 8 | LzmaUtil.o \ 9 | Alloc.o \ 10 | LzFind.o \ 11 | LzmaDec.o \ 12 | LzmaEnc.o \ 13 | 7zFile.o \ 14 | 7zStream.o \ 15 | 16 | 17 | all: $(PROG) 18 | 19 | $(PROG): $(OBJS) 20 | $(CXX) -o $(PROG) $(LDFLAGS) $(OBJS) $(LIB) $(LIB2) 21 | 22 | LzmaUtil.o: LzmaUtil.c 23 | $(CXX) $(CFLAGS) LzmaUtil.c 24 | 25 | Alloc.o: ../../Alloc.c 26 | $(CXX) $(CFLAGS) ../../Alloc.c 27 | 28 | LzFind.o: ../../LzFind.c 29 | $(CXX) $(CFLAGS) ../../LzFind.c 30 | 31 | LzmaDec.o: ../../LzmaDec.c 32 | $(CXX) $(CFLAGS) ../../LzmaDec.c 33 | 34 | LzmaEnc.o: ../../LzmaEnc.c 35 | $(CXX) $(CFLAGS) ../../LzmaEnc.c 36 | 37 | 7zFile.o: ../../7zFile.c 38 | $(CXX) $(CFLAGS) ../../7zFile.c 39 | 40 | 7zStream.o: ../../7zStream.c 41 | $(CXX) $(CFLAGS) ../../7zStream.c 42 | 43 | clean: 44 | -$(RM) $(PROG) $(OBJS) 45 | -------------------------------------------------------------------------------- /C/Util/LzmaLib/LzmaLib.def: -------------------------------------------------------------------------------- 1 | EXPORTS 2 | LzmaCompress 3 | LzmaUncompress 4 | 5 | -------------------------------------------------------------------------------- /C/Util/LzmaLib/LzmaLib.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 6.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "LzmaLib"=.\LzmaLib.dsp - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | }}} 15 | 16 | ############################################################################### 17 | 18 | Global: 19 | 20 | Package=<5> 21 | {{{ 22 | }}} 23 | 24 | Package=<3> 25 | {{{ 26 | }}} 27 | 28 | ############################################################################### 29 | 30 | -------------------------------------------------------------------------------- /C/Util/LzmaLib/LzmaLibExports.c: -------------------------------------------------------------------------------- 1 | /* LzmaLibExports.c -- LZMA library DLL Entry point 2 | 2015-11-08 : Igor Pavlov : Public domain */ 3 | 4 | #include "../../Precomp.h" 5 | 6 | #include 7 | 8 | BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved) 9 | { 10 | UNUSED_VAR(hInstance); 11 | UNUSED_VAR(dwReason); 12 | UNUSED_VAR(lpReserved); 13 | return TRUE; 14 | } 15 | -------------------------------------------------------------------------------- /C/Util/LzmaLib/makefile: -------------------------------------------------------------------------------- 1 | MY_STATIC_LINK=1 2 | SLIB = sLZMA.lib 3 | PROG = LZMA.dll 4 | SLIBPATH = $O\$(SLIB) 5 | 6 | DEF_FILE = LzmaLib.def 7 | CFLAGS = $(CFLAGS) \ 8 | 9 | LIB_OBJS = \ 10 | $O\LzmaLibExports.obj \ 11 | 12 | C_OBJS = \ 13 | $O\Alloc.obj \ 14 | $O\LzFind.obj \ 15 | $O\LzFindMt.obj \ 16 | $O\LzmaDec.obj \ 17 | $O\LzmaEnc.obj \ 18 | $O\LzmaLib.obj \ 19 | $O\Threads.obj \ 20 | 21 | OBJS = \ 22 | $(LIB_OBJS) \ 23 | $(C_OBJS) \ 24 | $O\resource.res 25 | 26 | !include "../../../CPP/Build.mak" 27 | 28 | $(SLIBPATH): $O $(OBJS) 29 | lib -out:$(SLIBPATH) $(OBJS) $(LIBS) 30 | 31 | $(LIB_OBJS): $(*B).c 32 | $(COMPL_O2) 33 | $(C_OBJS): ../../$(*B).c 34 | $(COMPL_O2) 35 | -------------------------------------------------------------------------------- /C/Util/LzmaLib/resource.rc: -------------------------------------------------------------------------------- 1 | #include "../../7zVersion.rc" 2 | 3 | MY_VERSION_INFO_DLL("LZMA library", "LZMA") 4 | -------------------------------------------------------------------------------- /C/Util/SfxSetup/Precomp.c: -------------------------------------------------------------------------------- 1 | /* Precomp.c -- StdAfx 2 | 2013-01-21 : Igor Pavlov : Public domain */ 3 | 4 | #include "Precomp.h" 5 | -------------------------------------------------------------------------------- /C/Util/SfxSetup/Precomp.h: -------------------------------------------------------------------------------- 1 | /* Precomp.h -- StdAfx 2 | 2013-06-16 : Igor Pavlov : Public domain */ 3 | 4 | #ifndef __7Z_PRECOMP_H 5 | #define __7Z_PRECOMP_H 6 | 7 | #include "../../Compiler.h" 8 | #include "../../7zTypes.h" 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /C/Util/SfxSetup/SfxSetup.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 6.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "SfxSetup"=.\SfxSetup.dsp - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | }}} 15 | 16 | ############################################################################### 17 | 18 | Global: 19 | 20 | Package=<5> 21 | {{{ 22 | }}} 23 | 24 | Package=<3> 25 | {{{ 26 | }}} 27 | 28 | ############################################################################### 29 | 30 | -------------------------------------------------------------------------------- /C/Util/SfxSetup/makefile: -------------------------------------------------------------------------------- 1 | PROG = 7zS2.sfx 2 | 3 | C_OBJS = \ 4 | $O\7zAlloc.obj \ 5 | $O\7zArcIn.obj \ 6 | $O\7zBuf.obj \ 7 | $O\7zBuf2.obj \ 8 | $O\7zCrc.obj \ 9 | $O\7zCrcOpt.obj \ 10 | $O\7zFile.obj \ 11 | $O\7zDec.obj \ 12 | $O\7zStream.obj \ 13 | $O\Bcj2.obj \ 14 | $O\Bra.obj \ 15 | $O\Bra86.obj \ 16 | $O\BraIA64.obj \ 17 | $O\CpuArch.obj \ 18 | $O\Delta.obj \ 19 | $O\Lzma2Dec.obj \ 20 | $O\LzmaDec.obj \ 21 | 22 | 7Z_OBJS = \ 23 | $O\SfxSetup.obj \ 24 | 25 | OBJS = \ 26 | $(7Z_OBJS) \ 27 | $(C_OBJS) \ 28 | $O\resource.res 29 | 30 | !include "../../../CPP/Build.mak" 31 | 32 | $(7Z_OBJS): $(*B).c 33 | $(COMPL_O1) 34 | $(C_OBJS): ../../$(*B).c 35 | $(COMPL_O1) 36 | -------------------------------------------------------------------------------- /C/Util/SfxSetup/makefile_con: -------------------------------------------------------------------------------- 1 | PROG = 7zS2con.sfx 2 | CFLAGS = $(CFLAGS) -D_CONSOLE 3 | 4 | C_OBJS = \ 5 | $O\7zAlloc.obj \ 6 | $O\7zArcIn.obj \ 7 | $O\7zBuf.obj \ 8 | $O\7zBuf2.obj \ 9 | $O\7zCrc.obj \ 10 | $O\7zCrcOpt.obj \ 11 | $O\7zFile.obj \ 12 | $O\7zDec.obj \ 13 | $O\7zStream.obj \ 14 | $O\Bcj2.obj \ 15 | $O\Bra.obj \ 16 | $O\Bra86.obj \ 17 | $O\BraIA64.obj \ 18 | $O\CpuArch.obj \ 19 | $O\Delta.obj \ 20 | $O\Lzma2Dec.obj \ 21 | $O\LzmaDec.obj \ 22 | 23 | 7Z_OBJS = \ 24 | $O\SfxSetup.obj \ 25 | 26 | OBJS = \ 27 | $(7Z_OBJS) \ 28 | $(C_OBJS) \ 29 | $O\resource.res 30 | 31 | !include "../../../CPP/Build.mak" 32 | 33 | $(7Z_OBJS): $(*B).c 34 | $(COMPL_O1) 35 | $(C_OBJS): ../../$(*B).c 36 | $(COMPL_O1) 37 | -------------------------------------------------------------------------------- /C/Util/SfxSetup/resource.rc: -------------------------------------------------------------------------------- 1 | #include "../../7zVersion.rc" 2 | 3 | MY_VERSION_INFO_APP("7z Setup SFX small", "7zS2.sfx") 4 | 5 | 1 ICON "setup.ico" 6 | -------------------------------------------------------------------------------- /C/Util/SfxSetup/setup.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjieest/lib7z-static/c847005f0358c0c054fa2318aa38c1901703c425/C/Util/SfxSetup/setup.ico -------------------------------------------------------------------------------- /C/XzCrc64.h: -------------------------------------------------------------------------------- 1 | /* XzCrc64.h -- CRC64 calculation 2 | 2013-01-18 : Igor Pavlov : Public domain */ 3 | 4 | #ifndef __XZ_CRC64_H 5 | #define __XZ_CRC64_H 6 | 7 | #include 8 | 9 | #include "7zTypes.h" 10 | 11 | EXTERN_C_BEGIN 12 | 13 | extern UInt64 g_Crc64Table[]; 14 | 15 | void MY_FAST_CALL Crc64GenerateTable(void); 16 | 17 | #define CRC64_INIT_VAL UINT64_CONST(0xFFFFFFFFFFFFFFFF) 18 | #define CRC64_GET_DIGEST(crc) ((crc) ^ CRC64_INIT_VAL) 19 | #define CRC64_UPDATE_BYTE(crc, b) (g_Crc64Table[((crc) ^ (b)) & 0xFF] ^ ((crc) >> 8)) 20 | 21 | UInt64 MY_FAST_CALL Crc64Update(UInt64 crc, const void *data, size_t size); 22 | UInt64 MY_FAST_CALL Crc64Calc(const void *data, size_t size); 23 | 24 | EXTERN_C_END 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /C/XzEnc.h: -------------------------------------------------------------------------------- 1 | /* XzEnc.h -- Xz Encode 2 | 2011-02-07 : Igor Pavlov : Public domain */ 3 | 4 | #ifndef __XZ_ENC_H 5 | #define __XZ_ENC_H 6 | 7 | #include "Lzma2Enc.h" 8 | 9 | #include "Xz.h" 10 | 11 | EXTERN_C_BEGIN 12 | 13 | typedef struct 14 | { 15 | UInt32 id; 16 | UInt32 delta; 17 | UInt32 ip; 18 | int ipDefined; 19 | } CXzFilterProps; 20 | 21 | void XzFilterProps_Init(CXzFilterProps *p); 22 | 23 | typedef struct 24 | { 25 | const CLzma2EncProps *lzma2Props; 26 | const CXzFilterProps *filterProps; 27 | unsigned checkId; 28 | } CXzProps; 29 | 30 | void XzProps_Init(CXzProps *p); 31 | 32 | SRes Xz_Encode(ISeqOutStream *outStream, ISeqInStream *inStream, 33 | const CXzProps *props, ICompressProgress *progress); 34 | 35 | SRes Xz_EncodeEmpty(ISeqOutStream *outStream); 36 | 37 | EXTERN_C_END 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /CPP/7zip/Aes.mak: -------------------------------------------------------------------------------- 1 | C_OBJS = $(C_OBJS) \ 2 | $O\Aes.obj 3 | 4 | !IF "$(CPU)" != "IA64" && "$(CPU)" != "MIPS" && "$(CPU)" != "ARM" 5 | ASM_OBJS = $(ASM_OBJS) \ 6 | $O\AesOpt.obj 7 | !ENDIF 8 | -------------------------------------------------------------------------------- /CPP/7zip/Archive/7z/7z.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 6.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "7z"=".\7z.dsp" - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | }}} 15 | 16 | ############################################################################### 17 | 18 | Global: 19 | 20 | Package=<5> 21 | {{{ 22 | }}} 23 | 24 | Package=<3> 25 | {{{ 26 | }}} 27 | 28 | ############################################################################### 29 | 30 | -------------------------------------------------------------------------------- /CPP/7zip/Archive/7z/7zCompressionMode.cpp: -------------------------------------------------------------------------------- 1 | // CompressionMethod.cpp 2 | 3 | #include "StdAfx.h" 4 | -------------------------------------------------------------------------------- /CPP/7zip/Archive/7z/7zHeader.cpp: -------------------------------------------------------------------------------- 1 | // 7zHeader.cpp 2 | 3 | #include "StdAfx.h" 4 | 5 | #include "7zHeader.h" 6 | 7 | namespace NArchive { 8 | namespace N7z { 9 | 10 | Byte kSignature[kSignatureSize] = {'7', 'z', 0xBC, 0xAF, 0x27, 0x1C}; 11 | #ifdef _7Z_VOL 12 | Byte kFinishSignature[kSignatureSize] = {'7', 'z', 0xBC, 0xAF, 0x27, 0x1C + 1}; 13 | #endif 14 | 15 | // We can change signature. So file doesn't contain correct signature. 16 | // struct SignatureInitializer { SignatureInitializer() { kSignature[0]--; } }; 17 | // static SignatureInitializer g_SignatureInitializer; 18 | 19 | }} 20 | -------------------------------------------------------------------------------- /CPP/7zip/Archive/7z/7zProperties.h: -------------------------------------------------------------------------------- 1 | // 7zProperties.h 2 | 3 | #ifndef __7Z_PROPERTIES_H 4 | #define __7Z_PROPERTIES_H 5 | 6 | #include "../../PropID.h" 7 | 8 | namespace NArchive { 9 | namespace N7z { 10 | 11 | enum 12 | { 13 | kpidPackedSize0 = kpidUserDefined, 14 | kpidPackedSize1, 15 | kpidPackedSize2, 16 | kpidPackedSize3, 17 | kpidPackedSize4 18 | }; 19 | 20 | }} 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /CPP/7zip/Archive/7z/7zRegister.cpp: -------------------------------------------------------------------------------- 1 | // 7zRegister.cpp 2 | 3 | #include "StdAfx.h" 4 | 5 | #include "../../Common/RegisterArc.h" 6 | 7 | #include "7zHandler.h" 8 | 9 | namespace NArchive { 10 | namespace N7z { 11 | 12 | static Byte k_Signature_Dec[kSignatureSize] = {'7' + 1, 'z', 0xBC, 0xAF, 0x27, 0x1C}; 13 | 14 | REGISTER_ARC_IO_DECREMENT_SIG( 15 | "7z", "7z", NULL, 7, 16 | k_Signature_Dec, 17 | 0, 18 | NArcInfoFlags::kFindSignature, 19 | NULL); 20 | 21 | }} 22 | -------------------------------------------------------------------------------- /CPP/7zip/Archive/7z/7zSpecStream.cpp: -------------------------------------------------------------------------------- 1 | // 7zSpecStream.cpp 2 | 3 | #include "StdAfx.h" 4 | 5 | #include "7zSpecStream.h" 6 | 7 | STDMETHODIMP CSequentialInStreamSizeCount2::Read(void *data, UInt32 size, UInt32 *processedSize) 8 | { 9 | UInt32 realProcessedSize; 10 | HRESULT result = _stream->Read(data, size, &realProcessedSize); 11 | _size += realProcessedSize; 12 | if (processedSize) 13 | *processedSize = realProcessedSize; 14 | return result; 15 | } 16 | 17 | STDMETHODIMP CSequentialInStreamSizeCount2::GetSubStreamSize(UInt64 subStream, UInt64 *value) 18 | { 19 | if (!_getSubStreamSize) 20 | return E_NOTIMPL; 21 | return _getSubStreamSize->GetSubStreamSize(subStream, value); 22 | } 23 | -------------------------------------------------------------------------------- /CPP/7zip/Archive/7z/StdAfx.cpp: -------------------------------------------------------------------------------- 1 | // StdAfx.cpp 2 | 3 | #include "StdAfx.h" 4 | -------------------------------------------------------------------------------- /CPP/7zip/Archive/7z/StdAfx.h: -------------------------------------------------------------------------------- 1 | // StdAfx.h 2 | 3 | #ifndef __STDAFX_H 4 | #define __STDAFX_H 5 | 6 | #include "../../../Common/Common.h" 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /CPP/7zip/Archive/7z/resource.rc: -------------------------------------------------------------------------------- 1 | #include "../../MyVersionInfo.rc" 2 | 3 | MY_VERSION_INFO_DLL("7z Plugin", "7z") 4 | 5 | 0 ICON "../Icons/7z.ico" 6 | 7 | STRINGTABLE 8 | BEGIN 9 | 100 "7z:0" 10 | END 11 | 12 | -------------------------------------------------------------------------------- /CPP/7zip/Archive/Archive.def: -------------------------------------------------------------------------------- 1 | EXPORTS 2 | CreateObject PRIVATE 3 | 4 | GetHandlerProperty PRIVATE 5 | GetNumberOfFormats PRIVATE 6 | GetHandlerProperty2 PRIVATE 7 | GetIsArc PRIVATE 8 | 9 | SetCodecs PRIVATE 10 | 11 | SetLargePageMode PRIVATE 12 | SetCaseSensitive PRIVATE 13 | -------------------------------------------------------------------------------- /CPP/7zip/Archive/Archive2.def: -------------------------------------------------------------------------------- 1 | EXPORTS 2 | CreateObject PRIVATE 3 | 4 | GetHandlerProperty PRIVATE 5 | GetNumberOfFormats PRIVATE 6 | GetHandlerProperty2 PRIVATE 7 | GetIsArc PRIVATE 8 | 9 | GetNumberOfMethods PRIVATE 10 | GetMethodProperty PRIVATE 11 | CreateDecoder PRIVATE 12 | CreateEncoder PRIVATE 13 | 14 | GetHashers PRIVATE 15 | 16 | SetCodecs PRIVATE 17 | 18 | SetLargePageMode PRIVATE 19 | SetCaseSensitive PRIVATE 20 | -------------------------------------------------------------------------------- /CPP/7zip/Archive/Cab/CabHandler.h: -------------------------------------------------------------------------------- 1 | // CabHandler.h 2 | 3 | #ifndef __CAB_HANDLER_H 4 | #define __CAB_HANDLER_H 5 | 6 | #include "../../../Common/MyCom.h" 7 | 8 | #include "../IArchive.h" 9 | 10 | #include "CabIn.h" 11 | 12 | namespace NArchive { 13 | namespace NCab { 14 | 15 | class CHandler: 16 | public IInArchive, 17 | public CMyUnknownImp 18 | { 19 | public: 20 | MY_UNKNOWN_IMP1(IInArchive) 21 | 22 | INTERFACE_IInArchive(;) 23 | 24 | private: 25 | CMvDatabaseEx m_Database; 26 | UString _errorMessage; 27 | bool _isArc; 28 | bool _errorInHeaders; 29 | bool _unexpectedEnd; 30 | // int _mainVolIndex; 31 | UInt32 _phySize; 32 | UInt64 _offset; 33 | }; 34 | 35 | }} 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /CPP/7zip/Archive/Cab/CabHeader.cpp: -------------------------------------------------------------------------------- 1 | // CabHeader.cpp 2 | 3 | #include "StdAfx.h" 4 | 5 | #include "CabHeader.h" 6 | 7 | namespace NArchive { 8 | namespace NCab { 9 | namespace NHeader { 10 | 11 | const Byte kMarker[kMarkerSize] = {'M', 'S', 'C', 'F', 0, 0, 0, 0 }; 12 | 13 | // struct CSignatureInitializer { CSignatureInitializer() { kMarker[0]--; } } g_SignatureInitializer; 14 | 15 | }}} 16 | -------------------------------------------------------------------------------- /CPP/7zip/Archive/Cab/CabHeader.h: -------------------------------------------------------------------------------- 1 | // Archive/CabHeader.h 2 | 3 | #ifndef __ARCHIVE_CAB_HEADER_H 4 | #define __ARCHIVE_CAB_HEADER_H 5 | 6 | #include "../../../Common/MyTypes.h" 7 | 8 | namespace NArchive { 9 | namespace NCab { 10 | namespace NHeader { 11 | 12 | const unsigned kMarkerSize = 8; 13 | extern const Byte kMarker[kMarkerSize]; 14 | 15 | namespace NArcFlags 16 | { 17 | const unsigned kPrevCabinet = 1; 18 | const unsigned kNextCabinet = 2; 19 | const unsigned kReservePresent = 4; 20 | } 21 | 22 | namespace NMethod 23 | { 24 | const Byte kNone = 0; 25 | const Byte kMSZip = 1; 26 | const Byte kQuantum = 2; 27 | const Byte kLZX = 3; 28 | } 29 | 30 | const unsigned kFileNameIsUtf8_Mask = 0x80; 31 | 32 | namespace NFolderIndex 33 | { 34 | const unsigned kContinuedFromPrev = 0xFFFD; 35 | const unsigned kContinuedToNext = 0xFFFE; 36 | const unsigned kContinuedPrevAndNext = 0xFFFF; 37 | } 38 | 39 | }}} 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /CPP/7zip/Archive/Cab/CabRegister.cpp: -------------------------------------------------------------------------------- 1 | // CabRegister.cpp 2 | 3 | #include "StdAfx.h" 4 | 5 | #include "../../Common/RegisterArc.h" 6 | 7 | #include "CabHandler.h" 8 | 9 | namespace NArchive { 10 | namespace NCab { 11 | 12 | REGISTER_ARC_I( 13 | "Cab", "cab", 0, 8, 14 | NHeader::kMarker, 15 | 0, 16 | NArcInfoFlags::kFindSignature, 17 | NULL) 18 | 19 | }} 20 | -------------------------------------------------------------------------------- /CPP/7zip/Archive/Cab/StdAfx.h: -------------------------------------------------------------------------------- 1 | // StdAfx.h 2 | 3 | #ifndef __STDAFX_H 4 | #define __STDAFX_H 5 | 6 | #include "../../../Common/Common.h" 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /CPP/7zip/Archive/Chm/ChmHandler.h: -------------------------------------------------------------------------------- 1 | // ChmHandler.h 2 | 3 | #ifndef __ARCHIVE_CHM_HANDLER_H 4 | #define __ARCHIVE_CHM_HANDLER_H 5 | 6 | #include "../../../Common/MyCom.h" 7 | 8 | #include "../IArchive.h" 9 | 10 | #include "ChmIn.h" 11 | 12 | namespace NArchive { 13 | namespace NChm { 14 | 15 | class CHandler: 16 | public IInArchive, 17 | public CMyUnknownImp 18 | { 19 | public: 20 | MY_UNKNOWN_IMP1(IInArchive) 21 | 22 | INTERFACE_IInArchive(;) 23 | 24 | bool _help2; 25 | CHandler(bool help2): _help2(help2) {} 26 | 27 | private: 28 | CFilesDatabase m_Database; 29 | CMyComPtr m_Stream; 30 | UInt32 m_ErrorFlags; 31 | }; 32 | 33 | }} 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /CPP/7zip/Archive/Chm/StdAfx.h: -------------------------------------------------------------------------------- 1 | // StdAfx.h 2 | 3 | #ifndef __STDAFX_H 4 | #define __STDAFX_H 5 | 6 | #include "../../../Common/Common.h" 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /CPP/7zip/Archive/Common/DummyOutStream.cpp: -------------------------------------------------------------------------------- 1 | // DummyOutStream.cpp 2 | 3 | #include "StdAfx.h" 4 | 5 | #include "DummyOutStream.h" 6 | 7 | STDMETHODIMP CDummyOutStream::Write(const void *data, UInt32 size, UInt32 *processedSize) 8 | { 9 | UInt32 realProcessedSize = size; 10 | HRESULT res = S_OK; 11 | if (_stream) 12 | res = _stream->Write(data, size, &realProcessedSize); 13 | _size += realProcessedSize; 14 | if (processedSize) 15 | *processedSize = realProcessedSize; 16 | return res; 17 | } 18 | -------------------------------------------------------------------------------- /CPP/7zip/Archive/Common/DummyOutStream.h: -------------------------------------------------------------------------------- 1 | // DummyOutStream.h 2 | 3 | #ifndef __DUMMY_OUT_STREAM_H 4 | #define __DUMMY_OUT_STREAM_H 5 | 6 | #include "../../../Common/MyCom.h" 7 | 8 | #include "../../IStream.h" 9 | 10 | class CDummyOutStream: 11 | public ISequentialOutStream, 12 | public CMyUnknownImp 13 | { 14 | CMyComPtr _stream; 15 | UInt64 _size; 16 | public: 17 | void SetStream(ISequentialOutStream *outStream) { _stream = outStream; } 18 | void ReleaseStream() { _stream.Release(); } 19 | void Init() { _size = 0; } 20 | MY_UNKNOWN_IMP 21 | STDMETHOD(Write)(const void *data, UInt32 size, UInt32 *processedSize); 22 | UInt64 GetSize() const { return _size; } 23 | }; 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /CPP/7zip/Archive/Common/FindSignature.h: -------------------------------------------------------------------------------- 1 | // FindSignature.h 2 | 3 | #ifndef __FIND_SIGNATURE_H 4 | #define __FIND_SIGNATURE_H 5 | 6 | #include "../../IStream.h" 7 | 8 | HRESULT FindSignatureInStream(ISequentialInStream *stream, 9 | const Byte *signature, unsigned signatureSize, 10 | const UInt64 *limit, UInt64 &resPos); 11 | 12 | #endif 13 | -------------------------------------------------------------------------------- /CPP/7zip/Archive/Common/ItemNameUtils.h: -------------------------------------------------------------------------------- 1 | // Archive/Common/ItemNameUtils.h 2 | 3 | #ifndef __ARCHIVE_ITEM_NAME_UTILS_H 4 | #define __ARCHIVE_ITEM_NAME_UTILS_H 5 | 6 | #include "../../../Common/MyString.h" 7 | 8 | namespace NArchive { 9 | namespace NItemName { 10 | 11 | void ReplaceToOsPathSeparator(wchar_t *s); 12 | 13 | UString MakeLegalName(const UString &name); 14 | UString GetOSName(const UString &name); 15 | UString GetOSName2(const UString &name); 16 | void ConvertToOSName2(UString &name); 17 | bool HasTailSlash(const AString &name, UINT codePage); 18 | 19 | #ifdef _WIN32 20 | inline UString WinNameToOSName(const UString &name) { return name; } 21 | #else 22 | UString WinNameToOSName(const UString &name); 23 | #endif 24 | 25 | }} 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /CPP/7zip/Archive/Common/OutStreamWithCRC.cpp: -------------------------------------------------------------------------------- 1 | // OutStreamWithCRC.cpp 2 | 3 | #include "StdAfx.h" 4 | 5 | #include "OutStreamWithCRC.h" 6 | 7 | STDMETHODIMP COutStreamWithCRC::Write(const void *data, UInt32 size, UInt32 *processedSize) 8 | { 9 | HRESULT result = S_OK; 10 | if (_stream) 11 | result = _stream->Write(data, size, &size); 12 | if (_calculate) 13 | _crc = CrcUpdate(_crc, data, size); 14 | _size += size; 15 | if (processedSize != NULL) 16 | *processedSize = size; 17 | return result; 18 | } 19 | -------------------------------------------------------------------------------- /CPP/7zip/Archive/Common/OutStreamWithSha1.cpp: -------------------------------------------------------------------------------- 1 | // OutStreamWithSha1.cpp 2 | 3 | #include "StdAfx.h" 4 | 5 | #include "OutStreamWithSha1.h" 6 | 7 | STDMETHODIMP COutStreamWithSha1::Write(const void *data, UInt32 size, UInt32 *processedSize) 8 | { 9 | HRESULT result = S_OK; 10 | if (_stream) 11 | result = _stream->Write(data, size, &size); 12 | if (_calculate) 13 | Sha1_Update(&_sha, (const Byte *)data, size); 14 | _size += size; 15 | if (processedSize) 16 | *processedSize = size; 17 | return result; 18 | } 19 | -------------------------------------------------------------------------------- /CPP/7zip/Archive/Common/ParseProperties.cpp: -------------------------------------------------------------------------------- 1 | // ParseProperties.cpp 2 | 3 | #include "StdAfx.h" 4 | -------------------------------------------------------------------------------- /CPP/7zip/Archive/Common/ParseProperties.h: -------------------------------------------------------------------------------- 1 | // ParseProperties.h 2 | 3 | #ifndef __PARSE_PROPERTIES_H 4 | #define __PARSE_PROPERTIES_H 5 | 6 | #endif 7 | -------------------------------------------------------------------------------- /CPP/7zip/Archive/Common/StdAfx.h: -------------------------------------------------------------------------------- 1 | // StdAfx.h 2 | 3 | #ifndef __STDAFX_H 4 | #define __STDAFX_H 5 | 6 | #include "../../../Common/Common.h" 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /CPP/7zip/Archive/DeflateProps.cpp: -------------------------------------------------------------------------------- 1 | // DeflateProps.cpp 2 | 3 | #include "StdAfx.h" 4 | -------------------------------------------------------------------------------- /CPP/7zip/Archive/DeflateProps.h: -------------------------------------------------------------------------------- 1 | // DeflateProps.h 2 | 3 | #ifndef __DEFLATE_PROPS_H 4 | #define __DEFLATE_PROPS_H 5 | 6 | #endif 7 | -------------------------------------------------------------------------------- /CPP/7zip/Archive/Iso/IsoHandler.h: -------------------------------------------------------------------------------- 1 | // IsoHandler.h 2 | 3 | #ifndef __ISO_HANDLER_H 4 | #define __ISO_HANDLER_H 5 | 6 | #include "../../../Common/MyCom.h" 7 | 8 | #include "../IArchive.h" 9 | 10 | #include "IsoIn.h" 11 | #include "IsoItem.h" 12 | 13 | namespace NArchive { 14 | namespace NIso { 15 | 16 | class CHandler: 17 | public IInArchive, 18 | public IInArchiveGetStream, 19 | public CMyUnknownImp 20 | { 21 | CMyComPtr _stream; 22 | CInArchive _archive; 23 | public: 24 | MY_UNKNOWN_IMP2(IInArchive, IInArchiveGetStream) 25 | INTERFACE_IInArchive(;) 26 | STDMETHOD(GetStream)(UInt32 index, ISequentialInStream **stream); 27 | }; 28 | 29 | }} 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /CPP/7zip/Archive/Iso/IsoHeader.cpp: -------------------------------------------------------------------------------- 1 | // Archive/Iso/Header.h 2 | 3 | #include "StdAfx.h" 4 | 5 | #include "IsoHeader.h" 6 | 7 | namespace NArchive { 8 | namespace NIso { 9 | 10 | const char *kElToritoSpec = "EL TORITO SPECIFICATION\0\0\0\0\0\0\0\0\0"; 11 | 12 | }} 13 | -------------------------------------------------------------------------------- /CPP/7zip/Archive/Iso/IsoRegister.cpp: -------------------------------------------------------------------------------- 1 | // IsoRegister.cpp 2 | 3 | #include "StdAfx.h" 4 | 5 | #include "../../Common/RegisterArc.h" 6 | 7 | #include "IsoHandler.h" 8 | 9 | namespace NArchive { 10 | namespace NIso { 11 | 12 | static const Byte k_Signature[] = { 'C', 'D', '0', '0', '1' }; 13 | 14 | REGISTER_ARC_I( 15 | "Iso", "iso img", 0, 0xE7, 16 | k_Signature, 17 | NArchive::NIso::kStartPos + 1, 18 | 0, 19 | NULL) 20 | 21 | }} 22 | -------------------------------------------------------------------------------- /CPP/7zip/Archive/Iso/StdAfx.h: -------------------------------------------------------------------------------- 1 | // StdAfx.h 2 | 3 | #ifndef __STDAFX_H 4 | #define __STDAFX_H 5 | 6 | #include "../../../Common/Common.h" 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /CPP/7zip/Archive/Nsis/NsisHandler.h: -------------------------------------------------------------------------------- 1 | // NSisHandler.h 2 | 3 | #ifndef __NSIS_HANDLER_H 4 | #define __NSIS_HANDLER_H 5 | 6 | #include "../../../Common/MyCom.h" 7 | 8 | #include "../../Common/CreateCoder.h" 9 | 10 | #include "../IArchive.h" 11 | 12 | #include "NsisIn.h" 13 | 14 | namespace NArchive { 15 | namespace NNsis { 16 | 17 | class CHandler: 18 | public IInArchive, 19 | public CMyUnknownImp 20 | { 21 | CInArchive _archive; 22 | AString _methodString; 23 | 24 | bool GetUncompressedSize(unsigned index, UInt32 &size) const; 25 | bool GetCompressedSize(unsigned index, UInt32 &size) const; 26 | 27 | // AString GetMethod(NMethodType::EEnum method, bool useItemFilter, UInt32 dictionary) const; 28 | public: 29 | MY_UNKNOWN_IMP1(IInArchive) 30 | 31 | INTERFACE_IInArchive(;) 32 | }; 33 | 34 | }} 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /CPP/7zip/Archive/Nsis/NsisRegister.cpp: -------------------------------------------------------------------------------- 1 | // NsisRegister.cpp 2 | 3 | #include "StdAfx.h" 4 | 5 | #include "../../Common/RegisterArc.h" 6 | 7 | #include "NsisHandler.h" 8 | 9 | namespace NArchive { 10 | namespace NNsis { 11 | 12 | REGISTER_ARC_I( 13 | "Nsis", "nsis", 0, 0x9, 14 | kSignature, 15 | 4, 16 | NArcInfoFlags::kFindSignature | 17 | NArcInfoFlags::kUseGlobalOffset, 18 | NULL) 19 | 20 | }} 21 | -------------------------------------------------------------------------------- /CPP/7zip/Archive/Nsis/StdAfx.h: -------------------------------------------------------------------------------- 1 | // StdAfx.h 2 | 3 | #ifndef __STDAFX_H 4 | #define __STDAFX_H 5 | 6 | #include "../../../Common/Common.h" 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /CPP/7zip/Archive/Rar/StdAfx.cpp: -------------------------------------------------------------------------------- 1 | // StdAfx.cpp 2 | 3 | #include "StdAfx.h" 4 | -------------------------------------------------------------------------------- /CPP/7zip/Archive/Rar/StdAfx.h: -------------------------------------------------------------------------------- 1 | // StdAfx.h 2 | 3 | #ifndef __STDAFX_H 4 | #define __STDAFX_H 5 | 6 | #include "../../../Common/Common.h" 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /CPP/7zip/Archive/StdAfx.h: -------------------------------------------------------------------------------- 1 | // StdAfx.h 2 | 3 | #ifndef __STDAFX_H 4 | #define __STDAFX_H 5 | 6 | #include "../../Common/Common.h" 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /CPP/7zip/Archive/Tar/StdAfx.h: -------------------------------------------------------------------------------- 1 | // StdAfx.h 2 | 3 | #ifndef __STDAFX_H 4 | #define __STDAFX_H 5 | 6 | #include "../../../Common/Common.h" 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /CPP/7zip/Archive/Tar/TarHeader.cpp: -------------------------------------------------------------------------------- 1 | // Archive/TarHeader.cpp 2 | 3 | #include "StdAfx.h" 4 | 5 | #include "TarHeader.h" 6 | 7 | namespace NArchive { 8 | namespace NTar { 9 | namespace NFileHeader { 10 | 11 | const char *kLongLink = "././@LongLink"; 12 | const char *kLongLink2 = "@LongLink"; 13 | 14 | // The magic field is filled with this if uname and gname are valid. 15 | namespace NMagic 16 | { 17 | // const char *kUsTar = "ustar"; // 5 chars 18 | // const char *kGNUTar = "GNUtar "; // 7 chars and a null 19 | // const char *kEmpty = "\0\0\0\0\0\0\0\0"; 20 | const char kUsTar_00[8] = { 'u', 's', 't', 'a', 'r', 0, '0', '0' } ; 21 | } 22 | 23 | }}} 24 | -------------------------------------------------------------------------------- /CPP/7zip/Archive/Tar/TarIn.h: -------------------------------------------------------------------------------- 1 | // TarIn.h 2 | 3 | #ifndef __ARCHIVE_TAR_IN_H 4 | #define __ARCHIVE_TAR_IN_H 5 | 6 | #include "../../IStream.h" 7 | 8 | #include "TarItem.h" 9 | 10 | namespace NArchive { 11 | namespace NTar { 12 | 13 | enum EErrorType 14 | { 15 | k_ErrorType_OK, 16 | k_ErrorType_Corrupted, 17 | k_ErrorType_UnexpectedEnd, 18 | }; 19 | 20 | HRESULT ReadItem(ISequentialInStream *stream, bool &filled, CItemEx &itemInfo, EErrorType &error); 21 | 22 | API_FUNC_IsArc IsArc_Tar(const Byte *p, size_t size); 23 | 24 | }} 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /CPP/7zip/Archive/Tar/TarOut.h: -------------------------------------------------------------------------------- 1 | // Archive/TarOut.h 2 | 3 | #ifndef __ARCHIVE_TAR_OUT_H 4 | #define __ARCHIVE_TAR_OUT_H 5 | 6 | #include "../../../Common/MyCom.h" 7 | 8 | #include "../../IStream.h" 9 | 10 | #include "TarItem.h" 11 | 12 | namespace NArchive { 13 | namespace NTar { 14 | 15 | class COutArchive 16 | { 17 | CMyComPtr m_Stream; 18 | 19 | HRESULT WriteBytes(const void *data, unsigned size); 20 | HRESULT WriteHeaderReal(const CItem &item); 21 | public: 22 | UInt64 Pos; 23 | 24 | void Create(ISequentialOutStream *outStream) 25 | { 26 | m_Stream = outStream; 27 | } 28 | 29 | HRESULT WriteHeader(const CItem &item); 30 | HRESULT FillDataResidual(UInt64 dataSize); 31 | HRESULT WriteFinishHeader(); 32 | }; 33 | 34 | }} 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /CPP/7zip/Archive/Tar/TarRegister.cpp: -------------------------------------------------------------------------------- 1 | // TarRegister.cpp 2 | 3 | #include "StdAfx.h" 4 | 5 | #include "../../Common/RegisterArc.h" 6 | 7 | #include "TarHandler.h" 8 | 9 | namespace NArchive { 10 | namespace NTar { 11 | 12 | static const Byte k_Signature[] = { 'u', 's', 't', 'a', 'r' }; 13 | 14 | REGISTER_ARC_IO( 15 | "tar", "tar ova", 0, 0xEE, 16 | k_Signature, 17 | NFileHeader::kUstarMagic_Offset, 18 | NArcInfoFlags::kStartOpen | 19 | NArcInfoFlags::kSymLinks | 20 | NArcInfoFlags::kHardLinks, 21 | IsArc_Tar) 22 | 23 | }} 24 | -------------------------------------------------------------------------------- /CPP/7zip/Archive/Tar/TarUpdate.h: -------------------------------------------------------------------------------- 1 | // TarUpdate.h 2 | 3 | #ifndef __TAR_UPDATE_H 4 | #define __TAR_UPDATE_H 5 | 6 | #include "../IArchive.h" 7 | 8 | #include "TarItem.h" 9 | 10 | namespace NArchive { 11 | namespace NTar { 12 | 13 | struct CUpdateItem 14 | { 15 | int IndexInArc; 16 | int IndexInClient; 17 | UInt64 Size; 18 | Int64 MTime; 19 | UInt32 Mode; 20 | bool NewData; 21 | bool NewProps; 22 | bool IsDir; 23 | AString Name; 24 | AString User; 25 | AString Group; 26 | 27 | CUpdateItem(): Size(0), IsDir(false) {} 28 | }; 29 | 30 | HRESULT UpdateArchive(IInStream *inStream, ISequentialOutStream *outStream, 31 | const CObjectVector &inputItems, 32 | const CObjectVector &updateItems, 33 | UINT codePage, 34 | IArchiveUpdateCallback *updateCallback); 35 | 36 | }} 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /CPP/7zip/Archive/Udf/StdAfx.h: -------------------------------------------------------------------------------- 1 | // StdAfx.h 2 | 3 | #ifndef __STDAFX_H 4 | #define __STDAFX_H 5 | 6 | #include "../../../Common/Common.h" 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /CPP/7zip/Archive/Udf/UdfHandler.h: -------------------------------------------------------------------------------- 1 | // UdfHandler.h 2 | 3 | #ifndef __UDF_HANDLER_H 4 | #define __UDF_HANDLER_H 5 | 6 | #include "../../../Common/MyCom.h" 7 | 8 | #include "../IArchive.h" 9 | 10 | #include "UdfIn.h" 11 | 12 | namespace NArchive { 13 | namespace NUdf { 14 | 15 | struct CRef2 16 | { 17 | unsigned Vol; 18 | unsigned Fs; 19 | unsigned Ref; 20 | }; 21 | 22 | class CHandler: 23 | public IInArchive, 24 | public IInArchiveGetStream, 25 | public CMyUnknownImp 26 | { 27 | CMyComPtr _inStream; 28 | CInArchive _archive; 29 | CRecordVector _refs2; 30 | public: 31 | MY_UNKNOWN_IMP2(IInArchive, IInArchiveGetStream) 32 | INTERFACE_IInArchive(;) 33 | STDMETHOD(GetStream)(UInt32 index, ISequentialInStream **stream); 34 | }; 35 | 36 | }} 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /CPP/7zip/Archive/Wim/StdAfx.h: -------------------------------------------------------------------------------- 1 | // StdAfx.h 2 | 3 | #ifndef __STDAFX_H 4 | #define __STDAFX_H 5 | 6 | #include "../../../Common/Common.h" 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /CPP/7zip/Archive/Wim/WimRegister.cpp: -------------------------------------------------------------------------------- 1 | // WimRegister.cpp 2 | 3 | #include "StdAfx.h" 4 | 5 | #include "../../Common/RegisterArc.h" 6 | 7 | #include "WimHandler.h" 8 | 9 | namespace NArchive { 10 | namespace NWim { 11 | 12 | REGISTER_ARC_IO( 13 | "wim", "wim swm esd", 0, 0xE6, 14 | kSignature, 15 | 0, 16 | NArcInfoFlags::kAltStreams | 17 | NArcInfoFlags::kNtSecure | 18 | NArcInfoFlags::kSymLinks | 19 | NArcInfoFlags::kHardLinks 20 | , NULL) 21 | 22 | }} 23 | -------------------------------------------------------------------------------- /CPP/7zip/Archive/Zip/StdAfx.h: -------------------------------------------------------------------------------- 1 | // StdAfx.h 2 | 3 | #ifndef __STDAFX_H 4 | #define __STDAFX_H 5 | 6 | #include "../../../Common/Common.h" 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /CPP/7zip/Archive/Zip/ZipRegister.cpp: -------------------------------------------------------------------------------- 1 | // ZipRegister.cpp 2 | 3 | #include "StdAfx.h" 4 | 5 | #include "../../Common/RegisterArc.h" 6 | 7 | #include "ZipHandler.h" 8 | 9 | namespace NArchive { 10 | namespace NZip { 11 | 12 | static const Byte k_Signature[] = { 13 | 4, 0x50, 0x4B, 0x03, 0x04, 14 | 4, 0x50, 0x4B, 0x05, 0x06, 15 | 6, 0x50, 0x4B, 0x30, 0x30, 0x50, 0x4B }; 16 | 17 | REGISTER_ARC_IO( 18 | "zip", "zip zipx jar xpi odt ods docx xlsx epub", 0, 1, 19 | k_Signature, 20 | 0, 21 | NArcInfoFlags::kFindSignature | 22 | NArcInfoFlags::kMultiSignature | 23 | NArcInfoFlags::kUseGlobalOffset, 24 | IsArc_Zip) 25 | 26 | }} 27 | -------------------------------------------------------------------------------- /CPP/7zip/Archive/makefile: -------------------------------------------------------------------------------- 1 | DIRS = \ 2 | 7z\~ \ 3 | Arj\~ \ 4 | BZip2\~ \ 5 | Cab\~ \ 6 | Chm\~ \ 7 | Cpio\~ \ 8 | Deb\~ \ 9 | GZip\~ \ 10 | Iso\~ \ 11 | Lzh\~ \ 12 | Nsis\~ \ 13 | Rar\~ \ 14 | RPM\~ \ 15 | Split\~ \ 16 | Tar\~ \ 17 | Z\~ \ 18 | Zip\~ \ 19 | 20 | all: $(DIRS) 21 | 22 | $(DIRS): 23 | !include "../SubBuild.mak" 24 | -------------------------------------------------------------------------------- /CPP/7zip/Asm.mak: -------------------------------------------------------------------------------- 1 | !IFDEF ASM_OBJS 2 | !IF "$(CPU)" == "ARM" 3 | $(ASM_OBJS): ../../../../Asm/Arm/$(*B).asm 4 | $(COMPL_ASM) 5 | !ELSEIF "$(CPU)" != "IA64" && "$(CPU)" != "MIPS" 6 | $(ASM_OBJS): ../../../../Asm/x86/$(*B).asm 7 | $(COMPL_ASM) 8 | !ENDIF 9 | !ENDIF 10 | -------------------------------------------------------------------------------- /CPP/7zip/Bundles/Format7zF/StdAfx.cpp: -------------------------------------------------------------------------------- 1 | // StdAfx.cpp 2 | 3 | #include "StdAfx.h" 4 | -------------------------------------------------------------------------------- /CPP/7zip/Bundles/Format7zF/StdAfx.h: -------------------------------------------------------------------------------- 1 | // StdAfx.h 2 | 3 | #ifndef __STDAFX_H 4 | #define __STDAFX_H 5 | 6 | #include "../../../Common/Common.h" 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /CPP/7zip/Bundles/Format7zF/makefile: -------------------------------------------------------------------------------- 1 | PROG = 7z.dll 2 | DEF_FILE = ../../Archive/Archive2.def 3 | CFLAGS = $(CFLAGS) \ 4 | -DEXTERNAL_CODECS \ 5 | 6 | !IFNDEF UNDER_CE 7 | CFLAGS = $(CFLAGS) -D_7ZIP_LARGE_PAGES 8 | !ENDIF 9 | 10 | !include "Arc.mak" 11 | 12 | COMPRESS_OBJS = $(COMPRESS_OBJS) \ 13 | $O\CodecExports.obj \ 14 | 15 | AR_OBJS = $(AR_OBJS) \ 16 | $O\ArchiveExports.obj \ 17 | $O\DllExports2.obj \ 18 | 19 | 20 | !include "../../7zip.mak" 21 | -------------------------------------------------------------------------------- /CPP/7zip/Common/FilePathAutoRename.h: -------------------------------------------------------------------------------- 1 | // FilePathAutoRename.h 2 | 3 | #ifndef __FILE_PATH_AUTO_RENAME_H 4 | #define __FILE_PATH_AUTO_RENAME_H 5 | 6 | #include "../../Common/MyString.h" 7 | 8 | bool AutoRenamePath(FString &fullProcessedPath); 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /CPP/7zip/Common/LockedStream.cpp: -------------------------------------------------------------------------------- 1 | // LockedStream.cpp 2 | 3 | #include "StdAfx.h" 4 | -------------------------------------------------------------------------------- /CPP/7zip/Common/LockedStream.h: -------------------------------------------------------------------------------- 1 | // LockedStream.h 2 | 3 | #ifndef __LOCKED_STREAM_H 4 | #define __LOCKED_STREAM_H 5 | 6 | #endif 7 | -------------------------------------------------------------------------------- /CPP/7zip/Common/MethodId.cpp: -------------------------------------------------------------------------------- 1 | // MethodId.cpp 2 | 3 | #include "StdAfx.h" 4 | -------------------------------------------------------------------------------- /CPP/7zip/Common/MethodId.h: -------------------------------------------------------------------------------- 1 | // MethodId.h 2 | 3 | #ifndef __7Z_METHOD_ID_H 4 | #define __7Z_METHOD_ID_H 5 | 6 | #include "../../Common/MyTypes.h" 7 | 8 | typedef UInt64 CMethodId; 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /CPP/7zip/Common/OffsetStream.h: -------------------------------------------------------------------------------- 1 | // OffsetStream.h 2 | 3 | #ifndef __OFFSET_STREAM_H 4 | #define __OFFSET_STREAM_H 5 | 6 | #include "../../Common/MyCom.h" 7 | 8 | #include "../IStream.h" 9 | 10 | class COffsetOutStream: 11 | public IOutStream, 12 | public CMyUnknownImp 13 | { 14 | UInt64 _offset; 15 | CMyComPtr _stream; 16 | public: 17 | HRESULT Init(IOutStream *stream, UInt64 offset); 18 | 19 | MY_UNKNOWN_IMP 20 | 21 | STDMETHOD(Write)(const void *data, UInt32 size, UInt32 *processedSize); 22 | STDMETHOD(Seek)(Int64 offset, UInt32 seekOrigin, UInt64 *newPosition); 23 | STDMETHOD(SetSize)(UInt64 newSize); 24 | }; 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /CPP/7zip/Common/ProgressUtils.h: -------------------------------------------------------------------------------- 1 | // ProgressUtils.h 2 | 3 | #ifndef __PROGRESS_UTILS_H 4 | #define __PROGRESS_UTILS_H 5 | 6 | #include "../../Common/MyCom.h" 7 | 8 | #include "../ICoder.h" 9 | #include "../IProgress.h" 10 | 11 | class CLocalProgress: 12 | public ICompressProgressInfo, 13 | public CMyUnknownImp 14 | { 15 | CMyComPtr _progress; 16 | CMyComPtr _ratioProgress; 17 | bool _inSizeIsMain; 18 | public: 19 | UInt64 ProgressOffset; 20 | UInt64 InSize; 21 | UInt64 OutSize; 22 | bool SendRatio; 23 | bool SendProgress; 24 | 25 | CLocalProgress(); 26 | 27 | void Init(IProgress *progress, bool inSizeIsMain); 28 | HRESULT SetCur(); 29 | 30 | MY_UNKNOWN_IMP1(ICompressProgressInfo) 31 | 32 | STDMETHOD(SetRatioInfo)(const UInt64 *inSize, const UInt64 *outSize); 33 | }; 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /CPP/7zip/Common/StdAfx.h: -------------------------------------------------------------------------------- 1 | // StdAfx.h 2 | 3 | #ifndef __STDAFX_H 4 | #define __STDAFX_H 5 | 6 | #include "../../Common/Common.h" 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /CPP/7zip/Common/StreamUtils.h: -------------------------------------------------------------------------------- 1 | // StreamUtils.h 2 | 3 | #ifndef __STREAM_UTILS_H 4 | #define __STREAM_UTILS_H 5 | 6 | #include "../IStream.h" 7 | 8 | HRESULT ReadStream(ISequentialInStream *stream, void *data, size_t *size) throw(); 9 | HRESULT ReadStream_FALSE(ISequentialInStream *stream, void *data, size_t size) throw(); 10 | HRESULT ReadStream_FAIL(ISequentialInStream *stream, void *data, size_t size) throw(); 11 | HRESULT WriteStream(ISequentialOutStream *stream, const void *data, size_t size) throw(); 12 | 13 | #endif 14 | -------------------------------------------------------------------------------- /CPP/7zip/Common/UniqBlocks.h: -------------------------------------------------------------------------------- 1 | // UniqBlocks.h 2 | 3 | #ifndef __UNIQ_BLOCKS_H 4 | #define __UNIQ_BLOCKS_H 5 | 6 | #include "../../Common/MyTypes.h" 7 | #include "../../Common/MyBuffer.h" 8 | #include "../../Common/MyVector.h" 9 | 10 | struct CUniqBlocks 11 | { 12 | CObjectVector Bufs; 13 | CUIntVector Sorted; 14 | CUIntVector BufIndexToSortedIndex; 15 | 16 | unsigned AddUniq(const Byte *data, size_t size); 17 | UInt64 GetTotalSizeInBytes() const; 18 | void GetReverseMap(); 19 | 20 | bool IsOnlyEmpty() const 21 | { 22 | return (Bufs.Size() == 0 || Bufs.Size() == 1 && Bufs[0].Size() == 0); 23 | } 24 | }; 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /CPP/7zip/Common/VirtThread.h: -------------------------------------------------------------------------------- 1 | // VirtThread.h 2 | 3 | #ifndef __VIRT_THREAD_H 4 | #define __VIRT_THREAD_H 5 | 6 | #include "../../Windows/Synchronization.h" 7 | #include "../../Windows/Thread.h" 8 | 9 | struct CVirtThread 10 | { 11 | NWindows::NSynchronization::CAutoResetEvent StartEvent; 12 | NWindows::NSynchronization::CAutoResetEvent FinishedEvent; 13 | NWindows::CThread Thread; 14 | bool Exit; 15 | 16 | ~CVirtThread() { WaitThreadFinish(); } 17 | void WaitThreadFinish(); // call it in destructor of child class ! 18 | WRes Create(); 19 | void Start(); 20 | virtual void Execute() = 0; 21 | void WaitExecuteFinish() { FinishedEvent.Lock(); } 22 | }; 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /CPP/7zip/Compress/BZip2Crc.cpp: -------------------------------------------------------------------------------- 1 | // BZip2Crc.cpp 2 | 3 | #include "StdAfx.h" 4 | 5 | #include "BZip2Crc.h" 6 | 7 | UInt32 CBZip2Crc::Table[256]; 8 | 9 | static const UInt32 kBZip2CrcPoly = 0x04c11db7; /* AUTODIN II, Ethernet, & FDDI */ 10 | 11 | void CBZip2Crc::InitTable() 12 | { 13 | for (UInt32 i = 0; i < 256; i++) 14 | { 15 | UInt32 r = (i << 24); 16 | for (int j = 8; j > 0; j--) 17 | r = (r & 0x80000000) ? ((r << 1) ^ kBZip2CrcPoly) : (r << 1); 18 | Table[i] = r; 19 | } 20 | } 21 | 22 | class CBZip2CrcTableInit 23 | { 24 | public: 25 | CBZip2CrcTableInit() { CBZip2Crc::InitTable(); } 26 | } g_BZip2CrcTableInit; 27 | -------------------------------------------------------------------------------- /CPP/7zip/Compress/BZip2Crc.h: -------------------------------------------------------------------------------- 1 | // BZip2Crc.h 2 | 3 | #ifndef __BZIP2_CRC_H 4 | #define __BZIP2_CRC_H 5 | 6 | #include "../../Common/MyTypes.h" 7 | 8 | class CBZip2Crc 9 | { 10 | UInt32 _value; 11 | static UInt32 Table[256]; 12 | public: 13 | static void InitTable(); 14 | CBZip2Crc(): _value(0xFFFFFFFF) {}; 15 | void Init() { _value = 0xFFFFFFFF; } 16 | void UpdateByte(Byte b) { _value = Table[(_value >> 24) ^ b] ^ (_value << 8); } 17 | void UpdateByte(unsigned int b) { _value = Table[(_value >> 24) ^ b] ^ (_value << 8); } 18 | UInt32 GetDigest() const { return _value ^ 0xFFFFFFFF; } 19 | }; 20 | 21 | class CBZip2CombinedCrc 22 | { 23 | UInt32 _value; 24 | public: 25 | CBZip2CombinedCrc(): _value(0){}; 26 | void Init() { _value = 0; } 27 | void Update(UInt32 v) { _value = ((_value << 1) | (_value >> 31)) ^ v; } 28 | UInt32 GetDigest() const { return _value ; } 29 | }; 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /CPP/7zip/Compress/BZip2Register.cpp: -------------------------------------------------------------------------------- 1 | // BZip2Register.cpp 2 | 3 | #include "StdAfx.h" 4 | 5 | #include "../Common/RegisterCodec.h" 6 | 7 | #include "BZip2Decoder.h" 8 | namespace NSBZIP2{ 9 | REGISTER_CODEC_CREATE(CreateDec, NCompress::NBZip2::CDecoder) 10 | } 11 | #if !defined(EXTRACT_ONLY) && !defined(BZIP2_EXTRACT_ONLY) 12 | #include "BZip2Encoder.h" 13 | namespace NSBZIP2{ 14 | REGISTER_CODEC_CREATE(CreateEnc, NCompress::NBZip2::CEncoder) 15 | } 16 | #else 17 | #define CreateEnc NULL 18 | #endif 19 | namespace NSBZIP2{ 20 | REGISTER_CODEC_2(BZip2, CreateDec, CreateEnc, 0x40202, "BZip2") 21 | 22 | } -------------------------------------------------------------------------------- /CPP/7zip/Compress/Bcj2Register.cpp: -------------------------------------------------------------------------------- 1 | // Bcj2Register.cpp 2 | 3 | #include "StdAfx.h" 4 | 5 | #include "../Common/RegisterCodec.h" 6 | 7 | #include "Bcj2Coder.h" 8 | namespace NSBCJ2{ 9 | REGISTER_CODEC_CREATE_2(CreateCodec, NCompress::NBcj2::CDecoder(), ICompressCoder2) 10 | } 11 | #ifndef EXTRACT_ONLY 12 | namespace NSBCJ2{ 13 | REGISTER_CODEC_CREATE_2(CreateCodecOut, NCompress::NBcj2::CEncoder(), ICompressCoder2) 14 | } 15 | #else 16 | #define CreateCodecOut NULL 17 | #endif 18 | namespace NSBCJ2{ 19 | 20 | REGISTER_CODEC_VAR 21 | { CreateCodec, CreateCodecOut, 0x303011B, "BCJ2", 4, false }; 22 | 23 | REGISTER_CODEC(BCJ2) 24 | } -------------------------------------------------------------------------------- /CPP/7zip/Compress/BcjCoder.cpp: -------------------------------------------------------------------------------- 1 | // BcjCoder.cpp 2 | 3 | #include "StdAfx.h" 4 | 5 | #include "BcjCoder.h" 6 | 7 | STDMETHODIMP CBcjCoder::Init() 8 | { 9 | _bufferPos = 0; 10 | x86_Convert_Init(_prevMask); 11 | return S_OK; 12 | } 13 | 14 | STDMETHODIMP_(UInt32) CBcjCoder::Filter(Byte *data, UInt32 size) 15 | { 16 | UInt32 processed = (UInt32)::x86_Convert(data, size, _bufferPos, &_prevMask, _encode); 17 | _bufferPos += processed; 18 | return processed; 19 | } 20 | -------------------------------------------------------------------------------- /CPP/7zip/Compress/BcjCoder.h: -------------------------------------------------------------------------------- 1 | // BcjCoder.h 2 | 3 | #ifndef __COMPRESS_BCJ_CODER_H 4 | #define __COMPRESS_BCJ_CODER_H 5 | 6 | #include "../../../C/Bra.h" 7 | 8 | #include "../../Common/MyCom.h" 9 | 10 | #include "../ICoder.h" 11 | 12 | class CBcjCoder: 13 | public ICompressFilter, 14 | public CMyUnknownImp 15 | { 16 | UInt32 _bufferPos; 17 | UInt32 _prevMask; 18 | int _encode; 19 | public: 20 | MY_UNKNOWN_IMP; 21 | INTERFACE_ICompressFilter(;) 22 | 23 | CBcjCoder(int encode): _bufferPos(0), _encode(encode) { x86_Convert_Init(_prevMask); } 24 | }; 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /CPP/7zip/Compress/BcjRegister.cpp: -------------------------------------------------------------------------------- 1 | // BcjRegister.cpp 2 | 3 | #include "StdAfx.h" 4 | 5 | #include "../Common/RegisterCodec.h" 6 | 7 | #include "BcjCoder.h" 8 | namespace NSBCJ{ 9 | REGISTER_FILTER_E(BCJ, 10 | CBcjCoder(false), 11 | CBcjCoder(true), 12 | 0x3030103, "BCJ") 13 | } 14 | -------------------------------------------------------------------------------- /CPP/7zip/Compress/BitlDecoder.cpp: -------------------------------------------------------------------------------- 1 | // BitlDecoder.cpp 2 | 3 | #include "StdAfx.h" 4 | 5 | #include "BitlDecoder.h" 6 | 7 | namespace NBitl { 8 | 9 | Byte kInvertTable[256]; 10 | 11 | struct CInverterTableInitializer 12 | { 13 | CInverterTableInitializer() 14 | { 15 | for (unsigned i = 0; i < 256; i++) 16 | { 17 | unsigned x = ((i & 0x55) << 1) | ((i & 0xAA) >> 1); 18 | x = ((x & 0x33) << 2) | ((x & 0xCC) >> 2); 19 | kInvertTable[i] = (Byte)(((x & 0x0F) << 4) | ((x & 0xF0) >> 4)); 20 | } 21 | } 22 | } g_InverterTableInitializer; 23 | 24 | } 25 | -------------------------------------------------------------------------------- /CPP/7zip/Compress/BranchMisc.cpp: -------------------------------------------------------------------------------- 1 | // BranchMisc.cpp 2 | 3 | #include "StdAfx.h" 4 | 5 | #include "BranchMisc.h" 6 | 7 | STDMETHODIMP CBranchCoder::Init() 8 | { 9 | _bufferPos = 0; 10 | return S_OK; 11 | } 12 | 13 | STDMETHODIMP_(UInt32) CBranchCoder::Filter(Byte *data, UInt32 size) 14 | { 15 | UInt32 processed = (UInt32)BraFunc(data, size, _bufferPos, _encode); 16 | _bufferPos += processed; 17 | return processed; 18 | } 19 | -------------------------------------------------------------------------------- /CPP/7zip/Compress/BranchMisc.h: -------------------------------------------------------------------------------- 1 | // BranchMisc.h 2 | 3 | #ifndef __COMPRESS_BRANCH_MISC_H 4 | #define __COMPRESS_BRANCH_MISC_H 5 | 6 | #include "../../Common/MyCom.h" 7 | 8 | #include "../ICoder.h" 9 | 10 | EXTERN_C_BEGIN 11 | 12 | typedef SizeT (*Func_Bra)(Byte *data, SizeT size, UInt32 ip, int encoding); 13 | 14 | EXTERN_C_END 15 | 16 | class CBranchCoder: 17 | public ICompressFilter, 18 | public CMyUnknownImp 19 | { 20 | UInt32 _bufferPos; 21 | int _encode; 22 | Func_Bra BraFunc; 23 | public: 24 | MY_UNKNOWN_IMP; 25 | INTERFACE_ICompressFilter(;) 26 | 27 | CBranchCoder(Func_Bra bra, int encode): _bufferPos(0), _encode(encode), BraFunc(bra) {} 28 | }; 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /CPP/7zip/Compress/Codec.def: -------------------------------------------------------------------------------- 1 | EXPORTS 2 | CreateObject PRIVATE 3 | GetNumberOfMethods PRIVATE 4 | GetMethodProperty PRIVATE 5 | CreateDecoder PRIVATE 6 | CreateEncoder PRIVATE 7 | -------------------------------------------------------------------------------- /CPP/7zip/Compress/CopyRegister.cpp: -------------------------------------------------------------------------------- 1 | // CopyRegister.cpp 2 | 3 | #include "StdAfx.h" 4 | 5 | #include "../Common/RegisterCodec.h" 6 | 7 | #include "CopyCoder.h" 8 | namespace NSCopy{ 9 | REGISTER_CODEC_CREATE(CreateCodec, NCompress::CCopyCoder()) 10 | 11 | REGISTER_CODEC_2(Copy, CreateCodec, CreateCodec, 0, "Copy") 12 | } -------------------------------------------------------------------------------- /CPP/7zip/Compress/Deflate64Register.cpp: -------------------------------------------------------------------------------- 1 | // Deflate64Register.cpp 2 | 3 | #include "StdAfx.h" 4 | 5 | #include "../Common/RegisterCodec.h" 6 | 7 | #include "DeflateDecoder.h" 8 | namespace NSDeflate64{ 9 | REGISTER_CODEC_CREATE(CreateDec, NCompress::NDeflate::NDecoder::CCOMCoder64()) 10 | } 11 | #if !defined(EXTRACT_ONLY) && !defined(DEFLATE_EXTRACT_ONLY) 12 | #include "DeflateEncoder.h" 13 | namespace NSDeflate64{ 14 | REGISTER_CODEC_CREATE(CreateEnc, NCompress::NDeflate::NEncoder::CCOMCoder64()) 15 | } 16 | #else 17 | #define CreateEnc NULL 18 | #endif 19 | namespace NSDeflate64{ 20 | REGISTER_CODEC_2(Deflate64, CreateDec, CreateEnc, 0x40109, "Deflate64") 21 | } -------------------------------------------------------------------------------- /CPP/7zip/Compress/DeflateRegister.cpp: -------------------------------------------------------------------------------- 1 | // DeflateRegister.cpp 2 | 3 | #include "StdAfx.h" 4 | 5 | #include "../Common/RegisterCodec.h" 6 | 7 | #include "DeflateDecoder.h" 8 | namespace NSDeflate{ 9 | REGISTER_CODEC_CREATE(CreateDec, NCompress::NDeflate::NDecoder::CCOMCoder) 10 | } 11 | #if !defined(EXTRACT_ONLY) && !defined(DEFLATE_EXTRACT_ONLY) 12 | #include "DeflateEncoder.h" 13 | namespace NSDeflate{ 14 | REGISTER_CODEC_CREATE(CreateEnc, NCompress::NDeflate::NEncoder::CCOMCoder) 15 | } 16 | #else 17 | #define CreateEnc NULL 18 | #endif 19 | namespace NSDeflate{ 20 | REGISTER_CODEC_2(Deflate, CreateDec, CreateEnc, 0x40108, "Deflate") 21 | } -------------------------------------------------------------------------------- /CPP/7zip/Compress/DllExports2Compress.cpp: -------------------------------------------------------------------------------- 1 | // DllExports2Compress.cpp 2 | 3 | #include "StdAfx.h" 4 | 5 | #include "../../Common/MyInitGuid.h" 6 | 7 | #include "../ICoder.h" 8 | 9 | #include "../Common/RegisterCodec.h" 10 | 11 | extern "C" 12 | BOOL WINAPI DllMain( 13 | #ifdef UNDER_CE 14 | HANDLE 15 | #else 16 | HINSTANCE 17 | #endif 18 | /* hInstance */, DWORD /* dwReason */, LPVOID /*lpReserved*/) 19 | { 20 | return TRUE; 21 | } 22 | 23 | STDAPI CreateCoder(const GUID *clsid, const GUID *iid, void **outObject); 24 | 25 | STDAPI CreateObject(const GUID *clsid, const GUID *iid, void **outObject) 26 | { 27 | return CreateCoder(clsid, iid, outObject); 28 | } 29 | -------------------------------------------------------------------------------- /CPP/7zip/Compress/LzOutWindow.cpp: -------------------------------------------------------------------------------- 1 | // LzOutWindow.cpp 2 | 3 | #include "StdAfx.h" 4 | 5 | #include "LzOutWindow.h" 6 | 7 | void CLzOutWindow::Init(bool solid) throw() 8 | { 9 | if (!solid) 10 | COutBuffer::Init(); 11 | #ifdef _NO_EXCEPTIONS 12 | ErrorCode = S_OK; 13 | #endif 14 | } 15 | -------------------------------------------------------------------------------- /CPP/7zip/Compress/Lzma2Register.cpp: -------------------------------------------------------------------------------- 1 | // Lzma2Register.cpp 2 | 3 | #include "StdAfx.h" 4 | 5 | #include "../Common/RegisterCodec.h" 6 | 7 | #include "Lzma2Decoder.h" 8 | 9 | #ifndef EXTRACT_ONLY 10 | #include "Lzma2Encoder.h" 11 | #endif 12 | namespace NSLZMA2{ 13 | 14 | REGISTER_CODEC_E(LZMA2, 15 | NCompress::NLzma2::CDecoder(), 16 | NCompress::NLzma2::CEncoder(), 17 | 0x21, 18 | "LZMA2") 19 | } -------------------------------------------------------------------------------- /CPP/7zip/Compress/LzmaRegister.cpp: -------------------------------------------------------------------------------- 1 | // LzmaRegister.cpp 2 | 3 | #include "StdAfx.h" 4 | 5 | #include "../Common/RegisterCodec.h" 6 | 7 | #include "LzmaDecoder.h" 8 | 9 | #ifndef EXTRACT_ONLY 10 | #include "LzmaEncoder.h" 11 | #endif 12 | namespace NSLZMA{ 13 | 14 | REGISTER_CODEC_E(LZMA, 15 | NCompress::NLzma::CDecoder(), 16 | NCompress::NLzma::CEncoder(), 17 | 0x30101, 18 | "LZMA") 19 | } -------------------------------------------------------------------------------- /CPP/7zip/Compress/PpmdRegister.cpp: -------------------------------------------------------------------------------- 1 | // PpmdRegister.cpp 2 | 3 | #include "StdAfx.h" 4 | 5 | #include "../Common/RegisterCodec.h" 6 | 7 | #include "PpmdDecoder.h" 8 | 9 | #ifndef EXTRACT_ONLY 10 | #include "PpmdEncoder.h" 11 | #endif 12 | namespace NSPPMD{ 13 | 14 | REGISTER_CODEC_E(PPMD, 15 | NCompress::NPpmd::CDecoder(), 16 | NCompress::NPpmd::CEncoder(), 17 | 0x30401, 18 | "PPMD") 19 | } -------------------------------------------------------------------------------- /CPP/7zip/Compress/RarCodecsRegister.cpp: -------------------------------------------------------------------------------- 1 | // RarCodecsRegister.cpp 2 | 3 | #include "StdAfx.h" 4 | 5 | #include "../Common/RegisterCodec.h" 6 | 7 | #include "Rar1Decoder.h" 8 | #include "Rar2Decoder.h" 9 | #include "Rar3Decoder.h" 10 | #include "Rar5Decoder.h" 11 | 12 | namespace NSRAR5{ 13 | #define CREATE_CODEC(x) REGISTER_CODEC_CREATE(CreateCodec ## x, NCompress::NRar ## x::CDecoder()) 14 | 15 | CREATE_CODEC(1) 16 | CREATE_CODEC(2) 17 | CREATE_CODEC(3) 18 | CREATE_CODEC(5) 19 | 20 | #define RAR_CODEC(x, name) { CreateCodec ## x, NULL, 0x40300 + x, "Rar" name, 1, false } 21 | 22 | REGISTER_CODECS_VAR 23 | { 24 | RAR_CODEC(1, "1"), 25 | RAR_CODEC(2, "2"), 26 | RAR_CODEC(3, "3"), 27 | RAR_CODEC(5, "5"), 28 | }; 29 | 30 | REGISTER_CODECS(Rar) 31 | } -------------------------------------------------------------------------------- /CPP/7zip/Compress/StdAfx.h: -------------------------------------------------------------------------------- 1 | // StdAfx.h 2 | 3 | #ifndef __STDAFX_H 4 | #define __STDAFX_H 5 | 6 | #include "../../Common/Common.h" 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /CPP/7zip/Compress/XpressDecoder.h: -------------------------------------------------------------------------------- 1 | // XpressDecoder.h 2 | 3 | #ifndef __XPRESS_DECODER_H 4 | #define __XPRESS_DECODER_H 5 | 6 | namespace NCompress { 7 | namespace NXpress { 8 | 9 | HRESULT Decode(const Byte *in, size_t inSize, Byte *out, size_t outSize); 10 | 11 | }} 12 | 13 | #endif 14 | -------------------------------------------------------------------------------- /CPP/7zip/Compress/makefile: -------------------------------------------------------------------------------- 1 | DIRS = \ 2 | LZMA_Alone\~ \ 3 | 4 | all: $(DIRS) 5 | 6 | $(DIRS): 7 | !include "../SubBuild.mak" 8 | -------------------------------------------------------------------------------- /CPP/7zip/Crc.mak: -------------------------------------------------------------------------------- 1 | C_OBJS = $(C_OBJS) \ 2 | $O\7zCrc.obj 3 | !IF "$(CPU)" == "IA64" || "$(CPU)" == "MIPS" || "$(CPU)" == "ARM" 4 | C_OBJS = $(C_OBJS) \ 5 | !ELSE 6 | ASM_OBJS = $(ASM_OBJS) \ 7 | !ENDIF 8 | $O\7zCrcOpt.obj 9 | -------------------------------------------------------------------------------- /CPP/7zip/Crc64.mak: -------------------------------------------------------------------------------- 1 | C_OBJS = $(C_OBJS) \ 2 | $O\XzCrc64.obj 3 | !IF "$(CPU)" == "IA64" || "$(CPU)" == "MIPS" || "$(CPU)" == "ARM" 4 | C_OBJS = $(C_OBJS) \ 5 | !ELSE 6 | ASM_OBJS = $(ASM_OBJS) \ 7 | !ENDIF 8 | $O\XzCrc64Opt.obj 9 | -------------------------------------------------------------------------------- /CPP/7zip/Crypto/7zAesRegister.cpp: -------------------------------------------------------------------------------- 1 | // 7zAesRegister.cpp 2 | 3 | #include "StdAfx.h" 4 | 5 | #include "../Common/RegisterCodec.h" 6 | 7 | #include "7zAes.h" 8 | namespace NS7zAES{ 9 | REGISTER_FILTER_E(7zAES, 10 | NCrypto::N7z::CDecoder(), 11 | NCrypto::N7z::CEncoder(), 12 | 0x6F10701, "7zAES") 13 | } -------------------------------------------------------------------------------- /CPP/7zip/Crypto/Codec.def: -------------------------------------------------------------------------------- 1 | EXPORTS 2 | CreateObject PRIVATE 3 | GetNumberOfMethods PRIVATE 4 | GetMethodProperty PRIVATE 5 | -------------------------------------------------------------------------------- /CPP/7zip/Crypto/HmacSha256.h: -------------------------------------------------------------------------------- 1 | // HmacSha256.h 2 | // Implements HMAC-SHA-256 (RFC2104, FIPS-198) 3 | 4 | #ifndef __CRYPTO_HMAC_SHA256_H 5 | #define __CRYPTO_HMAC_SHA256_H 6 | 7 | #include "../../../C/Sha256.h" 8 | 9 | namespace NCrypto { 10 | namespace NSha256 { 11 | 12 | const unsigned kDigestSize = SHA256_DIGEST_SIZE; 13 | 14 | class CHmac 15 | { 16 | CSha256 _sha; 17 | CSha256 _sha2; 18 | public: 19 | void SetKey(const Byte *key, size_t keySize); 20 | void Update(const Byte *data, size_t dataSize) { Sha256_Update(&_sha, data, dataSize); } 21 | void Final(Byte *mac); 22 | // void Final(Byte *mac, size_t macSize); 23 | }; 24 | 25 | }} 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /CPP/7zip/Crypto/MyAesReg.cpp: -------------------------------------------------------------------------------- 1 | // MyAesReg.cpp 2 | 3 | #include "StdAfx.h" 4 | 5 | #include "../Common/RegisterCodec.h" 6 | 7 | #include "MyAes.h" 8 | namespace NSAES256CBC{ 9 | REGISTER_FILTER_E(AES256CBC, 10 | NCrypto::CAesCbcDecoder(32), 11 | NCrypto::CAesCbcEncoder(32), 12 | 0x6F00181, "AES256CBC") 13 | } -------------------------------------------------------------------------------- /CPP/7zip/Crypto/Pbkdf2HmacSha1.h: -------------------------------------------------------------------------------- 1 | // Pbkdf2HmacSha1.h 2 | // Password-Based Key Derivation Function (RFC 2898, PKCS #5) based on HMAC-SHA-1 3 | 4 | #ifndef __CRYPTO_PBKDF2_HMAC_SHA1_H 5 | #define __CRYPTO_PBKDF2_HMAC_SHA1_H 6 | 7 | #include 8 | 9 | #include "../../Common/MyTypes.h" 10 | 11 | namespace NCrypto { 12 | namespace NSha1 { 13 | 14 | void Pbkdf2Hmac(const Byte *pwd, size_t pwdSize, const Byte *salt, size_t saltSize, 15 | UInt32 numIterations, Byte *key, size_t keySize); 16 | 17 | void Pbkdf2Hmac32(const Byte *pwd, size_t pwdSize, const UInt32 *salt, size_t saltSize, 18 | UInt32 numIterations, UInt32 *key, size_t keySize); 19 | 20 | }} 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /CPP/7zip/Crypto/RandGen.h: -------------------------------------------------------------------------------- 1 | // RandGen.h 2 | 3 | #ifndef __CRYPTO_RAND_GEN_H 4 | #define __CRYPTO_RAND_GEN_H 5 | 6 | #include "../../../C/Sha256.h" 7 | 8 | class CRandomGenerator 9 | { 10 | Byte _buff[SHA256_DIGEST_SIZE]; 11 | bool _needInit; 12 | 13 | void Init(); 14 | public: 15 | CRandomGenerator(): _needInit(true) {}; 16 | void Generate(Byte *data, unsigned size); 17 | }; 18 | 19 | extern CRandomGenerator g_RandomGenerator; 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /CPP/7zip/Crypto/StdAfx.h: -------------------------------------------------------------------------------- 1 | // StdAfx.h 2 | 3 | #ifndef __STDAFX_H 4 | #define __STDAFX_H 5 | 6 | #include "../../Common/Common.h" 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /CPP/7zip/IDecl.h: -------------------------------------------------------------------------------- 1 | // IDecl.h 2 | 3 | #ifndef __IDECL_H 4 | #define __IDECL_H 5 | 6 | #include "../Common/MyUnknown.h" 7 | 8 | #define k_7zip_GUID_Data1 0x23170F69 9 | #define k_7zip_GUID_Data2 0x40C1 10 | 11 | #define k_7zip_GUID_Data3_Common 0x278A 12 | 13 | #define k_7zip_GUID_Data3_Decoder 0x2790 14 | #define k_7zip_GUID_Data3_Encoder 0x2791 15 | #define k_7zip_GUID_Data3_Hasher 0x2792 16 | 17 | 18 | #define DECL_INTERFACE_SUB(i, base, groupId, subId) \ 19 | DEFINE_GUID(IID_ ## i, \ 20 | k_7zip_GUID_Data1, \ 21 | k_7zip_GUID_Data2, \ 22 | k_7zip_GUID_Data3_Common, \ 23 | 0, 0, 0, (groupId), 0, (subId), 0, 0); \ 24 | struct i: public base 25 | 26 | #define DECL_INTERFACE(i, groupId, subId) DECL_INTERFACE_SUB(i, IUnknown, groupId, subId) 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /CPP/7zip/IPassword.h: -------------------------------------------------------------------------------- 1 | // IPassword.h 2 | 3 | #ifndef __IPASSWORD_H 4 | #define __IPASSWORD_H 5 | 6 | #include "../Common/MyTypes.h" 7 | #include "../Common/MyUnknown.h" 8 | 9 | #include "IDecl.h" 10 | 11 | #define PASSWORD_INTERFACE(i, x) DECL_INTERFACE(i, 5, x) 12 | 13 | PASSWORD_INTERFACE(ICryptoGetTextPassword, 0x10) 14 | { 15 | STDMETHOD(CryptoGetTextPassword)(BSTR *password) PURE; 16 | }; 17 | 18 | PASSWORD_INTERFACE(ICryptoGetTextPassword2, 0x11) 19 | { 20 | STDMETHOD(CryptoGetTextPassword2)(Int32 *passwordIsDefined, BSTR *password) PURE; 21 | }; 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /CPP/7zip/IProgress.h: -------------------------------------------------------------------------------- 1 | // IProgress.h 2 | 3 | #ifndef __IPROGRESS_H 4 | #define __IPROGRESS_H 5 | 6 | #include "../Common/MyTypes.h" 7 | 8 | #include "IDecl.h" 9 | 10 | #define INTERFACE_IProgress(x) \ 11 | STDMETHOD(SetTotal)(UInt64 total) x; \ 12 | STDMETHOD(SetCompleted)(const UInt64 *completeValue) x; \ 13 | 14 | DECL_INTERFACE(IProgress, 0, 5) 15 | { 16 | INTERFACE_IProgress(PURE) 17 | }; 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /CPP/7zip/MyVersion.h: -------------------------------------------------------------------------------- 1 | #define USE_COPYRIGHT_CR 2 | #include "../../C/7zVersion.h" 3 | -------------------------------------------------------------------------------- /CPP/7zip/MyVersionInfo.rc: -------------------------------------------------------------------------------- 1 | #include "MyVersion.h" 2 | #include "..\..\C\7zVersion.rc" 3 | -------------------------------------------------------------------------------- /CPP/7zip/SubBuild.mak: -------------------------------------------------------------------------------- 1 | cd $(@D) 2 | $(MAKE) -nologo $(TARGETS) 3 | cd .. 4 | -------------------------------------------------------------------------------- /CPP/7zip/UI/Agent/StdAfx.h: -------------------------------------------------------------------------------- 1 | // StdAfx.h 2 | 3 | #ifndef __STDAFX_H 4 | #define __STDAFX_H 5 | 6 | #include "../../../Common/Common.h" 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /CPP/7zip/UI/Agent/UpdateCallbackAgent.h: -------------------------------------------------------------------------------- 1 | // UpdateCallbackAgent.h 2 | 3 | #ifndef __UPDATE_CALLBACK_AGENT_H 4 | #define __UPDATE_CALLBACK_AGENT_H 5 | 6 | #include "../Common/UpdateCallback.h" 7 | 8 | #include "IFolderArchive.h" 9 | 10 | class CUpdateCallbackAgent: public IUpdateCallbackUI 11 | { 12 | INTERFACE_IUpdateCallbackUI(;) 13 | 14 | CMyComPtr _cryptoGetTextPassword; 15 | CMyComPtr Callback; 16 | CMyComPtr Callback2; 17 | CMyComPtr _compressProgress; 18 | public: 19 | void SetCallback(IFolderArchiveUpdateCallback *callback); 20 | }; 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /CPP/7zip/UI/Client7z/Client7z.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 6.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "Client7z"=.\Client7z.dsp - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | }}} 15 | 16 | ############################################################################### 17 | 18 | Global: 19 | 20 | Package=<5> 21 | {{{ 22 | }}} 23 | 24 | Package=<3> 25 | {{{ 26 | }}} 27 | 28 | ############################################################################### 29 | 30 | -------------------------------------------------------------------------------- /CPP/7zip/UI/Client7z/StdAfx.cpp: -------------------------------------------------------------------------------- 1 | // StdAfx.cpp 2 | 3 | #include "StdAfx.h" 4 | -------------------------------------------------------------------------------- /CPP/7zip/UI/Client7z/StdAfx.h: -------------------------------------------------------------------------------- 1 | // StdAfx.h 2 | 3 | #ifndef __STDAFX_H 4 | #define __STDAFX_H 5 | 6 | #include "../../../Common/Common.h" 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /CPP/7zip/UI/Client7z/makefile: -------------------------------------------------------------------------------- 1 | PROG = 7zcl.exe 2 | MY_CONSOLE = 1 3 | 4 | CURRENT_OBJS = \ 5 | $O\Client7z.obj \ 6 | 7 | COMMON_OBJS = \ 8 | $O\IntToString.obj \ 9 | $O\NewHandler.obj \ 10 | $O\MyString.obj \ 11 | $O\StringConvert.obj \ 12 | $O\StringToInt.obj \ 13 | $O\MyVector.obj \ 14 | $O\Wildcard.obj \ 15 | 16 | WIN_OBJS = \ 17 | $O\DLL.obj \ 18 | $O\FileDir.obj \ 19 | $O\FileFind.obj \ 20 | $O\FileIO.obj \ 21 | $O\FileName.obj \ 22 | $O\PropVariant.obj \ 23 | $O\PropVariantConv.obj \ 24 | 25 | 7ZIP_COMMON_OBJS = \ 26 | $O\FileStreams.obj \ 27 | 28 | !include "../../7zip.mak" 29 | -------------------------------------------------------------------------------- /CPP/7zip/UI/Client7z/resource.rc: -------------------------------------------------------------------------------- 1 | #include "../../MyVersionInfo.rc" 2 | 3 | MY_VERSION_INFO_APP("7-Zip client", "7zcl") 4 | -------------------------------------------------------------------------------- /CPP/7zip/UI/Common/ArchiveName.h: -------------------------------------------------------------------------------- 1 | // ArchiveName.h 2 | 3 | #ifndef __ARCHIVE_NAME_H 4 | #define __ARCHIVE_NAME_H 5 | 6 | #include "../../../Common/MyString.h" 7 | 8 | #include "../../../Windows/FileFind.h" 9 | 10 | UString CreateArchiveName(const UString &path, bool fromPrev, bool keepName); 11 | UString CreateArchiveName(const NWindows::NFile::NFind::CFileInfo &fileInfo, bool keepName); 12 | 13 | #endif 14 | -------------------------------------------------------------------------------- /CPP/7zip/UI/Common/CompressCall.h: -------------------------------------------------------------------------------- 1 | // CompressCall.h 2 | 3 | #ifndef __COMPRESS_CALL_H 4 | #define __COMPRESS_CALL_H 5 | 6 | #include "../../../Common/MyString.h" 7 | 8 | UString GetQuotedString(const UString &s); 9 | 10 | HRESULT CompressFiles( 11 | const UString &arcPathPrefix, 12 | const UString &arcName, 13 | const UString &arcType, 14 | bool addExtension, 15 | const UStringVector &names, 16 | bool email, bool showDialog, bool waitFinish); 17 | 18 | void ExtractArchives(const UStringVector &arcPaths, const UString &outFolder, bool showDialog, bool elimDup); 19 | void TestArchives(const UStringVector &arcPaths); 20 | void CalcChecksum(const UStringVector &paths, const UString &methodName); 21 | void Benchmark(bool totalMode); 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /CPP/7zip/UI/Common/DefaultName.h: -------------------------------------------------------------------------------- 1 | // DefaultName.h 2 | 3 | #ifndef __DEFAULT_NAME_H 4 | #define __DEFAULT_NAME_H 5 | 6 | #include "../../../Common/MyString.h" 7 | 8 | UString GetDefaultName2(const UString &fileName, 9 | const UString &extension, const UString &addSubExtension); 10 | 11 | #endif 12 | -------------------------------------------------------------------------------- /CPP/7zip/UI/Common/EnumDirItems.h: -------------------------------------------------------------------------------- 1 | // EnumDirItems.h 2 | 3 | #ifndef __ENUM_DIR_ITEMS_H 4 | #define __ENUM_DIR_ITEMS_H 5 | 6 | #include "../../../Common/Wildcard.h" 7 | 8 | #include "../../../Windows/FileFind.h" 9 | 10 | #include "DirItem.h" 11 | 12 | void AddDirFileInfo(int phyParent, int logParent, int secureIndex, 13 | const NWindows::NFile::NFind::CFileInfo &fi, CObjectVector &dirItems); 14 | 15 | HRESULT EnumerateItems( 16 | const NWildcard::CCensor &censor, 17 | NWildcard::ECensorPathMode pathMode, 18 | const UString &addPathPrefix, 19 | CDirItems &dirItems); 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /CPP/7zip/UI/Common/ExitCode.h: -------------------------------------------------------------------------------- 1 | // ExitCode.h 2 | 3 | #ifndef __EXIT_CODE_H 4 | #define __EXIT_CODE_H 5 | 6 | namespace NExitCode { 7 | 8 | enum EEnum { 9 | 10 | kSuccess = 0, // Successful operation 11 | kWarning = 1, // Non fatal error(s) occurred 12 | kFatalError = 2, // A fatal error occurred 13 | // kCRCError = 3, // A CRC error occurred when unpacking 14 | // kLockedArchive = 4, // Attempt to modify an archive previously locked 15 | // kWriteError = 5, // Write to disk error 16 | // kOpenError = 6, // Open file error 17 | kUserError = 7, // Command line option error 18 | kMemoryError = 8, // Not enough memory for operation 19 | // kCreateFileError = 9, // Create file error 20 | 21 | kUserBreak = 255 // User stopped the process 22 | 23 | }; 24 | 25 | } 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /CPP/7zip/UI/Common/ExtractMode.h: -------------------------------------------------------------------------------- 1 | // ExtractMode.h 2 | 3 | #ifndef __EXTRACT_MODE_H 4 | #define __EXTRACT_MODE_H 5 | 6 | namespace NExtract { 7 | 8 | namespace NPathMode 9 | { 10 | enum EEnum 11 | { 12 | kFullPaths, 13 | kCurPaths, 14 | kNoPaths, 15 | kAbsPaths, 16 | kNoPathsAlt // alt streams must be extracted without name of base file 17 | }; 18 | } 19 | 20 | namespace NOverwriteMode 21 | { 22 | enum EEnum 23 | { 24 | kAsk, 25 | kOverwrite, 26 | kSkip, 27 | kRename, 28 | kRenameExisting 29 | }; 30 | } 31 | 32 | } 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /CPP/7zip/UI/Common/ExtractingFilePath.h: -------------------------------------------------------------------------------- 1 | // ExtractingFilePath.h 2 | 3 | #ifndef __EXTRACTING_FILE_PATH_H 4 | #define __EXTRACTING_FILE_PATH_H 5 | 6 | #include "../../../Common/MyString.h" 7 | 8 | #ifdef _WIN32 9 | void Correct_AltStream_Name(UString &s); 10 | #endif 11 | 12 | // replaces unsuported characters, and replaces "." , ".." and "" to "[]" 13 | UString Get_Correct_FsFile_Name(const UString &name); 14 | 15 | void Correct_FsPath(bool absIsAllowed, UStringVector &parts, bool isDir); 16 | 17 | UString MakePathFromParts(const UStringVector &parts); 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /CPP/7zip/UI/Common/PropIDUtils.h: -------------------------------------------------------------------------------- 1 | // PropIDUtils.h 2 | 3 | #ifndef __PROPID_UTILS_H 4 | #define __PROPID_UTILS_H 5 | 6 | #include "../../../Common/MyString.h" 7 | 8 | // provide at least 64 bytes for buffer including zero-end 9 | void ConvertPropertyToShortString(char *dest, const PROPVARIANT &propVariant, PROPID propID, bool full = true) throw(); 10 | void ConvertPropertyToString(UString &dest, const PROPVARIANT &propVariant, PROPID propID, bool full = true); 11 | 12 | bool ConvertNtReparseToString(const Byte *data, UInt32 size, UString &s); 13 | void ConvertNtSecureToString(const Byte *data, UInt32 size, AString &s); 14 | bool CheckNtSecure(const Byte *data, UInt32 size) throw();; 15 | 16 | void ConvertWinAttribToString(char *s, UInt32 wa) throw(); 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /CPP/7zip/UI/Common/Property.h: -------------------------------------------------------------------------------- 1 | // Property.h 2 | 3 | #ifndef __7Z_PROPERTY_H 4 | #define __7Z_PROPERTY_H 5 | 6 | #include "../../../Common/MyString.h" 7 | 8 | struct CProperty 9 | { 10 | UString Name; 11 | UString Value; 12 | }; 13 | 14 | #endif 15 | -------------------------------------------------------------------------------- /CPP/7zip/UI/Common/SetProperties.h: -------------------------------------------------------------------------------- 1 | // SetProperties.h 2 | 3 | #ifndef __SETPROPERTIES_H 4 | #define __SETPROPERTIES_H 5 | 6 | #include "Property.h" 7 | 8 | HRESULT SetProperties(IUnknown *unknown, const CObjectVector &properties); 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /CPP/7zip/UI/Common/SortUtils.cpp: -------------------------------------------------------------------------------- 1 | // SortUtils.cpp 2 | 3 | #include "StdAfx.h" 4 | 5 | #include "../../../Common/Wildcard.h" 6 | 7 | #include "SortUtils.h" 8 | 9 | static int CompareStrings(const unsigned *p1, const unsigned *p2, void *param) 10 | { 11 | const UStringVector &strings = *(const UStringVector *)param; 12 | return CompareFileNames(strings[*p1], strings[*p2]); 13 | } 14 | 15 | void SortFileNames(const UStringVector &strings, CUIntVector &indices) 16 | { 17 | const unsigned numItems = strings.Size(); 18 | indices.ClearAndSetSize(numItems); 19 | if (numItems == 0) 20 | return; 21 | unsigned *vals = &indices[0]; 22 | for (unsigned i = 0; i < numItems; i++) 23 | vals[i] = i; 24 | indices.Sort(CompareStrings, (void *)&strings); 25 | } 26 | -------------------------------------------------------------------------------- /CPP/7zip/UI/Common/SortUtils.h: -------------------------------------------------------------------------------- 1 | // SortUtils.h 2 | 3 | #ifndef __SORT_UTLS_H 4 | #define __SORT_UTLS_H 5 | 6 | #include "../../../Common/MyString.h" 7 | 8 | void SortFileNames(const UStringVector &strings, CUIntVector &indices); 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /CPP/7zip/UI/Common/StdAfx.h: -------------------------------------------------------------------------------- 1 | // StdAfx.h 2 | 3 | #ifndef __STDAFX_H 4 | #define __STDAFX_H 5 | 6 | #include "../../../Common/Common.h" 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /CPP/7zip/UI/Common/TempFiles.cpp: -------------------------------------------------------------------------------- 1 | // TempFiles.cpp 2 | 3 | #include "StdAfx.h" 4 | 5 | #include "../../../Windows/FileDir.h" 6 | 7 | #include "TempFiles.h" 8 | 9 | using namespace NWindows; 10 | using namespace NFile; 11 | 12 | void CTempFiles::Clear() 13 | { 14 | while (!Paths.IsEmpty()) 15 | { 16 | NDir::DeleteFileAlways(Paths.Back()); 17 | Paths.DeleteBack(); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /CPP/7zip/UI/Common/TempFiles.h: -------------------------------------------------------------------------------- 1 | // TempFiles.h 2 | 3 | #ifndef __TEMP_FILES_H 4 | #define __TEMP_FILES_H 5 | 6 | #include "../../../Common/MyString.h" 7 | 8 | class CTempFiles 9 | { 10 | void Clear(); 11 | public: 12 | FStringVector Paths; 13 | ~CTempFiles() { Clear(); } 14 | }; 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /CPP/7zip/UI/Common/UpdatePair.h: -------------------------------------------------------------------------------- 1 | // UpdatePair.h 2 | 3 | #ifndef __UPDATE_PAIR_H 4 | #define __UPDATE_PAIR_H 5 | 6 | #include "DirItem.h" 7 | #include "UpdateAction.h" 8 | 9 | #include "../../Archive/IArchive.h" 10 | 11 | struct CUpdatePair 12 | { 13 | NUpdateArchive::NPairState::EEnum State; 14 | int ArcIndex; 15 | int DirIndex; 16 | int HostIndex; // >= 0 for alt streams only, contains index of host pair 17 | 18 | CUpdatePair(): ArcIndex(-1), DirIndex(-1), HostIndex(-1) {} 19 | }; 20 | 21 | void GetUpdatePairInfoList( 22 | const CDirItems &dirItems, 23 | const CObjectVector &arcItems, 24 | NFileTimeType::EEnum fileTimeType, 25 | CRecordVector &updatePairs); 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /CPP/7zip/UI/Common/WorkDir.h: -------------------------------------------------------------------------------- 1 | // WorkDir.h 2 | 3 | #ifndef __WORK_DIR_H 4 | #define __WORK_DIR_H 5 | 6 | #include "../../../Windows/FileDir.h" 7 | 8 | #include "../../Common/FileStreams.h" 9 | 10 | #include "ZipRegistry.h" 11 | 12 | FString GetWorkDir(const NWorkDir::CInfo &workDirInfo, const FString &path, FString &fileName); 13 | 14 | class CWorkDirTempFile 15 | { 16 | FString _originalPath; 17 | NWindows::NFile::NDir::CTempFile _tempFile; 18 | COutFileStream *_outStreamSpec; 19 | public: 20 | CMyComPtr OutStream; 21 | 22 | HRESULT CreateTempFile(const FString &originalPath); 23 | HRESULT MoveToOriginal(bool deleteOriginal); 24 | }; 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /CPP/7zip/UI/Console/BenchCon.h: -------------------------------------------------------------------------------- 1 | // BenchCon.h 2 | 3 | #ifndef __BENCH_CON_H 4 | #define __BENCH_CON_H 5 | 6 | #include 7 | 8 | #include "../../Common/CreateCoder.h" 9 | #include "../../UI/Common/Property.h" 10 | 11 | HRESULT BenchCon(DECL_EXTERNAL_CODECS_LOC_VARS 12 | const CObjectVector &props, UInt32 numIterations, FILE *f); 13 | 14 | #endif 15 | -------------------------------------------------------------------------------- /CPP/7zip/UI/Console/Console.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 6.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "Console"=".\Console.dsp" - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | }}} 15 | 16 | ############################################################################### 17 | 18 | Global: 19 | 20 | Package=<5> 21 | {{{ 22 | }}} 23 | 24 | Package=<3> 25 | {{{ 26 | }}} 27 | 28 | ############################################################################### 29 | 30 | -------------------------------------------------------------------------------- /CPP/7zip/UI/Console/Console.mak: -------------------------------------------------------------------------------- 1 | CONSOLE_OBJS = \ 2 | $O\BenchCon.obj \ 3 | $O\ConsoleClose.obj \ 4 | $O\ExtractCallbackConsole.obj \ 5 | $O\HashCon.obj \ 6 | $O\List.obj \ 7 | $O\Main.obj \ 8 | $O\MainAr.obj \ 9 | $O\OpenCallbackConsole.obj \ 10 | $O\PercentPrinter.obj \ 11 | $O\UpdateCallbackConsole.obj \ 12 | $O\UserInputUtils.obj \ 13 | 14 | UI_COMMON_OBJS = \ 15 | $O\ArchiveCommandLine.obj \ 16 | $O\ArchiveExtractCallback.obj \ 17 | $O\ArchiveOpenCallback.obj \ 18 | $O\Bench.obj \ 19 | $O\DefaultName.obj \ 20 | $O\EnumDirItems.obj \ 21 | $O\Extract.obj \ 22 | $O\ExtractingFilePath.obj \ 23 | $O\HashCalc.obj \ 24 | $O\LoadCodecs.obj \ 25 | $O\OpenArchive.obj \ 26 | $O\PropIDUtils.obj \ 27 | $O\SetProperties.obj \ 28 | $O\SortUtils.obj \ 29 | $O\TempFiles.obj \ 30 | $O\Update.obj \ 31 | $O\UpdateAction.obj \ 32 | $O\UpdateCallback.obj \ 33 | $O\UpdatePair.obj \ 34 | $O\UpdateProduce.obj \ 35 | 36 | # 37 | -------------------------------------------------------------------------------- /CPP/7zip/UI/Console/ConsoleClose.h: -------------------------------------------------------------------------------- 1 | // ConsoleClose.h 2 | 3 | #ifndef __CONSOLE_CLOSE_H 4 | #define __CONSOLE_CLOSE_H 5 | 6 | namespace NConsoleClose { 7 | 8 | extern unsigned g_BreakCounter; 9 | 10 | inline bool TestBreakSignal() 11 | { 12 | #ifdef UNDER_CE 13 | return false; 14 | #else 15 | return (g_BreakCounter != 0); 16 | #endif 17 | } 18 | 19 | class CCtrlHandlerSetter 20 | { 21 | public: 22 | CCtrlHandlerSetter(); 23 | virtual ~CCtrlHandlerSetter(); 24 | }; 25 | 26 | class CCtrlBreakException 27 | {}; 28 | 29 | // void CheckCtrlBreak(); 30 | 31 | } 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /CPP/7zip/UI/Console/List.h: -------------------------------------------------------------------------------- 1 | // List.h 2 | 3 | #ifndef __LIST_H 4 | #define __LIST_H 5 | 6 | #include "../../../Common/Wildcard.h" 7 | 8 | #include "../Common/LoadCodecs.h" 9 | 10 | HRESULT ListArchives(CCodecs *codecs, 11 | const CObjectVector &types, 12 | const CIntVector &excludedFormats, 13 | bool stdInMode, 14 | UStringVector &archivePaths, UStringVector &archivePathsFull, 15 | bool processAltStreams, bool showAltStreams, 16 | const NWildcard::CCensorNode &wildcardCensor, 17 | bool enableHeaders, bool techMode, 18 | #ifndef _NO_CRYPTO 19 | bool &passwordEnabled, UString &password, 20 | #endif 21 | #ifndef _SFX 22 | const CObjectVector *props, 23 | #endif 24 | UInt64 &errors, 25 | UInt64 &numWarnings); 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /CPP/7zip/UI/Console/StdAfx.cpp: -------------------------------------------------------------------------------- 1 | // StdAfx.cpp 2 | 3 | #include "StdAfx.h" 4 | -------------------------------------------------------------------------------- /CPP/7zip/UI/Console/StdAfx.h: -------------------------------------------------------------------------------- 1 | // StdAfx.h 2 | 3 | #ifndef __STDAFX_H 4 | #define __STDAFX_H 5 | 6 | #include "../../../Common/Common.h" 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /CPP/7zip/UI/Console/UserInputUtils.h: -------------------------------------------------------------------------------- 1 | // UserInputUtils.h 2 | 3 | #ifndef __USER_INPUT_UTILS_H 4 | #define __USER_INPUT_UTILS_H 5 | 6 | #include "../../../Common/StdOutStream.h" 7 | 8 | namespace NUserAnswerMode { 9 | 10 | enum EEnum 11 | { 12 | kYes, 13 | kNo, 14 | kYesAll, 15 | kNoAll, 16 | kAutoRenameAll, 17 | kQuit 18 | }; 19 | } 20 | 21 | NUserAnswerMode::EEnum ScanUserYesNoAllQuit(CStdOutStream *outStream); 22 | UString GetPassword(CStdOutStream *outStream); 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /CPP/7zip/UI/Console/resource.rc: -------------------------------------------------------------------------------- 1 | #include "../../MyVersionInfo.rc" 2 | 3 | MY_VERSION_INFO_APP("7-Zip Console", "7z") 4 | -------------------------------------------------------------------------------- /CPP/7zip/UI/Explorer/7-zip.dll.manifest: -------------------------------------------------------------------------------- 1 | 7-Zip Extension. 2 | -------------------------------------------------------------------------------- /CPP/7zip/UI/Explorer/ContextMenuFlags.h: -------------------------------------------------------------------------------- 1 | // ContextMenuFlags.h 2 | 3 | #ifndef __CONTEXT_MENU_FLAGS_H 4 | #define __CONTEXT_MENU_FLAGS_H 5 | 6 | namespace NContextMenuFlags 7 | { 8 | const UInt32 kExtract = 1 << 0; 9 | const UInt32 kExtractHere = 1 << 1; 10 | const UInt32 kExtractTo = 1 << 2; 11 | 12 | const UInt32 kTest = 1 << 4; 13 | const UInt32 kOpen = 1 << 5; 14 | const UInt32 kOpenAs = 1 << 6; 15 | 16 | const UInt32 kCompress = 1 << 8; 17 | const UInt32 kCompressTo7z = 1 << 9; 18 | const UInt32 kCompressEmail = 1 << 10; 19 | const UInt32 kCompressTo7zEmail = 1 << 11; 20 | const UInt32 kCompressToZip = 1 << 12; 21 | const UInt32 kCompressToZipEmail = 1 << 13; 22 | 23 | const UInt32 kCRC = (UInt32)1 << 31; 24 | } 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /CPP/7zip/UI/Explorer/Explorer.def: -------------------------------------------------------------------------------- 1 | ; 7-zip.def 2 | 3 | LIBRARY "7-zip" 4 | 5 | EXPORTS 6 | DllCanUnloadNow PRIVATE 7 | DllGetClassObject PRIVATE 8 | DllRegisterServer PRIVATE 9 | DllUnregisterServer PRIVATE 10 | -------------------------------------------------------------------------------- /CPP/7zip/UI/Explorer/Explorer.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 6.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "Explorer"=".\Explorer.dsp" - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | }}} 15 | 16 | ############################################################################### 17 | 18 | Global: 19 | 20 | Package=<5> 21 | {{{ 22 | }}} 23 | 24 | Package=<3> 25 | {{{ 26 | }}} 27 | 28 | ############################################################################### 29 | 30 | -------------------------------------------------------------------------------- /CPP/7zip/UI/Explorer/MenuLogo.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjieest/lib7z-static/c847005f0358c0c054fa2318aa38c1901703c425/CPP/7zip/UI/Explorer/MenuLogo.bmp -------------------------------------------------------------------------------- /CPP/7zip/UI/Explorer/MyMessages.cpp: -------------------------------------------------------------------------------- 1 | // MyMessages.cpp 2 | 3 | #include "StdAfx.h" 4 | 5 | #include "MyMessages.h" 6 | 7 | #include "../../../Windows/ErrorMsg.h" 8 | #include "../../../Windows/ResourceString.h" 9 | 10 | #include "../FileManager/LangUtils.h" 11 | 12 | using namespace NWindows; 13 | 14 | void ShowErrorMessage(HWND window, LPCWSTR message) 15 | { 16 | ::MessageBoxW(window, message, L"7-Zip", MB_OK | MB_ICONSTOP); 17 | } 18 | 19 | void ShowErrorMessageHwndRes(HWND window, UINT resID) 20 | { 21 | ShowErrorMessage(window, LangString(resID)); 22 | } 23 | 24 | void ShowErrorMessageRes(UINT resID) 25 | { 26 | ShowErrorMessageHwndRes(0, resID); 27 | } 28 | 29 | void ShowErrorMessageDWORD(HWND window, DWORD errorCode) 30 | { 31 | ShowErrorMessage(window, NError::MyFormatMessage(errorCode)); 32 | } 33 | 34 | void ShowLastErrorMessage(HWND window) 35 | { 36 | ShowErrorMessageDWORD(window, ::GetLastError()); 37 | } 38 | -------------------------------------------------------------------------------- /CPP/7zip/UI/Explorer/MyMessages.h: -------------------------------------------------------------------------------- 1 | // MyMessages.h 2 | 3 | #ifndef __MY_MESSAGES_H 4 | #define __MY_MESSAGES_H 5 | 6 | #include "../../../Common/MyString.h" 7 | 8 | void ShowErrorMessage(HWND window, LPCWSTR message); 9 | inline void ShowErrorMessage(LPCWSTR message) { ShowErrorMessage(0, message); } 10 | 11 | void ShowErrorMessageHwndRes(HWND window, UInt32 langID); 12 | void ShowErrorMessageRes(UInt32 langID); 13 | 14 | void ShowLastErrorMessage(HWND window = 0); 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /CPP/7zip/UI/Explorer/RegistryContextMenu.h: -------------------------------------------------------------------------------- 1 | // RegistryContextMenu.h 2 | 3 | #ifndef __REGISTRY_CONTEXT_MENU_H 4 | #define __REGISTRY_CONTEXT_MENU_H 5 | 6 | #ifndef UNDER_CE 7 | 8 | bool CheckContextMenuHandler(const UString &path, UInt32 wow = 0); 9 | LONG SetContextMenuHandler(bool setMode, const UString &path, UInt32 wow = 0); 10 | 11 | #endif 12 | 13 | #endif 14 | -------------------------------------------------------------------------------- /CPP/7zip/UI/Explorer/StdAfx.cpp: -------------------------------------------------------------------------------- 1 | // StdAfx.cpp 2 | 3 | #include "stdafx.h" 4 | -------------------------------------------------------------------------------- /CPP/7zip/UI/Explorer/StdAfx.h: -------------------------------------------------------------------------------- 1 | // StdAfx.h 2 | 3 | #ifndef __STDAFX_H 4 | #define __STDAFX_H 5 | 6 | // #define _WIN32_WINNT 0x0400 7 | #define _WIN32_WINNT 0x0500 8 | #define WINVER _WIN32_WINNT 9 | 10 | #include "../../../Common/Common.h" 11 | 12 | #include 13 | 14 | #endif 15 | -------------------------------------------------------------------------------- /CPP/7zip/UI/Explorer/resource.h: -------------------------------------------------------------------------------- 1 | #define IDS_CONTEXT_FOLDER 2320 2 | #define IDS_CONTEXT_ARCHIVE 2321 3 | #define IDS_CONTEXT_OPEN 2322 4 | #define IDS_CONTEXT_EXTRACT 2323 5 | #define IDS_CONTEXT_COMPRESS 2324 6 | #define IDS_CONTEXT_TEST 2325 7 | #define IDS_CONTEXT_EXTRACT_HERE 2326 8 | #define IDS_CONTEXT_EXTRACT_TO 2327 9 | #define IDS_CONTEXT_COMPRESS_TO 2328 10 | #define IDS_CONTEXT_COMPRESS_EMAIL 2329 11 | #define IDS_CONTEXT_COMPRESS_TO_EMAIL 2330 12 | 13 | #define IDB_MENU_LOGO 190 14 | -------------------------------------------------------------------------------- /CPP/7zip/UI/Explorer/resource.rc: -------------------------------------------------------------------------------- 1 | #include "../../MyVersionInfo.rc" 2 | #include "resource2.rc" 3 | 4 | MY_VERSION_INFO_DLL("7-Zip Shell Extension", "7-zip") 5 | 6 | #ifndef UNDER_CE 7 | 1 24 MOVEABLE PURE "7-zip.dll.manifest" 8 | #endif 9 | -------------------------------------------------------------------------------- /CPP/7zip/UI/Explorer/resource2.rc: -------------------------------------------------------------------------------- 1 | #include "resource.h" 2 | 3 | STRINGTABLE 4 | BEGIN 5 | IDS_CONTEXT_FOLDER "" 6 | IDS_CONTEXT_ARCHIVE "" 7 | IDS_CONTEXT_OPEN "Open archive" 8 | IDS_CONTEXT_EXTRACT "Extract files..." 9 | IDS_CONTEXT_COMPRESS "Add to archive..." 10 | IDS_CONTEXT_TEST "Test archive" 11 | IDS_CONTEXT_EXTRACT_HERE "Extract Here" 12 | IDS_CONTEXT_EXTRACT_TO "Extract to {0}" 13 | IDS_CONTEXT_COMPRESS_TO "Add to {0}" 14 | IDS_CONTEXT_COMPRESS_EMAIL "Compress and email..." 15 | IDS_CONTEXT_COMPRESS_TO_EMAIL "Compress to {0} and email" 16 | END 17 | 18 | IDB_MENU_LOGO BITMAP "../../UI/Explorer/MenuLogo.bmp" 19 | -------------------------------------------------------------------------------- /CPP/7zip/UI/Far/Far.def: -------------------------------------------------------------------------------- 1 | ; 7-ZipFar.def : Declares the module parameters for the DLL. 2 | 3 | LIBRARY "7-ZipFar" 4 | 5 | EXPORTS 6 | ExitFAR 7 | SetStartupInfo 8 | OpenPlugin 9 | OpenFilePlugin 10 | ClosePlugin 11 | GetFindData 12 | FreeFindData 13 | SetDirectory 14 | GetPluginInfo 15 | Configure 16 | GetOpenPluginInfo 17 | GetFiles 18 | PutFiles 19 | DeleteFiles 20 | ProcessKey 21 | 22 | ;SetStartupInfoW 23 | ;OpenPluginW 24 | ;OpenFilePluginW 25 | ;ClosePluginW 26 | ;GetFindDataW 27 | ;FreeFindDataW 28 | ;SetDirectoryW 29 | ;GetPluginInfoW 30 | ;ConfigureW 31 | ;GetOpenPluginInfoW 32 | ;GetFilesW 33 | ;PutFilesW 34 | ;DeleteFilesW 35 | ;ProcessKeyW 36 | -------------------------------------------------------------------------------- /CPP/7zip/UI/Far/Far.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 6.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "Far"=.\Far.dsp - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | }}} 15 | 16 | ############################################################################### 17 | 18 | Global: 19 | 20 | Package=<5> 21 | {{{ 22 | }}} 23 | 24 | Package=<3> 25 | {{{ 26 | }}} 27 | 28 | ############################################################################### 29 | 30 | -------------------------------------------------------------------------------- /CPP/7zip/UI/Far/OverwriteDialogFar.h: -------------------------------------------------------------------------------- 1 | // OverwriteDialogFar.h 2 | 3 | #ifndef __OVERWRITE_DIALOG_FAR_H 4 | #define __OVERWRITE_DIALOG_FAR_H 5 | 6 | #include "../../../Common/MyString.h" 7 | #include "../../../Common/MyTypes.h" 8 | 9 | namespace NOverwriteDialog { 10 | 11 | struct CFileInfo 12 | { 13 | bool SizeIsDefined; 14 | bool TimeIsDefined; 15 | UInt64 Size; 16 | FILETIME Time; 17 | UString Name; 18 | }; 19 | 20 | namespace NResult 21 | { 22 | enum EEnum 23 | { 24 | kYes, 25 | kYesToAll, 26 | kNo, 27 | kNoToAll, 28 | kAutoRename, 29 | kCancel 30 | }; 31 | } 32 | 33 | NResult::EEnum Execute(const CFileInfo &oldFileInfo, const CFileInfo &newFileInfo); 34 | 35 | } 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /CPP/7zip/UI/Far/StdAfx.cpp: -------------------------------------------------------------------------------- 1 | // StdAfx.cpp 2 | 3 | #include "StdAfx.h" 4 | -------------------------------------------------------------------------------- /CPP/7zip/UI/Far/StdAfx.h: -------------------------------------------------------------------------------- 1 | // StdAfx.h 2 | 3 | #ifndef __STDAFX_H 4 | #define __STDAFX_H 5 | 6 | #include "../../../Common/Common.h" 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /CPP/7zip/UI/Far/resource.rc: -------------------------------------------------------------------------------- 1 | #include "../../MyVersionInfo.rc" 2 | 3 | MY_VERSION_INFO_DLL("7-Zip Plugin for FAR Manager", "7-ZipFar") 4 | -------------------------------------------------------------------------------- /CPP/7zip/UI/FileManager/7zFM.exe.manifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7-Zip File Manager. 5 | 6 | 7 | 8 | 9 | 10 | true 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /CPP/7zip/UI/FileManager/7zipLogo.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjieest/lib7z-static/c847005f0358c0c054fa2318aa38c1901703c425/CPP/7zip/UI/FileManager/7zipLogo.ico -------------------------------------------------------------------------------- /CPP/7zip/UI/FileManager/AboutDialog.h: -------------------------------------------------------------------------------- 1 | // AboutDialog.h 2 | 3 | #ifndef __ABOUT_DIALOG_H 4 | #define __ABOUT_DIALOG_H 5 | 6 | #include "../../../Windows/Control/Dialog.h" 7 | 8 | #include "AboutDialogRes.h" 9 | 10 | class CAboutDialog: public NWindows::NControl::CModalDialog 11 | { 12 | public: 13 | virtual bool OnInit(); 14 | virtual void OnHelp(); 15 | virtual bool OnButtonClicked(int buttonID, HWND buttonHWND); 16 | INT_PTR Create(HWND wndParent = 0) { return CModalDialog::Create(IDD_ABOUT, wndParent); } 17 | }; 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /CPP/7zip/UI/FileManager/AboutDialog.rc: -------------------------------------------------------------------------------- 1 | #include "AboutDialogRes.h" 2 | #include "../../GuiCommon.rc" 3 | #include "../../MyVersion.h" 4 | 5 | #define xc 144 6 | #define yc 144 7 | 8 | #define y 93 9 | 10 | IDI_LOGO ICON "../../UI/FileManager/7zipLogo.ico" 11 | 12 | #ifndef SS_REALSIZEIMAGE 13 | #define SS_REALSIZEIMAGE 0x800 14 | #endif 15 | 16 | IDD_ABOUT DIALOG 0, 0, xs, ys MY_MODAL_DIALOG_STYLE MY_FONT 17 | CAPTION "About 7-Zip" 18 | { 19 | DEFPUSHBUTTON "OK", IDOK, bx1, by, bxs, bys 20 | PUSHBUTTON "www.7-zip.org", IDB_ABOUT_HOMEPAGE, bx2, by, bxs, bys 21 | ICON IDI_LOGO, -1, m, m, 32, 32, SS_REALSIZEIMAGE, 22 | LTEXT "", IDT_ABOUT_VERSION, m, 54, xc, 8 23 | LTEXT "", IDT_ABOUT_DATE, m, 67, xc, 8 24 | LTEXT MY_COPYRIGHT, -1, m, 80, xc, 8 25 | LTEXT "7-Zip is free software", IDT_ABOUT_INFO, m, y, xc, (by - y - 1) 26 | } 27 | -------------------------------------------------------------------------------- /CPP/7zip/UI/FileManager/AboutDialogRes.h: -------------------------------------------------------------------------------- 1 | #define IDD_ABOUT 2900 2 | 3 | #define IDT_ABOUT_INFO 2901 4 | 5 | #define IDI_LOGO 100 6 | #define IDT_ABOUT_VERSION 101 7 | #define IDT_ABOUT_DATE 102 8 | #define IDB_ABOUT_HOMEPAGE 110 9 | -------------------------------------------------------------------------------- /CPP/7zip/UI/FileManager/Add.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjieest/lib7z-static/c847005f0358c0c054fa2318aa38c1901703c425/CPP/7zip/UI/FileManager/Add.bmp -------------------------------------------------------------------------------- /CPP/7zip/UI/FileManager/Add2.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjieest/lib7z-static/c847005f0358c0c054fa2318aa38c1901703c425/CPP/7zip/UI/FileManager/Add2.bmp -------------------------------------------------------------------------------- /CPP/7zip/UI/FileManager/BrowseDialog.h: -------------------------------------------------------------------------------- 1 | // BrowseDialog.h 2 | 3 | #ifndef __BROWSE_DIALOG_H 4 | #define __BROWSE_DIALOG_H 5 | 6 | #include "../../../Common/MyString.h" 7 | 8 | bool MyBrowseForFolder(HWND owner, LPCWSTR title, LPCWSTR path, UString &resultPath); 9 | bool MyBrowseForFile(HWND owner, LPCWSTR title, LPCWSTR path, LPCWSTR filterDescription, LPCWSTR filter, UString &resultPath); 10 | 11 | /* CorrectFsPath removes undesirable characters in names (dots and spaces at the end of file) 12 | But it doesn't change "bad" name in any of the following cases: 13 | - path is Super Path (with \\?\ prefix) 14 | - path is relative and relBase is Super Path 15 | - there is file or dir in filesystem with specified "bad" name */ 16 | 17 | bool CorrectFsPath(const UString &relBase, const UString &path, UString &result); 18 | 19 | bool Dlg_CreateFolder(HWND wnd, UString &destName); 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /CPP/7zip/UI/FileManager/BrowseDialogRes.h: -------------------------------------------------------------------------------- 1 | #define IDD_BROWSE 95 2 | 3 | #define IDL_BROWSE 100 4 | #define IDT_BROWSE_FOLDER 101 5 | #define IDE_BROWSE_PATH 102 6 | #define IDC_BROWSE_FILTER 103 7 | 8 | #define IDB_BROWSE_PARENT 110 9 | #define IDB_BROWSE_CREATE_DIR 112 10 | -------------------------------------------------------------------------------- /CPP/7zip/UI/FileManager/ClassDefs.cpp: -------------------------------------------------------------------------------- 1 | // ClassDefs.cpp 2 | 3 | #include "StdAfx.h" 4 | 5 | #include "../../../Common/MyWindows.h" 6 | 7 | #include "../../../Common/MyInitGuid.h" 8 | 9 | #include "../Agent/Agent.h" 10 | 11 | #include "MyWindowsNew.h" 12 | -------------------------------------------------------------------------------- /CPP/7zip/UI/FileManager/ComboDialog.h: -------------------------------------------------------------------------------- 1 | // ComboDialog.h 2 | 3 | #ifndef __COMBO_DIALOG_H 4 | #define __COMBO_DIALOG_H 5 | 6 | #include "../../../Windows/Control/ComboBox.h" 7 | #include "../../../Windows/Control/Dialog.h" 8 | 9 | #include "ComboDialogRes.h" 10 | 11 | class CComboDialog: public NWindows::NControl::CModalDialog 12 | { 13 | NWindows::NControl::CComboBox _comboBox; 14 | virtual void OnOK(); 15 | virtual bool OnInit(); 16 | virtual bool OnSize(WPARAM wParam, int xSize, int ySize); 17 | public: 18 | // bool Sorted; 19 | UString Title; 20 | UString Static; 21 | UString Value; 22 | UStringVector Strings; 23 | 24 | // CComboDialog(): Sorted(false) {}; 25 | INT_PTR Create(HWND parentWindow = 0) { return CModalDialog::Create(IDD_COMBO, parentWindow); } 26 | }; 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /CPP/7zip/UI/FileManager/ComboDialog.rc: -------------------------------------------------------------------------------- 1 | #include "ComboDialogRes.h" 2 | #include "../../GuiCommon.rc" 3 | 4 | #define xc 240 5 | #define yc 64 6 | 7 | IDD_COMBO DIALOG 0, 0, xs, ys MY_MODAL_RESIZE_DIALOG_STYLE MY_FONT 8 | CAPTION "Combo" 9 | { 10 | LTEXT "", IDT_COMBO, m, m, xc, 8 11 | COMBOBOX IDC_COMBO, m, 20, xc, 65, MY_COMBO_WITH_EDIT 12 | OK_CANCEL 13 | } 14 | 15 | #undef xc 16 | #undef yc 17 | -------------------------------------------------------------------------------- /CPP/7zip/UI/FileManager/ComboDialogRes.h: -------------------------------------------------------------------------------- 1 | #define IDD_COMBO 98 2 | 3 | #define IDT_COMBO 100 4 | #define IDC_COMBO 101 5 | -------------------------------------------------------------------------------- /CPP/7zip/UI/FileManager/Copy.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjieest/lib7z-static/c847005f0358c0c054fa2318aa38c1901703c425/CPP/7zip/UI/FileManager/Copy.bmp -------------------------------------------------------------------------------- /CPP/7zip/UI/FileManager/Copy2.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjieest/lib7z-static/c847005f0358c0c054fa2318aa38c1901703c425/CPP/7zip/UI/FileManager/Copy2.bmp -------------------------------------------------------------------------------- /CPP/7zip/UI/FileManager/CopyDialog.h: -------------------------------------------------------------------------------- 1 | // CopyDialog.h 2 | 3 | #ifndef __COPY_DIALOG_H 4 | #define __COPY_DIALOG_H 5 | 6 | #include "../../../Windows/Control/ComboBox.h" 7 | #include "../../../Windows/Control/Dialog.h" 8 | 9 | #include "CopyDialogRes.h" 10 | 11 | const int kCopyDialog_NumInfoLines = 11; 12 | 13 | class CCopyDialog: public NWindows::NControl::CModalDialog 14 | { 15 | NWindows::NControl::CComboBox _path; 16 | virtual void OnOK(); 17 | virtual bool OnInit(); 18 | virtual bool OnSize(WPARAM wParam, int xSize, int ySize); 19 | void OnButtonSetPath(); 20 | bool OnButtonClicked(int buttonID, HWND buttonHWND); 21 | public: 22 | UString Title; 23 | UString Static; 24 | UString Value; 25 | UString Info; 26 | UStringVector Strings; 27 | 28 | INT_PTR Create(HWND parentWindow = 0) { return CModalDialog::Create(IDD_COPY, parentWindow); } 29 | }; 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /CPP/7zip/UI/FileManager/CopyDialog.rc: -------------------------------------------------------------------------------- 1 | #include "CopyDialogRes.h" 2 | #include "../../GuiCommon.rc" 3 | 4 | #define xc 320 5 | #define yc 144 6 | 7 | #define y 40 8 | 9 | IDD_COPY DIALOG 0, 0, xs, ys MY_MODAL_RESIZE_DIALOG_STYLE MY_FONT 10 | CAPTION "Copy" 11 | { 12 | LTEXT "", IDT_COPY, m, m, xc, 8 13 | COMBOBOX IDC_COPY, m, 20, xc - bxsDots - m, 65, MY_COMBO_WITH_EDIT 14 | PUSHBUTTON "...", IDB_COPY_SET_PATH, xs - m - bxsDots, 18, bxsDots, bys, WS_GROUP 15 | LTEXT "", IDT_COPY_INFO, m, y, xc, by - y - 1, SS_NOPREFIX | SS_LEFTNOWORDWRAP 16 | OK_CANCEL 17 | } 18 | 19 | #undef xc 20 | #undef yc 21 | -------------------------------------------------------------------------------- /CPP/7zip/UI/FileManager/CopyDialogRes.h: -------------------------------------------------------------------------------- 1 | #define IDD_COPY 96 2 | 3 | #define IDT_COPY 100 4 | #define IDC_COPY 101 5 | #define IDB_COPY_SET_PATH 102 6 | #define IDT_COPY_INFO 103 7 | 8 | #define IDS_SET_FOLDER 6007 9 | -------------------------------------------------------------------------------- /CPP/7zip/UI/FileManager/Delete.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjieest/lib7z-static/c847005f0358c0c054fa2318aa38c1901703c425/CPP/7zip/UI/FileManager/Delete.bmp -------------------------------------------------------------------------------- /CPP/7zip/UI/FileManager/Delete2.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjieest/lib7z-static/c847005f0358c0c054fa2318aa38c1901703c425/CPP/7zip/UI/FileManager/Delete2.bmp -------------------------------------------------------------------------------- /CPP/7zip/UI/FileManager/DialogSize.h: -------------------------------------------------------------------------------- 1 | // DialogSize.h 2 | 3 | #ifndef __DIALOG_SIZE_H 4 | #define __DIALOG_SIZE_H 5 | 6 | #include "../../../Windows/Control/Dialog.h" 7 | 8 | #ifdef UNDER_CE 9 | #define BIG_DIALOG_SIZE(x, y) bool isBig = NWindows::NControl::IsDialogSizeOK(x, y); 10 | #define SIZED_DIALOG(big) (isBig ? big : big ## _2) 11 | #else 12 | #define BIG_DIALOG_SIZE(x, y) 13 | #define SIZED_DIALOG(big) big 14 | #endif 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /CPP/7zip/UI/FileManager/EditPage.h: -------------------------------------------------------------------------------- 1 | // EditPage.h 2 | 3 | #ifndef __EDIT_PAGE_H 4 | #define __EDIT_PAGE_H 5 | 6 | #include "../../../Windows/Control/PropertyPage.h" 7 | #include "../../../Windows/Control/Edit.h" 8 | 9 | struct CEditPageCtrl 10 | { 11 | NWindows::NControl::CEdit Edit; 12 | bool WasChanged; 13 | int Ctrl; 14 | int Button; 15 | }; 16 | 17 | class CEditPage: public NWindows::NControl::CPropertyPage 18 | { 19 | CEditPageCtrl _ctrls[3]; 20 | 21 | bool _initMode; 22 | public: 23 | virtual bool OnInit(); 24 | virtual void OnNotifyHelp(); 25 | virtual bool OnCommand(int code, int itemID, LPARAM param); 26 | virtual LONG OnApply(); 27 | virtual bool OnButtonClicked(int buttonID, HWND buttonHWND); 28 | }; 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /CPP/7zip/UI/FileManager/EditPage.rc: -------------------------------------------------------------------------------- 1 | #include "EditPageRes.h" 2 | #include "../../GuiCommon.rc" 3 | 4 | #define xc 240 5 | #define yc 80 6 | 7 | IDD_EDIT MY_PAGE 8 | #include "EditPage2.rc" 9 | 10 | #ifdef UNDER_CE 11 | 12 | #undef xc 13 | 14 | #define xc SMALL_PAGE_SIZE_X 15 | 16 | IDD_EDIT_2 MY_PAGE 17 | #include "EditPage2.rc" 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /CPP/7zip/UI/FileManager/EditPage2.rc: -------------------------------------------------------------------------------- 1 | CAPTION "Editor" 2 | { 3 | LTEXT "&View:", IDT_EDIT_VIEWER, m, m, xc, 8 4 | EDITTEXT IDE_EDIT_VIEWER, m, m + 12, xc - m - bxsDots, 14, ES_AUTOHSCROLL 5 | PUSHBUTTON "...", IDB_EDIT_VIEWER, xs - m - bxsDots, m + 11, bxsDots, bys 6 | 7 | LTEXT "&Editor:", IDT_EDIT_EDITOR, m, m + 32, xc, 8 8 | EDITTEXT IDE_EDIT_EDITOR, m, m + 44, xc - m - bxsDots, 14, ES_AUTOHSCROLL 9 | PUSHBUTTON "...", IDB_EDIT_EDITOR, xs - m - bxsDots, m + 43, bxsDots, bys 10 | 11 | LTEXT "&Diff:", IDT_EDIT_DIFF, m, m + 64, xc, 8 12 | EDITTEXT IDE_EDIT_DIFF, m, m + 76, xc - m - bxsDots, 14, ES_AUTOHSCROLL 13 | PUSHBUTTON "...", IDB_EDIT_DIFF, xs - m - bxsDots, m + 75, bxsDots, bys 14 | } 15 | -------------------------------------------------------------------------------- /CPP/7zip/UI/FileManager/EditPageRes.h: -------------------------------------------------------------------------------- 1 | #define IDD_EDIT 2103 2 | #define IDD_EDIT_2 12103 3 | 4 | #define IDT_EDIT_VIEWER 543 5 | #define IDT_EDIT_EDITOR 2104 6 | #define IDT_EDIT_DIFF 2105 7 | 8 | #define IDE_EDIT_VIEWER 100 9 | #define IDB_EDIT_VIEWER 101 10 | 11 | #define IDE_EDIT_EDITOR 102 12 | #define IDB_EDIT_EDITOR 103 13 | 14 | #define IDE_EDIT_DIFF 104 15 | #define IDB_EDIT_DIFF 105 16 | -------------------------------------------------------------------------------- /CPP/7zip/UI/FileManager/EnumFormatEtc.h: -------------------------------------------------------------------------------- 1 | // EnumFormatEtc.h 2 | 3 | #ifndef __ENUMFORMATETC_H 4 | #define __ENUMFORMATETC_H 5 | 6 | #include 7 | 8 | HRESULT CreateEnumFormatEtc(UINT numFormats, const FORMATETC *formats, IEnumFORMATETC **enumFormat); 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /CPP/7zip/UI/FileManager/Extract.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjieest/lib7z-static/c847005f0358c0c054fa2318aa38c1901703c425/CPP/7zip/UI/FileManager/Extract.bmp -------------------------------------------------------------------------------- /CPP/7zip/UI/FileManager/Extract2.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjieest/lib7z-static/c847005f0358c0c054fa2318aa38c1901703c425/CPP/7zip/UI/FileManager/Extract2.bmp -------------------------------------------------------------------------------- /CPP/7zip/UI/FileManager/FM.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 6.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "FM"=.\FM.dsp - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | }}} 15 | 16 | ############################################################################### 17 | 18 | Global: 19 | 20 | Package=<5> 21 | {{{ 22 | }}} 23 | 24 | Package=<3> 25 | {{{ 26 | }}} 27 | 28 | ############################################################################### 29 | 30 | -------------------------------------------------------------------------------- /CPP/7zip/UI/FileManager/FM.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjieest/lib7z-static/c847005f0358c0c054fa2318aa38c1901703c425/CPP/7zip/UI/FileManager/FM.ico -------------------------------------------------------------------------------- /CPP/7zip/UI/FileManager/FileFolderPluginOpen.h: -------------------------------------------------------------------------------- 1 | // FileFolderPluginOpen.h 2 | 3 | #ifndef __FILE_FOLDER_PLUGIN_OPEN_H 4 | #define __FILE_FOLDER_PLUGIN_OPEN_H 5 | 6 | HRESULT OpenFileFolderPlugin(IInStream *inStream, const FString &path, const UString &arcFormat, 7 | HMODULE *module, IFolderFolder **resultFolder, HWND parentWindow, bool &encrypted, UString &password); 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /CPP/7zip/UI/FileManager/FilePlugins.h: -------------------------------------------------------------------------------- 1 | // FilePlugins.h 2 | 3 | #ifndef __FILE_PLUGINS_H 4 | #define __FILE_PLUGINS_H 5 | 6 | #include "RegistryPlugins.h" 7 | 8 | struct CPluginToIcon 9 | { 10 | int PluginIndex; 11 | UString IconPath; 12 | int IconIndex; 13 | 14 | CPluginToIcon(): IconIndex(-1) {} 15 | }; 16 | 17 | struct CExtPlugins 18 | { 19 | UString Ext; 20 | CObjectVector Plugins; 21 | }; 22 | 23 | class CExtDatabase 24 | { 25 | int FindExt(const UString &ext); 26 | public: 27 | CObjectVector Exts; 28 | CObjectVector Plugins; 29 | 30 | void Read(); 31 | }; 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /CPP/7zip/UI/FileManager/FoldersPage.h: -------------------------------------------------------------------------------- 1 | // FoldersPage.h 2 | 3 | #ifndef __FOLDERS_PAGE_H 4 | #define __FOLDERS_PAGE_H 5 | 6 | #include "../../../Windows/Control/PropertyPage.h" 7 | 8 | #include "../Common/ZipRegistry.h" 9 | 10 | class CFoldersPage : public NWindows::NControl::CPropertyPage 11 | { 12 | NWorkDir::CInfo m_WorkDirInfo; 13 | NWindows::NControl::CDialogChildControl m_WorkPath; 14 | 15 | bool _needSave; 16 | bool _initMode; 17 | 18 | void MyEnableControls(); 19 | void ModifiedEvent(); 20 | 21 | void OnFoldersWorkButtonPath(); 22 | int GetWorkMode() const; 23 | void GetWorkDir(NWorkDir::CInfo &workDirInfo); 24 | // bool WasChanged(); 25 | virtual bool OnInit(); 26 | virtual bool OnCommand(int code, int itemID, LPARAM lParam); 27 | virtual void OnNotifyHelp(); 28 | virtual LONG OnApply(); 29 | virtual bool OnButtonClicked(int buttonID, HWND buttonHWND); 30 | }; 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /CPP/7zip/UI/FileManager/FoldersPage.rc: -------------------------------------------------------------------------------- 1 | #include "FoldersPageRes.h" 2 | #include "../../GuiCommon.rc" 3 | 4 | #define xc 240 5 | #define yc 100 6 | 7 | IDD_FOLDERS MY_PAGE 8 | #include "FoldersPage2.rc" 9 | 10 | #ifdef UNDER_CE 11 | 12 | #undef xc 13 | #define xc SMALL_PAGE_SIZE_X 14 | 15 | IDD_FOLDERS_2 MY_PAGE 16 | #include "FoldersPage2.rc" 17 | 18 | #endif 19 | 20 | STRINGTABLE 21 | BEGIN 22 | IDS_FOLDERS_SET_WORK_PATH_TITLE "Specify a location for temporary archive files." 23 | END 24 | -------------------------------------------------------------------------------- /CPP/7zip/UI/FileManager/FoldersPage2.rc: -------------------------------------------------------------------------------- 1 | CAPTION "Folders" 2 | BEGIN 3 | // GROUPBOX "&Working folder", IDT_FOLDERS_WORKING_FOLDER, m, m, xc, 98 4 | 5 | LTEXT "&Working folder", IDT_FOLDERS_WORKING_FOLDER, m, m, xc, 8 6 | CONTROL "&System temp folder", IDR_FOLDERS_WORK_SYSTEM, "Button", BS_AUTORADIOBUTTON | WS_GROUP, 7 | m, 20, xc, 10 8 | CONTROL "&Current", IDR_FOLDERS_WORK_CURRENT, "Button", BS_AUTORADIOBUTTON, 9 | m, 34, xc, 10 10 | CONTROL "Specified:", IDR_FOLDERS_WORK_SPECIFIED, "Button", BS_AUTORADIOBUTTON, 11 | m, 48, xc, 10 12 | EDITTEXT IDE_FOLDERS_WORK_PATH, m + m, 62, xc - m - m - bxsDots, 14, ES_AUTOHSCROLL 13 | PUSHBUTTON "...", IDB_FOLDERS_WORK_PATH, xs - m - bxsDots, 61, bxsDots, bys 14 | CONTROL "Use for removable drives only", IDX_FOLDERS_WORK_FOR_REMOVABLE, MY_CHECKBOX, 15 | m, 86, xc, 10 16 | END 17 | -------------------------------------------------------------------------------- /CPP/7zip/UI/FileManager/FoldersPageRes.h: -------------------------------------------------------------------------------- 1 | #define IDD_FOLDERS 2400 2 | #define IDD_FOLDERS_2 12400 3 | 4 | #define IDT_FOLDERS_WORKING_FOLDER 2401 5 | #define IDR_FOLDERS_WORK_SYSTEM 2402 6 | #define IDR_FOLDERS_WORK_CURRENT 2403 7 | #define IDR_FOLDERS_WORK_SPECIFIED 2404 8 | #define IDX_FOLDERS_WORK_FOR_REMOVABLE 2405 9 | #define IDS_FOLDERS_SET_WORK_PATH_TITLE 2406 10 | 11 | #define IDE_FOLDERS_WORK_PATH 100 12 | #define IDB_FOLDERS_WORK_PATH 101 13 | -------------------------------------------------------------------------------- /CPP/7zip/UI/FileManager/FormatUtils.cpp: -------------------------------------------------------------------------------- 1 | // FormatUtils.cpp 2 | 3 | #include "StdAfx.h" 4 | 5 | #include "../../../Common/IntToString.h" 6 | 7 | #include "FormatUtils.h" 8 | 9 | #include "LangUtils.h" 10 | 11 | UString NumberToString(UInt64 number) 12 | { 13 | wchar_t numberString[32]; 14 | ConvertUInt64ToString(number, numberString); 15 | return numberString; 16 | } 17 | 18 | UString MyFormatNew(const UString &format, const UString &argument) 19 | { 20 | UString result = format; 21 | result.Replace(L"{0}", argument); 22 | return result; 23 | } 24 | 25 | UString MyFormatNew(UINT resourceID, const UString &argument) 26 | { 27 | return MyFormatNew(LangString(resourceID), argument); 28 | } 29 | -------------------------------------------------------------------------------- /CPP/7zip/UI/FileManager/FormatUtils.h: -------------------------------------------------------------------------------- 1 | // FormatUtils.h 2 | 3 | #ifndef __FORMAT_UTILS_H 4 | #define __FORMAT_UTILS_H 5 | 6 | #include "../../../Common/MyTypes.h" 7 | #include "../../../Common/MyString.h" 8 | 9 | UString NumberToString(UInt64 number); 10 | 11 | UString MyFormatNew(const UString &format, const UString &argument); 12 | UString MyFormatNew(UINT resourceID, const UString &argument); 13 | 14 | #endif 15 | -------------------------------------------------------------------------------- /CPP/7zip/UI/FileManager/HelpUtils.cpp: -------------------------------------------------------------------------------- 1 | // HelpUtils.cpp 2 | 3 | #include "StdAfx.h" 4 | 5 | #include "HelpUtils.h" 6 | 7 | #if defined(UNDER_CE) || !defined(_WIN32) 8 | 9 | void ShowHelpWindow(HWND, LPCWSTR) 10 | { 11 | } 12 | 13 | #else 14 | 15 | #include 16 | 17 | #include "../../../Common/StringConvert.h" 18 | 19 | #include "../../../Windows/DLL.h" 20 | 21 | static LPCWSTR kHelpFileName = L"7-zip.chm::/"; 22 | 23 | void ShowHelpWindow(HWND hwnd, LPCWSTR topicFile) 24 | { 25 | FString path = NWindows::NDLL::GetModuleDirPrefix(); 26 | HtmlHelp(hwnd, GetSystemString(fs2us(path) + kHelpFileName + topicFile), HH_DISPLAY_TOPIC, 0); 27 | } 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /CPP/7zip/UI/FileManager/HelpUtils.h: -------------------------------------------------------------------------------- 1 | // HelpUtils.h 2 | 3 | #ifndef __HELP_UTILS_H 4 | #define __HELP_UTILS_H 5 | 6 | #include "../../../Common/MyString.h" 7 | 8 | void ShowHelpWindow(HWND hwnd, LPCWSTR topicFile); 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /CPP/7zip/UI/FileManager/Info.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjieest/lib7z-static/c847005f0358c0c054fa2318aa38c1901703c425/CPP/7zip/UI/FileManager/Info.bmp -------------------------------------------------------------------------------- /CPP/7zip/UI/FileManager/Info2.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjieest/lib7z-static/c847005f0358c0c054fa2318aa38c1901703c425/CPP/7zip/UI/FileManager/Info2.bmp -------------------------------------------------------------------------------- /CPP/7zip/UI/FileManager/LangPage.h: -------------------------------------------------------------------------------- 1 | // LangPage.h 2 | 3 | #ifndef __LANG_PAGE_H 4 | #define __LANG_PAGE_H 5 | 6 | #include "../../../Windows/Control/PropertyPage.h" 7 | #include "../../../Windows/Control/ComboBox.h" 8 | 9 | class CLangPage: public NWindows::NControl::CPropertyPage 10 | { 11 | NWindows::NControl::CComboBox _langCombo; 12 | UStringVector _paths; 13 | 14 | bool _needSave; 15 | public: 16 | bool LangWasChanged; 17 | 18 | CLangPage(): _needSave(false), LangWasChanged(false) {} 19 | virtual bool OnInit(); 20 | virtual void OnNotifyHelp(); 21 | virtual bool OnCommand(int code, int itemID, LPARAM param); 22 | virtual LONG OnApply(); 23 | }; 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /CPP/7zip/UI/FileManager/LangPage.rc: -------------------------------------------------------------------------------- 1 | #include "LangPageRes.h" 2 | #include "../../GuiCommon.rc" 3 | 4 | #define xc 160 5 | #define yc 100 6 | 7 | IDD_LANG DIALOG 0, 0, xs, ys MY_PAGE_STYLE MY_FONT 8 | CAPTION "Language" 9 | { 10 | LTEXT "Language:", IDT_LANG_LANG, m, m, xc, 8 11 | COMBOBOX IDC_LANG_LANG, m, 20, xc, yc - 20, MY_COMBO_SORTED 12 | } 13 | 14 | 15 | #ifdef UNDER_CE 16 | 17 | #undef m 18 | #undef xc 19 | 20 | #define m 4 21 | #define xc (SMALL_PAGE_SIZE_X + 8) 22 | 23 | IDD_LANG_2 MY_PAGE 24 | CAPTION "Language" 25 | { 26 | LTEXT "Language:", IDT_LANG_LANG, m, m, xc, 8 27 | COMBOBOX IDC_LANG_LANG, m, 20, xc, yc - 20, MY_COMBO_SORTED 28 | } 29 | 30 | #endif 31 | 32 | 33 | STRINGTABLE 34 | BEGIN 35 | IDS_LANG_ENGLISH "English" 36 | IDS_LANG_NATIVE "English" 37 | END 38 | -------------------------------------------------------------------------------- /CPP/7zip/UI/FileManager/LangPageRes.h: -------------------------------------------------------------------------------- 1 | #define IDD_LANG 2101 2 | #define IDD_LANG_2 12101 3 | 4 | #define IDS_LANG_ENGLISH 1 5 | #define IDS_LANG_NATIVE 2 6 | 7 | #define IDT_LANG_LANG 2102 8 | #define IDC_LANG_LANG 100 9 | -------------------------------------------------------------------------------- /CPP/7zip/UI/FileManager/LinkDialogRes.h: -------------------------------------------------------------------------------- 1 | #define IDD_LINK 7700 2 | 3 | #define IDB_LINK_LINK 7701 4 | 5 | #define IDT_LINK_PATH_FROM 7702 6 | #define IDT_LINK_PATH_TO 7703 7 | 8 | #define IDG_LINK_TYPE 7710 9 | #define IDR_LINK_TYPE_HARD 7711 10 | #define IDR_LINK_TYPE_SYM_FILE 7712 11 | #define IDR_LINK_TYPE_SYM_DIR 7713 12 | #define IDR_LINK_TYPE_JUNCTION 7714 13 | 14 | 15 | #define IDC_LINK_PATH_FROM 100 16 | #define IDC_LINK_PATH_TO 101 17 | 18 | #define IDT_LINK_PATH_TO_CUR 102 19 | 20 | #define IDB_LINK_PATH_FROM 103 21 | #define IDB_LINK_PATH_TO 104 22 | -------------------------------------------------------------------------------- /CPP/7zip/UI/FileManager/ListViewDialog.h: -------------------------------------------------------------------------------- 1 | // ListViewDialog.h 2 | 3 | #ifndef __LISTVIEW_DIALOG_H 4 | #define __LISTVIEW_DIALOG_H 5 | 6 | #include "../../../Windows/Control/Dialog.h" 7 | #include "../../../Windows/Control/ListView.h" 8 | 9 | #include "ListViewDialogRes.h" 10 | 11 | class CListViewDialog: public NWindows::NControl::CModalDialog 12 | { 13 | NWindows::NControl::CListView _listView; 14 | virtual void OnOK(); 15 | virtual bool OnInit(); 16 | virtual bool OnSize(WPARAM wParam, int xSize, int ySize); 17 | virtual bool OnNotify(UINT controlID, LPNMHDR header); 18 | public: 19 | UString Title; 20 | bool DeleteIsAllowed; 21 | bool StringsWereChanged; 22 | UStringVector Strings; 23 | int FocusedItemIndex; 24 | 25 | INT_PTR Create(HWND wndParent = 0) { return CModalDialog::Create(IDD_LISTVIEW, wndParent); } 26 | 27 | CListViewDialog(): DeleteIsAllowed(false) {} 28 | }; 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /CPP/7zip/UI/FileManager/ListViewDialog.rc: -------------------------------------------------------------------------------- 1 | #include "ListViewDialogRes.h" 2 | #include "../../GuiCommon.rc" 3 | 4 | #define xc 320 5 | #define yc 240 6 | 7 | IDD_LISTVIEW DIALOG 0, 0, xs, ys MY_MODAL_RESIZE_DIALOG_STYLE MY_FONT 8 | CAPTION "ListView" 9 | { 10 | CONTROL "List1", IDL_LISTVIEW, "SysListView32", LVS_REPORT | LVS_SHOWSELALWAYS | 11 | LVS_AUTOARRANGE | LVS_NOCOLUMNHEADER | WS_BORDER | WS_TABSTOP, 12 | m, m, xc, yc - bys - m 13 | OK_CANCEL 14 | } 15 | -------------------------------------------------------------------------------- /CPP/7zip/UI/FileManager/ListViewDialogRes.h: -------------------------------------------------------------------------------- 1 | #define IDD_LISTVIEW 99 2 | #define IDL_LISTVIEW 100 3 | -------------------------------------------------------------------------------- /CPP/7zip/UI/FileManager/MenuPage.rc: -------------------------------------------------------------------------------- 1 | #include "MenuPageRes.h" 2 | #include "../../GuiCommon.rc" 3 | 4 | #define xc 240 5 | #define yc 224 6 | 7 | IDD_MENU MY_PAGE 8 | #include "MenuPage2.rc" 9 | 10 | #ifdef UNDER_CE 11 | 12 | #undef m 13 | #undef xc 14 | #undef yc 15 | 16 | #define m 4 17 | #define xc (SMALL_PAGE_SIZE_X + 8) 18 | 19 | #define yc 112 20 | 21 | IDD_MENU_2 MY_PAGE 22 | #include "MenuPage2.rc" 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /CPP/7zip/UI/FileManager/MenuPage2.rc: -------------------------------------------------------------------------------- 1 | #include "../GUI/ExtractDialogRes.h" 2 | 3 | #define y 82 4 | 5 | CAPTION "7-Zip" 6 | BEGIN 7 | CONTROL "Integrate 7-Zip to shell context menu", IDX_SYSTEM_INTEGRATE_TO_MENU, MY_CHECKBOX, m, m, xc, 10 8 | CONTROL "(32-bit)", IDX_SYSTEM_INTEGRATE_TO_MENU_2, MY_CHECKBOX, m, m + 14, xc, 10 9 | CONTROL "Cascaded context menu", IDX_SYSTEM_CASCADED_MENU, MY_CHECKBOX, m, m + 28, xc, 10 10 | CONTROL "Icons in context menu", IDX_SYSTEM_ICON_IN_MENU, MY_CHECKBOX, m, m + 42, xc, 10 11 | CONTROL "Eliminate duplication of root folder", IDX_EXTRACT_ELIM_DUP, MY_CHECKBOX, m, m + 56, xc, 10 12 | 13 | LTEXT "Context menu items:", IDT_SYSTEM_CONTEXT_MENU_ITEMS, m, m + 70, xc, 8 14 | CONTROL "List", IDL_SYSTEM_OPTIONS, "SysListView32", 15 | LVS_REPORT | LVS_SINGLESEL | LVS_NOCOLUMNHEADER | WS_BORDER | WS_TABSTOP, 16 | m, m + y, xc, yc - y 17 | END 18 | -------------------------------------------------------------------------------- /CPP/7zip/UI/FileManager/MenuPageRes.h: -------------------------------------------------------------------------------- 1 | #define IDD_MENU 2300 2 | #define IDD_MENU_2 12300 3 | 4 | #define IDX_SYSTEM_INTEGRATE_TO_MENU 2301 5 | #define IDX_SYSTEM_CASCADED_MENU 2302 6 | #define IDT_SYSTEM_CONTEXT_MENU_ITEMS 2303 7 | #define IDX_SYSTEM_ICON_IN_MENU 2304 8 | 9 | #define IDX_SYSTEM_INTEGRATE_TO_MENU_2 2310 10 | 11 | #define IDL_SYSTEM_OPTIONS 100 12 | -------------------------------------------------------------------------------- /CPP/7zip/UI/FileManager/MessagesDialog.h: -------------------------------------------------------------------------------- 1 | // MessagesDialog.h 2 | 3 | #ifndef __MESSAGES_DIALOG_H 4 | #define __MESSAGES_DIALOG_H 5 | 6 | #include "../../../Windows/Control/Dialog.h" 7 | #include "../../../Windows/Control/ListView.h" 8 | 9 | #include "MessagesDialogRes.h" 10 | 11 | class CMessagesDialog: public NWindows::NControl::CModalDialog 12 | { 13 | NWindows::NControl::CListView _messageList; 14 | 15 | void AddMessageDirect(LPCWSTR message); 16 | void AddMessage(LPCWSTR message); 17 | virtual bool OnInit(); 18 | virtual bool OnSize(WPARAM wParam, int xSize, int ySize); 19 | public: 20 | const UStringVector *Messages; 21 | 22 | INT_PTR Create(HWND parent = 0) { return CModalDialog::Create(IDD_MESSAGES, parent); } 23 | }; 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /CPP/7zip/UI/FileManager/MessagesDialog.rc: -------------------------------------------------------------------------------- 1 | #include "MessagesDialogRes.h" 2 | #include "../../GuiCommon.rc" 3 | 4 | #define xc 440 5 | #define yc 160 6 | 7 | IDD_MESSAGES DIALOG 0, 0, xs, ys MY_MODAL_RESIZE_DIALOG_STYLE MY_FONT 8 | CAPTION "7-Zip: Diagnostic messages" 9 | { 10 | DEFPUSHBUTTON "&Close", IDOK, bx, by, bxs, bys 11 | CONTROL "List1", IDL_MESSAGE, "SysListView32", 12 | LVS_REPORT | LVS_SHOWSELALWAYS | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP, 13 | m, m, xc, yc - bys - m 14 | } 15 | -------------------------------------------------------------------------------- /CPP/7zip/UI/FileManager/MessagesDialogRes.h: -------------------------------------------------------------------------------- 1 | #define IDD_MESSAGES 6602 2 | #define IDS_MESSAGE 6603 3 | #define IDL_MESSAGE 100 4 | -------------------------------------------------------------------------------- /CPP/7zip/UI/FileManager/Move.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjieest/lib7z-static/c847005f0358c0c054fa2318aa38c1901703c425/CPP/7zip/UI/FileManager/Move.bmp -------------------------------------------------------------------------------- /CPP/7zip/UI/FileManager/Move2.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjieest/lib7z-static/c847005f0358c0c054fa2318aa38c1901703c425/CPP/7zip/UI/FileManager/Move2.bmp -------------------------------------------------------------------------------- /CPP/7zip/UI/FileManager/MyLoadMenu.h: -------------------------------------------------------------------------------- 1 | // MyLoadMenu.h 2 | 3 | #ifndef __MY_LOAD_MENU_H 4 | #define __MY_LOAD_MENU_H 5 | 6 | void OnMenuActivating(HWND hWnd, HMENU hMenu, int position); 7 | // void OnMenuUnActivating(HWND hWnd, HMENU hMenu, int id); 8 | // void OnMenuUnActivating(HWND hWnd); 9 | 10 | bool OnMenuCommand(HWND hWnd, int id); 11 | void MyLoadMenu(); 12 | 13 | struct CFileMenu 14 | { 15 | bool programMenu; 16 | bool readOnly; 17 | bool isFsFolder; 18 | bool allAreFiles; 19 | bool isAltStreamsSupported; 20 | int numItems; 21 | 22 | CFileMenu(): 23 | programMenu(false), 24 | readOnly(false), 25 | isFsFolder(false), 26 | allAreFiles(false), 27 | isAltStreamsSupported(true), 28 | numItems(0) 29 | {} 30 | 31 | void Load(HMENU hMenu, unsigned startPos); 32 | }; 33 | 34 | bool ExecuteFileCommand(int id); 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /CPP/7zip/UI/FileManager/OverwriteDialogRes.h: -------------------------------------------------------------------------------- 1 | #define IDD_OVERWRITE 3500 2 | #define IDD_OVERWRITE_2 13500 3 | 4 | #define IDT_OVERWRITE_HEADER 3501 5 | #define IDT_OVERWRITE_QUESTION_BEGIN 3502 6 | #define IDT_OVERWRITE_QUESTION_END 3503 7 | #define IDS_FILE_SIZE 3504 8 | 9 | #define IDB_AUTO_RENAME 3505 10 | #define IDB_YES_TO_ALL 440 11 | #define IDB_NO_TO_ALL 441 12 | 13 | #define IDI_OVERWRITE_OLD_FILE 100 14 | #define IDI_OVERWRITE_NEW_FILE 101 15 | 16 | #define IDT_OVERWRITE_OLD_FILE_SIZE_TIME 102 17 | #define IDT_OVERWRITE_NEW_FILE_SIZE_TIME 103 18 | -------------------------------------------------------------------------------- /CPP/7zip/UI/FileManager/PasswordDialog.h: -------------------------------------------------------------------------------- 1 | // PasswordDialog.h 2 | 3 | #ifndef __PASSWORD_DIALOG_H 4 | #define __PASSWORD_DIALOG_H 5 | 6 | #include "../../../Windows/Control/Dialog.h" 7 | #include "../../../Windows/Control/Edit.h" 8 | 9 | #include "PasswordDialogRes.h" 10 | 11 | class CPasswordDialog: public NWindows::NControl::CModalDialog 12 | { 13 | NWindows::NControl::CEdit _passwordEdit; 14 | 15 | virtual void OnOK(); 16 | virtual bool OnInit(); 17 | virtual bool OnButtonClicked(int buttonID, HWND buttonHWND); 18 | void SetTextSpec(); 19 | void ReadControls(); 20 | public: 21 | UString Password; 22 | bool ShowPassword; 23 | 24 | CPasswordDialog(): ShowPassword(false) {} 25 | INT_PTR Create(HWND parentWindow = 0) { return CModalDialog::Create(IDD_PASSWORD, parentWindow); } 26 | }; 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /CPP/7zip/UI/FileManager/PasswordDialog.rc: -------------------------------------------------------------------------------- 1 | #include "PasswordDialogRes.h" 2 | #include "../../GuiCommon.rc" 3 | 4 | #define xc 140 5 | #define yc 72 6 | 7 | IDD_PASSWORD DIALOG 0, 0, xs, ys MY_MODAL_DIALOG_STYLE MY_FONT 8 | CAPTION "Enter password" 9 | BEGIN 10 | LTEXT "&Enter password:", IDT_PASSWORD_ENTER, m, m, xc, 8 11 | EDITTEXT IDE_PASSWORD_PASSWORD, m, 20, xc, 14, ES_PASSWORD | ES_AUTOHSCROLL 12 | CONTROL "&Show password", IDX_PASSWORD_SHOW, MY_CHECKBOX, m, 42, xc, 10 13 | OK_CANCEL 14 | END 15 | -------------------------------------------------------------------------------- /CPP/7zip/UI/FileManager/PasswordDialogRes.h: -------------------------------------------------------------------------------- 1 | #define IDD_PASSWORD 3800 2 | #define IDT_PASSWORD_ENTER 3801 3 | #define IDX_PASSWORD_SHOW 3803 4 | 5 | #define IDE_PASSWORD_PASSWORD 120 6 | -------------------------------------------------------------------------------- /CPP/7zip/UI/FileManager/PluginInterface.h: -------------------------------------------------------------------------------- 1 | // PluginInterface.h 2 | 3 | #ifndef __PLUGIN_INTERFACE_H 4 | #define __PLUGIN_INTERFACE_H 5 | 6 | /* 7 | #include "../../../Common/Types.h" 8 | #include "../../IDecl.h" 9 | 10 | #define PLUGIN_INTERFACE(i, x) DECL_INTERFACE(i, 0x0A, x) 11 | 12 | PLUGIN_INTERFACE(IInitContextMenu, 0x00) 13 | { 14 | STDMETHOD(InitContextMenu)(const wchar_t *folder, const wchar_t * const *names, UInt32 numFiles) PURE; 15 | }; 16 | 17 | PLUGIN_INTERFACE(IPluginOptionsCallback, 0x01) 18 | { 19 | STDMETHOD(GetProgramFolderPath)(BSTR *value) PURE; 20 | STDMETHOD(GetProgramPath)(BSTR *value) PURE; 21 | STDMETHOD(GetRegistryCUPath)(BSTR *value) PURE; 22 | }; 23 | 24 | PLUGIN_INTERFACE(IPluginOptions, 0x02) 25 | { 26 | STDMETHOD(PluginOptions)(HWND hWnd, IPluginOptionsCallback *callback) PURE; 27 | // STDMETHOD(GetFileExtensions)(BSTR *extensions) PURE; 28 | }; 29 | */ 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /CPP/7zip/UI/FileManager/PluginLoader.h: -------------------------------------------------------------------------------- 1 | // PluginLoader.h 2 | 3 | #ifndef __PLUGIN_LOADER_H 4 | #define __PLUGIN_LOADER_H 5 | 6 | #include "../../../Windows/DLL.h" 7 | 8 | #include "IFolder.h" 9 | 10 | class CPluginLibrary: public NWindows::NDLL::CLibrary 11 | { 12 | public: 13 | HRESULT CreateManager(REFGUID clsID, IFolderManager **manager) 14 | { 15 | Func_CreateObject createObject = (Func_CreateObject)GetProc("CreateObject"); 16 | if (!createObject) 17 | return GetLastError(); 18 | return createObject(&clsID, &IID_IFolderManager, (void **)manager); 19 | } 20 | HRESULT LoadAndCreateManager(CFSTR filePath, REFGUID clsID, IFolderManager **manager) 21 | { 22 | if (!Load(filePath)) 23 | return GetLastError(); 24 | return CreateManager(clsID, manager); 25 | } 26 | }; 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /CPP/7zip/UI/FileManager/ProgramLocation.cpp: -------------------------------------------------------------------------------- 1 | // ProgramLocation.cpp 2 | 3 | #include "StdAfx.h" 4 | -------------------------------------------------------------------------------- /CPP/7zip/UI/FileManager/ProgramLocation.h: -------------------------------------------------------------------------------- 1 | // ProgramLocation.h 2 | 3 | #ifndef __PROGRAM_LOCATION_H 4 | #define __PROGRAM_LOCATION_H 5 | 6 | #endif 7 | -------------------------------------------------------------------------------- /CPP/7zip/UI/FileManager/ProgressDialog.rc: -------------------------------------------------------------------------------- 1 | #include "ProgressDialogRes.h" 2 | #include "../../GuiCommon.rc" 3 | 4 | #define xc 172 5 | #define yc 44 6 | 7 | IDD_PROGRESS DIALOG 0, 0, xs, ys MY_MODAL_DIALOG_STYLE MY_FONT 8 | CAPTION "Progress" 9 | BEGIN 10 | PUSHBUTTON "Cancel", IDCANCEL, bx, by, bxs, bys 11 | CONTROL "Progress1", IDC_PROGRESS1, "msctls_progress32", PBS_SMOOTH | WS_BORDER, m, m, xc, 14 12 | END 13 | -------------------------------------------------------------------------------- /CPP/7zip/UI/FileManager/ProgressDialog2.rc: -------------------------------------------------------------------------------- 1 | #include "ProgressDialog2Res.h" 2 | #include "../../GuiCommon.rc" 3 | 4 | #undef DIALOG_ID 5 | #define DIALOG_ID IDD_PROGRESS 6 | #define xc 360 7 | #define k 11 8 | #define z1s 16 9 | 10 | #include "ProgressDialog2a.rc" 11 | 12 | #ifdef UNDER_CE 13 | 14 | #include "../../GuiCommon.rc" 15 | 16 | 17 | #undef DIALOG_ID 18 | #undef m 19 | #undef k 20 | #undef z1s 21 | 22 | #define DIALOG_ID IDD_PROGRESS_2 23 | #define m 4 24 | #define k 8 25 | #define z1s 12 26 | 27 | #define xc 280 28 | 29 | #include "ProgressDialog2a.rc" 30 | 31 | #endif 32 | 33 | STRINGTABLE DISCARDABLE 34 | { 35 | IDS_PROGRESS_PAUSED "Paused" 36 | IDS_PROGRESS_FOREGROUND "&Foreground" 37 | IDS_CONTINUE "&Continue" 38 | IDS_PROGRESS_ASK_CANCEL "Are you sure you want to cancel?" 39 | IDS_CLOSE "&Close" 40 | } 41 | -------------------------------------------------------------------------------- /CPP/7zip/UI/FileManager/ProgressDialogRes.h: -------------------------------------------------------------------------------- 1 | #define IDD_PROGRESS 97 2 | 3 | #define IDC_PROGRESS1 100 4 | -------------------------------------------------------------------------------- /CPP/7zip/UI/FileManager/PropertyName.cpp: -------------------------------------------------------------------------------- 1 | // PropertyName.cpp 2 | 3 | #include "StdAfx.h" 4 | 5 | #include "../../../Common/IntToString.h" 6 | 7 | #include "LangUtils.h" 8 | #include "PropertyName.h" 9 | 10 | UString GetNameOfProperty(PROPID propID, const wchar_t *name) 11 | { 12 | if (propID < 1000) 13 | { 14 | UString s = LangString(1000 + propID); 15 | if (!s.IsEmpty()) 16 | return s; 17 | } 18 | if (name) 19 | return name; 20 | wchar_t temp[16]; 21 | ConvertUInt32ToString(propID, temp); 22 | return temp; 23 | } 24 | -------------------------------------------------------------------------------- /CPP/7zip/UI/FileManager/PropertyName.h: -------------------------------------------------------------------------------- 1 | // PropertyName.h 2 | 3 | #ifndef __PROPERTY_NAME_H 4 | #define __PROPERTY_NAME_H 5 | 6 | #include "../../../Common/MyString.h" 7 | 8 | UString GetNameOfProperty(PROPID propID, const wchar_t *name); 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /CPP/7zip/UI/FileManager/RegistryAssociations.h: -------------------------------------------------------------------------------- 1 | // RegistryAssociations.h 2 | 3 | #ifndef __REGISTRY_ASSOCIATIONS_H 4 | #define __REGISTRY_ASSOCIATIONS_H 5 | 6 | #include "../../../Common/MyString.h" 7 | 8 | namespace NRegistryAssoc { 9 | 10 | struct CShellExtInfo 11 | { 12 | CSysString ProgramKey; 13 | UString IconPath; 14 | int IconIndex; 15 | 16 | bool ReadFromRegistry(HKEY hkey, const CSysString &ext); 17 | bool IsIt7Zip() const; 18 | }; 19 | 20 | LONG DeleteShellExtensionInfo(HKEY hkey, const CSysString &ext); 21 | 22 | LONG AddShellExtensionInfo(HKEY hkey, 23 | const CSysString &ext, 24 | const UString &programTitle, 25 | const UString &programOpenCommand, 26 | const UString &iconPath, int iconIndex 27 | // , const void *shellNewData, int shellNewDataSize 28 | ); 29 | } 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /CPP/7zip/UI/FileManager/RegistryPlugins.h: -------------------------------------------------------------------------------- 1 | // RegistryPlugins.h 2 | 3 | #ifndef __REGISTRY_PLUGINS_H 4 | #define __REGISTRY_PLUGINS_H 5 | 6 | #include "../../../Common/MyString.h" 7 | 8 | enum EPluginType 9 | { 10 | kPluginTypeFF = 0 11 | }; 12 | 13 | struct CPluginInfo 14 | { 15 | FString FilePath; 16 | EPluginType Type; 17 | UString Name; 18 | CLSID ClassID; 19 | CLSID OptionsClassID; 20 | bool ClassIDDefined; 21 | bool OptionsClassIDDefined; 22 | 23 | // CSysString Extension; 24 | // CSysString AddExtension; 25 | // bool UpdateEnabled; 26 | // bool KeepName; 27 | }; 28 | 29 | void ReadPluginInfoList(CObjectVector &plugins); 30 | void ReadFileFolderPluginInfoList(CObjectVector &plugins); 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /CPP/7zip/UI/FileManager/RootFolder.h: -------------------------------------------------------------------------------- 1 | // RootFolder.h 2 | 3 | #ifndef __ROOT_FOLDER_H 4 | #define __ROOT_FOLDER_H 5 | 6 | #include "../../../Common/MyString.h" 7 | 8 | #include "IFolder.h" 9 | 10 | const unsigned kNumRootFolderItems_Max = 4; 11 | 12 | class CRootFolder: 13 | public IFolderFolder, 14 | public IFolderGetSystemIconIndex, 15 | public CMyUnknownImp 16 | { 17 | UString _names[kNumRootFolderItems_Max]; 18 | int _iconIndices[kNumRootFolderItems_Max]; 19 | 20 | public: 21 | MY_UNKNOWN_IMP1(IFolderGetSystemIconIndex) 22 | INTERFACE_FolderFolder(;) 23 | STDMETHOD(GetSystemIconIndex)(UInt32 index, Int32 *iconIndex); 24 | void Init(); 25 | }; 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /CPP/7zip/UI/FileManager/SettingsPage.h: -------------------------------------------------------------------------------- 1 | // SettingsPage.h 2 | 3 | #ifndef __SETTINGS_PAGE_H 4 | #define __SETTINGS_PAGE_H 5 | 6 | #include "../../../Windows/Control/PropertyPage.h" 7 | #include "../../../Windows/Control/Edit.h" 8 | 9 | class CSettingsPage: public NWindows::NControl::CPropertyPage 10 | { 11 | bool _wasChanged; 12 | 13 | bool _largePages_wasChanged; 14 | 15 | // void EnableSubItems(); 16 | bool OnButtonClicked(int buttonID, HWND buttonHWND); 17 | public: 18 | virtual bool OnInit(); 19 | virtual void OnNotifyHelp(); 20 | virtual LONG OnApply(); 21 | }; 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /CPP/7zip/UI/FileManager/SettingsPage.rc: -------------------------------------------------------------------------------- 1 | #include "SettingsPageRes.h" 2 | #include "../../GuiCommon.rc" 3 | 4 | #define xc 240 5 | #define yc 120 6 | 7 | IDD_SETTINGS MY_PAGE 8 | #include "SettingsPage2.rc" 9 | 10 | 11 | #ifdef UNDER_CE 12 | 13 | #undef m 14 | #undef xc 15 | 16 | #define m 4 17 | #define xc (SMALL_PAGE_SIZE_X + 8) 18 | 19 | IDD_SETTINGS_2 MY_PAGE 20 | #include "SettingsPage2.rc" 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /CPP/7zip/UI/FileManager/SettingsPage2.rc: -------------------------------------------------------------------------------- 1 | CAPTION "Settings" 2 | BEGIN 3 | CONTROL "Show "".."" item", IDX_SETTINGS_SHOW_DOTS, MY_CHECKBOX, m, 8, xc, 10 4 | CONTROL "Show real file &icons", IDX_SETTINGS_SHOW_REAL_FILE_ICONS, MY_CHECKBOX, m, 22, xc, 10 5 | CONTROL "&Full row select", IDX_SETTINGS_FULL_ROW, MY_CHECKBOX, m, 36, xc, 10 6 | CONTROL "Show &grid lines", IDX_SETTINGS_SHOW_GRID, MY_CHECKBOX, m, 50, xc, 10 7 | CONTROL "&Single-click to open an item", IDX_SETTINGS_SINGLE_CLICK, MY_CHECKBOX, m, 64, xc, 10 8 | CONTROL "&Alternative selection mode", IDX_SETTINGS_ALTERNATIVE_SELECTION, MY_CHECKBOX, m, 78, xc, 10 9 | 10 | CONTROL "Show system &menu", IDX_SETTINGS_SHOW_SYSTEM_MENU, MY_CHECKBOX, m, 100, xc, 10 11 | 12 | CONTROL "Use &large memory pages", IDX_SETTINGS_LARGE_PAGES, MY_CHECKBOX, m, 122, xc, 10 13 | END 14 | -------------------------------------------------------------------------------- /CPP/7zip/UI/FileManager/SettingsPageRes.h: -------------------------------------------------------------------------------- 1 | #define IDD_SETTINGS 2500 2 | #define IDD_SETTINGS_2 12500 3 | 4 | #define IDX_SETTINGS_SHOW_DOTS 2501 5 | #define IDX_SETTINGS_SHOW_REAL_FILE_ICONS 2502 6 | #define IDX_SETTINGS_SHOW_SYSTEM_MENU 2503 7 | #define IDX_SETTINGS_FULL_ROW 2504 8 | #define IDX_SETTINGS_SHOW_GRID 2505 9 | #define IDX_SETTINGS_SINGLE_CLICK 2506 10 | #define IDX_SETTINGS_ALTERNATIVE_SELECTION 2507 11 | #define IDX_SETTINGS_LARGE_PAGES 2508 12 | -------------------------------------------------------------------------------- /CPP/7zip/UI/FileManager/SplitDialog.h: -------------------------------------------------------------------------------- 1 | // SplitDialog.h 2 | 3 | #ifndef __SPLIT_DIALOG_H 4 | #define __SPLIT_DIALOG_H 5 | 6 | #include "../../../Windows/Control/Dialog.h" 7 | #include "../../../Windows/Control/ComboBox.h" 8 | 9 | #include "SplitDialogRes.h" 10 | 11 | class CSplitDialog: public NWindows::NControl::CModalDialog 12 | { 13 | NWindows::NControl::CComboBox _pathCombo; 14 | NWindows::NControl::CComboBox _volumeCombo; 15 | virtual void OnOK(); 16 | virtual bool OnInit(); 17 | virtual bool OnSize(WPARAM wParam, int xSize, int ySize); 18 | virtual bool OnButtonClicked(int buttonID, HWND buttonHWND); 19 | void OnButtonSetPath(); 20 | public: 21 | UString FilePath; 22 | UString Path; 23 | CRecordVector VolumeSizes; 24 | INT_PTR Create(HWND parentWindow = 0) 25 | { return CModalDialog::Create(IDD_SPLIT, parentWindow); } 26 | }; 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /CPP/7zip/UI/FileManager/SplitDialog.rc: -------------------------------------------------------------------------------- 1 | #include "SplitDialogRes.h" 2 | #include "../../GuiCommon.rc" 3 | 4 | #define xc 288 5 | #define yc 96 6 | 7 | IDD_SPLIT DIALOG 0, 0, xs, ys MY_MODAL_RESIZE_DIALOG_STYLE MY_FONT 8 | CAPTION "Split File" 9 | BEGIN 10 | LTEXT "&Split to:", IDT_SPLIT_PATH, m, m, xc, 8 11 | COMBOBOX IDC_SPLIT_PATH, m, 20, xc - bxsDots - m, 64, MY_COMBO_WITH_EDIT 12 | PUSHBUTTON "...", IDB_SPLIT_PATH, xs - m - bxsDots, 18, bxsDots, bys, WS_GROUP 13 | LTEXT "Split to &volumes, bytes:", IDT_SPLIT_VOLUME, m, 44, xc, 8 14 | COMBOBOX IDC_SPLIT_VOLUME, m, 56, 96, 52, MY_COMBO_WITH_EDIT 15 | OK_CANCEL 16 | END 17 | -------------------------------------------------------------------------------- /CPP/7zip/UI/FileManager/SplitDialogRes.h: -------------------------------------------------------------------------------- 1 | #define IDD_SPLIT 7300 2 | 3 | #define IDT_SPLIT_PATH 7301 4 | #define IDT_SPLIT_VOLUME 7302 5 | 6 | #define IDC_SPLIT_PATH 100 7 | #define IDB_SPLIT_PATH 101 8 | #define IDC_SPLIT_VOLUME 102 9 | -------------------------------------------------------------------------------- /CPP/7zip/UI/FileManager/SplitUtils.h: -------------------------------------------------------------------------------- 1 | // SplitUtils.h 2 | 3 | #ifndef __SPLIT_UTILS_H 4 | #define __SPLIT_UTILS_H 5 | 6 | #include "../../../Common/MyTypes.h" 7 | #include "../../../Common/MyString.h" 8 | 9 | #include "../../../Windows/Control/ComboBox.h" 10 | 11 | bool ParseVolumeSizes(const UString &s, CRecordVector &values); 12 | void AddVolumeItems(NWindows::NControl::CComboBox &volumeCombo); 13 | UInt64 GetNumberOfVolumes(UInt64 size, const CRecordVector &volSizes); 14 | 15 | #endif 16 | -------------------------------------------------------------------------------- /CPP/7zip/UI/FileManager/StdAfx.cpp: -------------------------------------------------------------------------------- 1 | // StdAfx.cpp 2 | 3 | #include "StdAfx.h" 4 | -------------------------------------------------------------------------------- /CPP/7zip/UI/FileManager/StdAfx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h 2 | 3 | #ifndef __STDAFX_H 4 | #define __STDAFX_H 5 | 6 | /* we used 0x0400 for Windows NT supporting (MENUITEMINFOW) 7 | But now menu problem is fixed. So it's OK to use 0x0500 (Windows 2000) */ 8 | 9 | // #define _WIN32_WINNT 0x0400 10 | #define _WIN32_WINNT 0x0500 11 | #define WINVER _WIN32_WINNT 12 | 13 | #include "../../../Common/Common.h" 14 | 15 | // #include "../../../Common/MyWindows.h" 16 | 17 | // #include 18 | // #include 19 | // #include 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /CPP/7zip/UI/FileManager/StringUtils.h: -------------------------------------------------------------------------------- 1 | // StringUtils.h 2 | 3 | #ifndef __STRING_UTILS_H 4 | #define __STRING_UTILS_H 5 | 6 | #include "../../../Common/MyString.h" 7 | 8 | void SplitStringToTwoStrings(const UString &src, UString &dest1, UString &dest2); 9 | 10 | void SplitString(const UString &srcString, UStringVector &destStrings); 11 | UString JoinStrings(const UStringVector &srcStrings); 12 | 13 | #endif 14 | -------------------------------------------------------------------------------- /CPP/7zip/UI/FileManager/SystemPageRes.h: -------------------------------------------------------------------------------- 1 | #define IDD_SYSTEM 2200 2 | #define IDD_SYSTEM_2 12200 3 | 4 | #define IDT_SYSTEM_ASSOCIATE 2201 5 | #define IDS_SYSTEM_ALL_USERS 2202 6 | 7 | #define IDL_SYSTEM_ASSOCIATE 100 8 | #define IDB_SYSTEM_CURRENT 101 9 | #define IDB_SYSTEM_ALL 102 10 | -------------------------------------------------------------------------------- /CPP/7zip/UI/FileManager/Test.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjieest/lib7z-static/c847005f0358c0c054fa2318aa38c1901703c425/CPP/7zip/UI/FileManager/Test.bmp -------------------------------------------------------------------------------- /CPP/7zip/UI/FileManager/Test2.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjieest/lib7z-static/c847005f0358c0c054fa2318aa38c1901703c425/CPP/7zip/UI/FileManager/Test2.bmp -------------------------------------------------------------------------------- /CPP/7zip/UI/FileManager/TextPairs.h: -------------------------------------------------------------------------------- 1 | // TextPairs.h 2 | 3 | #ifndef __FM_TEXT_PAIRS_H 4 | #define __FM_TEXT_PAIRS_H 5 | 6 | #include "../../../Common/MyString.h" 7 | 8 | struct CTextPair 9 | { 10 | UString ID; 11 | UString Value; 12 | }; 13 | 14 | class CPairsStorage 15 | { 16 | CObjectVector Pairs; 17 | 18 | int FindID(const UString &id, int &insertPos) const; 19 | int FindID(const UString &id) const; 20 | void Sort(); 21 | public: 22 | void Clear() { Pairs.Clear(); } 23 | bool ReadFromString(const UString &text); 24 | void SaveToString(UString &text) const; 25 | 26 | bool GetValue(const UString &id, UString &value) const; 27 | UString GetValue(const UString &id) const; 28 | void AddPair(const CTextPair &pair); 29 | void DeletePair(const UString &id); 30 | }; 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /CPP/7zip/UI/FileManager/resourceGui.h: -------------------------------------------------------------------------------- 1 | #define IDI_ICON 1 2 | 3 | #define IDS_MESSAGE_NO_ERRORS 3001 4 | 5 | #define IDS_PROGRESS_TESTING 3302 6 | #define IDS_OPENNING 3303 7 | #define IDS_SCANNING 3304 8 | 9 | #define IDS_CHECKSUM_CALCULATING 7500 10 | #define IDS_CHECKSUM_INFORMATION 7501 11 | #define IDS_CHECKSUM_CRC_DATA 7502 12 | #define IDS_CHECKSUM_CRC_DATA_NAMES 7503 13 | #define IDS_CHECKSUM_CRC_STREAMS_NAMES 7504 14 | 15 | #define IDS_INCORRECT_VOLUME_SIZE 7307 16 | -------------------------------------------------------------------------------- /CPP/7zip/UI/FileManager/resourceGui.rc: -------------------------------------------------------------------------------- 1 | #include "resourceGui.h" 2 | 3 | STRINGTABLE 4 | BEGIN 5 | IDS_MESSAGE_NO_ERRORS "There are no errors" 6 | 7 | IDS_PROGRESS_TESTING "Testing" 8 | 9 | IDS_CHECKSUM_CALCULATING "Checksum calculating..." 10 | IDS_CHECKSUM_INFORMATION "Checksum information" 11 | IDS_CHECKSUM_CRC_DATA "CRC checksum for data:" 12 | IDS_CHECKSUM_CRC_DATA_NAMES "CRC checksum for data and names:" 13 | IDS_CHECKSUM_CRC_STREAMS_NAMES "CRC checksum for streams and names:" 14 | 15 | IDS_INCORRECT_VOLUME_SIZE "Incorrect volume size" 16 | 17 | IDS_OPENNING "Opening..." 18 | IDS_SCANNING "Scanning..." 19 | END 20 | -------------------------------------------------------------------------------- /CPP/7zip/UI/GUI/7zG.exe.manifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7-Zip GUI. 5 | 6 | 7 | 8 | 9 | 10 | true 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /CPP/7zip/UI/GUI/ExtractDialogRes.h: -------------------------------------------------------------------------------- 1 | #define IDD_EXTRACT 3400 2 | #define IDD_EXTRACT_2 13400 3 | 4 | #define IDC_EXTRACT_PATH 100 5 | #define IDB_EXTRACT_SET_PATH 101 6 | #define IDC_EXTRACT_PATH_MODE 102 7 | #define IDC_EXTRACT_OVERWRITE_MODE 103 8 | 9 | #define IDE_EXTRACT_PASSWORD 120 10 | 11 | #define IDE_EXTRACT_NAME 130 12 | #define IDX_EXTRACT_NAME_ENABLE 131 13 | 14 | 15 | #define IDT_EXTRACT_EXTRACT_TO 3401 16 | #define IDT_EXTRACT_PATH_MODE 3410 17 | #define IDT_EXTRACT_OVERWRITE_MODE 3420 18 | 19 | #define IDX_EXTRACT_ELIM_DUP 3430 20 | #define IDX_EXTRACT_NT_SECUR 3431 21 | // #define IDX_EXTRACT_ALT_STREAMS 3432 22 | 23 | #define IDX_PASSWORD_SHOW 3803 24 | #define IDG_PASSWORD 3807 25 | -------------------------------------------------------------------------------- /CPP/7zip/UI/GUI/FM.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjieest/lib7z-static/c847005f0358c0c054fa2318aa38c1901703c425/CPP/7zip/UI/GUI/FM.ico -------------------------------------------------------------------------------- /CPP/7zip/UI/GUI/GUI.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 6.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "GUI"=.\GUI.dsp - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | }}} 15 | 16 | ############################################################################### 17 | 18 | Global: 19 | 20 | Package=<5> 21 | {{{ 22 | }}} 23 | 24 | Package=<3> 25 | {{{ 26 | }}} 27 | 28 | ############################################################################### 29 | 30 | -------------------------------------------------------------------------------- /CPP/7zip/UI/GUI/HashGUI.h: -------------------------------------------------------------------------------- 1 | // HashGUI.h 2 | 3 | #ifndef __HASH_GUI_H 4 | #define __HASH_GUI_H 5 | 6 | #include "../Common/HashCalc.h" 7 | 8 | HRESULT HashCalcGUI( 9 | DECL_EXTERNAL_CODECS_LOC_VARS 10 | const NWildcard::CCensor &censor, 11 | const CHashOptions &options, 12 | bool &messageWasDisplayed); 13 | 14 | void AddHashBundleRes(UString &s, const CHashBundle &hb, const UString &firstFileName); 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /CPP/7zip/UI/GUI/StdAfx.cpp: -------------------------------------------------------------------------------- 1 | // StdAfx.cpp 2 | 3 | #include "StdAfx.h" 4 | -------------------------------------------------------------------------------- /CPP/7zip/UI/GUI/StdAfx.h: -------------------------------------------------------------------------------- 1 | // StdAfx.h 2 | 3 | #ifndef __STDAFX_H 4 | #define __STDAFX_H 5 | 6 | // #define _WIN32_WINNT 0x0400 7 | #define _WIN32_WINNT 0x0500 8 | #define WINVER _WIN32_WINNT 9 | 10 | #include "../../../Common/Common.h" 11 | 12 | // #include "../../../Common/MyWindows.h" 13 | 14 | // #include 15 | // #include 16 | // #include 17 | 18 | // #define printf(x) NO_PRINTF_(x) 19 | // #define sprintf(x) NO_SPRINTF_(x) 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /CPP/7zip/UI/GUI/UpdateCallbackGUI.h: -------------------------------------------------------------------------------- 1 | // UpdateCallbackGUI.h 2 | 3 | #ifndef __UPDATE_CALLBACK_GUI_H 4 | #define __UPDATE_CALLBACK_GUI_H 5 | 6 | #include "../Common/Update.h" 7 | #include "../Common/ArchiveOpenCallback.h" 8 | 9 | #include "UpdateCallbackGUI2.h" 10 | 11 | class CUpdateCallbackGUI: 12 | public IOpenCallbackUI, 13 | public IUpdateCallbackUI2, 14 | public CUpdateCallbackGUI2 15 | { 16 | public: 17 | // CUpdateCallbackGUI(); 18 | // ~CUpdateCallbackGUI(); 19 | 20 | bool AskPassword; 21 | 22 | void Init(); 23 | 24 | CUpdateCallbackGUI(): 25 | AskPassword(false) 26 | {} 27 | 28 | INTERFACE_IUpdateCallbackUI2(;) 29 | INTERFACE_IOpenCallbackUI(;) 30 | 31 | FStringVector FailedFiles; 32 | }; 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /CPP/7zip/UI/GUI/UpdateCallbackGUI2.h: -------------------------------------------------------------------------------- 1 | // UpdateCallbackGUI2.h 2 | 3 | #ifndef __UPDATE_CALLBACK_GUI2_H 4 | #define __UPDATE_CALLBACK_GUI2_H 5 | 6 | #include "../FileManager/ProgressDialog2.h" 7 | 8 | class CUpdateCallbackGUI2 9 | { 10 | UStringVector _lang_Ops; 11 | UString _emptyString; 12 | public: 13 | UString Password; 14 | bool PasswordIsDefined; 15 | bool PasswordWasAsked; 16 | UInt64 NumFiles; 17 | 18 | UString _lang_Removing; 19 | 20 | CUpdateCallbackGUI2(): 21 | PasswordIsDefined(false), 22 | PasswordWasAsked(false), 23 | NumFiles(0) 24 | {} 25 | 26 | // ~CUpdateCallbackGUI2(); 27 | void Init(); 28 | 29 | CProgressDialog *ProgressDialog; 30 | 31 | HRESULT SetOperation_Base(UInt32 notifyOp, const wchar_t *name, bool isDir); 32 | HRESULT ShowAskPasswordDialog(); 33 | }; 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /CPP/7zip/UI/GUI/UpdateGUI.h: -------------------------------------------------------------------------------- 1 | // GUI/UpdateGUI.h 2 | 3 | #ifndef __UPDATE_GUI_H 4 | #define __UPDATE_GUI_H 5 | 6 | #include "../Common/Update.h" 7 | 8 | #include "UpdateCallbackGUI.h" 9 | 10 | /* 11 | callback->FailedFiles contains names of files for that there were problems. 12 | RESULT can be S_OK, even if there are such warnings!!! 13 | 14 | RESULT = E_ABORT - user break. 15 | RESULT != E_ABORT: 16 | { 17 | messageWasDisplayed = true - message was displayed already. 18 | messageWasDisplayed = false - there was some internal error, so you must show error message. 19 | } 20 | */ 21 | 22 | HRESULT UpdateGUI( 23 | CCodecs *codecs, 24 | const CObjectVector &formatIndices, 25 | const UString &cmdArcPath2, 26 | NWildcard::CCensor &censor, 27 | CUpdateOptions &options, 28 | bool showDialog, 29 | bool &messageWasDisplayed, 30 | CUpdateCallbackGUI *callback, 31 | HWND hwndParent = NULL); 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /CPP/7zip/UI/GUI/resource.rc: -------------------------------------------------------------------------------- 1 | #include "../../MyVersionInfo.rc" 2 | // #include 3 | 4 | #include "resource2.rc" 5 | #include "resource3.rc" 6 | 7 | #include "../FileManager/resourceGui.rc" 8 | 9 | MY_VERSION_INFO(MY_VFT_APP, "7-Zip GUI", "7zg", "7zg.exe") 10 | 11 | IDI_ICON ICON "FM.ico" 12 | 13 | #ifndef UNDER_CE 14 | 1 24 MOVEABLE PURE "7zG.exe.manifest" 15 | #endif 16 | 17 | #include "../FileManager/PropertyName.rc" 18 | #include "../FileManager/OverwriteDialog.rc" 19 | #include "../FileManager/PasswordDialog.rc" 20 | #include "../FileManager/ProgressDialog2.rc" 21 | #include "Extract.rc" 22 | #include "../FileManager/BrowseDialog.rc" 23 | #include "../FileManager/ComboDialog.rc" 24 | -------------------------------------------------------------------------------- /CPP/7zip/UI/GUI/resource2.h: -------------------------------------------------------------------------------- 1 | #define IDS_PROGRESS_COMPRESSING 3301 2 | #define IDS_ARCHIVES_COLON 3907 3 | -------------------------------------------------------------------------------- /CPP/7zip/UI/GUI/resource2.rc: -------------------------------------------------------------------------------- 1 | #include "ExtractDialog.rc" 2 | #include "CompressDialog.rc" 3 | #include "BenchmarkDialog.rc" 4 | #include "resource2.h" 5 | 6 | STRINGTABLE 7 | BEGIN 8 | IDS_PROGRESS_COMPRESSING "Compressing" 9 | IDS_ARCHIVES_COLON "Archives:" 10 | END 11 | -------------------------------------------------------------------------------- /CPP/7zip/UI/GUI/resource3.h: -------------------------------------------------------------------------------- 1 | #define IDS_PROGRESS_REMOVE 3305 2 | 3 | #define IDS_PROGRESS_ADD 3320 4 | #define IDS_PROGRESS_UPDATE 3321 5 | #define IDS_PROGRESS_ANALYZE 3322 6 | #define IDS_PROGRESS_REPLICATE 3323 7 | #define IDS_PROGRESS_REPACK 3324 8 | 9 | #define IDS_PROGRESS_DELETE 3326 10 | #define IDS_PROGRESS_HEADER 3327 11 | -------------------------------------------------------------------------------- /CPP/7zip/UI/GUI/resource3.rc: -------------------------------------------------------------------------------- 1 | #include "resource3.h" 2 | 3 | STRINGTABLE 4 | BEGIN 5 | IDS_PROGRESS_REMOVE "Removing" 6 | 7 | IDS_PROGRESS_ADD "Adding" 8 | IDS_PROGRESS_UPDATE "Updating" 9 | IDS_PROGRESS_ANALYZE "Analyzing" 10 | IDS_PROGRESS_REPLICATE "Replicating" 11 | IDS_PROGRESS_REPACK "Repacking" 12 | 13 | IDS_PROGRESS_DELETE "Deleting" 14 | IDS_PROGRESS_HEADER "Header creating" 15 | END 16 | -------------------------------------------------------------------------------- /CPP/7zip/UI/makefile: -------------------------------------------------------------------------------- 1 | DIRS = \ 2 | Client7z\~ \ 3 | Console\~ \ 4 | Explorer\~ \ 5 | Far\~ \ 6 | FileManager\~ \ 7 | GUI\~ \ 8 | 9 | all: $(DIRS) 10 | 11 | $(DIRS): 12 | !include "../SubBuild.mak" 13 | -------------------------------------------------------------------------------- /CPP/7zip/makefile: -------------------------------------------------------------------------------- 1 | DIRS = \ 2 | UI\~ \ 3 | Bundles\~ \ 4 | 5 | all: $(DIRS) 6 | 7 | $(DIRS): 8 | cd $(@D) 9 | $(MAKE) -nologo 10 | cd .. 11 | -------------------------------------------------------------------------------- /CPP/Common/AutoPtr.h: -------------------------------------------------------------------------------- 1 | // Common/AutoPtr.h 2 | 3 | #ifndef __COMMON_AUTOPTR_H 4 | #define __COMMON_AUTOPTR_H 5 | 6 | template class CMyAutoPtr 7 | { 8 | T *_p; 9 | public: 10 | CMyAutoPtr(T *p = 0) : _p(p) {} 11 | CMyAutoPtr(CMyAutoPtr& p): _p(p.release()) {} 12 | CMyAutoPtr& operator=(CMyAutoPtr& p) 13 | { 14 | reset(p.release()); 15 | return (*this); 16 | } 17 | ~CMyAutoPtr() { delete _p; } 18 | T& operator*() const { return *_p; } 19 | // T* operator->() const { return (&**this); } 20 | T* get() const { return _p; } 21 | T* release() 22 | { 23 | T *tmp = _p; 24 | _p = 0; 25 | return tmp; 26 | } 27 | void reset(T* p = 0) 28 | { 29 | if (p != _p) 30 | delete _p; 31 | _p = p; 32 | } 33 | }; 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /CPP/Common/CRC.cpp: -------------------------------------------------------------------------------- 1 | // Common/CRC.cpp 2 | 3 | #include "StdAfx.h" 4 | 5 | #include "../../C/7zCrc.h" 6 | 7 | struct CCRCTableInit { CCRCTableInit() { CrcGenerateTable(); } } g_CRCTableInit; 8 | -------------------------------------------------------------------------------- /CPP/Common/ComTry.h: -------------------------------------------------------------------------------- 1 | // ComTry.h 2 | 3 | #ifndef __COM_TRY_H 4 | #define __COM_TRY_H 5 | 6 | #include "MyWindows.h" 7 | // #include "Exception.h" 8 | // #include "NewHandler.h" 9 | 10 | #define COM_TRY_BEGIN try { 11 | #define COM_TRY_END } catch(...) { return E_OUTOFMEMORY; } 12 | 13 | // catch(const CNewException &) { return E_OUTOFMEMORY; } 14 | // catch(const CSystemException &e) { return e.ErrorCode; } 15 | // catch(...) { return E_FAIL; } 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /CPP/Common/Common.h: -------------------------------------------------------------------------------- 1 | // Common.h 2 | 3 | #ifndef __COMMON_COMMON_H 4 | #define __COMMON_COMMON_H 5 | 6 | #include "../../C/Compiler.h" 7 | 8 | #include "MyWindows.h" 9 | #include "NewHandler.h" 10 | 11 | #define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[1])) 12 | 13 | #endif 14 | -------------------------------------------------------------------------------- /CPP/Common/Defs.h: -------------------------------------------------------------------------------- 1 | // Common/Defs.h 2 | 3 | #ifndef __COMMON_DEFS_H 4 | #define __COMMON_DEFS_H 5 | 6 | template inline T MyMin(T a, T b) { return a < b ? a : b; } 7 | template inline T MyMax(T a, T b) { return a > b ? a : b; } 8 | 9 | template inline int MyCompare(T a, T b) 10 | { return a == b ? 0 : (a < b ? -1 : 1); } 11 | 12 | inline int BoolToInt(bool v) { return (v ? 1 : 0); } 13 | inline bool IntToBool(int v) { return (v != 0); } 14 | 15 | #endif 16 | -------------------------------------------------------------------------------- /CPP/Common/DynLimBuf.h: -------------------------------------------------------------------------------- 1 | // Common/DynLimBuf.h 2 | 3 | #ifndef __COMMON_DYN_LIM_BUF_H 4 | #define __COMMON_DYN_LIM_BUF_H 5 | 6 | #include 7 | 8 | #include "../../C/Alloc.h" 9 | 10 | #include "MyString.h" 11 | 12 | class CDynLimBuf 13 | { 14 | Byte *_chars; 15 | size_t _pos; 16 | size_t _size; 17 | size_t _sizeLimit; 18 | bool _error; 19 | 20 | CDynLimBuf(const CDynLimBuf &s); 21 | 22 | // ---------- forbidden functions ---------- 23 | CDynLimBuf &operator+=(wchar_t c); 24 | 25 | public: 26 | CDynLimBuf(size_t limit) throw(); 27 | ~CDynLimBuf() { MyFree(_chars); } 28 | 29 | size_t Len() const { return _pos; } 30 | void Empty() { _pos = 0; } 31 | 32 | operator const Byte *() const { return _chars; } 33 | // const char *Ptr() const { return _chars; } 34 | 35 | CDynLimBuf &operator+=(char c) throw(); 36 | CDynLimBuf &operator+=(const char *s) throw(); 37 | }; 38 | 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /CPP/Common/IntToString.h: -------------------------------------------------------------------------------- 1 | // Common/IntToString.h 2 | 3 | #ifndef __COMMON_INT_TO_STRING_H 4 | #define __COMMON_INT_TO_STRING_H 5 | 6 | #include "MyTypes.h" 7 | 8 | void ConvertUInt32ToString(UInt32 value, char *s) throw(); 9 | void ConvertUInt64ToString(UInt64 value, char *s) throw(); 10 | 11 | void ConvertUInt32ToString(UInt32 value, wchar_t *s) throw(); 12 | void ConvertUInt64ToString(UInt64 value, wchar_t *s) throw(); 13 | 14 | void ConvertUInt64ToOct(UInt64 value, char *s) throw(); 15 | 16 | void ConvertUInt32ToHex(UInt32 value, char *s) throw(); 17 | void ConvertUInt64ToHex(UInt64 value, char *s) throw(); 18 | void ConvertUInt32ToHex8Digits(UInt32 value, char *s) throw(); 19 | // void ConvertUInt32ToHex8Digits(UInt32 value, wchar_t *s) throw(); 20 | 21 | void ConvertInt64ToString(Int64 value, char *s) throw(); 22 | void ConvertInt64ToString(Int64 value, wchar_t *s) throw(); 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /CPP/Common/Lang.h: -------------------------------------------------------------------------------- 1 | // Common/Lang.h 2 | 3 | #ifndef __COMMON_LANG_H 4 | #define __COMMON_LANG_H 5 | 6 | #include "MyString.h" 7 | 8 | class CLang 9 | { 10 | wchar_t *_text; 11 | CRecordVector _ids; 12 | CRecordVector _offsets; 13 | 14 | bool OpenFromString(const AString &s); 15 | public: 16 | CLang(): _text(0) {} 17 | ~CLang() { Clear(); } 18 | bool Open(CFSTR fileName, const wchar_t *id); 19 | void Clear() throw(); 20 | const wchar_t *Get(UInt32 id) const throw(); 21 | }; 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /CPP/Common/ListFileUtils.h: -------------------------------------------------------------------------------- 1 | // Common/ListFileUtils.h 2 | 3 | #ifndef __COMMON_LIST_FILE_UTILS_H 4 | #define __COMMON_LIST_FILE_UTILS_H 5 | 6 | #include "MyString.h" 7 | #include "MyTypes.h" 8 | 9 | #define MY__CP_UTF16 1200 10 | #define MY__CP_UTF16BE 1201 11 | 12 | bool ReadNamesFromListFile(CFSTR fileName, UStringVector &strings, UINT codePage = CP_OEMCP); 13 | 14 | #endif 15 | -------------------------------------------------------------------------------- /CPP/Common/MyException.h: -------------------------------------------------------------------------------- 1 | // Common/Exception.h 2 | 3 | #ifndef __COMMON_EXCEPTION_H 4 | #define __COMMON_EXCEPTION_H 5 | 6 | #include "MyWindows.h" 7 | 8 | struct CSystemException 9 | { 10 | HRESULT ErrorCode; 11 | CSystemException(HRESULT errorCode): ErrorCode(errorCode) {} 12 | }; 13 | 14 | #endif 15 | -------------------------------------------------------------------------------- /CPP/Common/MyMap.h: -------------------------------------------------------------------------------- 1 | // MyMap.h 2 | 3 | #ifndef __COMMON_MYMAP_H 4 | #define __COMMON_MYMAP_H 5 | 6 | #include "MyTypes.h" 7 | #include "MyVector.h" 8 | 9 | class CMap32 10 | { 11 | struct CNode 12 | { 13 | UInt32 Key; 14 | UInt32 Keys[2]; 15 | UInt32 Values[2]; 16 | UInt16 Len; 17 | Byte IsLeaf[2]; 18 | }; 19 | CRecordVector Nodes; 20 | 21 | public: 22 | 23 | void Clear() { Nodes.Clear(); } 24 | bool Find(UInt32 key, UInt32 &valueRes) const throw(); 25 | bool Set(UInt32 key, UInt32 value); // returns true, if there is such key already 26 | }; 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /CPP/Common/MyTypes.h: -------------------------------------------------------------------------------- 1 | // Common/MyTypes.h 2 | 3 | #ifndef __COMMON_MY_TYPES_H 4 | #define __COMMON_MY_TYPES_H 5 | 6 | #include "../../C/7zTypes.h" 7 | 8 | typedef int HRes; 9 | 10 | struct CBoolPair 11 | { 12 | bool Val; 13 | bool Def; 14 | 15 | CBoolPair(): Val(false), Def(false) {} 16 | 17 | void Init() 18 | { 19 | Val = false; 20 | Def = false; 21 | } 22 | 23 | void SetTrueTrue() 24 | { 25 | Val = true; 26 | Def = true; 27 | } 28 | }; 29 | 30 | #define CLASS_NO_COPY(cls) \ 31 | private: \ 32 | cls(const cls &); \ 33 | cls &operator=(const cls &); 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /CPP/Common/MyUnknown.h: -------------------------------------------------------------------------------- 1 | // MyUnknown.h 2 | 3 | #ifndef __MY_UNKNOWN_H 4 | #define __MY_UNKNOWN_H 5 | 6 | #include "MyWindows.h" 7 | 8 | /* 9 | #ifdef _WIN32 10 | #include 11 | #include 12 | #else 13 | #include "MyWindows.h" 14 | #endif 15 | */ 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /CPP/Common/MyVector.cpp: -------------------------------------------------------------------------------- 1 | // Common/MyVector.cpp 2 | 3 | #include "StdAfx.h" 4 | -------------------------------------------------------------------------------- /CPP/Common/Random.cpp: -------------------------------------------------------------------------------- 1 | // Common/Random.cpp 2 | 3 | #include "StdAfx.h" 4 | 5 | #include 6 | 7 | #ifndef _WIN32 8 | #include 9 | #else 10 | #include "MyWindows.h" 11 | #endif 12 | 13 | #include "Random.h" 14 | 15 | void CRandom::Init(unsigned int seed) { srand(seed); } 16 | 17 | void CRandom::Init() 18 | { 19 | Init((unsigned int) 20 | #ifdef _WIN32 21 | GetTickCount() 22 | #else 23 | time(NULL) 24 | #endif 25 | ); 26 | } 27 | 28 | int CRandom::Generate() const { return rand(); } 29 | -------------------------------------------------------------------------------- /CPP/Common/Random.h: -------------------------------------------------------------------------------- 1 | // Common/Random.h 2 | 3 | #ifndef __COMMON_RANDOM_H 4 | #define __COMMON_RANDOM_H 5 | 6 | class CRandom 7 | { 8 | public: 9 | void Init(); 10 | void Init(unsigned int seed); 11 | int Generate() const; 12 | }; 13 | 14 | #endif 15 | -------------------------------------------------------------------------------- /CPP/Common/Sha1Reg.cpp: -------------------------------------------------------------------------------- 1 | // Sha1Reg.cpp 2 | 3 | #include "StdAfx.h" 4 | 5 | #include "../../C/Sha1.h" 6 | 7 | #include "../Common/MyCom.h" 8 | 9 | #include "../7zip/Common/RegisterCodec.h" 10 | 11 | class CSha1Hasher: 12 | public IHasher, 13 | public CMyUnknownImp 14 | { 15 | CSha1 _sha; 16 | Byte mtDummy[1 << 7]; 17 | 18 | public: 19 | CSha1Hasher() { Sha1_Init(&_sha); } 20 | 21 | MY_UNKNOWN_IMP 22 | INTERFACE_IHasher(;) 23 | }; 24 | 25 | STDMETHODIMP_(void) CSha1Hasher::Init() throw() 26 | { 27 | Sha1_Init(&_sha); 28 | } 29 | 30 | STDMETHODIMP_(void) CSha1Hasher::Update(const void *data, UInt32 size) throw() 31 | { 32 | Sha1_Update(&_sha, (const Byte *)data, size); 33 | } 34 | 35 | STDMETHODIMP_(void) CSha1Hasher::Final(Byte *digest) throw() 36 | { 37 | Sha1_Final(&_sha, digest); 38 | } 39 | 40 | REGISTER_HASHER(CSha1Hasher, 0x201, "SHA1", SHA1_DIGEST_SIZE) 41 | -------------------------------------------------------------------------------- /CPP/Common/Sha256Reg.cpp: -------------------------------------------------------------------------------- 1 | // Sha256Reg.cpp 2 | 3 | #include "StdAfx.h" 4 | 5 | #include "../../C/Sha256.h" 6 | 7 | #include "../Common/MyCom.h" 8 | 9 | #include "../7zip/Common/RegisterCodec.h" 10 | 11 | class CSha256Hasher: 12 | public IHasher, 13 | public CMyUnknownImp 14 | { 15 | CSha256 _sha; 16 | Byte mtDummy[1 << 7]; 17 | 18 | public: 19 | CSha256Hasher() { Sha256_Init(&_sha); } 20 | 21 | MY_UNKNOWN_IMP 22 | INTERFACE_IHasher(;) 23 | }; 24 | 25 | STDMETHODIMP_(void) CSha256Hasher::Init() throw() 26 | { 27 | Sha256_Init(&_sha); 28 | } 29 | 30 | STDMETHODIMP_(void) CSha256Hasher::Update(const void *data, UInt32 size) throw() 31 | { 32 | Sha256_Update(&_sha, (const Byte *)data, size); 33 | } 34 | 35 | STDMETHODIMP_(void) CSha256Hasher::Final(Byte *digest) throw() 36 | { 37 | Sha256_Final(&_sha, digest); 38 | } 39 | 40 | REGISTER_HASHER(CSha256Hasher, 0xA, "SHA256", SHA256_DIGEST_SIZE) 41 | -------------------------------------------------------------------------------- /CPP/Common/StdAfx.h: -------------------------------------------------------------------------------- 1 | // StdAfx.h 2 | 3 | #ifndef __STDAFX_H 4 | #define __STDAFX_H 5 | 6 | #include "Common.h" 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /CPP/Common/StdInStream.h: -------------------------------------------------------------------------------- 1 | // Common/StdInStream.h 2 | 3 | #ifndef __COMMON_STD_IN_STREAM_H 4 | #define __COMMON_STD_IN_STREAM_H 5 | 6 | #include 7 | 8 | #include "MyString.h" 9 | #include "MyTypes.h" 10 | 11 | class CStdInStream 12 | { 13 | FILE *_stream; 14 | bool _streamIsOpen; 15 | public: 16 | CStdInStream(): _stream(0), _streamIsOpen(false) {}; 17 | CStdInStream(FILE *stream): _stream(stream), _streamIsOpen(false) {}; 18 | ~CStdInStream() { Close(); } 19 | 20 | bool Open(LPCTSTR fileName) throw(); 21 | bool Close() throw(); 22 | 23 | AString ScanStringUntilNewLine(bool allowEOF = false); 24 | void ReadToString(AString &resultString); 25 | UString ScanUStringUntilNewLine(); 26 | 27 | bool Eof() throw(); 28 | int GetChar(); 29 | }; 30 | 31 | extern CStdInStream g_StdIn; 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /CPP/Common/StringToInt.h: -------------------------------------------------------------------------------- 1 | // Common/StringToInt.h 2 | 3 | #ifndef __COMMON_STRING_TO_INT_H 4 | #define __COMMON_STRING_TO_INT_H 5 | 6 | #include "MyTypes.h" 7 | 8 | UInt32 ConvertStringToUInt32(const char *s, const char **end) throw(); 9 | UInt64 ConvertStringToUInt64(const char *s, const char **end) throw(); 10 | UInt32 ConvertStringToUInt32(const wchar_t *s, const wchar_t **end) throw(); 11 | UInt64 ConvertStringToUInt64(const wchar_t *s, const wchar_t **end) throw(); 12 | 13 | Int32 ConvertStringToInt32(const wchar_t *s, const wchar_t **end) throw(); 14 | 15 | UInt32 ConvertOctStringToUInt32(const char *s, const char **end) throw(); 16 | UInt64 ConvertOctStringToUInt64(const char *s, const char **end) throw(); 17 | 18 | UInt32 ConvertHexStringToUInt32(const char *s, const char **end) throw(); 19 | UInt64 ConvertHexStringToUInt64(const char *s, const char **end) throw(); 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /CPP/Common/TextConfig.h: -------------------------------------------------------------------------------- 1 | // Common/TextConfig.h 2 | 3 | #ifndef __COMMON_TEXT_CONFIG_H 4 | #define __COMMON_TEXT_CONFIG_H 5 | 6 | #include "MyString.h" 7 | 8 | struct CTextConfigPair 9 | { 10 | UString ID; 11 | UString String; 12 | }; 13 | 14 | bool GetTextConfig(const AString &text, CObjectVector &pairs); 15 | 16 | int FindTextConfigItem(const CObjectVector &pairs, const UString &id) throw(); 17 | UString GetTextConfigValue(const CObjectVector &pairs, const UString &id); 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /CPP/Common/UTFConvert.h: -------------------------------------------------------------------------------- 1 | // Common/UTFConvert.h 2 | 3 | #ifndef __COMMON_UTF_CONVERT_H 4 | #define __COMMON_UTF_CONVERT_H 5 | 6 | #include "MyString.h" 7 | 8 | bool CheckUTF8(const char *src, bool allowReduced = false) throw(); 9 | bool ConvertUTF8ToUnicode(const AString &utfString, UString &resultString); 10 | void ConvertUnicodeToUTF8(const UString &unicodeString, AString &resultString); 11 | 12 | #endif 13 | -------------------------------------------------------------------------------- /CPP/Windows/COM.cpp: -------------------------------------------------------------------------------- 1 | // Windows/COM.cpp 2 | 3 | #include "StdAfx.h" 4 | 5 | /* 6 | 7 | #include "COM.h" 8 | #include "../Common/StringConvert.h" 9 | 10 | namespace NWindows { 11 | namespace NCOM { 12 | 13 | // CoInitialize (NULL); must be called! 14 | 15 | UString GUIDToStringW(REFGUID guid) 16 | { 17 | UString s; 18 | const unsigned kSize = 48; 19 | StringFromGUID2(guid, s.GetBuf(kSize), kSize); 20 | s.ReleaseBuf_CalcLen(kSize); 21 | return s; 22 | } 23 | 24 | AString GUIDToStringA(REFGUID guid) 25 | { 26 | return UnicodeStringToMultiByte(GUIDToStringW(guid)); 27 | } 28 | 29 | HRESULT StringToGUIDW(const wchar_t *string, GUID &classID) 30 | { 31 | return CLSIDFromString((wchar_t *)string, &classID); 32 | } 33 | 34 | HRESULT StringToGUIDA(const char *string, GUID &classID) 35 | { 36 | return StringToGUIDW(MultiByteToUnicodeString(string), classID); 37 | } 38 | 39 | }} 40 | 41 | */ 42 | -------------------------------------------------------------------------------- /CPP/Windows/Clipboard.h: -------------------------------------------------------------------------------- 1 | // Windows/Clipboard.h 2 | 3 | #ifndef __CLIPBOARD_H 4 | #define __CLIPBOARD_H 5 | 6 | #include "../Common/MyString.h" 7 | 8 | namespace NWindows { 9 | 10 | class CClipboard 11 | { 12 | bool m_Open; 13 | public: 14 | CClipboard(): m_Open(false) {}; 15 | ~CClipboard() { Close(); } 16 | bool Open(HWND wndNewOwner) throw(); 17 | bool Close() throw(); 18 | }; 19 | 20 | bool ClipboardIsFormatAvailableHDROP(); 21 | 22 | // bool ClipboardGetFileNames(UStringVector &names); 23 | // bool ClipboardGetTextString(AString &s); 24 | bool ClipboardSetText(HWND owner, const UString &s); 25 | 26 | } 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /CPP/Windows/CommonDialog.h: -------------------------------------------------------------------------------- 1 | // Windows/CommonDialog.h 2 | 3 | #ifndef __WINDOWS_COMMON_DIALOG_H 4 | #define __WINDOWS_COMMON_DIALOG_H 5 | 6 | #include "../Common/MyString.h" 7 | 8 | namespace NWindows { 9 | 10 | bool MyGetOpenFileName(HWND hwnd, LPCWSTR title, 11 | LPCWSTR initialDir, // can be NULL, so dir prefix in filePath will be used 12 | LPCWSTR filePath, // full path 13 | LPCWSTR filterDescription, // like "All files (*.*)" 14 | LPCWSTR filter, // like "*.exe" 15 | UString &resPath 16 | #ifdef UNDER_CE 17 | , bool openFolder = false 18 | #endif 19 | ); 20 | 21 | } 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /CPP/Windows/Console.cpp: -------------------------------------------------------------------------------- 1 | // Windows/Console.cpp 2 | 3 | #include "StdAfx.h" 4 | 5 | #include "Console.h" 6 | 7 | namespace NWindows{ 8 | namespace NConsole{ 9 | 10 | }} 11 | -------------------------------------------------------------------------------- /CPP/Windows/Control/Edit.h: -------------------------------------------------------------------------------- 1 | // Windows/Control/Edit.h 2 | 3 | #ifndef __WINDOWS_CONTROL_EDIT_H 4 | #define __WINDOWS_CONTROL_EDIT_H 5 | 6 | #include "../Window.h" 7 | 8 | namespace NWindows { 9 | namespace NControl { 10 | 11 | class CEdit: public CWindow 12 | { 13 | public: 14 | void SetPasswordChar(WPARAM c) { SendMsg(EM_SETPASSWORDCHAR, c); } 15 | }; 16 | 17 | }} 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /CPP/Windows/Control/ImageList.cpp: -------------------------------------------------------------------------------- 1 | // Windows/Control/ImageList.cpp 2 | 3 | #include "StdAfx.h" 4 | 5 | #include "ImageList.h" 6 | 7 | namespace NWindows { 8 | namespace NControl { 9 | 10 | }} 11 | -------------------------------------------------------------------------------- /CPP/Windows/Control/Static.h: -------------------------------------------------------------------------------- 1 | // Windows/Control/Static.h 2 | 3 | #ifndef __WINDOWS_CONTROL_STATIC_H 4 | #define __WINDOWS_CONTROL_STATIC_H 5 | 6 | #include "../Window.h" 7 | 8 | namespace NWindows { 9 | namespace NControl { 10 | 11 | class CStatic: public CWindow 12 | { 13 | public: 14 | HANDLE SetImage(WPARAM imageType, HANDLE handle) { return (HANDLE)SendMsg(STM_SETIMAGE, imageType, (LPARAM)handle); } 15 | HANDLE GetImage(WPARAM imageType) { return (HANDLE)SendMsg(STM_GETIMAGE, imageType, 0); } 16 | 17 | #ifdef UNDER_CE 18 | HICON SetIcon(HICON icon) { return (HICON)SetImage(IMAGE_ICON, icon); } 19 | HICON GetIcon() { return (HICON)GetImage(IMAGE_ICON); } 20 | #else 21 | HICON SetIcon(HICON icon) { return (HICON)SendMsg(STM_SETICON, (WPARAM)icon, 0); } 22 | HICON GetIcon() { return (HICON)SendMsg(STM_GETICON, 0, 0); } 23 | #endif 24 | }; 25 | 26 | }} 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /CPP/Windows/Control/StdAfx.h: -------------------------------------------------------------------------------- 1 | // StdAfx.h 2 | 3 | #ifndef __STDAFX_H 4 | #define __STDAFX_H 5 | 6 | #include "../../Common/Common.h" 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /CPP/Windows/Control/Trackbar.h: -------------------------------------------------------------------------------- 1 | // Windows/Control/Trackbar.h 2 | 3 | #ifndef __WINDOWS_CONTROL_TRACKBAR_H 4 | #define __WINDOWS_CONTROL_TRACKBAR_H 5 | 6 | #include "../Window.h" 7 | 8 | namespace NWindows { 9 | namespace NControl { 10 | 11 | class CTrackbar: public CWindow 12 | { 13 | public: 14 | void SetRange(int minimum, int maximum, bool redraw = true) 15 | { SendMsg(TBM_SETRANGE, BoolToBOOL(redraw), MAKELONG(minimum, maximum)); } 16 | void SetPos(int pos, bool redraw = true) 17 | { SendMsg(TBM_SETPOS, BoolToBOOL(redraw), pos); } 18 | void SetTicFreq(int freq) 19 | { SendMsg(TBM_SETTICFREQ, freq); } 20 | 21 | int GetPos() 22 | { return (int)SendMsg(TBM_GETPOS); } 23 | }; 24 | 25 | }} 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /CPP/Windows/Defs.h: -------------------------------------------------------------------------------- 1 | // Windows/Defs.h 2 | 3 | #ifndef __WINDOWS_DEFS_H 4 | #define __WINDOWS_DEFS_H 5 | 6 | #include "../Common/MyWindows.h" 7 | 8 | #ifdef _WIN32 9 | inline bool LRESULTToBool(LRESULT v) { return (v != FALSE); } 10 | inline bool BOOLToBool(BOOL v) { return (v != FALSE); } 11 | inline BOOL BoolToBOOL(bool v) { return (v ? TRUE: FALSE); } 12 | #endif 13 | 14 | inline VARIANT_BOOL BoolToVARIANT_BOOL(bool v) { return (v ? VARIANT_TRUE: VARIANT_FALSE); } 15 | inline bool VARIANT_BOOLToBool(VARIANT_BOOL v) { return (v != VARIANT_FALSE); } 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /CPP/Windows/ErrorMsg.h: -------------------------------------------------------------------------------- 1 | // Windows/ErrorMsg.h 2 | 3 | #ifndef __WINDOWS_ERROR_MSG_H 4 | #define __WINDOWS_ERROR_MSG_H 5 | 6 | #include "../Common/MyString.h" 7 | 8 | namespace NWindows { 9 | namespace NError { 10 | 11 | UString MyFormatMessage(DWORD errorCode); 12 | 13 | }} 14 | 15 | #endif 16 | -------------------------------------------------------------------------------- /CPP/Windows/FileMapping.cpp: -------------------------------------------------------------------------------- 1 | // Windows/FileMapping.cpp 2 | 3 | #include "StdAfx.h" 4 | 5 | #include "FileMapping.h" 6 | 7 | namespace NWindows { 8 | namespace NFile { 9 | namespace NMapping { 10 | 11 | 12 | }}} 13 | -------------------------------------------------------------------------------- /CPP/Windows/FileSystem.h: -------------------------------------------------------------------------------- 1 | // Windows/FileSystem.h 2 | 3 | #ifndef __WINDOWS_FILE_SYSTEM_H 4 | #define __WINDOWS_FILE_SYSTEM_H 5 | 6 | #include "../Common/MyString.h" 7 | #include "../Common/MyTypes.h" 8 | 9 | namespace NWindows { 10 | namespace NFile { 11 | namespace NSystem { 12 | 13 | bool MyGetVolumeInformation( 14 | CFSTR rootPath , 15 | UString &volumeName, 16 | LPDWORD volumeSerialNumber, 17 | LPDWORD maximumComponentLength, 18 | LPDWORD fileSystemFlags, 19 | UString &fileSystemName); 20 | 21 | UINT MyGetDriveType(CFSTR pathName); 22 | 23 | bool MyGetDiskFreeSpace(CFSTR rootPath, UInt64 &clusterSize, UInt64 &totalSize, UInt64 &freeSize); 24 | 25 | }}} 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /CPP/Windows/Handle.h: -------------------------------------------------------------------------------- 1 | // Windows/Handle.h 2 | 3 | #ifndef __WINDOWS_HANDLE_H 4 | #define __WINDOWS_HANDLE_H 5 | 6 | namespace NWindows { 7 | 8 | class CHandle 9 | { 10 | protected: 11 | HANDLE _handle; 12 | public: 13 | operator HANDLE() { return _handle; } 14 | CHandle(): _handle(NULL) {} 15 | ~CHandle() { Close(); } 16 | bool IsCreated() const { return (_handle != NULL); } 17 | bool Close() 18 | { 19 | if (_handle == NULL) 20 | return true; 21 | if (!::CloseHandle(_handle)) 22 | return false; 23 | _handle = NULL; 24 | return true; 25 | } 26 | void Attach(HANDLE handle) { _handle = handle; } 27 | HANDLE Detach() 28 | { 29 | HANDLE handle = _handle; 30 | _handle = NULL; 31 | return handle; 32 | } 33 | }; 34 | 35 | } 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /CPP/Windows/MemoryGlobal.cpp: -------------------------------------------------------------------------------- 1 | // Windows/MemoryGlobal.cpp 2 | 3 | #include "StdAfx.h" 4 | 5 | #include "MemoryGlobal.h" 6 | 7 | namespace NWindows { 8 | namespace NMemory { 9 | 10 | bool CGlobal::Alloc(UINT flags, SIZE_T size) throw() 11 | { 12 | HGLOBAL newBlock = ::GlobalAlloc(flags, size); 13 | if (newBlock == NULL) 14 | return false; 15 | _global = newBlock; 16 | return true; 17 | } 18 | 19 | bool CGlobal::Free() throw() 20 | { 21 | if (_global == NULL) 22 | return true; 23 | _global = ::GlobalFree(_global); 24 | return (_global == NULL); 25 | } 26 | 27 | bool CGlobal::ReAlloc(SIZE_T size) throw() 28 | { 29 | HGLOBAL newBlock = ::GlobalReAlloc(_global, size, GMEM_MOVEABLE); 30 | if (newBlock == NULL) 31 | return false; 32 | _global = newBlock; 33 | return true; 34 | } 35 | 36 | }} 37 | -------------------------------------------------------------------------------- /CPP/Windows/NationalTime.h: -------------------------------------------------------------------------------- 1 | // Windows/NationalTime.h 2 | 3 | #ifndef __WINDOWS_NATIONAL_TIME_H 4 | #define __WINDOWS_NATIONAL_TIME_H 5 | 6 | #include "../Common/MyString.h" 7 | 8 | namespace NWindows { 9 | namespace NNational { 10 | namespace NTime { 11 | 12 | bool MyGetTimeFormat(LCID locale, DWORD flags, CONST SYSTEMTIME *time, 13 | LPCTSTR format, CSysString &resultString); 14 | 15 | bool MyGetDateFormat(LCID locale, DWORD flags, CONST SYSTEMTIME *time, 16 | LPCTSTR format, CSysString &resultString); 17 | 18 | }}} 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /CPP/Windows/ProcessMessages.cpp: -------------------------------------------------------------------------------- 1 | // Windows/ProcessMessages.cpp 2 | 3 | #include "StdAfx.h" 4 | 5 | #include "ProcessMessages.h" 6 | 7 | namespace NWindows { 8 | 9 | void ProcessMessages(HWND window) 10 | { 11 | MSG msg; 12 | while (::PeekMessage(&msg, NULL, 0, 0, PM_REMOVE) ) 13 | { 14 | if (window == (HWND) NULL || !IsDialogMessage(window, &msg)) 15 | { 16 | TranslateMessage(&msg); 17 | DispatchMessage(&msg); 18 | } 19 | } 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /CPP/Windows/ProcessMessages.h: -------------------------------------------------------------------------------- 1 | // Windows/ProcessMessages.h 2 | 3 | #ifndef __WINDOWS_PROCESSMESSAGES_H 4 | #define __WINDOWS_PROCESSMESSAGES_H 5 | 6 | namespace NWindows { 7 | 8 | void ProcessMessages(HWND window); 9 | 10 | } 11 | 12 | #endif 13 | -------------------------------------------------------------------------------- /CPP/Windows/ResourceString.h: -------------------------------------------------------------------------------- 1 | // Windows/ResourceString.h 2 | 3 | #ifndef __WINDOWS_RESOURCE_STRING_H 4 | #define __WINDOWS_RESOURCE_STRING_H 5 | 6 | #include "../Common/MyString.h" 7 | 8 | namespace NWindows { 9 | 10 | UString MyLoadString(UINT resourceID); 11 | void MyLoadString(HINSTANCE hInstance, UINT resourceID, UString &dest); 12 | void MyLoadString(UINT resourceID, UString &dest); 13 | 14 | } 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /CPP/Windows/StdAfx.h: -------------------------------------------------------------------------------- 1 | // StdAfx.h 2 | 3 | #ifndef __STDAFX_H 4 | #define __STDAFX_H 5 | 6 | #include "../Common/Common.h" 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /CPP/Windows/Synchronization.cpp: -------------------------------------------------------------------------------- 1 | // Windows/Synchronization.cpp 2 | 3 | #include "StdAfx.h" 4 | 5 | #include "Synchronization.h" 6 | 7 | namespace NWindows { 8 | namespace NSynchronization { 9 | 10 | }} 11 | -------------------------------------------------------------------------------- /CPP/Windows/System.h: -------------------------------------------------------------------------------- 1 | // Windows/System.h 2 | 3 | #ifndef __WINDOWS_SYSTEM_H 4 | #define __WINDOWS_SYSTEM_H 5 | 6 | #include "../Common/MyTypes.h" 7 | 8 | namespace NWindows { 9 | namespace NSystem { 10 | 11 | UInt32 GetNumberOfProcessors(); 12 | 13 | bool GetRamSize(UInt64 &size); // returns false, if unknown ram size 14 | 15 | }} 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /CPP/Windows/TimeUtils.h: -------------------------------------------------------------------------------- 1 | // Windows/TimeUtils.h 2 | 3 | #ifndef __WINDOWS_TIME_UTILS_H 4 | #define __WINDOWS_TIME_UTILS_H 5 | 6 | #include "../Common/MyTypes.h" 7 | #include "../Common/MyWindows.h" 8 | 9 | namespace NWindows { 10 | namespace NTime { 11 | 12 | bool DosTimeToFileTime(UInt32 dosTime, FILETIME &fileTime) throw(); 13 | bool FileTimeToDosTime(const FILETIME &fileTime, UInt32 &dosTime) throw(); 14 | void UnixTimeToFileTime(UInt32 unixTime, FILETIME &fileTime) throw(); 15 | bool UnixTime64ToFileTime(Int64 unixTime, FILETIME &fileTime) throw(); 16 | bool FileTimeToUnixTime(const FILETIME &fileTime, UInt32 &unixTime) throw(); 17 | Int64 FileTimeToUnixTime64(const FILETIME &ft) throw(); 18 | bool GetSecondsSince1601(unsigned year, unsigned month, unsigned day, 19 | unsigned hour, unsigned min, unsigned sec, UInt64 &resSeconds) throw(); 20 | void GetCurUtcFileTime(FILETIME &ft) throw(); 21 | 22 | }} 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /SevenZip/ArchiveExtractCallback.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjieest/lib7z-static/c847005f0358c0c054fa2318aa38c1901703c425/SevenZip/ArchiveExtractCallback.cpp -------------------------------------------------------------------------------- /SevenZip/CompressionLevel.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | 4 | #include "Enum.h" 5 | 6 | 7 | namespace SevenZip 8 | { 9 | struct CompressionLevel 10 | { 11 | enum _Enum 12 | { 13 | Default, 14 | Fast, 15 | Normal 16 | }; 17 | 18 | typedef intl::EnumerationDefinitionNoStrings _Definition; 19 | typedef intl::EnumerationValue< _Enum, _Definition, Normal > _Value; 20 | }; 21 | 22 | typedef CompressionLevel::_Value CompressionLevelEnum; 23 | } 24 | -------------------------------------------------------------------------------- /SevenZip/FileInfo.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "SevenString.h" 3 | 4 | namespace SevenZip 5 | { 6 | namespace intl 7 | { 8 | struct FileInfo 9 | { 10 | TString FileName; 11 | FILETIME LastWriteTime; 12 | FILETIME CreationTime; 13 | FILETIME LastAccessTime; 14 | ULONGLONG Size; 15 | UINT Attributes; 16 | bool IsDirectory; 17 | }; 18 | 19 | struct FilePathInfo : public FileInfo 20 | { 21 | TString FilePath; 22 | }; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /SevenZip/FileSys.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjieest/lib7z-static/c847005f0358c0c054fa2318aa38c1901703c425/SevenZip/FileSys.cpp -------------------------------------------------------------------------------- /SevenZip/GUIDs.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include 3 | #include "GUIDs.h" 4 | #include "../include/7zpp.h" 5 | -------------------------------------------------------------------------------- /SevenZip/InStreamWrapper.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | 4 | #include "../CPP/7zip/IStream.h" 5 | #include "../CPP/Common/MyCom.h" 6 | 7 | 8 | namespace SevenZip 9 | { 10 | namespace intl 11 | { 12 | class InStreamWrapper : public IInStream, public IStreamGetSize 13 | { 14 | private: 15 | 16 | long m_refCount; 17 | CMyComPtr< IStream > m_baseStream; 18 | 19 | public: 20 | 21 | InStreamWrapper( const CMyComPtr< IStream >& baseStream ); 22 | virtual ~InStreamWrapper(); 23 | 24 | STDMETHOD(QueryInterface)( REFIID iid, void** ppvObject ); 25 | STDMETHOD_(ULONG, AddRef)(); 26 | STDMETHOD_(ULONG, Release)(); 27 | 28 | // ISequentialInStream 29 | STDMETHOD(Read)( void* data, UInt32 size, UInt32* processedSize ); 30 | 31 | // IInStream 32 | STDMETHOD(Seek)( Int64 offset, UInt32 seekOrigin, UInt64* newPosition ); 33 | 34 | // IStreamGetSize 35 | STDMETHOD(GetSize)( UInt64* size ); 36 | }; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /SevenZip/ListCallback.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "CompressionFormat.h" 3 | 4 | 5 | namespace SevenZip 6 | { 7 | class ListCallback 8 | { 9 | public: 10 | /* 11 | Called for each file found in the archive. Size in bytes. 12 | */ 13 | virtual void OnFileFound(WCHAR* /*path*/, int /*size*/) {} 14 | 15 | /* 16 | Called when all the files have been listed 17 | */ 18 | virtual void OnListingDone(WCHAR* /*path*/) {} 19 | }; 20 | } 21 | -------------------------------------------------------------------------------- /SevenZip/OutStreamWrapper.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | 4 | #include "../CPP/7zip/IStream.h" 5 | #include "../CPP/Common/MyCom.h" 6 | 7 | 8 | namespace SevenZip 9 | { 10 | namespace intl 11 | { 12 | class OutStreamWrapper : public IOutStream 13 | { 14 | private: 15 | 16 | long m_refCount; 17 | CMyComPtr< IStream > m_baseStream; 18 | 19 | public: 20 | 21 | OutStreamWrapper( const CMyComPtr< IStream >& baseStream ); 22 | virtual ~OutStreamWrapper(); 23 | 24 | STDMETHOD(QueryInterface)( REFIID iid, void** ppvObject ); 25 | STDMETHOD_(ULONG, AddRef)(); 26 | STDMETHOD_(ULONG, Release)(); 27 | 28 | // ISequentialOutStream 29 | STDMETHOD(Write)( const void* data, UInt32 size, UInt32* processedSize ); 30 | 31 | // IOutStream 32 | STDMETHOD(Seek)( Int64 offset, UInt32 seekOrigin, UInt64* newPosition ); 33 | STDMETHOD(SetSize)( UInt64 newSize ); 34 | }; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /SevenZip/ProgressCallback.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjieest/lib7z-static/c847005f0358c0c054fa2318aa38c1901703c425/SevenZip/ProgressCallback.h -------------------------------------------------------------------------------- /SevenZip/SevenString.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | 4 | #include 5 | #include 6 | 7 | 8 | namespace SevenZip 9 | { 10 | #ifdef _UNICODE 11 | typedef std::wstring TString; 12 | #else 13 | typedef std::string TString; 14 | #endif 15 | } 16 | -------------------------------------------------------------------------------- /SevenZip/SevenZipCompressor.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjieest/lib7z-static/c847005f0358c0c054fa2318aa38c1901703c425/SevenZip/SevenZipCompressor.cpp -------------------------------------------------------------------------------- /SevenZip/SevenZipException.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | 4 | #include 5 | #include "SevenString.h" 6 | 7 | 8 | namespace SevenZip 9 | { 10 | TString StrFmt( const TCHAR* format, ... ); 11 | TString GetWinErrMsg( const TString& contextMessage, DWORD lastError ); 12 | TString GetCOMErrMsg( const TString& contextMessage, HRESULT lastError ); 13 | 14 | class SevenZipException 15 | { 16 | protected: 17 | 18 | TString m_message; 19 | 20 | public: 21 | 22 | SevenZipException(); 23 | SevenZipException( const TString& message ); 24 | virtual ~SevenZipException(); 25 | 26 | const TString& GetMessage() const; 27 | }; 28 | } 29 | -------------------------------------------------------------------------------- /SevenZip/SevenZipExtractor.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjieest/lib7z-static/c847005f0358c0c054fa2318aa38c1901703c425/SevenZip/SevenZipExtractor.cpp -------------------------------------------------------------------------------- /SevenZip/SevenZipExtractor.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "SevenZipArchive.h" 3 | #include "CompressionFormat.h" 4 | #include "ProgressCallback.h" 5 | 6 | 7 | namespace SevenZip 8 | { 9 | class SevenZipExtractor : public SevenZipArchive 10 | { 11 | public: 12 | 13 | SevenZipExtractor(); 14 | virtual ~SevenZipExtractor(); 15 | 16 | virtual HRESULT ExtractArchive(const TString& directory, ProgressCallback* callback); 17 | const TString& GetErrorString(); 18 | 19 | void SetOverwriteMode(const OverwriteModeEnum& mode); 20 | OverwriteModeEnum GetOverwriteMode(); 21 | private: 22 | 23 | HRESULT ExtractArchive(const CMyComPtr< IStream >& archiveStream, const TString& directory, ProgressCallback* callback); 24 | 25 | OverwriteModeEnum m_overwriteMode; 26 | TString m_message; 27 | }; 28 | } 29 | -------------------------------------------------------------------------------- /SevenZip/SevenZipLibrary.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "SevenZipException.h" 4 | #include "CompressionFormat.h" 5 | 6 | namespace SevenZip 7 | { 8 | class SevenZipLibrary 9 | { 10 | private: 11 | 12 | typedef UINT32 (WINAPI * CreateObjectFunc)( const GUID* clsID, const GUID* interfaceID, void** outObject ); 13 | 14 | HMODULE m_dll; 15 | CreateObjectFunc m_func; 16 | 17 | public: 18 | 19 | SevenZipLibrary(); 20 | ~SevenZipLibrary(); 21 | 22 | bool Load(); 23 | bool Load( const TString& libraryPath ); 24 | void Free(); 25 | 26 | bool CreateObject( const GUID& clsID, const GUID& interfaceID, void** outObject ) const; 27 | }; 28 | } 29 | -------------------------------------------------------------------------------- /SevenZip/SevenZipLister.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "SevenZipArchive.h" 3 | #include "CompressionFormat.h" 4 | #include "ListCallback.h" 5 | 6 | 7 | namespace SevenZip 8 | { 9 | class SevenZipLister : public SevenZipArchive 10 | { 11 | public: 12 | 13 | SevenZipLister(); 14 | virtual ~SevenZipLister(); 15 | 16 | virtual bool ListArchive(ListCallback* callback); 17 | 18 | private: 19 | bool ListArchive(const CMyComPtr< IStream >& archiveStream, ListCallback* callback); 20 | }; 21 | } 22 | -------------------------------------------------------------------------------- /SevenZip/UsefulFunctions.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjieest/lib7z-static/c847005f0358c0c054fa2318aa38c1901703c425/SevenZip/UsefulFunctions.cpp -------------------------------------------------------------------------------- /StdAfx.cpp: -------------------------------------------------------------------------------- 1 | // StdAfx.cpp 2 | 3 | #include "StdAfx.h" 4 | -------------------------------------------------------------------------------- /StdAfx.h: -------------------------------------------------------------------------------- 1 | // StdAfx.h 2 | 3 | #ifndef __STDAFX_H 4 | #define __STDAFX_H 5 | 6 | #include "../../../Common/Common.h" 7 | #include "targetver.h" 8 | #define WIN32_LEAN_AND_MEAN 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | #endif 15 | -------------------------------------------------------------------------------- /include/7zpp.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #ifndef EXTRACT_ONLY 3 | #include "../SevenZip/SevenZipCompressor.h" 4 | #endif 5 | #include "../SevenZip/SevenZipExtractor.h" 6 | #include "../SevenZip/SevenZipLister.h" 7 | -------------------------------------------------------------------------------- /include/7zppMD.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #define EXTRACT_ONLY 4 | #include "7zpp.h" 5 | #define LIBPATH_LIB7Z(p,f) p##f 6 | #if defined(_DEBUG) 7 | #pragma comment(lib,LIBPATH_LIB7Z(__FILE__, "/../../lib/Debug/lib7zMD.lib")) 8 | #elif defined(PGO) 9 | #pragma comment(lib,LIBPATH_LIB7Z(__FILE__, "/../../lib/PGO/lib7zMD.lib")) 10 | #else 11 | #pragma comment(lib,LIBPATH_LIB7Z(__FILE__, "/../../lib/Release/lib7zMD.lib")) 12 | #endif 13 | #undef LIBPATH_LIB7Z 14 | -------------------------------------------------------------------------------- /include/7zppMT-ExactOnly.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "7zpp.h" 3 | #define LIBPATH_LIB7Z(p,f) p##f 4 | #if defined(_DEBUG) 5 | #pragma comment(lib,LIBPATH_LIB7Z(__FILE__, "/../../lib/Debug/lib7zMT-ExactOnly.lib")) 6 | #elif defined(PGO) 7 | #pragma comment(lib,LIBPATH_LIB7Z(__FILE__, "/../../lib/PGO/lib7zMT-ExactOnly.lib")) 8 | #else 9 | #pragma comment(lib,LIBPATH_LIB7Z(__FILE__, "/../../lib/Release/lib7zMT-ExactOnly.lib")) 10 | #endif 11 | #undef LIBPATH_LIB7Z 12 | -------------------------------------------------------------------------------- /include/7zppMT.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "7zpp.h" 3 | #define LIBPATH_LIB7Z(p,f) p##f 4 | #if defined(_DEBUG) 5 | #pragma comment(lib,LIBPATH_LIB7Z(__FILE__, "/../../lib/Debug/lib7zMT.lib")) 6 | #elif defined(PGO) 7 | #pragma comment(lib,LIBPATH_LIB7Z(__FILE__, "/../../lib/PGO/lib7zMT.lib")) 8 | #else 9 | #pragma comment(lib,LIBPATH_LIB7Z(__FILE__, "/../../lib/Release/lib7zMT.lib")) 10 | #endif 11 | #undef LIBPATH_LIB7Z 12 | -------------------------------------------------------------------------------- /targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | #undef _WIN32_WINNT 8 | #define _WIN32_WINNT 0x501 9 | #include 10 | -------------------------------------------------------------------------------- /test/stdafx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // test.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | 7 | // TODO: reference any additional headers you need in STDAFX.H 8 | // and not in this file 9 | -------------------------------------------------------------------------------- /test/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #pragma once 7 | 8 | #include "targetver.h" 9 | 10 | #include 11 | #include 12 | 13 | 14 | 15 | // TODO: reference additional headers your program requires here 16 | -------------------------------------------------------------------------------- /test/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /test/test.cpp: -------------------------------------------------------------------------------- 1 | // test.cpp : Defines the entry point for the console application. 2 | // 3 | 4 | #include "stdafx.h" 5 | #include "../include/7zppMT.h" 6 | 7 | int __cdecl _tmain(int argc, _TCHAR* argv[]) 8 | { 9 | // SevenZip::SevenZipCompressor compress; 10 | // compress.SetArchivePath(LR"(C:\Patch.7z)"); 11 | // if (S_OK != compress.CompressFiles(LR"(C:\Patch)", L"*.*", nullptr)) 12 | // { 13 | // wprintf_s(L"compress dir to 7z failed\n"); 14 | // } 15 | 16 | SevenZip::SevenZipExtractor decompress; 17 | decompress.SetArchivePath(LR"(C:\Patch.7z)"); 18 | if (S_OK != decompress.ExtractArchive(LR"(C:\Patch)", nullptr)) 19 | { 20 | wprintf_s(L"decompress 7z to dir failed\n"); 21 | } 22 | 23 | return 0; 24 | } 25 | 26 | --------------------------------------------------------------------------------