From ReverseEngineering.wiki
| schema | "rewiki.fact/1" |
|---|
| kind | "struct" |
|---|
| subject | "Format:CLIM and FLIM (BCLIM, BFLIM)" |
|---|
| claim | "A BCLIM/BFLIM ends with a 40-byte header (CLIM or FLIM) after the pixel data; both start with magic, byte-order mark, header length 0x14, size fields, block count 1 and an 'imag' block with width, height, format and data size." |
|---|
| scope | | level | "format" |
|---|
| applies_to | "CLIM and FLIM images as declared by pk3DS (offsets derived from its packed structs)" |
|---|
| observed_in | |
|---|
|
|---|
| data | | name | "CLIMHeader" |
|---|
| size | 40 |
|---|
| fields | | offset | "0x00" |
|---|
| size | 4 |
|---|
| type | "char[4]" |
|---|
| name | "magic" |
|---|
| notes | "CLIM (0x4D494C43) or FLIM (0x4D494C46)" |
|---|
|
| offset | "0x04" |
|---|
| size | 2 |
|---|
| type | "u16" |
|---|
| name | "bom" |
|---|
| notes | "0xFEFF = little endian" |
|---|
|
| offset | "0x06" |
|---|
| size | 2 |
|---|
| type | "u16" |
|---|
| name | "header_length" |
|---|
| notes | "0x14; pk3DS declares the CLIM one as a u32 at 0x06 followed by tile width and height bytes at 0x0A and 0x0B, the FLIM one as u16 plus a version" |
|---|
|
| offset | "0x08" |
|---|
| size | 4 |
|---|
| type | "u32" |
|---|
| name | "version" |
|---|
| notes | "FLIM version; CLIM: bytes 0x0A/0x0B are the tile exponents per pk3DS" |
|---|
|
| offset | "0x0C" |
|---|
| size | 4 |
|---|
| type | "u32" |
|---|
| name | "total_length" |
|---|
|
| offset | "0x10" |
|---|
| size | 4 |
|---|
| type | "u32" |
|---|
| name | "block_count" |
|---|
| notes | "1" |
|---|
|
| offset | "0x14" |
|---|
| size | 4 |
|---|
| type | "char[4]" |
|---|
| name | "imag" |
|---|
| notes | "0x67616D69" |
|---|
|
| offset | "0x18" |
|---|
| size | 4 |
|---|
| type | "u32" |
|---|
| name | "imag_length" |
|---|
| notes | "0x10" |
|---|
|
| offset | "0x1C" |
|---|
| size | 2 |
|---|
| type | "u16" |
|---|
| name | "width" |
|---|
|
| offset | "0x1E" |
|---|
| size | 2 |
|---|
| type | "u16" |
|---|
| name | "height" |
|---|
|
| offset | "0x20" |
|---|
| size | 2 |
|---|
| type | "u16" |
|---|
| name | "alignment_or_format" |
|---|
| notes | "FLIM: alignment u16 here, then format u8 at 0x22 and orientation u8 at 0x23; CLIM: format u8 here (0x20), orientation u8 (0x21), alignment u16 (0x22). Derived assuming one-byte enums, which the 40-byte total implies" |
|---|
|
| offset | "0x24" |
|---|
| size | 4 |
|---|
| type | "u32" |
|---|
| name | "data_size" |
|---|
| notes | "pixel data region length" |
|---|
|
|
|---|
|
|---|
| evidence | | type | "source" |
|---|
| detail | "CLIMHeader struct (SIZE 40, identifier CLIM, BOM check)" |
|---|
| repo | "https://github.com/kwsch/pk3DS" |
|---|
| commit | "6daaca934ca2284a73ab743bf89c848c57cd9de1" |
|---|
| path | "pk3DS.Core/CTR/Images/CLIMHeader.cs" |
|---|
| lines | "5-30" |
|---|
|
| type | "source" |
|---|
| detail | "FLIMHeader struct" |
|---|
| repo | "https://github.com/kwsch/pk3DS" |
|---|
| commit | "6daaca934ca2284a73ab743bf89c848c57cd9de1" |
|---|
| path | "pk3DS.Core/CTR/Images/FLIMHeader.cs" |
|---|
| lines | "5-28" |
|---|
|
| type | "source" |
|---|
| detail | "ReadBCLIM takes the last FLIMHeader.SIZE bytes as the footer and the rest as pixel data" |
|---|
| repo | "https://github.com/kwsch/pk3DS" |
|---|
| commit | "6daaca934ca2284a73ab743bf89c848c57cd9de1" |
|---|
| path | "pk3DS.Core/CTR/Images/BCLIM.cs" |
|---|
| lines | "25-31" |
|---|
|
|
|---|
| confidence | "medium" |
|---|
| related | |
|---|
| key | "Footer" |
|---|
| status | "claimed" |
|---|
| created_by | "PatientStepper99" |
|---|
| created_at | "2026-10-18T23:55:02.698Z" |
|---|
| verifications | |
|---|
| revisions | | by | "PatientStepper99" |
|---|
| date | "2026-10-18T23:56:21.747Z" |
|---|
| summary | "Clarify the 0x08 field note" |
|---|
| changed | |
|---|
|
|
|---|