diff options
| author | wildcard <nubieluv@gmail.com> | 2025-08-04 18:41:28 +0200 |
|---|---|---|
| committer | crueter <crueter@eden-emu.dev> | 2025-08-04 18:41:28 +0200 |
| commit | 41ffa5a3421d3b2f167d3a0a36cf63434f3bc028 (patch) | |
| tree | 4647af9328233c9e2b7c54f26cc867129d1dde09 /src/core/loader/nso.cpp | |
| parent | 33275c28d34589e0e1cf639a47187d9ce4f9e34f (diff) | |
[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 <crueter@eden-emu.dev>
Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/195
Reviewed-by: crueter <crueter@eden-emu.dev>
Co-authored-by: wildcard <nubieluv@gmail.com>
Co-committed-by: wildcard <nubieluv@gmail.com>
Diffstat (limited to 'src/core/loader/nso.cpp')
| -rw-r--r-- | src/core/loader/nso.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
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<VAddr> 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. |
