Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x86: vmovsd has incorrect access for operands #2138

Open
tobast opened this issue Aug 14, 2023 · 2 comments
Open

x86: vmovsd has incorrect access for operands #2138

tobast opened this issue Aug 14, 2023 · 2 comments

Comments

@tobast
Copy link

tobast commented Aug 14, 2023

Hello,

When disassembling a vmovsd instruction that stores to memory in x86, eg. vmovsd qword ptr [rdx], xmm0 (c5fb1102), the first operand is marked as read instead of written by capstone.

Indeed,

$ ./cstool/cstool -d x64 'c5 fb 11 02'
 0  c5 fb 11 02                                      vmovsd     qword ptr [rdx], xmm0
        ID: 1046 (vmovsd)
        Prefix:0x00 0x00 0x00 0x00
        Opcode:0xc5 0xfb 0x00 0x00
        rex: 0x40
        addr_size: 8
        modrm: 0x2
        disp: 0x0
        sib: 0x0
        op_count: 2
                operands[0].type: MEM
                        operands[0].mem.base: REG = rdx
                operands[0].size: 8
                operands[0].access: READ
                operands[1].type: REG = xmm0
                operands[1].size: 16
                operands[1].access: READ
        Registers read: rdx xmm0
        Groups: avx

I found that, indeed, in X86MappingInsnOp.inc, many of the versions of VMOVSD… were using CS_AC_READ, CS_AC_READ, 0 for their attributes; I am however unsure of where this should be addressed, and what other instructions might be affected the same way.

This issue seems to be present in both next, 5.0 and 4.0.2.

@XVilka
Copy link
Contributor

XVilka commented Aug 16, 2023

Ideally, the X86 should also be ported to the new "auto-sync" mechanism, it would fix many X86 problems and regressions. Sadly, we don't have time and hands to do that, as we focus on non-x86 due to the slightly different implementation of it in LLVM. External help on capstone-engine/llvm-capstone#13 is welcome.

@pkilller
Copy link

iShot_2023-11-20_14 42 40

I had the same problem with the arm64.
version: 5.0.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants