0

So, I am looking for disassembler code for MIPS commands, for example: if the program gets word of command like 3c1d8010, I want to get the name of the command and the registers, which it uses: lui sp,0x8010

examples: 25080268 addiu t0,t0,616 40806800 mtc0 zero,$13

I know, that it is possible to write by myself, but maybe somebody has done it already.

Many thanks in advance!

  • 1
    I typed your title into Google, and while the first hit was a commercial product, the second one has the description "mips-dasm is a mips disassembler written in C. It accepts lines of 32-bit numbers that it decodes into their MIPS32 instruction equivalent, through stdin or input file.". On github, so free & with source. – usr2564301 Oct 7 '16 at 14:46
3

Try capstone. They have a good documentation with samples like the following:

 # test1.py
 from capstone import *

 CODE = b"\x55\x48\x8b\x05\xb8\x13\x00\x00"

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

Output sample:

$ python test1.py

0x1000: push    rbp
0x1001: mov rax, qword ptr [rip + 0x13b8]

According to the docs they support MIPS and of course they have code on GitHub.

| improve this answer | |
3

If you want to have quick access without installing anything, try The online disassembler.

| improve this answer | |
1

you can try radare2

E:\R2>rasm2.exe -a mips -e -d -
25080268
addiu t0, t0, 0x268
40806800
mtc0 zero, t5, 0

use mips.gnu to get the output you queried

E:\R2>rasm2.exe -a mips.gnu -e -d -
25080268
addiu t0, t0, 616
40806800
mtc0 zero, $13

rasm2 -h should show the switches

-a = arch (use -L to list the numerous architectures it supports)
-e = to tell that the input is Big-Endian
-d = Disassemble 
-  = to provide input from Stdin
| improve this answer | |

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.