Radare2 - Unix-Like Contrary Engineering Framework Together With Commandline Tools Security


r2 is a rewrite from scratch of radare inward lodge to furnish a laid of libraries too tools to piece of job amongst binary files.
Radare projection started every bit a forensics tool, a scriptable command-line hexadecimal editor able to opened upwards disk files, but afterward added back upwards for analyzing binaries, disassembling code, debugging programs, attaching to remote gdb servers...
radare2 is portable.

Architectures
i386, x86-64, ARM, MIPS, PowerPC, SPARC, RISC-V, SH, m68k, AVR, XAP, System Z, XCore, CR16, HPPA, ARC, Blackfin, Z80, H8/300, V810, V850, CRIS, XAP, PIC, LM32, 8051, 6502, i4004, i8080, Propeller, Tricore, Chip8 LH5801, T8200, GameBoy, SNES, MSP430, Xtensa, NIOS II, Dalvik, WebAssembly, MSIL, EBC, TMS320 (c54x, c55x, c55+, c66), Hexagon, Brainfuck, Malbolge, DCPU16.

File Formats
ELF, Mach-O, Fatmach-O, PE, PE+, MZ, COFF, OMF, TE, XBE, BIOS/UEFI, Dyldcache, DEX, ART, CGC, Java class, Android kicking image, Plan9 executable, ZIMG, MBN/SBL bootloader, ELF coredump, MDMP (Windows minidump), WASM (WebAssembly binary), Commodore VICE emulator, Game Boy (Advance), Nintendo DS ROMs too Nintendo 3DS FIRMs, diverse filesystems.

Operating Systems
Windows (since XP), GNU/Linux, OS X, [Net|Free|Open]BSD, Android, iOS, OSX, QNX, Solaris, Haiku, FirefoxOS.

Bindings
Vala/Genie, Python (2, 3), NodeJS, Lua, Go, Perl, Guile, PHP, Newlisp, Ruby, Java, OCaml...

Dependencies
radare2 tin endure built without whatsoever exceptional dependency, exactly acquire a working toolchain (gcc, clang, tcc...) too utilization make.
Optionally you lot tin utilization libewf for loading EnCase disk images.
To create the bindings you lot demand latest valabind, g++ too swig2.

Install
The easiest means to install radare2 from git is yesteryear running the next command:
$ sys/install.sh
If you lot desire to install radare2 inward the dwelling identify directory without using root privileges too sudo, only run:
$ sys/user.sh

Building amongst meson + ninja
If you lot don't already accept meson too ninja, you lot tin install them amongst your distribution parcel manager or amongst r2pm:
$ r2pm -i meson
If you lot already accept them installed, you lot tin run this business to compile radare2:
$ python ./sys/meson.py --prefix=/usr --shared --install
This method is to a greater extent than oft than non useful on Windows because the initial edifice amongst Makefile is non suitable. If you lot are lost inward whatsoever way, exactly type:
$ python ./sys/meson.py --help

Update
To update Radare2 system-wide, you lot don't demand to uninstall or pull. Just re-run:
$ sys/install.sh
If you lot installed Radare2 inward the dwelling identify directory, exactly re-run:
$ sys/user.sh

Uninstall
In instance of a polluted filesystem, you lot tin uninstall the electrical current version or take all previous installations:
$ brand uninstall $ brand purge
To take all materials including libraries, use
$ brand system-purge

Package manager
Radare2 has its ain parcel manager - r2pm. Its packages repository is on GitHub too. To start to using it for the offset time, you lot demand to initialize packages:
$ r2pm init
Refresh the packages database earlier installing whatsoever package:
$ r2pm update
To install a package, utilization the next command:
$ r2pm install [package name]

Bindings
All linguistic communication bindings are nether the r2-bindings directory. You volition demand to install swig too valabind inward lodge to create the bindings for Python, Lua, etc..
APIs are defined inward vapi files which are too thence translated to swig interfaces, nodejs-ffi or other too and thence compiled.
The easiest means to install the python bindings is to run:
$ r2pm install lang-python2 #lang-python3 for python3 bindings $ r2pm install r2api-python $ r2pm install r2pipe-py
In improver at that spot are r2pipe bindings, which is an API interface to interact amongst the prompt, passing commands too receivent the output every bit a string, many commands back upwards JSON output, thence its integrated easily amongst many languages inward lodge to deserialize it into native objects.
$ npm install r2pipe   # NodeJS $ precious rock install r2pipe   # Ruby $ pip install r2pipe   # Python $ opam install radare2 # OCaml
And also for Go, Rust, Swift, D, .NET, Java, NewLisp, Perl, Haskell, Vala, OCaml, too many to a greater extent than to come!

Regression Testsuite
Running make tests volition fetch the radare2-regressions repository too run all the tests inward lodge to verify that no changes interruption whatsoever functionality.
We run those tests on every commit, too they are also executed amongst ASAN too valgrind on unlike platforms to choose grip of other unwanted 'features'.

Documentation
There is no formal documentation of r2 yet. Not all commands are compatible amongst radare1, thence the best means to acquire how to practise materials inward r2 is yesteryear reading the examples from the spider web too appending '?' to every ascendancy you lot are interested in.
Commands are modest mnemonics of few characters too at that spot is about extra syntax saccharide that makes the compaction much to a greater extent than pleasant for scripting too interacting amongst the APIs.
You could also checkout the radare2 book.

Webserver
radare2 comes amongst an embedded webserver which serves a pure html/js interface that sends ajax queries to the substance too aims to implement an usable UI for phones, tablets too desktops.
$ r2 -c=H /bin/ls
To utilization the webserver on Windows, you lot require a cmd instance amongst administrator rights. To start the webserver, utilization the next ascendancy inward the projection root.
> radare2.exe -c=H rax2.exe

Pointers
Website: https://www.radare.org/
IRC: irc.freenode.net #radare
Telegram: https://t.me/radare
Matrix: @radare2:matrix.org
Twitter: @radareorg