From 3e6c30fb5accb8d92c959a87649767ff3dba5314 Mon Sep 17 00:00:00 2001 From: Yifan Lu Date: Mon, 24 Oct 2016 20:37:46 -0700 Subject: Set outro pointer to use mirrored address --- lib/hook-functions.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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) -- cgit v1.2.3