Ghidra plugin to communicate with radare2
74
stars
108
commits
Java
primary language
Nov 24, 2025
updated
R4Ghidra provides a standalone radare2 experience inside Ghidra, implemented fully in Java but powered by Ghidra's APIs internally. This plugin allows users to communicate from/to radare2 instances via r2web and r2pipe protocols.
R4Ghidra supports not just the most common radare2 commands, but also all the handy command tricks you can do with r2 oneliners, including pipes, redirects, iterations, command substitution, file operations and more. The plugin features a complete REPL (Read-Eval-Print Loop) implementation that faithfully reproduces the radare2 command line experience within Ghidra.
Please use the Issue tracker for feedback and bug reports!
#
To build the plugin, simply run:
make
The extension .zip will be created in dist/ directory. You can also download pre-built releases from the release page.
To install that extension just run make install and that will remove the current r4ghidra plugin in your detected Ghidra installation and place the last build into the ghidra Extensions directory. And you will only need to follow these simple steps:
File->Install ExtensionsTools->R4Ghidra menughidraRun will start in background mode by default, you must edit the script to replace "bg" with "fg" to see backtraces and other startup debugging logs.
sudo apt install openjdk-21-jdk:amd64
sudo snap install ghidra --edge
sudo snap install gradle --edge --classic
make
A Run Configuration is provided for IntelliJ IDEA. To make it work you should:
GHIDRA_INSTALL_DIR environment variable set to your Ghidra release (not source!) directory.GHIDRA_INSTALL_DIR Path Variable under File->Settings->Path Variables.If everything is set up correctly IDEA should recognize the Gradle project and load external dependencies referenced by the Run Configuration from the referenced Ghidra directory. If everything is right you should see that Use classpath of module is set to -cp R4Ghidra.main in the Run Configuration GUI, and no errors are shown. You'll get a ClassNotFoundException when trying to use the Run Configuration if external dependencies were not discovered as expected.
File->Install Extensionsdist/ directory or downloaded from the release pageIf the configuration option is not offered after restart, you can manually enable the plugin:
File->Configure menu itemFile->Install ExtensionsThe plugin registers a new menu item under the Tools menu of Ghidra's Code Browser to start/stop the embedded web server. Once started, you can:
The Python script provided in the ghidra_scripts directory initializes the R4Ghidra server on port 9191 by default. You can change the port by setting the R4GHIDRA_PORT environment variable (or R2WEB_PORT for backward compatibility). You should provide this script as -postScript when launching headless Ghidra:
./support/analyzeHeadless /path/to/project-dir project-name \
-process binary_name -postScript /path/to/r4ghidra_headless.py
Note: The older script name r2web_headless.py is still available for backward compatibility.
R4Ghidra implements a complete radare2 REPL with support for:
For more detailed information about the REPL implementation and supported features, see the REPL documentation in the source code.
Java
97.3%
Ghidra plugin to communicate with radare2
74
stars
108
commits
Java
primary language
Nov 24, 2025
updated
R4Ghidra provides a standalone radare2 experience inside Ghidra, implemented fully in Java but powered by Ghidra's APIs internally. This plugin allows users to communicate from/to radare2 instances via r2web and r2pipe protocols.
R4Ghidra supports not just the most common radare2 commands, but also all the handy command tricks you can do with r2 oneliners, including pipes, redirects, iterations, command substitution, file operations and more. The plugin features a complete REPL (Read-Eval-Print Loop) implementation that faithfully reproduces the radare2 command line experience within Ghidra.
Please use the Issue tracker for feedback and bug reports!
#
To build the plugin, simply run:
make
The extension .zip will be created in dist/ directory. You can also download pre-built releases from the release page.
To install that extension just run make install and that will remove the current r4ghidra plugin in your detected Ghidra installation and place the last build into the ghidra Extensions directory. And you will only need to follow these simple steps:
File->Install ExtensionsTools->R4Ghidra menughidraRun will start in background mode by default, you must edit the script to replace "bg" with "fg" to see backtraces and other startup debugging logs.
sudo apt install openjdk-21-jdk:amd64
sudo snap install ghidra --edge
sudo snap install gradle --edge --classic
make
A Run Configuration is provided for IntelliJ IDEA. To make it work you should:
GHIDRA_INSTALL_DIR environment variable set to your Ghidra release (not source!) directory.GHIDRA_INSTALL_DIR Path Variable under File->Settings->Path Variables.If everything is set up correctly IDEA should recognize the Gradle project and load external dependencies referenced by the Run Configuration from the referenced Ghidra directory. If everything is right you should see that Use classpath of module is set to -cp R4Ghidra.main in the Run Configuration GUI, and no errors are shown. You'll get a ClassNotFoundException when trying to use the Run Configuration if external dependencies were not discovered as expected.
File->Install Extensionsdist/ directory or downloaded from the release pageIf the configuration option is not offered after restart, you can manually enable the plugin:
File->Configure menu itemFile->Install ExtensionsThe plugin registers a new menu item under the Tools menu of Ghidra's Code Browser to start/stop the embedded web server. Once started, you can:
The Python script provided in the ghidra_scripts directory initializes the R4Ghidra server on port 9191 by default. You can change the port by setting the R4GHIDRA_PORT environment variable (or R2WEB_PORT for backward compatibility). You should provide this script as -postScript when launching headless Ghidra:
./support/analyzeHeadless /path/to/project-dir project-name \
-process binary_name -postScript /path/to/r4ghidra_headless.py
Note: The older script name r2web_headless.py is still available for backward compatibility.
R4Ghidra implements a complete radare2 REPL with support for:
For more detailed information about the REPL implementation and supported features, see the REPL documentation in the source code.
Java
97.3%