Skip to content

incorrect ARM IT-block disassemble #643

Closed
@ripples-alive

Description

There is something unexpected in ARM IT block disassembling.

The trigger code (with python binding):

import capstone
from capstone.arm import *

CODE = '\xbc\xbf\x20\x60\x18\x46'
ADDR = 0x8a42

thumb_md = capstone.Cs(capstone.CS_ARCH_ARM, capstone.CS_MODE_THUMB)
thumb_md.detail = True

print '=' * 10
for insn in thumb_md.disasm(CODE[:4], ADDR):
    print '{0.mnemonic}\t{0.op_str}'.format(insn)

print '=' * 10
for insn in thumb_md.disasm(CODE, ADDR):
    print '{0.mnemonic}\t{0.op_str}'.format(insn)

print '=' * 10
for insn in thumb_md.disasm(CODE, ADDR):
    print '{0.mnemonic}\t{0.op_str}'.format(insn)

Output for above code:

==========
itt     lt
strlt   r0, [r4]
==========
itt     lt
strlt   r0, [r4]
mov     r0, r3
==========
itt     lt
strlt   r0, [r4]
movlt   r0, r3

But it should be:

==========
itt     lt
strlt   r0, [r4]
==========
itt     lt
strlt   r0, [r4]
movlt     r0, r3
==========
itt     lt
strlt   r0, [r4]
movlt   r0, r3

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions