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

Incorrect disassembly on `calll *0x0` instruction. #1241

Open eternalklaus opened 6 years ago

eternalklaus commented 6 years ago

My test code:

from capstone import *

CODE = b"\xff\x15\x00\x00\00\x00"

md = Cs(CS_ARCH_X86, CS_MODE_32)
md.syntax = CS_OPT_SYNTAX_ATT
for i in md.disasm(CODE, 0x1000):
    print("0x%x:\t%s\t%s" %(i.address, i.mnemonic, i.op_str))

result: 0x1000: calll *

This should be calll *0x0.

E3V3A commented 6 years ago

@eternalklaus Thanks for reporting. Would you care to make a PR for a fix? Can you provide a link to documentation of that instruction?

aquynh commented 6 years ago

which version is this?

on master code, we have:

$ cstool x32att "\xff\x15\x00\x00\00\x00"
 0  ff 15 00 00 00 00                                calll  *0