diff options
Diffstat (limited to 'src/core/loader/nso.cpp')
-rw-r--r-- | src/core/loader/nso.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/core/loader/nso.cpp b/src/core/loader/nso.cpp index 6ded0b707..0eb9fd7f7 100644 --- a/src/core/loader/nso.cpp +++ b/src/core/loader/nso.cpp @@ -7,10 +7,13 @@ #include <lz4.h> #include "common/common_funcs.h" #include "common/file_util.h" +#include "common/hex_util.h" #include "common/logging/log.h" #include "common/swap.h" +#include "core/core.h" #include "core/file_sys/patch_manager.h" #include "core/gdbstub/gdbstub.h" +#include "core/hle/kernel/code_set.h" #include "core/hle/kernel/process.h" #include "core/hle/kernel/vm_manager.h" #include "core/loader/nso.h" @@ -164,6 +167,16 @@ std::optional<VAddr> AppLoader_NSO::LoadModule(Kernel::Process& process, std::memcpy(program_image.data(), pi_header.data() + 0x100, program_image.size()); } + // Apply cheats if they exist and the program has a valid title ID + if (pm) { + const auto cheats = pm->CreateCheatList(nso_header.build_id); + if (!cheats.empty()) { + Core::System::GetInstance().RegisterCheatList( + cheats, Common::HexArrayToString(nso_header.build_id), load_base, + load_base + program_image.size()); + } + } + // Load codeset for current process codeset.memory = std::make_shared<std::vector<u8>>(std::move(program_image)); process.LoadModule(std::move(codeset), load_base); |