aboutsummaryrefslogtreecommitdiff
path: root/primedev/core/hooks.h
diff options
context:
space:
mode:
Diffstat (limited to 'primedev/core/hooks.h')
-rw-r--r--primedev/core/hooks.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/primedev/core/hooks.h b/primedev/core/hooks.h
index f842afbb..e5a65354 100644
--- a/primedev/core/hooks.h
+++ b/primedev/core/hooks.h
@@ -201,7 +201,9 @@ public:
}
}
- if (MH_CreateHook(targetAddr, pHookFunc, ppOrigFunc) == MH_OK)
+ if (!targetAddr)
+ spdlog::error("Address for hook {} is invalid", pFuncName);
+ else if (MH_CreateHook(targetAddr, pHookFunc, ppOrigFunc) == MH_OK)
{
if (MH_EnableHook(targetAddr) == MH_OK)
spdlog::info("Enabling hook {}", pFuncName);