From e895cdc598997a83a7999b558fba745ebc2a815d Mon Sep 17 00:00:00 2001 From: Yifan Lu Date: Wed, 26 Oct 2016 19:12:21 -0700 Subject: Added passing of the opt data to records --- lib/hook-functions.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib/hook-functions.c') diff --git a/lib/hook-functions.c b/lib/hook-functions.c index 310b839..674d424 100644 --- a/lib/hook-functions.c +++ b/lib/hook-functions.c @@ -295,6 +295,7 @@ int substitute_hook_functions(const struct substitute_function_hook *hooks, fws[i].opt = hooks[i].opt; if (records) { records->function = hi->code; + records->opt = hooks[i].opt; records->buffer_size = hi->jump_patch_size; memcpy(records->saved_buffer, hi->code, hi->jump_patch_size); records = (struct substitute_function_hook_record *)((char *)&records->saved_buffer + records->buffer_size); @@ -337,7 +338,7 @@ int substitute_free_hooks(struct substitute_function_hook_record *records, fws[i].dst = cur->function; fws[i].src = cur->saved_buffer; fws[i].len = cur->buffer_size; - fws[i].opt = NULL; + fws[i].opt = cur->opt; cur = (struct substitute_function_hook_record *)((char *)&cur->saved_buffer + cur->buffer_size); } /* TODO: Fix the case when thread is inside a patch/trampoline. */ -- cgit v1.2.3