diff options
Diffstat (limited to '7zip/Archive/Rar/RarHeader.h')
-rwxr-xr-x | 7zip/Archive/Rar/RarHeader.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/7zip/Archive/Rar/RarHeader.h b/7zip/Archive/Rar/RarHeader.h index f7e6f711..832a21c0 100755 --- a/7zip/Archive/Rar/RarHeader.h +++ b/7zip/Archive/Rar/RarHeader.h @@ -42,7 +42,10 @@ namespace NArchive const UInt16 kRecovery = 0x40; const UInt16 kBlockEncryption = 0x80; const UInt16 kFirstVolume = 0x100; // (set only by RAR 3.0 and later) + const UInt16 kEncryptVer = 0x200; // RAR 3.6 there is EncryptVer Byte in End of MainHeader + const int kHeaderSizeMin = 7; + struct CBlock { UInt16 CRC; @@ -53,9 +56,19 @@ namespace NArchive UInt32 Reserved2; // UInt16 GetRealCRC() const; }; + const int kArchiveHeaderSize = 13; const int kBlockHeadersAreEncrypted = 0x80; + + struct CHeader360: public CBlock + { + Byte EncryptVersion; + bool IsEncrypted() const { return (Flags & NHeader::NArchive::kBlockEncryption) != 0; } + bool IsThereEncryptVer() const { return (Flags & NHeader::NArchive::kEncryptVer) != 0; } + bool IsEncryptOld() const { return (!IsThereEncryptVer() || EncryptVersion < 36); } + UInt32 GetBaseSize() const { return kArchiveHeaderSize + (IsEncryptOld() ? 0 : 1); } + }; } namespace NFile |