Skip to content
Back to search

ghidra-headless-mcp

Headless Ghidra MCP server — giving AI agents deep reverse-engineering capabilities.

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/mrphrazer--ghidra-headless-mcp/badge.svg)](/listings/mrphrazer--ghidra-headless-mcp)

HTML

<a href="/listings/mrphrazer--ghidra-headless-mcp"><img src="/api/listings/mrphrazer--ghidra-headless-mcp/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

From the repo root:

python3 -m venv .venv
. .venv/bin/activate
pip install .

For development:

pip install -e ".[dev]"

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 640 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. # Ghidra Headless MCP
  2. A headless [Ghidra](https://ghidra-sre.org/) server that speaks [MCP](https://modelcontextprotocol.io/) (Model Context Protocol), giving AI agents full access to deep reverse-engineering workflows: program lifecycle, disassembly, decompilation, patching, types, xrefs, scripting, and more, without a GUI.
  3. Designed to run in the same Docker container as the agent runtime. No sidecars, no extra services.
  4. This entire project---code, tests, and documentation---is 100% vibe coded.
  5. ## Why
  6. Existing Ghidra automation usually assumes either interactive GUI use or ad hoc scripts with a narrow workflow. This server is headless-only and designed for agent-driven workflows in sandboxed VM/container environments: the agent gets full control over the analysis system, automating large parts of reverse engineering while you interactively discuss and steer the process.
  7. The goal is an interface where agents can inspect, refine, and extend an analysis over time: updating types, symbols, and metadata, improving the analysis database incrementally, applying patches and iterating safely with transactions and undo/redo, and running custom scripts when a workflow needs something bespoke.
  8. ## Features
  9. - **212 tools** across **34 feature groups**: project and program lifecycle, disassembly, decompilation, patching, transactions, types, layouts, memory, search, graph extraction, scripting, and more.
  10. - **Read-only by default** with safe mutation workflows (transactions, undo/redo, explicit save paths).
  11. - **Scripting access** via `ghidra.eval`, `ghidra.call`, and `ghidra.script` for anything the tool catalog doesn't cover.
  12. - **Stdio and TCP transports.**
  13. - **Real `pyghidra` backend** for live headless Ghidra workflows.
  14. - **Fake backend mode** for CI and development without a Ghidra install.
  15. ## Prerequisites
  16. - Python `3.11+`
  17. - A [Ghidra](https://ghidra-sre.org/) installation plus `pyghidra` in your runtime (for real analysis)
  18. - For CI/development without Ghidra, use fake backend mode
  19. ## Installation
  20. From the repo root:
  21. ```bash
  22. python3 -m venv .venv
  23. . .venv/bin/activate
  24. pip install .
  25. ```
  26. For development:
  27. ```bash
  28. pip install -e ".[dev]"
  29. ```
  30. ## Quick Start
  31. Stdio transport (default):
  32. ```bash
  33. GHIDRA_INSTALL_DIR=/ABSOLUTE/PATH/TO/ghidra python3 ghidra_headless_mcp.py
  34. ```
  35. TCP transport:
  36. ```bash
  37. GHIDRA_INSTALL_DIR=/ABSOLUTE/PATH/TO/ghidra python3 ghidra_headless_mcp.py --transport tcp --host 127.0.0.1 --port 8765
  38. ```
  39. Fake backend mode (no Ghidra required):
  40. ```bash
  41. python3 ghidra_headless_mcp.py --fake-backend
  42. ```
  43. Installed console script:
  44. ```bash
  45. ghidra-headless-mcp --version
  46. ```
  47. ## Use With AI Agents
  48. This server speaks standard MCP over `stdio` (default) or `tcp`, so any MCP-capable agent host can use it.
  49. ### Claude Code
  50. ```bash
  51. claude mcp add ghidra_headless_mcp -- python3 /path/to/ghidra-headless-mcp/ghidra_headless_mcp.py --ghidra-install-dir /ABSOLUTE/PATH/TO/ghidra
  52. ```
  53. Or add it to your project's `.mcp.json`:
  54. ```json
  55. {
  56. "mcpServers": {
  57. "ghidra_headless_mcp": {
  58. "command": "python3",
  59. "args": [
  60. "ghidra_headless_mcp.py",
  61. "--ghidra-install-dir",
  62. "/ABSOLUTE/PATH/TO/ghidra"
  63. ],
  64. "cwd": "/path/to/ghidra-headless-mcp"
  65. }
  66. }
  67. }
  68. ```
  69. For fake mode, append `--fake-backend` and omit the install dir.
  70. ### Codex
  71. ```bash
  72. codex mcp add ghidra_headless_mcp -- python3 ghidra_headless_mcp.py --ghidra-install-dir /ABSOLUTE/PATH/TO/ghidra
  73. ```
  74. ### Generic MCP Host
  75. - Register a server named `ghidra_headless_mcp`.
  76. - Use command `python3` with args `["ghidra_headless_mcp.py", "--ghidra-install-dir", "/ABSOLUTE/PATH/TO/ghidra"]` when `cwd` is the repo root, or use an absolute script path in `args`.
  77. - Set `cwd` to the repo path if you want relative paths like `samples/ls` to resolve correctly.
  78. - Use stdio transport unless your host requires TCP.
  79. - For fake mode (no Ghidra installed), append `--fake-backend`.
  80. - Verify connectivity by calling `health.ping`, then `program.open`.
  81. ## Docker Co-Location Pattern
  82. Recommended deployment model: run the agent process and this MCP server in the same container image.
  83. Example baseline:
  84. ```dockerfile
  85. FROM kalilinux/kali-rolling:latest
  86. RUN apt-get update && apt-get install -y --no-install-recommends \
  87. python3 python3-pip ghidra
  88. WORKDIR /app
  89. COPY . /app
  90. RUN python3 -m pip install --upgrade pip --break-system-packages \
  91. && python3 -m pip install ".[dev]" --break-system-packages
  92. CMD ["python3", "ghidra_headless_mcp.py", "--fake-backend"]
  93. ```
  94. If you need real Ghidra analysis in-container, keep Ghidra installed in that same image and set `GHIDRA_INSTALL_DIR` or pass `--ghidra-install-dir`.
  95. ## MCP Methods
  96. - `initialize`
  97. - `ping`
  98. - `tools/list`
  99. - `tools/call`
  100. - `shutdown`
  101. `tools/list` behavior:
  102. - Without explicit pagination params, returns the full tool catalog.
  103. - If `offset` or `limit` is provided, uses paginated output (`offset=0`, `limit=50` default in paged mode).
  104. - Supports filtering via:
  105. - `prefix` (for example `program.`)
  106. - `query` (substring match against tool name/description)
  107. - Returns pagination metadata: `offset`, `limit`, `total`, `has_more`.
  108. - When a page is truncated (`has_more=true`), includes `next_offset` and a `notice` hint.
  109. Tool call response behavior:
  110. - `structuredContent` is the canonical full payload.
  111. - `content[0].text` is a compact summary string (not full JSON duplication).
  112. - This split is intentional to keep context usage smaller while still exposing full machine-readable data.
  113. ## Quality And Testing
  114. This repository is well tested and has enforced quality gates.
  115. - Test suite: run `pytest --collect-only -q` for the current collected test count.
  116. - CI workflow enforces:
  117. - `ruff format --check .`
  118. - `ruff check .`
  119. - `pytest -m "not live"`
  120. - `pytest -m live`
  121. - clean-copy wheel build and install verification
  122. - Fake backend coverage runs without requiring a Ghidra install.
  123. - Additional structural tests verify tool registry consistency, server behavior, and backend reachability.
  124. ## Command-Line Client (ghidra_cli)
  125. `ghidra_cli` is a native command-line client that exposes **all** of the server's tools to agents
  126. and shells that do not speak the MCP protocol. It is a thin front end over the *same* dispatch code
  127. path as the MCP server, so results are identical to calling the tool over MCP. The tool catalog,
  128. parameters, and types are derived from the server's registry, so the CLI never drifts.
  129. Two execution modes:
  130. - **In-process** (default, no server needed): builds a backend in the CLI process and dispatches
  131. directly. State is ephemeral per invocation — good for stateless calls, CI, and self-contained
  132. `batch` sequences.
  133. - **Remote** (`--connect HOST:PORT`, or a managed background server): a JSON-RPC/TCP client to a
  134. long-lived server, so **session state persists across invocations**. This is the recommended mode
  135. for multi-step reverse engineering and the only practical mode for the real backend (whose JVM
  136. startup is slow).
  137. ### Quick start
  138. ```bash
  139. # No server: one-shot, fake backend
  140. ghidra_cli --fake-backend call health.ping
  141. # Managed background server (persistent sessions), then drive it with plain calls:
  142. ghidra_cli --ghidra-install-dir /ABSOLUTE/PATH/TO/ghidra server start
  143. SID=$(ghidra_cli --field session_id call program.open --path /bin/ls)
  144. ghidra_cli call function.list --session-id "$SID" --limit 20
  145. ghidra_cli --field 'items.0.name' call function.list --session-id "$SID"
  146. ghidra_cli server stop
  147. ```
  148. Once a managed server is running, `call`/`batch`/`raw`/`list` auto-connect to it. You can also point
  149. at any TCP server with `--connect 127.0.0.1:8765` or the `GHIDRA_CLI_CONNECT` env var, and set a
  150. default session with `--session-id` or `GHIDRA_CLI_SESSION`.
  151. ### Verbs
  152. ```
  153. ghidra_cli [GLOBAL OPTS] <verb> ...
  154. call <tool.name> [--param value ...] Invoke one tool.
  155. list | tools [--prefix P] [--query Q] [--offset N] [--limit N] [--names-only]
  156. describe <tool.name> Show description + parameters (type/required/default).
  157. raw <method> [--params JSON | --params-stdin] [--yes] Send arbitrary JSON-RPC (bypasses coercion).
  158. batch [FILE|-] [--continue-on-error] [--no-autosession] [--close-after]
  159. server start|stop|status|restart [--host H] [--port P]
  160. GLOBAL OPTS (before the verb):
  161. --connect HOST:PORT | --fake-backend | --ghidra-install-dir DIR | --in-process | --[no-]deterministic
  162. --session-id ID (default: $GHIDRA_CLI_SESSION)
  163. --raw | --quiet | --field DOTPATH
  164. ```
  165. `list` and `describe` answer locally from the tool registry, so they work without any backend.
  166. `batch` reads a JSONL stream of `{"tool": ..., "arguments": {...}}` and runs it against one
  167. transport in order; the most recent `session_id` is auto-threaded into later lines, making
  168. multi-step workflows possible without a running server.
  169. A complete, agent-oriented command reference listing **all 212 tools** — each with its description
  170. and exact `ghidra_cli call` invocation (parameters, types, defaults) — lives in
  171. [`GHIDRA_CLI.md`](GHIDRA_CLI.md). At runtime, `ghidra_cli list` and `ghidra_cli describe <tool>` are
  172. the always-current equivalents.
  173. ### Passing arguments
  174. Each tool parameter maps to a `--flag`. Values are coerced from the tool's schema:
  175. | Parameter kind | How to pass it |
  176. | --- | --- |
  177. | string | `--name main` |
  178. | integer | `--limit 50`, `--offset 0x10` (accepts `0x`/`0o`/`0b`, else decimal) |
  179. | boolean | `--read-only false` (true/false/yes/no/on/off/1/0), or bare `--read-only` for true |
  180. | number | `--threshold 1.5` |
  181. | address | `--function_start 0x401000` — **passed through as a string** so Ghidra applies its own parsing (a bare-digit address is read as hex). For a decimal integer address use `--function_start:int 4198400`. |
  182. | array | repeat the flag: `--script_args a --script_args b`, or `--values:json '[1,2]'` |
  183. | object | `--kwargs:json '{"k": 1}'` |
  184. Extra controls:
  185. - **Full-args escape:** `--json '{...}'` (or `--json-stdin`) sets the whole arguments object; any
  186. `--flag` overrides individual keys on top of it.
  187. - **Typed overrides:** `--key:TYPE value` with `TYPE` ∈ `str|int|float|bool|json|null`. `--key:null`
  188. sets a JSON `null` (e.g. `variable.comment.set --comment:null` clears a comment).
  189. - **Value sources:** `--code @script.py` reads a file, `--code -` reads stdin — keeps large or
  190. sensitive values out of `argv` (and process listings/shell history).
  191. ### Output and exit codes
  192. Output goes to stdout (diagnostics to stderr): the tool's `structuredContent` as pretty JSON by
  193. default, `--raw` for the full result envelope, `--quiet` for the summary line, or `--field DOTPATH`
  194. to extract one value (e.g. `--field session_id`, `--field items.0.name`).
  195. - exit `0` — success
  196. - exit `1` — the tool ran but reported an error (`isError`)
  197. - exit `2` — usage/client error (unknown tool, bad flag/value, malformed `--json`) or a
  198. connection/transport failure
  199. ### Security
  200. All tools — including `ghidra.eval`, `ghidra.call`, and `ghidra.script`, which run arbitrary
  201. Python/Java/scripts inside the Ghidra runtime — are available with no extra flag, matching the MCP
  202. surface. The TCP/managed server binds `127.0.0.1` only and has **no authentication**: anyone with
  203. localhost access can run arbitrary code through it. Prefer `@file`/stdin value sources for code and
  204. secrets so they never appear in `argv`. `raw shutdown` against a shared server requires `--yes`.
  205. ## Context Controls
  206. - Read-only mode is the default for opened programs (`read_only=true`).
  207. - Raw scripting/API tools reject read-only program sessions unless `write=true`; this guard protects
  208. program-session state but does not sandbox Python, Java, filesystem, or process access.
  209. - Deterministic process-level startup is enabled by default and can be disabled with `--no-deterministic`.
  210. - Many list/search surfaces are paginated with `offset` and `limit`.
  211. ## Limitations
  212. - Debugger-oriented Ghidra workflows are not currently covered.
  213. - Version Tracking, FID, BSim, and emulator workflows are not currently exposed.
  214. ## Security Model
  215. - MCP communication (`stdio`/`tcp`) is unauthenticated by default.
  216. - The server exposes arbitrary scripting via `ghidra.eval` and broad API access via `ghidra.call`.
  217. - This is by design for trusted, containerized agent environments.
  218. - Do not expose this server directly to untrusted users or networks.
  219. ## Local Dev Workflow
  220. ```bash
  221. python3 -m ruff format --check .
  222. python3 -m ruff check .
  223. python3 -m pytest -m "not live"
  224. GHIDRA_INSTALL_DIR=/usr/share/ghidra python3 -m pytest -m live
  225. ```
  226. Release process notes live in `RELEASING.md`. Public GitHub source releases remain blocked until an explicit repository license is chosen.
  227. ## Feature Fuzzer
  228. Use the built-in MCP feature fuzzer to exercise a broad tool surface against `samples/ls`.
  229. Real Ghidra backend:
  230. ```bash
  231. python3 -m ghidra_headless_mcp.fuzzer --backend-mode live --sample-path samples/ls --rounds 1 --seed 1337 --ghidra-install-dir /ABSOLUTE/PATH/TO/ghidra
  232. ```
  233. Fake backend smoke run:
  234. ```bash
  235. python3 -m ghidra_headless_mcp.fuzzer --backend-mode fake --sample-path samples/ls --rounds 2 --limit 40
  236. ```
  237. Target a specific tool family:
  238. ```bash
  239. python3 -m ghidra_headless_mcp.fuzzer --backend-mode live --prefix function. --rounds 2 --fail-fast --ghidra-install-dir /ABSOLUTE/PATH/TO/ghidra
  240. ```
  241. Useful flags:
  242. - `--limit N`: fuzz only the first `N` tools from the selected set.
  243. - `--prefix PREFIX`: restrict fuzzing to one tool family.
  244. - `--rounds N`: run richer optional-argument coverage in later rounds.
  245. - `--fail-fast`: stop on the first failing case.
  246. - `--verbose-results`: include per-case results in CLI JSON output.
  247. ## Feature Catalog
  248. The server currently exposes `212` tools across `34` feature groups. The broader capability matrix by feature family lives in `FEATURE_SUPPORT.md`.
  249. ### Core and Infrastructure
  250. #### analysis
  251. - `analysis.analyzers.list`: List boolean analyzers available for the current program and show whether each one is enabled.
  252. - `analysis.analyzers.set`: Enable or disable a specific boolean analyzer for the current program.
  253. - `analysis.clear_cache`: Clear cached decompiler state for the current session so later requests rebuild it cleanly.
  254. - `analysis.options.get`: Return the current value of a specific analysis option.
  255. - `analysis.options.list`: List available analysis options together with their current values.
  256. - `analysis.options.set`: Update the value of an analysis option for the current session.
  257. - `analysis.status`: Return the current auto-analysis status for the session.
  258. - `analysis.update`: Start auto-analysis in the background and return immediately.
  259. - `analysis.update_and_wait`: Run auto-analysis and wait until it completes.
  260. #### health
  261. - `health.ping`: Confirm that the server is reachable and responding.
  262. #### mcp
  263. - `mcp.response_format`: Explain how MCP tool responses split full structured data and human-readable summary text.
  264. #### task
  265. - `task.analysis_update`: Start auto-analysis as a tracked background task and return a task ID.
  266. - `task.cancel`: Request cancellation for a running or queued asynchronous task.
  267. - `task.result`: Return the terminal result or error payload for a completed task.
  268. - `task.status`: Return status, timing, and cancellation details for an asynchronous task.
  269. ### Project, Program, and Transactions
  270. #### program
  271. - `program.close`: Close an open program session and release its associated resources.
  272. - `program.export_binary`: Export the program to disk as either the original-file format or raw bytes.
  273. - `program.image_base.set`: Change the program image base (applied in memory; `commit` controls whether the change is recorded for undo).
  274. - `program.list_open`: List all program sessions currently held open by the server.
  275. - `program.mode.get`: Return whether a session is currently read-only or read-write.
  276. - `program.mode.set`: Switch a session between read-only and read-write mode.
  277. - `program.open`: Open a binary file for analysis and return a new session.
  278. - `program.open_bytes`: Open a binary from base64-encoded bytes and return a new session.
  279. - `program.report`: Return a compact program report with counts plus sample functions, strings, imports, and memory blocks.
  280. - `program.save`: Save the current program state back into the project.
  281. - `program.save_as`: Save the current program under a new project path or name.
  282. - `program.summary`: Return core program metadata such as architecture, memory layout, and entry point.
  283. #### project
  284. - `project.export`: Export the current Ghidra project artifacts to a destination directory.
  285. - `project.file.info`: Return metadata and state flags for a specific project file.
  286. - `project.files.list`: List project files with folder, content-type, query, and pagination filters.
  287. - `project.folders.list`: List project folders, optionally walking the tree recursively.
  288. - `project.program.open`: Open a program already stored in the current project and return a new session.
  289. - `project.program.open_existing`: Open a program from a named existing Ghidra project and return a new session.
  290. - `project.search.programs`: Search program files in the project by name or path.
  291. #### transaction
  292. - `transaction.begin`: Begin an explicit undo transaction for grouped changes.
  293. - `transaction.commit`: Commit the active transaction so its changes become undoable.
  294. - `transaction.redo`: Reapply the most recently undone change.
  295. - `transaction.revert`: Roll back the active transaction without committing it.
  296. - `transaction.status`: Return undo, redo, and active-transaction status for the session.
  297. - `transaction.undo`: Undo the most recently committed change.
  298. ### Listing, Memory, Disassembly, and Patching
  299. #### context
  300. - `context.get`: Return processor context register values at a specific address.
  301. - `context.ranges`: List address ranges where a processor context register value applies.
  302. - `context.set`: Set processor context register values across an address range.
  303. #### listing
  304. - `listing.clear`: Clear listing content over a range, including optional symbols, comments, references, functions, or context.
  305. - `listing.code_unit.after`: Return the nearest code unit that follows a given address.
  306. - `listing.code_unit.at`: Return the code unit that starts exactly at a given address.
  307. - `listing.code_unit.before`: Return the nearest code unit that precedes a given address.
  308. - `listing.code_unit.containing`: Return the code unit that contains a given address.
  309. - `listing.code_units.list`: List code units in a range with pagination and direction controls.
  310. - `listing.data.at`: Return the defined data item at a specific address.
  311. - `listing.data.clear`: Clear one or more data definitions starting at an address.
  312. - `listing.data.create`: Create a data definition of a chosen type at an address.
  313. - `listing.data.list`: List defined data items in the program with range and pagination controls.
  314. - `listing.disassemble.function`: Disassemble all instructions that belong to a function body.
  315. - `listing.disassemble.range`: Disassemble instructions across a selected address range.
  316. - `listing.disassemble.seed`: Start disassembly from a seed address and follow discovered flows.
  317. #### memory
  318. - `memory.block.create`: Create a memory block with permissions, initialization, and an optional comment.
  319. - `memory.block.remove`: Remove an existing memory block from the program.
  320. - `memory.blocks.list`: List memory blocks together with addresses, permissions, and sizes.
  321. - `memory.read`: Read raw bytes directly from program memory.
  322. - `memory.write`: Write raw bytes directly into program memory.
  323. #### patch
  324. - `patch.assemble`: Assemble instruction text at an address and write the resulting bytes.
  325. - `patch.branch_invert`: Invert a conditional branch instruction in place.
  326. - `patch.nop`: Replace instructions in a range with NOP bytes.
  327. ### Symbols, Namespaces, Externals, and References
  328. #### class
  329. - `class.create`: Create a class namespace for recovered methods or fields.
  330. #### equate
  331. - `equate.clear_range`: Remove equate references across an address range and delete empty equates.
  332. - `equate.create`: Create an equate and attach it to an operand at an address.
  333. - `equate.delete`: Delete an equate entirely, or remove one of its references before deletion.
  334. - `equate.list`: List equates together with values and attached references.
  335. #### external
  336. - `external.entrypoint.add`: Add an address to the program's external entry point set.
  337. - `external.entrypoint.list`: List addresses currently marked as external entry points.
  338. - `external.entrypoint.remove`: Remove an address from the external entry point set.
  339. - `external.exports.list`: List symbols exported by the program.
  340. - `external.function.create`: Create an external function symbol under an external location.
  341. - `external.imports.list`: List symbols imported by the program.
  342. - `external.library.create`: Create a new external library record.
  343. - `external.library.list`: List external libraries known to the program.
  344. - `external.library.set_path`: Set or update the filesystem path associated with an external library.
  345. - `external.location.create`: Create an external location for a symbol within a library.
  346. - `external.location.get`: Return details for a specific external location.
  347. #### namespace
  348. - `namespace.create`: Create a namespace under an optional parent namespace.
  349. #### reference
  350. - `reference.association.remove`: Remove the symbol association attached to a specific reference.
  351. - `reference.association.set`: Associate a specific reference with a symbol.
  352. - `reference.clear_from`: Remove references originating from one address or an address range.
  353. - `reference.clear_to`: Remove all references that target a specific address.
  354. - `reference.create.external`: Create a reference from an address to an external location.
  355. - `reference.create.memory`: Create a memory reference between two program addresses.
  356. - `reference.create.register`: Create a reference from an address to a register.
  357. - `reference.create.stack`: Create a reference from an address to a stack location.
  358. - `reference.delete`: Delete a specific reference selected by source, destination, and operand.
  359. - `reference.from`: List cross-references that originate from an address.
  360. - `reference.primary.set`: Mark a specific reference as the primary one for its operand.
  361. - `reference.to`: List cross-references that target an address.
  362. #### symbol
  363. - `symbol.by_name`: Look up a symbol by name and return its details.
  364. - `symbol.create`: Create a new symbol or label at an address.
  365. - `symbol.delete`: Delete a symbol at an address, optionally by name.
  366. - `symbol.list`: List symbols with filtering and pagination support.
  367. - `symbol.namespace.move`: Move a symbol into a different namespace.
  368. - `symbol.primary.set`: Mark a selected symbol as the primary symbol at its address.
  369. - `symbol.rename`: Rename an existing symbol.
  370. ### Comments, Bookmarks, Tags, Metadata, Source, and Relocations
  371. #### bookmark
  372. - `bookmark.add`: Add a bookmark at an address with a type, category, and comment.
  373. - `bookmark.clear`: Remove bookmarks in an address range, optionally filtered by bookmark type.
  374. - `bookmark.list`: List bookmarks, optionally scoped to an address or bookmark type.
  375. - `bookmark.remove`: Remove bookmarks at an address, optionally filtered by type or category.
  376. #### comment
  377. - `comment.get`: Return one comment type from a specific address.
  378. - `comment.get_all`: Return all available comment types at an address, with optional function comments.
  379. - `comment.list`: List comments matching range, type, text, and pagination filters.
  380. - `comment.set`: Set or clear a comment of a selected type at an address.
  381. #### metadata
  382. - `metadata.query`: Read metadata entries stored by this server, optionally filtered by key or prefix.
  383. - `metadata.store`: Store a JSON-serializable metadata value under a program-scoped key.
  384. #### relocation
  385. - `relocation.add`: Add a relocation entry at an address with type, status, values, and symbol metadata.
  386. - `relocation.list`: List relocation entries, optionally limited to an address range.
  387. #### source
  388. - `source.file.add`: Register a source file record with the program's source file manager.
  389. - `source.file.list`: List all source files currently registered with the program.
  390. - `source.file.remove`: Remove a source file record by path.
  391. - `source.map.add`: Add a source mapping entry from a source line to an address range.
  392. - `source.map.list`: List source mapping entries by address, source file, or line filters.
  393. - `source.map.remove`: Remove a specific source mapping entry by file, line, and base address.
  394. #### tag
  395. - `tag.add`: Create or reuse a function tag and attach it to a function.
  396. - `tag.list`: List tags for one function or across the whole program.
  397. - `tag.remove`: Remove a function tag from a function.
  398. - `tag.stats`: Summarize function tags and the number of functions using each one.
  399. ### Functions, Variables, Types, and Layout Reconstruction
  400. #### function
  401. - `function.at`: Return the function that starts at, or contains, a specific address.
  402. - `function.batch.run`: Run one supported action across a filtered batch of functions.
  403. - `function.body.set`: Replace the body range of an existing function.
  404. - `function.by_name`: Look up a function by name and return its details.
  405. - `function.callees`: List the functions called by a specific function.
  406. - `function.callers`: List the functions that call a specific function.
  407. - `function.calling_convention.set`: Set the calling convention used by a function.
  408. - `function.calling_conventions.list`: List calling conventions available in the current program.
  409. - `function.create`: Create a new function at a given address.
  410. - `function.delete`: Delete a function at a given address.
  411. - `function.flags.set`: Update function flags such as varargs, inline, noreturn, or custom storage.
  412. - `function.list`: List functions in the program with filtering and pagination support.
  413. - `function.rename`: Rename an existing function.
  414. - `function.report`: Return a richer function report with signature, variables, call graph edges, xrefs, and decompilation output.
  415. - `function.return_type.set`: Set the return type of a function.
  416. - `function.signature.get`: Return the full signature of a function.
  417. - `function.signature.set`: Apply a full C-style signature declaration to a function.
  418. - `function.thunk.set`: Mark a function as a thunk to another function.
  419. - `function.variables`: List parameters and local variables for a function.
  420. #### layout
  421. - `layout.enum.create`: Create an enum data type in a chosen category.
  422. - `layout.enum.member.add`: Add a named value to an enum data type.
  423. - `layout.enum.member.remove`: Remove a named member from an enum data type.
  424. - `layout.inspect.components`: Inspect the component layout of a composite data type.
  425. - `layout.struct.bitfield.add`: Insert a bitfield into a structure at a byte and bit offset.
  426. - `layout.struct.create`: Create a structure data type in a chosen category.
  427. - `layout.struct.field.add`: Add a field to a structure at a specific offset or append position.
  428. - `layout.struct.field.clear`: Clear a field from a structure by offset, ordinal, or field name.
  429. - `layout.struct.field.comment.set`: Set or clear the comment on a structure field.
  430. - `layout.struct.field.rename`: Rename a structure field.
  431. - `layout.struct.field.replace`: Replace an existing structure field with a new type, size, name, or comment.
  432. - `layout.struct.fill_from_decompiler`: Build or extend a structure from decompiler-observed usage of a variable.
  433. - `layout.struct.get`: Return a structure definition together with its components.
  434. - `layout.struct.resize`: Resize a structure to a specific total length.
  435. - `layout.union.create`: Create a union data type in a chosen category.
  436. - `layout.union.member.add`: Add a member to a union data type.
  437. - `layout.union.member.remove`: Remove a member from a union data type.
  438. #### parameter
  439. - `parameter.add`: Add a new parameter to a function with a chosen type and storage.
  440. - `parameter.move`: Reorder a parameter to a new ordinal within the signature.
  441. - `parameter.remove`: Remove a parameter from a function by ordinal or name.
  442. - `parameter.replace`: Replace an existing parameter definition by ordinal or name.
  443. #### stackframe
  444. - `stackframe.variable.clear`: Clear a stack-frame variable at a specific stack offset.
  445. - `stackframe.variable.create`: Create a stack-frame variable at a specific stack offset.
  446. - `stackframe.variables`: List stack-frame variables for a function.
  447. #### type
  448. - `type.apply_at`: Apply a data type at an address in the listing.
  449. - `type.archives.list`: List the current program archive plus attached source archives.
  450. - `type.category.create`: Create a new data type category path.
  451. - `type.category.list`: List data type categories under a path, optionally recursively.
  452. - `type.define_c`: Define a new data type from a C declaration.
  453. - `type.delete`: Delete a data type by name or full path.
  454. - `type.get`: Return details for a data type by name or full path.
  455. - `type.get_by_id`: Look up a data type by internal ID, universal ID, or source archive ID.
  456. - `type.list`: List data types with filtering and pagination support.
  457. - `type.parse_c`: Parse a C declaration (including `typedef struct`/composite declarations) and return the resulting type without committing it.
  458. - `type.rename`: Rename an existing data type.
  459. - `type.source_archives.list`: List source archives referenced by the current data type manager.
  460. #### variable
  461. - `variable.comment.set`: Set or clear the comment attached to a local variable or parameter.
  462. - `variable.local.create`: Create a local variable with explicit type, storage, and optional comment.
  463. - `variable.local.remove`: Remove a local variable from a function.
  464. - `variable.rename`: Rename a local variable or parameter.
  465. - `variable.retype`: Change the data type of a local variable or parameter.
  466. ### Decompiler, P-Code, Search, and Graph Extraction
  467. #### decomp
  468. - `decomp.ast`: Decompile a function and return the Clang markup tree for the result.
  469. - `decomp.function`: Decompile a function and return recovered C source code.
  470. - `decomp.global.rename`: Rename a global symbol selected through decompiler high-symbol information.
  471. - `decomp.global.retype`: Retype a global symbol selected through decompiler high-symbol information.
  472. - `decomp.high_function.summary`: Summarize the high-function view, including local symbols, globals, blocks, and jump tables.
  473. - `decomp.override.get`: Return the decompiler call override, if any, for a specific callsite.
  474. - `decomp.override.set`: Set or replace the decompiler call override signature for a specific callsite.
  475. - `decomp.tokens`: Decompile a function and return tokenized Clang markup for the output.
  476. - `decomp.trace_type.backward`: Trace type propagation backward from a selected decompiler symbol.
  477. - `decomp.trace_type.forward`: Trace type propagation forward from a selected decompiler symbol.
  478. - `decomp.writeback.locals`: Commit decompiler-recovered local names back into the program database.
  479. - `decomp.writeback.params`: Commit decompiler-recovered parameter information back into the program database.
  480. #### ghidra
  481. - `ghidra.call`: Invoke Ghidra or Java APIs directly through a generic bridge.
  482. - `ghidra.eval`: Evaluate Python code inside the live Ghidra runtime context.
  483. - `ghidra.info`: Return runtime information about Ghidra, PyGhidra, and the server environment.
  484. - `ghidra.script`: Run a Ghidra script against an open program session.
  485. #### graph
  486. - `graph.basic_blocks`: List the basic blocks that make up a function.
  487. - `graph.call_paths`: Find call graph paths between two functions up to a chosen depth.
  488. - `graph.cfg.edges`: List control-flow edges between the basic blocks of a function.
  489. #### pcode
  490. - `pcode.block`: Return per-instruction p-code for the basic block containing an address.
  491. - `pcode.function`: Return per-instruction p-code for a function.
  492. - `pcode.op.at`: Return the p-code ops generated by the instruction at an address.
  493. - `pcode.varnode_uses`: Find p-code reads and writes that match a selected varnode.
  494. #### search
  495. - `search.bytes`: Search program memory for an exact byte pattern.
  496. - `search.constants`: Search instructions for scalar constant operands that match a value.
  497. - `search.defined_strings`: List defined strings discovered in the program.
  498. - `search.instructions`: Search instructions by mnemonic or rendered instruction text.
  499. - `search.pcode`: Search p-code operations by mnemonic or rendered op text.
  500. - `search.resolve`: Resolve a symbol name or expression into an address.
  501. - `search.text`: Search for text across defined strings and raw memory matches.
  502. ## Contact
  503. For more information, contact Tim Blazytko ([@mr_phrazer](https://x.com/mr_phrazer)).

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.