relocator: Fix location of Init-Hook call

This commit is contained in:
Maschell 2020-06-01 18:43:58 +02:00
parent 2442bb46c5
commit eac22b0583

View File

@ -143,13 +143,13 @@ extern "C" void doStart(int argc, char **argv) {
gInitCalled = 1; gInitCalled = 1;
DEBUG_FUNCTION_LINE("Resolve relocations without replacing alloc functions\n"); DEBUG_FUNCTION_LINE("Resolve relocations without replacing alloc functions\n");
ResolveRelocations(loadedModules, false); ResolveRelocations(loadedModules, false);
CallHook(loadedModules, WUMS_HOOK_INIT);
for (auto &curModule : loadedModules) { for (auto &curModule : loadedModules) {
if (curModule.getExportName().compare("homebrew_memorymapping") == 0) { if (curModule.getExportName().compare("homebrew_memorymapping") == 0) {
for (auto &curExport : curModule.getExportDataList()) { for (auto &curExport : curModule.getExportDataList()) {
if (curExport.getName().compare("MemoryMappingEffectiveToPhysical") == 0) { if (curExport.getName().compare("MemoryMappingEffectiveToPhysical") == 0) {
CallHook(loadedModules, WUMS_HOOK_INIT);
DEBUG_FUNCTION_LINE("Setting MemoryMappingEffectiveToPhysicalPTR to %08X\n", curExport.getAddress()); DEBUG_FUNCTION_LINE("Setting MemoryMappingEffectiveToPhysicalPTR to %08X\n", curExport.getAddress());
MemoryMappingEffectiveToPhysicalPTR = (uint32_t) curExport.getAddress(); MemoryMappingEffectiveToPhysicalPTR = (uint32_t) curExport.getAddress();
} else if (curExport.getName().compare("MemoryMappingPhysicalToEffective") == 0) { } else if (curExport.getName().compare("MemoryMappingPhysicalToEffective") == 0) {