diff options
author | comex | 2015-02-01 01:56:29 -0500 |
---|---|---|
committer | comex | 2015-02-01 01:56:42 -0500 |
commit | a23ef990492cd0384de1a924c44805587d5b5aed (patch) | |
tree | aa3a28446fc1a7ca1d799c8f3ad3acc6afdea0f2 /lib/hook-functions.c | |
parent | trivial wording tweak (diff) | |
download | substitute-a23ef990492cd0384de1a924c44805587d5b5aed.tar.gz |
fix my utter failure to handle branches/conditionals correctly (on ARM)
Diffstat (limited to '')
-rw-r--r-- | lib/hook-functions.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/hook-functions.c b/lib/hook-functions.c index 9d34400..986990b 100644 --- a/lib/hook-functions.c +++ b/lib/hook-functions.c @@ -151,7 +151,7 @@ int substitute_hook_functions(const struct substitute_function_hook *hooks, struct hook_internal *hi = &his[i]; void *code = hook->function; struct arch_dis_ctx arch; - memset(&arch, 0, sizeof(arch)); + arch_dis_ctx_init(&arch); #ifdef __arm__ if ((uintptr_t) code & 1) { arch.pc_low_bit = true; @@ -183,9 +183,9 @@ int substitute_hook_functions(const struct substitute_function_hook *hooks, uintptr_t pc_patch_end = pc_patch_start + patch_size; /* Generate the rewritten start of the function for the outro * trampoline (complaining if any bad instructions are found). */ - uint8_t rewritten_temp[MAX_REWRITTEN_SIZE]; + uint8_t rewritten_temp[TD_MAX_REWRITTEN_SIZE]; void *rp = rewritten_temp; - if ((ret = transform_dis_main(code, &rp, pc_patch_start, pc_patch_end, + if ((ret = transform_dis_main(code, &rp, pc_patch_start, &pc_patch_end, arch, hi->offset_by_pcdiff))) goto end; /* Check some of the rest of the function for jumps back into the |