summaryrefslogtreecommitdiff
path: root/src/arch/x86/op_inc.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/arch/x86/op_inc.c')
-rw-r--r--src/arch/x86/op_inc.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/arch/x86/op_inc.c b/src/arch/x86/op_inc.c
index 912d432..b80e448 100644
--- a/src/arch/x86/op_inc.c
+++ b/src/arch/x86/op_inc.c
@@ -35,7 +35,8 @@
* Paramètres : data = flux de données à analyser. *
* pos = position courante dans ce flux. [OUT] *
* len = taille totale des données à analyser. *
-* offset = adresse virtuelle de l'instruction. *
+* addr = adresse virtuelle de l'instruction. *
+* prefix = éventuel(s) préfixe(s) remarqué(s). *
* proc = architecture ciblée par le désassemblage. *
* *
* Description : Décode une instruction de type 'inc' (16 ou 32 bits). *
@@ -46,20 +47,21 @@
* *
******************************************************************************/
-asm_x86_instr *x86_read_instr_inc_r1632(const uint8_t *data, off_t *pos, off_t len, uint64_t offset, const asm_x86_processor *proc)
+GArchInstruction *x86_read_instr_inc_r1632(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
{
- asm_x86_instr *result; /* Instruction à retourner */
+ GArchInstruction *result; /* Instruction à retourner */
+ X86Opcodes opcode; /* Instruction effective */
AsmOperandSize oprsize; /* Taille des opérandes */
- result = (asm_x86_instr *)calloc(1, sizeof(asm_x86_instr));
+ opcode = XOP_INC_E_AX + (data[*pos] - 0x40);
- oprsize = switch_x86_operand_size_if_needed(proc, data, pos);
+ result = g_x86_instruction_new(opcode);
- ASM_INSTRUCTION(result)->opcode = data[*pos];
+ oprsize = g_x86_processor_get_operand_size(proc, prefix);
if (!x86_read_one_operand(result, data, pos, len, X86_OTP_OP_R1632, oprsize, 0x40))
{
- free(result);
+ /* TODO free(result);*/
return NULL;
}