Skip to content

Instantly share code, notes, and snippets.

@bytehow
Created October 4, 2020 04:33
Show Gist options
  • Save bytehow/d7b36a46bb4ece2d95d7bb16bb84915b to your computer and use it in GitHub Desktop.
Save bytehow/d7b36a46bb4ece2d95d7bb16bb84915b to your computer and use it in GitHub Desktop.
A bash script to run a python Ghidra script from the command line
#!/bin/bash
GHIDRA_DIR=/path/to/Ghidra
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
PROJECT_DIR=/path/to/project
PROJECT=<project name>
FILE=<file within project>
SCRIPT=<script path in relation to this script's dir>
$GHIDRA_DIR/support/analyzeHeadless $PROJECT_DIR \
$PROJECT \
-noanalysis \
-process $FILE \
-scriptPath $DIR \
-postscript $SCRIPT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment