Compare commits

...

2 Commits
9.14 ... 9.16

Author SHA1 Message Date
Igor Pavlov
044e4bb741 9.16 2016-05-28 00:16:03 +01:00
Igor Pavlov
e279500d76 9.15 2016-05-28 00:16:03 +01:00
44 changed files with 515 additions and 258 deletions

View File

@@ -1,7 +1,7 @@
#define MY_VER_MAJOR 9 #define MY_VER_MAJOR 9
#define MY_VER_MINOR 14 #define MY_VER_MINOR 16
#define MY_VER_BUILD 0 #define MY_VER_BUILD 0
#define MY_VERSION "9.14 beta" #define MY_VERSION "9.16 beta"
#define MY_DATE "2010-06-04" #define MY_DATE "2010-09-08"
#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,9 +1,9 @@
/* Crypto/Sha256.c -- SHA-256 Hash function /* Crypto/Sha256.c -- SHA-256 Hash
2008-11-06 : Igor Pavlov : Public domain 2010-06-11 : Igor Pavlov : Public domain
This code is based on public domain code from Wei Dai's Crypto++ library. */ This code is based on public domain code from Wei Dai's Crypto++ library. */
#include "Sha256.h"
#include "RotateDefs.h" #include "RotateDefs.h"
#include "Sha256.h"
/* define it for speed optimization */ /* define it for speed optimization */
/* #define _SHA256_UNROLL */ /* #define _SHA256_UNROLL */
@@ -71,7 +71,7 @@ void Sha256_Init(CSha256 *p)
#endif #endif
const UInt32 K[64] = { static const UInt32 K[64] = {
0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5,
0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5,
0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3,

View File

@@ -1,14 +1,12 @@
/* Sha256.h -- SHA-256 Hash /* Sha256.h -- SHA-256 Hash
2009-02-07 : Igor Pavlov : Public domain */ 2010-06-11 : Igor Pavlov : Public domain */
#ifndef __CRYPTO_SHA256_H #ifndef __CRYPTO_SHA256_H
#define __CRYPTO_SHA256_H #define __CRYPTO_SHA256_H
#include "Types.h" #include "Types.h"
#ifdef __cplusplus EXTERN_C_BEGIN
extern "C" {
#endif
#define SHA256_DIGEST_SIZE 32 #define SHA256_DIGEST_SIZE 32
@@ -23,8 +21,6 @@ void Sha256_Init(CSha256 *p);
void Sha256_Update(CSha256 *p, const Byte *data, size_t size); void Sha256_Update(CSha256 *p, const Byte *data, size_t size);
void Sha256_Final(CSha256 *p, Byte *digest); void Sha256_Final(CSha256 *p, Byte *digest);
#ifdef __cplusplus EXTERN_C_END
}
#endif
#endif #endif

View File

@@ -1,5 +1,5 @@
/* 7zMain.c - Test application for 7z Decoder /* 7zMain.c - Test application for 7z Decoder
2010-03-12 : Igor Pavlov : Public domain */ 2010-07-13 : Igor Pavlov : Public domain */
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
@@ -104,7 +104,7 @@ static SRes Utf16_To_Utf8Buf(CBuf *dest, const UInt16 *src, size_t srcLen)
} }
#endif #endif
static WRes Utf16_To_Char(CBuf *buf, const UInt16 *s, int fileMode) static SRes Utf16_To_Char(CBuf *buf, const UInt16 *s, int fileMode)
{ {
int len = 0; int len = 0;
for (len = 0; s[len] != '\0'; len++); for (len = 0; s[len] != '\0'; len++);
@@ -172,15 +172,16 @@ static WRes OutFile_OpenUtf16(CSzFile *p, const UInt16 *name)
#endif #endif
} }
static void PrintString(const UInt16 *s) static SRes PrintString(const UInt16 *s)
{ {
CBuf buf; CBuf buf;
SRes res;
Buf_Init(&buf); Buf_Init(&buf);
if (Utf16_To_Char(&buf, s, 0) == 0) res = Utf16_To_Char(&buf, s, 0);
{ if (res == SZ_OK)
printf("%s", buf.data); printf("%s", buf.data);
Buf_Free(&buf, &g_Alloc); Buf_Free(&buf, &g_Alloc);
} return res;
} }
static void UInt64ToStr(UInt64 value, char *s) static void UInt64ToStr(UInt64 value, char *s)
@@ -398,7 +399,9 @@ int MY_CDECL main(int numargs, char *args[])
} }
printf("%s %s %10s ", t, attr, s); printf("%s %s %10s ", t, attr, s);
PrintString(temp); res = PrintString(temp);
if (res != SZ_OK)
break;
if (f->IsDir) if (f->IsDir)
printf("/"); printf("/");
printf("\n"); printf("\n");
@@ -407,7 +410,9 @@ int MY_CDECL main(int numargs, char *args[])
printf(testCommand ? printf(testCommand ?
"Testing ": "Testing ":
"Extracting "); "Extracting ");
PrintString(temp); res = PrintString(temp);
if (res != SZ_OK)
break;
if (f->IsDir) if (f->IsDir)
printf("/"); printf("/");
else else

View File

