NCM services: Difference between revisions
m Hexkyz moved page Content Manager services to Location Resolver services |
No edit summary |
||
Line 1: | Line 1: | ||
= ncm = | LR (Location Resolver) contains services for internal file path and content management. | ||
= LR services = | |||
== lr == | |||
{| class="wikitable" border="1" | |||
|- | |||
! Cmd || Name || Notes | |||
|- | |||
| 0 || GetIPathResolver || Takes a StorageID | |||
|- | |||
| 1 || || | |||
|- | |||
| 2 || CheckStorage || Takes a StorageID | |||
|- | |||
| 3 || || | |||
|} | |||
=== IPathResolver === | |||
{| class="wikitable" border="1" | |||
|- | |||
! Cmd || Name || Notes | |||
|- | |||
| 0 || GetProgramNcaPath || | |||
|- | |||
| 1 || SetProgramNcaPath || | |||
|- | |||
| 2 || || | |||
|- | |||
| 3 || || | |||
|- | |||
| 4 || GetControlNcaPath || | |||
|- | |||
| 5 || SetControlNcaPath || | |||
|- | |||
| 6 || || | |||
|- | |||
| 7 || || | |||
|- | |||
| 8 || || | |||
|- | |||
| 9 || || | |||
|} | |||
= Content Manager services = | |||
== ncm == | |||
{| class="wikitable" border="1" | {| class="wikitable" border="1" | ||
|- | |- | ||
Line 12: | Line 56: | ||
| 3 || || | | 3 || || | ||
|- | |- | ||
| 4 || | | 4 || GetIContentStorage || | ||
|- | |- | ||
| 5 || | | 5 || GetIContentMetaDatabase || | ||
|- | |- | ||
| 8 || || | | 8 || || | ||
Line 29: | Line 73: | ||
All of the above cmds takes a u8 as input. | All of the above cmds takes a u8 as input. | ||
== IContentStorage == | === IContentStorage === | ||
{| class="wikitable" border="1" | {| class="wikitable" border="1" | ||
|- | |- | ||
Line 48: | Line 92: | ||
| 6 || DeleteContent? || Takes a 0x10-sized entry. | | 6 || DeleteContent? || Takes a 0x10-sized entry. | ||
|- | |- | ||
| 7 || || Takes a 0x10-sized entry, returns a bool/u8. | | 7 || IsNcaEntryValid || Takes a 0x10-sized entry, returns a bool/u8. | ||
|- | |- | ||
| 8 || || Takes a type-0x1A string and a 0x10-sized entry. | | 8 || MakeNcaRegisteredPath || Takes a type-0x1A string and a 0x10-sized entry. | ||
|- | |- | ||
| 9 || || Takes a type-0x1A string and a 0x10-sized entry. | | 9 || MakeNcaPlaceholderPath || Takes a type-0x1A string and a 0x10-sized entry. | ||
|- | |- | ||
| 10 || || Void. | | 10 || || Void. | ||
Line 83: | Line 127: | ||
|} | |} | ||
=== GetRootEntry === | ==== GetRootEntry ==== | ||
Returns an entry of 16 completely random-looking bytes. It is not possible to read this entry. | Returns an entry of 16 completely random-looking bytes. It is not possible to read this entry. | ||
Changes on reboot? | Changes on reboot? | ||
=== GetNumberOfEntries === | ==== GetNumberOfEntries ==== | ||
Writes the total number of entries which can be read by GetEntries, to cmdreply <SFCO_offset>+0x10. | Writes the total number of entries which can be read by GetEntries, to cmdreply <SFCO_offset>+0x10. | ||
=== GetEntries === | ==== GetEntries ==== | ||
Takes an output buffer, u32 offset and gets all entries starting at that offset. | Takes an output buffer, u32 offset and gets all entries starting at that offset. | ||
Returns number of entries read. | Returns number of entries read. | ||
Line 99: | Line 143: | ||
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?). | 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 === | ==== GetEntrySize ==== | ||
Takes a [[#NcaID]] as input. | 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. | Returns the total size readable by ReadEntryRaw. This is the same as the size-field in the [[NAX0]] "<NcaID>.nca/00" file. | ||
=== ReadEntryRaw === | ==== ReadEntryRaw ==== | ||
Takes an output buffer, a [[#NcaID]] as input, and a u64 file offset. | Takes an output buffer, a [[#NcaID]] as input, and a u64 file offset. | ||
Line 117: | Line 161: | ||
See GetEntrySize for the total size readable with this. | See GetEntrySize for the total size readable with this. | ||
=== GetNcaTitleInfo === | ==== GetNcaTitleInfo ==== | ||
Takes a [[#NcaID]] and returns the following 0x10-sized entry. | Takes a [[#NcaID]] and returns the following 0x10-sized entry. | ||
Line 137: | Line 181: | ||
|} | |} | ||
== IContentMetaDatabase == | === IContentMetaDatabase === | ||
{| class="wikitable" border="1" | {| class="wikitable" border="1" | ||
|- | |- | ||
Line 183: | Line 227: | ||
|} | |} | ||
=== GetTitleIdInfo === | ==== GetTitleIdInfo ==== | ||
Takes a u64 title-id as input, returns same title-id together with info struct. | Takes a u64 title-id as input, returns same title-id together with info struct. | ||
Line 192: | Line 236: | ||
}; | }; | ||
=== GetTitleList === | ==== GetTitleList ==== | ||
Each 24-byte entries is as follows: | Each 24-byte entries is as follows: | ||
Line 200: | Line 244: | ||
=== GetUpdateTitleList === | ==== GetUpdateTitleList ==== | ||
Takes a type-6 output buffer, each entry being 0x10-byte bytes, a u32 entryoffset and a 0x10-sized entry. Returns a u32 for total_read_entries. | Takes a type-6 output buffer, each entry being 0x10-byte bytes, a u32 entryoffset and a 0x10-sized entry. Returns a u32 for total_read_entries. | ||
Line 209: | Line 253: | ||
This reads the titlelist stored in the specified title, normally a title with title-type 3, which is sysupdate-title 0100000000000816. Returns 0 with total_read_entries=0 when used with other title(s). | This reads the titlelist stored in the specified title, normally a title with title-type 3, which is sysupdate-title 0100000000000816. Returns 0 with total_read_entries=0 when used with other title(s). | ||
== NcaID == | === 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_Filesystem|SD]]). | This is a 0x10-byte entry. This is originally from the hex portion of "<hex>.nca" directory-names from this storage FS(like [[SD_Filesystem|SD]]). | ||
The NcaID is the same as the first 0x10-bytes from the calculated SHA256 hash, from hashing the entire output from ReadEntryRaw. | The NcaID is the same as the first 0x10-bytes from the calculated SHA256 hash, from hashing the entire output from ReadEntryRaw. | ||
== Enums == | === Enums === | ||
=== Title Types === | ==== Title Types ==== | ||
{| class="wikitable" border="1" | {| class="wikitable" border="1" | ||
Line 246: | Line 290: | ||
| Add-on content | | Add-on content | ||
|} | |} | ||
== ncm:v == | |||
[[Category:Services]] |