Compare commits

...

3 Commits
4.62 ... 4.65

Author SHA1 Message Date
Igor Pavlov
8874e4fbc9 4.65 2016-05-28 00:15:59 +01:00
Igor Pavlov
1dc92281fa 4.64 2016-05-28 00:15:59 +01:00
Igor Pavlov
3a524e5ba2 4.63 2016-05-28 00:15:58 +01:00
281 changed files with 3001 additions and 4996 deletions

View File

@@ -1,7 +1,7 @@
#define MY_VER_MAJOR 4 #define MY_VER_MAJOR 4
#define MY_VER_MINOR 62 #define MY_VER_MINOR 65
#define MY_VER_BUILD 0 #define MY_VER_BUILD 0
#define MY_VERSION "4.62" #define MY_VERSION "4.65"
#define MY_DATE "2008-12-02" #define MY_DATE "2009-02-03"
#define MY_COPYRIGHT ": Igor Pavlov : Public domain" #define MY_COPYRIGHT ": Igor Pavlov : Public domain"
#define MY_VERSION_COPYRIGHT_DATE MY_VERSION " " MY_COPYRIGHT " : " MY_DATE #define MY_VERSION_COPYRIGHT_DATE MY_VERSION " " MY_COPYRIGHT " : " MY_DATE

View File

@@ -1,5 +1,5 @@
/* 7zIn.c -- 7z Input functions /* 7zIn.c -- 7z Input functions
2008-11-23 : Igor Pavlov : Public domain */ 2008-12-31 : Igor Pavlov : Public domain */
#include "../../7zCrc.h" #include "../../7zCrc.h"
#include "../../CpuArch.h" #include "../../CpuArch.h"
@@ -9,6 +9,9 @@
#define RINOM(x) { if ((x) == 0) return SZ_ERROR_MEM; } #define RINOM(x) { if ((x) == 0) return SZ_ERROR_MEM; }
#define NUM_FOLDER_CODERS_MAX 32
#define NUM_CODER_STREAMS_MAX 32
void SzArEx_Init(CSzArEx *p) void SzArEx_Init(CSzArEx *p)
{ {
SzAr_Init(&p->db); SzAr_Init(&p->db);
@@ -409,13 +412,12 @@ static SRes SzReadSwitch(CSzData *sd)
static SRes SzGetNextFolderItem(CSzData *sd, CSzFolder *folder, ISzAlloc *alloc) static SRes SzGetNextFolderItem(CSzData *sd, CSzFolder *folder, ISzAlloc *alloc)
{ {
UInt32 numCoders; UInt32 numCoders, numBindPairs, numPackStreams, i;
UInt32 numBindPairs; UInt32 numInStreams = 0, numOutStreams = 0;
UInt32 numPackedStreams;
UInt32 i;
UInt32 numInStreams = 0;
UInt32 numOutStreams = 0;
RINOK(SzReadNumber32(sd, &numCoders)); RINOK(SzReadNumber32(sd, &numCoders));
if (numCoders > NUM_FOLDER_CODERS_MAX)
return SZ_ERROR_UNSUPPORTED;
folder->NumCoders = numCoders; folder->NumCoders = numCoders;
MY_ALLOC(CSzCoderInfo, folder->Coders, (size_t)numCoders, alloc); MY_ALLOC(CSzCoderInfo, folder->Coders, (size_t)numCoders, alloc);
@@ -443,6 +445,9 @@ static SRes SzGetNextFolderItem(CSzData *sd, CSzFolder *folder, ISzAlloc *alloc)
{ {
RINOK(SzReadNumber32(sd, &coder->NumInStreams)); RINOK(SzReadNumber32(sd, &coder->NumInStreams));
RINOK(SzReadNumber32(sd, &coder->NumOutStreams)); RINOK(SzReadNumber32(sd, &coder->NumOutStreams));
if (coder->NumInStreams > NUM_CODER_STREAMS_MAX ||
coder->NumOutStreams > NUM_CODER_STREAMS_MAX)
return SZ_ERROR_UNSUPPORTED;
} }
else else
{ {
@@ -475,41 +480,40 @@ static SRes SzGetNextFolderItem(CSzData *sd, CSzFolder *folder, ISzAlloc *alloc)
RINOK(SzSkeepDataSize(sd, propertiesSize)); RINOK(SzSkeepDataSize(sd, propertiesSize));
} }
} }
numInStreams += (UInt32)coder->NumInStreams; numInStreams += coder->NumInStreams;
numOutStreams += (UInt32)coder->NumOutStreams; numOutStreams += coder->NumOutStreams;
} }
numBindPairs = numOutStreams - 1; if (numOutStreams == 0)
folder->NumBindPairs = numBindPairs; return SZ_ERROR_UNSUPPORTED;
folder->NumBindPairs = numBindPairs = numOutStreams - 1;
MY_ALLOC(CBindPair, folder->BindPairs, (size_t)numBindPairs, alloc); MY_ALLOC(CBindPair, folder->BindPairs, (size_t)numBindPairs, alloc);
for (i = 0; i < numBindPairs; i++) for (i = 0; i < numBindPairs; i++)
{ {
CBindPair *bindPair = folder->BindPairs + i; CBindPair *bp = folder->BindPairs + i;
RINOK(SzReadNumber32(sd, &bindPair->InIndex)); RINOK(SzReadNumber32(sd, &bp->InIndex));
RINOK(SzReadNumber32(sd, &bindPair->OutIndex)); RINOK(SzReadNumber32(sd, &bp->OutIndex));
} }
numPackedStreams = numInStreams - (UInt32)numBindPairs; if (numInStreams < numBindPairs)
return SZ_ERROR_UNSUPPORTED;
folder->NumPackStreams = numPackedStreams; folder->NumPackStreams = numPackStreams = numInStreams - numBindPairs;
MY_ALLOC(UInt32, folder->PackStreams, (size_t)numPackedStreams, alloc); MY_ALLOC(UInt32, folder->PackStreams, (size_t)numPackStreams, alloc);
if (numPackedStreams == 1) if (numPackStreams == 1)
{ {
UInt32 j; for (i = 0; i < numInStreams ; i++)
UInt32 pi = 0; if (SzFolder_FindBindPairForInStream(folder, i) < 0)
for (j = 0; j < numInStreams; j++)
if (SzFolder_FindBindPairForInStream(folder, j) < 0)
{
folder->PackStreams[pi++] = j;
break; break;
} if (i == numInStreams)
return SZ_ERROR_UNSUPPORTED;
folder->PackStreams[0] = i;
} }
else else
for (i = 0; i < numPackedStreams; i++) for (i = 0; i < numPackStreams; i++)
{ {
RINOK(SzReadNumber32(sd, folder->PackStreams + i)); RINOK(SzReadNumber32(sd, folder->PackStreams + i));
} }

View File

@@ -1,5 +1,5 @@
/* LzmaEnc.c -- LZMA Encoder /* LzmaEnc.c -- LZMA Encoder
2008-10-04 : Igor Pavlov : Public domain */ 2009-02-02 : Igor Pavlov : Public domain */
#include <string.h> #include <string.h>
@@ -64,7 +64,13 @@ void LzmaEncProps_Normalize(CLzmaEncProps *p)
if (p->btMode < 0) p->btMode = (p->algo == 0 ? 0 : 1); if (p->btMode < 0) p->btMode = (p->algo == 0 ? 0 : 1);
if (p->numHashBytes < 0) p->numHashBytes = 4; if (p->numHashBytes < 0) p->numHashBytes = 4;
if (p->mc == 0) p->mc = (16 + (p->fb >> 1)) >> (p->btMode ? 0 : 1); if (p->mc == 0) p->mc = (16 + (p->fb >> 1)) >> (p->btMode ? 0 : 1);
if (p->numThreads < 0) p->numThreads = ((p->btMode && p->algo) ? 2 : 1); if (p->numThreads < 0)
p->numThreads =
#ifdef COMPRESS_MF_MT
((p->btMode && p->algo) ? 2 : 1);
#else
1;
#endif
} }
UInt32 LzmaEncProps_GetDictSize(const CLzmaEncProps *props2) UInt32 LzmaEncProps_GetDictSize(const CLzmaEncProps *props2)

View File

@@ -2,15 +2,12 @@
#include "StdAfx.h" #include "StdAfx.h"
#include "7zDecode.h"
#include "../../IPassword.h"
#include "../../Common/LockedStream.h"
#include "../../Common/StreamObjects.h"
#include "../../Common/ProgressUtils.h"
#include "../../Common/LimitedStreams.h" #include "../../Common/LimitedStreams.h"
#include "../../Common/CreateCoder.h" #include "../../Common/LockedStream.h"
#include "../../Common/FilterCoder.h" #include "../../Common/ProgressUtils.h"
#include "../../Common/StreamObjects.h"
#include "7zDecode.h"
namespace NArchive { namespace NArchive {
namespace N7z { namespace N7z {
@@ -105,6 +102,8 @@ HRESULT CDecoder::Decode(
#endif #endif
) )
{ {
if (!folderInfo.CheckStructure())
return E_NOTIMPL;
#ifndef _NO_CRYPTO #ifndef _NO_CRYPTO
passwordIsDefined = false; passwordIsDefined = false;
#endif #endif
@@ -229,13 +228,13 @@ HRESULT CDecoder::Decode(
decoder.QueryInterface(IID_ICompressSetDecoderProperties2, &setDecoderProperties); decoder.QueryInterface(IID_ICompressSetDecoderProperties2, &setDecoderProperties);
if (setDecoderProperties) if (setDecoderProperties)
{ {
const CByteBuffer &properties = coderInfo.Properties; const CByteBuffer &props = coderInfo.Props;
size_t size = properties.GetCapacity(); size_t size = props.GetCapacity();
if (size > 0xFFFFFFFF) if (size > 0xFFFFFFFF)
return E_NOTIMPL; return E_NOTIMPL;
if (size > 0) if (size > 0)
{ {
RINOK(setDecoderProperties->SetDecoderProperties2((const Byte *)properties, (UInt32)size)); RINOK(setDecoderProperties->SetDecoderProperties2((const Byte *)props, (UInt32)size));
} }
} }
} }

View File

@@ -233,8 +233,8 @@ HRESULT CEncoder::Encode(
outStreamSpec->Init(); outStreamSpec->Init();
writeCoderProperties->WriteCoderProperties(outStream); writeCoderProperties->WriteCoderProperties(outStream);
size_t size = outStreamSpec->GetSize(); size_t size = outStreamSpec->GetSize();
encodingInfo.Properties.SetCapacity(size); encodingInfo.Props.SetCapacity(size);
memmove(encodingInfo.Properties, outStreamSpec->GetBuffer(), size); memmove(encodingInfo.Props, outStreamSpec->GetBuffer(), size);
} }
} }
@@ -278,7 +278,7 @@ HRESULT CEncoder::Encode(
folderItem.UnpackSizes.Add(streamSize); folderItem.UnpackSizes.Add(streamSize);
} }
for (i = numMethods - 1; i >= 0; i--) for (i = numMethods - 1; i >= 0; i--)
folderItem.Coders[numMethods - 1 - i].Properties = _codersInfo[i].Properties; folderItem.Coders[numMethods - 1 - i].Props = _codersInfo[i].Props;
return S_OK; return S_OK;
} }

View File

