From b346c8f3759693f2291f4cb246fd6f7af6d4fdd6 Mon Sep 17 00:00:00 2001 From: Michael Scire Date: Mon, 7 May 2018 07:31:36 -0600 Subject: [PATCH] Fix minor bugs in loader/sm --- stratosphere/loader/source/ldr_registration.cpp | 2 +- stratosphere/sm/source/sm_user_service.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/stratosphere/loader/source/ldr_registration.cpp b/stratosphere/loader/source/ldr_registration.cpp index 729a2c3ad..70204eca3 100644 --- a/stratosphere/loader/source/ldr_registration.cpp +++ b/stratosphere/loader/source/ldr_registration.cpp @@ -230,7 +230,7 @@ Result Registration::RemoveNroInfo(u64 index, Handle process_h, u64 nro_heap_add return 0xA809; } - for (unsigned int i = 0; i < NRR_INFO_MAX; i++) { + for (unsigned int i = 0; i < NRO_INFO_MAX; i++) { if (target_process->nro_infos[i].in_use && target_process->nro_infos[i].nro_heap_address == nro_heap_address) { NroInfo *info = &target_process->nro_infos[i]; Result rc = svcUnmapProcessCodeMemory(process_h, info->base_address + info->text_size + info->ro_size + info->rw_size, info->bss_heap_address, info->bss_heap_size); diff --git a/stratosphere/sm/source/sm_user_service.cpp b/stratosphere/sm/source/sm_user_service.cpp index b445a5ab3..0e3d91025 100644 --- a/stratosphere/sm/source/sm_user_service.cpp +++ b/stratosphere/sm/source/sm_user_service.cpp @@ -65,11 +65,11 @@ std::tuple UserService::register_service(u64 service, u8 is Result rc = 0x415; #ifdef SM_ENABLE_SMHAX if (!this->has_initialized) { - rc = Registration::RegisterServiceForPid(Registration::GetInitialProcessId(), service, max_sessions, is_light != 0, &service_h); + rc = Registration::RegisterServiceForPid(Registration::GetInitialProcessId(), service, max_sessions, (is_light & 1) != 0, &service_h); } #endif if (this->has_initialized) { - rc = Registration::RegisterServiceForPid(this->pid, service, max_sessions, is_light != 0, &service_h); + rc = Registration::RegisterServiceForPid(this->pid, service, max_sessions, (is_light & 1) != 0, &service_h); } return {rc, MovedHandle{service_h}}; }