diff --git a/libraries/libstratosphere/include/stratosphere/spl/spl_api.hpp b/libraries/libstratosphere/include/stratosphere/spl/spl_api.hpp index 01b61aec7..b2ce4a56e 100644 --- a/libraries/libstratosphere/include/stratosphere/spl/spl_api.hpp +++ b/libraries/libstratosphere/include/stratosphere/spl/spl_api.hpp @@ -21,6 +21,7 @@ namespace ams::spl { HardwareType GetHardwareType(); MemoryArrangement GetMemoryArrangement(); + bool IsDisabledProgramVerification(); bool IsDevelopmentHardware(); bool IsDevelopmentFunctionEnabled(); bool IsMariko(); diff --git a/libraries/libstratosphere/source/spl/spl_api.cpp b/libraries/libstratosphere/source/spl/spl_api.cpp index cdbae0343..032ac52ac 100644 --- a/libraries/libstratosphere/source/spl/spl_api.cpp +++ b/libraries/libstratosphere/source/spl/spl_api.cpp @@ -41,6 +41,12 @@ namespace ams::spl { } } + bool IsDisabledProgramVerification() { + u64 val = 0; + R_ABORT_UNLESS(splGetConfig(SplConfigItem_DisableProgramVerification, &val)); + return val != 0; + } + bool IsDevelopmentHardware() { bool is_dev_hardware; R_ABORT_UNLESS(splIsDevelopment(&is_dev_hardware)); diff --git a/stratosphere/pm/source/impl/pm_process_manager.cpp b/stratosphere/pm/source/impl/pm_process_manager.cpp index c9b41d430..30ad8ce23 100644 --- a/stratosphere/pm/source/impl/pm_process_manager.cpp +++ b/stratosphere/pm/source/impl/pm_process_manager.cpp @@ -705,6 +705,16 @@ namespace ams::pm::impl { Result NotifyBootFinished() { static bool g_has_boot_finished = false; if (!g_has_boot_finished) { + /* Set program verification disabled, if we should. */ + /* NOTE: Nintendo does not check the result of this. */ + if (spl::IsDisabledProgramVerification()) { + if (hos::GetVersion() >= hos::Version_10_0_0) { + ldr::pm::SetEnabledProgramVerification(false); + } else { + fsprSetEnabledProgramVerification(false); + } + } + boot2::LaunchPreSdCardBootProgramsAndBoot2(); g_has_boot_finished = true; os::SignalSystemEvent(std::addressof(g_boot_finished_event));