diff options
Diffstat (limited to 'src/arch/x86/processor.c')
-rw-r--r-- | src/arch/x86/processor.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/arch/x86/processor.c b/src/arch/x86/processor.c index c7382ed..118dbd6 100644 --- a/src/arch/x86/processor.c +++ b/src/arch/x86/processor.c @@ -302,6 +302,7 @@ asm_instr *x86_fetch_instruction(const asm_x86_processor *proc, const uint8_t *d asm_x86_instr *result; /* Résultat à faire remonter */ X86Opcodes i; /* Boucle de parcours */ off_t tmp; /* Tête de lecture */ + off_t old_pos; /* Sauvegarde de la position */ result = NULL; @@ -326,9 +327,15 @@ asm_instr *x86_fetch_instruction(const asm_x86_processor *proc, const uint8_t *d if (proc->opcodes[i].has_op_ext && (data[tmp] & EXT_OPCODE_MASK) != proc->opcodes[i].op_ext) continue; + old_pos = *pos; + result = proc->opcodes[i].read(data, pos, len, offset, proc); if (result != NULL) result->type = i; - else printf("err while decoding :: [0x%02hhx] 0x%02hhx\n", proc->opcodes[i].prefix, proc->opcodes[i].opcode); + else + { + *pos = old_pos; + printf("err while decoding at 0x%08llx :: [0x%02hhx] 0x%02hhx\n", offset, proc->opcodes[i].prefix, proc->opcodes[i].opcode); + } break; } |