Radare2

A framework for disassembling, inspecting and patching binaries

About

Radare2 is a set of tools for taking binaries apart. Disassemble code, inspect data, patch bytes. Reach for it to understand a compiled program without its source.

Install it

pkg install radare2

Run this inside Termux. If the package is already present, pkg will say so and do nothing.

Commands worth knowing

6 of the invocations you will actually reach for. Tap the copy button to put one on your clipboard.

r2 program Open a binary for analysis. You land in an interactive prompt where the rest of these commands are typed.
r2 -A program Open a binary and run automatic analysis at once. Functions and symbols get named for you.
r2 -d program Open a binary in debug mode, so you can step through it as it runs.
r2 -w program Open a binary in write mode. You need this before changing any bytes.
r2 -q -c iz program Run a single command against a binary, then quit. Here, list the readable text it holds.
r2 -q -c pdf main program Disassemble one named function and exit. Read a routine without staying in the shell.

Worked example

Run r2 -q -c iI program and this is what you should see.

termux
$ r2 -q -c iI program
arch     arm
bits     64
os       linux
endian   little
machine  AArch64

The header tells you the target architecture and platform.

Developed by

The Radare2 developers .