Difference between revisions of "CIA"

From 3dbrew
Jump to navigation Jump to search
(fixing link)
Line 3: Line 3:
 
CIA stands for '''C'''TR '''I'''mportable '''A'''rchive. These files contain a compiled application which can be installed on CTR NAND, TWL NAND (part of the NAND used by DSi applications) and on the SD card.
 
CIA stands for '''C'''TR '''I'''mportable '''A'''rchive. These files contain a compiled application which can be installed on CTR NAND, TWL NAND (part of the NAND used by DSi applications) and on the SD card.
  
An example .CIA can be downloaded here [http://www.multiupload.com/5CJ2QQPOWE] Credit: [[User:Jl12|Jl12]]. It includes a .cia file, the .cia file in its extracted form, a screenshot of the application working and some information given by the 3DS.
+
An example .CIA can be downloaded [http://sherer.co.il/3ds/cia/Sample%20Cia/ here] Credit: [[User:Jl12|Jl12]]. It includes a .cia file, the .cia file in its extracted form, a screenshot of the application working and some information given by the 3DS.
  
 
=== Format ===
 
=== Format ===

Revision as of 02:51, 2 May 2012

Overview

CIA stands for CTR Importable Archive. These files contain a compiled application which can be installed on CTR NAND, TWL NAND (part of the NAND used by DSi applications) and on the SD card.

An example .CIA can be downloaded here Credit: Jl12. It includes a .cia file, the .cia file in its extracted form, a screenshot of the application working and some information given by the 3DS.

Format

The CIA format has a similar structure to the WAD format.

The file is represented in little-endian.

The data is aligned in 64 byte blocks (if a content ends at the middle of the block, the next content will begin from a new block).

CIA Header

This is a 32 bytes long header (8 x uint32).

START SIZE DESCRIPTION
0x00 0x04 Archive Header Size (=0x2020 bytes) (Starts with 0x80 @ offset 0x0020)
0x04 0x02 Type
0x06 0x02 Version
0x08 0x04 Certificate chain size
0x0C 0x04 Ticket size
0x10 0x04 TMD file size
0x14 0x04 Icon size (0 if no icon)
0x18 0x04 APP file size
0x1C 0x04 0x80000000

The order of the sections in the header also is the order of them in the CIA file:

  • certificate chain
  • Ticket
  • TMD file data
  • APP file data
  • Icon - (is not a necessary component and can be removed without altering the validity of the file)

The APP data can be either encrypted or cleartext, retail Download Play CIAs' APP data is always encrypted.

Icon

The actual icon is located at offset 0x400 in the icon data.