From f1df6fbca8975ceb0eebd51519eb5f753ff75fa4 Mon Sep 17 00:00:00 2001 From: Yifan Lu Date: Wed, 23 Nov 2016 17:24:50 -0600 Subject: Fixed defination of CC_CBXZ collides with other bits Fixed incorrect pc value in tdctx_to_actx Fixed ARM32 handling of CC_CBXZ (uses incorrect field in ctx->base) Fixed ARM32 transform_dis_branch incorrectly trashing LR for non-call based jumps Fixed ARM32 make_jump_patch not updated to use new assemble_ctx Added new option SUBSTITUTE_RELAXED to relax the disassembly engine Currently SUBSTITUTE_RELAXED only disables TRANSFORM_DIS_REL_JUMPS so jumps at the beginning of functions are allowed --- lib/hook-functions.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib/hook-functions.c') diff --git a/lib/hook-functions.c b/lib/hook-functions.c index 674d424..d2fabe9 100644 --- a/lib/hook-functions.c +++ b/lib/hook-functions.c @@ -147,6 +147,7 @@ int substitute_hook_functions(const struct substitute_function_hook *hooks, #else bool thread_safe = false; #endif + bool relaxed = !!(options & SUBSTITUTE_RELAXED); if (recordp) *recordp = NULL; @@ -248,7 +249,8 @@ int substitute_hook_functions(const struct substitute_function_hook *hooks, if ((ret = transform_dis_main(code, &trampoline_ptr, pc_patch_start, &pc_patch_end, trampoline_addr, &arch, hi->offset_by_pcdiff, - thread_safe ? TRANSFORM_DIS_BAN_CALLS : 0))) + (thread_safe ? TRANSFORM_DIS_BAN_CALLS : 0) | + (relaxed ? 0 : TRANSFORM_DIS_REL_JUMPS)))) goto end; trampoline_addr += (trampoline_ptr - trampoline_prev); -- cgit v1.2.3