Difference between revisions of "CCI"

From 3dbrew
Jump to navigation Jump to search
m (typo.)
Line 2: Line 2:
  
 
=== Overview ===
 
=== Overview ===
CCI files start with a NCSD header which is 4096 bytes long, followed by 4 [[CXI]] blocks. While it is unknown what each CXI block is for, the second one is most likely the main program code since it is much bigger than the others.
+
CCI files start with a NCSD header, followed by 3 [[CXI]] blocks. The first block usually starts at 0x4000. While it is unknown what each CXI block is for, the first one is most likely the main program code since it is much bigger than the others.
 
 
The first CXI block always begins at 0x1000, and appears to lack a RSA-2048 signature. The offsets to the other blocks are found inside the NCSD header.
 
  
 
=== NCSD header ===
 
=== NCSD header ===
Line 27: Line 25:
 
|  0x108
 
|  0x108
 
|  8
 
|  8
|  Title ID(?)
+
|  Title/Program ID
 
|-
 
|-
 
|  0x120
 
|  0x120
 
|  4
 
|  4
|  Offset to the second CXI in media units
+
|  Offset to the first CXI in media units
 
|-
 
|-
 
|  0x124
 
|  0x124
 
|  4
 
|  4
|  Size of the second CXI
+
|  Size of the first CXI
 
|-
 
|-
 
|  0x130
 
|  0x130
 
|  4
 
|  4
|  Offset to the third CXI
+
|  Offset to the second CXI
 
|-
 
|-
 
|  0x134
 
|  0x134
 
|  4
 
|  4
|  Size of the third CXI
+
|  Size of the second CXI
 
|-
 
|-
 
|  0x158
 
|  0x158
 
|  4
 
|  4
|  Offset to the fourth CXI
+
|  Offset to the third CXI
 
|-
 
|-
 
|  0x15C
 
|  0x15C
 
|  4
 
|  4
|  Size of the fourth CXI
+
|  Size of the third CXI
 
|-
 
|-
 
|  0x18C
 
|  0x18C
Line 59: Line 57:
 
|  0x190
 
|  0x190
 
|  8
 
|  8
|  Partition ID of the second CXI
+
|  Partition ID of the first CXI
 
|-
 
|-
 
|  0x1A0
 
|  0x1A0
 
|  8
 
|  8
|  Partition ID of the third CXI
+
|  Partition ID of the second CXI
 
|-
 
|-
 
|  0x1C8
 
|  0x1C8
 
|  8
 
|  8
|  Partition ID of the fourth CXI
+
|  Partition ID of the third CXI
 
|-
 
|-
 
|  0x200
 
|  0x200
Line 82: Line 80:
 
|}
 
|}
  
CCI images may not include all four CXI blocks. For example, Ghost Recon: Shadow Wars lacks the third CXI. Entries at 0x130, 0x134 and 0x1A0 in its NCSD header are zero.
+
Parts of the first CXI block's NCCH header are found around 0x1000 for whatever reason.
 +
 
 +
CCI images may not include all three CXI blocks. For example, Ghost Recon: Shadow Wars lacks the second CXI. Entries at 0x130, 0x134 and 0x1A0 in its NCSD header are zero.

Revision as of 12:27, 31 July 2011

This document is about the format of CTR cart images (CCI), which is also the format of 3DS ROM dumps.

Overview

CCI files start with a NCSD header, followed by 3 CXI blocks. The first block usually starts at 0x4000. While it is unknown what each CXI block is for, the first one is most likely the main program code since it is much bigger than the others.

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
0x120 4 Offset to the first CXI in media units
0x124 4 Size of the first CXI
0x130 4 Offset to the second CXI
0x134 4 Size of the second CXI
0x158 4 Offset to the third CXI
0x15C 4 Size of the third CXI
0x18C 4 Unknown (always 0x00000101)
0x190 8 Partition ID of the first CXI
0x1A0 8 Partition ID of the second CXI
0x1C8 8 Partition ID of the third CXI
0x200 4 Always 0xFFFFFFFF
0x300 4 Used ROM size in bytes
0x320 16 Unknown

Parts of the first CXI block's NCCH header are found around 0x1000 for whatever reason.

CCI images may not include all three CXI blocks. For example, Ghost Recon: Shadow Wars lacks the second CXI. Entries at 0x130, 0x134 and 0x1A0 in its NCSD header are zero.