NCM services
ncm
| Cmd | Name | Notes |
|---|---|---|
| 0 | ||
| 1 | ||
| 2 | ||
| 3 | ||
| 4 | GetContentStorage | |
| 5 | GetContentMetaDatabase | |
| 8 | ||
| 9 | InitializeStorageForMediaId | |
| 10 | UninitializeStorageForMediaId | |
| 11 | InitializeDatabaseForMediaId | |
| 12 | UninitializeDatabaseForMediaId |
All of the above cmds takes a u8 as input.
IContentStorage
| Cmd | Name | Notes |
|---|---|---|
| 0 | #GetRootEntry | |
| 1 | Takes two 0x10-sized entries, and a u64. | |
| 2 | Takes a 0x10-sized entry. | |
| 3 | Takes a 0x10-sized entry, returns a bool/u8. | |
| 4 | Takes a 0x10-sized entry, a u64, and type-5 array. | |
| 5 | Takes two 0x10-sized entries. | |
| 6 | DeleteContent? | Takes a 0x10-sized entry. |
| 7 | Takes a 0x10-sized entry, returns a bool/u8. | |
| 8 | Takes a type-0x1A string and a 0x10-sized entry. | |
| 9 | Takes a type-0x1A string and a 0x10-sized entry. | |
| 10 | Void. | |
| 11 | Takes a type-6 buffer, each entry 0x10 bytes, and returns a u32. | |
| 12 | #GetNumberOfEntries | |
| 13 | #GetEntries | |
| 14 | #GetEntrySize | |
| 15 | Void. | |
| 16 | Takes three 0x10-sized entries. | |
| 17 | Takes a 0x10-sized entry and a u64. | |
| 18 | #ReadEntryRaw | |
| 19 | Takes a 0x10-sized entry and returns another 0x10-sized entry. | |
| 20 | #GetNcaTitleInfo | |
| 21 | Takes a 0x10-sized entry, a u64, and a type5 buffer. | |
| 22 | GetFreeSpace | |
| 23 | GetTotalSpace |
GetRootEntry
Returns an entry of 16 completely random-looking bytes. It is not possible to read this entry.
Changes on reboot?
GetNumberOfEntries
Writes the total number of entries which can be read by GetEntries, to cmdreply <SFCO_offset>+0x10.
GetEntries
Takes an output buffer, u32 offset and gets all entries starting at that offset. Returns number of entries read.
Each entry is a #NcaID.
The total read entries is exactly the same as the number of "<hex>.nca" directories in the storage FS(or at least under the "registered" directory?).
GetEntrySize
Takes a #NcaID as input.
Returns the total size readable by ReadEntryRaw. This is the same as the size-field in the NAX0 "<NcaID>.nca/00" file.
ReadEntryRaw
Takes an output buffer, a #NcaID as input, and a u64 file offset.
Returns encrypted looking data. Doesn't match the encrypted raw data in the "<NcaID>.nca/00" file.
See GetEntrySize for the total size readable with this.
GetNcaTitleInfo
Takes a #NcaID and returns the following 0x10-sized entry.
With some NcaIDs this may return 0 with an all-zero output entry. This seems to be the case for most/all (?) NandSystem NcaIds?
| Offset | Size | Description |
|---|---|---|
| 0x0 | 0x8 | Big-endian titleID |
| 0x8 | 0x8 | Unknown. Usually zero? |
IContentMetaDatabase
| Cmd | Name | Notes |
|---|---|---|
| 0 | InsertContentEntry? | Takes a 0x10-sized entry, a type-5 buffer and a u64. |
| 1 | Takes a 0x10-sized entry, a type-6 buffer and a u64. Returns a u64. | |
| 2 | Takes a 0x10-sized entry. | |
| 3 | Takes a 0x10-sized entry and a bool/u8. Returns an 0x10-sized entry. | |
| 4 | Takes a type-6 buffer, each entry being 24 bytes, 0x10-sized entry and a u32. Returns a u32. | |
| 5 | Iterate | Takes a type-6 buffer, each entry being 16 bytes, a 0x10-sized entry, and a u32. Returns a u32. |
| 6 | #GetTitleIdInfo | |
| 7 | #GetTitleList | Takes a type-6 buffer, each entry being 24 bytes, and a u8/bool. Returns two u32's. |
| 8 | Takes a 0x10-sized entry. Returns a bool/u8. | |
| 9 | Takes a type-5 buffer, each entry being 16 bytes. Returns a bool/u8. | |
| 10 | Takes a 0x10-sized entry. Returns a u64. | |
| 11 | Takes a 0x10-sized entry. Returns a u32. | |
| 12 | Takes a 0x10-sized entry. Returns a u64. | |
| 13 | Void. | |
| 14 | Takes a type-6 byte buffer, and a type-5 buffer with each entry being 16 bytes. | |
| 15 | EndIteration | Void. |
| 16 | Takes two 0x10-sized entries. Returns a bool/u8. | |
| 17 | Takes a type-6 buffer, each entry being 16 bytes, a 0x10-sized entry and a u32. Returns a u32. | |
| 18 | Takes a 0x10-sized entry. Returns a bool/u8. | |
| 19 | Takes a 0x10-sized entry. Returns a u32. |
GetTitleIdInfo
Takes a u64 title-id as input, returns same title-id together with info struct.
struct title_info {
u32 version;
u8 type;
u8 pad[3];
};
GetTitleList
Each 24-byte entries is as follows:
u64 title_id_update; struct title_info info; u64 title_id;
NcaID
This is a 0x10-byte entry. This is originally from the hex portion of "<hex>.nca" directory-names from this storage FS(like SD).
Enums
Title Types
| Value | Description |
|---|---|
| 0x01 | System executable titles? (Titles with TID 01000000000000XX or 01000000000010XX) |
| 0x02 | System Data Archives |
| 0x03 | Unknown. Only used for title 0100000000000816? |
| 0x04 | Firmware package A |
| 0x05 | Firmware package B |
| 0x80 | Regular application |
| 0x81 | Update title |