Changes

352 bytes added ,  23:16, 27 June 2012
import info from ctrtool.
Line 1: Line 1:  
[[Category:File formats]]
 
[[Category:File formats]]
This page documents the format of NCSD. CTR cart images (CCI) is NCSD, but the same NCSD is for SD card titles and other things as well. CSU is NCSD used for system updates and development tools.
+
This page documents the format of NCSD. CTR cart images (CCI) is NCSD, but is used for other things as well. CSU is NCSD used for system updates and development tools.
   −
This is a container format which holds [[CXI]] files inside.
+
This is a container format which generally holds [[CXI]] files inside.
    
=== Overview ===
 
=== Overview ===
NCSD images start with a NCSD header, followed by up to a maximum of 13 NCCH blocks according to spec. The first block(CXI 0) always starts at 0x4000. In most carts the first block contains game code/data. The second block(CXI 1) contains the game "Manual"(title ID for the .CXI containing the Manual always starts with '0005'). In the third block(CXI 2) contains the download play "Child"(The title ID for the .CXI containing the Child always starts with '0006'). The eighth block(CXI 7) contains "Update Data"(The title ID for the .CXI containing the Update Data always starts with '8000') The exact contents of NCCH blocks can be determined by looking at the flags.
+
NCSD images start with a NCSD header, followed by up to a maximum of 8 partitions according to spec. The first partition(NCCH 0) usually starts at 0x4000, this is generally the main NCCH executable. The following info on partitions 1, 2, and 7 are only valid for .CCI. The second partition(NCCH 1) contains the game "Manual"(title ID for the .CXI containing the Manual always starts with '0005'). The third partition(NCCH 2) contains the download play "Child"(The title ID for the NCCH containing the Child always starts with '0006'). The eighth block(NCCH 7) contains "Update Data"(The title ID for the NCCH containing the Update Data always starts with '8000') The format of partitions can be determined from the partition FS flags, while the contents can be determined from the partitions flags.
    
=== NCSD header ===
 
=== NCSD header ===
Line 31: Line 31:  
|-
 
|-
 
|  0x110
 
|  0x110
16
+
8
Unknown
+
Partitions FS type
 +
|-
 +
|  0x118
 +
|  8
 +
|  Partitions crypt type
 
|-
 
|-
 
|  0x120
 
|  0x120
0x68=(4+4)*13
+
0x40=(4+4)*8
|  Offset & Length CXI table
+
|  Offset & Length partition table
 +
|-
 +
|  0x160
 +
|  0x20
 +
|  Exheader SHA-256 hash
 +
|-
 +
|  0x180
 +
|  0x4
 +
|  Additional header size
 +
|-
 +
|  0x184
 +
|  0x4
 +
|  Sector zero 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.
+
Partition Flags: byte[5]-byte[7] indicate content type ( system update, application, manual, ... ) size of media units ( 512*2^byte[6] ) and encryption.
 
|-
 
|-
 
|  0x190
 
|  0x190
0x68=8*13
+
0x40=8*8
CXI's Title ID table  
+
Partitions' Title ID table  
 +
|-
 +
|  0x1D0
 +
|  0x28
 +
|  Reserved
 
|-
 
|-
 
|  0x1F8
 
|  0x1F8
Line 75: Line 95:  
|}
 
|}
   −
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. NCSD can hold up to 8 partitions. (i.e. Mario Kart 7 holds 4 NCCHs, most we've seen so far)
NCSD can hold up to 13 CXI (i.e. Mario Kart 7 holds 4 CXIs, most we've seen so far)
      
The region-specific NVer title for this NCSD presumably must exist on NAND. The NVer title version may also be used to check whether a system update is required before running the app.
 
The region-specific NVer title for this NCSD presumably must exist on NAND. The NVer title version may also be used to check whether a system update is required before running the app.