diff options
| author | bunnei <bunneidev@gmail.com> | 2019-03-21 21:41:59 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-03-21 21:41:59 -0400 |
| commit | 92870ed060ea2265c2cf229e16ba742b6013ea6c (patch) | |
| tree | e03093771bbffc832c48670331cf9af54aa4a9fc /src/core/loader/nso.cpp | |
| parent | 57835877df1f65ff9b1e16c087632da44c9a3488 (diff) | |
| parent | 20c46b9242df6d37ca1fa4d55ab1693f936ecc45 (diff) | |
Merge pull request #1933 from DarkLordZach/cheat-engine
file_sys: Implement parser and interpreter for game memory cheats
Diffstat (limited to 'src/core/loader/nso.cpp')
| -rw-r--r-- | src/core/loader/nso.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/core/loader/nso.cpp b/src/core/loader/nso.cpp index e1c8908a18..0eb9fd7f70 100644 --- a/src/core/loader/nso.cpp +++ b/src/core/loader/nso.cpp @@ -7,8 +7,10 @@ #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" @@ -165,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); |
