|
|
(7 intermediate revisions by 4 users not shown) |
Line 1: |
Line 1: |
| = ldr:dmnt = | | = ldr:shel = |
| This is "nn::ldr::detail::IDebugMonitorInterface". | | This is "nn::ldr::detail::IShellInterface". |
|
| |
|
| {| class="wikitable" border="1" | | {| class="wikitable" border="1" |
Line 6: |
Line 6: |
| ! Cmd || Name | | ! Cmd || Name |
| |- | | |- |
| | 0 || [[Loader_services#AddProcessToDebugLaunchQueue|AddProcessToDebugLaunchQueue]] | | | 0 || [[#SetProgramArgument]] |
| |-
| |
| | 1 || [[Loader_services#ClearDebugLaunchQueue|ClearDebugLaunchQueue]]
| |
| |- | | |- |
| | 2 || [[Loader_services#GetNsoInfos|GetNsoInfos]] | | | 1 || [[#FlushArguments]] |
| |} | | |} |
|
| |
|
| == AddProcessToDebugLaunchQueue == | | == SetProgramArgument == |
| Same as [[Loader_services#AddProcessToLaunchQueue|AddProcessToLaunchQueue]] but for processes marked as debug.
| | Takes a type-0x9 input buffer with launch arguments (as string), an u32 (size of arguments string), and an input title-id. |
|
| |
|
| == ClearDebugLaunchQueue ==
| | Loads a process for the specified title-id and passes along the supplied arguments. |
| Same as [[Loader_services#ClearLaunchQueue|ClearLaunchQueue]].
| | Loaded processes are kept in a queue waiting for PM to launch them. The maximum number of waiting processes in this list is 10. |
|
| |
|
| == GetNsoInfos == | | == FlushArguments == |
| Takes in a u64 ProcessID, and a C descriptor. Returns the number of NsoInfos copied to output.
| | Clears the loaded processes waiting queue. |
|
| |
|
| NsoInfo has the following layout:
| | = ldr:dmnt = |
| | This is "nn::ldr::detail::IDebugMonitorInterface". |
|
| |
|
| {| class="wikitable" border="1" | | {| class="wikitable" border="1" |
| |- | | |- |
| ! Offset | | ! Cmd || Name |
| ! Size
| |
| ! Description
| |
| |- | | |- |
| | 0x0 | | | 0 || [[#SetProgramArgument]] |
| | 0x20 | |
| | "Build ID", from NSO header+0x40. | |
| |- | | |- |
| | 0x20 | | | 1 || [[#FlushArguments]] |
| | 0x8 | |
| | Mapped address for this NSO | |
| |-
| |
| | 0x28
| |
| | 0x8
| |
| | Mapped size for this NSO
| |
| |- | | |- |
| | | 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 = |
Line 56: |
Line 48: |
| | 1 || [[#GetProgramInfo]] | | | 1 || [[#GetProgramInfo]] |
| |- | | |- |
| | 2 || [[#RegisterTitle]] | | | 2 || [[#PinProgram]] |
| | |- |
| | | 3 || [[#UnpinProgram]] |
| |- | | |- |
| | 3 || [[#UnregisterTitle]] | | | 4 || [10.0.0+] [[#SetEnabledProgramVerification]] |
| |} | | |} |
|
| |
|
| == GetProgramInfo == | | == GetProgramInfo == |
| Takes a TitleId + StorageId, parses the NPDM, and writes output to a C descriptor buffer as follows: | | 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 126: |
Line 152: |
| | ACI0 [[NPDM#FS Access Control|FS Access Control]] | | | ACI0 [[NPDM#FS Access Control|FS Access Control]] |
| |} | | |} |
|
| |
| == RegisterTitle ==
| |
| Takes a TitleId + StorageId, returns an index.
| |
|
| |
| == UnregisterTitle ==
| |
| Takes the index from [[#RegisterTitle]].
| |
|
| |
| = ldr:shel =
| |
| This is "nn::ldr::detail::IShellInterface".
| |
|
| |
| {| class="wikitable" border="1"
| |
| |-
| |
| ! Cmd || Name
| |
| |-
| |
| | 0 || [[#AddProcessToLaunchQueue]]
| |
| |-
| |
| | 1 || [[#ClearLaunchQueue]]
| |
| |}
| |
|
| |
| == AddProcessToLaunchQueue ==
| |
| Takes a type-0x19 input buffer with launch arguments (as string), an u32 (size of arguments string), and an input title-id.
| |
|
| |
| 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.
| |
|
| |
| == ClearLaunchQueue ==
| |
| Clears the loaded processes waiting queue.
| |
|
| |
| = ldr:ro =
| |
| = ro:1 =
| |
| [1.0.0-2.3.0] This is "nn::ldr::detail::IRoInterface"
| |
|
| |
| [3.0.0+] This is "nn::ro::detail::IRoInterface".
| |
|
| |
| [7.0.0+] ro:1 was added, and also creates nn::ro::detail::IRoInterface objects.
| |
|
| |
| {| class="wikitable" border="1"
| |
| |-
| |
| ! Cmd || Name
| |
| |-
| |
| | 0 || [[#LoadNro]]
| |
| |-
| |
| | 1 || UnloadNro
| |
| |-
| |
| | 2 || [[#LoadNrr]]
| |
| |-
| |
| | 3 || UnloadNrr
| |
| |-
| |
| | 4 || [[#Initialize]]
| |
| |-
| |
| | 10 || [7.0.0+] [[#LoadNrrEx]]
| |
| |}
| |
|
| |
| == LoadNro ==
| |
| {| class="wikitable" border="1"
| |
| |-
| |
| ! Word || Value
| |
| |-
| |
| | 0 || 0x00000004
| |
| |-
| |
| | 1 || 0x80000012
| |
| |-
| |
| | 2 || 0x00000001
| |
| |- style="border-top: double"
| |
| | 0-1 || Pid
| |
| |- style="border-top: double"
| |
| | 0 || "SCFI"
| |
| |-
| |
| | 1 || 0x00000000
| |
| |-
| |
| | 2 || Always 0.
| |
| |-
| |
| | 3 || Nro heap address
| |
| |-
| |
| | 4 || Nro size
| |
| |-
| |
| | 5 || Bss backing heap address
| |
| |-
| |
| | 6 || Bss size
| |
| |}
| |
|
| |
| == LoadNrr ==
| |
| [7.0.0+] A new 8-bit field at NRR + 0x33C (previously padding) must be 0 for this function to succeed.
| |
|
| |
| {| class="wikitable" border="1"
| |
| |-
| |
| ! Word || Value
| |
| |-
| |
| | 0 || 0x00000004
| |
| |-
| |
| | 1 || 0x8000000E
| |
| |-
| |
| | 2 || 0x00000001
| |
| |-
| |
| |- style="border-top: double"
| |
| | 0-1 || Pid
| |
| |- style="border-top: double"
| |
| | 0 || "SFCI"
| |
| |-
| |
| | 1 || 0x00000002
| |
| |-
| |
| | 2 || Always 0.
| |
| |-
| |
| | 3 || Nrr address
| |
| |-
| |
| | 4 || Nrr size
| |
| |}
| |
|
| |
| == Initialize ==
| |
| {| class="wikitable" border="1"
| |
| |-
| |
| ! Word || Value
| |
| |-
| |
| | 0 || 0x00000004
| |
| |-
| |
| | 1 || 0x8000000A
| |
| |-
| |
| | 2 || 0x00000003
| |
| |- style="border-top: double"
| |
| | 0-1 || Pid
| |
| |-
| |
| | 2 || Process handle (0xFFFF8001)
| |
| |- style="border-top: double"
| |
| | 0 || "SFCI"
| |
| |-
| |
| | 1 || 0x00000004
| |
| |-
| |
| | 2 || Always 0.
| |
| |}
| |
|
| |
| == LoadNrrEx ==
| |
| Takes in a u64 nrr_address, a u64 nrr_size, a pid descriptor, and a process handle.
| |
|
| |
| First, this validates that the pid descriptor matches the pid for the process handle sent to this->Initialize() earlier.
| |
|
| |
| Then, this calls the same function as LoadNrr, except using the passed process handle instead of the one sent to Initialize.
| |
|
| |
| When called from an ro:1 session, the field at NRR header + 0x33C must be 0x1. When called from ldr:ro session, the field at NRR header + 0x33C must be 0x0.
| |
|
| |
|
| [[Category:Services]] | | [[Category:Services]] |