0

I have this little-endian thumb hex code: 44 79 (79 44) and I want to convert it into an instruction. How do I go about doing so? Compiling a program then decompiling it to get the instruction, is that possible?

3

The Online Disassembler works well for small sequences of instructions.

44 79

.data:00000000  7944    ldrb    r4, [r0, #5]

79 44

.data:00000000  4479    add     r1, pc
1

I'd probably use capstone. An example is below:

#!/usr/bin/env python
from capstone import *

CODE = b"\x44\x79"

md = Cs(CS_ARCH_ARM, CS_MODE_THUMB|CS_MODE_LITTLE_ENDIAN)
for (address, size, mnemonic, op_str) in md.disasm_lite(CODE, 0x1000):
    print("0x%x:\t%s\t%s" %(address, mnemonic, op_str))

0x1000: ldrb r4, [r0, #5]

1
  • will is cause a problem if I change 0x1000 to 0x0000?
    – Anthony
    May 16 '16 at 13:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.