radareorg/r2ai

LLM-based reversing for radare2

What it solves

Reverse engineering binary code is often slow and tedious, requiring manual reading of disassembly and guesswork about function purposes. R2AI brings large language models directly into the radare2 console, so you can ask for explanations, spot vulnerabilities, rename functions, and get decompilation help without leaving your workflow.

How it works

R2AI is a plugin that adds an r2ai command to radare2's shell. You can chat interactively (REPL), run it in batch mode, or script it via r2pipe. It connects to many LLM providers—local ones like Ollama, or remote ones like OpenAI, Anthropic, and Grok. It also includes a vector database for retrieval-augmented generation (RAG), letting you index markdown, code, or text files and query them. The plugin can even take the output of any radare2 command and use it as context for answering questions about the current binary.

Who it's for

Reverse engineers, malware analysts, CTF players, and anyone using radare2 for binary analysis who wants AI assistance to speed up code understanding and vulnerability hunting.

Highlights

  • Define custom roles and prompts for different analysis tasks
  • Scriptable via r2pipe for automation
  • Live REPL mode and batch mode from the CLI or radare2 prompt
  • Supports Automatic (ReAct) mode to solve tasks with function calling
  • Works with local and remote language models (Ollama, OpenAI, Grok, Anthropic, ...)
  • RAG over markdown, code, or text files using a native vector database
  • Can embed an r2 command's output and ask questions about that data

Related

  • Project
  • Project
  • Project
  • Project
  • Project