2

I am trying to disassemble a MIPS 32 version 1 binary with the Radare2 framework.

Here is the full output of the file command:

ELF 32-bit LSB executable, MIPS, MIPS32 version 1 (SYSV), dynamically linked, 
interpreter /lib/ld-uClibc.so.0, stripped

1 Answer 1

4

First of all, make sure you run the latest version of radare2 from git repository:

$ git clone https://github.com/radare/radare2.git
$ cd radare2
$ ./sys/install.sh

If you don’t want to install the git version or you want the binaries for another machine (Windows, OS X, iOS, etc) check out the download page at the radare2 website.

To open MIPS binary with radare2, simply use the following command:

radare2 -a mips -b 32 ./file
  • -a arch - set asm.arch (x86, ppc, arm, mips, bf, java, ...)
  • -b bits - set asm.bits (16, 32, 64)

Don't forget to read the manual (man r2), it's all there.

For more relative information you can watch Andrew McDonnell's talk called "Reverse engineering embedded software using radare2" (slides: link).

If you feel that you need more basic information about radare2 and how to use it, I recommend the following sources:

  1. Radare2 Book
  2. Radare2 Explorations
  3. Radare Demystified (Talk)
2
  • Thanks for the response Megabeets but my system can run MIPS code and I don't have qemu installed. Wouldn't that command (radare2 -a mips -b 32 ./file) try to run the file because of the ./? Commented Aug 17, 2017 at 0:12
  • The command will not execute the file. In order to execute the file (i.e open it in debug mode) you need to pass the -d flag to radare. The command mentioned before will open the binary in read-only mode and will help you to conduct static analysis. The prepended "./" just means that the file is in the current folder. You can avoid it and simply call it with r2 -a mips -b 32 filename
    – Megabeets
    Commented Aug 17, 2017 at 4:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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