x86: fix operand size of farjmp/farcall. bug reported by Ruslan Kabatsayev

This commit is contained in:
Nguyen Anh Quynh 2015-08-14 10:46:42 +08:00
parent 6482ca156a
commit 1c6309cdb8

View File

@ -67,13 +67,22 @@ static void printopaquemem(MCInst *MI, unsigned OpNo, SStream *O)
switch(MI->csh->mode) {
case CS_MODE_16:
MI->x86opsize = 2;
if (MI->flat_insn->id == X86_INS_LJMP || MI->flat_insn->id == X86_INS_LCALL)
MI->x86opsize = 4;
else
MI->x86opsize = 2;
break;
case CS_MODE_32:
MI->x86opsize = 4;
if (MI->flat_insn->id == X86_INS_LJMP || MI->flat_insn->id == X86_INS_LCALL)
MI->x86opsize = 6;
else
MI->x86opsize = 4;
break;
case CS_MODE_64:
MI->x86opsize = 8;
if (MI->flat_insn->id == X86_INS_LJMP || MI->flat_insn->id == X86_INS_LCALL)
MI->x86opsize = 10;
else
MI->x86opsize = 8;
break;
default: // never reach
break;