A cabinet begins with a header (MSCF, size, offset of the first file entry, counts) followed by folder entries, file entries and CFDATA blocks. Folders are compressed with MSZIP, Quantum or LZX and can span cabinets.
Where it is used
Windows installers and updates, driver packages.
Setup programs and MSI media.
History
Introduced by Microsoft in the mid 1990s.
Status today
Still used throughout Windows.
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.
CabCarver.FindCabinet buffer data · CabCarver.cs
Offset
Size
Type
Field
Notes
i + 1
1
u8
–
i + 2
1
u8
–
i + 3
1
u8
–
i + 4
4
u32 LE
–
FolderResult.Carve buffer tables · CabCarver.cs
Offset
Size
Type
Field
Notes
position
2
u16 LE
–
position
2
u16 LE
Header Reserve
position
4
u32 LE
–
position
4
u32 LE
Size
position + 2
1
u8
Folder Reserve
position + 3
1
u8
Data Reserve
position + 4
4
u32 LE
–
position + 4
2
u16 LE
–
position + 4
4
u32 LE
Offset
position + 6
2
u16 LE
–
position + 8
4
u32 LE
Signature At
position + 8
2
u16 LE
Folder
position + 10
2
u16 LE
Date
position + 12
4
u32 LE
Signature Length
position + 12
2
u16 LE
Time
position + 14
2
u16 LE
Attributes
FolderResult.WalkFolder buffer head · CabCarver.cs
Offset
Size
Type
Field
Notes
0x0
4
u32 LE
Stored
0x4
2
u16 LE
Packed
0x4
4
bytes
Sum
0x4
4
bytes
Ok
0x6
2
u16 LE
Size
struct.ParseHeader buffer h · CabCarver.cs
Offset
Size
Type
Field
Notes
0x4
4
u32 LE
–
0x8
4
u32 LE
Size
0x10
4
u32 LE
Files Offset
0x18
1
u8
–
0x19
1
u8
–
0x1A
2
u16 LE
Folders
0x1C
2
u16 LE
Files
0x1E
2
u16 LE
Flags
0x20
2
u16 LE
–
0x22
2
u16 LE
–
CabFolders.Decode buffer head · CabExtractor.cs
Offset
Size
Type
Field
Notes
0x4
2
u16 LE
Packed
0x6
2
u16 LE
Uncomp
Other fields read
Read in
Offset
Size
Type
Field
Notes
struct.Checksum
(i * 4)
4
u32 LE
–
LzxDecoder.UndoE8
(i + 1)
4
i32 LE
Absolute
Constants
General CabCarver
Name
Value
Type
Notes
HeaderSize
36
int
BlockHeaderSize
8
int
InitialRead
64 * 1024
int
SignatureMarker
0x00100000
int
General CabExtractor
Name
Value
Type
Notes
HeaderSize
36
int
BlockHeaderSize
8
int
General Lzx
Name
Value
Type
Notes
NumChars
256
int
PretreeElements
20
int
AlignedElements
8
int
NumPrimaryLengths
7
int
NumSecondaryLengths
249
int
FrameSize
32768
int
BlockVerbatim
1
int
BlockAligned
2
int
BlockUncompressed
3
int
ExtraBits
BuildExtraBits()
int[]
PositionBase
BuildPositionBase()
int[]
General LzxDecoder
Name
Value
Type
Notes
NumChars
256
int
LengthHeaders
8
int
PrimaryLengths
7
int
LengthSymbols
249
int
PretreeSymbols
20
int
AlignedSymbols
8
int
E8FileSize
12_000_000
int
General CabArchiveModule
Name
Value
Type
Notes
Magic
[0x4D, 0x53, 0x43, 0x46, 0x00, 0x00, 0x00, 0x00]
byte[]
Implementation limits reader
Class
Name
Value
Notes
CabCarver
MaxBlockOutput
32768
CabCarver
MaxTables
64 * 1024 * 1024
CabCarver
MaxInflated
512L * 1024 * 1024
CabCarver
MaxSignature
1024 * 1024
CabExtractor
MaxBlockOutput
32768
CabExtractor
MaxFolderOutput
int.MaxValue
Lzx
MinMatch
2
LzxDecoder
MinMatch
2
LzxDecoder
MinAlignedSlot
8
LzxDecoder
MaxOffsetSlots
50
LzxDecoder
DefaultBlockSize
32768
Signatures and magic strings referenced
Text
Where
Context
MSCF
struct.ParseHeader
if (!h.StartsWith(“MSCF”u8) || BinaryPrimitives.ReadUInt32LittleEndian(h[4..]) != 0)
Structures and constants were extracted from: Carving/Plugins/Cab/CabCarver.cs, Carving/Plugins/Cab/CabExtractor.cs, Carving/Plugins/Cab/Lzx.cs, IO/Compression/LzxDecoder.cs, Modules/FileSystems/CabArchiveModule.cs. Prose sections are a summary from public sources; verify details before relying on them.