init
This commit is contained in:
Executable
+31
@@ -0,0 +1,31 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
workspace_dir=$(pwd -P)
|
||||
ghidra_install_dir=${GHIDRA_INSTALL_DIR:-/opt/ghidra}
|
||||
headless_analyzer="$ghidra_install_dir/support/analyzeHeadless"
|
||||
script_dir="$workspace_dir/tools"
|
||||
project_dir=$(mktemp -d /tmp/tdkpin-ghidra.XXXXXX)
|
||||
|
||||
if [[ ! -x "$headless_analyzer" ]]; then
|
||||
echo "Ghidra headless analyzer not found at: $headless_analyzer" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
"$headless_analyzer" "$project_dir" tdkpin \
|
||||
-import "$workspace_dir/TDKPIN.EXE" \
|
||||
-analysisTimeoutPerFile 900 \
|
||||
-max-cpu 8
|
||||
|
||||
"$headless_analyzer" "$project_dir" tdkpin \
|
||||
-process TDKPIN.EXE \
|
||||
-noanalysis \
|
||||
-scriptPath "$script_dir" \
|
||||
-preScript SeedMissingEntrypoints.java \
|
||||
-postScript ExportDecompilation.java \
|
||||
"$workspace_dir/TDKPIN_GHIDRA_RAW.c" \
|
||||
"$workspace_dir/FUNCTIONS.tsv" \
|
||||
-postScript AuditCoverage.java \
|
||||
"$workspace_dir/COVERAGE.tsv"
|
||||
|
||||
echo "Ghidra project retained at: $project_dir"
|
||||
Reference in New Issue
Block a user