From 44ccdde6fced7672b184be82b4eaf994c1c705c5 Mon Sep 17 00:00:00 2001 From: Michael Pavone Date: Wed, 13 Sep 2017 21:06:25 -0700 Subject: Preserve original address when retranslating instructions instead of switching to the lowest alias --- gen_x86.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'gen_x86.c') diff --git a/gen_x86.c b/gen_x86.c index 2840ba0..d8dd157 100644 --- a/gen_x86.c +++ b/gen_x86.c @@ -1307,6 +1307,15 @@ void mov_ir(code_info *code, int64_t val, uint8_t dst, uint8_t size) code->cur = out; } +uint8_t is_mov_ir(code_ptr inst) +{ + while (*inst == PRE_SIZE || *inst == PRE_REX) + { + inst++; + } + return (*inst & 0xF8) == OP_MOV_I8R || (*inst & 0xF8) == OP_MOV_IR || (*inst & 0xFE) == OP_MOV_IEA; +} + void mov_irdisp(code_info *code, int32_t val, uint8_t dst, int32_t disp, uint8_t size) { check_alloc_code(code, 12); -- cgit v1.2.3