来源:chatgpt
1. Radare2
一个 unix 命令行的逆向工具,支持很多的插件,如果要搞 c++ 反编译,需要先安装 r2ghidra
插件
官网地址:git@github.com:radareorg/radare2.git
最好使用源码安装,否则在安装插件 r2ghidra
的时候,会报错无法找到 r_core
。
clone 源码后,使用脚本 sys/python.sh
进行安装。(https://github.com/radareorg/radare2/issues/1943)
需要安装的依赖:
apt install build-essential libxxhash-dev make cmake pkg-config
反编译 c++
安装插件 r2ghidra
r2pm -ci r2ghidra
使用方式
$ r2 -A /bin/ls # open file in read-only
> aaa # analyse the program (r2 -A)
> afl # list all functions (try aflt, aflm)
> px 32 # print 32 byte hexdump current block
> s sym.main # seek to main (using flag name)
> f~foo # filter flags matching 'foo' (internal |grep)
> iS;is # list sections and symbols (rabin2 -Ss)
> pdf; agf # disassembly and ascii-art function graph
> oo+;w hello # reopen in read-write and write a string
> ?*~... # interactive filter in all command help
> q # quit
aa
会分析所有函数。afr
会重新分析所有函数。afl
列出所有分析的函数。
导出反编译的代码
pdg @main > main_decompiled.c
插件管理命令
r2pm -s <word> # search packages matching a word
r2pm -Uci <pkg> # update database and clean install a package
r2pm -u <pkg> # uninstall the given package
r2pm -l <pkg> # list installed packages