Difference between revisions of "Extdata"

From 3dbrew
Jump to navigation Jump to search
Line 2: Line 2:
 
At /Nintendo 3DS/<SomeID>/<SomeID>/extdata/00000000 is directories for each title, with Quota.dat inside each dir. Quota.dat doesn't exist for all titles. Then there's a sub-directory 00000000, which contains the actual extdata. Size and number of files in this dir varies per title.
 
At /Nintendo 3DS/<SomeID>/<SomeID>/extdata/00000000 is directories for each title, with Quota.dat inside each dir. Quota.dat doesn't exist for all titles. Then there's a sub-directory 00000000, which contains the actual extdata. Size and number of files in this dir varies per title.
  
These files are encrypted with AES-CTR. The key is unknown, this is console-unique. The CTR includes the titleID and filename. The base CTR is fixed: the CTR never changes after each write. Thus it is possible to obtain some cleartext by XORing one file(like newly created extdata) with a newer file, where the newer file overwrote zeros in the original file with non-zero data. Most extdata uses the same FS as [[savegames]], except extdata uses DIFF instead of DISA. However some extdata files are raw, without any FS.
+
=== Encryption ===
 +
 
 +
These files are encrypted with AES-CTR. The key is unknown, this is console-unique. The CTR includes the titleID and filename. The base CTR is fixed: the CTR never changes after each write. Thus it is possible to obtain some cleartext by XORing one file(like newly created extdata) with a newer file, where the newer file overwrote zeros in the original file with non-zero data.
 +
 
 +
=== Filesystem ===
 +
 
 +
Most extdata uses the same FS as [[savegames]], except extdata uses [[Savegames|DIFF]] instead of DISA. However some extdata files are raw, without any FS.
 +
Quota.dat seems to use the same FS and encryption as the actual extdata?
 +
 
 +
'''QUOT'''
 +
 
 +
* This seems to be stored in the Quota.dat FS image somewhere?
 +
 
 +
{| class="wikitable"
 +
|-
 +
! Start
 +
! Length
 +
! Description
 +
|-
 +
| 0x0
 +
| 4
 +
| Magic ("QUOT")
 +
|-
 +
| 0x4
 +
| 4
 +
| Magic Number? (0x30000)
 +
|-
 +
| 0x8
 +
| 8
 +
| Unknown
 +
|-
 +
| 0x10
 +
| 0x38
 +
| Unknown
 +
|}

Revision as of 06:45, 24 January 2012

This page describes the format and crypto of extdata, "extra data" and StreetPass data stored on SD card. At /Nintendo 3DS/<SomeID>/<SomeID>/extdata/00000000 is directories for each title, with Quota.dat inside each dir. Quota.dat doesn't exist for all titles. Then there's a sub-directory 00000000, which contains the actual extdata. Size and number of files in this dir varies per title.

Encryption

These files are encrypted with AES-CTR. The key is unknown, this is console-unique. The CTR includes the titleID and filename. The base CTR is fixed: the CTR never changes after each write. Thus it is possible to obtain some cleartext by XORing one file(like newly created extdata) with a newer file, where the newer file overwrote zeros in the original file with non-zero data.

Filesystem

Most extdata uses the same FS as savegames, except extdata uses DIFF instead of DISA. However some extdata files are raw, without any FS. Quota.dat seems to use the same FS and encryption as the actual extdata?

QUOT

  • This seems to be stored in the Quota.dat FS image somewhere?
Start Length Description
0x0 4 Magic ("QUOT")
0x4 4 Magic Number? (0x30000)
0x8 8 Unknown
0x10 0x38 Unknown