Skip to main content

Crate ghidra_ipc

Crate ghidra_ipc 

Source
Expand description

Wire types, framing, JSON-RPC, and address canonicalization for the host <-> Ghidra-worker socket. No Ghidra dependency: pure, unit-testable.

Modules§

address
Strict-total address canonicalization (spec §9). Lenient input, one canonical output form. This is the single code path; no tool formats addresses itself.
error
Error envelope + code set (spec §10). Serialized as the MCP tool result body { error: { code, message, suggested_action, details? } } with isError:true (the isError flagging is applied by the MCP layer in M1).
error_map
Total map from the Java worker’s string error codes to the Rust ErrorCode set (spec §4.1). Every known worker string maps to a variant; any UNKNOWN string falls back to WorkerUnavailable with the raw code preserved in details.worker_code so nothing is silently lost.
frame
Length-delimited framing: 4-byte big-endian length prefix + UTF-8 JSON body (spec §5).
owner_only
Owner-only directory lockdown: the Unix chmod 0700 equivalent on both platforms. Single home for the DACL/chmod logic so the two callers (ghidra-mcp::logging for the log dir, ghidra-worker-ctl::boot for the per-boot token dir) cannot drift apart.
protocol
Cross-language wire DTOs for the M1a read tools (spec §3). These are the worker’s response shapes; the server canonicalizes address strings (via address::AddressCanonicalizer) before returning them to the MCP client, but the wire form carries whatever space:offset the worker emits.
rpc
JSON-RPC 2.0 host <-> worker types + the versioned init handshake (spec §5).