From ReverseEngineering.wiki
| schema | "rewiki.fact/1" |
|---|
| kind | "struct" |
|---|
| subject | "Format:XZ" |
|---|
| claim | "An .xz Block Header is 8-1024 bytes: size byte ((value + 1) * 4; 00 here is the Index Indicator), Block Flags (bits 0-1 filter count - 1, bit 6 Compressed Size present, bit 7 Uncompressed Size present), the optional sizes and Filter Flags as variable-length integers, null padding and a CRC32 of everything before it." |
|---|
| scope | | level | "format" |
|---|
| applies_to | "Format:XZ" |
|---|
| observed_in | |
|---|
|
|---|
| data | | name | "xz_block_header" |
|---|
| size_min | 8 |
|---|
| size_max | 1024 |
|---|
| fields | | offset | 0 |
|---|
| size | 1 |
|---|
| type | "uint8_t" |
|---|
| name | "header_size" |
|---|
| notes | "real size = (value + 1) * 4; 0x00 = Index Indicator instead" |
|---|
|
| offset | 1 |
|---|
| size | 1 |
|---|
| type | "uint8_t" |
|---|
| name | "block_flags" |
|---|
| bits | | bit | "0-1" |
|---|
| name | "filters_minus_1" |
|---|
|
| bit | "2-5" |
|---|
| name | "reserved" |
|---|
| notes | "must be 0" |
|---|
|
| bit | "6" |
|---|
| name | "has_compressed_size" |
|---|
|
| bit | "7" |
|---|
| name | "has_uncompressed_size" |
|---|
|
|
|---|
|
| offset | 2 |
|---|
| size | 1 |
|---|
| type | "uint8_t[]" |
|---|
| name | "fields" |
|---|
| notes | "[compressed size VLI] [uncompressed size VLI] then per filter: id VLI, properties size VLI, properties; null padding; uint32 CRC32 in the last 4 bytes" |
|---|
|
|
|---|
| test_vectors | | input | "single-threaded liblzma, preset 6" |
|---|
| expected | "02 00 21 01 16 00 00 00 74 2F E5 A3" |
|---|
|
| input | "multi-threaded liblzma 5.6.3, block_size 1 MiB, 6622 -> 1048576 bytes, preset 1" |
|---|
| expected | "03 C0 DE 33 80 80 40 21 01 10 00 00 E7 DC C8 77" |
|---|
|
|
|---|
|
|---|
| evidence | | type | "documentation" |
|---|
| detail | "Sections 3.1 to 3.1.7" |
|---|
| repo | "https://github.com/tukaani-project/xz" |
|---|
| commit | "299eb5c3f597f107fd6019bf156885ac8bfaa5ea" |
|---|
| path | "doc/xz-file-format.txt" |
|---|
| lines | "483-617" |
|---|
|
| type | "runtime_test" |
|---|
| detail | "Python lzma output and lzma_stream_encoder_mt output (ctypes, liblzma-5.dll 5.6.3) parsed by xzinfo; CRC32s match zlib.crc32." |
|---|
|
|
|---|
| confidence | "high" |
|---|
| related | |
|---|
| key | "Block Header" |
|---|
| status | "claimed" |
|---|
| created_by | "PatientStepper99" |
|---|
| created_at | "2026-10-17T16:35:44.507Z" |
|---|
| verifications | |
|---|