diff options
author | comex | 2015-02-23 00:41:29 -0500 |
---|---|---|
committer | comex | 2015-02-23 00:54:13 -0500 |
commit | b63f1dff9dc736f7fa66f04976436f1f3fe2ac5d (patch) | |
tree | db70eb338a0107fdc70992ea2522fd03f2ecf32e /lib/x86/arch-transform-dis.inc.h | |
parent | fix some i386 stuff (diff) | |
download | substitute-b63f1dff9dc736f7fa66f04976436f1f3fe2ac5d.tar.gz |
Ban calls within transform regions in threadsafe mode.
Diffstat (limited to 'lib/x86/arch-transform-dis.inc.h')
-rw-r--r-- | lib/x86/arch-transform-dis.inc.h | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/lib/x86/arch-transform-dis.inc.h b/lib/x86/arch-transform-dis.inc.h index 56e41eb..a4be424 100644 --- a/lib/x86/arch-transform-dis.inc.h +++ b/lib/x86/arch-transform-dis.inc.h @@ -81,10 +81,7 @@ static void transform_dis_branch(struct transform_dis_ctx *ctx, uint_tptr dpc, *ctx->rewritten_ptr_ptr = code; return; } - if (dpc >= ctx->pc_patch_start && dpc < ctx->pc_patch_end) { - ctx->err = SUBSTITUTE_ERR_FUNC_BAD_INSN_AT_START; - return; - } + transform_dis_branch_top(ctx, dpc, cc); void *code = *ctx->rewritten_ptr_ptr; struct arch_dis_ctx arch; @@ -109,10 +106,8 @@ static void transform_dis_branch(struct transform_dis_ctx *ctx, uint_tptr dpc, transform_dis_ret(ctx); } else { ctx->write_newop_here = NULL; - make_jmp_or_call(&code, ctx->pc_trampoline, dpc, cc & CC_CALL); - if (!(cc & CC_CALL)) - transform_dis_ret(ctx); + make_jmp_or_call(&code, ctx->pc_trampoline, dpc, cc & CC_CALL); } *ctx->rewritten_ptr_ptr = code; } |