diff options
author | Matthew Wozniak <me@woz.blue> | 2024-11-01 13:47:31 -0400 |
---|---|---|
committer | Matthew Wozniak <me@woz.blue> | 2024-11-01 13:48:09 -0400 |
commit | a2f7e37d8adf2047e1f3b0ea1227ac9d51514783 (patch) | |
tree | 2942ee2a12abe02e27f119552221c6a06ac87273 /hook.c | |
parent | fb95177298bb92098b61f09b9f66c1fce32f2f02 (diff) | |
download | rt-a2f7e37d8adf2047e1f3b0ea1227ac9d51514783.tar.gz rt-a2f7e37d8adf2047e1f3b0ea1227ac9d51514783.zip |
play demo using the demoplayer object
Diffstat (limited to 'hook.c')
-rw-r--r-- | hook.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -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;
|