╭─────────────────────────────────╮
│ ,______ .______ .______ ,___ │
╭──╮ │ : __ \ \____ |: \ : __| │
│ _│_ │ | \____|/ ____|| _,_ || : | │
│ 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-3-7-sonnet-20250219
r2ai -e max_tokens=64000