Difference between revisions of "Loader services"
(ldr:dmnt->BreakAslr();) |
|||
(13 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
− | = ldr: | + | = ldr:shel = |
− | This is "nn::ldr::detail:: | + | This is "nn::ldr::detail::IShellInterface". |
+ | |||
+ | This service has IPC max_sessions 3. | ||
{| class="wikitable" border="1" | {| class="wikitable" border="1" | ||
Line 6: | Line 8: | ||
! Cmd || Name | ! Cmd || Name | ||
|- | |- | ||
− | | 0 || [[ | + | | 0 || [[#SetProgramArgument]] |
|- | |- | ||
− | | 1 || [[ | + | | 1 || [[#FlushArguments]] |
− | |||
− | |||
|} | |} | ||
− | == | + | == SetProgramArgument == |
− | + | Takes a type-0x9 input buffer with launch arguments (as string), an u32 (size of arguments string), and an input title-id. | |
+ | |||
+ | [11.0.0+] Now takes a type-0x5 buffer instead of type-0x9. Now takes a total of 8-bytes of input, instead of 0x10-bytes total. | ||
− | + | Loads a process for the specified title-id and passes along the supplied arguments. | |
− | + | Loaded processes are kept in a queue waiting for PM to launch them. The maximum number of waiting processes in this list is 10. | |
− | == | + | == FlushArguments == |
− | + | Clears the loaded processes waiting queue. | |
− | + | = ldr:dmnt = | |
+ | This is "nn::ldr::detail::IDebugMonitorInterface". | ||
+ | |||
+ | This service has IPC max_sessions 2. | ||
{| class="wikitable" border="1" | {| class="wikitable" border="1" | ||
|- | |- | ||
− | ! | + | ! Cmd || Name |
− | |||
− | |||
|- | |- | ||
− | | | + | | 0 || [[#SetProgramArgument]] |
− | | | ||
− | | | ||
− | |||
− | |||
− | |||
− | |||
|- | |- | ||
− | | | + | | 1 || [[#FlushArguments]] |
− | | | ||
− | | | ||
|- | |- | ||
+ | | 2 || [[#GetProcessModuleInfo]] | ||
|} | |} | ||
+ | == GetProcessModuleInfo == | ||
+ | Takes in a u64 Process ID, and a C descriptor out array of [[#ModuleInfo]]s. Returns the number of ModuleInfos copied to output. | ||
= ldr:pm = | = ldr:pm = | ||
This is "nn::ldr::detail::IProcessManagerInterface". | This is "nn::ldr::detail::IProcessManagerInterface". | ||
+ | |||
+ | This service has IPC max_sessions 1. | ||
{| class="wikitable" border="1" | {| class="wikitable" border="1" | ||
Line 56: | Line 56: | ||
| 1 || [[#GetProgramInfo]] | | 1 || [[#GetProgramInfo]] | ||
|- | |- | ||
− | | 2 || [[# | + | | 2 || [[#PinProgram]] |
|- | |- | ||
− | | 3 || [[# | + | | 3 || [[#UnpinProgram]] |
+ | |- | ||
+ | | 4 || [10.0.0+] [[#SetEnabledProgramVerification]] | ||
|} | |} | ||
== GetProgramInfo == | == GetProgramInfo == | ||
− | Takes | + | Takes an ncm::ProgramLocation, parses the NPDM, and writes a [[#ProgramInfo]] to a C descriptor buffer. |
+ | |||
+ | == PinProgram == | ||
+ | Takes an ncm::ProgramLocation, returns a u64 "PinId". | ||
+ | |||
+ | == UnpinProgram == | ||
+ | Takes a PinId from [[#PinProgram]]. | ||
+ | |||
+ | == SetEnabledProgramVerification == | ||
+ | Seems to sets a global flag to inputval & 1. | ||
+ | |||
+ | When the flag is zero, it will set ret=0 instead of ret={error} when verifying the fixed-key [[NPDM]] ACID signature fails. This also skips verifying the [[NCA_Format|NCA Header]] signature using the ACID key. Note that if verifying the fixed-key ACID signature is successful, and verifying the ACID-key NCA header signature fails, it will throw an error and abort. | ||
+ | |||
+ | = ModuleInfo = | ||
+ | {| class="wikitable" border="1" | ||
+ | |- | ||
+ | ! Offset | ||
+ | ! Size | ||
+ | ! Description | ||
+ | |- | ||
+ | | 0x0 | ||
+ | | 0x20 | ||
+ | | ModuleId | ||
+ | |- | ||
+ | | 0x20 | ||
+ | | 0x8 | ||
+ | | ImageAddress | ||
+ | |- | ||
+ | | 0x28 | ||
+ | | 0x8 | ||
+ | | ImageSize | ||
+ | |} | ||
+ | = ProgramInfo = | ||
{| class="wikitable" border="1" | {| class="wikitable" border="1" | ||
|- | |- | ||
Line 125: | Line 159: | ||
| <Varies> | | <Varies> | ||
| ACI0 [[NPDM#FS Access Control|FS Access Control]] | | ACI0 [[NPDM#FS Access Control|FS Access Control]] | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
|} | |} | ||
[[Category:Services]] | [[Category:Services]] |
Revision as of 03:57, 9 May 2023
ldr:shel
This is "nn::ldr::detail::IShellInterface".
This service has IPC max_sessions 3.
Cmd | Name |
---|---|
0 | #SetProgramArgument |
1 | #FlushArguments |
SetProgramArgument
Takes a type-0x9 input buffer with launch arguments (as string), an u32 (size of arguments string), and an input title-id.
[11.0.0+] Now takes a type-0x5 buffer instead of type-0x9. Now takes a total of 8-bytes of input, instead of 0x10-bytes total.
Loads a process for the specified title-id and passes along the supplied arguments. Loaded processes are kept in a queue waiting for PM to launch them. The maximum number of waiting processes in this list is 10.
FlushArguments
Clears the loaded processes waiting queue.
ldr:dmnt
This is "nn::ldr::detail::IDebugMonitorInterface".
This service has IPC max_sessions 2.
Cmd | Name |
---|---|
0 | #SetProgramArgument |
1 | #FlushArguments |
2 | #GetProcessModuleInfo |
GetProcessModuleInfo
Takes in a u64 Process ID, and a C descriptor out array of #ModuleInfos. Returns the number of ModuleInfos copied to output.
ldr:pm
This is "nn::ldr::detail::IProcessManagerInterface".
This service has IPC max_sessions 1.
Cmd | Name |
---|---|
0 | CreateProcess |
1 | #GetProgramInfo |
2 | #PinProgram |
3 | #UnpinProgram |
4 | [10.0.0+] #SetEnabledProgramVerification |
GetProgramInfo
Takes an ncm::ProgramLocation, parses the NPDM, and writes a #ProgramInfo to a C descriptor buffer.
PinProgram
Takes an ncm::ProgramLocation, returns a u64 "PinId".
UnpinProgram
Takes a PinId from #PinProgram.
SetEnabledProgramVerification
Seems to sets a global flag to inputval & 1.
When the flag is zero, it will set ret=0 instead of ret={error} when verifying the fixed-key NPDM ACID signature fails. This also skips verifying the NCA Header signature using the ACID key. Note that if verifying the fixed-key ACID signature is successful, and verifying the ACID-key NCA header signature fails, it will throw an error and abort.
ModuleInfo
Offset | Size | Description |
---|---|---|
0x0 | 0x20 | ModuleId |
0x20 | 0x8 | ImageAddress |
0x28 | 0x8 | ImageSize |
ProgramInfo
Offset | Size | Description |
---|---|---|
0x0 | 0x1 | MainThreadPrio. Arg1 to svcStartProcess |
0x1 | 0x1 | DefaultCpuId. Arg2 to svcStartProcess |
0x2 | 0x1 | ApplicationType, see here. |
0x3 | 0x1 | Padding |
0x4 | 0x4 | MainThreadStackSize. Arg3 to svcStartProcess |
0x8 | 0x8 | TitleIdRange_Min |
0x10 | 0x4 | ACID Service Access Control list size |
0x14 | 0x4 | ACI0 Service Access Control list size |
0x18 | 0x4 | ACID FS Access Control buffer size |
0x1C | 0x4 | ACI0 FS Access Control buffer size |
0x20 | <Varies> | ACID Service Access Control list |
<Varies> | <Varies> | ACI0 Service Access Control list |
<Varies> | <Varies> | ACID FS Access Control buffer |
<Varies> | <Varies> | ACI0 FS Access Control |