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/substitute.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'lib/substitute.h') diff --git a/lib/substitute.h b/lib/substitute.h index becf4b0..8cc2a4d 100644 --- a/lib/substitute.h +++ b/lib/substitute.h @@ -98,13 +98,16 @@ struct substitute_function_hook { /* Currently unused; pass 0. (Protip: When using C {} struct initializer * syntax, you can just omit this.) */ int options; - /* Any platform specific auxiliary data */ + /* Any platform specific auxiliary data. The data pointed to must remain + * valid until after the hook is freed! */ void *opt; }; struct substitute_function_hook_record { /* Function that was originally hooked. */ void *function; + /* Any platform specific auxiliary data copied from the hook */ + void *opt; /** Should at least be MAX_JUMP_PATCH_SIZE for your platform */ size_t buffer_size; /** Store the original code. Must be large enough to hold MAX_JUMP_PATCH_SIZE -- cgit v1.2.3