mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-05-28 05:34:11 -04:00
SM: Add IPC commands for first-class MITM installation.
This commit is contained in:
parent
968c86578a
commit
80f40caf67
4 changed files with 129 additions and 6 deletions
|
@ -18,6 +18,12 @@ Result UserService::dispatch(IpcParsedCommand &r, IpcCommand &out_c, u64 cmd_id,
|
|||
case User_Cmd_UnregisterService:
|
||||
rc = WrapIpcCommandImpl<&UserService::unregister_service>(this, r, out_c, pointer_buffer, pointer_buffer_size);
|
||||
break;
|
||||
case User_Cmd_AtmosphereInstallMitm:
|
||||
rc = WrapIpcCommandImpl<&UserService::install_mitm>(this, r, out_c, pointer_buffer, pointer_buffer_size);
|
||||
break;
|
||||
case User_Cmd_AtmosphereUninstallMitm:
|
||||
rc = WrapIpcCommandImpl<&UserService::uninstall_mitm>(this, r, out_c, pointer_buffer, pointer_buffer_size);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
@ -56,7 +62,7 @@ std::tuple<Result, MovedHandle> UserService::get_service(u64 service) {
|
|||
|
||||
std::tuple<Result, MovedHandle> UserService::deferred_get_service(u64 service) {
|
||||
Handle session_h = 0;
|
||||
Result rc = Registration::GetServiceHandle(service, &session_h);
|
||||
Result rc = Registration::GetServiceHandle(this->pid, service, &session_h);
|
||||
return {rc, MovedHandle{session_h}};
|
||||
}
|
||||
|
||||
|
@ -86,3 +92,20 @@ std::tuple<Result> UserService::unregister_service(u64 service) {
|
|||
}
|
||||
return {rc};
|
||||
}
|
||||
|
||||
std::tuple<Result, MovedHandle> UserService::install_mitm(u64 service) {
|
||||
Handle service_h = 0;
|
||||
Result rc = 0x415;
|
||||
if (this->has_initialized) {
|
||||
rc = Registration::InstallMitmForPid(this->pid, service, &service_h);
|
||||
}
|
||||
return {rc, MovedHandle{service_h}};
|
||||
}
|
||||
|
||||
std::tuple<Result> UserService::uninstall_mitm(u64 service) {
|
||||
Result rc = 0x415;
|
||||
if (this->has_initialized) {
|
||||
rc = Registration::UninstallMitmForPid(this->pid, service);
|
||||
}
|
||||
return {rc};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue