summaryrefslogtreecommitdiff
path: root/src/arch/x86/op_pop.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/arch/x86/op_pop.c')
-rw-r--r--src/arch/x86/op_pop.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/arch/x86/op_pop.c b/src/arch/x86/op_pop.c
index 3e725eb..4d7f520 100644
--- a/src/arch/x86/op_pop.c
+++ b/src/arch/x86/op_pop.c
@@ -32,9 +32,11 @@
/******************************************************************************
* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
+* 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. *
+* proc = architecture ciblée par le désassemblage. *
* *
* Description : Décode une instruction de type 'pop' (16 ou 32 bits). *
* *
@@ -44,24 +46,25 @@
* *
******************************************************************************/
-asm_x86_instr *read_instr_pop_1632(const uint8_t *data, off_t *pos, off_t len)
+asm_x86_instr *read_instr_pop_reg1632(const uint8_t *data, off_t *pos, off_t len, uint64_t offset, const asm_x86_processor *proc)
{
asm_x86_instr *result; /* Instruction à retourner */
- bool is_reg32; /* Implique un registre 32 bits*/
+ AsmOperandSize oprsize; /* Taille des opérandes */
asm_x86_operand *reg; /* Registre de destination */
result = (asm_x86_instr *)calloc(1, sizeof(asm_x86_instr));
/* Utilisation des registres 32 bits ? */
- is_reg32 = (data[*pos] != 0x66);
- if (!is_reg32)
+ if (data[*pos] == 0x66)
{
+ oprsize = switch_x86_operand_size(proc);
(*pos)++;
}
+ else oprsize = get_x86_current_operand_size(proc);
ASM_INSTRUCTION(result)->opcode = data[*pos];
- reg = x86_create_reg1632_operand(data[(*pos)++], is_reg32, 0x58);
+ reg = x86_create_reg1632_operand(data[(*pos)++], oprsize == AOS_32_BITS, 0x58);
if (reg == NULL)
{
free(result);