From 41ffa5a3421d3b2f167d3a0a36cf63434f3bc028 Mon Sep 17 00:00:00 2001 From: wildcard Date: Mon, 4 Aug 2025 18:41:28 +0200 Subject: [core, nce] module_id cache key handling (#195) Uses Module_id plus offset for cache key, Module_id is unique to each module. Also passes the module_id everytime new patcher is created in case the module is too big. Co-authored-by: crueter Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/195 Reviewed-by: crueter Co-authored-by: wildcard Co-committed-by: wildcard --- src/core/loader/nso.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/core/loader/nso.cpp') diff --git a/src/core/loader/nso.cpp b/src/core/loader/nso.cpp index 583b7e9270..2cd62df072 100644 --- a/src/core/loader/nso.cpp +++ b/src/core/loader/nso.cpp @@ -166,9 +166,12 @@ std::optional AppLoader_NSO::LoadModule(Kernel::KProcess& process, Core:: const auto& code = codeset.CodeSegment(); auto* patch = patches ? &patches->operator[](patch_index) : nullptr; if (patch && !load_into_process) { + //Set module ID using build_id from the NSO header + patch->SetModuleID(nso_header.build_id); // Patch SVCs and MRS calls in the guest code while (!patch->PatchText(program_image, code)) { patch = &patches->emplace_back(); + patch->SetModuleID(nso_header.build_id); // In case the patcher is changed for big modules, the new patcher should also have the build_id } } else if (patch) { // Relocate code patch and copy to the program_image. -- cgit v1.2.3