Format:CIA
| Extensions | .cia |
|---|---|
| Endianness | little |
| On this wiki | Facts · Code · Notes · Topics |
CTR Installable Archive (.cia) of the 3DS: a 0x2020-byte header with section sizes and a content-present bitmap, followed by certificate chain, ticket, TMD, content (NCCH partitions) and an optional meta section, each aligned to 0x40.
Header and sections
See Fact:CIA/struct/Header (0x2020 bytes): u32 header size, u16 type, u16 version, u32 certificate chain size, u32 ticket size, u32 TMD size, u32 meta size, u64 content size, then a 0x2000-byte bitmap with one bit per possible content index (up to 0x10000 contents; index 0 is the most significant bit of the first byte).
Section offsets follow from the sizes (Fact:CIA/behavior/Section offsets): certificate chain at align(header size, 0x40); ticket at align(cert end, 0x40); TMD at align(ticket end, 0x40); content at align(TMD end, 0x40); meta at align(content end + content size, 0x40). The meta section is 0x400 bytes: 0x30 u64 dependency title ids, 0x180 reserved, u32 core version, 0xFC reserved; an Format:SMDH may follow it in the same meta section.
Each content is normally an Format:NCCH container (the application's executable and RomFS), listed in the TMD with its index and size; contents may be encrypted with the title key from the ticket, which this wiki does not document.
ctrtool declares the u16 type (0 = Normal, the only value) and the format version (0 = Default, 0xFF = SimpleCia), calls the meta section the footer, and declares a 16-byte content alignment next to the 64-byte section alignment (Fact:CIA/struct/Header and footer (ctrtool)). Unverified: what a SimpleCia is, and which code uses the 16-byte constant (I read only the declarations).
Code & repositories
- https://github.com/azahar-emu/azahar @
987f18405073960622e1043bb44005989135c6e1· license: GPL-3.0
azahar (3DS emulator, GPL-2.0): src/core/loader/3dsx.cpp, src/core/file_sys/cia_container.h/.cpp, ncch_container.h. Read for format facts only.
Tested on: source read, not run · checked 2026-10-18; last activity 2026-10-17; Note: the latest release ships binaries; the wiki links only the source, never the binaries - https://github.com/3DSGuy/Project_CTR @
d52c2b0e788c2d085763d7c5dcc4b2edd9ffb7d8· license: MIT (declared by the contributor; GitHub's detector did not recognize a license file)
Project_CTR (ctrtool, makerom): ctrtool/deps/libnintendo-n3ds/include/ntd/n3ds/ncch.h, exheader.h, exefs.h, cia.h, cro.h declare the NCCH, extended header, ExeFS, CIA and CRO structures with static size asserts. License taken from ctrtool/deps/libnintendo-n3ds/LICENSE (MIT); GitHub's detector found no top-level license.
Tested on: source read, not run · checked 2026-10-19; last activity 2026-10-11; Note: the latest release ships binaries; the wiki links only the source, never the binaries