@@ -2,15 +2,14 @@
#include "StdAfx.h" #include "StdAfx.h"
#include "7zHandler.h" #include "../../../Common/ComTry.h"
#include "7zFolderOutStream.h"
#include "../../Common/ProgressUtils.h"
#include "7zDecode.h" #include "7zDecode.h"
// #include "7z1Decode.h" // #include "7z1Decode.h"
#include "7zFolderOutStream.h"
#include "../../../Common/ComTry.h" #include "7zHandler.h"
#include "../../Common/StreamObjects.h"
#include "../../Common/ProgressUtils.h"
#include "../../Common/LimitedStreams.h"
namespace NArchive { namespace NArchive {
namespace N7z { namespace N7z {
@@ -149,27 +148,26 @@ STDMETHODIMP CHandler::Extract(const UInt32 *indices, UInt32 numItems,
); );
// CDecoder1 decoder; // CDecoder1 decoder;
UInt64 currentTotalPacked = 0; UInt64 totalPacked = 0;
UInt64 currentTotalUnpacked = 0; UInt64 totalUnpacked = 0;
UInt64 totalFolderUnpacked; UInt64 curPacked, curUnpacked;
UInt64 totalFolderPacked;
CLocalProgress *lps = new CLocalProgress; CLocalProgress *lps = new CLocalProgress;
CMyComPtr<ICompressProgressInfo> progress = lps; CMyComPtr<ICompressProgressInfo> progress = lps;
lps->Init(extractCallback, false); lps->Init(extractCallback, false);
for(int i = 0; i < extractFolderInfoVector.Size(); i++, for (int i = 0;; i++, totalUnpacked += curUnpacked, totalPacked += curPacked)
currentTotalUnpacked += totalFolderUnpacked,
currentTotalPacked += totalFolderPacked)
{ {
lps->OutSize = currentTotalUnpacked; lps->OutSize = totalUnpacked;
lps->InSize = currentTotalPacked; lps->InSize = totalPacked;
RINOK(lps->SetCur()); RINOK(lps->SetCur());
const CExtractFolderInfo &efi = extractFolderInfoVector[i]; if (i >= extractFolderInfoVector.Size())
totalFolderUnpacked = efi.UnpackSize; break;
totalFolderPacked = 0; const CExtractFolderInfo &efi = extractFolderInfoVector[i];
curUnpacked = efi.UnpackSize;
curPacked = 0;
CFolderOutStream *folderOutStream = new CFolderOutStream; CFolderOutStream *folderOutStream = new CFolderOutStream;
CMyComPtr<ISequentialOutStream> outStream(folderOutStream); CMyComPtr<ISequentialOutStream> outStream(folderOutStream);
@@ -187,7 +185,6 @@ STDMETHODIMP CHandler::Extract(const UInt32 *indices, UInt32 numItems,
else else
startIndex = db.FolderStartFileIndex[efi.FolderIndex]; startIndex = db.FolderStartFileIndex[efi.FolderIndex];
HRESULT result = folderOutStream->Init(&db, HRESULT result = folderOutStream->Init(&db,
#ifdef _7Z_VOL #ifdef _7Z_VOL
volume.StartRef2Index, volume.StartRef2Index,
@@ -205,7 +202,7 @@ STDMETHODIMP CHandler::Extract(const UInt32 *indices, UInt32 numItems,
CNum folderIndex = efi.FolderIndex; CNum folderIndex = efi.FolderIndex;
const CFolder &folderInfo = db.Folders[folderIndex]; const CFolder &folderInfo = db.Folders[folderIndex];
totalFolderPacked = _db.GetFolderFullPackSize(folderIndex); curPacked = _db.GetFolderFullPackSize(folderIndex);
CNum packStreamIndex = db.FolderStartPackStreamIndex[folderIndex]; CNum packStreamIndex = db.FolderStartPackStreamIndex[folderIndex];
UInt64 folderStartPackPos = db.GetFolderStreamPos(folderIndex, 0); UInt64 folderStartPackPos = db.GetFolderStreamPos(folderIndex, 0);

View File

@@ -85,6 +85,7 @@ STDAPI CreateArchiver(const GUID *clsid, const GUID *iid, void **outObject)
STDAPI GetHandlerProperty2(UInt32 formatIndex, PROPID propID, PROPVARIANT *value) STDAPI GetHandlerProperty2(UInt32 formatIndex, PROPID propID, PROPVARIANT *value)
{ {
COM_TRY_BEGIN
if (formatIndex >= g_NumArcs) if (formatIndex >= g_NumArcs)
return E_INVALIDARG; return E_INVALIDARG;
const CArcInfo &arc = *g_Arcs[formatIndex]; const CArcInfo &arc = *g_Arcs[formatIndex];
@@ -119,6 +120,7 @@ STDAPI GetHandlerProperty2(UInt32 formatIndex, PROPID propID, PROPVARIANT *value
} }
prop.Detach(value); prop.Detach(value);
return S_OK; return S_OK;
COM_TRY_END
} }
STDAPI GetHandlerProperty(PROPID propID, PROPVARIANT *value) STDAPI GetHandlerProperty(PROPID propID, PROPVARIANT *value)

View File

@@ -41,7 +41,7 @@ enum
}; };
#endif #endif
STATPROPSTG kProps[] = static STATPROPSTG kProps[] =
{ {
{ NULL, kpidPath, VT_BSTR}, { NULL, kpidPath, VT_BSTR},
{ NULL, kpidSize, VT_UI8}, { NULL, kpidSize, VT_UI8},
@@ -57,18 +57,18 @@ STATPROPSTG kProps[] =
#endif #endif
}; };
static const wchar_t *kMethods[] = static const char *kMethods[] =
{ {
L"None", "None",
L"MSZip", "MSZip",
L"Quantum", "Quantum",
L"LZX" "LZX"
}; };
static const int kNumMethods = sizeof(kMethods) / sizeof(kMethods[0]); static const int kNumMethods = sizeof(kMethods) / sizeof(kMethods[0]);
static const wchar_t *kUnknownMethod = L"Unknown"; static const char *kUnknownMethod = "Unknown";
STATPROPSTG kArcProps[] = static STATPROPSTG kArcProps[] =
{ {
{ NULL, kpidMethod, VT_BSTR}, { NULL, kpidMethod, VT_BSTR},
// { NULL, kpidSolid, VT_BOOL}, // { NULL, kpidSolid, VT_BOOL},
@@ -87,7 +87,7 @@ STDMETHODIMP CHandler::GetArchiveProperty(PROPID propID, PROPVARIANT *value)
{ {
case kpidMethod: case kpidMethod:
{ {
UString resString; AString resString;
CRecordVector<Byte> ids; CRecordVector<Byte> ids;
int i; int i;
for (int v = 0; v < m_Database.Volumes.Size(); v++) for (int v = 0; v < m_Database.Volumes.Size(); v++)
@@ -99,9 +99,9 @@ STDMETHODIMP CHandler::GetArchiveProperty(PROPID propID, PROPVARIANT *value)
for (i = 0; i < ids.Size(); i++) for (i = 0; i < ids.Size(); i++)
{ {
Byte id = ids[i]; Byte id = ids[i];
UString method = (id < kNumMethods) ? kMethods[id] : kUnknownMethod; AString method = (id < kNumMethods) ? kMethods[id] : kUnknownMethod;
if (!resString.IsEmpty()) if (!resString.IsEmpty())
resString += L' '; resString += ' ';
resString += method; resString += method;
} }
prop = resString; prop = resString;
@@ -171,12 +171,12 @@ STDMETHODIMP CHandler::GetProperty(UInt32 index, PROPID propID, PROPVARIANT *va
UInt32 realFolderIndex = item.GetFolderIndex(db.Folders.Size()); UInt32 realFolderIndex = item.GetFolderIndex(db.Folders.Size());
const CFolder &folder = db.Folders[realFolderIndex]; const CFolder &folder = db.Folders[realFolderIndex];
int methodIndex = folder.GetCompressionMethod(); int methodIndex = folder.GetCompressionMethod();
UString method = (methodIndex < kNumMethods) ? kMethods[methodIndex] : kUnknownMethod; AString method = (methodIndex < kNumMethods) ? kMethods[methodIndex] : kUnknownMethod;
if (methodIndex == NHeader::NCompressionMethodMajor::kLZX || if (methodIndex == NHeader::NCompressionMethodMajor::kLZX ||
methodIndex == NHeader::NCompressionMethodMajor::kQuantum) methodIndex == NHeader::NCompressionMethodMajor::kQuantum)
{ {
method += L":"; method += ':';
wchar_t temp[32]; char temp[32];
ConvertUInt64ToString(folder.CompressionTypeMinor, temp); ConvertUInt64ToString(folder.CompressionTypeMinor, temp);
method += temp; method += temp;
} }

View File

@@ -526,7 +526,14 @@ HRESULT CDatabase::ReadDir(Int32 parent, UInt32 cluster, int level)
item.Attrib = attrib; item.Attrib = attrib;
item.Flags = p[12]; item.Flags = p[12];
item.Size = Get32(p + 28); item.Size = Get32(p + 28);
item.Cluster = Get16(p + 26) | ((UInt32)Get16(p + 20) << 16); item.Cluster = Get16(p + 26);
if (Header.NumFatBits > 16)
item.Cluster |= ((UInt32)Get16(p + 20) << 16);
else
{
// OS/2 and WinNT probably can store EA (extended atributes) in that field.
}
item.CTime = Get32(p + 14); item.CTime = Get32(p + 14);
item.CTime2 = p[13]; item.CTime2 = p[13];
item.ADate = Get16(p + 18); item.ADate = Get16(p + 18);
@@ -578,8 +585,12 @@ HRESULT CDatabase::Open()
return S_FALSE; return S_FALSE;
UInt64 fileSize; UInt64 fileSize;
RINOK(InStream->Seek(0, STREAM_SEEK_END, &fileSize)); RINOK(InStream->Seek(0, STREAM_SEEK_END, &fileSize));
/* we comment that check to support truncated images */
/*
if (fileSize < Header.GetPhySize()) if (fileSize < Header.GetPhySize())
return S_FALSE; return S_FALSE;
*/
if (Header.IsFat32()) if (Header.IsFat32())
{ {

View File

@@ -7,15 +7,14 @@
#include "../../Common/StreamUtils.h" #include "../../Common/StreamUtils.h"
#include "../../Common/MethodId.h" #include "../../Common/MethodId.h"
#include "../../Common/CreateCoder.h"
#include "../../Compress/BZip2Decoder.h"
#include "../../Compress/DeflateDecoder.h"
#include "../../Compress/LzmaDecoder.h"
namespace NArchive { namespace NArchive {
namespace NNsis { namespace NNsis {
static const CMethodId k_Copy = 0x0;
static const CMethodId k_Deflate = 0x040901;
static const CMethodId k_BZip2 = 0x040902;
static const CMethodId k_LZMA = 0x030101;
static const CMethodId k_BCJ_X86 = 0x03030103; static const CMethodId k_BCJ_X86 = 0x03030103;
HRESULT CDecoder::Init( HRESULT CDecoder::Init(
@@ -31,24 +30,14 @@ HRESULT CDecoder::Init(
_method = method; _method = method;
if (!_codecInStream) if (!_codecInStream)
{ {
CMethodId methodID;
switch (method) switch (method)
{ {
case NMethodType::kCopy: methodID = k_Copy; break; // case NMethodType::kCopy: return E_NOTIMPL;
case NMethodType::kDeflate: methodID = k_Deflate; break; case NMethodType::kDeflate: _codecInStream = new NCompress::NDeflate::NDecoder::CNsisCOMCoder(); break;
case NMethodType::kBZip2: methodID = k_BZip2; break; case NMethodType::kBZip2: _codecInStream = new NCompress::NBZip2::CNsisDecoder(); break;
case NMethodType::kLZMA: methodID = k_LZMA; break; case NMethodType::kLZMA: _codecInStream = new NCompress::NLzma::CDecoder(); break;
default: return E_NOTIMPL; default: return E_NOTIMPL;
} }
CMyComPtr<ICompressCoder> coder;
RINOK(CreateCoder(
EXTERNAL_CODECS_LOC_VARS
methodID, coder, false));
if (!coder)
return E_NOTIMPL;
coder.QueryInterface(IID_ISequentialInStream, &_codecInStream);
if (!_codecInStream)
return E_NOTIMPL;
} }
if (thereIsFilterFlag) if (thereIsFilterFlag)

View File

@@ -313,6 +313,8 @@ STDMETHODIMP CHandler::Extract(const UInt32 *indices, UInt32 numItems,
byteBuf.SetCapacity(kBufferLength); byteBuf.SetCapacity(kBufferLength);
Byte *buffer = byteBuf; Byte *buffer = byteBuf;
CByteBuffer tempBuf;
bool dataError = false; bool dataError = false;
for (i = 0; i < numItems; i++, currentTotalSize += currentItemSize) for (i = 0; i < numItems; i++, currentTotalSize += currentItemSize)
{ {
@@ -357,6 +359,9 @@ STDMETHODIMP CHandler::Extract(const UInt32 *indices, UInt32 numItems,
bool sizeIsKnown = false; bool sizeIsKnown = false;
UInt32 fullSize = 0; UInt32 fullSize = 0;
bool writeToTemp = false;
bool readFromTemp = false;
if (_archive.IsSolid) if (_archive.IsSolid)
{ {
UInt64 pos = _archive.GetPosOfSolidItem(index); UInt64 pos = _archive.GetPosOfSolidItem(index);
@@ -389,8 +394,21 @@ STDMETHODIMP CHandler::Extract(const UInt32 *indices, UInt32 numItems,
fullSize = Get32(buffer2); fullSize = Get32(buffer2);
sizeIsKnown = true; sizeIsKnown = true;
needDecompress = true; needDecompress = true;
if (!testMode && i + 1 < numItems)
{
UInt64 nextPos = _archive.GetPosOfSolidItem(allFilesMode ? i : indices[i + 1]);
if (nextPos < streamPos + fullSize)
{
tempBuf.Free();
tempBuf.SetCapacity(fullSize);
writeToTemp = true;
} }
} }
}
else
readFromTemp = true;
}
else else
{ {
RINOK(_inStream->Seek(_archive.GetPosOfNonSolidItem(index) + 4, STREAM_SEEK_SET, NULL)); RINOK(_inStream->Seek(_archive.GetPosOfNonSolidItem(index) + 4, STREAM_SEEK_SET, NULL));
@@ -434,6 +452,9 @@ STDMETHODIMP CHandler::Extract(const UInt32 *indices, UInt32 numItems,
break; break;
} }
if (writeToTemp)
memcpy((Byte *)tempBuf + (size_t)offset, buffer, processedSize);
fullSize -= (UInt32)processedSize; fullSize -= (UInt32)processedSize;
streamPos += processedSize; streamPos += processedSize;
offset += processedSize; offset += processedSize;
@@ -450,6 +471,12 @@ STDMETHODIMP CHandler::Extract(const UInt32 *indices, UInt32 numItems,
} }
else else
{ {
if (readFromTemp)
{
if (!testMode)
RINOK(WriteStream(realOutStream, tempBuf, tempBuf.GetCapacity()));
}
else
while (fullSize > 0) while (fullSize > 0)
{ {
UInt32 curSize = MyMin(fullSize, kBufferLength); UInt32 curSize = MyMin(fullSize, kBufferLength);

View File

@@ -1151,16 +1151,25 @@ HRESULT CInArchive::ReadEntries(const CBlockHeader &bh)
bool sameName = IsUnicode ? bool sameName = IsUnicode ?
(Items[i].NameU == Items[i + 1].NameU) : (Items[i].NameU == Items[i + 1].NameU) :
(Items[i].NameA == Items[i + 1].NameA); (Items[i].NameA == Items[i + 1].NameA);
if (Items[i].Pos == Items[i + 1].Pos && (IsSolid || sameName)) if (Items[i].Pos == Items[i + 1].Pos && sameName)
Items.Delete(i + 1); Items.Delete(i + 1);
else else
i++; i++;
} }
for (i = 0; i + 1 < Items.Size(); i++) for (i = 0; i < Items.Size(); i++)
{ {
CItem &item = Items[i]; CItem &item = Items[i];
UInt32 curPos = item.Pos + 4;
for (int nextIndex = i + 1; nextIndex < Items.Size(); nextIndex++)
{
UInt32 nextPos = Items[nextIndex].Pos;
if (curPos <= nextPos)
{
item.EstimatedSizeIsDefined = true; item.EstimatedSizeIsDefined = true;
item.EstimatedSize = Items[i + 1].Pos - item.Pos - 4; item.EstimatedSize = nextPos - curPos;
break;
}
}
} }
if (!IsSolid) if (!IsSolid)
{ {
@@ -1275,6 +1284,11 @@ static bool IsLZMA(const Byte *p, UInt32 &dictionary, bool &thereIsFlag)
return false; return false;
} }
static bool IsBZip2(const Byte *p)
{
return (p[0] == 0x31 && p[1] < 14);
}
HRESULT CInArchive::Open2( HRESULT CInArchive::Open2(
DECL_EXTERNAL_CODECS_LOC_VARS2 DECL_EXTERNAL_CODECS_LOC_VARS2
) )
@@ -1312,8 +1326,15 @@ HRESULT CInArchive::Open2(
else if (sig[3] == 0x80) else if (sig[3] == 0x80)
{ {
IsSolid = false; IsSolid = false;
if (IsBZip2(sig + 4))
Method = NMethodType::kBZip2;
else
Method = NMethodType::kDeflate; Method = NMethodType::kDeflate;
} }
else if (IsBZip2(sig))
{
Method = NMethodType::kBZip2;
}
else else
{ {
Method = NMethodType::kDeflate; Method = NMethodType::kDeflate;

View File

@@ -107,8 +107,11 @@ STDMETHODIMP CHandler::UpdateItems(ISequentialOutStream *outStream, UInt32 numIt
if (prop.vt != VT_UI8) if (prop.vt != VT_UI8)
return E_INVALIDARG; return E_INVALIDARG;
ui.Size = prop.uhVal.QuadPart; ui.Size = prop.uhVal.QuadPart;
/*
// now we support GNU extension for big files
if (ui.Size >= ((UInt64)1 << 33)) if (ui.Size >= ((UInt64)1 << 33))
return E_INVALIDARG; return E_INVALIDARG;
*/
} }
updateItems.Add(ui); updateItems.Add(ui);
} }

View File

@@ -2,6 +2,8 @@
#include "StdAfx.h" #include "StdAfx.h"
#include "../../../../C/CpuArch.h"
#include "Common/StringToInt.h" #include "Common/StringToInt.h"
#include "../../Common/StreamUtils.h" #include "../../Common/StreamUtils.h"
@@ -92,7 +94,16 @@ static HRESULT GetNextItemReal(ISequentialInStream *stream, bool &filled, CItemE
if (!OctalToNumber32(p, 8, item.UID)) item.UID = 0; p += 8; if (!OctalToNumber32(p, 8, item.UID)) item.UID = 0; p += 8;
if (!OctalToNumber32(p, 8, item.GID)) item.GID = 0; p += 8; if (!OctalToNumber32(p, 8, item.GID)) item.GID = 0; p += 8;
RIF(OctalToNumber(p, 12, item.Size)); p += 12; if (GetBe32(p) == (UInt32)1 << 31)
{
// GNU extension
item.Size = GetBe64(p + 4);
}
else
{
RIF(OctalToNumber(p, 12, item.Size));
}
p += 12;
RIF(OctalToNumber32(p, 12, item.MTime)); p += 12; RIF(OctalToNumber32(p, 12, item.MTime)); p += 12;
UInt32 checkSum; UInt32 checkSum;

View File

@@ -53,17 +53,23 @@ static bool MakeOctalString8(char *s, UInt32 value)
return true; return true;
} }
static bool MakeOctalString12(char *s, UInt64 value) static void MakeOctalString12(char *s, UInt64 value)
{ {
AString tempString = MakeOctalString(value); AString tempString = MakeOctalString(value);
const int kMaxSize = 12; const int kMaxSize = 12;
if (tempString.Length() > kMaxSize) if (tempString.Length() > kMaxSize)
return false; {
// GNU extension;
s[0] = (char)(Byte)0x80;
s[1] = s[2] = s[3] = 0;
for (int i = 0; i < 8; i++, value <<= 8)
s[4 + i] = (char)(value >> 56);
return;
}
int numSpaces = kMaxSize - tempString.Length(); int numSpaces = kMaxSize - tempString.Length();
for(int i = 0; i < numSpaces; i++) for(int i = 0; i < numSpaces; i++)
s[i] = ' '; s[i] = ' ';
memmove(s + numSpaces, (const char *)tempString, tempString.Length()); memmove(s + numSpaces, (const char *)tempString, tempString.Length());
return true;
} }
static bool CopyString(char *dest, const AString &src, int maxSize) static bool CopyString(char *dest, const AString &src, int maxSize)
@@ -90,17 +96,12 @@ HRESULT COutArchive::WriteHeaderReal(const CItem &item)
MyStrNCpy(cur, item.Name, NFileHeader::kNameSize); MyStrNCpy(cur, item.Name, NFileHeader::kNameSize);
cur += NFileHeader::kNameSize; cur += NFileHeader::kNameSize;
RETURN_IF_NOT_TRUE(MakeOctalString8(cur, item.Mode)); RETURN_IF_NOT_TRUE(MakeOctalString8(cur, item.Mode)); cur += 8;
cur += 8; RETURN_IF_NOT_TRUE(MakeOctalString8(cur, item.UID)); cur += 8;
RETURN_IF_NOT_TRUE(MakeOctalString8(cur, item.UID)); RETURN_IF_NOT_TRUE(MakeOctalString8(cur, item.GID)); cur += 8;
cur += 8;
RETURN_IF_NOT_TRUE(MakeOctalString8(cur, item.GID));
cur += 8;
RETURN_IF_NOT_TRUE(MakeOctalString12(cur, item.Size)); MakeOctalString12(cur, item.Size); cur += 12;
cur += 12; MakeOctalString12(cur, item.MTime); cur += 12;
RETURN_IF_NOT_TRUE(MakeOctalString12(cur, item.MTime));
cur += 12;
memmove(cur, NFileHeader::kCheckSumBlanks, 8); memmove(cur, NFileHeader::kCheckSumBlanks, 8);
cur += 8; cur += 8;

View File

@@ -391,7 +391,6 @@ STDMETHODIMP CHandler::Open(IInStream *inStream,
{ {
COM_TRY_BEGIN COM_TRY_BEGIN
Close(); Close();
try
{ {
CMyComPtr<IArchiveOpenVolumeCallback> openVolumeCallback; CMyComPtr<IArchiveOpenVolumeCallback> openVolumeCallback;
@@ -488,10 +487,6 @@ STDMETHODIMP CHandler::Open(IInStream *inStream,
_xmlInComments = (_xmls.Size() == 1 && !_db.ShowImageNumber); _xmlInComments = (_xmls.Size() == 1 && !_db.ShowImageNumber);
} }
catch(...)
{
return S_FALSE;
}
return S_OK; return S_OK;
COM_TRY_END COM_TRY_END
} }

View File

@@ -258,7 +258,7 @@ static size_t WriteItem(const CUpdateItem &item, Byte *p, const Byte *hash)
return totalLen; return totalLen;
} }
void WriteTree(const CDir &tree, CRecordVector<CSha1Hash> &digests, static void WriteTree(const CDir &tree, CRecordVector<CSha1Hash> &digests,
CUpdateItem &defaultDirItem, CUpdateItem &defaultDirItem,
CObjectVector<CUpdateItem> &updateItems, Byte *dest, size_t &pos) CObjectVector<CUpdateItem> &updateItems, Byte *dest, size_t &pos)
{ {
@@ -488,11 +488,15 @@ static HRESULT UpdateArchive(ISequentialOutStream *seqOutStream,
const UInt32 kSecuritySize = 8; const UInt32 kSecuritySize = 8;
size_t pos = kSecuritySize; size_t pos = kSecuritySize;
WriteTree(rootFolder, hashes.Digests, ri, updateItems, NULL, pos); WriteTree(rootFolder, hashes.Digests, ri, updateItems, NULL, pos);
CByteBuffer meta; CByteBuffer meta;
meta.SetCapacity(pos); meta.SetCapacity(pos);
// memset(meta, 0, kSecuritySize);
Set32((Byte *)meta, 0); // only if there is no security data, we can use 0 here. // we can write 0 here only if there is no security data, imageX does it,
// but some programs expect size = 8
Set32((Byte *)meta, 8); // size of security data
Set32((Byte *)meta + 4, 0); // num security entries Set32((Byte *)meta + 4, 0); // num security entries
pos = kSecuritySize; pos = kSecuritySize;
WriteTree(rootFolder, hashes.Digests, ri, updateItems, (Byte *)meta, pos); WriteTree(rootFolder, hashes.Digests, ri, updateItems, (Byte *)meta, pos);

View File

@@ -258,13 +258,24 @@ void CResource::Parse(const Byte *p)
#define GetResource(p, res) res.Parse(p) #define GetResource(p, res) res.Parse(p)
static void GetStream(const Byte *p, CStreamInfo &s) static void GetStream(bool oldVersion, const Byte *p, CStreamInfo &s)
{ {
s.Resource.Parse(p); s.Resource.Parse(p);
if (oldVersion)
{
s.PartNumber = 1;
s.RefCount = 1;
// UInt32 id = Get32(p + 24);
// UInt32 unknown = Get32(p + 28);
memcpy(s.Hash, p + 32, kHashSize);
}
else
{
s.PartNumber = Get16(p + 24); s.PartNumber = Get16(p + 24);
s.RefCount = Get32(p + 26); s.RefCount = Get32(p + 26);
memcpy(s.Hash, p + 30, kHashSize); memcpy(s.Hash, p + 30, kHashSize);
} }
}
static const wchar_t *kLongPath = L"[LongPath]"; static const wchar_t *kLongPath = L"[LongPath]";
@@ -384,7 +395,12 @@ HRESULT CDatabase::ParseDirItem(size_t pos, int parent)
return S_FALSE; return S_FALSE;
UInt32 fileNameLen = Get16(p + 0x24); UInt32 fileNameLen = Get16(p + 0x24);
if ((fileNameLen & 1) != 0 || ((0x26 + fileNameLen + 6) & ~7) != len) if ((fileNameLen & 1) != 0)
return S_FALSE;
/* Probably different versions of ImageX can use different number of
additional ZEROs. So we don't use exact check. */
UInt32 fileNameLen2 = (fileNameLen == 0 ? fileNameLen : fileNameLen + 2);
if (((0x26 + fileNameLen2 + 6) & ~7) > len)
return S_FALSE; return S_FALSE;
UString name; UString name;
@@ -522,9 +538,7 @@ HRESULT CDatabase::ParseImageDirs(const CByteBuffer &buf, int parent)
HRESULT CHeader::Parse(const Byte *p) HRESULT CHeader::Parse(const Byte *p)
{ {
UInt32 haderSize = Get32(p + 8); UInt32 headerSize = Get32(p + 8);
if (haderSize < 0x74)
return S_FALSE;
Version = Get32(p + 0x0C); Version = Get32(p + 0x0C);
Flags = Get32(p + 0x10); Flags = Get32(p + 0x10);
if (!IsSupported()) if (!IsSupported())
@@ -532,25 +546,42 @@ HRESULT CHeader::Parse(const Byte *p)
ChunkSize = Get32(p + 0x14); ChunkSize = Get32(p + 0x14);
if (ChunkSize != kChunkSize && ChunkSize != 0) if (ChunkSize != kChunkSize && ChunkSize != 0)
return S_FALSE; return S_FALSE;
int offset;
if (IsOldVersion())
{
if (headerSize != 0x60)
return S_FALSE;
memset(Guid, 0, 16);
offset = 0x18;
PartNumber = 1;
NumParts = 1;
}
else
{
if (headerSize < 0x74)
return S_FALSE;
memcpy(Guid, p + 0x18, 16); memcpy(Guid, p + 0x18, 16);
PartNumber = Get16(p + 0x28); PartNumber = Get16(p + 0x28);
NumParts = Get16(p + 0x2A); NumParts = Get16(p + 0x2A);
int offset = 0x2C; offset = 0x2C;
if (IsNewVersion()) if (IsNewVersion())
{ {
NumImages = Get32(p + offset); NumImages = Get32(p + offset);
offset += 4; offset += 4;
} }
}
GetResource(p + offset, OffsetResource); GetResource(p + offset, OffsetResource);
GetResource(p + offset + 0x18, XmlResource); GetResource(p + offset + 0x18, XmlResource);
GetResource(p + offset + 0x30, MetadataResource); GetResource(p + offset + 0x30, MetadataResource);
if (IsNewVersion()) if (IsNewVersion())
{ {
if (haderSize < 0xD0) if (headerSize < 0xD0)
return S_FALSE; return S_FALSE;
BootIndex = Get32(p + 0x48); BootIndex = Get32(p + 0x48);
IntegrityResource.Parse(p + offset + 0x4C); IntegrityResource.Parse(p + offset + 0x4C);
} }
if (IsOldVersion())
return S_FALSE;
return S_OK; return S_OK;
} }
@@ -565,15 +596,16 @@ HRESULT ReadHeader(IInStream *inStream, CHeader &h)
return h.Parse(p); return h.Parse(p);
} }
static HRESULT ReadStreams(IInStream *inStream, const CHeader &h, CDatabase &db) static HRESULT ReadStreams(bool oldVersion, IInStream *inStream, const CHeader &h, CDatabase &db)
{ {
CByteBuffer offsetBuf; CByteBuffer offsetBuf;
RINOK(UnpackData(inStream, h.OffsetResource, h.IsLzxMode(), offsetBuf, NULL)); RINOK(UnpackData(inStream, h.OffsetResource, h.IsLzxMode(), offsetBuf, NULL));
size_t i; size_t i;
for (i = 0; offsetBuf.GetCapacity() - i >= kStreamInfoSize; i += kStreamInfoSize) size_t streamInfoSize = oldVersion ? kStreamInfoSize + 2 : kStreamInfoSize;
for (i = 0; offsetBuf.GetCapacity() - i >= streamInfoSize; i += streamInfoSize)
{ {
CStreamInfo s; CStreamInfo s;
GetStream((const Byte *)offsetBuf + i, s); GetStream(oldVersion, (const Byte *)offsetBuf + i, s);
if (s.PartNumber == h.PartNumber) if (s.PartNumber == h.PartNumber)
db.Streams.Add(s); db.Streams.Add(s);
} }
@@ -584,7 +616,7 @@ HRESULT CDatabase::Open(IInStream *inStream, const CHeader &h, CByteBuffer &xml,
{ {
OpenCallback = openCallback; OpenCallback = openCallback;
RINOK(UnpackData(inStream, h.XmlResource, h.IsLzxMode(), xml, NULL)); RINOK(UnpackData(inStream, h.XmlResource, h.IsLzxMode(), xml, NULL));
RINOK(ReadStreams(inStream, h, *this)); RINOK(ReadStreams(h.IsOldVersion(), inStream, h, *this));
bool needBootMetadata = !h.MetadataResource.IsEmpty(); bool needBootMetadata = !h.MetadataResource.IsEmpty();
Order = 0; Order = 0;
if (h.PartNumber == 1) if (h.PartNumber == 1)

View File

@@ -155,6 +155,7 @@ struct CHeader
bool IsSupported() const { return (!IsCompressed() || (Flags & NHeaderFlags::kLZX) != 0 || (Flags & NHeaderFlags::kXPRESS) != 0 ) ; } bool IsSupported() const { return (!IsCompressed() || (Flags & NHeaderFlags::kLZX) != 0 || (Flags & NHeaderFlags::kXPRESS) != 0 ) ; }
bool IsLzxMode() const { return (Flags & NHeaderFlags::kLZX) != 0; } bool IsLzxMode() const { return (Flags & NHeaderFlags::kLZX) != 0; }
bool IsSpanned() const { return (!IsCompressed() || (Flags & NHeaderFlags::kSpanned) != 0); } bool IsSpanned() const { return (!IsCompressed() || (Flags & NHeaderFlags::kSpanned) != 0); }
bool IsOldVersion() const { return (Version == 0x010A00); }
bool IsNewVersion()const { return (Version > 0x010C00); } bool IsNewVersion()const { return (Version > 0x010C00); }
bool AreFromOnArchive(const CHeader &h) bool AreFromOnArchive(const CHeader &h)

View File

@@ -78,7 +78,7 @@ namespace NFileHeader
kWzAES = 0x63 kWzAES = 0x63
}; };
const int kNumCompressionMethods = 11; const int kNumCompressionMethods = 11;
const Byte kMadeByProgramVersion = 20; const Byte kMadeByProgramVersion = 63;
const Byte kExtractVersion_Default = 10; const Byte kExtractVersion_Default = 10;
const Byte kExtractVersion_Dir = 20; const Byte kExtractVersion_Dir = 20;

View File

@@ -1,3 +1,3 @@
#include "../../MyVersionInfo.rc" #include "../../MyVersionInfo.rc"
MY_VERSION_INFO_APP("7-Zip Standalone Console", "7za") MY_VERSION_INFO_APP("7-Zip Standalone Console", "7zr")

View File

@@ -358,7 +358,6 @@ COMPRESS_OBJS = \
$O\Deflate64Register.obj \ $O\Deflate64Register.obj \
$O\DeflateDecoder.obj \ $O\DeflateDecoder.obj \
$O\DeflateEncoder.obj \ $O\DeflateEncoder.obj \
$O\DeflateNsisRegister.obj \
$O\DeflateRegister.obj \ $O\DeflateRegister.obj \
$O\DeltaFilter.obj \ $O\DeltaFilter.obj \
$O\ImplodeDecoder.obj \ $O\ImplodeDecoder.obj \

View File

@@ -539,10 +539,6 @@ SOURCE=..\..\Compress\DeflateEncoder.h
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\..\Compress\DeflateNsisRegister.cpp
# End Source File
# Begin Source File
SOURCE=..\..\Compress\DeflateRegister.cpp SOURCE=..\..\Compress\DeflateRegister.cpp
# End Source File # End Source File
# Begin Source File # Begin Source File

View File

@@ -210,7 +210,6 @@ COMPRESS_OBJS = \
$O\Deflate64Register.obj \ $O\Deflate64Register.obj \
$O\DeflateDecoder.obj \ $O\DeflateDecoder.obj \
$O\DeflateEncoder.obj \ $O\DeflateEncoder.obj \
$O\DeflateNsisRegister.obj \
$O\DeflateRegister.obj \ $O\DeflateRegister.obj \
$O\DeltaFilter.obj \ $O\DeltaFilter.obj \
$O\ImplodeDecoder.obj \ $O\ImplodeDecoder.obj \

View File

@@ -32,5 +32,5 @@ MY_VERSION_INFO_DLL("7z Standalone Plugin", "7za")
STRINGTABLE STRINGTABLE
BEGIN BEGIN
100 "7z:0 zip:1 bz2:2 bzip2:2 tbz2:2 tbz:2 rar:3 arj:4 z:5 taz:5 lzh:6 lha:6 cab:7 iso:8 001:9 rpm:10 deb:11 cpio:12 tar:13 gz:14 gzip:14 tgz:14 tpz:14 wim:15 swm:15 lzma:16 dmg:17 hfs:18 xar:19 vhd:20 fat:21 ntfs:22 xz:23" 100 "7z:0 zip:1 bz2:2 bzip2:2 tbz2:2 tbz:2 rar:3 arj:4 z:5 taz:5 lzh:6 lha:6 cab:7 iso:8 001:9 rpm:10 deb:11 cpio:12 tar:13 gz:14 gzip:14 tgz:14 tpz:14 wim:15 swm:15 lzma:16 dmg:17 hfs:18 xar:19 vhd:20 fat:21 ntfs:22 xz:23 txz:23"
END END

View File

@@ -164,7 +164,7 @@ Byte CByteInBufWrap::ReadByteFromNewBlock()
return 0; return 0;
} }
extern "C" static Byte Wrap_ReadByte(void *pp) static Byte Wrap_ReadByte(void *pp)
{ {
CByteInBufWrap *p = (CByteInBufWrap *)pp; CByteInBufWrap *p = (CByteInBufWrap *)pp;
if (p->Cur != p->Lim) if (p->Cur != p->Lim)
@@ -210,7 +210,7 @@ HRESULT CByteOutBufWrap::Flush()
return Res; return Res;
} }
extern "C" static void Wrap_WriteByte(void *pp, Byte b) static void Wrap_WriteByte(void *pp, Byte b)
{ {
CByteOutBufWrap *p = (CByteOutBufWrap *)pp; CByteOutBufWrap *p = (CByteOutBufWrap *)pp;
Byte *dest = p->Cur; Byte *dest = p->Cur;

View File

@@ -4,9 +4,6 @@
#include "../../../C/Alloc.h" #include "../../../C/Alloc.h"
#include "../../Common/Defs.h"
#include "BZip2Crc.h"
#include "BZip2Decoder.h" #include "BZip2Decoder.h"
#include "Mtf8.h" #include "Mtf8.h"
@@ -15,11 +12,11 @@ namespace NBZip2 {
#define NO_INLINE MY_FAST_CALL #define NO_INLINE MY_FAST_CALL
const UInt32 kNumThreadsMax = 4; static const UInt32 kNumThreadsMax = 4;
static const UInt32 kBufferSize = (1 << 17); static const UInt32 kBufferSize = (1 << 17);
static Int16 kRandNums[512] = { static const UInt16 kRandNums[512] = {
619, 720, 127, 481, 931, 816, 813, 233, 566, 247, 619, 720, 127, 481, 931, 816, 813, 233, 566, 247,
985, 724, 205, 454, 863, 491, 741, 242, 949, 214, 985, 724, 205, 454, 863, 491, 741, 242, 949, 214,
733, 859, 335, 708, 621, 574, 73, 654, 730, 472, 733, 859, 335, 708, 621, 574, 73, 654, 730, 472,
@@ -76,8 +73,8 @@ static Int16 kRandNums[512] = {
bool CState::Alloc() bool CState::Alloc()
{ {
if (Counters == 0) if (!Counters)
Counters = (UInt32 *)BigAlloc((256 + kBlockSizeMax) * sizeof(UInt32)); Counters = (UInt32 *)::BigAlloc((256 + kBlockSizeMax) * sizeof(UInt32));
return (Counters != 0); return (Counters != 0);
} }
@@ -87,7 +84,7 @@ void CState::Free()
Counters = 0; Counters = 0;
} }
UInt32 CDecoder::ReadBits(int numBits) { return m_InStream.ReadBits(numBits); } UInt32 CDecoder::ReadBits(unsigned 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; }
@@ -102,12 +99,12 @@ UInt32 CDecoder::ReadCrc()
return crc; return crc;
} }
UInt32 NO_INLINE ReadBits(NBitm::CDecoder<CInBuffer> *m_InStream, int num) static UInt32 NO_INLINE ReadBits(NBitm::CDecoder<CInBuffer> *m_InStream, unsigned num)
{ {
return m_InStream->ReadBits(num); return m_InStream->ReadBits(num);
} }
UInt32 NO_INLINE ReadBit(NBitm::CDecoder<CInBuffer> *m_InStream) static UInt32 NO_INLINE ReadBit(NBitm::CDecoder<CInBuffer> *m_InStream)
{ {
return m_InStream->ReadBits(1); return m_InStream->ReadBits(1);
} }
@@ -116,6 +113,7 @@ 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)
{ {
if (randRes)
*randRes = ReadBit(m_InStream) ? true : false; *randRes = ReadBit(m_InStream) ? true : false;
*origPtrRes = ReadBits(m_InStream, kNumOrigBits); *origPtrRes = ReadBits(m_InStream, kNumOrigBits);
@@ -258,7 +256,7 @@ static HRESULT NO_INLINE ReadBlock(NBitm::CDecoder<CInBuffer> *m_InStream,
return (*origPtrRes < blockSize) ? S_OK : S_FALSE; return (*origPtrRes < blockSize) ? S_OK : S_FALSE;
} }
void NO_INLINE DecodeBlock1(UInt32 *charCounters, UInt32 blockSize) static void NO_INLINE DecodeBlock1(UInt32 *charCounters, UInt32 blockSize)
{ {
{ {
UInt32 sum = 0; UInt32 sum = 0;
@@ -283,13 +281,13 @@ static UInt32 NO_INLINE DecodeBlock2(const UInt32 *tt, UInt32 blockSize, UInt32
// 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];
unsigned int prevByte = (unsigned int)(tPos & 0xFF); unsigned prevByte = (unsigned)(tPos & 0xFF);
int numReps = 0; unsigned numReps = 0;
do do
{ {
unsigned int b = (unsigned int)(tPos & 0xFF); unsigned b = (unsigned)(tPos & 0xFF);
tPos = tt[tPos >> 8]; tPos = tt[tPos >> 8];
if (numReps == kRleModeRepSize) if (numReps == kRleModeRepSize)
@@ -315,7 +313,7 @@ static UInt32 NO_INLINE DecodeBlock2(const UInt32 *tt, UInt32 blockSize, UInt32
m_OutStream.WriteByte((Byte)b); m_OutStream.WriteByte((Byte)b);
for (; --blockSize != 0;) for (; --blockSize != 0;)
{ {
b = (unsigned int)(tPos & 0xFF); b = (unsigned)(tPos & 0xFF);
tPos = tt[tPos >> 8]; tPos = tt[tPos >> 8];
crc.UpdateByte(b); crc.UpdateByte(b);
m_OutStream.WriteByte((Byte)b); m_OutStream.WriteByte((Byte)b);
@@ -327,7 +325,7 @@ static UInt32 NO_INLINE DecodeBlock2(const UInt32 *tt, UInt32 blockSize, UInt32
if (--blockSize == 0) if (--blockSize == 0)
break; break;
b = (unsigned int)(tPos & 0xFF); b = (unsigned)(tPos & 0xFF);
tPos = tt[tPos >> 8]; tPos = tt[tPos >> 8];
crc.UpdateByte(b); crc.UpdateByte(b);
m_OutStream.WriteByte((Byte)b); m_OutStream.WriteByte((Byte)b);
@@ -339,7 +337,7 @@ static UInt32 NO_INLINE DecodeBlock2(const UInt32 *tt, UInt32 blockSize, UInt32
if (--blockSize == 0) if (--blockSize == 0)
break; break;
b = (unsigned int)(tPos & 0xFF); b = (unsigned)(tPos & 0xFF);
tPos = tt[tPos >> 8]; tPos = tt[tPos >> 8];
crc.UpdateByte(b); crc.UpdateByte(b);
m_OutStream.WriteByte((Byte)b); m_OutStream.WriteByte((Byte)b);
@@ -354,7 +352,7 @@ static UInt32 NO_INLINE DecodeBlock2(const UInt32 *tt, UInt32 blockSize, UInt32
if (blockSize == 0) if (blockSize == 0)
break; break;
b = (unsigned int)(tPos & 0xFF); b = (unsigned)(tPos & 0xFF);
tPos = tt[tPos >> 8]; tPos = tt[tPos >> 8];
for (; b > 0; b--) for (; b > 0; b--)
@@ -375,15 +373,15 @@ static UInt32 NO_INLINE DecodeBlock2Rand(const UInt32 *tt, UInt32 blockSize, UIn
UInt32 randIndex = 1; UInt32 randIndex = 1;
UInt32 randToGo = kRandNums[0] - 2; UInt32 randToGo = kRandNums[0] - 2;
int numReps = 0; unsigned numReps = 0;
// 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];
unsigned int prevByte = (unsigned int)(tPos & 0xFF); unsigned prevByte = (unsigned)(tPos & 0xFF);
do do
{ {
unsigned int b = (unsigned int)(tPos & 0xFF); unsigned b = (unsigned)(tPos & 0xFF);
tPos = tt[tPos >> 8]; tPos = tt[tPos >> 8];
{ {
@@ -449,7 +447,7 @@ HRESULT CDecoder::Create()
try try
{ {
m_States = new CState[NumThreads]; m_States = new CState[NumThreads];
if (m_States == 0) if (!m_States)
return E_OUTOFMEMORY; return E_OUTOFMEMORY;
} }
catch(...) { return E_OUTOFMEMORY; } catch(...) { return E_OUTOFMEMORY; }
@@ -487,6 +485,7 @@ void CDecoder::Free()
delete []m_States; delete []m_States;
m_States = 0; m_States = 0;
} }
#endif #endif
HRESULT CDecoder::ReadSignatures(bool &wasFinished, UInt32 &crc) HRESULT CDecoder::ReadSignatures(bool &wasFinished, UInt32 &crc)
@@ -794,6 +793,7 @@ STDMETHODIMP CDecoder::SetNumberOfThreads(UInt32 numThreads)
NumThreads = kNumThreadsMax; NumThreads = kNumThreadsMax;
return S_OK; return S_OK;
} }
#endif #endif
HRESULT CDecoder::SetRatioProgress(UInt64 packSize) HRESULT CDecoder::SetRatioProgress(UInt64 packSize)
@@ -805,4 +805,138 @@ HRESULT CDecoder::SetRatioProgress(UInt64 packSize)
return Progress->SetRatioInfo(&packSize, &unpackSize); return Progress->SetRatioInfo(&packSize, &unpackSize);
} }
// ---------- NSIS ----------
enum
{
NSIS_STATE_INIT,
NSIS_STATE_NEW_BLOCK,
NSIS_STATE_DATA,
NSIS_STATE_FINISHED,
NSIS_STATE_ERROR
};
STDMETHODIMP CNsisDecoder::SetInStream(ISequentialInStream *inStream) { m_InStream.SetStream(inStream); return S_OK; }
STDMETHODIMP CNsisDecoder::ReleaseInStream() { m_InStream.ReleaseStream(); return S_OK; }
STDMETHODIMP CNsisDecoder::SetOutStreamSize(const UInt64 * /* outSize */)
{
_nsisState = NSIS_STATE_INIT;
return S_OK;
}
STDMETHODIMP CNsisDecoder::Read(void *data, UInt32 size, UInt32 *processedSize)
{
try {
*processedSize = 0;
if (_nsisState == NSIS_STATE_FINISHED)
return S_OK;
if (_nsisState == NSIS_STATE_ERROR)
return S_FALSE;
if (size == 0)
return S_OK;
CState &state = m_State;
if (_nsisState == NSIS_STATE_INIT)
{
if (!m_InStream.Create(kBufferSize))
return E_OUTOFMEMORY;
if (!state.Alloc())
return E_OUTOFMEMORY;
m_InStream.Init();
_nsisState = NSIS_STATE_NEW_BLOCK;
}
if (_nsisState == NSIS_STATE_NEW_BLOCK)
{
Byte b = (Byte)m_InStream.ReadBits(8);
if (b == kFinSig0)
{
_nsisState = NSIS_STATE_FINISHED;
return S_OK;
}
if (b != kBlockSig0)
{
_nsisState = NSIS_STATE_ERROR;
return S_FALSE;
}
UInt32 origPtr;
RINOK(ReadBlock(&m_InStream, state.Counters, 9 * kBlockSizeStep,
m_Selectors, m_HuffmanDecoders, &_blockSize, &origPtr, NULL));
DecodeBlock1(state.Counters, _blockSize);
const UInt32 *tt = state.Counters + 256;
_tPos = tt[tt[origPtr] >> 8];
_prevByte = (unsigned)(_tPos & 0xFF);
_numReps = 0;
_repRem = 0;
_nsisState = NSIS_STATE_DATA;
}
UInt32 tPos = _tPos;
unsigned prevByte = _prevByte;
unsigned numReps = _numReps;
UInt32 blockSize = _blockSize;
const UInt32 *tt = state.Counters + 256;
while (_repRem)
{
_repRem--;
*(Byte *)data = (Byte)prevByte;
data = (Byte *)data + 1;
(*processedSize)++;
if (--size == 0)
return S_OK;
}
if (blockSize == 0)
{
_nsisState = NSIS_STATE_NEW_BLOCK;
return S_OK;
}
do
{
unsigned b = (unsigned)(tPos & 0xFF);
tPos = tt[tPos >> 8];
blockSize--;
if (numReps == kRleModeRepSize)
{
numReps = 0;
while (b)
{
b--;
*(Byte *)data = (Byte)prevByte;
data = (Byte *)data + 1;
(*processedSize)++;
if (--size == 0)
break;
}
_repRem = b;
continue;
}
if (b != prevByte)
numReps = 0;
numReps++;
prevByte = b;
*(Byte *)data = (Byte)b;
data = (Byte *)data + 1;
(*processedSize)++;
size--;
}
while (size && blockSize);
_tPos = tPos;
_prevByte = prevByte;
_numReps = numReps;
_blockSize = blockSize;
return S_OK;
}
catch(const CInBufferException &e) { return e.ErrorCode; }
catch(...) { return S_FALSE; }
}
}} }}

View File

@@ -76,11 +76,10 @@ private:
bool _needInStreamInit; bool _needInStreamInit;
UInt32 ReadBits(int numBits); UInt32 ReadBits(unsigned numBits);
Byte ReadByte(); Byte ReadByte();
bool ReadBit(); bool ReadBit();
UInt32 ReadCrc(); UInt32 ReadCrc();
HRESULT PrepareBlock(CState &state);
HRESULT DecodeFile(bool &isBZ, ICompressProgressInfo *progress); HRESULT DecodeFile(bool &isBZ, ICompressProgressInfo *progress);
HRESULT CodeReal(ISequentialInStream *inStream, ISequentialOutStream *outStream, HRESULT CodeReal(ISequentialInStream *inStream, ISequentialOutStream *outStream,
bool &isBZ, ICompressProgressInfo *progress); bool &isBZ, ICompressProgressInfo *progress);
@@ -168,6 +167,39 @@ public:
#endif #endif
}; };
class CNsisDecoder :
public ISequentialInStream,
public ICompressSetInStream,
public ICompressSetOutStreamSize,
public CMyUnknownImp
{
NBitm::CDecoder<CInBuffer> m_InStream;
Byte m_Selectors[kNumSelectorsMax];
CHuffmanDecoder m_HuffmanDecoders[kNumTablesMax];
CState m_State;
int _nsisState;
UInt32 _tPos;
unsigned _prevByte;
unsigned _repRem;
unsigned _numReps;
UInt32 _blockSize;
public:
MY_QUERYINTERFACE_BEGIN2(ISequentialInStream)
MY_QUERYINTERFACE_ENTRY(ICompressSetInStream)
MY_QUERYINTERFACE_ENTRY(ICompressSetOutStreamSize)
MY_QUERYINTERFACE_END
MY_ADDREF_RELEASE
STDMETHOD(Read)(void *data, UInt32 size, UInt32 *processedSize);
STDMETHOD(SetInStream)(ISequentialInStream *inStream);
STDMETHOD(ReleaseInStream)();
STDMETHOD(SetOutStreamSize)(const UInt64 *outSize);
};
}} }}
#endif #endif

View File

@@ -1,14 +0,0 @@
// DeflateNsisRegister.cpp
#include "StdAfx.h"
#include "../Common/RegisterCodec.h"
#include "DeflateDecoder.h"
static void *CreateCodecDeflateNsis() { return (void *)(ICompressCoder *)(new NCompress::NDeflate::NDecoder::CNsisCOMCoder); }
static CCodecInfo g_CodecInfo =
{ CreateCodecDeflateNsis, 0, 0x040901, L"DeflateNSIS", 1, false };
REGISTER_CODEC(DeflateNsis)

View File

@@ -627,7 +627,6 @@ public:
CCoderReleaser(CDecoder *coder): m_Coder(coder) {} CCoderReleaser(CDecoder *coder): m_Coder(coder) {}
~CCoderReleaser() ~CCoderReleaser()
{ {
// m_Coder->m_OutWindowStream.Flush();
m_Coder->ReleaseStreams(); m_Coder->ReleaseStreams();
} }
}; };
@@ -838,9 +837,10 @@ HRESULT CDecoder::CodeReal(ICompressProgressInfo *progress)
break; break;
} }
RINOK(WriteBuf()); RINOK(WriteBuf());
UInt64 packSize = m_InBitStream.bitDecoder.GetProcessedSize();
RINOK(progress->SetRatioInfo(&packSize, &_writtenFileSize));
if (_writtenFileSize < _unpackSize) if (_writtenFileSize < _unpackSize)
return S_FALSE; return S_FALSE;
// return m_OutWindowStream.Flush();
return S_OK; return S_OK;
} }

View File

@@ -114,6 +114,12 @@ HRESULT CDecoder::CheckPassword(bool &passwOK)
_key.KeySize = 16 + algId * 8; _key.KeySize = 16 + algId * 8;
if ((flags & 1) == 0) if ((flags & 1) == 0)
return E_NOTIMPL; return E_NOTIMPL;
if ((flags & 0x4000) != 0)
{
// Use 3DES
return E_NOTIMPL;
}
UInt32 rdSize = GetUi16(p + 8); UInt32 rdSize = GetUi16(p + 8);
if ((rdSize & 0xF) != 0 || rdSize + 16 > _remSize) if ((rdSize & 0xF) != 0 || rdSize + 16 > _remSize)
return E_NOTIMPL; return E_NOTIMPL;

View File

@@ -1,8 +1,8 @@
#define MY_VER_MAJOR 9 #define MY_VER_MAJOR 9
#define MY_VER_MINOR 14 #define MY_VER_MINOR 16
#define MY_VER_BUILD 0 #define MY_VER_BUILD 0
#define MY_VERSION "9.14 beta" #define MY_VERSION "9.16"
#define MY_7ZIP_VERSION "7-Zip 9.14 beta" #define MY_7ZIP_VERSION "7-Zip 9.16 beta"
#define MY_DATE "2010-06-04" #define MY_DATE "2010-09-08"
#define MY_COPYRIGHT "Copyright (c) 1999-2010 Igor Pavlov" #define MY_COPYRIGHT "Copyright (c) 1999-2010 Igor Pavlov"
#define MY_VERSION_COPYRIGHT_DATE MY_VERSION " " MY_COPYRIGHT " " MY_DATE #define MY_VERSION_COPYRIGHT_DATE MY_VERSION " " MY_COPYRIGHT " " MY_DATE

View File

@@ -514,11 +514,9 @@ HRESULT ListArchives(CCodecs *codecs, const CIntVector &formatIndices,
CMyComBSTR name; CMyComBSTR name;
PROPID propID; PROPID propID;
VARTYPE vt; VARTYPE vt;
if (archive->GetArchivePropertyInfo(j, &name, &propID, &vt) != S_OK) RINOK(archive->GetArchivePropertyInfo(j, &name, &propID, &vt));
continue;
NCOM::CPropVariant prop; NCOM::CPropVariant prop;
if (archive->GetArchiveProperty(propID, &prop) != S_OK) RINOK(archive->GetArchiveProperty(propID, &prop));
continue;
UString s = ConvertPropertyToString(prop, propID); UString s = ConvertPropertyToString(prop, propID);
if (!s.IsEmpty()) if (!s.IsEmpty())
PrintPropPair(GetPropName(propID, name), s); PrintPropPair(GetPropName(propID, name), s);
@@ -536,11 +534,9 @@ HRESULT ListArchives(CCodecs *codecs, const CIntVector &formatIndices,
CMyComBSTR name; CMyComBSTR name;
PROPID propID; PROPID propID;
VARTYPE vt; VARTYPE vt;
if (archive->GetPropertyInfo(j, &name, &propID, &vt) != S_OK) RINOK(archive->GetPropertyInfo(j, &name, &propID, &vt));
continue;
NCOM::CPropVariant prop; NCOM::CPropVariant prop;
if (archive->GetProperty(mainIndex, propID, &prop) != S_OK) RINOK(archive->GetProperty(mainIndex, propID, &prop));
continue;
UString s = ConvertPropertyToString(prop, propID); UString s = ConvertPropertyToString(prop, propID);
if (!s.IsEmpty()) if (!s.IsEmpty())
PrintPropPair(GetPropName(propID, name), s); PrintPropPair(GetPropName(propID, name), s);

View File

@@ -21,6 +21,6 @@ CAPTION "About 7-Zip"
ICON IDI_LOGO, -1, m, m, 32, 32, SS_REALSIZEIMAGE ICON IDI_LOGO, -1, m, m, 32, 32, SS_REALSIZEIMAGE
LTEXT MY_7ZIP_VERSION, -1, m, 54, xc, 8 LTEXT MY_7ZIP_VERSION, -1, m, 54, xc, 8
LTEXT MY_COPYRIGHT, -1, m, 67, xc, 8 LTEXT MY_COPYRIGHT, -1, m, 67, xc, 8
LTEXT "7-Zip is free software. However, you can support development of 7-Zip by registering.", LTEXT "7-Zip is free software",
IDC_ABOUT_STATIC_REGISTER_INFO, m, y, xc, (by - y - 1) IDC_ABOUT_STATIC_REGISTER_INFO, m, y, xc, (by - y - 1)
} }

View File

@@ -236,12 +236,12 @@ private:
void ChangeWindowSize(int xSize, int ySize); void ChangeWindowSize(int xSize, int ySize);
void InitColumns(); HRESULT InitColumns();
// void InitColumns2(PROPID sortID); // void InitColumns2(PROPID sortID);
void InsertColumn(int index); void InsertColumn(int index);
void SetFocusedSelectedItem(int index, bool select); void SetFocusedSelectedItem(int index, bool select);
void RefreshListCtrl(const UString &focusedName, int focusedPos, bool selectFocused, HRESULT RefreshListCtrl(const UString &focusedName, int focusedPos, bool selectFocused,
const UStringVector &selectedNames); const UStringVector &selectedNames);
void OnShiftSelectMessage(); void OnShiftSelectMessage();
@@ -335,8 +335,8 @@ public:
void GetSelectedNames(UStringVector &selectedNames); void GetSelectedNames(UStringVector &selectedNames);
void SaveSelectedState(CSelectedState &s); void SaveSelectedState(CSelectedState &s);
void RefreshListCtrl(const CSelectedState &s); HRESULT RefreshListCtrl(const CSelectedState &s);
void RefreshListCtrlSaveFocused(); HRESULT RefreshListCtrlSaveFocused();
UString GetItemName(int itemIndex) const; UString GetItemName(int itemIndex) const;
UString GetItemPrefix(int itemIndex) const; UString GetItemPrefix(int itemIndex) const;
@@ -517,7 +517,7 @@ public:
// bool _passwordIsDefined; // bool _passwordIsDefined;
// UString _password; // UString _password;
void RefreshListCtrl(); HRESULT RefreshListCtrl();
void MessageBoxInfo(LPCWSTR message, LPCWSTR caption); void MessageBoxInfo(LPCWSTR message, LPCWSTR caption);
void MessageBox(LPCWSTR message); void MessageBox(LPCWSTR message);

View File

@@ -169,7 +169,7 @@ static const char *kStartExtensions =
#endif #endif
" exe bat com" " exe bat com"
" chm" " chm"
" msi doc xls ppt pps wps wpt wks xlr wdb" " msi doc xls ppt pps wps wpt wks xlr wdb vsd"
" docx docm dotx dotm xlsx xlsm xltx xltm xlsb" " docx docm dotx dotm xlsx xlsm xltx xltm xlsb"
" xlam pptx pptm potx potm ppam ppsx ppsm xsn" " xlam pptx pptm potx potm ppam ppsx ppsm xsn"

View File

@@ -55,7 +55,7 @@ static int GetColumnAlign(PROPID propID, VARTYPE varType)
} }
} }
void CPanel::InitColumns() HRESULT CPanel::InitColumns()
{ {
if (_needSaveInfo) if (_needSaveInfo)
SaveListViewInfo(); SaveListViewInfo();
@@ -88,8 +88,7 @@ void CPanel::InitColumns()
PROPID propID; PROPID propID;
VARTYPE varType; VARTYPE varType;
if (_folder->GetPropertyInfo(i, &name, &propID, &varType) != S_OK) RINOK(_folder->GetPropertyInfo(i, &name, &propID, &varType));
throw 1;
if (propID == kpidIsDir) if (propID == kpidIsDir)
continue; continue;
@@ -155,6 +154,7 @@ void CPanel::InitColumns()
{ {
InsertColumn(i); InsertColumn(i);
} }
return S_OK;
} }
void CPanel::InsertColumn(int index) void CPanel::InsertColumn(int index)
@@ -170,9 +170,9 @@ void CPanel::InsertColumn(int index)
_listView.InsertColumn(index, &column); _listView.InsertColumn(index, &column);
} }
void CPanel::RefreshListCtrl() HRESULT CPanel::RefreshListCtrl()
{ {
RefreshListCtrl(UString(), -1, true, UStringVector()); return RefreshListCtrl(UString(), -1, true, UStringVector());
} }
int CALLBACK CompareItems(LPARAM lParam1, LPARAM lParam2, LPARAM lpData); int CALLBACK CompareItems(LPARAM lParam1, LPARAM lParam2, LPARAM lpData);
@@ -239,19 +239,19 @@ void CPanel::SaveSelectedState(CSelectedState &s)
GetSelectedNames(s.SelectedNames); GetSelectedNames(s.SelectedNames);
} }
void CPanel::RefreshListCtrl(const CSelectedState &s) HRESULT CPanel::RefreshListCtrl(const CSelectedState &s)
{ {
bool selectFocused = s.SelectFocused; bool selectFocused = s.SelectFocused;
if (_mySelectMode) if (_mySelectMode)
selectFocused = true; selectFocused = true;
RefreshListCtrl(s.FocusedName, s.FocusedItem, selectFocused, s.SelectedNames); return RefreshListCtrl(s.FocusedName, s.FocusedItem, selectFocused, s.SelectedNames);
} }
void CPanel::RefreshListCtrlSaveFocused() HRESULT CPanel::RefreshListCtrlSaveFocused()
{ {
CSelectedState state; CSelectedState state;
SaveSelectedState(state); SaveSelectedState(state);
RefreshListCtrl(state); return RefreshListCtrl(state);
} }
void CPanel::SetFocusedSelectedItem(int index, bool select) void CPanel::SetFocusedSelectedItem(int index, bool select)
@@ -268,7 +268,7 @@ void CPanel::SetFocusedSelectedItem(int index, bool select)
} }
} }
void CPanel::RefreshListCtrl(const UString &focusedName, int focusedPos, bool selectFocused, HRESULT CPanel::RefreshListCtrl(const UString &focusedName, int focusedPos, bool selectFocused,
const UStringVector &selectedNames) const UStringVector &selectedNames)
{ {
_dontShowMode = false; _dontShowMode = false;
@@ -309,11 +309,8 @@ void CPanel::RefreshListCtrl(const UString &focusedName, int focusedPos, bool se
if (folderSetFlatMode) if (folderSetFlatMode)
folderSetFlatMode->SetFlatMode(BoolToInt(_flatMode)); folderSetFlatMode->SetFlatMode(BoolToInt(_flatMode));
if (_folder->LoadItems() != S_OK) RINOK(_folder->LoadItems());
return; RINOK(InitColumns());
InitColumns();
// OutputDebugString(TEXT("Start Dir\n")); // OutputDebugString(TEXT("Start Dir\n"));
UInt32 numItems; UInt32 numItems;
@@ -346,7 +343,7 @@ void CPanel::RefreshListCtrl(const UString &focusedName, int focusedPos, bool se
if (item.iImage < 0) if (item.iImage < 0)
item.iImage = 0; item.iImage = 0;
if (_listView.InsertItem(&item) == -1) if (_listView.InsertItem(&item) == -1)
return; return E_FAIL;
} }
// OutputDebugStringA("S1\n"); // OutputDebugStringA("S1\n");
@@ -400,7 +397,7 @@ void CPanel::RefreshListCtrl(const UString &focusedName, int focusedPos, bool se
item.pszText = (wchar_t *)(const wchar_t *)itemName; item.pszText = (wchar_t *)(const wchar_t *)itemName;
NCOM::CPropVariant prop; NCOM::CPropVariant prop;
_folder->GetProperty(i, kpidAttrib, &prop); RINOK(_folder->GetProperty(i, kpidAttrib, &prop));
UInt32 attrib = 0; UInt32 attrib = 0;
if (prop.vt == VT_UI4) if (prop.vt == VT_UI4)
attrib = prop.ulVal; attrib = prop.ulVal;
@@ -431,7 +428,7 @@ void CPanel::RefreshListCtrl(const UString &focusedName, int focusedPos, bool se
item.iImage = 0; item.iImage = 0;
if (_listView.InsertItem(&item) == -1) if (_listView.InsertItem(&item) == -1)
return; // error return E_FAIL; // error
} }
// OutputDebugStringA("End2\n"); // OutputDebugStringA("End2\n");
@@ -452,6 +449,7 @@ void CPanel::RefreshListCtrl(const UString &focusedName, int focusedPos, bool se
/* /*
_listView.UpdateWindow(); _listView.UpdateWindow();
*/ */
return S_OK;
} }
void CPanel::GetSelectedItemsIndices(CRecordVector<UInt32> &indices) const void CPanel::GetSelectedItemsIndices(CRecordVector<UInt32> &indices) const
@@ -785,7 +783,9 @@ void CPanel::ShowColumnsContextMenu(int x, int y)
void CPanel::OnReload() void CPanel::OnReload()
{ {
RefreshListCtrlSaveFocused(); HRESULT res = RefreshListCtrlSaveFocused();
if (res != S_OK)
MessageBoxError(res);
OnRefreshStatusBar(); OnRefreshStatusBar();
} }

View File

@@ -149,9 +149,10 @@ LRESULT CPanel::SetItemText(LVITEMW &item)
if (needRead) if (needRead)
*/ */
if (_folder->GetProperty(realIndex, propID, &prop) != S_OK) HRESULT res = _folder->GetProperty(realIndex, propID, &prop);
throw 2723407; if (res != S_OK)
s = UString(L"Error: ") + HResultToMessage(res);
else
if ((prop.vt == VT_UI8 || prop.vt == VT_UI4) && ( if ((prop.vt == VT_UI8 || prop.vt == VT_UI4) && (
propID == kpidSize || propID == kpidSize ||
propID == kpidPackSize || propID == kpidPackSize ||

View File

@@ -50,6 +50,8 @@ CPropVariant& CPropVariant::operator=(BSTR bstrSrc)
return *this; return *this;
} }
static const char *kMemException = "out of memory";
CPropVariant& CPropVariant::operator=(LPCOLESTR lpszSrc) CPropVariant& CPropVariant::operator=(LPCOLESTR lpszSrc)
{ {
InternalClear(); InternalClear();
@@ -58,8 +60,9 @@ CPropVariant& CPropVariant::operator=(LPCOLESTR lpszSrc)
bstrVal = ::SysAllocString(lpszSrc); bstrVal = ::SysAllocString(lpszSrc);
if (bstrVal == NULL && lpszSrc != NULL) if (bstrVal == NULL && lpszSrc != NULL)
{ {
vt = VT_ERROR; throw kMemException;
scode = E_OUTOFMEMORY; // vt = VT_ERROR;
// scode = E_OUTOFMEMORY;
} }
return *this; return *this;
} }
@@ -74,8 +77,9 @@ CPropVariant& CPropVariant::operator=(const char *s)
bstrVal = ::SysAllocStringByteLen(0, (UINT)len * sizeof(OLECHAR)); bstrVal = ::SysAllocStringByteLen(0, (UINT)len * sizeof(OLECHAR));
if (bstrVal == NULL) if (bstrVal == NULL)
{ {
vt = VT_ERROR; throw kMemException;
scode = E_OUTOFMEMORY; // vt = VT_ERROR;
// scode = E_OUTOFMEMORY;
} }
else else
{ {
@@ -204,6 +208,8 @@ void CPropVariant::InternalCopy(const PROPVARIANT *pSrc)
HRESULT hr = Copy(pSrc); HRESULT hr = Copy(pSrc);
if (FAILED(hr)) if (FAILED(hr))
{ {
if (hr == E_OUTOFMEMORY)
throw kMemException;
vt = VT_ERROR; vt = VT_ERROR;
scode = hr; scode = hr;
} }

View File

@@ -62,7 +62,6 @@ fm\index.htm
fm\menu.htm fm\menu.htm
fm\about.htm fm\about.htm
fm\plugins\index.htm fm\plugins\index.htm
fm\plugins\7-zip\options.htm
fm\plugins\7-zip\extract.htm fm\plugins\7-zip\extract.htm
fm\plugins\7-zip\index.htm fm\plugins\7-zip\index.htm
fm\plugins\7-zip\add.htm fm\plugins\7-zip\add.htm

View File

@@ -10,8 +10,8 @@ AppName = "7-Zip"
InstallDir = %CE1%\%AppName% InstallDir = %CE1%\%AppName%
[Strings] [Strings]
AppVer = "9.14" AppVer = "9.16"
AppDate = "2010-06-04" AppDate = "2010-09-07"
[CEDevice] [CEDevice]
; ProcessorType = 2577 ; ARM ; ProcessorType = 2577 ; ARM

View File

@@ -2,7 +2,7 @@
;Defines ;Defines
!define VERSION_MAJOR 9 !define VERSION_MAJOR 9
!define VERSION_MINOR 14 !define VERSION_MINOR 16
!define VERSION_POSTFIX_FULL " beta" !define VERSION_POSTFIX_FULL " beta"
!ifdef WIN64 !ifdef WIN64
!ifdef IA64 !ifdef IA64
@@ -206,7 +206,9 @@ Section
File fur.txt File fur.txt
File fy.txt File fy.txt
File gl.txt File gl.txt
File gu.txt
File he.txt File he.txt
File hi.txt
File hr.txt File hr.txt
File hu.txt File hu.txt
File hy.txt File hy.txt
@@ -237,6 +239,7 @@ Section
File pt-br.txt File pt-br.txt
File ro.txt File ro.txt
File ru.txt File ru.txt
File sa.txt
File si.txt File si.txt
File sk.txt File sk.txt
File sl.txt File sl.txt
@@ -397,7 +400,9 @@ Section "Uninstall"
Delete $INSTDIR\Lang\fur.txt Delete $INSTDIR\Lang\fur.txt
Delete $INSTDIR\Lang\fy.txt Delete $INSTDIR\Lang\fy.txt
Delete $INSTDIR\Lang\gl.txt Delete $INSTDIR\Lang\gl.txt
Delete $INSTDIR\Lang\gu.txt
Delete $INSTDIR\Lang\he.txt Delete $INSTDIR\Lang\he.txt
Delete $INSTDIR\Lang\hi.txt
Delete $INSTDIR\Lang\hr.txt Delete $INSTDIR\Lang\hr.txt
Delete $INSTDIR\Lang\hu.txt Delete $INSTDIR\Lang\hu.txt
Delete $INSTDIR\Lang\hy.txt Delete $INSTDIR\Lang\hy.txt
@@ -428,6 +433,7 @@ Section "Uninstall"
Delete $INSTDIR\Lang\pt-br.txt Delete $INSTDIR\Lang\pt-br.txt
Delete $INSTDIR\Lang\ro.txt Delete $INSTDIR\Lang\ro.txt
Delete $INSTDIR\Lang\ru.txt Delete $INSTDIR\Lang\ru.txt
Delete $INSTDIR\Lang\sa.txt
Delete $INSTDIR\Lang\si.txt Delete $INSTDIR\Lang\si.txt
Delete $INSTDIR\Lang\sk.txt Delete $INSTDIR\Lang\sk.txt
Delete $INSTDIR\Lang\sl.txt Delete $INSTDIR\Lang\sl.txt

View File

@@ -1,7 +1,7 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<?define VerMajor = "9" ?> <?define VerMajor = "9" ?>
<?define VerMinor = "14" ?> <?define VerMinor = "16" ?>
<?define VerBuild = "00" ?> <?define VerBuild = "00" ?>
<?define MmVer = "$(var.VerMajor).$(var.VerMinor)" ?> <?define MmVer = "$(var.VerMajor).$(var.VerMinor)" ?>
<?define MmHex = "0$(var.VerMajor)$(var.VerMinor)" ?> <?define MmHex = "0$(var.VerMajor)$(var.VerMinor)" ?>
@@ -248,7 +248,9 @@
<File Id="fur.txt" Name="fur.txt" /> <File Id="fur.txt" Name="fur.txt" />
<File Id="fy.txt" Name="fy.txt" /> <File Id="fy.txt" Name="fy.txt" />
<File Id="gl.txt" Name="gl.txt" /> <File Id="gl.txt" Name="gl.txt" />
<File Id="gu.txt" Name="gu.txt" />
<File Id="he.txt" Name="he.txt" /> <File Id="he.txt" Name="he.txt" />
<File Id="hi.txt" Name="hi.txt" />
<File Id="hr.txt" Name="hr.txt" /> <File Id="hr.txt" Name="hr.txt" />
<File Id="hu.txt" Name="hu.txt" /> <File Id="hu.txt" Name="hu.txt" />
<File Id="hy.txt" Name="hy.txt" /> <File Id="hy.txt" Name="hy.txt" />
@@ -279,6 +281,7 @@
<File Id="pt_br.txt" Name="pt-br.txt" /> <File Id="pt_br.txt" Name="pt-br.txt" />
<File Id="ro.txt" Name="ro.txt" /> <File Id="ro.txt" Name="ro.txt" />
<File Id="ru.txt" Name="ru.txt" /> <File Id="ru.txt" Name="ru.txt" />
<File Id="sa.txt" Name="sa.txt" />
<File Id="si.txt" Name="si.txt" /> <File Id="si.txt" Name="si.txt" />
<File Id="sk.txt" Name="sk.txt" /> <File Id="sk.txt" Name="sk.txt" />
<File Id="sl.txt" Name="sl.txt" /> <File Id="sl.txt" Name="sl.txt" />

View File

@@ -1,4 +1,4 @@
LZMA SDK 9.14 LZMA SDK 9.16
------------- -------------
LZMA SDK provides the documentation, samples, header files, libraries, LZMA SDK provides the documentation, samples, header files, libraries,
@@ -37,7 +37,7 @@ LZMA SDK includes:
UNIX/Linux version UNIX/Linux version
------------------ ------------------
To compile C++ version of file->file LZMA encoding, go to directory To compile C++ version of file->file LZMA encoding, go to directory
C++/7zip/Compress/LZMA_Alone CPP/7zip/Bundles/LzmaCon
and call make to recompile it: and call make to recompile it:
make -f makefile.gcc clean all make -f makefile.gcc clean all
@@ -91,8 +91,6 @@ CPP/ -- CPP files
Compress - files related to compression/decompression Compress - files related to compression/decompression
LZMA_Alone - file->file LZMA compression/decompression
Archive - files related to archiving Archive - files related to archiving
Common - common files for archive handling Common - common files for archive handling
@@ -101,6 +99,7 @@ CPP/ -- CPP files
Bundles - Modules that are bundles of other modules Bundles - Modules that are bundles of other modules
Alone7z - 7zr.exe: Standalone version of 7z.exe that supports only 7z/LZMA/BCJ/BCJ2 Alone7z - 7zr.exe: Standalone version of 7z.exe that supports only 7z/LZMA/BCJ/BCJ2
LzmaCon - lzma.exe: LZMA compression/decompression
Format7zR - 7zr.dll: Reduced version of 7za.dll: extracting/compressing to 7z/LZMA/BCJ/BCJ2 Format7zR - 7zr.dll: Reduced version of 7za.dll: extracting/compressing to 7z/LZMA/BCJ/BCJ2
Format7zExtractR - 7zxr.dll: Reduced version of 7zxa.dll: extracting from 7z/LZMA/BCJ/BCJ2. Format7zExtractR - 7zxr.dll: Reduced version of 7zxa.dll: extracting from 7z/LZMA/BCJ/BCJ2.

View File

@@ -1,4 +1,4 @@
7-Zip 9.13 Sources 7-Zip 9.16 Sources
------------------ ------------------
7-Zip is a file archiver for Windows. 7-Zip is a file archiver for Windows.