aboutsummaryrefslogtreecommitdiff
path: root/hook.c
diff options
context:
space:
mode:
Diffstat (limited to 'hook.c')
-rw-r--r--hook.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/hook.c b/hook.c
index 8d7f409..fe8c555 100644
--- a/hook.c
+++ b/hook.c
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: ISC
// SPDX-FileCopyrightText: 2024 Michael Smith <mikesmiffy128@gmail.com>
-// SPDX-FileCopyrightText: 2022 Willian Henrique <wsimanbrazil@yahoo.com.br>//
+// SPDX-FileCopyrightText: 2022 Willian Henrique <wsimanbrazil@yahoo.com.br>
// SPDX-FileCopyrightText: 2024 Matthew Wozniak <me@woz.blue>
#include <string.h>
@@ -70,7 +70,7 @@ void *hook_inline(void *func_, void *target) {
}
}
// for simplicity, just bump alloc the trampoline. no need to free anyway
- if (nexttrampoline - trampolines > sizeof(trampolines) - len - 6) {
+ if (nexttrampoline - trampolines > (int)sizeof(trampolines) - len - 6) {
warn("out of trampoline space\n");
return 0;
}
@@ -99,6 +99,7 @@ void unhook_inline(void *orig) {
void *hook_dllapi(const char *module, const char *name, void *target) {
void *func = os_dlsym(os_dlopen(module), name);
+ debug("%s = %p", name, func);
if (!func) warn("couldn't find function %s in %s", name, module);
else return hook_inline(func, target);
return NULL;