From eac22b0583aaffae8ec0634025bef84ae7c56171 Mon Sep 17 00:00:00 2001 From: Maschell Date: Mon, 1 Jun 2020 18:43:58 +0200 Subject: [PATCH] relocator: Fix location of Init-Hook call --- relocator/src/entry.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/relocator/src/entry.cpp b/relocator/src/entry.cpp index 17aa9e0..0a66ba2 100644 --- a/relocator/src/entry.cpp +++ b/relocator/src/entry.cpp @@ -143,13 +143,13 @@ extern "C" void doStart(int argc, char **argv) { gInitCalled = 1; DEBUG_FUNCTION_LINE("Resolve relocations without replacing alloc functions\n"); ResolveRelocations(loadedModules, false); + + CallHook(loadedModules, WUMS_HOOK_INIT); + for (auto &curModule : loadedModules) { if (curModule.getExportName().compare("homebrew_memorymapping") == 0) { for (auto &curExport : curModule.getExportDataList()) { if (curExport.getName().compare("MemoryMappingEffectiveToPhysical") == 0) { - - CallHook(loadedModules, WUMS_HOOK_INIT); - DEBUG_FUNCTION_LINE("Setting MemoryMappingEffectiveToPhysicalPTR to %08X\n", curExport.getAddress()); MemoryMappingEffectiveToPhysicalPTR = (uint32_t) curExport.getAddress(); } else if (curExport.getName().compare("MemoryMappingPhysicalToEffective") == 0) {