RO services: Difference between revisions

From Nintendo Switch Brew
Jump to navigation Jump to search
No edit summary
fixup ro command names
 
(5 intermediate revisions by one other user not shown)
Line 12: Line 12:
! Cmd || Name
! Cmd || Name
|-
|-
| 0 || [[#LoadModule]]
| 0 || [[#MapManualLoadModuleMemory]]
|-
|-
| 1 || [[#UnloadModule]]
| 1 || [[#UnmapManualLoadModuleMemory]]
|-
|-
| 2 || [[#RegisterModuleInfo]]  
| 2 || [[#RegisterModuleInfo]]  
Line 20: Line 20:
| 3 || [[#UnregisterModuleInfo]]
| 3 || [[#UnregisterModuleInfo]]
|-
|-
| 4 || [[#Initialize]]
| 4 || [[#RegisterProcessHandle]]
|-
|-
| 10 || [7.0.0+] [[#RegisterModuleInfo2]]
| 10 || [7.0.0+] [[#RegisterModuleInfoWithUserProcessHandle]]
|}
|}


== LoadModule ==
== MapManualLoadModuleMemory ==
Takes a PID-descriptor, 5 input u64s ('''client_pid_deprecated''', '''nro_address''', '''nro_size''', '''bss_address''' and '''bss_size'''). Returns an output u64 ('''out_address''').  
Takes a PID-descriptor and 4 input u64s ('''nro_address''', '''nro_size''', '''bss_address''' and '''bss_size'''). Returns an output u64 ('''out_address''').


== UnloadModule ==
== UnmapManualLoadModuleMemory ==
Takes a PID-descriptor and 2 input u64s ('''client_pid_deprecated''' and '''nro_address''').  
Takes a PID-descriptor and an input u64 ('''nro_address''').  


== RegisterModuleInfo ==
== RegisterModuleInfo ==
Takes a PID-descriptor and 3 input u64s ('''client_pid_deprecated''', '''nrr_address''' and '''nrr_size''').  
Takes a PID-descriptor and 2 input u64s ('''nrr_address''' and '''nrr_size''').  


[7.0.0+] [[NRR|NrrKind]] must be 0 (User) for this function to succeed.
[7.0.0+] [[NRR|NrrKind]] must be 0 (User) for this function to succeed.


== UnregisterModuleInfo ==
== UnregisterModuleInfo ==
Takes a PID-descriptor and 2 input u64s ('''client_pid_deprecated''' and '''nrr_address''').  
Takes a PID-descriptor and an input u64s ('''nrr_address''').  


== Initialize ==
== RegisterProcessHandle ==
Takes PID-descriptor, a process handle and an input u64 ('''client_pid_deprecated''').
Takes PID-descriptor and a process handle.


== RegisterModuleInfo2 ==
== RegisterModuleInfoWithUserProcessHandle ==
Takes a PID-descriptor, a process handle and 3 input u64s ('''client_pid_deprecated''', '''nrr_address''' and '''nrr_size''').  
Takes a PID-descriptor, a process handle and 2 input u64s ('''nrr_address''' and '''nrr_size''').  


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.  
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 [[#RegisterModuleInfo|RegisterModuleInfo]], except using the passed process handle instead of the one sent to Initialize.  


When called from an ro:1 session, [[NRR|NrrKind]] must be 1 (JitPlugin). When called from ldr:ro session, [[NRR|NrrKind]] must be 0 (User).
When called from an ro:1 session, [[NRR|NrrKind]] must be 1 (JitPlugin). When called from ldr:ro session, [[NRR|NrrKind]] must be 0 (User).
Line 60: Line 60:


== GetProcessModuleInfo ==
== GetProcessModuleInfo ==
Same as [[#Loader_services|GetProcessModuleInfo]] from [[Loader_services#ldr:dmnt|ldr:dmnt]].
Same as [[Loader_services#GetProcessModuleInfo|GetProcessModuleInfo]] from [[Loader_services#ldr:dmnt|ldr:dmnt]].


[[Category:Services]]
[[Category:Services]]

Latest revision as of 00:56, 29 May 2025

Prior to 3.0.0, ro was included as part of Loader. Despite the separation, the service name ldr:ro is retained to maintain compatibility with old games.

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 is also "nn::ro::detail::IRoInterface".

Cmd Name
0 #MapManualLoadModuleMemory
1 #UnmapManualLoadModuleMemory
2 #RegisterModuleInfo
3 #UnregisterModuleInfo
4 #RegisterProcessHandle
10 [7.0.0+] #RegisterModuleInfoWithUserProcessHandle

MapManualLoadModuleMemory

Takes a PID-descriptor and 4 input u64s (nro_address, nro_size, bss_address and bss_size). Returns an output u64 (out_address).

UnmapManualLoadModuleMemory

Takes a PID-descriptor and an input u64 (nro_address).

RegisterModuleInfo

Takes a PID-descriptor and 2 input u64s (nrr_address and nrr_size).

[7.0.0+] NrrKind must be 0 (User) for this function to succeed.

UnregisterModuleInfo

Takes a PID-descriptor and an input u64s (nrr_address).

RegisterProcessHandle

Takes PID-descriptor and a process handle.

RegisterModuleInfoWithUserProcessHandle

Takes a PID-descriptor, a process handle and 2 input u64s (nrr_address and nrr_size).

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 RegisterModuleInfo, except using the passed process handle instead of the one sent to Initialize.

When called from an ro:1 session, NrrKind must be 1 (JitPlugin). When called from ldr:ro session, NrrKind must be 0 (User).

ro:dmnt

This is "nn::ro::detail::IDebugMonitorInterface".

Cmd Name
0 #GetProcessModuleInfo

GetProcessModuleInfo

Same as GetProcessModuleInfo from ldr:dmnt.