From e2a7f23214d97eeddec1fc74f3a82f606fdc457d Mon Sep 17 00:00:00 2001 From: Michael Scire Date: Mon, 4 Feb 2019 21:47:55 -0800 Subject: [PATCH] ams.mitm: simplify bpc ShouldMitm logic, fix enum problem --- stratosphere/ams_mitm/source/amsmitm_modules.hpp | 3 ++- stratosphere/ams_mitm/source/bpc_mitm/bpc_mitm_service.hpp | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/stratosphere/ams_mitm/source/amsmitm_modules.hpp b/stratosphere/ams_mitm/source/amsmitm_modules.hpp index 3f9d6b830..fb03657cd 100644 --- a/stratosphere/ams_mitm/source/amsmitm_modules.hpp +++ b/stratosphere/ams_mitm/source/amsmitm_modules.hpp @@ -21,7 +21,8 @@ enum MitmModuleId : u32 { MitmModuleId_SetMitm = 1, MitmModuleId_BpcMitm = 2, - MitmModuleId_Count = 3, + /* Always keep this at the end. */ + MitmModuleId_Count, }; void LaunchAllMitmModules(); diff --git a/stratosphere/ams_mitm/source/bpc_mitm/bpc_mitm_service.hpp b/stratosphere/ams_mitm/source/bpc_mitm/bpc_mitm_service.hpp index ac51abe8f..03e933c06 100644 --- a/stratosphere/ams_mitm/source/bpc_mitm/bpc_mitm_service.hpp +++ b/stratosphere/ams_mitm/source/bpc_mitm/bpc_mitm_service.hpp @@ -18,6 +18,8 @@ #include #include +#include "../utils.hpp" + enum BpcCmd : u32 { BpcCmd_ShutdownSystem = 0, BpcCmd_RebootSystem = 1, @@ -35,7 +37,7 @@ class BpcMitmService : public IMitmServiceObject { * - fatal, to simplify payload reboot logic significantly * - applications, to allow homebrew to take advantage of the feature. */ - return tid == 0x0100000000000023ull || tid == 0x0100000000000034ull || tid >= 0x0100000000010000ull; + return tid == 0x0100000000000023ull || tid == 0x0100000000000034ull || Utils::IsHblTid(tid); } static void PostProcess(IMitmServiceObject *obj, IpcResponseContext *ctx);