#pragma once #include #include #include "pm_registration.hpp" enum DmntCmd { Dmnt_Cmd_GetUnknownStub = 0, Dmnt_Cmd_GetDebugProcessIds = 1, Dmnt_Cmd_LaunchDebugProcess = 2, Dmnt_Cmd_GetTitleProcessId = 3, Dmnt_Cmd_EnableDebugForTitleId = 4, Dmnt_Cmd_GetApplicationProcessId = 5, Dmnt_Cmd_EnableDebugForApplication = 6, }; enum DmntCmd_5X { Dmnt_Cmd_5X_GetDebugProcessIds = 0, Dmnt_Cmd_5X_LaunchDebugProcess = 1, Dmnt_Cmd_5X_GetTitleProcessId = 2, Dmnt_Cmd_5X_EnableDebugForTitleId = 3, Dmnt_Cmd_5X_GetApplicationProcessId = 4, Dmnt_Cmd_5X_EnableDebugForApplication = 5, }; class DebugMonitorService final : IServiceObject { public: Result dispatch(IpcParsedCommand &r, IpcCommand &out_c, u64 cmd_id, u8 *pointer_buffer, size_t pointer_buffer_size) override; Result handle_deferred() override; private: /* Actual commands. */ std::tuple get_unknown_stub(u64 unknown, OutBuffer out_unknown); std::tuple get_debug_process_ids(OutBuffer out_processes); std::tuple launch_debug_process(u64 pid); std::tuple get_title_process_id(u64 tid); std::tuple enable_debug_for_tid(u64 tid); std::tuple get_application_process_id(); std::tuple enable_debug_for_application(); };