Skip to content

Commit

Permalink
x86: LES is invalid in x64. see capstone-engine#904
Browse files Browse the repository at this point in the history
  • Loading branch information
aquynh committed May 6, 2017
1 parent efc9036 commit a8ad69a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions arch/X86/X86Disassembler.c
Original file line number Diff line number Diff line change
Expand Up @@ -835,6 +835,12 @@ bool X86_getInstruction(csh ud, const uint8_t *code, size_t code_len,

result = (!translateInstruction(instr, &insn)) ? true : false;
if (result) {
// quick fix for #904. TODO: fix this properly in the next update
if (handle->mode & CS_MODE_64 &&
(instr->Opcode == X86_LES16rm || instr->Opcode == X86_LES32rm))
// LES is invalid in x64
return false;

instr->imm_size = insn.immSize;
if (handle->detail) {
update_pub_insn(instr->flat_insn, &insn, instr->x86_prefix);
Expand Down

0 comments on commit a8ad69a

Please sign in to comment.