diff options
Diffstat (limited to 'src/core/loader/nso.cpp')
-rw-r--r-- | src/core/loader/nso.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/core/loader/nso.cpp b/src/core/loader/nso.cpp index 62c090353..e75c700ad 100644 --- a/src/core/loader/nso.cpp +++ b/src/core/loader/nso.cpp @@ -89,7 +89,7 @@ std::optional<VAddr> AppLoader_NSO::LoadModule(Kernel::Process& process, // Build program image Kernel::CodeSet codeset; - std::vector<u8> program_image; + Kernel::PhysicalMemory program_image; for (std::size_t i = 0; i < nso_header.segments.size(); ++i) { std::vector<u8> data = file.ReadBytes(nso_header.segments_compressed_size[i], nso_header.segments[i].offset); @@ -152,8 +152,7 @@ std::optional<VAddr> AppLoader_NSO::LoadModule(Kernel::Process& process, auto& system = Core::System::GetInstance(); const auto cheats = pm->CreateCheatList(system, nso_header.build_id); if (!cheats.empty()) { - system.RegisterCheatList(cheats, Common::HexArrayToString(nso_header.build_id), - load_base, load_base + program_image.size()); + system.RegisterCheatList(cheats, nso_header.build_id, load_base, image_size); } } @@ -172,11 +171,15 @@ AppLoader_NSO::LoadResult AppLoader_NSO::Load(Kernel::Process& process) { return {ResultStatus::ErrorAlreadyLoaded, {}}; } + modules.clear(); + // Load module const VAddr base_address = process.VMManager().GetCodeRegionBaseAddress(); if (!LoadModule(process, *file, base_address, true)) { return {ResultStatus::ErrorLoadingNSO, {}}; } + + modules.insert_or_assign(base_address, file->GetName()); LOG_DEBUG(Loader, "loaded module {} @ 0x{:X}", file->GetName(), base_address); is_loaded = true; @@ -184,4 +187,9 @@ AppLoader_NSO::LoadResult AppLoader_NSO::Load(Kernel::Process& process) { LoadParameters{Kernel::THREADPRIO_DEFAULT, Memory::DEFAULT_STACK_SIZE}}; } +ResultStatus AppLoader_NSO::ReadNSOModules(Modules& modules) { + modules = this->modules; + return ResultStatus::Success; +} + } // namespace Loader |