Headless analysis
Headless mode runs without CodeBrowser. It can create projects, import files, process existing programs, and execute non-GUI scripts. It is a batch analyzer, not an HTTP API.
Analyze a controlled sample
Section titled “Analyze a controlled sample”From an extracted upstream installation on Linux/macOS:
mkdir -p ./test-projects./support/analyzeHeadless ./test-projects Demo \ -import ./samples/hello \ -analysisTimeoutPerFile 120 \ -log ./analysis.logThe Windows launcher is support\analyzeHeadless.bat; adapt shell quoting and paths. Use a project that is not open in the GUI.
Run your script after analysis
Section titled “Run your script after analysis”./support/analyzeHeadless ./test-projects Demo \ -process hello \ -scriptPath ./scripts \ -postScript MyReport.java \ -scriptlog ./script.logMyReport.java is your script, not a bundled command. -postScript accepts its filename; the directory belongs in -scriptPath. -import and -process cannot be combined in one invocation.
Keep batch results reproducible
Section titled “Keep batch results reproducible”Record sample hashes, version, import settings, script revision, logs, and analysis timeout. Inspect failures and timeouts before using generated reports. Use -readOnly where its documented semantics fit your workflow; read the pinned manual before using overwrite or deletion options.
Source: Headless Analyzer README.
Adapted from the Ghidra documentation (Apache 2.0).