Fix #2244: The offset for pseudo-instr. IDs was incorrectly applied for vcmp. (#2332)

This commit is contained in:
Rot127 2024-05-08 14:26:57 +00:00 committed by GitHub
parent 30a4ecf01b
commit 11a2ea2863
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 6 additions and 1 deletions

2
cs.c
View File

@ -945,7 +945,7 @@ size_t CAPSTONE_API cs_disasm(csh ud, const uint8_t *buffer, size_t size, uint64
fill_insn(handle, insn_cache, ss.buffer, &mci, handle->post_printer, buffer);
// adjust for pseudo opcode (X86)
if (handle->arch == CS_ARCH_X86)
if (handle->arch == CS_ARCH_X86 && insn_cache->id != X86_INS_VCMP)
insn_cache->id += mci.popcode_adjust;
next_offset = insn_size;

View File

@ -1050,3 +1050,7 @@
!# issue 2079
!# CS_ARCH_X86, CS_MODE_32, CS_OPT_DETAIL
0x0: 0xd1,0x10 == rcl dword ptr [eax] ; operands[1].type: IMM = 0x1
!# issue 2244
!# CS_ARCH_X86, CS_MODE_64, CS_OPT_DETAIL
0x0: 0xc5,0xfb,0xc2,0xda,0x06 == vcmpnlesd xmm3, xmm0, xmm2 ; ID: 797

View File

@ -203,6 +203,7 @@ char *get_detail_x86(csh *ud, cs_mode mode, cs_insn *ins)
x86 = &(ins->detail->x86);
add_str(&result, " ; ID: %" PRIu32 , ins->id);
print_string_hex(&result, " ; Prefix:", x86->prefix, 4);
print_string_hex(&result, " ; Opcode:", x86->opcode, 4);
add_str(&result, " ; rex: 0x%x", x86->rex);