From 31efb5e930aeac40c4fef16be778418394b662e3 Mon Sep 17 00:00:00 2001 From: Billy Laws Date: Sun, 11 Oct 2020 20:51:20 +0100 Subject: [PATCH] Correct an NSO loader bug and use the correct address space extents --- app/src/main/cpp/skyline/kernel/memory.cpp | 4 ++-- app/src/main/cpp/skyline/loader/nso.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/src/main/cpp/skyline/kernel/memory.cpp b/app/src/main/cpp/skyline/kernel/memory.cpp index 47dfbdcb..66e0b9be 100644 --- a/app/src/main/cpp/skyline/kernel/memory.cpp +++ b/app/src/main/cpp/skyline/kernel/memory.cpp @@ -33,8 +33,8 @@ namespace skyline::kernel { } chunks = {ChunkDescriptor{ - .ptr = reinterpret_cast(base.address), - .size = base.size, + .ptr = reinterpret_cast(addressSpace.address), + .size = addressSpace.size, .state = memory::states::Unmapped, }}; } diff --git a/app/src/main/cpp/skyline/loader/nso.cpp b/app/src/main/cpp/skyline/loader/nso.cpp index bd092e63..64a45811 100644 --- a/app/src/main/cpp/skyline/loader/nso.cpp +++ b/app/src/main/cpp/skyline/loader/nso.cpp @@ -41,11 +41,11 @@ namespace skyline::loader { nsoExecutable.text.contents.resize(util::AlignUp(nsoExecutable.text.contents.size(), PAGE_SIZE)); nsoExecutable.text.offset = header.text.memoryOffset; - nsoExecutable.ro.contents = GetSegment(backing, header.ro, header.flags.textCompressed ? header.textCompressedSize : 0); + nsoExecutable.ro.contents = GetSegment(backing, header.ro, header.flags.roCompressed ? header.roCompressedSize : 0); nsoExecutable.ro.contents.resize(util::AlignUp(nsoExecutable.ro.contents.size(), PAGE_SIZE)); nsoExecutable.ro.offset = header.ro.memoryOffset; - nsoExecutable.data.contents = GetSegment(backing, header.data, header.flags.textCompressed ? header.textCompressedSize : 0); + nsoExecutable.data.contents = GetSegment(backing, header.data, header.flags.dataCompressed ? header.dataCompressedSize : 0); nsoExecutable.data.contents.resize(util::AlignUp(nsoExecutable.data.contents.size(), PAGE_SIZE)); nsoExecutable.data.offset = header.data.memoryOffset;