mitm/cfg: pass around override status for decision-making

This commit is contained in:
Michael Scire
2019-11-21 04:03:19 -08:00
committed by SciresM
parent 37e065fa2d
commit 421324b498
59 changed files with 425 additions and 265 deletions

View File

@@ -25,16 +25,15 @@ namespace ams::mitm::bpc {
RebootSystem = 1,
};
public:
static bool ShouldMitm(os::ProcessId process_id, ncm::ProgramId program_id) {
static bool ShouldMitm(const sm::MitmProcessInfo &client_info) {
/* We will mitm:
* - am, to intercept the Reboot/Power buttons in the overlay menu.
* - fatal, to simplify payload reboot logic significantly
* - applications and hbl, to allow homebrew to take advantage of the feature.
* - hbl, to allow homebrew to take advantage of the feature.
*/
return program_id == ncm::ProgramId::Am ||
program_id == ncm::ProgramId::Fatal ||
ncm::IsApplicationProgramId(program_id);
/* TODO: Hbl */
return client_info.program_id == ncm::ProgramId::Am ||
client_info.program_id == ncm::ProgramId::Fatal ||
client_info.override_status.IsHbl();
}
public:
SF_MITM_SERVICE_OBJECT_CTOR(BpcMitmService) { /* ... */ }