Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Apple File System Compression (decmpfs)

Hierarchical File System (HFS) and Apple File System (APFS) use Apple File System Compression (decmpfs) to compress file contents.

Overview

An Apple File System Compression (decmpfs) compressed file consists of:

  • an extended attribute named “com.apple.decmpfs”

Characteristics

CharacteristicsDescription
Byte orderlittle-endian

decmpfs extended attribute

The decmpfs extended attribute consists of:

  • decmpfs header
  • optional compressed data

decmpfs header

The decmpfs header is 16 bytes in size and consists of:

OffsetSizeValueDescription
04"fpmc"Signature
44Compression method
88Uncompressed data size

Note that the signature is likely stored in little-endian and represents “cmpf”.

Compression methods

ValueIdentifierDescription
1CMP_Type1Unknown (uncompressed extended attribute data)
3ZLIB (DEFLATE) compressed extended attribute data, where the compressed data is stored in the extended attribute after the compressed data header
464k chunked ZLIB (DEFLATE) compressed resource fork, where the compressed data is stored in the resource fork
5Unknown (sparse compressed extended attribute data), where the uncompressed data contains 0-byte values
6Unknown (unused)
7LZVN compressed extended attribute data, where the compressed data is stored in the extended attribute after the compressed data header
864k chunked LZVN compressed resource fork, where the compressed data is stored in the resource fork
9Unknown (uncompressed extended attribute data, different than CMP_Type1)
10Unknown (64k chunked uncompressed data resource fork), where the compressed data is stored in the resource fork
11LZFSE compressed extended attribute data, where the compressed data is stored in the extended attribute after the compressed data header
1264k chunked LZFSE compressed resource fork, where the compressed data is stored in the resource fork
0x80000001Unknown (faulting file)

Note that if the ZLIB (DEFLATE) compressed data starts with 0xff the data is stored uncompressed after the first compressed data byte.

Note that if the LZVN compressed data starts with 0x06 (end of stream oppcode) the data is stored uncompressed after the first compressed data byte.