Radare2 是什么?

A free/libre toolchain for easing several low level tasks like forensics, software reverse engineering, exploiting, debugging, …
It is composed by a bunch of libraries (which are extended with plugins) and programs that can be automated with almost any programming language.
[

](https://blog.csdn.net/weixin_40732417/article/details/105586107)

Radare2 介绍

官网:https://www.radare.org/n/radare2.html

特征

  • 批处理、命令线、可视和面板交互模式
  • 嵌入式网络服务器与js脚本和webui
  • 组装和拆卸大量 CPU 列表
  • 在 Windows 上运行,还有任何其他 UNIX 味道
  • 使用 ESIL 分析和模拟代码
  • 本机调试器和 GDB、WINDBG、QNX 和 FRIDA
  • 导航 ascii 技术控制流图
  • 能够修补二进制文件、修改代码或数据
  • 搜索模式、魔法标题、函数签名
  • 易于扩展和修改
  • 命令线,C API,脚本与r2管道在任何语言

如何安装 Radare2?

  • Radare2:核心部件
  • Cutter: R2的图形化前端,使用Qt。当然你也可以使用r2-agent打开WebUI。

安装

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

pip安装

pip install r2env
r2env init
r2env add radare2@git
  • rabin2->查看文件格式的
  • radiff2->比较文件不同的
  • rahash2->各种密码算法,hash算法集成
  • rasm2->汇编和反汇编
  • ragg2->开发shellcode工具(radare2自己编写的编译器)
  • radare2->整合了所有工具

使用

$ r2 /bin/ls   # open the binary in read-only mode
> aaa          # same as r2 -A, analyse the binary
> afl          # list all functions (try aflt, aflm)
> px 32        # print 32 byte hexdump current block
> s sym.main   # seek to the given offset (by flag name, number, ..)
> f~foo        # filter flags with ~grep (same as |grep)
> iS;is        # list sections and symbols (same as rabin2 -Ss)
> pdf; agf     # print function and show control-flow-graph in ascii-art
> oo+;w hello  # reopen in rw mode and write a string in the current offset
> ?*~...       # interactive filter all command help messages
> q            # quit