emproof-com / nyxstone

Nyxstone: assembly / disassembly library based on LLVM, implemented in C++ with Rust and Python bindings, maintained by emproof.com
https://www.emproof.com
MIT License
321 stars 16 forks source link

Get more information about disassembled instructions #34

Open seritools opened 1 year ago

seritools commented 1 year ago

Not sure how feasible this is or how much LLVM provides, but it seems like there isn't a lot of information available about decoded instructions. It's for example not possible to extract arguments or even easily retrieve just the instruction mnemonic.

Because it's generic over multiple architectures it probably won't ever reach the level of detail that something like iced_x86::Instruction has, but a bit more than just the bytes and the entire assembler line would be nice.

stuxnot commented 1 year ago

This is something we would really like to have, but which has proven difficult. While LLVM provies a MCInstrDesc for each instruction, the information in this class are not the greatest, since they need to be generic over all architectures. In the future this should be further explored.

m4drat commented 4 months ago

As an example, being able to extract additional information as capstone does would be an immensely useful feature:

$ cstool -d arm "0x00, 0x00, 0x00, 0xEF"
 0  00 00 00 ef  svc    #0
        ID: 216 (svc)
        op_count: 1
                operands[0].type: IMM = 0x0
        Registers read: pc
        Registers modified: lr
        Groups: arm int