Nintendo CDN Files

From DSiBrew
Revision as of 02:24, 18 November 2020 by Zedseven (talk | contribs) (A page detailing Nintendo CDN files, and the known special content IDs of the NUS.)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Files on the Nintendo CDN

On the Nintendo CDN, there are a few kinds of files for each game/title:

  • Metadata (tmd)
  • Ticket (cetk)
  • Content files (00000000 and up)

Server File ID

Note that "we" refers to Hiccup and zedseven.

In addition to the expected files (tmd, cetk, game content), there are a number of other files accessible by the same content ID system as is used to access game content.

If you try to access a non-existent file, the server gives you an error - for instance, with http://nus.cdn.t.shop.nintendowifi.net/ccs/download/0000000000000000/00000000 you get something akin to the following:

NUS-Screenshot-0000000000000000-00000000.png

(response header has 404 in status code, with Last-Modified field indicating that this page is generated on the fly)


The text in the square brackets appears to be some kind of server file id. Note that if you request a nonexistent cetk, it's server file id is reported as 4294967293 (0xFFFFFFFD).

NUS-Screenshot-0000000000000000-cetk.png

(with http://nus.cdn.t.shop.nintendowifi.net/ccs/download/0000000000000000/cetk)


Through this, we guessed that cetks do in fact have content IDs, and it turns out tmds also do, although if you request a tmd (either as "tmd" or "tmd.[version]", the server file ID is not reported by the error message (see #Special Content IDs for more info).

NUS-Screenshot-0000000000000000-tmd.png

(with http://nus.cdn.t.shop.nintendowifi.net/ccs/download/0000000000000000/tmd)


The function used for the server file ID is as follows:

Server-File-ID-Equation.png

Where t is the title ID, and c is the content ID.


Special Content IDs

FFFD0000

DSi Shop content starts at FFFD0000 and increments up. This content is often icons and screenshots, (typically GIF or BMP interchangeably), with some ZIP file manuals for system titles mixed in as well.

FFFEFFFF

tmd content is stored at this content ID. The very first version is FFFEFFFF, and subsequent versions decrement the value (second version is FFFEFFFE, third is FFFEFFFD, etc.). Because tmd versions aren't sequential, this sequential versioning allows us to check if any versions have been deleted from the CDN. No titles were found to have deleted versions.

FFFFFFFD

This is the content ID of cetk, if it exists for a given title.

FFFFFFFE

This is a file that exists for every existing title, however it is always 0 bytes in size. We suspect it is used as a way of checking if a title exists on the CDN, since no other files have unchanging, consistent names (tmd kind of does, but we suspect it's auto-generated as the latest version - the file "tmd" probably doesn't exist on the server).