summaryrefslogtreecommitdiffstats
path: root/src/core/loader/nso.cpp
diff options
context:
space:
mode:
authorZach Hilman <zachhilman@gmail.com>2019-03-05 16:09:27 +0100
committerZach Hilman <zachhilman@gmail.com>2019-03-05 16:09:36 +0100
commit52ac6419dafb84b10369226d3746b3b5b761d33b (patch)
tree008c14ba2e019b86128e6168ad49a3a1eafa6ba8 /src/core/loader/nso.cpp
parentcore: Add support for registering and controlling ownership of CheatEngine (diff)
downloadyuzu-52ac6419dafb84b10369226d3746b3b5b761d33b.tar
yuzu-52ac6419dafb84b10369226d3746b3b5b761d33b.tar.gz
yuzu-52ac6419dafb84b10369226d3746b3b5b761d33b.tar.bz2
yuzu-52ac6419dafb84b10369226d3746b3b5b761d33b.tar.lz
yuzu-52ac6419dafb84b10369226d3746b3b5b761d33b.tar.xz
yuzu-52ac6419dafb84b10369226d3746b3b5b761d33b.tar.zst
yuzu-52ac6419dafb84b10369226d3746b3b5b761d33b.zip
Diffstat (limited to 'src/core/loader/nso.cpp')
-rw-r--r--src/core/loader/nso.cpp10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/core/loader/nso.cpp b/src/core/loader/nso.cpp
index 2721d85b1..5f6a6c0cf 100644
--- a/src/core/loader/nso.cpp
+++ b/src/core/loader/nso.cpp
@@ -97,7 +97,6 @@ static constexpr u32 PageAlignSize(u32 size) {
std::optional<VAddr> AppLoader_NSO::LoadModule(Kernel::Process& process,
const FileSys::VfsFile& file, VAddr load_base,
bool should_pass_arguments,
- bool should_register_data_region,
std::optional<FileSys::PatchManager> pm) {
if (file.GetSize() < sizeof(NsoHeader))
return {};
@@ -156,10 +155,6 @@ std::optional<VAddr> AppLoader_NSO::LoadModule(Kernel::Process& process,
const u32 image_size{PageAlignSize(static_cast<u32>(program_image.size()) + bss_size)};
program_image.resize(image_size);
- if (should_register_data_region) {
- process.VMManager().SetMainCodeRegion(load_base, load_base + program_image.size());
- }
-
// Apply patches if necessary
if (pm && (pm->HasNSOPatch(nso_header.build_id) || Settings::values.dump_nso)) {
std::vector<u8> pi_header(program_image.size() + 0x100);
@@ -176,7 +171,8 @@ std::optional<VAddr> AppLoader_NSO::LoadModule(Kernel::Process& process,
const auto cheats = pm->CreateCheatList(nso_header.build_id);
if (!cheats.empty()) {
Core::System::GetInstance().RegisterCheatList(
- cheats, Common::HexArrayToString(nso_header.build_id));
+ cheats, Common::HexArrayToString(nso_header.build_id), load_base,
+ load_base + program_image.size());
}
}
@@ -197,7 +193,7 @@ ResultStatus AppLoader_NSO::Load(Kernel::Process& process) {
// Load module
const VAddr base_address = process.VMManager().GetCodeRegionBaseAddress();
- if (!LoadModule(process, *file, base_address, true, true)) {
+ if (!LoadModule(process, *file, base_address, true)) {
return ResultStatus::ErrorLoadingNSO;
}
LOG_DEBUG(Loader, "loaded module {} @ 0x{:X}", file->GetName(), base_address);