Skip to content

Commit

Permalink
x86: handle f2/f3 prefix for 16bit. see issue capstone-engine#452
Browse files Browse the repository at this point in the history
  • Loading branch information
aquynh committed May 7, 2017
1 parent 3cc69be commit ce8a822
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions arch/X86/X86DisassemblerDecoder.c
Original file line number Diff line number Diff line change
Expand Up @@ -1238,9 +1238,9 @@ static int getID(struct InternalInstruction *insn)
attrMask |= ATTR_OPSIZE;
} else if (isPrefixAtLocation(insn, 0x67, insn->necessaryPrefixLocation)) {
attrMask |= ATTR_ADSIZE;
} else if (isPrefixAtLocation(insn, 0xf3, insn->necessaryPrefixLocation)) {
} else if (insn->mode != MODE_16BIT && isPrefixAtLocation(insn, 0xf3, insn->necessaryPrefixLocation)) {
attrMask |= ATTR_XS;
} else if (isPrefixAtLocation(insn, 0xf2, insn->necessaryPrefixLocation)) {
} else if (insn->mode != MODE_16BIT && isPrefixAtLocation(insn, 0xf2, insn->necessaryPrefixLocation)) {
attrMask |= ATTR_XD;
}
}
Expand All @@ -1260,6 +1260,7 @@ static int getID(struct InternalInstruction *insn)
return -1;
}


/*
* JCXZ/JECXZ need special handling for 16-bit mode because the meaning
* of the AdSize prefix is inverted w.r.t. 32-bit mode.
Expand Down

0 comments on commit ce8a822

Please sign in to comment.