diff options
author | Yifan Lu | 2016-10-24 20:37:46 -0700 |
---|---|---|
committer | Yifan Lu | 2016-10-24 20:37:46 -0700 |
commit | 3e6c30fb5accb8d92c959a87649767ff3dba5314 (patch) | |
tree | ebc0ed455c3bb7da383c5edff55359a6cd8a322f /lib/hook-functions.c | |
parent | Forgot NULL pointer check (diff) | |
download | substitute-3e6c30fb5accb8d92c959a87649767ff3dba5314.tar.gz |
Set outro pointer to use mirrored address
Diffstat (limited to '')
-rw-r--r-- | lib/hook-functions.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/hook-functions.c b/lib/hook-functions.c index 1c96d61..310b839 100644 --- a/lib/hook-functions.c +++ b/lib/hook-functions.c @@ -237,7 +237,8 @@ int substitute_hook_functions(const struct substitute_function_hook *hooks, hi->outro_trampoline++; #endif if (hook->old_ptr) - *(void **) hook->old_ptr = hi->outro_trampoline; + *(uintptr_t *) hook->old_ptr = trampoline_addr + + (uintptr_t)(hi->outro_trampoline - outro_trampoline_real); /* Generate the rewritten start of the function for the outro * trampoline (complaining if any bad instructions are found) |