A 7z file starts with a signature header (7z BC AF 27 1C, version, start-header CRC, next-header offset, size and CRC). A header at the end describes folders, each a graph of coders (LZMA, LZMA2, PPMd, BZip2, Deflate, Copy and filters such as BCJ and Delta) with unpack sizes and CRCs. AES-256 encryption can cover data and headers.
Where it is used
High-ratio compression and software distribution.
Backups and large downloads.
History
Created by Igor Pavlov, first released with 7-Zip in 1999.
Status today
Actively maintained; the format is open and documented in the LZMA SDK.
Structures read by the implementation
Offsets are in bytes from the start of the buffer named in each heading. Field names are taken from the implementation and are not an official specification. Fixed-width integers are shown as u/i (unsigned/signed) followed by bit width and byte order.
in-memory decode budget per folder (byte[]-bounded)
SevenZipExtractor
MaxFiles
10_000_000
SevenZipArchiveModule
SfxScanLimit
8 * 1024 * 1024
BranchFilter enum
Name
Value
X86
(next)
PowerPc
(next)
Ia64
(next)
Arm
(next)
ArmThumb
(next)
Sparc
(next)
Arm64
(next)
RiscV
(next)
Structures and constants were extracted from: Carving/Plugins/SevenZip/Bcj2.cs, Carving/Plugins/SevenZip/BranchFilters.cs, Carving/Plugins/SevenZip/LzmaDecoder.cs, Carving/Plugins/SevenZip/Ppmd7.cs, Carving/Plugins/SevenZip/Ppmd8.cs, Carving/Plugins/SevenZip/SevenZipCarver.cs, Carving/Plugins/SevenZip/SevenZipExtractor.cs, Modules/FileSystems/SevenZipArchiveModule.cs. Prose sections are a summary from public sources; verify details before relying on them.