Difference between revisions of "CCI"
Jump to navigation
Jump to search
(→CXI Table Theory: too big header) |
(update the table theory (it appeared to be correct)) |
||
Line 1: | Line 1: | ||
+ | [[Category:File formats]] | ||
This document is about the format of CTR cart images (CCI), which is also the format of 3DS ROM dumps. | This document is about the format of CTR cart images (CCI), which is also the format of 3DS ROM dumps. | ||
+ | |||
+ | This is a container format which holds [[CXI]] files inside. | ||
=== Overview === | === Overview === | ||
− | CCI files start with a NCSD header, followed by up to a maximum of | + | CCI files start with a NCSD header, followed by up to a maximum of 13 NCCH blocks according to spec. The first block usually starts at 0x4000. In most carts the first block contains game code/data, the second block contains the download play "child" and the third block contains potential system updates. The exact contents of NCCH blocks can be determined by looking at the flags. |
− | |||
− | |||
=== NCSD header === | === NCSD header === | ||
Line 28: | Line 29: | ||
| 8 | | 8 | ||
| Title/Program ID | | Title/Program ID | ||
+ | |- | ||
+ | | 0x110 | ||
+ | | 16 | ||
+ | | Unknown | ||
|- | |- | ||
| 0x120 | | 0x120 | ||
− | | 4 | + | | 0x68=(4+4)*13 |
− | + | | Offset & Length CXI table | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | | Offset | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
|- | |- | ||
| 0x188 | | 0x188 | ||
| 8 | | 8 | ||
− | | | + | | CXI Flags: byte[5]-byte[7] indicate content type ( system update, application, manual, ... ) size of media units ( 512*2^byte[6] ) and encryption. |
|- | |- | ||
| 0x190 | | 0x190 | ||
− | | 8 | + | | 0x68=8*13 |
− | | | + | | CXI's Title ID table |
− | |||
− | |||
− | |||
− | |||
|- | |- | ||
− | | | + | | 0x1F8 |
| 8 | | 8 | ||
− | | | + | | Unknown |
|- | |- | ||
| 0x200 | | 0x200 | ||
| 4 | | 4 | ||
| Always 0xFFFFFFFF | | Always 0xFFFFFFFF | ||
+ | |- | ||
+ | | 0x204 | ||
+ | | 252 | ||
+ | | Padding? | ||
|- | |- | ||
| 0x300 | | 0x300 | ||
| 4 | | 4 | ||
| Used ROM size in bytes | | Used ROM size in bytes | ||
+ | |- | ||
+ | | 0x304 | ||
+ | | 28 | ||
+ | | Padding | ||
|- | |- | ||
| 0x320 | | 0x320 | ||
Line 88: | Line 77: | ||
Parts of the first NCCH block's header are found around 0x1000 for whatever reason. | Parts of the first NCCH block's header are found around 0x1000 for whatever reason. | ||
− | CCI | + | CCI can hold up to 13 CXI (i.e. Mario Kart 7 holds 4 CXIs, most we've seen so far) |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | CSU files are basicaly CCI files. |
Revision as of 11:32, 21 December 2011
This document is about the format of CTR cart images (CCI), which is also the format of 3DS ROM dumps.
This is a container format which holds CXI files inside.
Overview
CCI files start with a NCSD header, followed by up to a maximum of 13 NCCH blocks according to spec. The first block usually starts at 0x4000. In most carts the first block contains game code/data, the second block contains the download play "child" and the third block contains potential system updates. The exact contents of NCCH blocks can be determined by looking at the flags.
NCSD header
OFFSET | SIZE | DESCRIPTION |
---|---|---|
0x000 | 0x100 | RSA-2048 signature of the NCSD header, using SHA-256 (needs to be confirmed) |
0x100 | 4 | Magic ID, always 'NCSD' |
0x104 | 4 | Size of the CCI image, in media units (1 media unit = 0x200 bytes) |
0x108 | 8 | Title/Program ID |
0x110 | 16 | Unknown |
0x120 | 0x68=(4+4)*13 | Offset & Length CXI table |
0x188 | 8 | CXI Flags: byte[5]-byte[7] indicate content type ( system update, application, manual, ... ) size of media units ( 512*2^byte[6] ) and encryption. |
0x190 | 0x68=8*13 | CXI's Title ID table |
0x1F8 | 8 | Unknown |
0x200 | 4 | Always 0xFFFFFFFF |
0x204 | 252 | Padding? |
0x300 | 4 | Used ROM size in bytes |
0x304 | 28 | Padding |
0x320 | 8 | Loader Title ID |
0x328 | 8 | Loader Title Version |
Parts of the first NCCH block's header are found around 0x1000 for whatever reason.
CCI can hold up to 13 CXI (i.e. Mario Kart 7 holds 4 CXIs, most we've seen so far)
CSU files are basicaly CCI files.