capstone-engine / capstone

Capstone disassembly/disassembler framework for ARM, ARM64 (ARMv8), Alpha, BPF, Ethereum VM, HPPA, LoongArch, M68K, M680X, Mips, MOS65XX, PPC, RISC-V(rv32G/rv64G), SH, Sparc, SystemZ, TMS320C64X, TriCore, Webassembly, XCore and X86.
http://www.capstone-engine.org
7.61k stars 1.56k forks source link

This time actually fix big endian issue. #2530

Closed Rot127 closed 3 weeks ago

Rot127 commented 3 weeks ago

Your checklist for this pull request

Detailed description

Of course an enum value has the width of an int. If it is 64bits long and on a big endian machine, the enum value gets assigned to the upper bits. Not the lower ones.

Test plan

QEMU_LD_PREFIX=/usr/s390x-redhat-linux/sys-root/fc40/usr/ qemu-s390x-static ./build-s390x/cstool -d aarch64 01421bd501423bd5
 0  01 42 1b d5  msr    NZCV, x1
    ID: 734 (msr)
    op_count: 2
        operands[0].type: SYS REG:
        operands[0].subtype: REG_MSR = 0xda10
        operands[1].type: REG = x1
        operands[1].access: READ
    Update-flags: True
    Registers read: x1
    Groups: privilege 

 4  01 42 3b d5  mrs    x1, NZCV
    ID: 732 (mrs)
    op_count: 2
        operands[0].type: REG = x1
        operands[0].access: WRITE
        operands[1].type: SYS REG:
        operands[1].subtype: REG_MRS = 0xda10
    Registers modified: x1
    Groups: privilege 

Closing issues

...