From 552d5071fa171165e4054392d8bb6bf2ecc924e2 Mon Sep 17 00:00:00 2001 From: Zach Hilman Date: Wed, 27 Mar 2019 20:08:56 -0400 Subject: patch_manager: Dump NSO name with build ID --- src/core/loader/nso.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/core/loader') diff --git a/src/core/loader/nso.cpp b/src/core/loader/nso.cpp index 714d85a59..c766070e7 100644 --- a/src/core/loader/nso.cpp +++ b/src/core/loader/nso.cpp @@ -20,6 +20,8 @@ #include "core/memory.h" #include "core/settings.h" +#pragma optimize("", off) + namespace Loader { namespace { struct MODHeader { @@ -139,13 +141,13 @@ std::optional AppLoader_NSO::LoadModule(Kernel::Process& process, // Apply patches if necessary if (pm && (pm->HasNSOPatch(nso_header.build_id) || Settings::values.dump_nso)) { - std::vector pi_header(sizeof(NSOHeader) + program_image.size()); + std::vector pi_header; pi_header.insert(pi_header.begin(), reinterpret_cast(&nso_header), reinterpret_cast(&nso_header) + sizeof(NSOHeader)); pi_header.insert(pi_header.begin() + sizeof(NSOHeader), program_image.begin(), program_image.end()); - pi_header = pm->PatchNSO(pi_header); + pi_header = pm->PatchNSO(pi_header, file.GetName()); std::copy(pi_header.begin() + sizeof(NSOHeader), pi_header.end(), program_image.begin()); } -- cgit v1.2.3