From ReverseEngineering.wiki
| schema | "rewiki.fact/1" |
|---|
| kind | "struct" |
|---|
| subject | "Format:CIA" |
|---|
| claim | "ctrtool declares the CIA header as 0x2020 bytes with a 'footer' size (azahar's meta size), type 0 = Normal, format version 0 = Default or 0xFF = SimpleCia, a 64-byte section alignment and a separate 16-byte content alignment constant; its 0x400-byte footer holds 48 dependency title ids and the core version." |
|---|
| scope | | level | "format" |
|---|
| applies_to | "CIA as declared by ctrtool (libnintendo-n3ds)" |
|---|
| observed_in | |
|---|
|
|---|
| data | | name | "CiaHeader / CiaFooter" |
|---|
| size | "0x2020" |
|---|
| endianness | "little" |
|---|
| fields | | offset | "0x00" |
|---|
| size | 4 |
|---|
| type | "u32" |
|---|
| name | "header_size" |
|---|
|
| offset | "0x04" |
|---|
| size | 2 |
|---|
| type | "u16" |
|---|
| name | "type" |
|---|
| notes | "0 = Type_Normal (only value declared)" |
|---|
|
| offset | "0x06" |
|---|
| size | 2 |
|---|
| type | "u16" |
|---|
| name | "format_version" |
|---|
| notes | "0 = Default, 0xFF = SimpleCia" |
|---|
|
| offset | "0x08" |
|---|
| size | 4 |
|---|
| type | "u32" |
|---|
| name | "certificate_size" |
|---|
|
| offset | "0x0C" |
|---|
| size | 4 |
|---|
| type | "u32" |
|---|
| name | "ticket_size" |
|---|
|
| offset | "0x10" |
|---|
| size | 4 |
|---|
| type | "u32" |
|---|
| name | "tmd_size" |
|---|
|
| offset | "0x14" |
|---|
| size | 4 |
|---|
| type | "u32" |
|---|
| name | "footer_size" |
|---|
| notes | "the optional meta/footer section; 0x400 when it holds only the CiaFooter" |
|---|
|
| offset | "0x18" |
|---|
| size | 8 |
|---|
| type | "u64" |
|---|
| name | "content_size" |
|---|
|
| offset | "0x20" |
|---|
| size | 8192 |
|---|
| type | "u8[0x2000]" |
|---|
| name | "content_bitarray" |
|---|
| notes | "kCiaMaxContentNum 0x10000 bits" |
|---|
|
|
|---|
|
|---|
| evidence | | type | "source" |
|---|
| detail | "CiaHeader with constants kCiaSectionAlignment 64 and kCiaContentAlignment 16, Type and FormatVersion enums, static_assert 0x2020; CiaFooter: 48 x u64 dependency_list, 0x180 pad, u32 firmware_title_id_lower ('core version'), 0xFC pad, static_assert 0x400. Bit order of the bitarray template (template args <size, true, false>) not read here; azahar's IsContentPresent is MSB first. Which code uses the 16-byte content alignment was not read." |
|---|
| repo | "https://github.com/3DSGuy/Project_CTR" |
|---|
| commit | "d52c2b0e788c2d085763d7c5dcc4b2edd9ffb7d8" |
|---|
| path | "ctrtool/deps/libnintendo-n3ds/include/ntd/n3ds/cia.h" |
|---|
| lines | "8-57" |
|---|
|
|
|---|
| confidence | "high" |
|---|
| related | |
|---|
| key | "Header and footer (ctrtool)" |
|---|
| status | "claimed" |
|---|
| created_by | "PatientStepper99" |
|---|
| created_at | "2026-10-19T12:40:21.731Z" |
|---|
| verifications | |
|---|