Radare2 AI 插件,使用本地或远程 LLM 进行反编译、函数解释、漏洞检测、重命名和脚本化逆向工程。
╭─────────────────────────────────╮
│ ,______ .______ .______ ,___ │
╭──╮ │ : __ \ \____ |: \ : __| │
│ _│_ │ | \____|/ ____|| _,_ || : | │
│ O O < | : \ \ . || : || | │
│ │╷ │ | |___\ \__:__||___| || | │
│ ││ │ |___| : |___||___| │
│ ─╯│ ╰─────────────────────────────────╯
╰───╯
本仓库包含两个 radare2 插件:
如果你希望通过 MCP 将 radare2 与其他智能体配合使用:
如果你在寻找专注于 radare2 的自主智能体:
[0x00000000]> r2ai -q
explain: Explain the current function -
devices: Find and explain devices used -
libs: Group imports by Libraries -
varnames: Better variable names -
autoname: Automatically suggest a better name for this function -
vulns: Find vulnerabilities or bugs in the current function -
signature: Suggest an improved function signature -
dlopen: List libraries loaded with dlopen - Some libraries are loaded
decompile: Augmented decompilation based on LLM -
[0x00000000]>
安装任何 r2ai 组件的推荐方式是通过 r2pm:
$ r2pm -Uci r2ai
$ r2pm -Uci decai
r2 -qc r2air2pm -r r2ai将你的 API 密钥放入环境变量中,或使用配置文件:
$ export ANTHROPIC_API_KEY=sk-ant-api03-CENSORED
$ export OPENAI_API_KEY=sk-proj-6rlSPS-zN1v...
或编辑 API 密钥文件 ~/.config/r2ai/apikeys.txt 并运行:
$ r2ai -K
你可以使用操作系统的默认设置文件(例如 Linux 上的 ~/.radare2rc)来自定义并保存你的配置设置。
例如,以下配置将 Claude 3.7 设为默认模型,并将最大输出 token 数设为 64000。
$ r2ai -E
然后你可以输入在加载 r2ai 插件时要运行的命令:
r2ai -e api=anthropic
r2ai -e model=claude-sonnet-5-5
r2ai -e max_tokens=64000