summaryrefslogtreecommitdiffstats
path: root/src/core/loader
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
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')
-rw-r--r--src/core/loader/deconstructed_rom_directory.cpp4
-rw-r--r--src/core/loader/nso.cpp10
-rw-r--r--src/core/loader/nso.h1
3 files changed, 4 insertions, 11 deletions
diff --git a/src/core/loader/deconstructed_rom_directory.cpp b/src/core/loader/deconstructed_rom_directory.cpp
index ef9a577e3..07aa7a1cd 100644
--- a/src/core/loader/deconstructed_rom_directory.cpp
+++ b/src/core/loader/deconstructed_rom_directory.cpp
@@ -147,10 +147,8 @@ ResultStatus AppLoader_DeconstructedRomDirectory::Load(Kernel::Process& process)
const VAddr load_addr = next_load_addr;
const bool should_pass_arguments = std::strcmp(module, "rtld") == 0;
- const bool should_register_data_segment = std::strcmp(module, "main") == 0;
const auto tentative_next_load_addr =
- AppLoader_NSO::LoadModule(process, *module_file, load_addr, should_pass_arguments,
- should_register_data_segment, pm);
+ AppLoader_NSO::LoadModule(process, *module_file, load_addr, should_pass_arguments, pm);
if (!tentative_next_load_addr) {
return ResultStatus::ErrorLoadingNSO;
}
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);
diff --git a/src/core/loader/nso.h b/src/core/loader/nso.h
index 858e346c6..135b6ea5a 100644
--- a/src/core/loader/nso.h
+++ b/src/core/loader/nso.h
@@ -43,7 +43,6 @@ public:
static std::optional<VAddr> LoadModule(Kernel::Process& process, const FileSys::VfsFile& file,
VAddr load_base, bool should_pass_arguments,
- bool should_register_data_segment,
std::optional<FileSys::PatchManager> pm = {});
ResultStatus Load(Kernel::Process& process) override;