Difference between revisions of "Title Database"

From 3dbrew
Jump to navigation Jump to search
m (Dead Gist link removed)
Line 74: Line 74:
  
 
Note: It is quite unlikely that the either the import.db or title.db contain the cached icon and names of installed titles. The amount of data which changes in those two file when a title installed/deleted is not sufficient to contain the size of data required for the icons and names of the application, they are most likely cached in the [[Flash Filesystem|NAND]].
 
Note: It is quite unlikely that the either the import.db or title.db contain the cached icon and names of installed titles. The amount of data which changes in those two file when a title installed/deleted is not sufficient to contain the size of data required for the icons and names of the application, they are most likely cached in the [[Flash Filesystem|NAND]].
 
* [https://gist.github.com/1113cbe10f124e5a2c72 Old and new import.db and title.db xored, revealing some plaintext].
 

Revision as of 02:33, 5 April 2013

These files contain data relating to install/usage/management of installed 3DS titles. The database files are located at:

  • nand/dbs
  • sdmc/Nintendo 3DS/<ID0>/<ID1>/dbs

ID0 is the first 0x10-bytes from a SHA256 hash. The installation of SD Card titles was introduced in the 2.0.0-2 update and the SD dbs files are encrypted. These files are extdata images. The NAND extdata images are cleartext, however some of the images contain data encrypted with a console-unique keyslot.

These files are stored under this directory:

Stored on SD card Stored in CTR-NAND Filename CTR-9DB0 ID Description
Yes Yes import.db 0x3 This is an Import Database, it contains entries for titles(or versions of titles) not yet installed, ready for transferring to the title.db. (Automatic Update, uses this, so completing the update takes seconds)
Yes Yes title.db 0x2 Title database, this contains entries for all installed titles (TWL & CTR) on the 3DS(Each database is responsible for titles installed on it's medium).
No Yes tmp_t.db ? This is the temporary Title database containing one entry for the currently installed Download Play Child.
No Yes tmp_i.db ? Similar to import.db, except it's used in conjunction with tmp_t.db, for installing Download Play Children.
No Yes certs.db ? This contains the certificate chain used to verify TMDs and other certificates.
No Yes ticket.db ? This contains the installed tickets.

"title.db" - With a fixed size of 0x31E400 bytes, this Extdata image embeds two almost identical copies(the latter is probably an older backup) of the Title Database. For each installed title, the following information is known to be stored:

It is important to note the database doesn't contain a hash of the .cmd. So if a user has more than one valid set of application data for a given .cmd Content ID they can be manually interchanged without issue. Though renaming a .cmd file to match the Content ID which the title.db is expecting will result in an error, as the CTR for the per-console encryption layer changes depending on the file path, and the MAC of the .cmd is probably generated with the .cmd Content ID in mind.


"import.db" - The function of the file is not well understood. It appears to be related to the download/install of titles, as in the progress of downloading titles this file will have changed but the title.db will not be modified until the title has been properly downloaded.

  • This file doesn't contain any title specific data which the ARM9 has been noted to use in relation to installed titles, even though this file is modified when titles are installed/deleted. In fact, no matter what titles you install, if you use an old copy of the "import.db" with a recent copy of the "title.db", this creates no noticeable issues.

These NAND/SD /dbs images seem to be loaded by the ARM9 while NATIVE_FIRM is booting.

Note: It is quite unlikely that the either the import.db or title.db contain the cached icon and names of installed titles. The amount of data which changes in those two file when a title installed/deleted is not sufficient to contain the size of data required for the icons and names of the application, they are most likely cached in the NAND.