Skip to content

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.

From an extracted upstream installation on Linux/macOS:

Terminal window
mkdir -p ./test-projects
./support/analyzeHeadless ./test-projects Demo \
-import ./samples/hello \
-analysisTimeoutPerFile 120 \
-log ./analysis.log

The Windows launcher is support\analyzeHeadless.bat; adapt shell quoting and paths. Use a project that is not open in the GUI.

Terminal window
./support/analyzeHeadless ./test-projects Demo \
-process hello \
-scriptPath ./scripts \
-postScript MyReport.java \
-scriptlog ./script.log

MyReport.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.

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).