AutoScripting is a Ghidra extension that runs a target script automatically when a program is opened. By default, it executes Autoscript.py from the ~/ghidra_scripts directory. The extension content exists inside Ghidra_Autoscripting_Extension.
- The
AutoStartPluginlistens for program-open events. - The first time a program is opened in a session, the plugin loads and runs
Autoscript.pyfrom~/ghidra_scripts. - If the same program is reopened in the same session, the script will not rerun unless the program is closed first.
- Ghidra 11.4.2 (or a compatible version you specify)
- Java (required by Ghidra)
- Gradle (or use the Gradle wrapper if you add one later)
You must point the build to your local Ghidra installation.
Option 1: Set an environment variable:
export GHIDRA_INSTALL_DIR=/path/to/ghidraOption 2: Edit gradle.properties and set:
GHIDRA_INSTALL_DIR=/path/to/ghidraIf your Ghidra version differs, update the version field in extension.properties to match your Ghidra version.
From the project root:
gradle buildExtensionThis produces a zip in dist/ (for example, dist/AutoScripting.zip).
- Open Ghidra.
- Go to File > Install Extensions.
- Click + and select the generated zip from
dist/. - Restart Ghidra when prompted.
- Open File > Configure and enable the AutoScript plugin under Scripting if it is not already enabled.
Place your script at:
~/ghidra_scripts/Autoscript.py
Notes:
- The filename must be exactly
Autoscript.py. - The script runs each time a program is opened (once per program per session).
- If the build fails, confirm
GHIDRA_INSTALL_DIRis set correctly. - If the plugin does not appear, verify the
versionfield in extension.properties matches your Ghidra version. - If the script does not run, check that
Autoscript.pyexists in~/ghidra_scripts.
build.gradle
extension.properties
gradle.properties
settings.gradle
src/main/java/autoscript/AutoStartPlugin.java