Open spatti33 opened 3 days ago
Care to share your Dockerfile
and your command-line?
I have never actually tried this out myself and neither have I tried Ghidra's headless mode with BinExport.
Dockerfile:
FROM ubuntu:22.04.2
ARG DEBIAN_FRONTEND=noninteractive
RUN apt -y update && apt -y upgrade
RUN apt -y -qq install python3 python3-pip build-essential tshark zip vim nano pkg-config python3-dev openjdk-21-jdk
COPY ./ghidra /ghidra
COPY ./.ghidra /home/user/.ghidra
RUN pip3 install --no-cache-dir --upgrade pip
RUN pip3 install --no-cache-dir python_bindiff-0.2.3-py3-none-any.whl python_binexport-0.3.5-py3-none-any.whl
Command line:
/ghidra/support/analyzeHeadless /home/user/project MyProject -import /home/user/project/program1 -processor "x86:LE:64:default" -cspec gcc -loader ElfLoader -scriptPath /home/user/project -postScript export_script.py -deleteProject
Export Script:
from com.google.security.binexport import BinExportExporter
from java.io import File
exporter = BinExportExporter()
exporter.export(File(currentProgram.getName() + ".BinExport"), currentProgram, currentProgram.getMemory(), monitor)
Thanks. Maybe try with a less recent JDK version? I think Ghidra is still on JDK 17.
Other than that, I don't see anthing out of the ordinary in your Dockerfile
.
I tried with 17 through to 21 and same result, thanks for looking though!
I am running ghidra in a docker container so I can use the headless analyzer in a pipeline. I have installed the binexport extension in ghidra and am running a custom post script with the headless analyzer to export the file as a .BinExport file. I developed this on my host machine (Ubuntu 22.04 with jdk 21) where it worked perfectly and made the docker container with the same dependencies and OS version.
However, when I run this on the docker container, the analysis succeeds but it is unable to export the .BinExport file and I get the following error:
I cannot find what is causing this issue or why it is only an issue when I run this workflow in the docker container. Any insight or suggestions would be appreciated!