diff --git a/CLAUDE.md b/CLAUDE.md index 8586cff..84da884 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -37,7 +37,7 @@ Early stage. What exists: a single image (`Dockerfile`, `launch-apps.sh`) with C ## Architecture -- **Claude Desktop and Ghidra share one container** (the root `Dockerfile`, started by `run.sh`), at the user's request. Ghidra is the official GitHub release (version, build date and SHA-256 are build args), runs on Ubuntu's `openjdk-25-jdk`, lives in `/opt/ghidra` and starts together with Claude Desktop. Further services such as the RE MCP server may still get their own containers. +- **Claude Desktop and Ghidra share one container** (the root `Dockerfile`, started by `run.sh`), at the user's request. Ghidra is the official GitHub release (version, build date and SHA-256 are build args), runs on Ubuntu's `openjdk-25-jdk`, lives in `/opt/ghidra` and starts together with Claude Desktop. The CodeBrowser has the **Developer** plugin package enabled: the build patches `defaultTools/CodeBrowser.tool` inside `Public_Release.jar` (user settings reset every start, so patching user config wouldn't stick). Further services such as the RE MCP server may still get their own containers. - **Shared workspace volume.** Every container mounts the workspace at `/workspace`, so a file path means the same thing to Claude, Ghidra and the RE MCP. `run.sh` asks for the host folder on each start in the desktop's folder picker (`zenity`, or `kdialog` on KDE; terminal prompt if neither exists), opening at the last folder used, else `./workspace`. Skip it with `--workspace DIR` or `WORKSPACE=DIR`. It refuses `/` and `$HOME`. The image symlinks `~/workspace` to `/workspace` for Claude Desktop's file picker. - **GUI forwarding.** Claude Desktop and Ghidra are GUI apps. Default to X11 forwarding (`/tmp/.X11-unix` + `DISPLAY`). Support Wayland through XWayland. Keep a noVNC/VNC fallback in mind for headless hosts. Never solve display access with a blanket `xhost +`. Scope it (`xhost +local:docker` or `+SI:localuser:...`). - **GhidraMCP wiring.** GhidraMCP has two parts: diff --git a/Dockerfile b/Dockerfile index 068a4e1..ba8bc15 100644 --- a/Dockerfile +++ b/Dockerfile @@ -52,6 +52,19 @@ RUN apt-get update \ && ln -s /opt/ghidra/ghidraRun /usr/local/bin/ghidra ENV GHIDRA_INSTALL_DIR=/opt/ghidra +# Enable the "Developer" plugin package (File > Configure > Developer) in the +# CodeBrowser. Ghidra copies its default tools into the user's settings on +# first start, and settings are reset on every container start, so the +# default CodeBrowser.tool inside the jar is patched instead of user config. +# The build fails if the line could not be inserted. +RUN set -e; cd /tmp \ + && jar_file=/opt/ghidra/Ghidra/Configurations/Public_Release/lib/Public_Release.jar \ + && unzip -q "$jar_file" defaultTools/CodeBrowser.tool \ + && sed -i '0,/\n ' defaultTools/CodeBrowser.tool \ + && jar uf "$jar_file" defaultTools/CodeBrowser.tool \ + && rm -r /tmp/defaultTools + # Ubuntu 24.04 ships a default "ubuntu" user on UID 1000; replace it. RUN if id ubuntu >/dev/null 2>&1; then userdel -r ubuntu; fi \ && groupadd -g "${USER_GID}" "${USER_NAME}" \