@@ -2,25 +2,29 @@
#include "StdAfx.h" #include "StdAfx.h"
#include "7zHandler.h" extern "C"
#include "7zProperties.h" {
#include "../../../../C/CpuArch.h"
}
#include "../../../Common/IntToString.h"
#include "../../../Common/ComTry.h" #include "../../../Common/ComTry.h"
#include "../../../Windows/Defs.h" #include "../../../Common/IntToString.h"
#ifdef COMPRESS_MT
#include "../../../Windows/System.h"
#endif
#include "../Common/ItemNameUtils.h" #include "../Common/ItemNameUtils.h"
#include "7zHandler.h"
#include "7zProperties.h"
#ifdef __7Z_SET_PROPERTIES #ifdef __7Z_SET_PROPERTIES
#ifdef EXTRACT_ONLY #ifdef EXTRACT_ONLY
#include "../Common/ParseProperties.h" #include "../Common/ParseProperties.h"
#endif #endif
#endif #endif
#ifdef COMPRESS_MT
#include "../../../Windows/System.h"
#endif
using namespace NWindows; using namespace NWindows;
extern UString ConvertMethodIdToString(UInt64 id); extern UString ConvertMethodIdToString(UInt64 id);
@@ -191,13 +195,6 @@ static inline UString GetHex2(Byte value)
static const UInt64 k_AES = 0x06F10701; static const UInt64 k_AES = 0x06F10701;
#ifndef _SFX
static inline UInt32 GetUInt32FromMemLE(const Byte *p)
{
return p[0] | (((UInt32)p[1]) << 8) | (((UInt32)p[2]) << 16) | (((UInt32)p[3]) << 24);
}
#endif
bool CHandler::IsEncrypted(UInt32 index2) const bool CHandler::IsEncrypted(UInt32 index2) const
{ {
CNum folderIndex = _db.FileIndexToFolderIndexMap[index2]; CNum folderIndex = _db.FileIndexToFolderIndexMap[index2];
@@ -291,33 +288,31 @@ STDMETHODIMP CHandler::GetProperty(UInt32 index, PROPID propID, PROPVARIANT *va
methodsString += methodName; methodsString += methodName;
if (coderInfo.MethodID == k_LZMA) if (coderInfo.MethodID == k_LZMA)
{ {
if (coderInfo.Properties.GetCapacity() >= 5) if (coderInfo.Props.GetCapacity() >= 5)
{ {
methodsString += L":"; methodsString += L":";
UInt32 dicSize = GetUInt32FromMemLE( UInt32 dicSize = GetUi32((const Byte *)coderInfo.Props + 1);
((const Byte *)coderInfo.Properties + 1));
methodsString += GetStringForSizeValue(dicSize); methodsString += GetStringForSizeValue(dicSize);
} }
} }
else if (coderInfo.MethodID == k_PPMD) else if (coderInfo.MethodID == k_PPMD)
{ {
if (coderInfo.Properties.GetCapacity() >= 5) if (coderInfo.Props.GetCapacity() >= 5)
{ {
Byte order = *(const Byte *)coderInfo.Properties; Byte order = *(const Byte *)coderInfo.Props;
methodsString += L":o"; methodsString += L":o";
methodsString += ConvertUInt32ToString(order); methodsString += ConvertUInt32ToString(order);
methodsString += L":mem"; methodsString += L":mem";
UInt32 dicSize = GetUInt32FromMemLE( UInt32 dicSize = GetUi32((const Byte *)coderInfo.Props + 1);
((const Byte *)coderInfo.Properties + 1));
methodsString += GetStringForSizeValue(dicSize); methodsString += GetStringForSizeValue(dicSize);
} }
} }
else if (coderInfo.MethodID == k_AES) else if (coderInfo.MethodID == k_AES)
{ {
if (coderInfo.Properties.GetCapacity() >= 1) if (coderInfo.Props.GetCapacity() >= 1)
{ {
methodsString += L":"; methodsString += L":";
const Byte *data = (const Byte *)coderInfo.Properties; const Byte *data = (const Byte *)coderInfo.Props;
Byte firstByte = *data++; Byte firstByte = *data++;
UInt32 numCyclesPower = firstByte & 0x3F; UInt32 numCyclesPower = firstByte & 0x3F;
methodsString += ConvertUInt32ToString(numCyclesPower); methodsString += ConvertUInt32ToString(numCyclesPower);
@@ -328,7 +323,7 @@ STDMETHODIMP CHandler::GetProperty(UInt32 index, PROPID propID, PROPVARIANT *va
return S_OK; return S_OK;
UInt32 saltSize = (firstByte >> 7) & 1; UInt32 saltSize = (firstByte >> 7) & 1;
UInt32 ivSize = (firstByte >> 6) & 1; UInt32 ivSize = (firstByte >> 6) & 1;
if (coderInfo.Properties.GetCapacity() >= 2) if (coderInfo.Props.GetCapacity() >= 2)
{ {
Byte secondByte = *data++; Byte secondByte = *data++;
saltSize += (secondByte >> 4); saltSize += (secondByte >> 4);
@@ -340,18 +335,18 @@ STDMETHODIMP CHandler::GetProperty(UInt32 index, PROPID propID, PROPVARIANT *va
} }
else else
{ {
if (coderInfo.Properties.GetCapacity() > 0) if (coderInfo.Props.GetCapacity() > 0)
{ {
methodsString += L":["; methodsString += L":[";
for (size_t bi = 0; bi < coderInfo.Properties.GetCapacity(); bi++) for (size_t bi = 0; bi < coderInfo.Props.GetCapacity(); bi++)
{ {
if (bi > 5 && bi + 1 < coderInfo.Properties.GetCapacity()) if (bi > 5 && bi + 1 < coderInfo.Props.GetCapacity())
{ {
methodsString += L".."; methodsString += L"..";
break; break;
} }
else else
methodsString += GetHex2(coderInfo.Properties[bi]); methodsString += GetHex2(coderInfo.Props[bi]);
} }
methodsString += L"]"; methodsString += L"]";
} }

View File

@@ -2,20 +2,20 @@
#include "StdAfx.h" #include "StdAfx.h"
#include "7zHandler.h"
#include "7zOut.h"
#include "7zUpdate.h"
#include "../../../Windows/PropVariant.h" #include "../../../Windows/PropVariant.h"
#include "../../../Common/ComTry.h" #include "../../../Common/ComTry.h"
#include "../../../Common/StringToInt.h" #include "../../../Common/StringToInt.h"
#include "../../IPassword.h"
#include "../../ICoder.h" #include "../../ICoder.h"
#include "../Common/ItemNameUtils.h" #include "../Common/ItemNameUtils.h"
#include "../Common/ParseProperties.h" #include "../Common/ParseProperties.h"
#include "7zHandler.h"
#include "7zOut.h"
#include "7zUpdate.h"
using namespace NWindows; using namespace NWindows;
namespace NArchive { namespace NArchive {
@@ -85,28 +85,28 @@ HRESULT CHandler::SetCompressionMethod(
COneMethodInfo oneMethodInfo; COneMethodInfo oneMethodInfo;
oneMethodInfo.MethodName = kLZMAMethodName; oneMethodInfo.MethodName = kLZMAMethodName;
{ {
CProp property; CProp prop;
property.Id = NCoderPropID::kMatchFinder; prop.Id = NCoderPropID::kMatchFinder;
property.Value = kLzmaMatchFinderForHeaders; prop.Value = kLzmaMatchFinderForHeaders;
oneMethodInfo.Properties.Add(property); oneMethodInfo.Props.Add(prop);
} }
{ {
CProp property; CProp prop;
property.Id = NCoderPropID::kAlgorithm; prop.Id = NCoderPropID::kAlgorithm;
property.Value = kAlgorithmForHeaders; prop.Value = kAlgorithmForHeaders;
oneMethodInfo.Properties.Add(property); oneMethodInfo.Props.Add(prop);
} }
{ {
CProp property; CProp prop;
property.Id = NCoderPropID::kNumFastBytes; prop.Id = NCoderPropID::kNumFastBytes;
property.Value = UInt32(kNumFastBytesForHeaders); prop.Value = (UInt32)kNumFastBytesForHeaders;
oneMethodInfo.Properties.Add(property); oneMethodInfo.Props.Add(prop);
} }
{ {
CProp property; CProp prop;
property.Id = NCoderPropID::kDictionarySize; prop.Id = NCoderPropID::kDictionarySize;
property.Value = UInt32(kDictionaryForHeaders); prop.Value = (UInt32)kDictionaryForHeaders;
oneMethodInfo.Properties.Add(property); oneMethodInfo.Props.Add(prop);
} }
headerMethodInfoVector.Add(oneMethodInfo); headerMethodInfoVector.Add(oneMethodInfo);
HRESULT res = SetCompressionMethod(headerMethod, headerMethodInfoVector HRESULT res = SetCompressionMethod(headerMethod, headerMethodInfoVector
@@ -155,14 +155,14 @@ HRESULT CHandler::SetCompressionMethod(
EXTERNAL_CODECS_VARS EXTERNAL_CODECS_VARS
oneMethodInfo.MethodName, methodFull.Id, methodFull.NumInStreams, methodFull.NumOutStreams)) oneMethodInfo.MethodName, methodFull.Id, methodFull.NumInStreams, methodFull.NumOutStreams))
return E_INVALIDARG; return E_INVALIDARG;
methodFull.Properties = oneMethodInfo.Properties; methodFull.Props = oneMethodInfo.Props;
methodMode.Methods.Add(methodFull); methodMode.Methods.Add(methodFull);
if (!_numSolidBytesDefined) if (!_numSolidBytesDefined)
{ {
for (int j = 0; j < methodFull.Properties.Size(); j++) for (int j = 0; j < methodFull.Props.Size(); j++)
{ {
const CProp &prop = methodFull.Properties[j]; const CProp &prop = methodFull.Props[j];
if ((prop.Id == NCoderPropID::kDictionarySize || if ((prop.Id == NCoderPropID::kDictionarySize ||
prop.Id == NCoderPropID::kUsedMemorySize) && prop.Value.vt == VT_UI4) prop.Id == NCoderPropID::kUsedMemorySize) && prop.Value.vt == VT_UI4)
{ {

View File

@@ -2,16 +2,18 @@
#include "StdAfx.h" #include "StdAfx.h"
#include "7zIn.h"
#include "7zDecode.h"
#include "../../Common/StreamObjects.h"
#include "../../Common/StreamUtils.h"
extern "C" extern "C"
{ {
#include "../../../../C/7zCrc.h" #include "../../../../C/7zCrc.h"
#include "../../../../C/CpuArch.h" #include "../../../../C/CpuArch.h"
} }
#include "../../Common/StreamObjects.h"
#include "../../Common/StreamUtils.h"
#include "7zDecode.h"
#include "7zIn.h"
#define Get16(p) GetUi16(p) #define Get16(p) GetUi16(p)
#define Get32(p) GetUi32(p) #define Get32(p) GetUi32(p)
#define Get64(p) GetUi64(p) #define Get64(p) GetUi64(p)
@@ -24,6 +26,86 @@ extern "C"
namespace NArchive { namespace NArchive {
namespace N7z { namespace N7z {
static void BoolVector_Fill_False(CBoolVector &v, int size)
{
v.Clear();
v.Reserve(size);
for (int i = 0; i < size; i++)
v.Add(false);
}
static bool BoolVector_GetAndSet(CBoolVector &v, UInt32 index)
{
if (index >= (UInt32)v.Size())
return true;
bool res = v[index];
v[index] = true;
return res;
}
bool CFolder::CheckStructure() const
{
const int kNumCodersMax = sizeof(UInt32) * 8; // don't change it
const int kMaskSize = sizeof(UInt32) * 8; // it must be >= kNumCodersMax
const int kNumBindsMax = 32;
if (Coders.Size() > kNumCodersMax || BindPairs.Size() > kNumBindsMax)
return false;
{
CBoolVector v;
BoolVector_Fill_False(v, BindPairs.Size() + PackStreams.Size());
int i;
for (i = 0; i < BindPairs.Size(); i++)
if (BoolVector_GetAndSet(v, BindPairs[i].InIndex))
return false;
for (i = 0; i < PackStreams.Size(); i++)
if (BoolVector_GetAndSet(v, PackStreams[i]))
return false;
BoolVector_Fill_False(v, UnpackSizes.Size());
for (i = 0; i < BindPairs.Size(); i++)
if (BoolVector_GetAndSet(v, BindPairs[i].OutIndex))
return false;
}
UInt32 mask[kMaskSize];
int i;
for (i = 0; i < kMaskSize; i++)
mask[i] = 0;
{
CIntVector inStreamToCoder, outStreamToCoder;
for (i = 0; i < Coders.Size(); i++)
{
CNum j;
const CCoderInfo &coder = Coders[i];
for (j = 0; j < coder.NumInStreams; j++)
inStreamToCoder.Add(i);
for (j = 0; j < coder.NumOutStreams; j++)
outStreamToCoder.Add(i);
}
for (i = 0; i < BindPairs.Size(); i++)
{
const CBindPair &bp = BindPairs[i];
mask[inStreamToCoder[bp.InIndex]] |= (1 << outStreamToCoder[bp.OutIndex]);
}
}
for (i = 0; i < kMaskSize; i++)
for (int j = 0; j < kMaskSize; j++)
if (((1 << j) & mask[i]) != 0)
mask[i] |= mask[j];
for (i = 0; i < kMaskSize; i++)
if (((1 << i) & mask[i]) != 0)
return false;
return true;
}
class CInArchiveException {}; class CInArchiveException {};
static void ThrowException() { throw CInArchiveException(); } static void ThrowException() { throw CInArchiveException(); }
@@ -323,9 +405,9 @@ void CInArchive::GetNextFolderItem(CFolder &folder)
} }
if ((mainByte & 0x20) != 0) if ((mainByte & 0x20) != 0)
{ {
CNum propertiesSize = ReadNum(); CNum propsSize = ReadNum();
coder.Properties.SetCapacity((size_t)propertiesSize); coder.Props.SetCapacity((size_t)propsSize);
ReadBytes((Byte *)coder.Properties, (size_t)propertiesSize); ReadBytes((Byte *)coder.Props, (size_t)propsSize);
} }
if ((mainByte & 0x80) != 0) if ((mainByte & 0x80) != 0)
ThrowUnsupported(); ThrowUnsupported();
@@ -334,31 +416,34 @@ void CInArchive::GetNextFolderItem(CFolder &folder)
numOutStreams += coder.NumOutStreams; numOutStreams += coder.NumOutStreams;
} }
CNum numBindPairs; CNum numBindPairs = numOutStreams - 1;
numBindPairs = numOutStreams - 1;
folder.BindPairs.Clear(); folder.BindPairs.Clear();
folder.BindPairs.Reserve(numBindPairs); folder.BindPairs.Reserve(numBindPairs);
for (i = 0; i < numBindPairs; i++) for (i = 0; i < numBindPairs; i++)
{ {
CBindPair bindPair; CBindPair bp;
bindPair.InIndex = ReadNum(); bp.InIndex = ReadNum();
bindPair.OutIndex = ReadNum(); bp.OutIndex = ReadNum();
folder.BindPairs.Add(bindPair); folder.BindPairs.Add(bp);
} }
CNum numPackedStreams = numInStreams - numBindPairs; if (numInStreams < numBindPairs)
folder.PackStreams.Reserve(numPackedStreams); ThrowUnsupported();
if (numPackedStreams == 1) CNum numPackStreams = numInStreams - numBindPairs;
folder.PackStreams.Reserve(numPackStreams);
if (numPackStreams == 1)
{ {
for (CNum j = 0; j < numInStreams; j++) for (i = 0; i < numInStreams; i++)
if (folder.FindBindPairForInStream(j) < 0) if (folder.FindBindPairForInStream(i) < 0)
{ {
folder.PackStreams.Add(j); folder.PackStreams.Add(i);
break; break;
} }
if (folder.PackStreams.Size() != 1)
ThrowUnsupported();
} }
else else
for (i = 0; i < numPackedStreams; i++) for (i = 0; i < numPackStreams; i++)
folder.PackStreams.Add(ReadNum()); folder.PackStreams.Add(ReadNum());
} }
@@ -376,7 +461,7 @@ void CInArchive::WaitAttribute(UInt64 attribute)
} }
void CInArchive::ReadHashDigests(int numItems, void CInArchive::ReadHashDigests(int numItems,
CRecordVector<bool> &digestsDefined, CBoolVector &digestsDefined,
CRecordVector<UInt32> &digests) CRecordVector<UInt32> &digests)
{ {
ReadBoolVector2(numItems, digestsDefined); ReadBoolVector2(numItems, digestsDefined);
@@ -394,7 +479,7 @@ void CInArchive::ReadHashDigests(int numItems,
void CInArchive::ReadPackInfo( void CInArchive::ReadPackInfo(
UInt64 &dataOffset, UInt64 &dataOffset,
CRecordVector<UInt64> &packSizes, CRecordVector<UInt64> &packSizes,
CRecordVector<bool> &packCRCsDefined, CBoolVector &packCRCsDefined,
CRecordVector<UInt32> &packCRCs) CRecordVector<UInt32> &packCRCs)
{ {
dataOffset = ReadNumber(); dataOffset = ReadNumber();
@@ -421,15 +506,11 @@ void CInArchive::ReadPackInfo(
} }
if (packCRCsDefined.IsEmpty()) if (packCRCsDefined.IsEmpty())
{ {
packCRCsDefined.Reserve(numPackStreams); BoolVector_Fill_False(packCRCsDefined, numPackStreams);
packCRCsDefined.Clear();
packCRCs.Reserve(numPackStreams); packCRCs.Reserve(numPackStreams);
packCRCs.Clear(); packCRCs.Clear();
for (CNum i = 0; i < numPackStreams; i++) for (CNum i = 0; i < numPackStreams; i++)
{
packCRCsDefined.Add(false);
packCRCs.Add(0); packCRCs.Add(0);
}
} }
} }
@@ -471,7 +552,7 @@ void CInArchive::ReadUnpackInfo(
return; return;
if (type == NID::kCRC) if (type == NID::kCRC)
{ {
CRecordVector<bool> crcsDefined; CBoolVector crcsDefined;
CRecordVector<UInt32> crcs; CRecordVector<UInt32> crcs;
ReadHashDigests(numFolders, crcsDefined, crcs); ReadHashDigests(numFolders, crcsDefined, crcs);
for (i = 0; i < numFolders; i++) for (i = 0; i < numFolders; i++)
@@ -490,7 +571,7 @@ void CInArchive::ReadSubStreamsInfo(
const CObjectVector<CFolder> &folders, const CObjectVector<CFolder> &folders,
CRecordVector<CNum> &numUnpackStreamsInFolders, CRecordVector<CNum> &numUnpackStreamsInFolders,
CRecordVector<UInt64> &unpackSizes, CRecordVector<UInt64> &unpackSizes,
CRecordVector<bool> &digestsDefined, CBoolVector &digestsDefined,
CRecordVector<UInt32> &digests) CRecordVector<UInt32> &digests)
{ {
numUnpackStreamsInFolders.Clear(); numUnpackStreamsInFolders.Clear();
@@ -551,7 +632,7 @@ void CInArchive::ReadSubStreamsInfo(
{ {
if (type == NID::kCRC) if (type == NID::kCRC)
{ {
CRecordVector<bool> digestsDefined2; CBoolVector digestsDefined2;
CRecordVector<UInt32> digests2; CRecordVector<UInt32> digests2;
ReadHashDigests(numDigests, digestsDefined2, digests2); ReadHashDigests(numDigests, digestsDefined2, digests2);
int digestIndex = 0; int digestIndex = 0;
@@ -576,13 +657,10 @@ void CInArchive::ReadSubStreamsInfo(
{ {
if (digestsDefined.IsEmpty()) if (digestsDefined.IsEmpty())
{ {
digestsDefined.Clear(); BoolVector_Fill_False(digestsDefined, numDigestsTotal);
digests.Clear(); digests.Clear();
for (int i = 0; i < numDigestsTotal; i++) for (int i = 0; i < numDigestsTotal; i++)
{
digestsDefined.Add(false);
digests.Add(0); digests.Add(0);
}
} }
return; return;
} }
@@ -596,12 +674,12 @@ void CInArchive::ReadStreamsInfo(
const CObjectVector<CByteBuffer> *dataVector, const CObjectVector<CByteBuffer> *dataVector,
UInt64 &dataOffset, UInt64 &dataOffset,
CRecordVector<UInt64> &packSizes, CRecordVector<UInt64> &packSizes,
CRecordVector<bool> &packCRCsDefined, CBoolVector &packCRCsDefined,
CRecordVector<UInt32> &packCRCs, CRecordVector<UInt32> &packCRCs,
CObjectVector<CFolder> &folders, CObjectVector<CFolder> &folders,
CRecordVector<CNum> &numUnpackStreamsInFolders, CRecordVector<CNum> &numUnpackStreamsInFolders,
CRecordVector<UInt64> &unpackSizes, CRecordVector<UInt64> &unpackSizes,
CRecordVector<bool> &digestsDefined, CBoolVector &digestsDefined,
CRecordVector<UInt32> &digests) CRecordVector<UInt32> &digests)
{ {
for (;;) for (;;)
@@ -695,13 +773,13 @@ HRESULT CInArchive::ReadAndDecodePackedStreams(
) )
{ {
CRecordVector<UInt64> packSizes; CRecordVector<UInt64> packSizes;
CRecordVector<bool> packCRCsDefined; CBoolVector packCRCsDefined;
CRecordVector<UInt32> packCRCs; CRecordVector<UInt32> packCRCs;
CObjectVector<CFolder> folders; CObjectVector<CFolder> folders;
CRecordVector<CNum> numUnpackStreamsInFolders; CRecordVector<CNum> numUnpackStreamsInFolders;
CRecordVector<UInt64> unpackSizes; CRecordVector<UInt64> unpackSizes;
CRecordVector<bool> digestsDefined; CBoolVector digestsDefined;
CRecordVector<UInt32> digests; CRecordVector<UInt32> digests;
ReadStreamsInfo(NULL, ReadStreamsInfo(NULL,
@@ -802,7 +880,7 @@ HRESULT CInArchive::ReadHeader(
} }
CRecordVector<UInt64> unpackSizes; CRecordVector<UInt64> unpackSizes;
CRecordVector<bool> digestsDefined; CBoolVector digestsDefined;
CRecordVector<UInt32> digests; CRecordVector<UInt32> digests;
if (type == NID::kMainStreamsInfo) if (type == NID::kMainStreamsInfo)
@@ -852,9 +930,7 @@ HRESULT CInArchive::ReadHeader(
db.ArchiveInfo.FileInfoPopIDs.Add(NID::kCRC); db.ArchiveInfo.FileInfoPopIDs.Add(NID::kCRC);
CBoolVector emptyStreamVector; CBoolVector emptyStreamVector;
emptyStreamVector.Reserve((int)numFiles); BoolVector_Fill_False(emptyStreamVector, (int)numFiles);
for (i = 0; i < numFiles; i++)
emptyStreamVector.Add(false);
CBoolVector emptyFileVector; CBoolVector emptyFileVector;
CBoolVector antiFileVector; CBoolVector antiFileVector;
CNum numEmptyStreams = 0; CNum numEmptyStreams = 0;
@@ -901,13 +977,10 @@ HRESULT CInArchive::ReadHeader(
for (i = 0; i < (CNum)emptyStreamVector.Size(); i++) for (i = 0; i < (CNum)emptyStreamVector.Size(); i++)
if (emptyStreamVector[i]) if (emptyStreamVector[i])
numEmptyStreams++; numEmptyStreams++;
emptyFileVector.Reserve(numEmptyStreams);
antiFileVector.Reserve(numEmptyStreams); BoolVector_Fill_False(emptyFileVector, numEmptyStreams);
for (i = 0; i < numEmptyStreams; i++) BoolVector_Fill_False(antiFileVector, numEmptyStreams);
{
emptyFileVector.Add(false);
antiFileVector.Add(false);
}
break; break;
} }
case NID::kEmptyFile: ReadBoolVector(numEmptyStreams, emptyFileVector); break; case NID::kEmptyFile: ReadBoolVector(numEmptyStreams, emptyFileVector); break;

View File

@@ -4,8 +4,10 @@
#define __7Z_IN_H #define __7Z_IN_H
#include "../../../Common/MyCom.h" #include "../../../Common/MyCom.h"
#include "../../IStream.h"
#include "../../IPassword.h" #include "../../IPassword.h"
#include "../../IStream.h"
#include "../../Common/CreateCoder.h" #include "../../Common/CreateCoder.h"
#include "../../Common/InBuffer.h" #include "../../Common/InBuffer.h"
@@ -167,12 +169,12 @@ private:
void ReadArchiveProperties(CInArchiveInfo &archiveInfo); void ReadArchiveProperties(CInArchiveInfo &archiveInfo);
void GetNextFolderItem(CFolder &itemInfo); void GetNextFolderItem(CFolder &itemInfo);
void ReadHashDigests(int numItems, void ReadHashDigests(int numItems,
CRecordVector<bool> &digestsDefined, CRecordVector<UInt32> &digests); CBoolVector &digestsDefined, CRecordVector<UInt32> &digests);
void ReadPackInfo( void ReadPackInfo(
UInt64 &dataOffset, UInt64 &dataOffset,
CRecordVector<UInt64> &packSizes, CRecordVector<UInt64> &packSizes,
CRecordVector<bool> &packCRCsDefined, CBoolVector &packCRCsDefined,
CRecordVector<UInt32> &packCRCs); CRecordVector<UInt32> &packCRCs);
void ReadUnpackInfo( void ReadUnpackInfo(
@@ -183,19 +185,19 @@ private:
const CObjectVector<CFolder> &folders, const CObjectVector<CFolder> &folders,
CRecordVector<CNum> &numUnpackStreamsInFolders, CRecordVector<CNum> &numUnpackStreamsInFolders,
CRecordVector<UInt64> &unpackSizes, CRecordVector<UInt64> &unpackSizes,
CRecordVector<bool> &digestsDefined, CBoolVector &digestsDefined,
CRecordVector<UInt32> &digests); CRecordVector<UInt32> &digests);
void ReadStreamsInfo( void ReadStreamsInfo(
const CObjectVector<CByteBuffer> *dataVector, const CObjectVector<CByteBuffer> *dataVector,
UInt64 &dataOffset, UInt64 &dataOffset,
CRecordVector<UInt64> &packSizes, CRecordVector<UInt64> &packSizes,
CRecordVector<bool> &packCRCsDefined, CBoolVector &packCRCsDefined,
CRecordVector<UInt32> &packCRCs, CRecordVector<UInt32> &packCRCs,
CObjectVector<CFolder> &folders, CObjectVector<CFolder> &folders,
CRecordVector<CNum> &numUnpackStreamsInFolders, CRecordVector<CNum> &numUnpackStreamsInFolders,
CRecordVector<UInt64> &unpackSizes, CRecordVector<UInt64> &unpackSizes,
CRecordVector<bool> &digestsDefined, CBoolVector &digestsDefined,
CRecordVector<UInt32> &digests); CRecordVector<UInt32> &digests);

View File

@@ -5,7 +5,9 @@
#include "../../../Common/Buffer.h" #include "../../../Common/Buffer.h"
#include "../../../Common/MyString.h" #include "../../../Common/MyString.h"
#include "../../Common/MethodId.h" #include "../../Common/MethodId.h"
#include "7zHeader.h" #include "7zHeader.h"
namespace NArchive { namespace NArchive {
@@ -18,7 +20,7 @@ const CNum kNumNoIndex = 0xFFFFFFFF;
struct CCoderInfo struct CCoderInfo
{ {
CMethodId MethodID; CMethodId MethodID;
CByteBuffer Properties; CByteBuffer Props;
CNum NumInStreams; CNum NumInStreams;
CNum NumOutStreams; CNum NumOutStreams;
bool IsSimpleCoder() const { return (NumInStreams == 1) && (NumOutStreams == 1); } bool IsSimpleCoder() const { return (NumInStreams == 1) && (NumOutStreams == 1); }
@@ -80,6 +82,8 @@ struct CFolder
return i; return i;
return -1; return -1;
} }
bool CheckStructure() const;
}; };
struct CUInt64DefVector struct CUInt64DefVector

View File

@@ -278,7 +278,7 @@ void COutArchive::WriteFolder(const CFolder &folder)
{ {
const CCoderInfo &coder = folder.Coders[i]; const CCoderInfo &coder = folder.Coders[i];
{ {
size_t propertiesSize = coder.Properties.GetCapacity(); size_t propsSize = coder.Props.GetCapacity();
UInt64 id = coder.MethodID; UInt64 id = coder.MethodID;
int idSize; int idSize;
@@ -292,7 +292,7 @@ void COutArchive::WriteFolder(const CFolder &folder)
b = (Byte)(idSize & 0xF); b = (Byte)(idSize & 0xF);
bool isComplex = !coder.IsSimpleCoder(); bool isComplex = !coder.IsSimpleCoder();
b |= (isComplex ? 0x10 : 0); b |= (isComplex ? 0x10 : 0);
b |= ((propertiesSize != 0) ? 0x20 : 0 ); b |= ((propsSize != 0) ? 0x20 : 0 );
WriteByte(b); WriteByte(b);
WriteBytes(longID, idSize); WriteBytes(longID, idSize);
if (isComplex) if (isComplex)
@@ -300,10 +300,10 @@ void COutArchive::WriteFolder(const CFolder &folder)
WriteNumber(coder.NumInStreams); WriteNumber(coder.NumInStreams);
WriteNumber(coder.NumOutStreams); WriteNumber(coder.NumOutStreams);
} }
if (propertiesSize == 0) if (propsSize == 0)
continue; continue;
WriteNumber(propertiesSize); WriteNumber(propsSize);
WriteBytes(coder.Properties, propertiesSize); WriteBytes(coder.Props, propsSize);
} }
} }
for (i = 0; i < folder.BindPairs.Size(); i++) for (i = 0; i < folder.BindPairs.Size(); i++)

View File

@@ -1,18 +1,19 @@
// UpdateMain.cpp // 7zUpdate.cpp
#include "StdAfx.h" #include "StdAfx.h"
#include "7zUpdate.h" #include "../../Common/LimitedStreams.h"
#include "7zFolderInStream.h" #include "../../Common/ProgressUtils.h"
#include "../../Compress/CopyCoder.h"
#include "../Common/ItemNameUtils.h"
#include "7zEncode.h" #include "7zEncode.h"
#include "7zFolderInStream.h"
#include "7zHandler.h" #include "7zHandler.h"
#include "7zOut.h" #include "7zOut.h"
#include "7zUpdate.h"
#include "../../Compress/Copy/CopyCoder.h"
#include "../../Common/ProgressUtils.h"
#include "../../Common/LimitedStreams.h"
#include "../../Common/LimitedStreams.h"
#include "../Common/ItemNameUtils.h"
namespace NArchive { namespace NArchive {
namespace N7z { namespace N7z {
@@ -78,7 +79,7 @@ static int CompareCoders(const CCoderInfo &c1, const CCoderInfo &c2)
RINOZ(MyCompare(c1.NumInStreams, c2.NumInStreams)); RINOZ(MyCompare(c1.NumInStreams, c2.NumInStreams));
RINOZ(MyCompare(c1.NumOutStreams, c2.NumOutStreams)); RINOZ(MyCompare(c1.NumOutStreams, c2.NumOutStreams));
RINOZ(MyCompare(c1.MethodID, c2.MethodID)); RINOZ(MyCompare(c1.MethodID, c2.MethodID));
return CompareBuffers(c1.Properties, c2.Properties); return CompareBuffers(c1.Props, c2.Props);
} }
static int CompareBindPairs(const CBindPair &b1, const CBindPair &b2) static int CompareBindPairs(const CBindPair &b1, const CBindPair &b2)
@@ -336,28 +337,28 @@ static bool MakeExeMethod(const CCompressionMethodMode &method,
if (!GetMethodFull(k_LZMA, 1, methodFull)) if (!GetMethodFull(k_LZMA, 1, methodFull))
return false; return false;
{ {
CProp property; CProp prop;
property.Id = NCoderPropID::kAlgorithm; prop.Id = NCoderPropID::kAlgorithm;
property.Value = kAlgorithmForBCJ2_LZMA; prop.Value = kAlgorithmForBCJ2_LZMA;
methodFull.Properties.Add(property); methodFull.Props.Add(prop);
} }
{ {
CProp property; CProp prop;
property.Id = NCoderPropID::kMatchFinder; prop.Id = NCoderPropID::kMatchFinder;
property.Value = kMatchFinderForBCJ2_LZMA; prop.Value = kMatchFinderForBCJ2_LZMA;
methodFull.Properties.Add(property); methodFull.Props.Add(prop);
} }
{ {
CProp property; CProp prop;
property.Id = NCoderPropID::kDictionarySize; prop.Id = NCoderPropID::kDictionarySize;
property.Value = kDictionaryForBCJ2_LZMA; prop.Value = kDictionaryForBCJ2_LZMA;
methodFull.Properties.Add(property); methodFull.Props.Add(prop);
} }
{ {
CProp property; CProp prop;
property.Id = NCoderPropID::kNumFastBytes; prop.Id = NCoderPropID::kNumFastBytes;
property.Value = kNumFastBytesForBCJ2_LZMA; prop.Value = kNumFastBytesForBCJ2_LZMA;
methodFull.Properties.Add(property); methodFull.Props.Add(prop);
} }
exeMethod.Methods.Add(methodFull); exeMethod.Methods.Add(methodFull);

View File

@@ -16,11 +16,9 @@
#include "../Common/StreamObjects.h" #include "../Common/StreamObjects.h"
#include "../Common/StreamUtils.h" #include "../Common/StreamUtils.h"
#include "../Compress/Arj/ArjDecoder1.h" #include "../Compress/ArjDecoder1.h"
#include "../Compress/Arj/ArjDecoder2.h" #include "../Compress/ArjDecoder2.h"
#include "../Compress/Copy/CopyCoder.h" #include "../Compress/CopyCoder.h"
#include "IArchive.h"
#include "Common/ItemNameUtils.h" #include "Common/ItemNameUtils.h"
#include "Common/OutStreamWithCRC.h" #include "Common/OutStreamWithCRC.h"
@@ -427,7 +425,7 @@ HRESULT CInArchive::GetNextItem(bool &filled, CItem &item)
/* /*
UInt32 extraData; UInt32 extraData;
if ((header.Flags & NFileHeader::NFlags::kExtFile) != 0) if ((header.Flags & NFileHeader::NFlags::kExtFile) != 0)
extraData = GetUInt32FromMemLE(_block + pos); extraData = GetUi32(_block + pos);
*/ */
RINOK(SkeepExtendedHeaders()); RINOK(SkeepExtendedHeaders());

View File

@@ -3,13 +3,13 @@
#include "StdAfx.h" #include "StdAfx.h"
#include "Common/ComTry.h" #include "Common/ComTry.h"
#include "Common/Defs.h"
#include "Windows/PropVariant.h"
#include "Windows/Defs.h"
#include "Windows/PropVariant.h"
#include "../../Common/CreateCoder.h"
#include "../../Common/ProgressUtils.h" #include "../../Common/ProgressUtils.h"
#include "../../Common/StreamUtils.h" #include "../../Common/StreamUtils.h"
#include "../../Common/CreateCoder.h"
#include "../Common/DummyOutStream.h" #include "../Common/DummyOutStream.h"
#include "BZip2Handler.h" #include "BZip2Handler.h"

View File

@@ -9,7 +9,7 @@
#include "Windows/PropVariant.h" #include "Windows/PropVariant.h"
#include "../../Compress/Copy/CopyCoder.h" #include "../../Compress/CopyCoder.h"
#include "../Common/ParseProperties.h" #include "../Common/ParseProperties.h"

View File

@@ -2,27 +2,27 @@
#include "StdAfx.h" #include "StdAfx.h"
#include "Common/StringConvert.h"
#include "Common/Defs.h"
#include "Common/UTFConvert.h"
#include "Common/ComTry.h" #include "Common/ComTry.h"
#include "Common/Defs.h"
#include "Common/IntToString.h" #include "Common/IntToString.h"
#include "Common/StringConvert.h"
#include "Common/UTFConvert.h"
#include "Windows/PropVariant.h" #include "Windows/PropVariant.h"
#include "Windows/Time.h" #include "Windows/Time.h"
#include "CabHandler.h"
#include "CabBlockInStream.h"
#include "../../Common/ProgressUtils.h" #include "../../Common/ProgressUtils.h"
#include "../../Compress/Copy/CopyCoder.h" #include "../../Compress/CopyCoder.h"
#include "../../Compress/Deflate/DeflateDecoder.h" #include "../../Compress/DeflateDecoder.h"
#include "../../Compress/Lzx/LzxDecoder.h" #include "../../Compress/LzxDecoder.h"
#include "../../Compress/Quantum/QuantumDecoder.h" #include "../../Compress/QuantumDecoder.h"
#include "../Common/ItemNameUtils.h" #include "../Common/ItemNameUtils.h"
#include "CabBlockInStream.h"
#include "CabHandler.h"
using namespace NWindows; using namespace NWindows;
namespace NArchive { namespace NArchive {

View File

@@ -1,27 +1,26 @@
// Chm/Handler.cpp // ChmHandler.cpp
#include "StdAfx.h" #include "StdAfx.h"
#include "Common/StringConvert.h"
#include "Common/Defs.h"
#include "Common/UTFConvert.h"
#include "Common/ComTry.h" #include "Common/ComTry.h"
#include "Common/Defs.h"
#include "Common/StringConvert.h"
#include "Common/UTFConvert.h"
#include "Windows/PropVariant.h" #include "Windows/PropVariant.h"
#include "Windows/Time.h" #include "Windows/Time.h"
#include "../../Common/LimitedStreams.h" #include "../../Common/LimitedStreams.h"
#include "../../Common/StreamUtils.h"
#include "../../Common/ProgressUtils.h" #include "../../Common/ProgressUtils.h"
#include "../../Common/StreamUtils.h"
#include "../../Compress/Copy/CopyCoder.h" #include "../../Compress/CopyCoder.h"
#include "../../Compress/Lzx/LzxDecoder.h" #include "../../Compress/LzxDecoder.h"
#include "../Common/ItemNameUtils.h" #include "../Common/ItemNameUtils.h"
#include "ChmHandler.h" #include "ChmHandler.h"
using namespace NWindows; using namespace NWindows;
using namespace NTime; using namespace NTime;

View File

@@ -1,17 +1,21 @@
// HandlerOutCommon.cpp // HandlerOut.cpp
#include "StdAfx.h" #include "StdAfx.h"
#include "HandlerOut.h"
#include "../../../Windows/PropVariant.h"
#include "../../../Common/StringToInt.h" #include "../../../Common/StringToInt.h"
#include "../../ICoder.h"
#include "../Common/ParseProperties.h" #include "../../../Windows/PropVariant.h"
#ifdef COMPRESS_MT #ifdef COMPRESS_MT
#include "../../../Windows/System.h" #include "../../../Windows/System.h"
#endif #endif
#include "../../ICoder.h"
#include "../Common/ParseProperties.h"
#include "HandlerOut.h"
using namespace NWindows; using namespace NWindows;
namespace NArchive { namespace NArchive {
@@ -161,13 +165,13 @@ static int FindPropIdFromStringName(const UString &name)
static void SetOneMethodProp(COneMethodInfo &oneMethodInfo, PROPID propID, static void SetOneMethodProp(COneMethodInfo &oneMethodInfo, PROPID propID,
const NWindows::NCOM::CPropVariant &value) const NWindows::NCOM::CPropVariant &value)
{ {
for (int j = 0; j < oneMethodInfo.Properties.Size(); j++) for (int j = 0; j < oneMethodInfo.Props.Size(); j++)
if (oneMethodInfo.Properties[j].Id == propID) if (oneMethodInfo.Props[j].Id == propID)
return; return;
CProp property; CProp prop;
property.Id = propID; prop.Id = propID;
property.Value = value; prop.Value = value;
oneMethodInfo.Properties.Add(property); oneMethodInfo.Props.Add(prop);
} }
void COutHandler::SetCompressionMethod2(COneMethodInfo &oneMethodInfo void COutHandler::SetCompressionMethod2(COneMethodInfo &oneMethodInfo
@@ -311,19 +315,16 @@ static void SplitParam(const UString &param, UString &name, UString &value)
HRESULT COutHandler::SetParam(COneMethodInfo &oneMethodInfo, const UString &name, const UString &value) HRESULT COutHandler::SetParam(COneMethodInfo &oneMethodInfo, const UString &name, const UString &value)
{ {
CProp property; CProp prop;
if ( if (name.CompareNoCase(L"D") == 0 ||
name.CompareNoCase(L"D") == 0 || name.CompareNoCase(L"MEM") == 0)
name.CompareNoCase(L"MEM") == 0)
{ {
UInt32 dicSize; UInt32 dicSize;
RINOK(ParsePropDictionaryValue(value, dicSize)); RINOK(ParsePropDictionaryValue(value, dicSize));
if (name.CompareNoCase(L"D") == 0) prop.Id = (name.CompareNoCase(L"D") == 0) ?
property.Id = NCoderPropID::kDictionarySize; NCoderPropID::kDictionarySize :
else NCoderPropID::kUsedMemorySize;
property.Id = NCoderPropID::kUsedMemorySize; prop.Value = dicSize;
property.Value = dicSize;
oneMethodInfo.Properties.Add(property);
} }
else else
{ {
@@ -332,7 +333,7 @@ HRESULT COutHandler::SetParam(COneMethodInfo &oneMethodInfo, const UString &name
return E_INVALIDARG; return E_INVALIDARG;
const CNameToPropID &nameToPropID = g_NameToPropID[index]; const CNameToPropID &nameToPropID = g_NameToPropID[index];
property.Id = nameToPropID.PropID; prop.Id = nameToPropID.PropID;
NCOM::CPropVariant propValue; NCOM::CPropVariant propValue;
@@ -354,11 +355,10 @@ HRESULT COutHandler::SetParam(COneMethodInfo &oneMethodInfo, const UString &name
propValue = value; propValue = value;
} }
if (!ConvertProperty(propValue, nameToPropID.VarType, property.Value)) if (!ConvertProperty(propValue, nameToPropID.VarType, prop.Value))
return E_INVALIDARG; return E_INVALIDARG;
oneMethodInfo.Properties.Add(property);
} }
oneMethodInfo.Props.Add(prop);
return S_OK; return S_OK;
} }
@@ -576,32 +576,29 @@ HRESULT COutHandler::SetProperty(const wchar_t *nameSpec, const PROPVARIANT &val
} }
else else
{ {
CProp property; CProp prop;
if (realName.Left(1).CompareNoCase(L"D") == 0) if (realName.Left(1).CompareNoCase(L"D") == 0)
{ {
UInt32 dicSize; UInt32 dicSize;
RINOK(ParsePropDictionaryValue(realName.Mid(1), value, dicSize)); RINOK(ParsePropDictionaryValue(realName.Mid(1), value, dicSize));
property.Id = NCoderPropID::kDictionarySize; prop.Id = NCoderPropID::kDictionarySize;
property.Value = dicSize; prop.Value = dicSize;
oneMethodInfo.Properties.Add(property);
if (number <= mainDicMethodIndex) if (number <= mainDicMethodIndex)
mainDicSize = dicSize; mainDicSize = dicSize;
} }
else if (realName.Left(1).CompareNoCase(L"B") == 0) else if (realName.Left(1).CompareNoCase(L"C") == 0)
{ {
UInt32 blockSize; UInt32 blockSize;
RINOK(ParsePropDictionaryValue(realName.Mid(1), value, blockSize)); RINOK(ParsePropDictionaryValue(realName.Mid(1), value, blockSize));
property.Id = NCoderPropID::kBlockSize; prop.Id = NCoderPropID::kBlockSize;
property.Value = blockSize; prop.Value = blockSize;
oneMethodInfo.Properties.Add(property);
} }
else if (realName.Left(3).CompareNoCase(L"MEM") == 0) else if (realName.Left(3).CompareNoCase(L"MEM") == 0)
{ {
UInt32 dicSize; UInt32 dicSize;
RINOK(ParsePropDictionaryValue(realName.Mid(3), value, dicSize)); RINOK(ParsePropDictionaryValue(realName.Mid(3), value, dicSize));
property.Id = NCoderPropID::kUsedMemorySize; prop.Id = NCoderPropID::kUsedMemorySize;
property.Value = dicSize; prop.Value = dicSize;
oneMethodInfo.Properties.Add(property);
if (number <= mainDicMethodIndex) if (number <= mainDicMethodIndex)
mainDicSize = dicSize; mainDicSize = dicSize;
} }
@@ -610,15 +607,12 @@ HRESULT COutHandler::SetProperty(const wchar_t *nameSpec, const PROPVARIANT &val
int index = FindPropIdFromStringName(realName); int index = FindPropIdFromStringName(realName);
if (index < 0) if (index < 0)
return E_INVALIDARG; return E_INVALIDARG;
const CNameToPropID &nameToPropID = g_NameToPropID[index]; const CNameToPropID &nameToPropID = g_NameToPropID[index];
property.Id = nameToPropID.PropID; prop.Id = nameToPropID.PropID;
if (!ConvertProperty(value, nameToPropID.VarType, prop.Value))
if (!ConvertProperty(value, nameToPropID.VarType, property.Value))
return E_INVALIDARG; return E_INVALIDARG;
oneMethodInfo.Properties.Add(property);
} }
oneMethodInfo.Props.Add(prop);
} }
return S_OK; return S_OK;
} }

View File

@@ -3,14 +3,14 @@
#ifndef __HANDLER_OUT_H #ifndef __HANDLER_OUT_H
#define __HANDLER_OUT_H #define __HANDLER_OUT_H
#include "../../Common/MethodProps.h"
#include "../../../Common/MyString.h" #include "../../../Common/MyString.h"
#include "../../Common/MethodProps.h"
namespace NArchive { namespace NArchive {
struct COneMethodInfo struct COneMethodInfo
{ {
CObjectVector<CProp> Properties; CObjectVector<CProp> Props;
UString MethodName; UString MethodName;
}; };

View File

@@ -1,7 +1,7 @@
// OutStreamWithCRC.h // OutStreamWithCRC.h
#ifndef __OUTSTREAMWITHCRC_H #ifndef __OUT_STREAM_WITH_CRC_H
#define __OUTSTREAMWITHCRC_H #define __OUT_STREAM_WITH_CRC_H
#include "../../../Common/MyCom.h" #include "../../../Common/MyCom.h"
#include "../../IStream.h" #include "../../IStream.h"

View File

@@ -1,14 +1,14 @@
// OutStreamWithSha1.h // OutStreamWithSha1.h
#ifndef __OUTSTREAMWITHSHA1_H #ifndef __OUT_STREAM_WITH_SHA1_H
#define __OUTSTREAMWITHSHA1_H #define __OUT_STREAM_WITH_SHA1_H
#include "../../../Common/MyCom.h" #include "../../../Common/MyCom.h"
#include "../../IStream.h" #include "../../IStream.h"
#include "../../Crypto/Hash/Sha1.h" #include "../../Crypto/Sha1.h"
class COutStreamWithSha1: class COutStreamWithSha1:

View File

@@ -1,25 +1,25 @@
// Archive/cpio/Handler.cpp // CpioHandler.cpp
#include "StdAfx.h" #include "StdAfx.h"
#include "CpioHandler.h"
#include "CpioIn.h"
#include "Common/Defs.h"
#include "Common/StringConvert.h"
#include "Common/NewHandler.h"
#include "Common/ComTry.h" #include "Common/ComTry.h"
#include "Common/Defs.h"
#include "Common/NewHandler.h"
#include "Common/StringConvert.h"
#include "Windows/Time.h"
#include "Windows/PropVariant.h" #include "Windows/PropVariant.h"
#include "Windows/Time.h"
#include "../../Common/LimitedStreams.h"
#include "../../Common/ProgressUtils.h" #include "../../Common/ProgressUtils.h"
#include "../../Common//LimitedStreams.h"
#include "../../Compress/Copy/CopyCoder.h" #include "../../Compress/CopyCoder.h"
#include "../Common/ItemNameUtils.h" #include "../Common/ItemNameUtils.h"
#include "CpioHandler.h"
#include "CpioIn.h"
using namespace NWindows; using namespace NWindows;
using namespace NTime; using namespace NTime;

View File

@@ -16,7 +16,7 @@
#include "../Common/RegisterArc.h" #include "../Common/RegisterArc.h"
#include "../Common/StreamUtils.h" #include "../Common/StreamUtils.h"
#include "../Compress/Copy/CopyCoder.h" #include "../Compress/CopyCoder.h"
#include "Common/ItemNameUtils.h" #include "Common/ItemNameUtils.h"
@@ -198,7 +198,7 @@ HRESULT CInArchive::GetNextItem(bool &filled, CItemEx &item)
RINOK(GetNextItemReal(filled, item)); RINOK(GetNextItemReal(filled, item));
if (!filled) if (!filled)
return S_OK; return S_OK;
if (item.Name.CompareNoCase("debian-binary") != 0) if (item.Name.Compare("debian-binary") != 0)
return S_OK; return S_OK;
if (item.Size != 4) if (item.Size != 4)
return S_OK; return S_OK;

View File

@@ -17,9 +17,9 @@
#include "../Common/RegisterArc.h" #include "../Common/RegisterArc.h"
#include "../Common/StreamUtils.h" #include "../Common/StreamUtils.h"
#include "../Compress/BZip2/BZip2Decoder.h" #include "../Compress/BZip2Decoder.h"
#include "../Compress/Copy/CopyCoder.h" #include "../Compress/CopyCoder.h"
#include "../Compress/Deflate/ZlibDecoder.h" #include "../Compress/ZlibDecoder.h"
// #define DMG_SHOW_RAW // #define DMG_SHOW_RAW

View File

@@ -15,7 +15,7 @@
#include "../Common/RegisterArc.h" #include "../Common/RegisterArc.h"
#include "../Common/StreamUtils.h" #include "../Common/StreamUtils.h"
#include "../Compress/Copy/CopyCoder.h" #include "../Compress/CopyCoder.h"
#include "Common/DummyOutStream.h" #include "Common/DummyOutStream.h"

View File

@@ -1,19 +1,20 @@
// Archive/GZip/OutHandler.cpp // GZipHandlerOut.cpp
#include "StdAfx.h" #include "StdAfx.h"
#include "GZipHandler.h"
#include "GZipUpdate.h"
#include "Common/StringConvert.h" #include "Common/StringConvert.h"
#include "Common/StringToInt.h" #include "Common/StringToInt.h"
#include "Windows/Time.h"
#include "Windows/PropVariant.h" #include "Windows/PropVariant.h"
#include "Windows/Time.h"
#include "../../Compress/CopyCoder.h"
#include "../../Compress/Copy/CopyCoder.h"
#include "../Common/ParseProperties.h" #include "../Common/ParseProperties.h"
#include "GZipHandler.h"
#include "GZipUpdate.h"
using namespace NWindows; using namespace NWindows;
using namespace NTime; using namespace NTime;

View File

@@ -2,8 +2,6 @@
#include "StdAfx.h" #include "StdAfx.h"
#include "GZipUpdate.h"
#include "Common/Defs.h" #include "Common/Defs.h"
#include "Common/StringConvert.h" #include "Common/StringConvert.h"
@@ -11,12 +9,16 @@
#include "Windows/PropVariant.h" #include "Windows/PropVariant.h"
#include "../../ICoder.h" #include "../../ICoder.h"
#include "../../Common/ProgressUtils.h"
#include "../../Common/CreateCoder.h" #include "../../Common/CreateCoder.h"
#include "../../Compress/Copy/CopyCoder.h" #include "../../Common/ProgressUtils.h"
#include "../../Compress/CopyCoder.h"
#include "../Common/InStreamWithCRC.h" #include "../Common/InStreamWithCRC.h"
#include "GZipUpdate.h"
namespace NArchive { namespace NArchive {
namespace NGZip { namespace NGZip {

View File

@@ -1,25 +1,25 @@
// Iso/Handler.cpp // IsoHandler.cpp
#include "StdAfx.h" #include "StdAfx.h"
#include "IsoHandler.h" #include "Common/ComTry.h"
#include "Common/Defs.h" #include "Common/Defs.h"
#include "Common/StringConvert.h"
#include "Common/IntToString.h" #include "Common/IntToString.h"
#include "Common/NewHandler.h" #include "Common/NewHandler.h"
#include "Common/ComTry.h" #include "Common/StringConvert.h"
#include "Windows/Time.h"
#include "Windows/PropVariant.h" #include "Windows/PropVariant.h"
#include "Windows/Time.h"
#include "../../Common/ProgressUtils.h"
#include "../../Common/LimitedStreams.h" #include "../../Common/LimitedStreams.h"
#include "../../Common/ProgressUtils.h"
#include "../../Compress/Copy/CopyCoder.h" #include "../../Compress/CopyCoder.h"
#include "../Common/ItemNameUtils.h" #include "../Common/ItemNameUtils.h"
#include "IsoHandler.h"
using namespace NWindows; using namespace NWindows;
using namespace NTime; using namespace NTime;

View File

@@ -2,23 +2,23 @@
#include "StdAfx.h" #include "StdAfx.h"
#include "Common/ComTry.h"
#include "Common/Defs.h" #include "Common/Defs.h"
#include "Common/StringConvert.h" #include "Common/StringConvert.h"
#include "Common/ComTry.h"
#include "Windows/Time.h"
#include "Windows/PropVariant.h" #include "Windows/PropVariant.h"
#include "Windows/Time.h"
#include "LzhHandler.h" #include "LzhHandler.h"
#include "LzhOutStreamWithCRC.h" #include "LzhOutStreamWithCRC.h"
#include "../../ICoder.h" #include "../../ICoder.h"
#include "../../Common/ProgressUtils.h"
#include "../../Common/LimitedStreams.h" #include "../../Common/LimitedStreams.h"
#include "../../Common/ProgressUtils.h"
#include "../../Compress/Copy/CopyCoder.h" #include "../../Compress/CopyCoder.h"
#include "../../Compress/Lzh/LzhDecoder.h" #include "../../Compress/LzhDecoder.h"
#include "../Common/ItemNameUtils.h" #include "../Common/ItemNameUtils.h"
@@ -384,5 +384,4 @@ STDMETHODIMP CHandler::Extract(const UInt32* indices, UInt32 numItems,
COM_TRY_END COM_TRY_END
} }
}} }}

View File

@@ -14,7 +14,7 @@
#include "../Common/RegisterArc.h" #include "../Common/RegisterArc.h"
#include "../Common/StreamUtils.h" #include "../Common/StreamUtils.h"
#include "../Compress/Copy/CopyCoder.h" #include "../Compress/CopyCoder.h"
#include "Common/DummyOutStream.h" #include "Common/DummyOutStream.h"
@@ -308,11 +308,9 @@ STDMETHODIMP CHandler::GetArchiveProperty(PROPID propID, PROPVARIANT *value)
static AString GetName(const char *name) static AString GetName(const char *name)
{ {
AString res; char res[kNameSize + 1];
char *p = res.GetBuffer(kNameSize); memcpy(res, name, kNameSize);
strncpy(p, name, kNameSize); res[kNameSize] = 0;
p[kNameSize] = 0;
res.ReleaseBuffer();
return res; return res;
} }

View File

@@ -13,7 +13,7 @@
#include "../Common/RegisterArc.h" #include "../Common/RegisterArc.h"
#include "../Common/StreamUtils.h" #include "../Common/StreamUtils.h"
#include "../Compress/Copy/CopyCoder.h" #include "../Compress/CopyCoder.h"
#define Get32(p) GetBe32(p) #define Get32(p) GetBe32(p)

View File

@@ -2,19 +2,19 @@
#include "StdAfx.h" #include "StdAfx.h"
#include "NsisHandler.h" #include "../../../../C/CpuArch.h"
#include "Common/StringConvert.h" #include "Common/ComTry.h"
#include "Common/IntToString.h" #include "Common/IntToString.h"
#include "Common/NewHandler.h" #include "Common/NewHandler.h"
#include "Common/ComTry.h"
#include "Windows/PropVariant.h" #include "Windows/PropVariant.h"
#include "../Common/ItemNameUtils.h"
#include "../../Common/StreamUtils.h" #include "../../Common/StreamUtils.h"
#include "../../../../C/CpuArch.h" #include "../Common/ItemNameUtils.h"
#include "NsisHandler.h"
#define Get32(p) GetUi32(p) #define Get32(p) GetUi32(p)
@@ -228,12 +228,7 @@ STDMETHODIMP CHandler::GetProperty(UInt32 index, PROPID propID, PROPVARIANT *val
{ {
case kpidPath: case kpidPath:
{ {
UString s; UString s = NItemName::WinNameToOSName(item.GetReducedName(_archive.IsUnicode));
if (_archive.IsUnicode)
s = item.GetReducedNameU();
else
s = MultiByteToUnicodeString(item.GetReducedNameA(), CP_ACP);
s = NItemName::WinNameToOSName(s);
if (!s.IsEmpty()) if (!s.IsEmpty())
prop = (const wchar_t *)s; prop = (const wchar_t *)s;
break; break;
@@ -320,6 +315,11 @@ STDMETHODIMP CHandler::Extract(const UInt32* indices, UInt32 numItems,
_inStream, _archive.Method, _archive.FilterFlag, useFilter)); _inStream, _archive.Method, _archive.FilterFlag, useFilter));
} }
CByteBuffer byteBuf;
const UInt32 kBufferLength = 1 << 16;
byteBuf.SetCapacity(kBufferLength);
Byte *buffer = byteBuf;
bool dataError = false; bool dataError = false;
for (i = 0; i < numItems; i++, currentTotalSize += currentItemSize) for (i = 0; i < numItems; i++, currentTotalSize += currentItemSize)
{ {
@@ -363,9 +363,6 @@ STDMETHODIMP CHandler::Extract(const UInt32* indices, UInt32 numItems,
bool sizeIsKnown = false; bool sizeIsKnown = false;
UInt32 fullSize = 0; UInt32 fullSize = 0;
const UInt32 kBufferLength = 1 << 11;
Byte buffer[kBufferLength];
if (_archive.IsSolid) if (_archive.IsSolid)
{ {
UInt64 pos = _archive.GetPosOfSolidItem(index); UInt64 pos = _archive.GetPosOfSolidItem(index);
@@ -389,12 +386,13 @@ STDMETHODIMP CHandler::Extract(const UInt32* indices, UInt32 numItems,
} }
if (streamPos == pos) if (streamPos == pos)
{ {
Byte buffer2[4];
size_t processedSize = 4; size_t processedSize = 4;
RINOK(_archive.Decoder.Read(buffer, &processedSize)); RINOK(_archive.Decoder.Read(buffer2, &processedSize));
if (processedSize != 4) if (processedSize != 4)
return E_FAIL; return E_FAIL;
streamPos += processedSize; streamPos += processedSize;
fullSize = Get32(buffer); fullSize = Get32(buffer2);
sizeIsKnown = true; sizeIsKnown = true;
needDecompress = true; needDecompress = true;
} }
@@ -409,7 +407,9 @@ STDMETHODIMP CHandler::Extract(const UInt32* indices, UInt32 numItems,
RINOK(_archive.Decoder.Init( RINOK(_archive.Decoder.Init(
EXTERNAL_CODECS_VARS EXTERNAL_CODECS_VARS
_inStream, _archive.Method, _archive.FilterFlag, useFilter)); _inStream, _archive.Method, _archive.FilterFlag, useFilter));
fullSize = Get32(buffer); // fullSize = Get32(buffer); // It's bug !!!
// Test it: what is exact fullSize?
fullSize = 0xFFFFFFFF;
} }
else else
fullSize = item.Size; fullSize = item.Size;

View File

@@ -3,16 +3,17 @@
#ifndef __ARCHIVE_NSIS_IN_H #ifndef __ARCHIVE_NSIS_IN_H
#define __ARCHIVE_NSIS_IN_H #define __ARCHIVE_NSIS_IN_H
#include "Common/MyCom.h"
#include "Common/IntToString.h"
#include "Common/Buffer.h" #include "Common/Buffer.h"
#include "Common/IntToString.h"
#include "Common/MyCom.h"
#include "Common/StringConvert.h"
#include "../../Common/CreateCoder.h"
#include "../../IStream.h" #include "../../IStream.h"
#include "NsisDecode.h" #include "NsisDecode.h"
#include "../../Common/CreateCoder.h"
// #define NSIS_SCRIPT // #define NSIS_SCRIPT
namespace NArchive { namespace NArchive {
@@ -81,32 +82,25 @@ struct CItem
return (PrefixA.Length() >= 3 || PrefixU.Length() >= 3); return (PrefixA.Length() >= 3 || PrefixU.Length() >= 3);
} }
AString GetReducedNameA() const UString GetReducedName(bool unicode) const
{ {
AString prefix = PrefixA; UString s;
if (prefix.Length() > 0) if (unicode)
if (prefix[prefix.Length() - 1] != '\\') s = PrefixU;
prefix += '\\'; else
AString s2 = prefix + NameA; s = MultiByteToUnicodeString(PrefixA);
if (s.Length() > 0)
if (s[s.Length() - 1] != L'\\')
s += L'\\';
if (unicode)
s += NameU;
else
s += MultiByteToUnicodeString(NameA);
const int len = 9; const int len = 9;
if (s2.Left(len).CompareNoCase("$INSTDIR\\") == 0) if (s.Left(len).CompareNoCase(L"$INSTDIR\\") == 0)
s2 = s2.Mid(len); s = s.Mid(len);
return s2; return s;
} }
UString GetReducedNameU() const
{
UString prefix = PrefixU;
if (prefix.Length() > 0)
if (prefix[prefix.Length() - 1] != L'\\')
prefix += L'\\';
UString s2 = prefix + NameU;
const int len = 9;
if (s2.Left(len).CompareNoCase(L"$INSTDIR\\") == 0)
s2 = s2.Mid(len);
return s2;
}
}; };
class CInArchive class CInArchive

View File

@@ -16,7 +16,7 @@
#include "../Common/RegisterArc.h" #include "../Common/RegisterArc.h"
#include "../Common/StreamUtils.h" #include "../Common/StreamUtils.h"
#include "../Compress/Copy/CopyCoder.h" #include "../Compress/CopyCoder.h"
#include "Common/DummyOutStream.h" #include "Common/DummyOutStream.h"
@@ -605,7 +605,11 @@ HRESULT CHandler::LoadDebugSections(IInStream *stream, bool &thereIsSection)
} }
} }
if (i == _sections.Size()) if (i == _sections.Size())
return S_FALSE; {
return S_OK;
// Exe for ARM requires S_OK
// return S_FALSE;
}
CByteBuffer buffer; CByteBuffer buffer;
buffer.SetCapacity(debugLink.Size); buffer.SetCapacity(debugLink.Size);

View File

@@ -2,25 +2,29 @@
#include "StdAfx.h" #include "StdAfx.h"
#include "RarHandler.h"
#include "Common/StringConvert.h"
#include "Common/ComTry.h" #include "Common/ComTry.h"
#include "Common/IntToString.h" #include "Common/IntToString.h"
#include "Common/StringConvert.h"
#include "Windows/PropVariant.h" #include "Windows/PropVariant.h"
#include "Windows/Time.h" #include "Windows/Time.h"
#include "../../IPassword.h" #include "../../IPassword.h"
#include "../../Common/ProgressUtils.h"
#include "../../Common/CreateCoder.h" #include "../../Common/CreateCoder.h"
#include "../../Common/MethodId.h"
#include "../../Common/FilterCoder.h" #include "../../Common/FilterCoder.h"
#include "../../Compress/Copy/CopyCoder.h" #include "../../Common/MethodId.h"
#include "../../Crypto/Rar20/Rar20Cipher.h" #include "../../Common/ProgressUtils.h"
#include "../../Crypto/RarAES/RarAES.h"
#include "../Common/OutStreamWithCRC.h" #include "../../Compress/CopyCoder.h"
#include "../../Crypto/Rar20Crypto.h"
#include "../../Crypto/RarAes.h"
#include "../Common/ItemNameUtils.h" #include "../Common/ItemNameUtils.h"
#include "../Common/OutStreamWithCRC.h"
#include "RarHandler.h"
using namespace NWindows; using namespace NWindows;
using namespace NTime; using namespace NTime;

View File

@@ -5,10 +5,14 @@
#include "Common/DynamicBuffer.h" #include "Common/DynamicBuffer.h"
#include "Common/MyCom.h" #include "Common/MyCom.h"
#include "../../IStream.h"
#include "../../ICoder.h" #include "../../ICoder.h"
#include "../../IStream.h"
#include "../../Common/StreamObjects.h" #include "../../Common/StreamObjects.h"
#include "../../Crypto/RarAES/RarAES.h"
#include "../../Crypto/RarAes.h"
#include "RarHeader.h" #include "RarHeader.h"
#include "RarItem.h" #include "RarItem.h"

View File

@@ -13,7 +13,7 @@
#include "../Common/RegisterArc.h" #include "../Common/RegisterArc.h"
#include "../Common/StreamUtils.h" #include "../Common/StreamUtils.h"
#include "../Compress/Copy/CopyCoder.h" #include "../Compress/CopyCoder.h"
using namespace NWindows; using namespace NWindows;

View File

@@ -1,22 +1,24 @@
// Tar/Handler.cpp // SplitHandler.cpp
#include "StdAfx.h" #include "StdAfx.h"
#include "SplitHandler.h"
#include "Common/Defs.h"
#include "Common/StringConvert.h"
#include "Common/NewHandler.h"
#include "Common/ComTry.h" #include "Common/ComTry.h"
#include "Common/Defs.h"
#include "Common/NewHandler.h"
#include "Common/StringConvert.h"
#include "Windows/Time.h"
#include "Windows/PropVariant.h" #include "Windows/PropVariant.h"
#include "Windows/Time.h"
#include "../../Common/ProgressUtils.h" #include "../../Common/ProgressUtils.h"
#include "../../Compress/Copy/CopyCoder.h"
#include "../../Compress/CopyCoder.h"
#include "../Common/ItemNameUtils.h" #include "../Common/ItemNameUtils.h"
#include "../Common/MultiStream.h" #include "../Common/MultiStream.h"
#include "SplitHandler.h"
using namespace NWindows; using namespace NWindows;
using namespace NTime; using namespace NTime;

View File

@@ -1,26 +1,26 @@
// Tar/Handler.cpp // TarHandler.cpp
#include "StdAfx.h" #include "StdAfx.h"
#include "Common/ComTry.h"
#include "Common/Defs.h"
#include "Common/NewHandler.h"
#include "Common/StringConvert.h"
#include "Windows/PropVariant.h"
#include "Windows/Time.h"
#include "../../Common/LimitedStreams.h"
#include "../../Common/ProgressUtils.h"
#include "../../Compress/CopyCoder.h"
#include "../Common/DummyOutStream.h"
#include "../Common/ItemNameUtils.h"
#include "TarHandler.h" #include "TarHandler.h"
#include "TarIn.h" #include "TarIn.h"
#include "Common/Defs.h"
#include "Common/StringConvert.h"
#include "Common/NewHandler.h"
#include "Common/ComTry.h"
#include "Windows/Time.h"
#include "Windows/PropVariant.h"
#include "../../Common/ProgressUtils.h"
#include "../../Common/LimitedStreams.h"
#include "../Common/DummyOutStream.h"
#include "../../Compress/Copy/CopyCoder.h"
#include "../Common/ItemNameUtils.h"
using namespace NWindows; using namespace NWindows;
namespace NArchive { namespace NArchive {

View File

@@ -2,13 +2,10 @@
#include "StdAfx.h" #include "StdAfx.h"
#include "Common/Defs.h"
#include "Common/StringConvert.h"
#include "Windows/Defs.h"
#include "../../Common/ProgressUtils.h"
#include "../../Common/LimitedStreams.h" #include "../../Common/LimitedStreams.h"
#include "../../Compress/Copy/CopyCoder.h" #include "../../Common/ProgressUtils.h"
#include "../../Compress/CopyCoder.h"
#include "TarOut.h" #include "TarOut.h"
#include "TarUpdate.h" #include "TarUpdate.h"

View File

@@ -1,19 +1,21 @@
// Udf/Handler.cpp // UdfHandler.cpp
#include "StdAfx.h" #include "StdAfx.h"
#include "UdfHandler.h"
#include "Common/NewHandler.h"
#include "Common/ComTry.h" #include "Common/ComTry.h"
#include "Common/NewHandler.h"
#include "Windows/Time.h"
#include "Windows/PropVariant.h" #include "Windows/PropVariant.h"
#include "Windows/Time.h"
#include "../../Common/ProgressUtils.h" #include "../../Common/ProgressUtils.h"
#include "../../Compress/Copy/CopyCoder.h"
#include "../../Compress/CopyCoder.h"
#include "../Common/DummyOutStream.h" #include "../Common/DummyOutStream.h"
#include "UdfHandler.h"
namespace NArchive { namespace NArchive {
namespace NUdf { namespace NUdf {

View File

@@ -123,7 +123,7 @@ HRESULT CDecoder::Code(ISequentialInStream *inStream, ISequentialOutStream *outS
{ {
try { return CodeReal(inStream, outStream, outSize); } try { return CodeReal(inStream, outStream, outSize); }
catch(const CInBufferException &e) { return e.ErrorCode; } \ catch(const CInBufferException &e) { return e.ErrorCode; } \
catch(const CLZOutWindowException &e) { return e.ErrorCode; } catch(const CLzOutWindowException &e) { return e.ErrorCode; }
catch(...) { return S_FALSE; } catch(...) { return S_FALSE; }
} }

View File

@@ -3,11 +3,11 @@
#ifndef __ARCHIVE_WIM_IN_H #ifndef __ARCHIVE_WIM_IN_H
#define __ARCHIVE_WIM_IN_H #define __ARCHIVE_WIM_IN_H
#include "Common/MyString.h"
#include "Common/Buffer.h" #include "Common/Buffer.h"
#include "Common/MyString.h"
#include "../../Compress/Lzx/LzxDecoder.h" #include "../../Compress/CopyCoder.h"
#include "../../Compress/Copy/CopyCoder.h" #include "../../Compress/LzxDecoder.h"
namespace NArchive { namespace NArchive {
namespace NWim { namespace NWim {
@@ -66,7 +66,7 @@ const UInt32 kMainTableSize = 256 + kNumPosLenSlots;
class CDecoder class CDecoder
{ {
CBitStream m_InBitStream; CBitStream m_InBitStream;
CLZOutWindow m_OutWindowStream; CLzOutWindow m_OutWindowStream;
NCompress::NHuffman::CDecoder<kNumHuffmanBits, kMainTableSize> m_MainDecoder; NCompress::NHuffman::CDecoder<kNumHuffmanBits, kMainTableSize> m_MainDecoder;
HRESULT CodeSpec(UInt32 size); HRESULT CodeSpec(UInt32 size);

View File

@@ -18,9 +18,9 @@
#include "../Common/StreamObjects.h" #include "../Common/StreamObjects.h"
#include "../Common/StreamUtils.h" #include "../Common/StreamUtils.h"
#include "../Compress/BZip2/BZip2Decoder.h" #include "../Compress/BZip2Decoder.h"
#include "../Compress/Copy/CopyCoder.h" #include "../Compress/CopyCoder.h"
#include "../Compress/Deflate/ZlibDecoder.h" #include "../Compress/ZlibDecoder.h"
#include "Common/OutStreamWithSha1.h" #include "Common/OutStreamWithSha1.h"

View File

@@ -10,7 +10,7 @@
#include "../Common/RegisterArc.h" #include "../Common/RegisterArc.h"
#include "../Common/StreamUtils.h" #include "../Common/StreamUtils.h"
#include "../Compress/Z/ZDecoder.h" #include "../Compress/ZDecoder.h"
#include "Common/DummyOutStream.h" #include "Common/DummyOutStream.h"

View File

@@ -1,4 +1,4 @@
// AddCommon.cpp // ZipAddCommon.cpp
#include "StdAfx.h" #include "StdAfx.h"
@@ -8,14 +8,17 @@ extern "C"
} }
#include "Windows/PropVariant.h" #include "Windows/PropVariant.h"
#include "Windows/Defs.h"
#include "../../MyVersion.h"
#include "../../ICoder.h" #include "../../ICoder.h"
#include "../../IPassword.h" #include "../../IPassword.h"
#include "../../MyVersion.h"
#include "../../Common/CreateCoder.h" #include "../../Common/CreateCoder.h"
#include "../../Common/StreamObjects.h" #include "../../Common/StreamObjects.h"
#include "../../Common/StreamUtils.h" #include "../../Common/StreamUtils.h"
#include "../../Compress/LZMA/LZMAEncoder.h"
#include "../../Compress/LzmaEncoder.h"
#include "../Common/InStreamWithCRC.h" #include "../Common/InStreamWithCRC.h"
#include "ZipAddCommon.h" #include "ZipAddCommon.h"
@@ -34,7 +37,7 @@ class CLzmaEncoder:
public ICompressCoder, public ICompressCoder,
public CMyUnknownImp public CMyUnknownImp
{ {
NCompress::NLZMA::CEncoder *EncoderSpec; NCompress::NLzma::CEncoder *EncoderSpec;
CMyComPtr<ICompressCoder> Encoder; CMyComPtr<ICompressCoder> Encoder;
Byte Header[kLzmaHeaderSize]; Byte Header[kLzmaHeaderSize];
public: public:
@@ -49,7 +52,7 @@ HRESULT CLzmaEncoder::SetCoderProperties(const PROPID *propIDs, const PROPVARIAN
{ {
if (!Encoder) if (!Encoder)
{ {
EncoderSpec = new NCompress::NLZMA::CEncoder; EncoderSpec = new NCompress::NLzma::CEncoder;
Encoder = EncoderSpec; Encoder = EncoderSpec;
} }
CSequentialOutStreamImp *outStreamSpec = new CSequentialOutStreamImp; CSequentialOutStreamImp *outStreamSpec = new CSequentialOutStreamImp;
@@ -153,7 +156,7 @@ HRESULT CAddCommon::Compress(
} }
if (_options.IsAesMode) if (_options.IsAesMode)
{ {
_cryptoStreamSpec->Filter = _aesFilter = _filterAesSpec = new NCrypto::NWzAES::CEncoder; _cryptoStreamSpec->Filter = _aesFilter = _filterAesSpec = new NCrypto::NWzAes::CEncoder;
_filterAesSpec->SetKeyMode(_options.AesKeyMode); _filterAesSpec->SetKeyMode(_options.AesKeyMode);
RINOK(_filterAesSpec->CryptoSetPassword( RINOK(_filterAesSpec->CryptoSetPassword(
(const Byte *)(const char *)_options.Password, _options.Password.Length())); (const Byte *)(const char *)_options.Password, _options.Password.Length()));

View File

@@ -1,16 +1,18 @@
// Zip/AddCommon.h // ZipAddCommon.h
#ifndef __ZIP_ADDCOMMON_H #ifndef __ZIP_ADD_COMMON_H
#define __ZIP_ADDCOMMON_H #define __ZIP_ADD_COMMON_H
#include "../../ICoder.h" #include "../../ICoder.h"
#include "../../IProgress.h" #include "../../IProgress.h"
#include "../../Compress/Copy/CopyCoder.h"
#include "../../Common/CreateCoder.h" #include "../../Common/CreateCoder.h"
#include "../../Common/FilterCoder.h" #include "../../Common/FilterCoder.h"
#include "../../Crypto/Zip/ZipCipher.h"
#include "../../Crypto/WzAES/WzAES.h" #include "../../Compress/CopyCoder.h"
#include "../../Crypto/ZipCrypto.h"
#include "../../Crypto/WzAes.h"
#include "ZipCompressionMode.h" #include "ZipCompressionMode.h"
@@ -38,7 +40,7 @@ class CAddCommon
CMyComPtr<ISequentialOutStream> _cryptoStream; CMyComPtr<ISequentialOutStream> _cryptoStream;
NCrypto::NZip::CEncoder *_filterSpec; NCrypto::NZip::CEncoder *_filterSpec;
NCrypto::NWzAES::CEncoder *_filterAesSpec; NCrypto::NWzAes::CEncoder *_filterAesSpec;
CMyComPtr<ICompressFilter> _zipCryptoFilter; CMyComPtr<ICompressFilter> _zipCryptoFilter;
CMyComPtr<ICompressFilter> _aesFilter; CMyComPtr<ICompressFilter> _aesFilter;

View File

@@ -2,40 +2,35 @@
#include "StdAfx.h" #include "StdAfx.h"
#include "ZipHandler.h"
#include "Common/Defs.h"
#include "Common/StringConvert.h"
#include "Common/ComTry.h" #include "Common/ComTry.h"
#include "Common/Defs.h"
#include "Common/IntToString.h" #include "Common/IntToString.h"
#include "Common/StringConvert.h"
#include "Windows/Time.h"
#include "Windows/PropVariant.h" #include "Windows/PropVariant.h"
#include "Windows/Time.h"
#include "../../IPassword.h" #include "../../IPassword.h"
#include "../../Common/CreateCoder.h"
#include "../../Common/FilterCoder.h"
#include "../../Common/ProgressUtils.h" #include "../../Common/ProgressUtils.h"
#include "../../Common/StreamObjects.h" #include "../../Common/StreamObjects.h"
#include "../../Common/StreamUtils.h" #include "../../Common/StreamUtils.h"
#include "../../Common/CreateCoder.h"
#include "../../Common/FilterCoder.h"
#include "../../Compress/Copy/CopyCoder.h" #include "../../Compress/CopyCoder.h"
#include "../../Compress/LZMA/LZMADecoder.h" #include "../../Compress/LzmaDecoder.h"
#include "../../Compress/ImplodeDecoder.h"
#include "../../Compress/ShrinkDecoder.h"
#include "../../Crypto/WzAes.h"
#include "../../Crypto/ZipCrypto.h"
#include "../../Crypto/ZipStrong.h"
#include "../Common/ItemNameUtils.h" #include "../Common/ItemNameUtils.h"
#include "../Common/OutStreamWithCRC.h" #include "../Common/OutStreamWithCRC.h"
#include "../../Compress/Shrink/ShrinkDecoder.h" #include "ZipHandler.h"
#include "../../Compress/Implode/ImplodeDecoder.h"
#include "../../Crypto/Zip/ZipCipher.h"
#include "../../Crypto/WzAES/WzAES.h"
#ifdef ZIP_STRONG_SUPORT
#include "../../Crypto/ZipStrong/ZipStrong.h"
#endif
using namespace NWindows; using namespace NWindows;
@@ -381,7 +376,7 @@ class CLzmaDecoder:
public ICompressCoder, public ICompressCoder,
public CMyUnknownImp public CMyUnknownImp
{ {
NCompress::NLZMA::CDecoder *DecoderSpec; NCompress::NLzma::CDecoder *DecoderSpec;
CMyComPtr<ICompressCoder> Decoder; CMyComPtr<ICompressCoder> Decoder;
public: public:
CLzmaDecoder(); CLzmaDecoder();
@@ -393,7 +388,7 @@ public:
CLzmaDecoder::CLzmaDecoder() CLzmaDecoder::CLzmaDecoder()
{ {
DecoderSpec = new NCompress::NLZMA::CDecoder; DecoderSpec = new NCompress::NLzma::CDecoder;
Decoder = DecoderSpec; Decoder = DecoderSpec;
} }
@@ -417,20 +412,24 @@ struct CMethodItem
class CZipDecoder class CZipDecoder
{ {
NCrypto::NZip::CDecoder *_zipCryptoDecoderSpec; NCrypto::NZip::CDecoder *_zipCryptoDecoderSpec;
NCrypto::NWzAES::CDecoder *_aesDecoderSpec; NCrypto::NZipStrong::CDecoder *_pkAesDecoderSpec;
NCrypto::NWzAes::CDecoder *_wzAesDecoderSpec;
CMyComPtr<ICompressFilter> _zipCryptoDecoder; CMyComPtr<ICompressFilter> _zipCryptoDecoder;
CMyComPtr<ICompressFilter> _aesDecoder; CMyComPtr<ICompressFilter> _pkAesDecoder;
#ifdef ZIP_STRONG_SUPORT CMyComPtr<ICompressFilter> _wzAesDecoder;
NCrypto::NZipStrong::CDecoder *_zsDecoderSpec;
CMyComPtr<ICompressFilter> _zsDecoder;
#endif
CFilterCoder *filterStreamSpec; CFilterCoder *filterStreamSpec;
CMyComPtr<ISequentialInStream> filterStream; CMyComPtr<ISequentialInStream> filterStream;
CMyComPtr<ICryptoGetTextPassword> getTextPassword; CMyComPtr<ICryptoGetTextPassword> getTextPassword;
CObjectVector<CMethodItem> methodItems; CObjectVector<CMethodItem> methodItems;
public: public:
CZipDecoder(): _zipCryptoDecoderSpec(0), _aesDecoderSpec(0), filterStreamSpec(0) {} CZipDecoder():
_zipCryptoDecoderSpec(0),
_pkAesDecoderSpec(0),
_wzAesDecoderSpec(0),
filterStreamSpec(0) {}
HRESULT Decode( HRESULT Decode(
DECL_EXTERNAL_CODECS_LOC_VARS DECL_EXTERNAL_CODECS_LOC_VARS
@@ -453,23 +452,19 @@ HRESULT CZipDecoder::Decode(
CInStreamReleaser inStreamReleaser; CInStreamReleaser inStreamReleaser;
bool needCRC = true; bool needCRC = true;
bool aesMode = false; bool wzAesMode = false;
#ifdef ZIP_STRONG_SUPORT
bool pkAesMode = false; bool pkAesMode = false;
#endif
UInt16 methodId = item.CompressionMethod; UInt16 methodId = item.CompressionMethod;
if (item.IsEncrypted()) if (item.IsEncrypted())
{ {
if (item.IsStrongEncrypted()) if (item.IsStrongEncrypted())
{ {
#ifdef ZIP_STRONG_SUPORT
CStrongCryptoField f; CStrongCryptoField f;
if (item.CentralExtra.GetStrongCryptoField(f)) if (item.CentralExtra.GetStrongCryptoField(f))
{ {
pkAesMode = true; pkAesMode = true;
} }
if (!pkAesMode) if (!pkAesMode)
#endif
{ {
res = NArchive::NExtract::NOperationResult::kUnSupportedMethod; res = NArchive::NExtract::NOperationResult::kUnSupportedMethod;
return S_OK; return S_OK;
@@ -480,7 +475,7 @@ HRESULT CZipDecoder::Decode(
CWzAesExtraField aesField; CWzAesExtraField aesField;
if (item.CentralExtra.GetWzAesField(aesField)) if (item.CentralExtra.GetWzAesField(aesField))
{ {
aesMode = true; wzAesMode = true;
needCRC = aesField.NeedCrc(); needCRC = aesField.NeedCrc();
} }
} }
@@ -496,11 +491,11 @@ HRESULT CZipDecoder::Decode(
CMyComPtr<ISequentialInStream> inStream; CMyComPtr<ISequentialInStream> inStream;
{ {
UInt64 packSize = item.PackSize; UInt64 packSize = item.PackSize;
if (aesMode) if (wzAesMode)
{ {
if (packSize < NCrypto::NWzAES::kMacSize) if (packSize < NCrypto::NWzAes::kMacSize)
return S_OK; return S_OK;
packSize -= NCrypto::NWzAES::kMacSize; packSize -= NCrypto::NWzAes::kMacSize;
} }
UInt64 dataPos = item.GetDataPosition(); UInt64 dataPos = item.GetDataPosition();
inStream.Attach(archive.CreateLimitedStream(dataPos, packSize)); inStream.Attach(archive.CreateLimitedStream(dataPos, packSize));
@@ -510,32 +505,30 @@ HRESULT CZipDecoder::Decode(
CMyComPtr<ICompressFilter> cryptoFilter; CMyComPtr<ICompressFilter> cryptoFilter;
if (item.IsEncrypted()) if (item.IsEncrypted())
{ {
if (aesMode) if (wzAesMode)
{ {
CWzAesExtraField aesField; CWzAesExtraField aesField;
if (!item.CentralExtra.GetWzAesField(aesField)) if (!item.CentralExtra.GetWzAesField(aesField))
return S_OK; return S_OK;
methodId = aesField.Method; methodId = aesField.Method;
if (!_aesDecoder) if (!_wzAesDecoder)
{ {
_aesDecoderSpec = new NCrypto::NWzAES::CDecoder; _wzAesDecoderSpec = new NCrypto::NWzAes::CDecoder;
_aesDecoder = _aesDecoderSpec; _wzAesDecoder = _wzAesDecoderSpec;
} }
cryptoFilter = _aesDecoder; cryptoFilter = _wzAesDecoder;
Byte properties = aesField.Strength; Byte properties = aesField.Strength;
RINOK(_aesDecoderSpec->SetDecoderProperties2(&properties, 1)); RINOK(_wzAesDecoderSpec->SetDecoderProperties2(&properties, 1));
} }
#ifdef ZIP_STRONG_SUPORT
else if (pkAesMode) else if (pkAesMode)
{ {
if (!_zsDecoder) if (!_pkAesDecoder)
{ {
_zsDecoderSpec = new NCrypto::NZipStrong::CDecoder; _pkAesDecoderSpec = new NCrypto::NZipStrong::CDecoder;
_zsDecoder = _zsDecoderSpec; _pkAesDecoder = _pkAesDecoderSpec;
} }
cryptoFilter = _zsDecoder; cryptoFilter = _pkAesDecoder;
} }
#endif
else else
{ {
if (!_zipCryptoDecoder) if (!_zipCryptoDecoder)
@@ -556,11 +549,7 @@ HRESULT CZipDecoder::Decode(
CMyComBSTR password; CMyComBSTR password;
RINOK(getTextPassword->CryptoGetTextPassword(&password)); RINOK(getTextPassword->CryptoGetTextPassword(&password));
AString charPassword; AString charPassword;
if (aesMode if (wzAesMode || pkAesMode)
#ifdef ZIP_STRONG_SUPORT
|| pkAesMode
#endif
)
{ {
charPassword = UnicodeStringToMultiByte((const wchar_t *)password, CP_ACP); charPassword = UnicodeStringToMultiByte((const wchar_t *)password, CP_ACP);
/* /*
@@ -583,9 +572,9 @@ HRESULT CZipDecoder::Decode(
// we use OEM. WinZip/Windows probably use ANSI for some files // we use OEM. WinZip/Windows probably use ANSI for some files
charPassword = UnicodeStringToMultiByte((const wchar_t *)password, CP_OEMCP); charPassword = UnicodeStringToMultiByte((const wchar_t *)password, CP_OEMCP);
} }
HRESULT res = cryptoSetPassword->CryptoSetPassword( HRESULT result = cryptoSetPassword->CryptoSetPassword(
(const Byte *)(const char *)charPassword, charPassword.Length()); (const Byte *)(const char *)charPassword, charPassword.Length());
if (res != S_OK) if (result != S_OK)
return S_OK; return S_OK;
} }
else else
@@ -660,7 +649,7 @@ HRESULT CZipDecoder::Decode(
#endif #endif
{ {
HRESULT result; HRESULT result = S_OK;
CMyComPtr<ISequentialInStream> inStreamNew; CMyComPtr<ISequentialInStream> inStreamNew;
if (item.IsEncrypted()) if (item.IsEncrypted())
{ {
@@ -670,33 +659,42 @@ HRESULT CZipDecoder::Decode(
filterStream = filterStreamSpec; filterStream = filterStreamSpec;
} }
filterStreamSpec->Filter = cryptoFilter; filterStreamSpec->Filter = cryptoFilter;
if (aesMode) if (wzAesMode)
{ {
RINOK(_aesDecoderSpec->ReadHeader(inStream)); result = _wzAesDecoderSpec->ReadHeader(inStream);
} }
#ifdef ZIP_STRONG_SUPORT
else if (pkAesMode) else if (pkAesMode)
{ {
RINOK(_zsDecoderSpec->ReadHeader(inStream)); result =_pkAesDecoderSpec->ReadHeader(inStream, item.FileCRC, item.UnPackSize);
if (result == S_OK)
{
bool passwOK;
result = _pkAesDecoderSpec->CheckPassword(passwOK);
if (result == S_OK && !passwOK)
result = S_FALSE;
}
} }
#endif
else else
{ {
RINOK(_zipCryptoDecoderSpec->ReadHeader(inStream)); result = _zipCryptoDecoderSpec->ReadHeader(inStream);
} }
RINOK(filterStreamSpec->SetInStream(inStream));
inStreamReleaser.FilterCoder = filterStreamSpec;
inStreamNew = filterStream;
if (aesMode) if (result == S_OK)
{ {
if (!_aesDecoderSpec->CheckPasswordVerifyCode()) RINOK(filterStreamSpec->SetInStream(inStream));
return S_OK; inStreamReleaser.FilterCoder = filterStreamSpec;
inStreamNew = filterStream;
if (wzAesMode)
{
if (!_wzAesDecoderSpec->CheckPasswordVerifyCode())
result = S_FALSE;
}
} }
} }
else else
inStreamNew = inStream; inStreamNew = inStream;
result = coder->Code(inStreamNew, outStream, NULL, &item.UnPackSize, compressProgress); if (result == S_OK)
result = coder->Code(inStreamNew, outStream, NULL, &item.UnPackSize, compressProgress);
if (result == S_FALSE) if (result == S_FALSE)
return S_OK; return S_OK;
if (result == E_NOTIMPL) if (result == E_NOTIMPL)
@@ -711,10 +709,10 @@ HRESULT CZipDecoder::Decode(
bool authOk = true; bool authOk = true;
if (needCRC) if (needCRC)
crcOK = (outStreamSpec->GetCRC() == item.FileCRC); crcOK = (outStreamSpec->GetCRC() == item.FileCRC);
if (aesMode) if (wzAesMode)
{ {
inStream.Attach(archive.CreateLimitedStream(authenticationPos, NCrypto::NWzAES::kMacSize)); inStream.Attach(archive.CreateLimitedStream(authenticationPos, NCrypto::NWzAes::kMacSize));
if (_aesDecoderSpec->CheckMac(inStream, authOk) != S_OK) if (_wzAesDecoderSpec->CheckMac(inStream, authOk) != S_OK)
authOk = false; authOk = false;
} }

View File

@@ -55,6 +55,7 @@ private:
UInt32 m_NumMatchFinderCycles; UInt32 m_NumMatchFinderCycles;
bool m_NumMatchFinderCyclesDefined; bool m_NumMatchFinderCyclesDefined;
bool m_ForceAesMode;
bool m_IsAesMode; bool m_IsAesMode;
Byte m_AesKeyMode; Byte m_AesKeyMode;
@@ -78,6 +79,7 @@ private:
m_NumFastBytes = m_NumFastBytes =
m_NumMatchFinderCycles = 0xFFFFFFFF; m_NumMatchFinderCycles = 0xFFFFFFFF;
m_NumMatchFinderCyclesDefined = false; m_NumMatchFinderCyclesDefined = false;
m_ForceAesMode = false;
m_IsAesMode = false; m_IsAesMode = false;
m_AesKeyMode = 3; // aes-256 m_AesKeyMode = 3; // aes-256
m_WriteNtfsTimeExtra = false; m_WriteNtfsTimeExtra = false;

View File

@@ -1,22 +1,25 @@
// Zip/HandlerOut.cpp // ZipHandlerOut.cpp
#include "StdAfx.h" #include "StdAfx.h"
#include "ZipHandler.h"
#include "ZipUpdate.h"
#include "Common/StringConvert.h"
#include "Common/ComTry.h" #include "Common/ComTry.h"
#include "Common/StringConvert.h"
#include "Common/StringToInt.h" #include "Common/StringToInt.h"
#include "Windows/PropVariant.h" #include "Windows/PropVariant.h"
#include "Windows/Time.h" #include "Windows/Time.h"
#include "../../IPassword.h" #include "../../IPassword.h"
#include "../../Common/OutBuffer.h"
#include "../../Crypto/WzAes.h"
#include "../Common/ItemNameUtils.h" #include "../Common/ItemNameUtils.h"
#include "../Common/ParseProperties.h" #include "../Common/ParseProperties.h"
#include "../../Crypto/WzAES/WzAES.h"
#include "../../Common/OutBuffer.h" #include "ZipHandler.h"
#include "ZipUpdate.h"
using namespace NWindows; using namespace NWindows;
using namespace NCOM; using namespace NCOM;
@@ -95,6 +98,7 @@ STDMETHODIMP CHandler::UpdateItems(ISequentialOutStream *outStream, UInt32 numIt
{ {
COM_TRY_BEGIN2 COM_TRY_BEGIN2
CObjectVector<CUpdateItem> updateItems; CObjectVector<CUpdateItem> updateItems;
bool thereAreAesUpdates = false;
for (UInt32 i = 0; i < numItems; i++) for (UInt32 i = 0; i < numItems; i++)
{ {
CUpdateItem ui; CUpdateItem ui;
@@ -108,7 +112,11 @@ STDMETHODIMP CHandler::UpdateItems(ISequentialOutStream *outStream, UInt32 numIt
ui.NewData = IntToBool(newData); ui.NewData = IntToBool(newData);
ui.IndexInArchive = indexInArchive; ui.IndexInArchive = indexInArchive;
ui.IndexInClient = i; ui.IndexInClient = i;
// bool existInArchive = (indexInArchive != UInt32(-1)); bool existInArchive = (indexInArchive != UInt32(-1));
if (existInArchive && newData)
if (m_Items[indexInArchive].IsAesEncrypted())
thereAreAesUpdates = true;
if (IntToBool(newProperties)) if (IntToBool(newProperties))
{ {
UString name; UString name;
@@ -234,7 +242,6 @@ STDMETHODIMP CHandler::UpdateItems(ISequentialOutStream *outStream, UInt32 numIt
} }
CMyComPtr<ICryptoGetTextPassword2> getTextPassword; CMyComPtr<ICryptoGetTextPassword2> getTextPassword;
if (!getTextPassword)
{ {
CMyComPtr<IArchiveUpdateCallback> udateCallBack2(callback); CMyComPtr<IArchiveUpdateCallback> udateCallBack2(callback);
udateCallBack2.QueryInterface(IID_ICryptoGetTextPassword2, &getTextPassword); udateCallBack2.QueryInterface(IID_ICryptoGetTextPassword2, &getTextPassword);
@@ -249,16 +256,17 @@ STDMETHODIMP CHandler::UpdateItems(ISequentialOutStream *outStream, UInt32 numIt
options.PasswordIsDefined = IntToBool(passwordIsDefined); options.PasswordIsDefined = IntToBool(passwordIsDefined);
if (options.PasswordIsDefined) if (options.PasswordIsDefined)
{ {
options.IsAesMode = (m_ForceAesMode ? m_IsAesMode : thereAreAesUpdates);
options.AesKeyMode = m_AesKeyMode;
if (!IsAsciiString((const wchar_t *)password)) if (!IsAsciiString((const wchar_t *)password))
return E_INVALIDARG; return E_INVALIDARG;
if (m_IsAesMode) if (options.IsAesMode)
{ {
if (options.Password.Length() > NCrypto::NWzAES::kPasswordSizeMax) if (options.Password.Length() > NCrypto::NWzAes::kPasswordSizeMax)
return E_INVALIDARG; return E_INVALIDARG;
} }
options.Password = UnicodeStringToMultiByte((const wchar_t *)password, CP_OEMCP); options.Password = UnicodeStringToMultiByte((const wchar_t *)password, CP_OEMCP);
options.IsAesMode = m_IsAesMode;
options.AesKeyMode = m_AesKeyMode;
} }
} }
else else
@@ -419,9 +427,13 @@ STDMETHODIMP CHandler::SetProperties(const wchar_t **names, const PROPVARIANT *v
else else
return E_INVALIDARG; return E_INVALIDARG;
m_IsAesMode = true; m_IsAesMode = true;
m_ForceAesMode = true;
} }
else if (valueString == L"ZIPCRYPTO") else if (valueString == L"ZIPCRYPTO")
{
m_IsAesMode = false; m_IsAesMode = false;
m_ForceAesMode = true;
}
else else
return E_INVALIDARG; return E_INVALIDARG;
} }

View File

@@ -187,6 +187,7 @@ public:
bool IsEncrypted() const { return (Flags & NFileHeader::NFlags::kEncrypted) != 0; } bool IsEncrypted() const { return (Flags & NFileHeader::NFlags::kEncrypted) != 0; }
bool IsStrongEncrypted() const { return IsEncrypted() && (Flags & NFileHeader::NFlags::kStrongEncrypted) != 0; }; bool IsStrongEncrypted() const { return IsEncrypted() && (Flags & NFileHeader::NFlags::kStrongEncrypted) != 0; };
bool IsAesEncrypted() const { return IsEncrypted() && (IsStrongEncrypted() || CompressionMethod == NFileHeader::NCompressionMethod::kWzAES); };
bool IsLzmaEOS() const { return (Flags & NFileHeader::NFlags::kLzmaEOS) != 0; } bool IsLzmaEOS() const { return (Flags & NFileHeader::NFlags::kLzmaEOS) != 0; }

View File

@@ -2,27 +2,26 @@
#include "StdAfx.h" #include "StdAfx.h"
#include <stdio.h>
#include "ZipUpdate.h"
#include "ZipAddCommon.h"
#include "ZipOut.h"
#include "Common/Defs.h"
#include "Common/AutoPtr.h" #include "Common/AutoPtr.h"
#include "Common/Defs.h"
#include "Common/StringConvert.h" #include "Common/StringConvert.h"
#include "Windows/Defs.h" #include "Windows/Defs.h"
#include "Windows/Thread.h" #include "Windows/Thread.h"
#include "../../Common/CreateCoder.h"
#include "../../Common/LimitedStreams.h"
#include "../../Common/OutMemStream.h"
#include "../../Common/ProgressUtils.h" #include "../../Common/ProgressUtils.h"
#ifdef COMPRESS_MT #ifdef COMPRESS_MT
#include "../../Common/ProgressMt.h" #include "../../Common/ProgressMt.h"
#endif #endif
#include "../../Common/LimitedStreams.h"
#include "../../Common/OutMemStream.h"
#include "../../Common/CreateCoder.h"
#include "../../Compress/Copy/CopyCoder.h" #include "../../Compress/CopyCoder.h"
#include "ZipAddCommon.h"
#include "ZipOut.h"
#include "ZipUpdate.h"
using namespace NWindows; using namespace NWindows;
using namespace NSynchronization; using namespace NSynchronization;

View File

@@ -589,22 +589,6 @@ SOURCE=..\..\Common\LockedStream.h
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\..\Common\LSBFDecoder.cpp
# End Source File
# Begin Source File
SOURCE=..\..\Common\LSBFDecoder.h
# End Source File
# Begin Source File
SOURCE=..\..\Common\LSBFEncoder.cpp
# End Source File
# Begin Source File
SOURCE=..\..\Common\LSBFEncoder.h
# End Source File
# Begin Source File
SOURCE=..\..\Common\MemBlocks.cpp SOURCE=..\..\Common\MemBlocks.cpp
# End Source File # End Source File
# Begin Source File # Begin Source File
@@ -625,14 +609,6 @@ SOURCE=..\..\Common\MethodProps.h
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\..\Common\MSBFDecoder.h
# End Source File
# Begin Source File
SOURCE=..\..\Common\MSBFEncoder.h
# End Source File
# Begin Source File
SOURCE=..\..\Common\OffsetStream.cpp SOURCE=..\..\Common\OffsetStream.cpp
# End Source File # End Source File
# Begin Source File # Begin Source File
@@ -707,106 +683,20 @@ SOURCE=..\..\Common\VirtThread.h
# Begin Group "Compress" # Begin Group "Compress"
# PROP Default_Filter "" # PROP Default_Filter ""
# Begin Group "Branch"
# PROP Default_Filter ""
# Begin Source File
SOURCE=..\..\Compress\Branch\BCJ2Register.cpp
# End Source File
# Begin Source File
SOURCE=..\..\Compress\Branch\BCJRegister.cpp
# End Source File
# Begin Source File
SOURCE=..\..\Compress\Branch\BranchCoder.cpp
# End Source File
# Begin Source File
SOURCE=..\..\Compress\Branch\BranchCoder.h
# End Source File
# Begin Source File
SOURCE=..\..\Compress\Branch\BranchMisc.cpp
# End Source File
# Begin Source File
SOURCE=..\..\Compress\Branch\BranchMisc.h
# End Source File
# Begin Source File
SOURCE=..\..\Compress\Branch\BranchRegister.cpp
# End Source File
# Begin Source File
SOURCE=..\..\Compress\Branch\Coder.h
# End Source File
# Begin Source File
SOURCE=..\..\Compress\Branch\x86.cpp
!IF "$(CFG)" == "Alone - Win32 Release"
# ADD CPP /O2
# SUBTRACT CPP /YX /Yc /Yu
!ELSEIF "$(CFG)" == "Alone - Win32 Debug"
!ELSEIF "$(CFG)" == "Alone - Win32 ReleaseU"
# ADD CPP /O2
# SUBTRACT CPP /YX /Yc /Yu
!ELSEIF "$(CFG)" == "Alone - Win32 DebugU"
!ENDIF
# End Source File
# Begin Source File
SOURCE=..\..\Compress\Branch\x86.h
# End Source File
# Begin Source File
SOURCE=..\..\Compress\Branch\x86_2.cpp
!IF "$(CFG)" == "Alone - Win32 Release"
# ADD CPP /O2
# SUBTRACT CPP /YX /Yc /Yu
!ELSEIF "$(CFG)" == "Alone - Win32 Debug"
!ELSEIF "$(CFG)" == "Alone - Win32 ReleaseU"
# ADD CPP /O2
# SUBTRACT CPP /YX /Yc /Yu
!ELSEIF "$(CFG)" == "Alone - Win32 DebugU"
!ENDIF
# End Source File
# Begin Source File
SOURCE=..\..\Compress\Branch\x86_2.h
# End Source File
# End Group
# Begin Group "BZip2" # Begin Group "BZip2"
# PROP Default_Filter "" # PROP Default_Filter ""
# Begin Source File # Begin Source File
SOURCE=..\..\Compress\BZip2\BZip2CRC.cpp SOURCE=..\..\Compress\BZip2Crc.cpp
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\..\Compress\BZip2\BZip2CRC.h SOURCE=..\..\Compress\BZip2Crc.h
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\..\Compress\BZip2\BZip2Decoder.cpp SOURCE=..\..\Compress\BZip2Decoder.cpp
!IF "$(CFG)" == "Alone - Win32 Release" !IF "$(CFG)" == "Alone - Win32 Release"
@@ -827,11 +717,11 @@ SOURCE=..\..\Compress\BZip2\BZip2Decoder.cpp
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\..\Compress\BZip2\BZip2Decoder.h SOURCE=..\..\Compress\BZip2Decoder.h
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\..\Compress\BZip2\BZip2Encoder.cpp SOURCE=..\..\Compress\BZip2Encoder.cpp
!IF "$(CFG)" == "Alone - Win32 Release" !IF "$(CFG)" == "Alone - Win32 Release"
@@ -852,11 +742,11 @@ SOURCE=..\..\Compress\BZip2\BZip2Encoder.cpp
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\..\Compress\BZip2\BZip2Encoder.h SOURCE=..\..\Compress\BZip2Encoder.h
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\..\Compress\BZip2\BZip2Register.cpp SOURCE=..\..\Compress\BZip2Register.cpp
# End Source File # End Source File
# End Group # End Group
# Begin Group "Copy" # Begin Group "Copy"
@@ -864,15 +754,15 @@ SOURCE=..\..\Compress\BZip2\BZip2Register.cpp
# PROP Default_Filter "" # PROP Default_Filter ""
# Begin Source File # Begin Source File
SOURCE=..\..\Compress\Copy\CopyCoder.cpp SOURCE=..\..\Compress\CopyCoder.cpp
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\..\Compress\Copy\CopyCoder.h SOURCE=..\..\Compress\CopyCoder.h
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\..\Compress\Copy\CopyRegister.cpp SOURCE=..\..\Compress\CopyRegister.cpp
# End Source File # End Source File
# End Group # End Group
# Begin Group "Deflate" # Begin Group "Deflate"
@@ -880,15 +770,15 @@ SOURCE=..\..\Compress\Copy\CopyRegister.cpp
# PROP Default_Filter "" # PROP Default_Filter ""
# Begin Source File # Begin Source File
SOURCE=..\..\Compress\Deflate\Deflate64Register.cpp SOURCE=..\..\Compress\Deflate64Register.cpp
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\..\Compress\Deflate\DeflateConst.h SOURCE=..\..\Compress\DeflateConst.h
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\..\Compress\Deflate\DeflateDecoder.cpp SOURCE=..\..\Compress\DeflateDecoder.cpp
!IF "$(CFG)" == "Alone - Win32 Release" !IF "$(CFG)" == "Alone - Win32 Release"
@@ -909,11 +799,11 @@ SOURCE=..\..\Compress\Deflate\DeflateDecoder.cpp
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\..\Compress\Deflate\DeflateDecoder.h SOURCE=..\..\Compress\DeflateDecoder.h
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\..\Compress\Deflate\DeflateEncoder.cpp SOURCE=..\..\Compress\DeflateEncoder.cpp
!IF "$(CFG)" == "Alone - Win32 Release" !IF "$(CFG)" == "Alone - Win32 Release"
@@ -934,15 +824,15 @@ SOURCE=..\..\Compress\Deflate\DeflateEncoder.cpp
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\..\Compress\Deflate\DeflateEncoder.h SOURCE=..\..\Compress\DeflateEncoder.h
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\..\Compress\Deflate\DeflateExtConst.h SOURCE=..\..\Compress\DeflateExtConst.h
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\..\Compress\Deflate\DeflateRegister.cpp SOURCE=..\..\Compress\DeflateRegister.cpp
# End Source File # End Source File
# End Group # End Group
# Begin Group "Huffman" # Begin Group "Huffman"
@@ -950,7 +840,7 @@ SOURCE=..\..\Compress\Deflate\DeflateRegister.cpp
# PROP Default_Filter "" # PROP Default_Filter ""
# Begin Source File # Begin Source File
SOURCE=..\..\Compress\Huffman\HuffmanDecoder.h SOURCE=..\..\Compress\HuffmanDecoder.h
# End Source File # End Source File
# End Group # End Group
# Begin Group "Implode" # Begin Group "Implode"
@@ -958,82 +848,19 @@ SOURCE=..\..\Compress\Huffman\HuffmanDecoder.h
# PROP Default_Filter "" # PROP Default_Filter ""
# Begin Source File # Begin Source File
SOURCE=..\..\Compress\Implode\ImplodeDecoder.cpp SOURCE=..\..\Compress\ImplodeDecoder.cpp
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\..\Compress\Implode\ImplodeDecoder.h SOURCE=..\..\Compress\ImplodeDecoder.h
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\..\Compress\Implode\ImplodeHuffmanDecoder.cpp SOURCE=..\..\Compress\ImplodeHuffmanDecoder.cpp
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\..\Compress\Implode\ImplodeHuffmanDecoder.h SOURCE=..\..\Compress\ImplodeHuffmanDecoder.h
# End Source File
# End Group
# Begin Group "LZ"
# PROP Default_Filter ""
# Begin Group "MT"
# PROP Default_Filter ""
# End Group
# Begin Group "HC"
# PROP Default_Filter ""
# Begin Source File
SOURCE=..\..\Compress\LZ\HashChain\HC.h
# End Source File
# Begin Source File
SOURCE=..\..\Compress\LZ\HashChain\HC2.h
# End Source File
# Begin Source File
SOURCE=..\..\Compress\LZ\HashChain\HC3.h
# End Source File
# Begin Source File
SOURCE=..\..\Compress\LZ\HashChain\HC4.h
# End Source File
# Begin Source File
SOURCE=..\..\Compress\LZ\HashChain\HC4b.h
# End Source File
# Begin Source File
SOURCE=..\..\Compress\LZ\HashChain\HCMain.h
# End Source File
# End Group
# Begin Source File
SOURCE=..\..\Compress\LZ\IMatchFinder.h
# End Source File
# Begin Source File
SOURCE=..\..\Compress\LZ\LZOutWindow.cpp
!IF "$(CFG)" == "Alone - Win32 Release"
# ADD CPP /O1
!ELSEIF "$(CFG)" == "Alone - Win32 Debug"
!ELSEIF "$(CFG)" == "Alone - Win32 ReleaseU"
# ADD CPP /O1
!ELSEIF "$(CFG)" == "Alone - Win32 DebugU"
!ENDIF
# End Source File
# Begin Source File
SOURCE=..\..\Compress\LZ\LZOutWindow.h
# End Source File # End Source File
# End Group # End Group
# Begin Group "LZMA" # Begin Group "LZMA"
@@ -1041,11 +868,11 @@ SOURCE=..\..\Compress\LZ\LZOutWindow.h
# PROP Default_Filter "" # PROP Default_Filter ""
# Begin Source File # Begin Source File
SOURCE=..\..\Compress\LZMA\LZMA.h SOURCE=..\..\Compress\Lzma.h
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\..\Compress\LZMA\LZMADecoder.cpp SOURCE=..\..\Compress\LzmaDecoder.cpp
!IF "$(CFG)" == "Alone - Win32 Release" !IF "$(CFG)" == "Alone - Win32 Release"
@@ -1066,11 +893,11 @@ SOURCE=..\..\Compress\LZMA\LZMADecoder.cpp
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\..\Compress\LZMA\LZMADecoder.h SOURCE=..\..\Compress\LzmaDecoder.h
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\..\Compress\LZMA\LZMAEncoder.cpp SOURCE=..\..\Compress\LzmaEncoder.cpp
!IF "$(CFG)" == "Alone - Win32 Release" !IF "$(CFG)" == "Alone - Win32 Release"
@@ -1091,11 +918,11 @@ SOURCE=..\..\Compress\LZMA\LZMAEncoder.cpp
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\..\Compress\LZMA\LZMAEncoder.h SOURCE=..\..\Compress\LzmaEncoder.h
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\..\Compress\LZMA\LZMARegister.cpp SOURCE=..\..\Compress\LzmaRegister.cpp
# End Source File # End Source File
# End Group # End Group
# Begin Group "PPMd" # Begin Group "PPMd"
@@ -1103,15 +930,15 @@ SOURCE=..\..\Compress\LZMA\LZMARegister.cpp
# PROP Default_Filter "" # PROP Default_Filter ""
# Begin Source File # Begin Source File
SOURCE=..\..\Compress\PPMD\PPMDContext.h SOURCE=..\..\Compress\PpmdContext.h
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\..\Compress\PPMD\PPMDDecode.h SOURCE=..\..\Compress\PpmdDecode.h
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\..\Compress\PPMD\PPMDDecoder.cpp SOURCE=..\..\Compress\PpmdDecoder.cpp
!IF "$(CFG)" == "Alone - Win32 Release" !IF "$(CFG)" == "Alone - Win32 Release"
@@ -1132,15 +959,15 @@ SOURCE=..\..\Compress\PPMD\PPMDDecoder.cpp
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\..\Compress\PPMD\PPMDDecoder.h SOURCE=..\..\Compress\PpmdDecoder.h
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\..\Compress\PPMD\PPMDEncode.h SOURCE=..\..\Compress\PpmdEncode.h
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\..\Compress\PPMD\PPMDEncoder.cpp SOURCE=..\..\Compress\PpmdEncoder.cpp
!IF "$(CFG)" == "Alone - Win32 Release" !IF "$(CFG)" == "Alone - Win32 Release"
@@ -1161,19 +988,19 @@ SOURCE=..\..\Compress\PPMD\PPMDEncoder.cpp
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\..\Compress\PPMD\PPMDEncoder.h SOURCE=..\..\Compress\PpmdEncoder.h
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\..\Compress\PPMD\PPMDRegister.cpp SOURCE=..\..\Compress\PpmdRegister.cpp
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\..\Compress\PPMD\PPMDSubAlloc.h SOURCE=..\..\Compress\PpmdSubAlloc.h
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\..\Compress\PPMD\PPMDType.h SOURCE=..\..\Compress\PpmdType.h
# End Source File # End Source File
# End Group # End Group
# Begin Group "RangeCoder" # Begin Group "RangeCoder"
@@ -1181,38 +1008,19 @@ SOURCE=..\..\Compress\PPMD\PPMDType.h
# PROP Default_Filter "" # PROP Default_Filter ""
# Begin Source File # Begin Source File
SOURCE=..\..\Compress\RangeCoder\RangeCoder.h SOURCE=..\..\Compress\RangeCoder.h
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\..\Compress\RangeCoder\RangeCoderBit.cpp SOURCE=..\..\Compress\RangeCoderBit.h
!IF "$(CFG)" == "Alone - Win32 Release"
# ADD CPP /O1
!ELSEIF "$(CFG)" == "Alone - Win32 Debug"
!ELSEIF "$(CFG)" == "Alone - Win32 ReleaseU"
# ADD CPP /O1
!ELSEIF "$(CFG)" == "Alone - Win32 DebugU"
!ENDIF
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\..\Compress\RangeCoder\RangeCoderBit.h SOURCE=..\..\Compress\RangeCoderBitTree.h
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\..\Compress\RangeCoder\RangeCoderBitTree.h SOURCE=..\..\Compress\RangeCoderOpt.h
# End Source File
# Begin Source File
SOURCE=..\..\Compress\RangeCoder\RangeCoderOpt.h
# End Source File # End Source File
# End Group # End Group
# Begin Group "Shrink" # Begin Group "Shrink"
@@ -1220,11 +1028,11 @@ SOURCE=..\..\Compress\RangeCoder\RangeCoderOpt.h
# PROP Default_Filter "" # PROP Default_Filter ""
# Begin Source File # Begin Source File
SOURCE=..\..\Compress\Shrink\ShrinkDecoder.cpp SOURCE=..\..\Compress\ShrinkDecoder.cpp
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\..\Compress\Shrink\ShrinkDecoder.h SOURCE=..\..\Compress\ShrinkDecoder.h
# End Source File # End Source File
# End Group # End Group
# Begin Group "Z" # Begin Group "Z"
@@ -1232,11 +1040,11 @@ SOURCE=..\..\Compress\Shrink\ShrinkDecoder.h
# PROP Default_Filter "" # PROP Default_Filter ""
# Begin Source File # Begin Source File
SOURCE=..\..\Compress\Z\ZDecoder.cpp SOURCE=..\..\Compress\ZDecoder.cpp
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\..\Compress\Z\ZDecoder.h SOURCE=..\..\Compress\ZDecoder.h
# End Source File # End Source File
# End Group # End Group
# Begin Group "BWT" # Begin Group "BWT"
@@ -1244,7 +1052,7 @@ SOURCE=..\..\Compress\Z\ZDecoder.h
# PROP Default_Filter "" # PROP Default_Filter ""
# Begin Source File # Begin Source File
SOURCE=..\..\Compress\BWT\Mtf8.h SOURCE=..\..\Compress\Mtf8.h
# End Source File # End Source File
# End Group # End Group
# Begin Group "LZX" # Begin Group "LZX"
@@ -1252,23 +1060,23 @@ SOURCE=..\..\Compress\BWT\Mtf8.h
# PROP Default_Filter "" # PROP Default_Filter ""
# Begin Source File # Begin Source File
SOURCE=..\..\Compress\Lzx\Lzx.h SOURCE=..\..\Compress\Lzx.h
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\..\Compress\Lzx\Lzx86Converter.cpp SOURCE=..\..\Compress\Lzx86Converter.cpp
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\..\Compress\Lzx\Lzx86Converter.h SOURCE=..\..\Compress\Lzx86Converter.h
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\..\Compress\Lzx\LzxDecoder.cpp SOURCE=..\..\Compress\LzxDecoder.cpp
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\..\Compress\Lzx\LzxDecoder.h SOURCE=..\..\Compress\LzxDecoder.h
# End Source File # End Source File
# End Group # End Group
# Begin Group "Quantum" # Begin Group "Quantum"
@@ -1276,11 +1084,11 @@ SOURCE=..\..\Compress\Lzx\LzxDecoder.h
# PROP Default_Filter "" # PROP Default_Filter ""
# Begin Source File # Begin Source File
SOURCE=..\..\Compress\Quantum\QuantumDecoder.cpp SOURCE=..\..\Compress\QuantumDecoder.cpp
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\..\Compress\Quantum\QuantumDecoder.h SOURCE=..\..\Compress\QuantumDecoder.h
# End Source File # End Source File
# End Group # End Group
# Begin Group "LZMA_Alone" # Begin Group "LZMA_Alone"
@@ -1303,6 +1111,90 @@ SOURCE=..\..\Compress\LZMA_Alone\LzmaBenchCon.cpp
SOURCE=..\..\Compress\LZMA_Alone\LzmaBenchCon.h SOURCE=..\..\Compress\LZMA_Alone\LzmaBenchCon.h
# End Source File # End Source File
# End Group # End Group
# Begin Source File
SOURCE=..\..\Compress\Bcj2Coder.cpp
# End Source File
# Begin Source File
SOURCE=..\..\Compress\Bcj2Coder.h
# End Source File
# Begin Source File
SOURCE=..\..\Compress\Bcj2Register.cpp
# End Source File
# Begin Source File
SOURCE=..\..\Compress\BcjCoder.cpp
# End Source File
# Begin Source File
SOURCE=..\..\Compress\BcjCoder.h
# End Source File
# Begin Source File
SOURCE=..\..\Compress\BcjRegister.cpp
# End Source File
# Begin Source File
SOURCE=..\..\Compress\BitlDecoder.cpp
# End Source File
# Begin Source File
SOURCE=..\..\Compress\BitlDecoder.h
# End Source File
# Begin Source File
SOURCE=..\..\Compress\BitlEncoder.h
# End Source File
# Begin Source File
SOURCE=..\..\Compress\BitmDecoder.h
# End Source File
# Begin Source File
SOURCE=..\..\Compress\BitmEncoder.h
# End Source File
# Begin Source File
SOURCE=..\..\Compress\BranchCoder.cpp
# End Source File
# Begin Source File
SOURCE=..\..\Compress\BranchCoder.h
# End Source File
# Begin Source File
SOURCE=..\..\Compress\BranchMisc.cpp
# End Source File
# Begin Source File
SOURCE=..\..\Compress\BranchMisc.h
# End Source File
# Begin Source File
SOURCE=..\..\Compress\BranchRegister.cpp
# End Source File
# Begin Source File
SOURCE=..\..\Compress\ByteSwap.cpp
# End Source File
# Begin Source File
SOURCE=..\..\Compress\ByteSwap.h
# End Source File
# Begin Source File
SOURCE=..\..\Compress\ByteSwapRegister.cpp
# End Source File
# Begin Source File
SOURCE=..\..\Compress\LzOutWindow.cpp
# End Source File
# Begin Source File
SOURCE=..\..\Compress\LzOutWindow.h
# End Source File
# End Group # End Group
# Begin Group "Archive" # Begin Group "Archive"
@@ -1990,13 +1882,146 @@ SOURCE=..\..\UI\Common\WorkDir.h
# End Group # End Group
# Begin Group "Crypto" # Begin Group "Crypto"
# PROP Default_Filter ""
# Begin Group "Zip Crypto"
# PROP Default_Filter "" # PROP Default_Filter ""
# Begin Source File # Begin Source File
SOURCE=..\..\Crypto\Zip\ZipCipher.cpp SOURCE=..\..\Crypto\7zAes.cpp
!IF "$(CFG)" == "Alone - Win32 Release"
# ADD CPP /O2
# SUBTRACT CPP /YX /Yc /Yu
!ELSEIF "$(CFG)" == "Alone - Win32 Debug"
!ELSEIF "$(CFG)" == "Alone - Win32 ReleaseU"
# ADD CPP /O2
# SUBTRACT CPP /YX /Yc /Yu
!ELSEIF "$(CFG)" == "Alone - Win32 DebugU"
!ENDIF
# End Source File
# Begin Source File
SOURCE=..\..\Crypto\7zAes.h
# End Source File
# Begin Source File
SOURCE=..\..\Crypto\7zAesRegister.cpp
# End Source File
# Begin Source File
SOURCE=..\..\Crypto\HmacSha1.cpp
!IF "$(CFG)" == "Alone - Win32 Release"
# ADD CPP /O2
# SUBTRACT CPP /YX /Yc /Yu
!ELSEIF "$(CFG)" == "Alone - Win32 Debug"
!ELSEIF "$(CFG)" == "Alone - Win32 ReleaseU"
!ELSEIF "$(CFG)" == "Alone - Win32 DebugU"
!ENDIF
# End Source File
# Begin Source File
SOURCE=..\..\Crypto\HmacSha1.h
# End Source File
# Begin Source File
SOURCE=..\..\Crypto\MyAes.cpp
!IF "$(CFG)" == "Alone - Win32 Release"
# ADD CPP /O2
# SUBTRACT CPP /YX /Yc /Yu
!ELSEIF "$(CFG)" == "Alone - Win32 Debug"
!ELSEIF "$(CFG)" == "Alone - Win32 ReleaseU"
# ADD CPP /O2
# SUBTRACT CPP /YX /Yc /Yu
!ELSEIF "$(CFG)" == "Alone - Win32 DebugU"
!ENDIF
# End Source File
# Begin Source File
SOURCE=..\..\Crypto\MyAes.h
# End Source File
# Begin Source File
SOURCE=..\..\Crypto\Pbkdf2HmacSha1.cpp
!IF "$(CFG)" == "Alone - Win32 Release"
# ADD CPP /O2
# SUBTRACT CPP /YX /Yc /Yu
!ELSEIF "$(CFG)" == "Alone - Win32 Debug"
!ELSEIF "$(CFG)" == "Alone - Win32 ReleaseU"
!ELSEIF "$(CFG)" == "Alone - Win32 DebugU"
!ENDIF
# End Source File
# Begin Source File
SOURCE=..\..\Crypto\Pbkdf2HmacSha1.h
# End Source File
# Begin Source File
SOURCE=..\..\Crypto\RandGen.cpp
# End Source File
# Begin Source File
SOURCE=..\..\Crypto\RandGen.h
# End Source File
# Begin Source File
SOURCE=..\..\Crypto\Sha1.cpp
!IF "$(CFG)" == "Alone - Win32 Release"
# ADD CPP /O2
# SUBTRACT CPP /YX /Yc /Yu
!ELSEIF "$(CFG)" == "Alone - Win32 Debug"
!ELSEIF "$(CFG)" == "Alone - Win32 ReleaseU"
!ELSEIF "$(CFG)" == "Alone - Win32 DebugU"
!ENDIF
# End Source File
# Begin Source File
SOURCE=..\..\Crypto\Sha1.h
# End Source File
# Begin Source File
SOURCE=..\..\Crypto\WzAes.cpp
# End Source File
# Begin Source File
SOURCE=..\..\Crypto\WzAes.h
# End Source File
# Begin Source File
SOURCE=..\..\Crypto\ZipCrypto.cpp
!IF "$(CFG)" == "Alone - Win32 Release" !IF "$(CFG)" == "Alone - Win32 Release"
@@ -2015,185 +2040,17 @@ SOURCE=..\..\Crypto\Zip\ZipCipher.cpp
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\..\Crypto\Zip\ZipCipher.h SOURCE=..\..\Crypto\ZipCrypto.h
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\..\Crypto\Zip\ZipCrypto.cpp SOURCE=..\..\Crypto\ZipStrong.cpp
!IF "$(CFG)" == "Alone - Win32 Release"
# ADD CPP /O1
!ELSEIF "$(CFG)" == "Alone - Win32 Debug"
!ELSEIF "$(CFG)" == "Alone - Win32 ReleaseU"
# ADD CPP /O1
!ELSEIF "$(CFG)" == "Alone - Win32 DebugU"
!ENDIF
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\..\Crypto\Zip\ZipCrypto.h SOURCE=..\..\Crypto\ZipStrong.h
# End Source File # End Source File
# End Group # End Group
# Begin Group "AES"
# PROP Default_Filter ""
# Begin Source File
SOURCE=..\..\Crypto\AES\MyAES.cpp
!IF "$(CFG)" == "Alone - Win32 Release"
# ADD CPP /O2
# SUBTRACT CPP /YX /Yc /Yu
!ELSEIF "$(CFG)" == "Alone - Win32 Debug"
!ELSEIF "$(CFG)" == "Alone - Win32 ReleaseU"
# ADD CPP /O2
# SUBTRACT CPP /YX /Yc /Yu
!ELSEIF "$(CFG)" == "Alone - Win32 DebugU"
!ENDIF
# End Source File
# Begin Source File
SOURCE=..\..\Crypto\AES\MyAES.h
# End Source File
# End Group
# Begin Group "7z AES"
# PROP Default_Filter ""
# Begin Source File
SOURCE=..\..\Crypto\7zAES\7zAES.cpp
!IF "$(CFG)" == "Alone - Win32 Release"
# ADD CPP /O2
# SUBTRACT CPP /YX /Yc /Yu
!ELSEIF "$(CFG)" == "Alone - Win32 Debug"
!ELSEIF "$(CFG)" == "Alone - Win32 ReleaseU"
# ADD CPP /O2
# SUBTRACT CPP /YX /Yc /Yu
!ELSEIF "$(CFG)" == "Alone - Win32 DebugU"
!ENDIF
# End Source File
# Begin Source File
SOURCE=..\..\Crypto\7zAES\7zAES.h
# End Source File
# Begin Source File
SOURCE=..\..\Crypto\7zAES\7zAESRegister.cpp
# End Source File
# End Group
# Begin Group "WzAES"
# PROP Default_Filter ""
# Begin Source File
SOURCE=..\..\Crypto\WzAES\WzAES.cpp
# End Source File
# Begin Source File
SOURCE=..\..\Crypto\WzAES\WzAES.h
# End Source File
# End Group
# Begin Group "Hash"
# PROP Default_Filter ""
# Begin Source File
SOURCE=..\..\Crypto\Hash\HmacSha1.cpp
!IF "$(CFG)" == "Alone - Win32 Release"
# ADD CPP /O2
# SUBTRACT CPP /YX /Yc /Yu
!ELSEIF "$(CFG)" == "Alone - Win32 Debug"
!ELSEIF "$(CFG)" == "Alone - Win32 ReleaseU"
!ELSEIF "$(CFG)" == "Alone - Win32 DebugU"
!ENDIF
# End Source File
# Begin Source File
SOURCE=..\..\Crypto\Hash\HmacSha1.h
# End Source File
# Begin Source File
SOURCE=..\..\Crypto\Hash\Pbkdf2HmacSha1.cpp
!IF "$(CFG)" == "Alone - Win32 Release"
# ADD CPP /O2
# SUBTRACT CPP /YX /Yc /Yu
!ELSEIF "$(CFG)" == "Alone - Win32 Debug"
!ELSEIF "$(CFG)" == "Alone - Win32 ReleaseU"
!ELSEIF "$(CFG)" == "Alone - Win32 DebugU"
!ENDIF
# End Source File
# Begin Source File
SOURCE=..\..\Crypto\Hash\Pbkdf2HmacSha1.h
# End Source File
# Begin Source File
SOURCE=..\..\Crypto\Hash\RandGen.cpp
# End Source File
# Begin Source File
SOURCE=..\..\Crypto\Hash\RandGen.h
# End Source File
# Begin Source File
SOURCE=..\..\Crypto\Hash\Sha1.cpp
!IF "$(CFG)" == "Alone - Win32 Release"
# ADD CPP /O2
# SUBTRACT CPP /YX /Yc /Yu
!ELSEIF "$(CFG)" == "Alone - Win32 Debug"
!ELSEIF "$(CFG)" == "Alone - Win32 ReleaseU"
!ELSEIF "$(CFG)" == "Alone - Win32 DebugU"
!ENDIF
# End Source File
# Begin Source File
SOURCE=..\..\Crypto\Hash\Sha1.h
# End Source File
# End Group
# End Group
# Begin Group "7-zip" # Begin Group "7-zip"
# PROP Default_Filter "" # PROP Default_Filter ""

View File

@@ -58,8 +58,6 @@ WIN_OBJS = \
$O\InOutTempBuffer.obj \ $O\InOutTempBuffer.obj \
$O\LimitedStreams.obj \ $O\LimitedStreams.obj \
$O\LockedStream.obj \ $O\LockedStream.obj \
$O\LSBFDecoder.obj \
$O\LSBFEncoder.obj \
$O\MemBlocks.obj \ $O\MemBlocks.obj \
$O\MethodId.obj \ $O\MethodId.obj \
$O\MethodProps.obj \ $O\MethodProps.obj \
@@ -182,88 +180,57 @@ ZIP_OBJS = \
$O\ZipRegister.obj \ $O\ZipRegister.obj \
BRANCH_OPT_OBJS = \ COMPRESS_OBJS = \
$O\x86.obj \ $O\Bcj2Coder.obj \
$O\x86_2.obj \ $O\Bcj2Register.obj \
$O\BcjCoder.obj \
$O\BcjRegister.obj \
$O\BitlDecoder.obj \
$O\BranchCoder.obj \ $O\BranchCoder.obj \
$O\BranchMisc.obj \ $O\BranchMisc.obj \
$O\BranchRegister.obj \ $O\BranchRegister.obj \
$O\BCJRegister.obj \
$O\BCJ2Register.obj \
SWAP_OPT_OBJS = \
$O\ByteSwap.obj \ $O\ByteSwap.obj \
$O\ByteSwapRegister.obj \ $O\ByteSwapRegister.obj \
BZIP2_OBJS = \
$O\BZip2CRC.obj \ $O\BZip2CRC.obj \
$O\BZip2Register.obj \
BZIP2_OPT_OBJS = \
$O\BZip2Decoder.obj \ $O\BZip2Decoder.obj \
$O\BZip2Encoder.obj \ $O\BZip2Encoder.obj \
$O\BZip2Register.obj \
COPY_OBJS = \
$O\CopyCoder.obj \ $O\CopyCoder.obj \
$O\CopyRegister.obj \ $O\CopyRegister.obj \
$O\Deflate64Register.obj \
DEFLATE_OPT_OBJS = \
$O\DeflateDecoder.obj \ $O\DeflateDecoder.obj \
$O\DeflateEncoder.obj \ $O\DeflateEncoder.obj \
$O\DeflateRegister.obj \ $O\DeflateRegister.obj \
$O\Deflate64Register.obj \ $O\ImplodeDecoder.obj \
$O\ImplodeHuffmanDecoder.obj \
LZ_OBJS = \ $O\LzmaDecoder.obj \
$O\LzmaEncoder.obj \
$O\LzmaRegister.obj \
$O\LzOutWindow.obj \ $O\LzOutWindow.obj \
$O\Lzx86Converter.obj \
LZMA_OPT_OBJS = \ $O\LzxDecoder.obj \
$O\LZMADecoder.obj \ $O\PpmdDecoder.obj \
$O\LZMAEncoder.obj \ $O\PpmdEncoder.obj \
$O\LZMARegister.obj \ $O\PpmdRegister.obj \
$O\QuantumDecoder.obj \
$O\ShrinkDecoder.obj \
$O\ZDecoder.obj \
LZMA_BENCH_OBJS = \ LZMA_BENCH_OBJS = \
$O\LzmaBench.obj \ $O\LzmaBench.obj \
$O\LzmaBenchCon.obj \ $O\LzmaBenchCon.obj \
LZX_OBJS = \ CRYPTO_OBJS = \
$O\LzxDecoder.obj \ $O\7zAes.obj \
$O\Lzx86Converter.obj \ $O\7zAesRegister.obj \
IMPLODE_OBJS = \
$O\ImplodeDecoder.obj \
$O\ImplodeHuffmanDecoder.obj \
PPMD_OPT_OBJS = \
$O\PPMDDecoder.obj \
$O\PPMDEncoder.obj \
$O\PPMDRegister.obj \
SHRINK_OBJS = \
$O\ShrinkDecoder.obj \
COMPRESS_Z_OBJS = \
$O\ZDecoder.obj \
7ZAES_OPT_OBJS = \
$O\7zAES.obj \
$O\7zAESRegister.obj \
AES_OPT_OBJS = \
$O\MyAES.obj \
CRYPTO_HASH_OBJS = \
$O\HmacSha1.obj \ $O\HmacSha1.obj \
$O\MyAes.obj \
$O\Pbkdf2HmacSha1.obj \ $O\Pbkdf2HmacSha1.obj \
$O\RandGen.obj \ $O\RandGen.obj \
$O\Sha1.obj \ $O\Sha1.obj \
$O\WzAes.obj \
CRYPTO_WZAES_OBJS = \
$O\WzAES.obj \
CRYPTO_ZIP_OBJS = \
$O\ZipCipher.obj \
$O\ZipCrypto.obj \ $O\ZipCrypto.obj \
$O\ZipStrong.obj \
C_OBJS = \ C_OBJS = \
$O\Alloc.obj \ $O\Alloc.obj \
@@ -301,28 +268,10 @@ OBJS = \
$(SPLIT_OBJS) \ $(SPLIT_OBJS) \
$(TAR_OBJS) \ $(TAR_OBJS) \
$(ZIP_OBJS) \ $(ZIP_OBJS) \
$(BZIP2_OBJS) \ $(COMPRESS_OBJS) \
$(BZIP2_OPT_OBJS) \
$(BRANCH_OPT_OBJS) \
$(SWAP_OPT_OBJS) \
$(COPY_OBJS) \
$(DEFLATE_OPT_OBJS) \
$(IMPLODE_OBJS) \
$(LZ_OBJS) \
$(LZMA_OPT_OBJS) \
$(LZMA_BENCH_OBJS) \ $(LZMA_BENCH_OBJS) \
$(LZX_OBJS) \ $(CRYPTO_OBJS) \
$(PPMD_OPT_OBJS) \
$(SHRINK_OBJS) \
$(COMPRESS_Z_OBJS) \
$(C_OBJS) \ $(C_OBJS) \
$O\RangeCoderBit.obj \
$(7ZAES_OPT_OBJS) \
$(AES_OPT_OBJS) \
$(CRYPTO_HASH_OBJS) \
$(CRYPTO_ZIP_OBJS) \
$(CRYPTO_WZAES_OBJS) \
$O\QuantumDecoder.obj \
$(CRC_OBJS) \ $(CRC_OBJS) \
$O\resource.res $O\resource.res
@@ -362,50 +311,13 @@ $(TAR_OBJS): ../../Archive/Tar/$(*B).cpp
$(ZIP_OBJS): ../../Archive/Zip/$(*B).cpp $(ZIP_OBJS): ../../Archive/Zip/$(*B).cpp
$(COMPL) $(COMPL)
$(BRANCH_OPT_OBJS): ../../Compress/Branch/$(*B).cpp $(COMPRESS_OBJS): ../../Compress/$(*B).cpp
$(COMPL_O2)
$(SWAP_OPT_OBJS): ../../Compress/ByteSwap/$(*B).cpp
$(COMPL_O2)
$(BZIP2_OBJS): ../../Compress/BZip2/$(*B).cpp
$(COMPL)
$(BZIP2_OPT_OBJS): ../../Compress/BZip2/$(*B).cpp
$(COMPL_O2)
$(COPY_OBJS): ../../Compress/Copy/$(*B).cpp
$(COMPL)
$(DEFLATE_OPT_OBJS): ../../Compress/Deflate/$(*B).cpp
$(COMPL_O2)
$(IMPLODE_OBJS): ../../Compress/Implode/$(*B).cpp
$(COMPL)
$(LZ_OBJS): ../../Compress/LZ/$(*B).cpp
$(COMPL_O2)
$(LZMA_OPT_OBJS): ../../Compress/LZMA/$(*B).cpp
$(COMPL_O2) $(COMPL_O2)
$(LZMA_BENCH_OBJS): ../../Compress/LZMA_Alone/$(*B).cpp $(LZMA_BENCH_OBJS): ../../Compress/LZMA_Alone/$(*B).cpp
$(COMPL) $(COMPL)
$(LZX_OBJS): ../../Compress/Lzx/$(*B).cpp $(CRYPTO_OBJS): ../../Crypto/$(*B).cpp
$(COMPL_O2)
$(PPMD_OPT_OBJS): ../../Compress/PPMD/$(*B).cpp
$(COMPL_O2)
$(SHRINK_OBJS): ../../Compress/Shrink/$(*B).cpp
$(COMPL)
$(COMPRESS_Z_OBJS): ../../Compress/Z/$(*B).cpp
$(COMPL)
$O\RangeCoderBit.obj: ../../Compress/RangeCoder/$(*B).cpp
$(COMPL)
$O\QuantumDecoder.obj: ../../Compress/Quantum/$(*B).cpp
$(COMPL)
$(AES_OPT_OBJS): ../../Crypto/AES/$(*B).cpp
$(COMPL_O2)
$(7ZAES_OPT_OBJS): ../../Crypto/7zAES/$(*B).cpp
$(COMPL_O2)
$(CRYPTO_HASH_OBJS): ../../Crypto/Hash/$(*B).cpp
$(COMPL_O2)
$(CRYPTO_ZIP_OBJS): ../../Crypto/Zip/$(*B).cpp
$(COMPL)
$(CRYPTO_WZAES_OBJS): ../../Crypto/WzAES/$(*B).cpp
$(COMPL_O2) $(COMPL_O2)
$(C_OBJS): ../../../../C/$(*B).c $(C_OBJS): ../../../../C/$(*B).c

View File

@@ -132,27 +132,21 @@ SPLIT_OBJS = \
$O\SplitHandlerOut.obj \ $O\SplitHandlerOut.obj \
$O\SplitRegister.obj \ $O\SplitRegister.obj \
BRANCH_OPT_OBJS = \ COMPRESS_OBJS = \
$O\x86.obj \ $O\Bcj2Coder.obj \
$O\x86_2.obj \ $O\Bcj2Register.obj \
$O\BcjCoder.obj \
$O\BcjRegister.obj \
$O\BranchCoder.obj \ $O\BranchCoder.obj \
$O\BranchMisc.obj \ $O\BranchMisc.obj \
$O\BranchRegister.obj \ $O\BranchRegister.obj \
$O\BCJRegister.obj \
$O\BCJ2Register.obj \
SWAP_OPT_OBJS = \
$O\ByteSwap.obj \ $O\ByteSwap.obj \
$O\ByteSwapRegister.obj \ $O\ByteSwapRegister.obj \
COPY_OBJS = \
$O\CopyCoder.obj \ $O\CopyCoder.obj \
$O\CopyRegister.obj \ $O\CopyRegister.obj \
$O\LzmaDecoder.obj \
LZMA_OPT_OBJS = \ $O\LzmaEncoder.obj \
$O\LZMADecoder.obj \ $O\LzmaRegister.obj \
$O\LZMAEncoder.obj \
$O\LZMARegister.obj \
LZMA_BENCH_OBJS = \ LZMA_BENCH_OBJS = \
$O\LzmaBench.obj \ $O\LzmaBench.obj \
@@ -181,10 +175,7 @@ OBJS = \
$(7Z_OBJS) \ $(7Z_OBJS) \
$(LZM_OBJS) \ $(LZM_OBJS) \
$(SPLIT_OBJS) \ $(SPLIT_OBJS) \
$(BRANCH_OPT_OBJS) \ $(COMPRESS_OBJS) \
$(SWAP_OPT_OBJS) \
$(COPY_OBJS) \
$(LZMA_OPT_OBJS) \
$(LZMA_BENCH_OBJS) \ $(LZMA_BENCH_OBJS) \
$(C_OBJS) \ $(C_OBJS) \
$(CRC_OBJS) \ $(CRC_OBJS) \
@@ -213,13 +204,7 @@ $(LZM_OBJS): ../../Archive/Lzma/$(*B).cpp
$(COMPL) $(COMPL)
$(SPLIT_OBJS): ../../Archive/Split/$(*B).cpp $(SPLIT_OBJS): ../../Archive/Split/$(*B).cpp
$(COMPL) $(COMPL)
$(BRANCH_OPT_OBJS): ../../Compress/Branch/$(*B).cpp $(COMPRESS_OBJS): ../../Compress/$(*B).cpp
$(COMPL_O2)
$(SWAP_OPT_OBJS): ../../Compress/ByteSwap/$(*B).cpp
$(COMPL_O2)
$(COPY_OBJS): ../../Compress/Copy/$(*B).cpp
$(COMPL)
$(LZMA_OPT_OBJS): ../../Compress/LZMA/$(*B).cpp
$(COMPL_O2) $(COMPL_O2)
$(LZMA_BENCH_OBJS): ../../Compress/LZMA_Alone/$(*B).cpp $(LZMA_BENCH_OBJS): ../../Compress/LZMA_Alone/$(*B).cpp
$(COMPL) $(COMPL)

View File

@@ -33,7 +33,6 @@ WIN_OBJS = \
$O\FilterCoder.obj \ $O\FilterCoder.obj \
$O\LimitedStreams.obj \ $O\LimitedStreams.obj \
$O\LockedStream.obj \ $O\LockedStream.obj \
$O\LSBFDecoder.obj \
$O\MethodId.obj \ $O\MethodId.obj \
$O\MethodProps.obj \ $O\MethodProps.obj \
$O\OutBuffer.obj \ $O\OutBuffer.obj \
@@ -78,57 +77,37 @@ AR_COMMON_OBJS = \
COMPRESS_OBJS = \ COMPRESS_OBJS = \
$O\CodecExports.obj \ $O\CodecExports.obj \
$O\Bcj2Coder.obj \
BRANCH_OPT_OBJS = \ $O\Bcj2Register.obj \
$O\x86.obj \ $O\BcjCoder.obj \
$O\x86_2.obj \ $O\BcjRegister.obj \
$O\BitlDecoder.obj \
$O\BranchCoder.obj \ $O\BranchCoder.obj \
$O\BranchMisc.obj \ $O\BranchMisc.obj \
$O\BranchRegister.obj \ $O\BranchRegister.obj \
$O\BCJRegister.obj \
$O\BCJ2Register.obj \
SWAP_OPT_OBJS = \
$O\ByteSwap.obj \ $O\ByteSwap.obj \
$O\ByteSwapRegister.obj \ $O\ByteSwapRegister.obj \
$O\BZip2Crc.obj \
BZIP2_OBJS = \
$O\BZip2CRC.obj \
$O\BZip2Register.obj \
BZIP2_OPT_OBJS = \
$O\BZip2Decoder.obj \ $O\BZip2Decoder.obj \
$O\BZip2Encoder.obj \
COPY_OBJS = \ $O\BZip2Register.obj \
$O\CopyCoder.obj \ $O\CopyCoder.obj \
$O\CopyRegister.obj \ $O\CopyRegister.obj \
DEFLATE_OPT_OBJS = \
$O\DeflateDecoder.obj \ $O\DeflateDecoder.obj \
$O\DeflateEncoder.obj \
$O\DeflateRegister.obj \ $O\DeflateRegister.obj \
$O\LzmaDecoder.obj \
$O\LzmaEncoder.obj \
$O\LzmaRegister.obj \
$O\LzOutWindow.obj \
$O\PpmdDecoder.obj \
$O\PpmdEncoder.obj \
$O\PpmdRegister.obj \
LZ_OBJS = \ CRYPTO_OBJS = \
$O\LZOutWindow.obj \ $O\7zAes.obj \
$O\7zAesRegister.obj \
LZMA_OPT_OBJS = \ $O\MyAes.obj \
$O\LZMADecoder.obj \
$O\LZMAEncoder.obj \
$O\LZMARegister.obj \
PPMD_OPT_OBJS = \
$O\PPMDDecoder.obj \
$O\PPMDEncoder.obj \
$O\PPMDRegister.obj \
7ZAES_OPT_OBJS = \
$O\7zAES.obj \
$O\7zAESRegister.obj \
AES_OPT_OBJS = \
$O\MyAES.obj \
CRYPTO_HASH_OBJS = \
$O\RandGen.obj \ $O\RandGen.obj \
$O\Sha1.obj \ $O\Sha1.obj \
@@ -137,11 +116,14 @@ C_OBJS = \
$O\Bra.obj \ $O\Bra.obj \
$O\Bra86.obj \ $O\Bra86.obj \
$O\BraIA64.obj \ $O\BraIA64.obj \
$O\LzmaDec.obj \ $O\BwtSort.obj \
$O\LzmaEnc.obj \ $O\HuffEnc.obj \
$O\Threads.obj \
$O\LzFind.obj \ $O\LzFind.obj \
$O\LzFindMt.obj \ $O\LzFindMt.obj \
$O\LzmaDec.obj \
$O\LzmaEnc.obj \
$O\Sort.obj \
$O\Threads.obj \
$O\Aes.obj \ $O\Aes.obj \
$O\Sha256.obj \ $O\Sha256.obj \
@@ -157,19 +139,8 @@ OBJS = \
$(AR_COMMON_OBJS) \ $(AR_COMMON_OBJS) \
$(7Z_OBJS) \ $(7Z_OBJS) \
$(COMPRESS_OBJS) \ $(COMPRESS_OBJS) \
$(BRANCH_OPT_OBJS) \ $(CRYPTO_OBJS) \
$(SWAP_OPT_OBJS) \
$(BZIP2_OBJS) \
$(BZIP2_OPT_OBJS) \
$(COPY_OBJS) \
$(DEFLATE_OPT_OBJS) \
$(LZ_OBJS) \
$(LZMA_OPT_OBJS) \
$(PPMD_OPT_OBJS) \
$(C_OBJS) \ $(C_OBJS) \
$(7ZAES_OPT_OBJS) \
$(AES_OPT_OBJS) \
$(CRYPTO_HASH_OBJS) \
$(CRC_OBJS) \ $(CRC_OBJS) \
$O\resource.res $O\resource.res
@@ -191,31 +162,9 @@ $(7Z_OBJS): ../../Archive/7z/$(*B).cpp
$(COMPL) $(COMPL)
$(COMPRESS_OBJS): ../../Compress/$(*B).cpp $(COMPRESS_OBJS): ../../Compress/$(*B).cpp
$(COMPL)
$(BRANCH_OPT_OBJS): ../../Compress/Branch/$(*B).cpp
$(COMPL_O2)
$(SWAP_OPT_OBJS): ../../Compress/ByteSwap/$(*B).cpp
$(COMPL_O2)
$(BZIP2_OBJS): ../../Compress/BZip2/$(*B).cpp
$(COMPL)
$(BZIP2_OPT_OBJS): ../../Compress/BZip2/$(*B).cpp
$(COMPL_O2)
$(COPY_OBJS): ../../Compress/Copy/$(*B).cpp
$(COMPL)
$(DEFLATE_OPT_OBJS): ../../Compress/Deflate/$(*B).cpp
$(COMPL_O2)
$(LZ_OBJS): ../../Compress/LZ/$(*B).cpp
$(COMPL)
$(LZMA_OPT_OBJS): ../../Compress/LZMA/$(*B).cpp
$(COMPL_O2)
$(PPMD_OPT_OBJS): ../../Compress/PPMD/$(*B).cpp
$(COMPL_O2) $(COMPL_O2)
$(AES_OPT_OBJS): ../../Crypto/AES/$(*B).cpp $(CRYPTO_OBJS): ../../Crypto/$(*B).cpp
$(COMPL_O2)
$(7ZAES_OPT_OBJS): ../../Crypto/7zAES/$(*B).cpp
$(COMPL_O2)
$(CRYPTO_HASH_OBJS): ../../Crypto/Hash/$(*B).cpp
$(COMPL_O2) $(COMPL_O2)
$(C_OBJS): ../../../../C/$(*B).c $(C_OBJS): ../../../../C/$(*B).c

View File

@@ -31,7 +31,6 @@ WIN_OBJS = \
$O\FilterCoder.obj \ $O\FilterCoder.obj \
$O\LimitedStreams.obj \ $O\LimitedStreams.obj \
$O\LockedStream.obj \ $O\LockedStream.obj \
$O\LSBFDecoder.obj \
$O\MethodId.obj \ $O\MethodId.obj \
$O\OutBuffer.obj \ $O\OutBuffer.obj \
$O\ProgressUtils.obj \ $O\ProgressUtils.obj \
@@ -66,53 +65,33 @@ AR_COMMON_OBJS = \
COMPRESS_OBJS = \ COMPRESS_OBJS = \
$O\CodecExports.obj \ $O\CodecExports.obj \
$O\Bcj2Coder.obj \
BRANCH_OPT_OBJS = \ $O\Bcj2Register.obj \
$O\x86.obj \ $O\BcjCoder.obj \
$O\x86_2.obj \ $O\BcjRegister.obj \
$O\BitlDecoder.obj \
$O\BranchCoder.obj \ $O\BranchCoder.obj \
$O\BranchMisc.obj \ $O\BranchMisc.obj \
$O\BranchRegister.obj \ $O\BranchRegister.obj \
$O\BCJRegister.obj \
$O\BCJ2Register.obj \
SWAP_OPT_OBJS = \
$O\ByteSwap.obj \ $O\ByteSwap.obj \
$O\ByteSwapRegister.obj \ $O\ByteSwapRegister.obj \
$O\BZip2Crc.obj \
BZIP2_OBJS = \
$O\BZip2CRC.obj \
$O\BZip2Register.obj \
BZIP2_OPT_OBJS = \
$O\BZip2Decoder.obj \ $O\BZip2Decoder.obj \
$O\BZip2Register.obj \
COPY_OBJS = \
$O\CopyCoder.obj \ $O\CopyCoder.obj \
$O\CopyRegister.obj \ $O\CopyRegister.obj \
DEFLATE_OPT_OBJS = \
$O\DeflateDecoder.obj \ $O\DeflateDecoder.obj \
$O\DeflateRegister.obj \ $O\DeflateRegister.obj \
$O\LzmaDecoder.obj \
$O\LzmaRegister.obj \
$O\LzOutWindow.obj \
$O\PpmdDecoder.obj \
$O\PpmdRegister.obj \
LZ_OBJS = \ CRYPTO_OBJS = \
$O\LZOutWindow.obj \ $O\7zAes.obj \
$O\7zAesRegister.obj \
LZMA_OPT_OBJS = \ $O\MyAes.obj \
$O\LZMADecoder.obj \
$O\LZMARegister.obj \
PPMD_OPT_OBJS = \
$O\PPMDDecoder.obj \
$O\PPMDRegister.obj \
7ZAES_OPT_OBJS = \
$O\7zAES.obj \
$O\7zAESRegister.obj \
AES_OPT_OBJS = \
$O\MyAES.obj \
C_OBJS = \ C_OBJS = \
$O\Alloc.obj \ $O\Alloc.obj \
@@ -136,17 +115,7 @@ OBJS = \
$(AR_COMMON_OBJS) \ $(AR_COMMON_OBJS) \
$(7Z_OBJS) \ $(7Z_OBJS) \
$(COMPRESS_OBJS) \ $(COMPRESS_OBJS) \
$(SWAP_OPT_OBJS) \ $(CRYPTO_OBJS) \
$(BZIP2_OBJS) \
$(BZIP2_OPT_OBJS) \
$(BRANCH_OPT_OBJS) \
$(COPY_OBJS) \
$(DEFLATE_OPT_OBJS) \
$(LZ_OBJS) \
$(LZMA_OPT_OBJS) \
$(PPMD_OPT_OBJS) \
$(7ZAES_OPT_OBJS) \
$(AES_OPT_OBJS) \
$(C_OBJS) \ $(C_OBJS) \
$(CRC_OBJS) \ $(CRC_OBJS) \
$O\resource.res $O\resource.res
@@ -169,30 +138,11 @@ $(7Z_OBJS): ../../Archive/7z/$(*B).cpp
$(COMPL) $(COMPL)
$(COMPRESS_OBJS): ../../Compress/$(*B).cpp $(COMPRESS_OBJS): ../../Compress/$(*B).cpp
$(COMPL)
$(BRANCH_OPT_OBJS): ../../Compress/Branch/$(*B).cpp
$(COMPL_O2)
$(SWAP_OPT_OBJS): ../../Compress/ByteSwap/$(*B).cpp
$(COMPL_O2)
$(BZIP2_OBJS): ../../Compress/BZip2/$(*B).cpp
$(COMPL)
$(BZIP2_OPT_OBJS): ../../Compress/BZip2/$(*B).cpp
$(COMPL_O2)
$(COPY_OBJS): ../../Compress/Copy/$(*B).cpp
$(COMPL)
$(DEFLATE_OPT_OBJS): ../../Compress/Deflate/$(*B).cpp
$(COMPL_O2)
$(LZ_OBJS): ../../Compress/LZ/$(*B).cpp
$(COMPL)
$(LZMA_OPT_OBJS): ../../Compress/LZMA/$(*B).cpp
$(COMPL_O2)
$(PPMD_OPT_OBJS): ../../Compress/PPMD/$(*B).cpp
$(COMPL_O2) $(COMPL_O2)
$(AES_OPT_OBJS): ../../Crypto/AES/$(*B).cpp $(CRYPTO_OBJS): ../../Crypto/$(*B).cpp
$(COMPL_O2)
$(7ZAES_OPT_OBJS): ../../Crypto/7zAES/$(*B).cpp
$(COMPL_O2) $(COMPL_O2)
$(C_OBJS): ../../../../C/$(*B).c $(C_OBJS): ../../../../C/$(*B).c
$(COMPL_O2) $(COMPL_O2)

View File

@@ -68,27 +68,19 @@ AR_COMMON_OBJS = \
COMPRESS_OBJS = \ COMPRESS_OBJS = \
$O\CodecExports.obj \ $O\CodecExports.obj \
$O\Bcj2Coder.obj \
SWAP_OPT_OBJS = \ $O\Bcj2Register.obj \
$O\ByteSwap.obj \ $O\BcjCoder.obj \
$O\ByteSwapRegister.obj \ $O\BcjRegister.obj \
BRANCH_OPT_OBJS = \
$O\x86.obj \
$O\x86_2.obj \
$O\BranchCoder.obj \ $O\BranchCoder.obj \
$O\BranchMisc.obj \ $O\BranchMisc.obj \
$O\BranchRegister.obj \ $O\BranchRegister.obj \
$O\BCJRegister.obj \ $O\ByteSwap.obj \
$O\BCJ2Register.obj \ $O\ByteSwapRegister.obj \
COPY_OBJS = \
$O\CopyCoder.obj \ $O\CopyCoder.obj \
$O\CopyRegister.obj \ $O\CopyRegister.obj \
$O\LzmaDecoder.obj \
LZMA_OPT_OBJS = \ $O\LzmaRegister.obj \
$O\LZMADecoder.obj \
$O\LZMARegister.obj \
C_OBJS = \ C_OBJS = \
$O\7zCrc.obj \ $O\7zCrc.obj \
@@ -109,10 +101,6 @@ OBJS = \
$(AR_COMMON_OBJS) \ $(AR_COMMON_OBJS) \
$(7Z_OBJS) \ $(7Z_OBJS) \
$(COMPRESS_OBJS) \ $(COMPRESS_OBJS) \
$(BRANCH_OPT_OBJS) \
$(SWAP_OPT_OBJS) \
$(COPY_OBJS) \
$(LZMA_OPT_OBJS) \
$(C_OBJS) \ $(C_OBJS) \
$O\resource.res $O\resource.res
@@ -134,14 +122,6 @@ $(7Z_OBJS): ../../Archive/7z/$(*B).cpp
$(COMPL) $(COMPL)
$(COMPRESS_OBJS): ../../Compress/$(*B).cpp $(COMPRESS_OBJS): ../../Compress/$(*B).cpp
$(COMPL)
$(BRANCH_OPT_OBJS): ../../Compress/Branch/$(*B).cpp
$(COMPL_O2)
$(SWAP_OPT_OBJS): ../../Compress/ByteSwap/$(*B).cpp
$(COMPL_O2)
$(COPY_OBJS): ../../Compress/Copy/$(*B).cpp
$(COMPL)
$(LZMA_OPT_OBJS): ../../Compress/LZMA/$(*B).cpp
$(COMPL_O2) $(COMPL_O2)
$(C_OBJS): ../../../../C/$(*B).c $(C_OBJS): ../../../../C/$(*B).c

View File

File diff suppressed because it is too large Load Diff

View File

@@ -38,8 +38,6 @@ WIN_OBJS = \
$O\FilterCoder.obj \ $O\FilterCoder.obj \
$O\LimitedStreams.obj \ $O\LimitedStreams.obj \
$O\LockedStream.obj \ $O\LockedStream.obj \
$O\LSBFDecoder.obj \
$O\LSBFEncoder.obj \
$O\MethodId.obj \ $O\MethodId.obj \
$O\MethodProps.obj \ $O\MethodProps.obj \
$O\MemBlocks.obj \ $O\MemBlocks.obj \
@@ -213,107 +211,64 @@ ZIP_OBJS = \
COMPRESS_OBJS = \ COMPRESS_OBJS = \
$O\CodecExports.obj \ $O\CodecExports.obj \
$O\ArjDecoder1.obj \
BRANCH_OPT_OBJS = \ $O\ArjDecoder2.obj \
$O\x86.obj \ $O\Bcj2Coder.obj \
$O\x86_2.obj \ $O\Bcj2Register.obj \
$O\BcjCoder.obj \
$O\BcjRegister.obj \
$O\BitlDecoder.obj \
$O\BranchCoder.obj \ $O\BranchCoder.obj \
$O\BranchMisc.obj \ $O\BranchMisc.obj \
$O\BranchRegister.obj \ $O\BranchRegister.obj \
$O\BCJRegister.obj \
$O\BCJ2Register.obj \
SWAP_OPT_OBJS = \
$O\ByteSwap.obj \ $O\ByteSwap.obj \
$O\ByteSwapRegister.obj \ $O\ByteSwapRegister.obj \
$O\BZip2Crc.obj \
BZIP2_OBJS = \
$O\BZip2CRC.obj \
$O\BZip2Register.obj \
BZIP2_OPT_OBJS = \
$O\BZip2Decoder.obj \ $O\BZip2Decoder.obj \
$O\BZip2Encoder.obj \ $O\BZip2Encoder.obj \
$O\BZip2Register.obj \
COPY_OBJS = \
$O\CopyCoder.obj \ $O\CopyCoder.obj \
$O\CopyRegister.obj \ $O\CopyRegister.obj \
$O\Deflate64Register.obj \
DEFLATE_OPT_OBJS = \
$O\DeflateDecoder.obj \ $O\DeflateDecoder.obj \
$O\DeflateEncoder.obj \ $O\DeflateEncoder.obj \
$O\DeflateRegister.obj \
$O\Deflate64Register.obj \
$O\DeflateNsisRegister.obj \ $O\DeflateNsisRegister.obj \
$O\ZlibDecoder.obj \ $O\DeflateRegister.obj \
IMPLODE_OBJS = \
$O\ImplodeDecoder.obj \ $O\ImplodeDecoder.obj \
$O\ImplodeHuffmanDecoder.obj \ $O\ImplodeHuffmanDecoder.obj \
$O\LzhDecoder.obj \
LZ_OBJS = \ $O\LzmaDecoder.obj \
$O\LZOutWindow.obj \ $O\LzmaEncoder.obj \
$O\LzmaRegister.obj \
LZMA_OPT_OBJS = \ $O\LzOutWindow.obj \
$O\LZMADecoder.obj \
$O\LZMAEncoder.obj \
$O\LZMARegister.obj \
LZX_OBJS = \
$O\LzxDecoder.obj \
$O\Lzx86Converter.obj \ $O\Lzx86Converter.obj \
$O\LzxDecoder.obj \
PPMD_OPT_OBJS = \ $O\PpmdDecoder.obj \
$O\PPMDDecoder.obj \ $O\PpmdEncoder.obj \
$O\PPMDEncoder.obj \ $O\PpmdRegister.obj \
$O\PPMDRegister.obj \ $O\QuantumDecoder.obj \
RAR29_OPT_OBJS = \
$O\Rar1Decoder.obj \ $O\Rar1Decoder.obj \
$O\Rar2Decoder.obj \ $O\Rar2Decoder.obj \
$O\Rar3Decoder.obj \ $O\Rar3Decoder.obj \
$O\Rar3Vm.obj \ $O\Rar3Vm.obj \
$O\RarCodecsRegister.obj \ $O\RarCodecsRegister.obj \
SHRINK_OBJS = \
$O\ShrinkDecoder.obj \ $O\ShrinkDecoder.obj \
$O\ZlibDecoder.obj \
COMPRESS_ARJ_OBJS = \
$O\ArjDecoder1.obj \
$O\ArjDecoder2.obj \
COMPRESS_LZH_OBJS = \
$O\LzhDecoder.obj \
COMPRESS_Z_OBJS = \
$O\ZDecoder.obj \ $O\ZDecoder.obj \
7ZAES_OPT_OBJS = \ CRYPTO_OBJS = \
$O\7zAES.obj \ $O\7zAes.obj \
$O\7zAESRegister.obj \ $O\7zAesRegister.obj \
AES_OPT_OBJS = \
$O\MyAES.obj \
CRYPTO_HASH_OBJS = \
$O\HmacSha1.obj \ $O\HmacSha1.obj \
$O\MyAes.obj \
$O\Pbkdf2HmacSha1.obj \ $O\Pbkdf2HmacSha1.obj \
$O\RandGen.obj \ $O\RandGen.obj \
$O\Sha1.obj \
CRYPTO_WZAES_OBJS = \
$O\WzAES.obj \
CRYPTO_ZIP_OBJS = \
$O\ZipCipher.obj \
$O\ZipCrypto.obj \
CRYPTO_RAR20_OBJS = \
$O\Rar20Cipher.obj \
$O\Rar20Crypto.obj \ $O\Rar20Crypto.obj \
$O\RarAes.obj \
CRYPTO_RARAES_OBJS = \ $O\Sha1.obj \
$O\RarAES.obj \ $O\WzAes.obj \
$O\ZipCrypto.obj \
$O\ZipStrong.obj \
C_OBJS = \ C_OBJS = \
@@ -360,33 +315,9 @@ OBJS = \
$(UDF_OBJS) \ $(UDF_OBJS) \
$(WIM_OBJS) \ $(WIM_OBJS) \
$(ZIP_OBJS) \ $(ZIP_OBJS) \
$(BZIP2_OBJS) \
$(BZIP2_OPT_OBJS) \
$(COMPRESS_OBJS) \ $(COMPRESS_OBJS) \
$(BRANCH_OPT_OBJS) \ $(CRYPTO_OBJS) \
$(SWAP_OPT_OBJS) \
$(COPY_OBJS) \
$(DEFLATE_OPT_OBJS) \
$(IMPLODE_OBJS) \
$(LZ_OBJS) \
$(LZMA_OPT_OBJS) \
$(LZX_OBJS) \
$(PPMD_OPT_OBJS) \
$(RAR29_OPT_OBJS) \
$(SHRINK_OBJS) \
$(COMPRESS_ARJ_OBJS) \
$(COMPRESS_LZH_OBJS) \
$(COMPRESS_Z_OBJS) \
$O\QuantumDecoder.obj \
$(C_OBJS) \ $(C_OBJS) \
$O\RangeCoderBit.obj \
$(7ZAES_OPT_OBJS) \
$(AES_OPT_OBJS) \
$(CRYPTO_ZIP_OBJS) \
$(CRYPTO_WZAES_OBJS) \
$(CRYPTO_HASH_OBJS) \
$(CRYPTO_RAR20_OBJS) \
$(CRYPTO_RARAES_OBJS) \
$(CRC_OBJS) \ $(CRC_OBJS) \
$O\resource.res $O\resource.res
@@ -442,59 +373,10 @@ $(ZIP_OBJS): ../../Archive/Zip/$(*B).cpp
$(COMPL) $(COMPL)
$(COMPRESS_OBJS): ../../Compress/$(*B).cpp $(COMPRESS_OBJS): ../../Compress/$(*B).cpp
$(COMPL)
$(BRANCH_OPT_OBJS): ../../Compress/Branch/$(*B).cpp
$(COMPL_O2) $(COMPL_O2)
$(SWAP_OPT_OBJS): ../../Compress/ByteSwap/$(*B).cpp
$(COMPL_O2)
$(BZIP2_OBJS): ../../Compress/BZip2/$(*B).cpp
$(COMPL)
$(BZIP2_OPT_OBJS): ../../Compress/BZip2/$(*B).cpp
$(COMPL_O2)
$(COPY_OBJS): ../../Compress/Copy/$(*B).cpp
$(COMPL)
$(DEFLATE_OPT_OBJS): ../../Compress/Deflate/$(*B).cpp
$(COMPL_O2)
$(IMPLODE_OBJS): ../../Compress/Implode/$(*B).cpp
$(COMPL)
$(LZ_OBJS): ../../Compress/LZ/$(*B).cpp
$(COMPL)
$(LZMA_OPT_OBJS): ../../Compress/LZMA/$(*B).cpp
$(COMPL_O2)
$(LZX_OBJS): ../../Compress/Lzx/$(*B).cpp
$(COMPL_O2)
$(PPMD_OPT_OBJS): ../../Compress/PPMD/$(*B).cpp
$(COMPL_O2)
$(RAR29_OPT_OBJS): ../../Compress/Rar/$(*B).cpp
$(COMPL_O2)
$(SHRINK_OBJS): ../../Compress/Shrink/$(*B).cpp
$(COMPL)
$(COMPRESS_ARJ_OBJS): ../../Compress/Arj/$(*B).cpp
$(COMPL)
$(COMPRESS_LZH_OBJS): ../../Compress/Lzh/$(*B).cpp
$(COMPL)
$(COMPRESS_Z_OBJS): ../../Compress/Z/$(*B).cpp
$(COMPL)
$O\QuantumDecoder.obj: ../../Compress/Quantum/$(*B).cpp
$(COMPL)
$O\RangeCoderBit.obj: ../../Compress/RangeCoder/$(*B).cpp $(CRYPTO_OBJS): ../../Crypto/$(*B).cpp
$(COMPL)
$(AES_OPT_OBJS): ../../Crypto/AES/$(*B).cpp
$(COMPL_O2) $(COMPL_O2)
$(7ZAES_OPT_OBJS): ../../Crypto/7zAES/$(*B).cpp
$(COMPL_O2)
$(CRYPTO_ZIP_OBJS): ../../Crypto/Zip/$(*B).cpp
$(COMPL)
$(CRYPTO_WZAES_OBJS): ../../Crypto/WzAES/$(*B).cpp
$(COMPL_O2)
$(CRYPTO_HASH_OBJS): ../../Crypto/Hash/$(*B).cpp
$(COMPL_O2)
$(CRYPTO_RAR20_OBJS): ../../Crypto/Rar20/$(*B).cpp
$(COMPL)
$(CRYPTO_RARAES_OBJS): ../../Crypto/RarAES/$(*B).cpp
$(COMPL)
$(C_OBJS): ../../../../C/$(*B).c $(C_OBJS): ../../../../C/$(*B).c
$(COMPL_O2) $(COMPL_O2)

View File

@@ -75,28 +75,20 @@ AR_COMMON_OBJS = \
COMPRESS_OBJS = \ COMPRESS_OBJS = \
$O\CodecExports.obj \ $O\CodecExports.obj \
$O\Bcj2Coder.obj \
BRANCH_OPT_OBJS = \ $O\Bcj2Register.obj \
$O\x86.obj \ $O\BcjCoder.obj \
$O\x86_2.obj \ $O\BcjRegister.obj \
$O\BranchCoder.obj \ $O\BranchCoder.obj \
$O\BranchMisc.obj \ $O\BranchMisc.obj \
$O\BranchRegister.obj \ $O\BranchRegister.obj \
$O\BCJRegister.obj \
$O\BCJ2Register.obj \
SWAP_OPT_OBJS = \
$O\ByteSwap.obj \ $O\ByteSwap.obj \
$O\ByteSwapRegister.obj \ $O\ByteSwapRegister.obj \
COPY_OBJS = \
$O\CopyCoder.obj \ $O\CopyCoder.obj \
$O\CopyRegister.obj \ $O\CopyRegister.obj \
$O\LzmaDecoder.obj \
LZMA_OPT_OBJS = \ $O\LzmaEncoder.obj \
$O\LZMADecoder.obj \ $O\LzmaRegister.obj \
$O\LZMAEncoder.obj \
$O\LZMARegister.obj \
C_OBJS = \ C_OBJS = \
$O\7zCrc.obj \ $O\7zCrc.obj \
@@ -119,15 +111,7 @@ OBJS = \
$(AR_OBJS) \ $(AR_OBJS) \
$(AR_COMMON_OBJS) \ $(AR_COMMON_OBJS) \
$(7Z_OBJS) \ $(7Z_OBJS) \
$(BZIP2_OBJS) \
$(BZIP2_OPT_OBJS) \
$(COMPRESS_OBJS) \ $(COMPRESS_OBJS) \
$(BRANCH_OPT_OBJS) \
$(SWAP_OPT_OBJS) \
$(COPY_OBJS) \
$(DEFLATE_OPT_OBJS) \
$(LZMA_OPT_OBJS) \
$(PPMD_OPT_OBJS) \
$(C_OBJS) \ $(C_OBJS) \
$O\resource.res $O\resource.res
@@ -149,14 +133,6 @@ $(7Z_OBJS): ../../Archive/7z/$(*B).cpp
$(COMPL) $(COMPL)
$(COMPRESS_OBJS): ../../Compress/$(*B).cpp $(COMPRESS_OBJS): ../../Compress/$(*B).cpp
$(COMPL)
$(BRANCH_OPT_OBJS): ../../Compress/Branch/$(*B).cpp
$(COMPL_O2)
$(SWAP_OPT_OBJS): ../../Compress/ByteSwap/$(*B).cpp
$(COMPL_O2)
$(COPY_OBJS): ../../Compress/Copy/$(*B).cpp
$(COMPL)
$(LZMA_OPT_OBJS): ../../Compress/LZMA/$(*B).cpp
$(COMPL_O2) $(COMPL_O2)
$(C_OBJS): ../../../../C/$(*B).c $(C_OBJS): ../../../../C/$(*B).c

View File

@@ -254,128 +254,76 @@ SOURCE=..\..\Archive\7z\7zRegister.cpp
# End Group # End Group
# Begin Group "Compress" # Begin Group "Compress"
# PROP Default_Filter ""
# Begin Group "LZMA"
# PROP Default_Filter "" # PROP Default_Filter ""
# Begin Source File # Begin Source File
SOURCE=..\..\Compress\LZMA\LZMADecoder.cpp SOURCE=..\..\Compress\Bcj2Coder.cpp
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\..\Compress\LZMA\LZMARegister.cpp SOURCE=..\..\Compress\Bcj2Register.cpp
# End Source File
# End Group
# Begin Group "Branch"
# PROP Default_Filter ""
# Begin Source File
SOURCE=..\..\Compress\Branch\BCJ2Register.cpp
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\..\Compress\Branch\BCJRegister.cpp SOURCE=..\..\Compress\BcjCoder.cpp
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\..\Compress\Branch\BranchCoder.cpp SOURCE=..\..\Compress\BcjRegister.cpp
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\..\Compress\Branch\BranchCoder.h SOURCE=..\..\Compress\BranchCoder.cpp
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\..\Compress\Branch\x86.cpp SOURCE=..\..\Compress\CopyCoder.cpp
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\..\Compress\Branch\x86_2.cpp SOURCE=..\..\Compress\CopyRegister.cpp
# End Source File
# End Group
# Begin Group "PPMD"
# PROP Default_Filter ""
# Begin Source File
SOURCE=..\..\Compress\PPMD\PPMDDecoder.cpp
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\..\Compress\PPMD\PPMDRegister.cpp SOURCE=..\..\Compress\LzmaDecoder.cpp
# End Source File
# End Group
# Begin Group "LZ"
# PROP Default_Filter ""
# Begin Source File
SOURCE=..\..\Compress\LZ\LZOutWindow.cpp
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\..\Compress\LZ\LZOutWindow.h SOURCE=..\..\Compress\LzmaRegister.cpp
# End Source File
# End Group
# Begin Group "Copy"
# PROP Default_Filter ""
# Begin Source File
SOURCE=..\..\Compress\Copy\CopyCoder.cpp
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\..\Compress\Copy\CopyCoder.h SOURCE=..\..\Compress\PpmdDecoder.cpp
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\..\Compress\Copy\CopyRegister.cpp SOURCE=..\..\Compress\PpmdRegister.cpp
# End Source File # End Source File
# End Group # End Group
# End Group
# Begin Group "Crypto" # Begin Group "Crypto"
# PROP Default_Filter ""
# Begin Group "7zAES"
# PROP Default_Filter "" # PROP Default_Filter ""
# Begin Source File # Begin Source File
SOURCE=..\..\Crypto\7zAES\7zAES.cpp SOURCE=..\..\Crypto\7zAes.cpp
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\..\Crypto\7zAES\7zAES.h SOURCE=..\..\Crypto\7zAes.h
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\..\Crypto\7zAES\7zAESRegister.cpp SOURCE=..\..\Crypto\7zAesRegister.cpp
# End Source File
# End Group
# Begin Group "AES"
# PROP Default_Filter ""
# Begin Source File
SOURCE=..\..\Crypto\AES\MyAES.cpp
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\..\Crypto\AES\MyAES.h SOURCE=..\..\Crypto\MyAes.cpp
# End Source File # End Source File
# End Group
# Begin Group "Hash"
# PROP Default_Filter ""
# Begin Source File # Begin Source File
SOURCE=..\..\Crypto\Hash\RotateDefs.h SOURCE=..\..\Crypto\MyAes.h
# End Source File # End Source File
# End Group # End Group
# End Group
# Begin Group "Windows" # Begin Group "Windows"
# PROP Default_Filter "" # PROP Default_Filter ""

View File

@@ -81,34 +81,23 @@ AR_COMMON_OBJS = \
$O\7zIn.obj \ $O\7zIn.obj \
$O\7zRegister.obj \ $O\7zRegister.obj \
BRANCH_OPT_OBJS = \ COMPRESS_OBJS = \
$O\x86.obj \
$O\x86_2.obj \
$O\BranchCoder.obj \ $O\BranchCoder.obj \
$O\BCJRegister.obj \ $O\Bcj2Coder.obj \
$O\BCJ2Register.obj \ $O\Bcj2Register.obj \
$O\BcjCoder.obj \
COPY_OBJS = \ $O\BcjRegister.obj \
$O\CopyCoder.obj \ $O\CopyCoder.obj \
$O\CopyRegister.obj \ $O\CopyRegister.obj \
$O\LzmaDecoder.obj \
$O\LzmaRegister.obj \
$O\PpmdDecoder.obj \
$O\PpmdRegister.obj \
LZ_OBJS = \ CRYPTO_OBJS = \
$O\LZOutWindow.obj \ $O\7zAes.obj \
$O\7zAesRegister.obj \
LZMA_OPT_OBJS = \ $O\MyAes.obj \
$O\LZMADecoder.obj \
$O\LZMARegister.obj \
PPMD_OPT_OBJS = \
$O\PPMDDecoder.obj \
$O\PPMDRegister.obj \
7ZAES_OPT_OBJS = \
$O\7zAES.obj \
$O\7zAESRegister.obj \
AES_OPT_OBJS = \
$O\MyAES.obj \
C_OBJS = \ C_OBJS = \
$O\Alloc.obj \ $O\Alloc.obj \
@@ -130,13 +119,8 @@ OBJS = \
$(UI_COMMON_OBJS) \ $(UI_COMMON_OBJS) \
$(AR_COMMON_OBJS) \ $(AR_COMMON_OBJS) \
$(7Z_OBJS) \ $(7Z_OBJS) \
$(BRANCH_OPT_OBJS) \ $(COMPRESS_OBJS) \
$(COPY_OBJS) \ $(CRYPTO_OBJS) \
$(LZ_OBJS) \
$(LZMA_OPT_OBJS) \
$(PPMD_OPT_OBJS) \
$(7ZAES_OPT_OBJS) \
$(AES_OPT_OBJS) \
$(C_OBJS) \ $(C_OBJS) \
$(CRC_OBJS) \ $(CRC_OBJS) \
$O\resource.res $O\resource.res
@@ -162,20 +146,9 @@ $(AR_COMMON_OBJS): ../../Archive/Common/$(*B).cpp
$(7Z_OBJS): ../../Archive/7z/$(*B).cpp $(7Z_OBJS): ../../Archive/7z/$(*B).cpp
$(COMPL) $(COMPL)
$(BRANCH_OPT_OBJS): ../../Compress/Branch/$(*B).cpp $(COMPRESS_OBJS): ../../Compress/$(*B).cpp
$(COMPL) $(COMPL)
$(COPY_OBJS): ../../Compress/Copy/$(*B).cpp $(CRYPTO_OBJS): ../../Crypto/$(*B).cpp
$(COMPL)
$(LZ_OBJS): ../../Compress/LZ/$(*B).cpp
$(COMPL)
$(LZMA_OPT_OBJS): ../../Compress/LZMA/$(*B).cpp
$(COMPL)
$(PPMD_OPT_OBJS): ../../Compress/PPMD/$(*B).cpp
$(COMPL)
$(AES_OPT_OBJS): ../../Crypto/AES/$(*B).cpp
$(COMPL)
$(7ZAES_OPT_OBJS): ../../Crypto/7zAES/$(*B).cpp
$(COMPL) $(COMPL)
$(C_OBJS): ../../../../C/$(*B).c $(C_OBJS): ../../../../C/$(*B).c
$(COMPL_O2) $(COMPL_O2)

View File

@@ -242,76 +242,44 @@ SOURCE=..\..\Archive\Common\OutStreamWithCRC.h
# End Group # End Group
# Begin Group "Compress" # Begin Group "Compress"
# PROP Default_Filter ""
# Begin Group "LZMA"
# PROP Default_Filter "" # PROP Default_Filter ""
# Begin Source File # Begin Source File
SOURCE=..\..\Compress\LZMA\LZMADecoder.cpp SOURCE=..\..\Compress\Bcj2Coder.cpp
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\..\Compress\LZMA\LZMARegister.cpp SOURCE=..\..\Compress\Bcj2Register.cpp
# End Source File
# End Group
# Begin Group "Branch"
# PROP Default_Filter ""
# Begin Source File
SOURCE=..\..\Compress\Branch\BCJ2Register.cpp
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\..\Compress\Branch\BCJRegister.cpp SOURCE=..\..\Compress\BcjCoder.cpp
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\..\Compress\Branch\BranchCoder.cpp SOURCE=..\..\Compress\BcjRegister.cpp
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\..\Compress\Branch\BranchCoder.h SOURCE=..\..\Compress\BranchCoder.cpp
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\..\Compress\Branch\x86.cpp SOURCE=..\..\Compress\CopyCoder.cpp
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\..\Compress\Branch\x86_2.cpp SOURCE=..\..\Compress\CopyRegister.cpp
# End Source File
# End Group
# Begin Group "Copy"
# PROP Default_Filter ""
# Begin Source File
SOURCE=..\..\Compress\Copy\CopyCoder.cpp
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\..\Compress\Copy\CopyCoder.h SOURCE=..\..\Compress\LzmaDecoder.cpp
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\..\Compress\Copy\CopyRegister.cpp SOURCE=..\..\Compress\LzmaRegister.cpp
# End Source File # End Source File
# End Group # End Group
# Begin Group "LZ"
# PROP Default_Filter ""
# Begin Source File
SOURCE=..\..\Compress\LZ\LZOutWindow.cpp
# End Source File
# Begin Source File
SOURCE=..\..\Compress\LZ\LZOutWindow.h
# End Source File
# End Group
# End Group
# Begin Group "Common" # Begin Group "Common"
# PROP Default_Filter "" # PROP Default_Filter ""

View File

@@ -79,23 +79,16 @@ AR_COMMON_OBJS = \
$O\7zIn.obj \ $O\7zIn.obj \
$O\7zRegister.obj \ $O\7zRegister.obj \
BRANCH_OPT_OBJS = \ COMPRESS_OBJS = \
$O\x86.obj \
$O\x86_2.obj \
$O\BranchCoder.obj \ $O\BranchCoder.obj \
$O\BCJRegister.obj \ $O\Bcj2Coder.obj \
$O\BCJ2Register.obj \ $O\Bcj2Register.obj \
$O\BcjCoder.obj \
COPY_OBJS = \ $O\BcjRegister.obj \
$O\CopyCoder.obj \ $O\CopyCoder.obj \
$O\CopyRegister.obj \ $O\CopyRegister.obj \
$O\LzmaDecoder.obj \
LZ_OBJS = \ $O\LzmaRegister.obj \
$O\LZOutWindow.obj \
LZMA_OPT_OBJS = \
$O\LZMADecoder.obj \
$O\LZMARegister.obj \
C_OBJS = \ C_OBJS = \
$O\Alloc.obj \ $O\Alloc.obj \
@@ -116,10 +109,7 @@ OBJS = \
$(FM_OBJS)\ $(FM_OBJS)\
$(AR_COMMON_OBJS) \ $(AR_COMMON_OBJS) \
$(7Z_OBJS) \ $(7Z_OBJS) \
$(BRANCH_OPT_OBJS) \ $(COMPRESS_OBJS) \
$(COPY_OBJS) \
$(LZ_OBJS) \
$(LZMA_OPT_OBJS) \
$O\MyMessages.obj \ $O\MyMessages.obj \
$(C_OBJS) \ $(C_OBJS) \
$(CRC_OBJS) \ $(CRC_OBJS) \
@@ -148,13 +138,7 @@ $(AR_COMMON_OBJS): ../../Archive/Common/$(*B).cpp
$(7Z_OBJS): ../../Archive/7z/$(*B).cpp $(7Z_OBJS): ../../Archive/7z/$(*B).cpp
$(COMPL) $(COMPL)
$(BRANCH_OPT_OBJS): ../../Compress/Branch/$(*B).cpp $(COMPRESS_OBJS): ../../Compress/$(*B).cpp
$(COMPL)
$(COPY_OBJS): ../../Compress/Copy/$(*B).cpp
$(COMPL)
$(LZ_OBJS): ../../Compress/LZ/$(*B).cpp
$(COMPL)
$(LZMA_OPT_OBJS): ../../Compress/LZMA/$(*B).cpp
$(COMPL) $(COMPL)
$O\MyMessages.obj: ../../UI/Explorer/MyMessages.cpp $O\MyMessages.obj: ../../UI/Explorer/MyMessages.cpp

View File

@@ -230,152 +230,76 @@ SOURCE=..\..\Archive\Common\OutStreamWithCRC.h
# End Group # End Group
# Begin Group "Compress" # Begin Group "Compress"
# PROP Default_Filter ""
# Begin Group "LZMA"
# PROP Default_Filter "" # PROP Default_Filter ""
# Begin Source File # Begin Source File
SOURCE=..\..\Compress\LZMA\LZMADecoder.cpp SOURCE=..\..\Compress\Bcj2Coder.cpp
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\..\Compress\LZMA\LZMARegister.cpp SOURCE=..\..\Compress\Bcj2Register.cpp
# End Source File
# End Group
# Begin Group "Branch"
# PROP Default_Filter ""
# Begin Source File
SOURCE=..\..\Compress\Branch\BCJ2Register.cpp
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\..\Compress\Branch\BCJRegister.cpp SOURCE=..\..\Compress\BcjCoder.cpp
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\..\Compress\Branch\BranchCoder.cpp SOURCE=..\..\Compress\BcjRegister.cpp
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\..\Compress\Branch\BranchCoder.h SOURCE=..\..\Compress\BranchCoder.cpp
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\..\Compress\Branch\x86.cpp SOURCE=..\..\Compress\CopyCoder.cpp
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\..\Compress\Branch\x86_2.cpp SOURCE=..\..\Compress\CopyRegister.cpp
# End Source File
# End Group
# Begin Group "PPMD"
# PROP Default_Filter ""
# Begin Source File
SOURCE=..\..\Compress\PPMD\PPMDContext.h
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\..\Compress\PPMD\PPMDDecode.h SOURCE=..\..\Compress\LzmaDecoder.cpp
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\..\Compress\PPMD\PPMDDecoder.cpp SOURCE=..\..\Compress\LzmaRegister.cpp
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\..\Compress\PPMD\PPMDDecoder.h SOURCE=..\..\Compress\PpmdDecoder.cpp
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\..\Compress\PPMD\PPMDRegister.cpp SOURCE=..\..\Compress\PpmdRegister.cpp
# End Source File # End Source File
# Begin Source File
SOURCE=..\..\Compress\PPMD\PPMDSubAlloc.h
# End Source File
# Begin Source File
SOURCE=..\..\Compress\PPMD\PPMDType.h
# End Source File
# End Group
# Begin Group "LZ"
# PROP Default_Filter ""
# Begin Source File
SOURCE=..\..\Compress\LZ\LZOutWindow.cpp
# End Source File
# Begin Source File
SOURCE=..\..\Compress\LZ\LZOutWindow.h
# End Source File
# End Group
# Begin Group "Copy"
# PROP Default_Filter ""
# Begin Source File
SOURCE=..\..\Compress\Copy\CopyCoder.cpp
# End Source File
# Begin Source File
SOURCE=..\..\Compress\Copy\CopyCoder.h
# End Source File
# Begin Source File
SOURCE=..\..\Compress\Copy\CopyRegister.cpp
# End Source File
# End Group
# End Group # End Group
# Begin Group "Crypto" # Begin Group "Crypto"
# PROP Default_Filter ""
# Begin Group "AES"
# PROP Default_Filter "" # PROP Default_Filter ""
# Begin Source File # Begin Source File
SOURCE=..\..\Crypto\AES\MyAES.cpp SOURCE=..\..\Crypto\7zAes.cpp
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\..\Crypto\AES\MyAES.h SOURCE=..\..\Crypto\7zAes.h
# End Source File
# End Group
# Begin Group "7zAES"
# PROP Default_Filter ""
# Begin Source File
SOURCE=..\..\Crypto\7zAES\7zAES.cpp
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\..\Crypto\7zAES\7zAES.h SOURCE=..\..\Crypto\7zAesRegister.cpp
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\..\Crypto\7zAES\7zAESRegister.cpp SOURCE=..\..\Crypto\MyAes.cpp
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\..\Crypto\7zAES\MySHA256.h SOURCE=..\..\Crypto\MyAes.h
# End Source File # End Source File
# End Group # End Group
# Begin Group "Hash"
# PROP Default_Filter ""
# Begin Source File
SOURCE=..\..\Crypto\Hash\RotateDefs.h
# End Source File
# End Group
# End Group
# Begin Group "Dialogs" # Begin Group "Dialogs"
# PROP Default_Filter "" # PROP Default_Filter ""

View File

@@ -89,34 +89,23 @@ AR_COMMON_OBJS = \
$O\7zIn.obj \ $O\7zIn.obj \
$O\7zRegister.obj \ $O\7zRegister.obj \
BRANCH_OPT_OBJS = \ COMPRESS_OBJS = \
$O\x86.obj \
$O\x86_2.obj \
$O\BranchCoder.obj \ $O\BranchCoder.obj \
$O\BCJRegister.obj \ $O\Bcj2Coder.obj \
$O\BCJ2Register.obj \ $O\Bcj2Register.obj \
$O\BcjCoder.obj \
COPY_OBJS = \ $O\BcjRegister.obj \
$O\CopyCoder.obj \ $O\CopyCoder.obj \
$O\CopyRegister.obj \ $O\CopyRegister.obj \
$O\LzmaDecoder.obj \
$O\LzmaRegister.obj \
$O\PpmdDecoder.obj \
$O\PpmdRegister.obj \
LZ_OBJS = \ CRYPTO_OBJS = \
$O\LZOutWindow.obj \ $O\7zAes.obj \
$O\7zAesRegister.obj \
LZMA_OPT_OBJS = \ $O\MyAes.obj \
$O\LZMADecoder.obj \
$O\LZMARegister.obj \
PPMD_OPT_OBJS = \
$O\PPMDDecoder.obj \
$O\PPMDRegister.obj \
7ZAES_OPT_OBJS = \
$O\7zAES.obj \
$O\7zAESRegister.obj \
AES_OPT_OBJS = \
$O\MyAES.obj \
C_OBJS = \ C_OBJS = \
$O\Alloc.obj \ $O\Alloc.obj \
@@ -140,13 +129,8 @@ OBJS = \
$(FM_OBJS)\ $(FM_OBJS)\
$(AR_COMMON_OBJS) \ $(AR_COMMON_OBJS) \
$(7Z_OBJS) \ $(7Z_OBJS) \
$(BRANCH_OPT_OBJS) \ $(COMPRESS_OBJS) \
$(COPY_OBJS) \ $(CRYPTO_OBJS) \
$(LZ_OBJS) \
$(LZMA_OPT_OBJS) \
$(PPMD_OPT_OBJS) \
$(7ZAES_OPT_OBJS) \
$(AES_OPT_OBJS) \
$O\MyMessages.obj \ $O\MyMessages.obj \
$(C_OBJS) \ $(C_OBJS) \
$(CRC_OBJS) \ $(CRC_OBJS) \
@@ -177,20 +161,9 @@ $(AR_COMMON_OBJS): ../../Archive/Common/$(*B).cpp
$(7Z_OBJS): ../../Archive/7z/$(*B).cpp $(7Z_OBJS): ../../Archive/7z/$(*B).cpp
$(COMPL) $(COMPL)
$(BRANCH_OPT_OBJS): ../../Compress/Branch/$(*B).cpp $(COMPRESS_OBJS): ../../Compress/$(*B).cpp
$(COMPL) $(COMPL)
$(COPY_OBJS): ../../Compress/Copy/$(*B).cpp $(CRYPTO_OBJS): ../../Crypto/$(*B).cpp
$(COMPL)
$(LZ_OBJS): ../../Compress/LZ/$(*B).cpp
$(COMPL)
$(LZMA_OPT_OBJS): ../../Compress/LZMA/$(*B).cpp
$(COMPL)
$(PPMD_OPT_OBJS): ../../Compress/PPMD/$(*B).cpp
$(COMPL)
$(7ZAES_OPT_OBJS): ../../Crypto/7zAES/$(*B).cpp
$(COMPL)
$(AES_OPT_OBJS): ../../Crypto/AES/$(*B).cpp
$(COMPL) $(COMPL)
$O\MyMessages.obj: ../../UI/Explorer/MyMessages.cpp $O\MyMessages.obj: ../../UI/Explorer/MyMessages.cpp

View File

@@ -1,11 +0,0 @@
// LSBFEncoder.cpp
#include "StdAfx.h"
#include "LSBFEncoder.h"
#include "Common/Defs.h"
namespace NStream {
namespace NLSBF {
}}

View File

@@ -2,9 +2,12 @@
#include "StdAfx.h" #include "StdAfx.h"
#include "MethodProps.h"
#include "../../Common/MyCom.h" #include "../../Common/MyCom.h"
#include "../ICoder.h"
#include "MethodProps.h"
static UInt64 k_LZMA = 0x030101; static UInt64 k_LZMA = 0x030101;
// static UInt64 k_LZMA2 = 0x030102; // static UInt64 k_LZMA2 = 0x030102;
@@ -35,24 +38,24 @@ HRESULT SetMethodProperties(const CMethod &method, const UInt64 *inSizeForReduce
} }
{ {
int numProperties = method.Properties.Size(); int numProps = method.Props.Size();
CMyComPtr<ICompressSetCoderProperties> setCoderProperties; CMyComPtr<ICompressSetCoderProperties> setCoderProperties;
coder->QueryInterface(IID_ICompressSetCoderProperties, (void **)&setCoderProperties); coder->QueryInterface(IID_ICompressSetCoderProperties, (void **)&setCoderProperties);
if (setCoderProperties == NULL) if (setCoderProperties == NULL)
{ {
if (numProperties != 0) if (numProps != 0)
return E_INVALIDARG; return E_INVALIDARG;
} }
else else
{ {
CRecordVector<PROPID> propIDs; CRecordVector<PROPID> propIDs;
NWindows::NCOM::CPropVariant *values = new NWindows::NCOM::CPropVariant[numProperties]; NWindows::NCOM::CPropVariant *values = new NWindows::NCOM::CPropVariant[numProps];
HRESULT res = S_OK; HRESULT res = S_OK;
try try
{ {
for (int i = 0; i < numProperties; i++) for (int i = 0; i < numProps; i++)
{ {
const CProp &prop = method.Properties[i]; const CProp &prop = method.Props[i];
propIDs.Add(prop.Id); propIDs.Add(prop.Id);
NWindows::NCOM::CPropVariant &value = values[i]; NWindows::NCOM::CPropVariant &value = values[i];
value = prop.Value; value = prop.Value;
@@ -65,7 +68,7 @@ HRESULT SetMethodProperties(const CMethod &method, const UInt64 *inSizeForReduce
} }
CMyComPtr<ICompressSetCoderProperties> setCoderProperties; CMyComPtr<ICompressSetCoderProperties> setCoderProperties;
coder->QueryInterface(IID_ICompressSetCoderProperties, (void **)&setCoderProperties); coder->QueryInterface(IID_ICompressSetCoderProperties, (void **)&setCoderProperties);
res = setCoderProperties->SetCoderProperties(&propIDs.Front(), values, numProperties); res = setCoderProperties->SetCoderProperties(&propIDs.Front(), values, numProps);
} }
catch(...) catch(...)
{ {

View File

@@ -3,11 +3,11 @@
#ifndef __7Z_METHOD_PROPS_H #ifndef __7Z_METHOD_PROPS_H
#define __7Z_METHOD_PROPS_H #define __7Z_METHOD_PROPS_H
#include "MethodId.h" #include "../../Common/MyVector.h"
#include "../../Windows/PropVariant.h" #include "../../Windows/PropVariant.h"
#include "../../Common/MyVector.h"
#include "../ICoder.h" #include "MethodId.h"
struct CProp struct CProp
{ {
@@ -18,7 +18,7 @@ struct CProp
struct CMethod struct CMethod
{ {
CMethodId Id; CMethodId Id;
CObjectVector<CProp> Properties; CObjectVector<CProp> Props;
}; };
struct CMethodsMode struct CMethodsMode

View File

@@ -1,64 +0,0 @@
// Arj/Decoder2.h
#ifndef __COMPRESS_ARJ_DECODER2_H
#define __COMPRESS_ARJ_DECODER2_H
#include "../../../Common/MyCom.h"
#include "../../ICoder.h"
#include "../../Common/MSBFDecoder.h"
#include "../../Common/InBuffer.h"
#include "../LZ/LZOutWindow.h"
/*
// {23170F69-40C1-278B-0404-020000000000}
DEFINE_GUID(CLSID_CCompressArj2Decoder,
0x23170F69, 0x40C1, 0x278B, 0x04, 0x04, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00);
*/
namespace NCompress {
namespace NArj {
namespace NDecoder2 {
class CCoder :
public ICompressCoder,
public CMyUnknownImp
{
CLZOutWindow m_OutWindowStream;
NStream::NMSBF::CDecoder<CInBuffer> m_InBitStream;
void ReleaseStreams()
{
m_OutWindowStream.ReleaseStream();
m_InBitStream.ReleaseStream();
}
class CCoderReleaser
{
CCoder *m_Coder;
public:
bool NeedFlush;
CCoderReleaser(CCoder *coder): m_Coder(coder), NeedFlush(true) {}
~CCoderReleaser()
{
if (NeedFlush)
m_Coder->m_OutWindowStream.Flush();
m_Coder->ReleaseStreams();
}
};
friend class CCoderReleaser;
HRESULT CodeReal(ISequentialInStream *inStream,
ISequentialOutStream *outStream, const UInt64 *inSize, const UInt64 *outSize,
ICompressProgressInfo *progress);
public:
MY_UNKNOWN_IMP
STDMETHOD(Code)(ISequentialInStream *inStream,
ISequentialOutStream *outStream, const UInt64 *inSize, const UInt64 *outSize,
ICompressProgressInfo *progress);
};
}}}
#endif

View File

@@ -1,8 +0,0 @@
// StdAfx.h
#ifndef __STDAFX_H
#define __STDAFX_H
#include "../../../Common/MyWindows.h"
#endif

View File

@@ -1,18 +1,16 @@
// Arj/Decoder.cpp // ArjDecoder1.cpp
#include "StdAfx.h" #include "StdAfx.h"
#include "ArjDecoder1.h" #include "ArjDecoder1.h"
#include "Windows/Defs.h"
namespace NCompress{ namespace NCompress{
namespace NArj { namespace NArj {
namespace NDecoder1 { namespace NDecoder1 {
static const UInt32 kHistorySize = 26624; static const UInt32 kHistorySize = 26624;
static const UInt32 kMatchMaxLen = 256;
static const UInt32 kMatchMinLen = 3; static const UInt32 kMatchMinLen = 3;
static const UInt32 kMatchMaxLen = 256;
// static const UInt32 kNC = 255 + kMatchMaxLen + 2 - kMatchMinLen; // static const UInt32 kNC = 255 + kMatchMaxLen + 2 - kMatchMinLen;
@@ -237,9 +235,8 @@ UInt32 CCoder::decode_p()
} }
HRESULT CCoder::CodeReal(ISequentialInStream *inStream, HRESULT CCoder::CodeReal(ISequentialInStream *inStream, ISequentialOutStream *outStream,
ISequentialOutStream *outStream, const UInt64 * /* inSize */, const UInt64 *outSize, const UInt64 * /* inSize */, const UInt64 *outSize, ICompressProgressInfo *progress)
ICompressProgressInfo *progress)
{ {
if (outSize == NULL) if (outSize == NULL)
return E_INVALIDARG; return E_INVALIDARG;
@@ -306,13 +303,12 @@ HRESULT CCoder::CodeReal(ISequentialInStream *inStream,
return m_OutWindowStream.Flush(); return m_OutWindowStream.Flush();
} }
STDMETHODIMP CCoder::Code(ISequentialInStream *inStream, STDMETHODIMP CCoder::Code(ISequentialInStream *inStream, ISequentialOutStream *outStream,
ISequentialOutStream *outStream, const UInt64 *inSize, const UInt64 *outSize, const UInt64 *inSize, const UInt64 *outSize, ICompressProgressInfo *progress)
ICompressProgressInfo *progress)
{ {
try { return CodeReal(inStream, outStream, inSize, outSize, progress);} try { return CodeReal(inStream, outStream, inSize, outSize, progress);}
catch(const CInBufferException &e) { return e.ErrorCode; } catch(const CInBufferException &e) { return e.ErrorCode; }
catch(const CLZOutWindowException &e) { return e.ErrorCode; } catch(const CLzOutWindowException &e) { return e.ErrorCode; }
catch(...) { return S_FALSE; } catch(...) { return S_FALSE; }
} }

View File

@@ -1,19 +1,16 @@
// Arj/Decoder1.h // ArjDecoder1.h
#ifndef __COMPRESS_ARJ_DECODER1_H #ifndef __COMPRESS_ARJ_DECODER1_H
#define __COMPRESS_ARJ_DECODER1_H #define __COMPRESS_ARJ_DECODER1_H
#include "../../../Common/MyCom.h" #include "../../Common/MyCom.h"
#include "../../ICoder.h"
#include "../../Common/MSBFDecoder.h"
#include "../../Common/InBuffer.h"
#include "../LZ/LZOutWindow.h"
/* #include "../ICoder.h"
// {23170F69-40C1-278B-0404-010000000000}
DEFINE_GUID(CLSID_CCompressArjDecoder, #include "../Common/InBuffer.h"
0x23170F69, 0x40C1, 0x278B, 0x04, 0x04, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00);
*/ #include "BitmDecoder.h"
#include "LzOutWindow.h"
namespace NCompress { namespace NCompress {
namespace NArj { namespace NArj {
@@ -47,8 +44,8 @@ class CCoder :
public ICompressCoder, public ICompressCoder,
public CMyUnknownImp public CMyUnknownImp
{ {
CLZOutWindow m_OutWindowStream; CLzOutWindow m_OutWindowStream;
NStream::NMSBF::CDecoder<CInBuffer> m_InBitStream; NBitm::CDecoder<CInBuffer> m_InBitStream;
UInt32 left[2 * NC - 1]; UInt32 left[2 * NC - 1];
UInt32 right[2 * NC - 1]; UInt32 right[2 * NC - 1];
@@ -86,15 +83,13 @@ class CCoder :
UInt32 decode_c(); UInt32 decode_c();
UInt32 decode_p(); UInt32 decode_p();
HRESULT CodeReal(ISequentialInStream *inStream, HRESULT CodeReal(ISequentialInStream *inStream, ISequentialOutStream *outStream,
ISequentialOutStream *outStream, const UInt64 *inSize, const UInt64 *outSize, const UInt64 *inSize, const UInt64 *outSize, ICompressProgressInfo *progress);
ICompressProgressInfo *progress);
public: public:
MY_UNKNOWN_IMP MY_UNKNOWN_IMP
STDMETHOD(Code)(ISequentialInStream *inStream, STDMETHOD(Code)(ISequentialInStream *inStream, ISequentialOutStream *outStream,
ISequentialOutStream *outStream, const UInt64 *inSize, const UInt64 *outSize, const UInt64 *inSize, const UInt64 *outSize, ICompressProgressInfo *progress);
ICompressProgressInfo *progress);
}; };

View File

@@ -1,4 +1,4 @@
// Arj/Decoder2.cpp // ArjDecoder2.cpp
#include "StdAfx.h" #include "StdAfx.h"
@@ -9,12 +9,10 @@ namespace NArj {
namespace NDecoder2 { namespace NDecoder2 {
static const UInt32 kHistorySize = 26624; static const UInt32 kHistorySize = 26624;
// static const UInt32 kMatchMaxLen = 256;
static const UInt32 kMatchMinLen = 3; static const UInt32 kMatchMinLen = 3;
HRESULT CCoder::CodeReal(ISequentialInStream *inStream, HRESULT CCoder::CodeReal(ISequentialInStream *inStream, ISequentialOutStream *outStream,
ISequentialOutStream *outStream, const UInt64 * /* inSize */, const UInt64 *outSize, const UInt64 * /* inSize */, const UInt64 *outSize, ICompressProgressInfo * /* progress */)
ICompressProgressInfo * /* progress */)
{ {
if (outSize == NULL) if (outSize == NULL)
return E_INVALIDARG; return E_INVALIDARG;
@@ -80,13 +78,12 @@ HRESULT CCoder::CodeReal(ISequentialInStream *inStream,
return m_OutWindowStream.Flush(); return m_OutWindowStream.Flush();
} }
STDMETHODIMP CCoder::Code(ISequentialInStream *inStream, STDMETHODIMP CCoder::Code(ISequentialInStream *inStream, ISequentialOutStream *outStream,
ISequentialOutStream *outStream, const UInt64 *inSize, const UInt64 *outSize, const UInt64 *inSize, const UInt64 *outSize, ICompressProgressInfo *progress)
ICompressProgressInfo *progress)
{ {
try { return CodeReal(inStream, outStream, inSize, outSize, progress);} try { return CodeReal(inStream, outStream, inSize, outSize, progress);}
catch(const CInBufferException &e) { return e.ErrorCode; } catch(const CInBufferException &e) { return e.ErrorCode; }
catch(const CLZOutWindowException &e) { return e.ErrorCode; } catch(const CLzOutWindowException &e) { return e.ErrorCode; }
catch(...) { return S_FALSE; } catch(...) { return S_FALSE; }
} }

59
CPP/7zip/Compress/ArjDecoder2.h Executable file
View File

@@ -0,0 +1,59 @@
// ArjDecoder2.h
#ifndef __COMPRESS_ARJ_DECODER2_H
#define __COMPRESS_ARJ_DECODER2_H
#include "../../Common/MyCom.h"
#include "../ICoder.h"
#include "../Common/InBuffer.h"
#include "BitmDecoder.h"
#include "LzOutWindow.h"
namespace NCompress {
namespace NArj {
namespace NDecoder2 {
class CCoder :
public ICompressCoder,
public CMyUnknownImp
{
CLzOutWindow m_OutWindowStream;
NBitm::CDecoder<CInBuffer> m_InBitStream;
void ReleaseStreams()
{
m_OutWindowStream.ReleaseStream();
m_InBitStream.ReleaseStream();
}
class CCoderReleaser
{
CCoder *m_Coder;
public:
bool NeedFlush;
CCoderReleaser(CCoder *coder): m_Coder(coder), NeedFlush(true) {}
~CCoderReleaser()
{
if (NeedFlush)
m_Coder->m_OutWindowStream.Flush();
m_Coder->ReleaseStreams();
}
};
friend class CCoderReleaser;
HRESULT CodeReal(ISequentialInStream *inStream, ISequentialOutStream *outStream,
const UInt64 *inSize, const UInt64 *outSize, ICompressProgressInfo *progress);
public:
MY_UNKNOWN_IMP
STDMETHOD(Code)(ISequentialInStream *inStream, ISequentialOutStream *outStream,
const UInt64 *inSize, const UInt64 *outSize, ICompressProgressInfo *progress);
};
}}}
#endif

View File

@@ -1,26 +0,0 @@
// BZip2CRC.cpp
#include "StdAfx.h"
#include "BZip2CRC.h"
UInt32 CBZip2CRC::Table[256];
static const UInt32 kBZip2CRCPoly = 0x04c11db7; /* AUTODIN II, Ethernet, & FDDI */
void CBZip2CRC::InitTable()
{
for (UInt32 i = 0; i < 256; i++)
{
UInt32 r = (i << 24);
for (int j = 8; j > 0; j--)
r = (r & 0x80000000) ? ((r << 1) ^ kBZip2CRCPoly) : (r << 1);
Table[i] = r;
}
}
class CBZip2CRCTableInit
{
public:
CBZip2CRCTableInit() { CBZip2CRC::InitTable(); }
} g_BZip2CRCTableInit;

View File

@@ -1,8 +0,0 @@
// StdAfx.h
#ifndef __STDAFX_H
#define __STDAFX_H
#include "../../../Common/MyWindows.h"
#endif

26
CPP/7zip/Compress/BZip2Crc.cpp Executable file
View File

@@ -0,0 +1,26 @@
// BZip2Crc.cpp
#include "StdAfx.h"
#include "BZip2Crc.h"
UInt32 CBZip2Crc::Table[256];
static const UInt32 kBZip2CrcPoly = 0x04c11db7; /* AUTODIN II, Ethernet, & FDDI */
void CBZip2Crc::InitTable()
{
for (UInt32 i = 0; i < 256; i++)
{
UInt32 r = (i << 24);
for (int j = 8; j > 0; j--)
r = (r & 0x80000000) ? ((r << 1) ^ kBZip2CrcPoly) : (r << 1);
Table[i] = r;
}
}
class CBZip2CrcTableInit
{
public:
CBZip2CrcTableInit() { CBZip2Crc::InitTable(); }
} g_BZip2CrcTableInit;

View File

@@ -1,28 +1,28 @@
// BZip2CRC.h // BZip2Crc.h
#ifndef __BZIP2_CRC_H #ifndef __BZIP2_CRC_H
#define __BZIP2_CRC_H #define __BZIP2_CRC_H
#include "Common/Types.h" #include "Common/Types.h"
class CBZip2CRC class CBZip2Crc
{ {
UInt32 _value; UInt32 _value;
static UInt32 Table[256]; static UInt32 Table[256];
public: public:
static void InitTable(); static void InitTable();
CBZip2CRC(): _value(0xFFFFFFFF) {}; CBZip2Crc(): _value(0xFFFFFFFF) {};
void Init() { _value = 0xFFFFFFFF; } void Init() { _value = 0xFFFFFFFF; }
void UpdateByte(Byte b) { _value = Table[(_value >> 24) ^ b] ^ (_value << 8); } void UpdateByte(Byte b) { _value = Table[(_value >> 24) ^ b] ^ (_value << 8); }
void UpdateByte(unsigned int b) { _value = Table[(_value >> 24) ^ b] ^ (_value << 8); } void UpdateByte(unsigned int b) { _value = Table[(_value >> 24) ^ b] ^ (_value << 8); }
UInt32 GetDigest() const { return _value ^ 0xFFFFFFFF; } UInt32 GetDigest() const { return _value ^ 0xFFFFFFFF; }
}; };
class CBZip2CombinedCRC class CBZip2CombinedCrc
{ {
UInt32 _value; UInt32 _value;
public: public:
CBZip2CombinedCRC(): _value(0){}; CBZip2CombinedCrc(): _value(0){};
void Init() { _value = 0; } void Init() { _value = 0; }
void Update(UInt32 v) { _value = ((_value << 1) | (_value >> 31)) ^ v; } void Update(UInt32 v) { _value = ((_value << 1) | (_value >> 31)) ^ v; }
UInt32 GetDigest() const { return _value ; } UInt32 GetDigest() const { return _value ; }

View File

@@ -2,20 +2,22 @@
#include "StdAfx.h" #include "StdAfx.h"
#include "BZip2Decoder.h"
extern "C" extern "C"
{ {
#include "../../../../C/Alloc.h" #include "../../../C/Alloc.h"
} }
#include "../../../Common/Defs.h" #include "../../Common/Defs.h"
#include "../BWT/Mtf8.h"
#include "BZip2CRC.h" #include "BZip2Crc.h"
#include "BZip2Decoder.h"
#include "Mtf8.h"
namespace NCompress { namespace NCompress {
namespace NBZip2 { namespace NBZip2 {
#define NO_INLINE MY_FAST_CALL
const UInt32 kNumThreadsMax = 4; const UInt32 kNumThreadsMax = 4;
static const UInt32 kBufferSize = (1 << 17); static const UInt32 kBufferSize = (1 << 17);
@@ -92,7 +94,7 @@ UInt32 CDecoder::ReadBits(int numBits) { return m_InStream.ReadBits(numBits); }
Byte CDecoder::ReadByte() {return (Byte)ReadBits(8); } Byte CDecoder::ReadByte() {return (Byte)ReadBits(8); }
bool CDecoder::ReadBit() { return ReadBits(1) != 0; } bool CDecoder::ReadBit() { return ReadBits(1) != 0; }
UInt32 CDecoder::ReadCRC() UInt32 CDecoder::ReadCrc()
{ {
UInt32 crc = 0; UInt32 crc = 0;
for (int i = 0; i < 4; i++) for (int i = 0; i < 4; i++)
@@ -103,17 +105,17 @@ UInt32 CDecoder::ReadCRC()
return crc; return crc;
} }
UInt32 NO_INLINE ReadBits(NStream::NMSBF::CDecoder<CInBuffer> *m_InStream, int num) UInt32 NO_INLINE ReadBits(NBitm::CDecoder<CInBuffer> *m_InStream, int num)
{ {
return m_InStream->ReadBits(num); return m_InStream->ReadBits(num);
} }
UInt32 NO_INLINE ReadBit(NStream::NMSBF::CDecoder<CInBuffer> *m_InStream) UInt32 NO_INLINE ReadBit(NBitm::CDecoder<CInBuffer> *m_InStream)
{ {
return m_InStream->ReadBits(1); return m_InStream->ReadBits(1);
} }
static HRESULT NO_INLINE ReadBlock(NStream::NMSBF::CDecoder<CInBuffer> *m_InStream, static HRESULT NO_INLINE ReadBlock(NBitm::CDecoder<CInBuffer> *m_InStream,
UInt32 *CharCounters, UInt32 blockSizeMax, Byte *m_Selectors, CHuffmanDecoder *m_HuffmanDecoders, UInt32 *CharCounters, UInt32 blockSizeMax, Byte *m_Selectors, CHuffmanDecoder *m_HuffmanDecoders,
UInt32 *blockSizeRes, UInt32 *origPtrRes, bool *randRes) UInt32 *blockSizeRes, UInt32 *origPtrRes, bool *randRes)
{ {
@@ -280,7 +282,7 @@ void NO_INLINE DecodeBlock1(UInt32 *charCounters, UInt32 blockSize)
static UInt32 NO_INLINE DecodeBlock2(const UInt32 *tt, UInt32 blockSize, UInt32 OrigPtr, COutBuffer &m_OutStream) static UInt32 NO_INLINE DecodeBlock2(const UInt32 *tt, UInt32 blockSize, UInt32 OrigPtr, COutBuffer &m_OutStream)
{ {
CBZip2CRC crc; CBZip2Crc crc;
// it's for speed optimization: prefetch & prevByte_init; // it's for speed optimization: prefetch & prevByte_init;
UInt32 tPos = tt[tt[OrigPtr] >> 8]; UInt32 tPos = tt[tt[OrigPtr] >> 8];
@@ -371,7 +373,7 @@ static UInt32 NO_INLINE DecodeBlock2(const UInt32 *tt, UInt32 blockSize, UInt32
static UInt32 NO_INLINE DecodeBlock2Rand(const UInt32 *tt, UInt32 blockSize, UInt32 OrigPtr, COutBuffer &m_OutStream) static UInt32 NO_INLINE DecodeBlock2Rand(const UInt32 *tt, UInt32 blockSize, UInt32 OrigPtr, COutBuffer &m_OutStream)
{ {
CBZip2CRC crc; CBZip2Crc crc;
UInt32 randIndex = 1; UInt32 randIndex = 1;
UInt32 randToGo = kRandNums[0] - 2; UInt32 randToGo = kRandNums[0] - 2;
@@ -492,7 +494,7 @@ HRESULT CDecoder::ReadSignatures(bool &wasFinished, UInt32 &crc)
Byte s[6]; Byte s[6];
for (int i = 0; i < 6; i++) for (int i = 0; i < 6; i++)
s[i] = ReadByte(); s[i] = ReadByte();
crc = ReadCRC(); crc = ReadCrc();
if (s[0] == kFinSig0) if (s[0] == kFinSig0)
{ {
if (s[1] != kFinSig1 || if (s[1] != kFinSig1 ||
@@ -503,7 +505,7 @@ HRESULT CDecoder::ReadSignatures(bool &wasFinished, UInt32 &crc)
return S_FALSE; return S_FALSE;
wasFinished = true; wasFinished = true;
return (crc == CombinedCRC.GetDigest()) ? S_OK : S_FALSE; return (crc == CombinedCrc.GetDigest()) ? S_OK : S_FALSE;
} }
if (s[0] != kBlockSig0 || if (s[0] != kBlockSig0 ||
s[1] != kBlockSig1 || s[1] != kBlockSig1 ||
@@ -512,7 +514,7 @@ HRESULT CDecoder::ReadSignatures(bool &wasFinished, UInt32 &crc)
s[4] != kBlockSig4 || s[4] != kBlockSig4 ||
s[5] != kBlockSig5) s[5] != kBlockSig5)
return S_FALSE; return S_FALSE;
CombinedCRC.Update(crc); CombinedCrc.Update(crc);
return S_OK; return S_OK;
} }
@@ -552,7 +554,7 @@ HRESULT CDecoder::DecodeFile(bool &isBZ, ICompressProgressInfo *progress)
isBZ = true; isBZ = true;
UInt32 dicSize = (UInt32)(s[3] - kArSig3) * kBlockSizeStep; UInt32 dicSize = (UInt32)(s[3] - kArSig3) * kBlockSizeStep;
CombinedCRC.Init(); CombinedCrc.Init();
#ifdef COMPRESS_BZIP2_MT #ifdef COMPRESS_BZIP2_MT
if (MtMode) if (MtMode)
{ {
@@ -608,9 +610,8 @@ HRESULT CDecoder::DecodeFile(bool &isBZ, ICompressProgressInfo *progress)
return S_OK; return S_OK;
} }
HRESULT CDecoder::CodeReal(ISequentialInStream *inStream, HRESULT CDecoder::CodeReal(ISequentialInStream *inStream, ISequentialOutStream *outStream,
ISequentialOutStream *outStream, const UInt64 * /* inSize */, const UInt64 * /* outSize */, const UInt64 * /* inSize */, const UInt64 * /* outSize */, ICompressProgressInfo *progress)
ICompressProgressInfo *progress)
{ {
if (!m_InStream.Create(kBufferSize)) if (!m_InStream.Create(kBufferSize))
return E_OUTOFMEMORY; return E_OUTOFMEMORY;
@@ -630,9 +631,8 @@ HRESULT CDecoder::CodeReal(ISequentialInStream *inStream,
return isBZ ? S_OK: S_FALSE; return isBZ ? S_OK: S_FALSE;
} }
STDMETHODIMP CDecoder::Code(ISequentialInStream *inStream, STDMETHODIMP CDecoder::Code(ISequentialInStream *inStream, ISequentialOutStream *outStream,
ISequentialOutStream *outStream, const UInt64 *inSize, const UInt64 *outSize, const UInt64 *inSize, const UInt64 *outSize, ICompressProgressInfo *progress)
ICompressProgressInfo *progress)
{ {
try { return CodeReal(inStream, outStream, inSize, outSize, progress); } try { return CodeReal(inStream, outStream, inSize, outSize, progress); }
catch(const CInBufferException &e) { return e.ErrorCode; } catch(const CInBufferException &e) { return e.ErrorCode; }

View File

@@ -1,23 +1,24 @@
// Compress/BZip2/Decoder.h // Compress/BZip2Decoder.h
#ifndef __COMPRESS_BZIP2_DECODER_H #ifndef __COMPRESS_BZIP2_DECODER_H
#define __COMPRESS_BZIP2_DECODER_H #define __COMPRESS_BZIP2_DECODER_H
#include "../../ICoder.h" #include "../../Common/MyCom.h"
#include "../../../Common/MyCom.h"
#include "../../Common/MSBFDecoder.h"
#include "../../Common/InBuffer.h"
#include "../../Common/OutBuffer.h"
#include "../Huffman/HuffmanDecoder.h"
#include "BZip2Const.h"
#include "BZip2CRC.h"
#ifdef COMPRESS_BZIP2_MT #ifdef COMPRESS_BZIP2_MT
#include "../../../Windows/Thread.h" #include "../../Windows/Synchronization.h"
#include "../../../Windows/Synchronization.h" #include "../../Windows/Thread.h"
#endif #endif
#define NO_INLINE MY_FAST_CALL #include "../ICoder.h"
#include "../Common/InBuffer.h"
#include "../Common/OutBuffer.h"
#include "BitmDecoder.h"
#include "BZip2Const.h"
#include "BZip2Crc.h"
#include "HuffmanDecoder.h"
namespace NCompress { namespace NCompress {
namespace NBZip2 { namespace NBZip2 {
@@ -67,7 +68,7 @@ class CDecoder :
public: public:
COutBuffer m_OutStream; COutBuffer m_OutStream;
Byte MtPad[1 << 8]; // It's pad for Multi-Threading. Must be >= Cache_Line_Size. Byte MtPad[1 << 8]; // It's pad for Multi-Threading. Must be >= Cache_Line_Size.
NStream::NMSBF::CDecoder<CInBuffer> m_InStream; NBitm::CDecoder<CInBuffer> m_InStream;
Byte m_Selectors[kNumSelectorsMax]; Byte m_Selectors[kNumSelectorsMax];
CHuffmanDecoder m_HuffmanDecoders[kNumTablesMax]; CHuffmanDecoder m_HuffmanDecoders[kNumTablesMax];
private: private:
@@ -77,12 +78,11 @@ private:
UInt32 ReadBits(int numBits); UInt32 ReadBits(int numBits);
Byte ReadByte(); Byte ReadByte();
bool ReadBit(); bool ReadBit();
UInt32 ReadCRC(); UInt32 ReadCrc();
HRESULT PrepareBlock(CState &state); HRESULT PrepareBlock(CState &state);
HRESULT DecodeFile(bool &isBZ, ICompressProgressInfo *progress); HRESULT DecodeFile(bool &isBZ, ICompressProgressInfo *progress);
HRESULT CodeReal(ISequentialInStream *inStream, HRESULT CodeReal(ISequentialInStream *inStream, ISequentialOutStream *outStream,
ISequentialOutStream *outStream, const UInt64 *inSize, const UInt64 *outSize, const UInt64 *inSize, const UInt64 *outSize, ICompressProgressInfo *progress);
ICompressProgressInfo *progress);
class CDecoderFlusher class CDecoderFlusher
{ {
CDecoder *_decoder; CDecoder *_decoder;
@@ -98,7 +98,7 @@ private:
}; };
public: public:
CBZip2CombinedCRC CombinedCRC; CBZip2CombinedCrc CombinedCrc;
#ifdef COMPRESS_BZIP2_MT #ifdef COMPRESS_BZIP2_MT
ICompressProgressInfo *Progress; ICompressProgressInfo *Progress;
@@ -144,9 +144,8 @@ public:
#endif #endif
STDMETHOD(Code)(ISequentialInStream *inStream, STDMETHOD(Code)(ISequentialInStream *inStream, ISequentialOutStream *outStream,
ISequentialOutStream *outStream, const UInt64 *inSize, const UInt64 *outSize, const UInt64 *inSize, const UInt64 *outSize, ICompressProgressInfo *progress);
ICompressProgressInfo *progress);
STDMETHOD(GetInStreamProcessedSize)(UInt64 *value); STDMETHOD(GetInStreamProcessedSize)(UInt64 *value);

View File

@@ -4,15 +4,14 @@
extern "C" extern "C"
{ {
#include "../../../../C/Alloc.h" #include "../../../C/Alloc.h"
#include "../../../../C/BwtSort.h" #include "../../../C/BwtSort.h"
#include "../../../../C/HuffEnc.h" #include "../../../C/HuffEnc.h"
} }
#include "BZip2Crc.h"
#include "BZip2Encoder.h" #include "BZip2Encoder.h"
#include "Mtf8.h"
#include "../BWT/Mtf8.h"
#include "BZip2CRC.h"
namespace NCompress { namespace NCompress {
namespace NBZip2 { namespace NBZip2 {
@@ -239,7 +238,7 @@ void CThreadInfo::WriteBits2(UInt32 value, UInt32 numBits)
{ m_OutStreamCurrent->WriteBits(value, numBits); } { m_OutStreamCurrent->WriteBits(value, numBits); }
void CThreadInfo::WriteByte2(Byte b) { WriteBits2(b , 8); } void CThreadInfo::WriteByte2(Byte b) { WriteBits2(b , 8); }
void CThreadInfo::WriteBit2(bool v) { WriteBits2((v ? 1 : 0), 1); } void CThreadInfo::WriteBit2(bool v) { WriteBits2((v ? 1 : 0), 1); }
void CThreadInfo::WriteCRC2(UInt32 v) void CThreadInfo::WriteCrc2(UInt32 v)
{ {
for (int i = 0; i < 4; i++) for (int i = 0; i < 4; i++)
WriteByte2(((Byte)(v >> (24 - i * 8)))); WriteByte2(((Byte)(v >> (24 - i * 8))));
@@ -249,7 +248,7 @@ void CEncoder::WriteBits(UInt32 value, UInt32 numBits)
{ m_OutStream.WriteBits(value, numBits); } { m_OutStream.WriteBits(value, numBits); }
void CEncoder::WriteByte(Byte b) { WriteBits(b , 8); } void CEncoder::WriteByte(Byte b) { WriteBits(b , 8); }
void CEncoder::WriteBit(bool v) { WriteBits((v ? 1 : 0), 1); } void CEncoder::WriteBit(bool v) { WriteBits((v ? 1 : 0), 1); }
void CEncoder::WriteCRC(UInt32 v) void CEncoder::WriteCrc(UInt32 v)
{ {
for (int i = 0; i < 4; i++) for (int i = 0; i < 4; i++)
WriteByte(((Byte)(v >> (24 - i * 8)))); WriteByte(((Byte)(v >> (24 - i * 8))));
@@ -284,7 +283,7 @@ void CThreadInfo::EncodeBlock(const Byte *block, UInt32 blockSize)
if (inUse[i]) if (inUse[i])
{ {
inUse16[i >> 4] = true; inUse16[i >> 4] = true;
mtf.Buffer[numInUse++] = (Byte)i; mtf.Buf[numInUse++] = (Byte)i;
} }
for (i = 0; i < 16; i++) for (i = 0; i < 16; i++)
WriteBit2(inUse16[i]); WriteBit2(inUse16[i]);
@@ -583,7 +582,7 @@ UInt32 CThreadInfo::EncodeBlockWithHeaders(const Byte *block, UInt32 blockSize)
WriteByte2(kBlockSig4); WriteByte2(kBlockSig4);
WriteByte2(kBlockSig5); WriteByte2(kBlockSig5);
CBZip2CRC crc; CBZip2Crc crc;
int numReps = 0; int numReps = 0;
Byte prevByte = block[0]; Byte prevByte = block[0];
UInt32 i = 0; UInt32 i = 0;
@@ -608,7 +607,7 @@ UInt32 CThreadInfo::EncodeBlockWithHeaders(const Byte *block, UInt32 blockSize)
} }
while (++i < blockSize); while (++i < blockSize);
UInt32 crcRes = crc.GetDigest(); UInt32 crcRes = crc.GetDigest();
WriteCRC2(crcRes); WriteCrc2(crcRes);
EncodeBlock(block, blockSize); EncodeBlock(block, blockSize);
return crcRes; return crcRes;
} }
@@ -689,7 +688,7 @@ HRESULT CThreadInfo::EncodeBlock3(UInt32 blockSize)
Encoder->ThreadsInfo[m_BlockIndex].CanWriteEvent.Lock(); Encoder->ThreadsInfo[m_BlockIndex].CanWriteEvent.Lock();
#endif #endif
for (UInt32 i = 0; i < m_NumCrcs; i++) for (UInt32 i = 0; i < m_NumCrcs; i++)
Encoder->CombinedCRC.Update(m_CRCs[i]); Encoder->CombinedCrc.Update(m_CRCs[i]);
Encoder->WriteBytes(m_TempArray, outStreamTemp.GetPos(), outStreamTemp.GetCurByte()); Encoder->WriteBytes(m_TempArray, outStreamTemp.GetPos(), outStreamTemp.GetCurByte());
HRESULT res = S_OK; HRESULT res = S_OK;
#ifdef COMPRESS_BZIP2_MT #ifdef COMPRESS_BZIP2_MT
@@ -720,9 +719,8 @@ void CEncoder::WriteBytes(const Byte *data, UInt32 sizeInBits, Byte lastByte)
} }
HRESULT CEncoder::CodeReal(ISequentialInStream *inStream, HRESULT CEncoder::CodeReal(ISequentialInStream *inStream, ISequentialOutStream *outStream,
ISequentialOutStream *outStream, const UInt64 * /* inSize */, const UInt64 * /* outSize */, const UInt64 * /* inSize */, const UInt64 * /* outSize */, ICompressProgressInfo *progress)
ICompressProgressInfo *progress)
{ {
#ifdef COMPRESS_BZIP2_MT #ifdef COMPRESS_BZIP2_MT
Progress = progress; Progress = progress;
@@ -764,7 +762,7 @@ HRESULT CEncoder::CodeReal(ISequentialInStream *inStream,
CFlusher flusher(this); CFlusher flusher(this);
CombinedCRC.Init(); CombinedCrc.Init();
#ifdef COMPRESS_BZIP2_MT #ifdef COMPRESS_BZIP2_MT
NextBlockIndex = 0; NextBlockIndex = 0;
StreamWasFinished = false; StreamWasFinished = false;
@@ -824,13 +822,12 @@ HRESULT CEncoder::CodeReal(ISequentialInStream *inStream,
WriteByte(kFinSig4); WriteByte(kFinSig4);
WriteByte(kFinSig5); WriteByte(kFinSig5);
WriteCRC(CombinedCRC.GetDigest()); WriteCrc(CombinedCrc.GetDigest());
return S_OK; return S_OK;
} }
STDMETHODIMP CEncoder::Code(ISequentialInStream *inStream, STDMETHODIMP CEncoder::Code(ISequentialInStream *inStream, ISequentialOutStream *outStream,
ISequentialOutStream *outStream, const UInt64 *inSize, const UInt64 *outSize, const UInt64 *inSize, const UInt64 *outSize, ICompressProgressInfo *progress)
ICompressProgressInfo *progress)
{ {
try { return CodeReal(inStream, outStream, inSize, outSize, progress); } try { return CodeReal(inStream, outStream, inSize, outSize, progress); }
catch(const CInBufferException &e) { return e.ErrorCode; } catch(const CInBufferException &e) { return e.ErrorCode; }
@@ -838,19 +835,18 @@ STDMETHODIMP CEncoder::Code(ISequentialInStream *inStream,
catch(...) { return S_FALSE; } catch(...) { return S_FALSE; }
} }
HRESULT CEncoder::SetCoderProperties(const PROPID *propIDs, HRESULT CEncoder::SetCoderProperties(const PROPID *propIDs, const PROPVARIANT *props, UInt32 numProps)
const PROPVARIANT *properties, UInt32 numProperties)
{ {
for(UInt32 i = 0; i < numProperties; i++) for(UInt32 i = 0; i < numProps; i++)
{ {
const PROPVARIANT &property = properties[i]; const PROPVARIANT &prop = props[i];
switch(propIDs[i]) switch(propIDs[i])
{ {
case NCoderPropID::kNumPasses: case NCoderPropID::kNumPasses:
{ {
if (property.vt != VT_UI4) if (prop.vt != VT_UI4)
return E_INVALIDARG; return E_INVALIDARG;
UInt32 numPasses = property.ulVal; UInt32 numPasses = prop.ulVal;
if (numPasses == 0) if (numPasses == 0)
numPasses = 1; numPasses = 1;
if (numPasses > kNumPassesMax) if (numPasses > kNumPassesMax)
@@ -861,9 +857,9 @@ HRESULT CEncoder::SetCoderProperties(const PROPID *propIDs,
} }
case NCoderPropID::kDictionarySize: case NCoderPropID::kDictionarySize:
{ {
if (property.vt != VT_UI4) if (prop.vt != VT_UI4)
return E_INVALIDARG; return E_INVALIDARG;
UInt32 dictionary = property.ulVal / kBlockSizeStep; UInt32 dictionary = prop.ulVal / kBlockSizeStep;
if (dictionary < kBlockSizeMultMin) if (dictionary < kBlockSizeMultMin)
dictionary = kBlockSizeMultMin; dictionary = kBlockSizeMultMin;
else if (dictionary > kBlockSizeMultMax) else if (dictionary > kBlockSizeMultMax)
@@ -874,9 +870,9 @@ HRESULT CEncoder::SetCoderProperties(const PROPID *propIDs,
case NCoderPropID::kNumThreads: case NCoderPropID::kNumThreads:
{ {
#ifdef COMPRESS_BZIP2_MT #ifdef COMPRESS_BZIP2_MT
if (property.vt != VT_UI4) if (prop.vt != VT_UI4)
return E_INVALIDARG; return E_INVALIDARG;
NumThreads = property.ulVal; NumThreads = prop.ulVal;
if (NumThreads < 1) if (NumThreads < 1)
NumThreads = 1; NumThreads = 1;
#endif #endif

View File

@@ -1,21 +1,25 @@
// Compress/BZip2/Encoder.h // Compress/BZip2Encoder.h
#ifndef __COMPRESS_BZIP2_ENCODER_H #ifndef __COMPRESS_BZIP2_ENCODER_H
#define __COMPRESS_BZIP2_ENCODER_H #define __COMPRESS_BZIP2_ENCODER_H
#include "../../ICoder.h" #include "../../Common/Defs.h"
#include "../../../Common/MyCom.h" #include "../../Common/MyCom.h"
#include "../../Common/MSBFEncoder.h"
#include "../../Common/InBuffer.h"
#include "../../Common/OutBuffer.h"
#include "BZip2Const.h"
#include "BZip2CRC.h"
#ifdef COMPRESS_BZIP2_MT #ifdef COMPRESS_BZIP2_MT
#include "../../../Windows/Thread.h" #include "../../Windows/Synchronization.h"
#include "../../../Windows/Synchronization.h" #include "../../Windows/Thread.h"
#endif #endif
#include "../ICoder.h"
#include "../Common/InBuffer.h"
#include "../Common/OutBuffer.h"
#include "BitmEncoder.h"
#include "BZip2Const.h"
#include "BZip2Crc.h"
namespace NCompress { namespace NCompress {
namespace NBZip2 { namespace NBZip2 {
@@ -38,13 +42,13 @@ public:
void Flush() void Flush()
{ {
if(m_BitPos < 8) if (m_BitPos < 8)
WriteBits(0, m_BitPos); WriteBits(0, m_BitPos);
} }
void WriteBits(UInt32 value, int numBits) void WriteBits(UInt32 value, int numBits)
{ {
while(numBits > 0) while (numBits > 0)
{ {
int numNewBits = MyMin(numBits, m_BitPos); int numNewBits = MyMin(numBits, m_BitPos);
numBits -= numNewBits; numBits -= numNewBits;
@@ -108,7 +112,7 @@ private:
void WriteBits2(UInt32 value, UInt32 numBits); void WriteBits2(UInt32 value, UInt32 numBits);
void WriteByte2(Byte b); void WriteByte2(Byte b);
void WriteBit2(bool v); void WriteBit2(bool v);
void WriteCRC2(UInt32 v); void WriteCrc2(UInt32 v);
void EncodeBlock(const Byte *block, UInt32 blockSize); void EncodeBlock(const Byte *block, UInt32 blockSize);
UInt32 EncodeBlockWithHeaders(const Byte *block, UInt32 blockSize); UInt32 EncodeBlockWithHeaders(const Byte *block, UInt32 blockSize);
@@ -158,9 +162,9 @@ class CEncoder :
public: public:
CInBuffer m_InStream; CInBuffer m_InStream;
Byte MtPad[1 << 8]; // It's pad for Multi-Threading. Must be >= Cache_Line_Size. Byte MtPad[1 << 8]; // It's pad for Multi-Threading. Must be >= Cache_Line_Size.
NStream::NMSBF::CEncoder<COutBuffer> m_OutStream; CBitmEncoder<COutBuffer> m_OutStream;
UInt32 NumPasses; UInt32 NumPasses;
CBZip2CombinedCRC CombinedCRC; CBZip2CombinedCrc CombinedCrc;
#ifdef COMPRESS_BZIP2_MT #ifdef COMPRESS_BZIP2_MT
CThreadInfo *ThreadsInfo; CThreadInfo *ThreadsInfo;
@@ -186,7 +190,7 @@ public:
void WriteBits(UInt32 value, UInt32 numBits); void WriteBits(UInt32 value, UInt32 numBits);
void WriteByte(Byte b); void WriteByte(Byte b);
void WriteBit(bool v); void WriteBit(bool v);
void WriteCRC(UInt32 v); void WriteCrc(UInt32 v);
#ifdef COMPRESS_BZIP2_MT #ifdef COMPRESS_BZIP2_MT
HRESULT Create(); HRESULT Create();
@@ -227,15 +231,12 @@ public:
MY_UNKNOWN_IMP1(ICompressSetCoderProperties) MY_UNKNOWN_IMP1(ICompressSetCoderProperties)
#endif #endif
HRESULT CodeReal(ISequentialInStream *inStream, HRESULT CodeReal(ISequentialInStream *inStream, ISequentialOutStream *outStream,
ISequentialOutStream *outStream, const UInt64 *inSize, const UInt64 *outSize, const UInt64 *inSize, const UInt64 *outSize, ICompressProgressInfo *progress);
ICompressProgressInfo *progress);
STDMETHOD(Code)(ISequentialInStream *inStream, STDMETHOD(Code)(ISequentialInStream *inStream, ISequentialOutStream *outStream,
ISequentialOutStream *outStream, const UInt64 *inSize, const UInt64 *outSize, const UInt64 *inSize, const UInt64 *outSize, ICompressProgressInfo *progress);
ICompressProgressInfo *progress); STDMETHOD(SetCoderProperties)(const PROPID *propIDs, const PROPVARIANT *props, UInt32 numProps);
STDMETHOD(SetCoderProperties)(const PROPID *propIDs,
const PROPVARIANT *properties, UInt32 numProperties);
#ifdef COMPRESS_BZIP2_MT #ifdef COMPRESS_BZIP2_MT
STDMETHOD(SetNumberOfThreads)(UInt32 numThreads); STDMETHOD(SetNumberOfThreads)(UInt32 numThreads);

View File

@@ -1,10 +1,11 @@
// Bzip2Register.cpp // BZip2Register.cpp
#include "StdAfx.h" #include "StdAfx.h"
#include "../../Common/RegisterCodec.h" #include "../Common/RegisterCodec.h"
#include "BZip2Decoder.h" #include "BZip2Decoder.h"
static void *CreateCodec() { return (void *)(ICompressCoder *)(new NCompress::NBZip2::CDecoder); } static void *CreateCodec() { return (void *)(ICompressCoder *)(new NCompress::NBZip2::CDecoder); }
#if !defined(EXTRACT_ONLY) && !defined(BZIP2_EXTRACT_ONLY) #if !defined(EXTRACT_ONLY) && !defined(BZIP2_EXTRACT_ONLY)
#include "BZip2Encoder.h" #include "BZip2Encoder.h"

View File

@@ -1,13 +1,14 @@
// x86_2.cpp // Bcj2Coder.cpp
#include "StdAfx.h" #include "StdAfx.h"
#include "x86_2.h"
extern "C" extern "C"
{ {
#include "../../../../C/Alloc.h" #include "../../../C/Alloc.h"
} }
#include "Bcj2Coder.h"
namespace NCompress { namespace NCompress {
namespace NBcj2 { namespace NBcj2 {

View File

@@ -1,11 +1,13 @@
// x86_2.h // Bcj2Coder.h
#ifndef __BRANCH_X86_2_H #ifndef __COMPRESS_BCJ2_CODER_H
#define __BRANCH_X86_2_H #define __COMPRESS_BCJ2_CODER_H
#include "../../../Common/MyCom.h" #include "../../Common/MyCom.h"
#include "../RangeCoder/RangeCoderBit.h"
#include "../../ICoder.h" #include "../ICoder.h"
#include "RangeCoderBit.h"
namespace NCompress { namespace NCompress {
namespace NBcj2 { namespace NBcj2 {

View File

@@ -1,10 +1,11 @@
// BranchRegister.cpp // Bcj2Register.cpp
#include "StdAfx.h" #include "StdAfx.h"
#include "../../Common/RegisterCodec.h" #include "../Common/RegisterCodec.h"
#include "Bcj2Coder.h"
#include "x86_2.h"
static void *CreateCodec() { return (void *)(ICompressCoder2 *)(new NCompress::NBcj2::CDecoder()); } static void *CreateCodec() { return (void *)(ICompressCoder2 *)(new NCompress::NBcj2::CDecoder()); }
#ifndef EXTRACT_ONLY #ifndef EXTRACT_ONLY
static void *CreateCodecOut() { return (void *)(ICompressCoder2 *)(new NCompress::NBcj2::CEncoder()); } static void *CreateCodecOut() { return (void *)(ICompressCoder2 *)(new NCompress::NBcj2::CEncoder()); }

View File

@@ -1,7 +1,8 @@
// x86.cpp // BcjCoder.cpp
#include "StdAfx.h" #include "StdAfx.h"
#include "x86.h"
#include "BcjCoder.h"
UInt32 CBCJ_x86_Encoder::SubFilter(Byte *data, UInt32 size) UInt32 CBCJ_x86_Encoder::SubFilter(Byte *data, UInt32 size)
{ {

View File

@@ -1,14 +1,15 @@
// x86.h // BcjCoder.h
#ifndef __X86_H #ifndef __COMPRESS_BCJ_CODER_H
#define __X86_H #define __COMPRESS_BCJ_CODER_H
#include "BranchCoder.h"
extern "C" extern "C"
{ {
#include "../../../../C/Bra.h" #include "../../../C/Bra.h"
} }
#include "BranchCoder.h"
struct CBranch86 struct CBranch86
{ {
UInt32 _prevMask; UInt32 _prevMask;

View File

@@ -1,10 +1,11 @@
// BranchRegister.cpp // BcjRegister.cpp
#include "StdAfx.h" #include "StdAfx.h"
#include "../../Common/RegisterCodec.h" #include "../Common/RegisterCodec.h"
#include "BcjCoder.h"
#include "x86.h"
static void *CreateCodec() { return (void *)(ICompressFilter *)(new CBCJ_x86_Decoder()); } static void *CreateCodec() { return (void *)(ICompressFilter *)(new CBCJ_x86_Decoder()); }
#ifndef EXTRACT_ONLY #ifndef EXTRACT_ONLY
static void *CreateCodecOut() { return (void *)(ICompressFilter *)(new CBCJ_x86_Encoder()); } static void *CreateCodecOut() { return (void *)(ICompressFilter *)(new CBCJ_x86_Encoder()); }

View File

@@ -1,17 +1,15 @@
// Stream/LSBFDecoder.cpp // BitlDecoder.cpp
#include "StdAfx.h" #include "StdAfx.h"
#include "LSBFDecoder.h" #include "BitlDecoder.h"
namespace NStream { namespace NBitl {
namespace NLSBF {
Byte kInvertTable[256]; Byte kInvertTable[256];
class CInverterTableInitializer struct CInverterTableInitializer
{ {
public:
CInverterTableInitializer() CInverterTableInitializer()
{ {
for (int i = 0; i < 256; i++) for (int i = 0; i < 256; i++)
@@ -23,5 +21,4 @@ public:
} }
} g_InverterTableInitializer; } g_InverterTableInitializer;
}
}}

View File

@@ -1,12 +1,11 @@
// LSBFDecoder.h // BitlDecoder.h -- the Least Significant Bit of byte is First
#ifndef __STREAM_LSBFDECODER_H #ifndef __BITL_DECODER_H
#define __STREAM_LSBFDECODER_H #define __BITL_DECODER_H
#include "../IStream.h" #include "../IStream.h"
namespace NStream { namespace NBitl {
namespace NLSBF {
const int kNumBigValueBits = 8 * 4; const int kNumBigValueBits = 8 * 4;
@@ -16,7 +15,6 @@ const int kNumValueBits = 8 * kNumValueBytes;
const UInt32 kMask = (1 << kNumValueBits) - 1; const UInt32 kMask = (1 << kNumValueBits) - 1;
extern Byte kInvertTable[256]; extern Byte kInvertTable[256];
// the Least Significant Bit of byte is First
template<class TInByte> template<class TInByte>
class CBaseDecoder class CBaseDecoder
@@ -122,6 +120,6 @@ public:
} }
}; };
}} }
#endif #endif

View File

@@ -1,15 +1,11 @@
// Stream/LSBFEncoder.h // BitlEncoder.h -- the Least Significant Bit of byte is First
#ifndef __STREAM_LSBFENCODER_H #ifndef __BITL_ENCODER_H
#define __STREAM_LSBFENCODER_H #define __BITL_ENCODER_H
#include "../IStream.h" #include "../Common/OutBuffer.h"
#include "OutBuffer.h"
namespace NStream { class CBitlEncoder
namespace NLSBF {
class CEncoder
{ {
COutBuffer m_Stream; COutBuffer m_Stream;
int m_BitPos; int m_BitPos;
@@ -61,7 +57,4 @@ public:
void WriteByte(Byte b) { m_Stream.WriteByte(b);} void WriteByte(Byte b) { m_Stream.WriteByte(b);}
}; };
}}
#endif #endif

View File

@@ -1,14 +1,11 @@
// MSBFDecoder.h // BitmDecoder.h -- the Most Significant Bit of byte is First
// the Most Significant Bit of byte is First
#ifndef __STREAM_MSBFDECODER_H #ifndef __BITM_DECODER_H
#define __STREAM_MSBFDECODER_H #define __BITM_DECODER_H
#include "../../Common/Types.h"
#include "../IStream.h" #include "../IStream.h"
namespace NStream { namespace NBitm {
namespace NMSBF {
const int kNumBigValueBits = 8 * 4; const int kNumBigValueBits = 8 * 4;
const int kNumValueBytes = 3; const int kNumValueBytes = 3;
@@ -64,6 +61,6 @@ public:
} }
}; };
}} }
#endif #endif

View File

@@ -1,17 +1,12 @@
// Stream/MSBFEncoder.h // BitmEncoder.h -- the Most Significant Bit of byte is First
#ifndef __STREAM_MSBFENCODER_H #ifndef __BITM_ENCODER_H
#define __STREAM_MSBFENCODER_H #define __BITM_ENCODER_H
#include "Common/Defs.h"
#include "../IStream.h" #include "../IStream.h"
#include "OutBuffer.h"
namespace NStream {
namespace NMSBF {
template<class TOutByte> template<class TOutByte>
class CEncoder class CBitmEncoder
{ {
TOutByte m_Stream; TOutByte m_Stream;
int m_BitPos; int m_BitPos;
@@ -54,6 +49,4 @@ public:
return m_Stream.GetProcessedSize() + (8 - m_BitPos + 7) / 8; } return m_Stream.GetProcessedSize() + (8 - m_BitPos + 7) / 8; }
}; };
}}
#endif #endif

View File

@@ -1,8 +0,0 @@
// StdAfx.h
#ifndef __STDAFX_H
#define __STDAFX_H
#include "../../../Common/MyWindows.h"
#endif

View File

@@ -1,6 +1,7 @@
// BranchCoder.cpp // BranchCoder.cpp
#include "StdAfx.h" #include "StdAfx.h"
#include "BranchCoder.h" #include "BranchCoder.h"
STDMETHODIMP CBranchConverter::Init() STDMETHODIMP CBranchConverter::Init()

View File

@@ -1,12 +1,11 @@
// BranchCoder.h // BranchCoder.h
#ifndef __BRANCH_CODER_H #ifndef __COMPRESS_BRANCH_CODER_H
#define __BRANCH_CODER_H #define __COMPRESS_BRANCH_CODER_H
#include "Common/MyCom.h" #include "../../Common/MyCom.h"
#include "Common/Types.h"
#include "../../ICoder.h" #include "../ICoder.h"
class CBranchConverter: class CBranchConverter:
public ICompressFilter, public ICompressFilter,

Some files were not shown because too many files have changed in this diff Show More