From 94d40374f99a5d9db6cc97a3b34ad777793cbec8 Mon Sep 17 00:00:00 2001 From: Maschell Date: Wed, 3 Jun 2020 19:36:16 +0200 Subject: [PATCH] Fix calling the hooks --- relocator/src/hooks.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/relocator/src/hooks.cpp b/relocator/src/hooks.cpp index d84c3e2..b575399 100644 --- a/relocator/src/hooks.cpp +++ b/relocator/src/hooks.cpp @@ -14,11 +14,11 @@ void CallHook(const std::vector &modules, wums_hook_type_t type) { DEBUG_FUNCTION_LINE("Calling hook of type %s [%d]", hook_names[type], type); for (auto &curModule: modules) { for (auto &curHook : curModule.getHookDataList()) { - if (curHook.getType() == WUMS_HOOK_INIT || - curHook.getType() == WUMS_HOOK_APPLICATION_STARTS || - curHook.getType() == WUMS_HOOK_APPLICATION_ENDS || - curHook.getType() == WUMS_HOOK_INIT_WUT || - curHook.getType() == WUMS_HOOK_FINI_WUT) { + if ((type == WUMS_HOOK_INIT || + type == WUMS_HOOK_APPLICATION_STARTS || + type == WUMS_HOOK_APPLICATION_ENDS || + type == WUMS_HOOK_INIT_WUT || + type == WUMS_HOOK_FINI_WUT) && curHook.getType() == type) { uint32_t func_ptr = (uint32_t) curHook.getTarget(); if (func_ptr == 0) { DEBUG_FUNCTION_LINE("Hook ptr was NULL\n");