Loader: Skeleton IPS/IPS32 patching support.

This commit is contained in:
Michael Scire 2018-07-28 20:01:09 -07:00
parent cd42f6dc18
commit c1fd2eda20
3 changed files with 118 additions and 0 deletions

View file

@ -7,6 +7,7 @@
#include "ldr_nso.hpp"
#include "ldr_map.hpp"
#include "ldr_random.hpp"
#include "ldr_patcher.hpp"
static NsoUtils::NsoHeader g_nso_headers[NSO_NUM_MAX] = {0};
static bool g_nso_present[NSO_NUM_MAX] = {0};
@ -283,6 +284,9 @@ Result NsoUtils::LoadNsosIntoProcessMemory(Handle process_h, u64 title_id, NsoLo
u64 bss_base = rw_start + g_nso_headers[i].segments[2].decomp_size, bss_size = g_nso_headers[i].segments[2].align_or_total_size;
std::fill(map_base + bss_base, map_base + bss_base + bss_size, 0);
/* Apply patches to loaded module. */
PatchUtils::ApplyPatches(title_id, &g_nso_headers[i], map_base, bss_base);
nso_map.Close();
for (unsigned int seg = 0; seg < 3; seg++) {