Line 1: |
Line 1: |
− | This page describes the format of savegames contained in NAND. NAND savegames do not use an container with the entire file encrypted. Various areas of the saveimage is uninitialized data, resulting in encrypted data in those areas (like 3DS did). | + | This page describes the format of save files contained in NAND. These files are stored as completely unencrypted, plaintext data. Save files are not cleared upon creation, resulting in possible garbage data in unused portions of the container. |
| | | |
| == Main header == | | == Main header == |
Line 415: |
Line 415: |
| | 8 | | | 8 |
| | Block size | | | Block size |
| + | |- |
| + | | |
| + | | |
| + | | The below fields are treated as a separate subheader |
| |- | | |- |
| | 0x20 | | | 0x20 |
| | 4 | | | 4 |
− | | Unknown (Must be 0 or 1) | + | | Version? (Must be 0 or 1) |
| |- | | |- |
| | 0x24 | | | 0x24 |
Line 462: |
Line 466: |
| | | | | |
| | | | | |
− | | The below fields are read separately from the above fields | + | | The below fields are treated as a separate subheader |
| |- | | |- |
| | 0x18 | | | 0x18 |
Line 578: |
Line 582: |
| == Files == | | == Files == |
| | | |
− | === File Offset Table === | + | === Directory Table Entry === |
| | | |
− | * Indexes 0 and 1 are reserved to point towards the folder and file tables. | + | * Index 0 is the start of a linked list that contains all invalid/inactive directories. |
− | | + | * Index 1 is the start of a linked list that contains all valid/active directories. |
− | ==== File Offset Table Entry ====
| + | * Index 2 is the root directory. |
| | | |
| {| class="wikitable" | | {| class="wikitable" |
Line 591: |
Line 595: |
| |- | | |- |
| | 0x00 | | | 0x00 |
− | | 3 | + | | 4 |
− | | Data offset, in blocks | + | | Parent directory node index |
| + | |- |
| + | | 0x04 |
| + | | 64 |
| + | | Filename |
| |- | | |- |
− | | 0x03 | + | | 0x44 |
− | | 1 | + | | 4 |
− | | Unknown, 80 | + | | Next sibling directory node index |
| + | |- |
| + | | 0x48 |
| + | | 4 |
| + | | First child directory node index |
| + | |- |
| + | | 0x4c |
| + | | 8 |
| + | | First child file node index |
| + | |- |
| + | | 0x54 |
| + | | 8 |
| + | | Unused? |
| |- | | |- |
− | | 0x04 | + | | 0x5c |
| | 4 | | | 4 |
− | | Unknown, 0 | + | | Next directory node index in the chain of invalid or valid directories. If this is the first block in a list of length 0, this value will contain the number total number of directory nodes. |
| + | |- |
| |} | | |} |
| | | |
− | === File/Folder Table Entry === | + | === File Table Entry === |
| | | |
− | * The root file/folder index is generally 2 | + | * Index 0 is the start of a linked list that contains all invalid/inactive files. |
| + | * Index 1 is the start of a linked list that contains all valid/active files. |
| | | |
| {| class="wikitable" | | {| class="wikitable" |
Line 615: |
Line 637: |
| | 0x00 | | | 0x00 |
| | 4 | | | 4 |
− | | Parent Folder Index | + | | Parent directory node index |
| |- | | |- |
| | 0x04 | | | 0x04 |
Line 623: |
Line 645: |
| | 0x44 | | | 0x44 |
| | 4 | | | 4 |
− | | File/Folder Index? | + | | Next sibling file node index |
| |- | | |- |
| | 0x48 | | | 0x48 |
| | 4 | | | 4 |
− | | File offset index in offset table, 0 for folders | + | | Index of the block that the file starts at |
| |- | | |- |
| | 0x4c | | | 0x4c |
| | 8 | | | 8 |
− | | File size, or number of files for folders | + | | File size in bytes |
| |- | | |- |
| | 0x54 | | | 0x54 |
| | 8 | | | 8 |
− | | Unknown | + | | Unused? |
| |- | | |- |
| | 0x5c | | | 0x5c |
| | 4 | | | 4 |
− | | Next File Index, same as folder index for folders | + | | Next file node index in the chain of invalid or valid file. If this is the first block in a list of length 0, this value will contain the number total number of file nodes. |
| |- | | |- |
| |} | | |} |