aboutsummaryrefslogtreecommitdiff
path: root/lib/hook-functions.c
diff options
context:
space:
mode:
authorYifan Lu2016-10-26 19:12:21 -0700
committerYifan Lu2016-10-26 19:12:21 -0700
commite895cdc598997a83a7999b558fba745ebc2a815d (patch)
treeb9e6c0b4b05c9ddc60482acdeb6b3be7da62421c /lib/hook-functions.c
parentVita: Added logging and changed cache flush name (diff)
downloadsubstitute-e895cdc598997a83a7999b558fba745ebc2a815d.tar.gz
Added passing of the opt data to records
Diffstat (limited to 'lib/hook-functions.c')
-rw-r--r--lib/hook-functions.c3
1 files changed, 2 insertions, 1 deletions
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. */