Line 17: |
Line 17: |
| |- | | |- |
| | 0x1200 | | | 0x1200 |
− | | 0x6E00 | + | | 0x200 |
| + | | [11.0.0+] [[#NewCardHeader]] |
| + | |- |
| + | | 0x1400 |
| + | | 0x400 |
| + | | [11.0.0+] [[#NewCardHeaderCertArea]] |
| + | |- |
| + | | 0x1800 |
| + | | 0x6800 |
| | ReservedArea | | | ReservedArea |
| |- | | |- |
Line 76: |
Line 84: |
| | 0x8 | | | 0x8 |
| | 0x8 | | | 0x8 |
− | | Empty | + | | Reserved |
| |- | | |- |
| | 0x10 | | | 0x10 |
Line 130: |
Line 138: |
| | 0x100 | | | 0x100 |
| | 0x4 | | | 0x4 |
− | | MagicCode ("HEAD") | + | | Magic ("HEAD") |
| |- | | |- |
| | 0x104 | | | 0x104 |
Line 161: |
Line 169: |
| |- | | |- |
| | 0x118 | | | 0x118 |
− | | 0x8 | + | | 0x4 |
| | ValidDataEndAddress (in Gamecard page units, which are 0x200 bytes) | | | ValidDataEndAddress (in Gamecard page units, which are 0x200 bytes) |
| + | |- |
| + | | 0x11C |
| + | | 0x1 |
| + | | Reserved |
| + | |- |
| + | | 0x11D |
| + | | 0x1 |
| + | | [18.0.0+] [[#Flags2]] ([1.0.0-17.0.1] Reserved) |
| + | |- |
| + | | 0x11E |
| + | | 0x2 |
| + | | [19.0.0+] [[#ApplicationIdListEntryCount]] ([1.0.0-18.1.0] Reserved) |
| |- | | |- |
| | 0x120 | | | 0x120 |
Line 186: |
Line 206: |
| | 0x180 | | | 0x180 |
| | 0x4 | | | 0x4 |
− | | SelSec (0x01 = T1, 0x02 = T2) | + | | [[#SelSec]] |
| |- | | |- |
| | 0x184 | | | 0x184 |
Line 202: |
Line 222: |
| | 0x190 | | | 0x190 |
| | 0x70 | | | 0x70 |
− | | [[#CardInfo]] | + | | [[#CardHeaderEncryptedData]] |
| + | |} |
| + | |
| + | === RomSize === |
| + | [[Filesystem_services|FS]] retrieves this data as [[Filesystem_services#GameCardSize|GameCardSize]]. |
| + | |
| + | {| class="wikitable" border="1" |
| + | |- |
| + | ! Value |
| + | ! Description |
| + | |- |
| + | | 0xFA |
| + | | 1GB |
| + | |- |
| + | | 0xF8 |
| + | | 2GB |
| + | |- |
| + | | 0xF0 |
| + | | 4GB |
| + | |- |
| + | | 0xE0 |
| + | | 8GB |
| + | |- |
| + | | 0xE1 |
| + | | 16GB |
| + | |- |
| + | | 0xE2 |
| + | | 32GB |
| + | |} |
| + | |
| + | === Flags === |
| + | [[Filesystem_services|FS]] retrieves this data as [[Filesystem_services#GameCardAttribute|GameCardAttribute]]. |
| + | |
| + | {| class="wikitable" border="1" |
| + | |- |
| + | ! Bits |
| + | ! Description |
| + | |- |
| + | | 0 |
| + | | AutoBoot |
| + | |- |
| + | | 1 |
| + | | HistoryErase |
| + | |- |
| + | | 2 |
| + | | [4.0.0+] RepairTool |
| + | |- |
| + | | 3 |
| + | | [9.0.0+] DifferentRegionCupToTerraDevice |
| + | |- |
| + | | 4 |
| + | | [9.0.0+] DifferentRegionCupToGlobalDevice |
| + | |- |
| + | | 7 |
| + | | [11.0.0+] HasNewCardHeader |
| |} | | |} |
| | | |
− | === CardInfo === | + | === Flags2 === |
| + | [[Filesystem_services|FS]] retrieves this data as [[Filesystem_services#GameCardAttribute2|GameCardAttribute2]]. |
| + | |
| + | === ApplicationIdListEntryCount === |
| + | This is the number of entries in the ApplicationIdList located right before ValidDataEndAddress. |
| + | |
| + | === SelSec === |
| + | {| class="wikitable" border="1" |
| + | |- |
| + | ! Value |
| + | ! Description |
| + | |- |
| + | | 1 |
| + | | T1 |
| + | |- |
| + | | 2 |
| + | | T2 |
| + | |} |
| + | |
| + | === CardHeaderEncryptedData === |
| This region is stored encrypted (AES-128-CBC). | | This region is stored encrypted (AES-128-CBC). |
| | | |
Line 216: |
Line 309: |
| | 0x0 | | | 0x0 |
| | 0x8 | | | 0x8 |
− | | FwVersion (0x00 = Development, 0x01 = Retail, [4.0.0+] 0x02 = Retail, [11.0.0+] 0x04 = Retail) | + | | [[#FwVersion]] |
| |- | | |- |
| | 0x8 | | | 0x8 |
| | 0x4 | | | 0x4 |
− | | AccCtrl1 (0x00A10011 = 25MHz access, 0x00A10010 = 50MHz access) | + | | [[#AccCtrl1]] |
| |- | | |- |
| | 0xC | | | 0xC |
Line 248: |
Line 341: |
| | 0x24 | | | 0x24 |
| | 0x1 | | | 0x1 |
− | | [9.0.0+] CompatibilityType (0x00 = Normal, 0x01 = Terra) | + | | [9.0.0+] [[#CompatibilityType]] |
| |- | | |- |
| | 0x25 | | | 0x25 |
| | 0x3 | | | 0x3 |
− | | Empty | + | | Reserved |
| |- | | |- |
| | 0x28 | | | 0x28 |
Line 264: |
Line 357: |
| | 0x38 | | | 0x38 |
| | 0x38 | | | 0x38 |
− | | Empty | + | | Reserved |
| |} | | |} |
| | | |
− | === RomSize === | + | ==== FwVersion ==== |
− | [[Filesystem_services|FS]] retrieves this data as [[Filesystem_services#GameCardSize|GameCardSize]].
| |
− | | |
| {| class="wikitable" border="1" | | {| class="wikitable" border="1" |
| |- | | |- |
Line 275: |
Line 366: |
| ! Description | | ! Description |
| |- | | |- |
− | | 0xFA | + | | 0 |
− | | 1GB | + | | Development |
| |- | | |- |
− | | 0xF8 | + | | 1 |
− | | 2GB | + | | Retail |
| |- | | |- |
− | | 0xF0 | + | | 2 |
− | | 4GB | + | | [4.0.0+] Retail |
| |- | | |- |
− | | 0xE0 | + | | 3 |
− | | 8GB | + | | [11.0.0+] Development |
| |- | | |- |
− | | 0xE1 | + | | 4 |
− | | 16GB | + | | [11.0.0+] Retail |
| |- | | |- |
− | | 0xE2 | + | | 5 |
− | | 32GB | + | | [12.0.0+] Retail |
| |} | | |} |
| | | |
− | === Flags === | + | ==== AccCtrl1 ==== |
− | [[Filesystem_services|FS]] retrieves this data as [[Filesystem_services#GameCardAttribute|GameCardAttribute]].
| + | {| class="wikitable" border="1" |
| + | |- |
| + | ! Value |
| + | ! Description |
| + | |- |
| + | | 0x00A10011 |
| + | | 25MHz |
| + | |- |
| + | | 0x00A10010 |
| + | | 50MHz |
| + | |} |
| | | |
| + | ==== CompatibilityType ==== |
| {| class="wikitable" border="1" | | {| class="wikitable" border="1" |
| |- | | |- |
− | ! Bits | + | ! Value |
| ! Description | | ! Description |
| |- | | |- |
| | 0 | | | 0 |
− | | AutoBoot | + | | Normal |
| |- | | |- |
| | 1 | | | 1 |
− | | HistoryErase | + | | Terra |
| + | |} |
| + | |
| + | == NewCardHeader == |
| + | {| class="wikitable" border="1" |
| + | |- |
| + | ! Offset |
| + | ! Size |
| + | ! Description |
| + | |- |
| + | | 0x0 |
| + | | 0x100 |
| + | | RSA-2048 PKCS #1 signature over the data from 0x100 to 0x200 |
| + | |- |
| + | | 0x100 |
| + | | 0x90 |
| + | | |
| + | |- |
| + | | 0x190 |
| + | | 0x70 |
| + | | [[#NewCardHeaderEncryptedData]] |
| + | |} |
| + | |
| + | === NewCardHeaderEncryptedData === |
| + | This region is stored encrypted (AES-128-CBC). |
| + | |
| + | {| class="wikitable" border="1" |
| + | |- |
| + | ! Offset |
| + | ! Size |
| + | ! Description |
| + | |- |
| + | | 0x0 |
| + | | 0x40 |
| + | | |
| + | |- |
| + | | 0x40 |
| + | | 0x20 |
| + | | SHA-256 hash of the [[#CardHeader]] |
| + | |- |
| + | | 0x60 |
| + | | 0x10 |
| + | | Reserved |
| + | |} |
| + | |
| + | == NewCardHeaderCertArea == |
| + | {| class="wikitable" border="1" |
| + | |- |
| + | ! Offset |
| + | ! Size |
| + | ! Description |
| + | |- |
| + | | 0x0 |
| + | | 0x100 |
| + | | RSA-2048 PKCS #1 signature over the data from 0x100 to 0x300 |
| + | |- |
| + | | 0x100 |
| + | | 0x30 |
| + | | |
| |- | | |- |
− | | 2 | + | | 0x130 |
− | | [4.0.0+] RepairTool | + | | 0x100 |
| + | | [[#NewCardHeader]] modulus |
| |- | | |- |
− | | 3 | + | | 0x230 |
− | | [9.0.0+] DifferentRegionCupToTerraDevice | + | | 0x4 |
| + | | [[#NewCardHeader]] exponent |
| |- | | |- |
− | | 4 | + | | 0x234 |
− | | [9.0.0+] DifferentRegionCupToGlobalDevice | + | | 0x1CC |
| + | | |
| |} | | |} |
| | | |
Line 335: |
Line 498: |
| | 0x100 | | | 0x100 |
| | 0x4 | | | 0x4 |
− | | MagicCode ("CERT") | + | | Magic ("CERT") |
| |- | | |- |
| | 0x104 | | | 0x104 |
Line 351: |
Line 514: |
| | 0x110 | | | 0x110 |
| | 0x10 | | | 0x10 |
− | | DeviceId | + | | T1CardDeviceId |
| |- | | |- |
| | 0x120 | | | 0x120 |
Line 358: |
Line 521: |
| |- | | |- |
| | 0x130 | | | 0x130 |
− | | 0xD0 | + | | 0x10 |
− | | Data (encrypted) | + | | HwKey (encrypted) |
| + | |- |
| + | | 0x140 |
| + | | 0xC0 |
| + | | Reserved (encrypted) |
| |- | | |- |
| | 0x200 | | | 0x200 |
Line 440: |
Line 607: |
| | | |
| === PartitionFsHeader === | | === PartitionFsHeader === |
− | The "SHA-256 File System" or "HFS0" starts at offset 0x10000 in the Gamecard. The first 0x200 bytes act as a global header and represent the root partition which points to the other partitions ("normal", "logo", "update" and "secure). | + | The "SHA-256 File System" or "HFS0" starts at offset 0x10000 in the Gamecard. The first 0x200 bytes act as a global header and represent the root partition which points to the other partitions ("normal", "logo", "update" and "secure"). |
| | | |
| A hash for this header is stored at offset 0x140 in the [[#CardHeader]]. | | A hash for this header is stored at offset 0x140 in the [[#CardHeader]]. |
Line 452: |
Line 619: |
| | 0x0 | | | 0x0 |
| | 0x4 | | | 0x4 |
− | | MagicCode ("HFS0") | + | | Magic ("HFS0") |
| |- | | |- |
| | 0x4 | | | 0x4 |