Repository navigation
docs(native): clarify memory and file byte sources - #8829
Conversation
[Low impact] This wording-only change appears safe to merge. SummaryClarifies the existing difference between analyzed memory and original file bytes in CLI help and MCP descriptions.
No actionable issues or new security concerns were found. Source checks matched the descriptions to the byte reader, file mapper, and catalog registration. Supersession could not be checked because GitHub access required authentication. Reviews (1) · Last reviewed commit: "docs(native): qualify Ghidra fixup cover..." · Reviewed by Greptile |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Summary
Ghidra's
read_bytescan return initialized memory bytes that include loader fixups that differ from the original file at the offset reported byaddress_to_file_offset. Make that distinction visible in both MCP tool descriptions and CLI help. Related: #8170 and #8556.Problem and expected behavior
The existing Evidence limitation explains loader fixups after a read, but the catalog descriptions do not explain the distinction when the caller chooses a tool. An offset maps one address; it does not establish a contiguous file range or byte equality with modeled memory.
Change and scope
Clarify the existing contracts only. This changes no result, provider operation, target access, or schema. Contribution scope decision: not applicable; documentation of existing static behavior.
Contract and boundary impact
Evidence and regression coverage
Real Ghidra 12.1.4 on macOS arm64, through compact and full stdio MCP, read
c003000001000000at0x100004000and mapped that address to file offset16384; an independent read of the target file at that offset gavec003000000000000. The fixture SHA-256 was496e188170232c15f1ceeebf33165f060c6a31b46be9571b6f49778ef0e8d910and remained unchanged. Both catalogs exposed the new descriptions. No output schemas or runtime behavior changed, and no new test was added for this wording-only clarification. One host and fixture; no autonomous-agent trial or general claim about all fixups.A second control at the fixture’s code address
0x1000003c0returned the same eight bytes (ff4300d1e00f00b9) from Ghidra memory and the mapped file offset960, in both profiles. This contrast supports “can differ”; it is not a general statement that code ranges are unaffected by fixups.A separate source-generated ELF64 maps two adjacent four-byte virtual regions to file offsets
0x1000and0x3000. Real Ghidra MCPread_bytesreturned all eight bytes1122334455667788and complete in both profiles; the two address lookups returned those separate offsets. Reading eight contiguous file bytes from the first offset gave1122334400000000. The unexecuted fixture SHA-256 remainede66ea8131ec8479d0fbfbdc2d57ff30137700d1956879602ff6b7bd289d54f3d. This supports the single-address offset caveat on one constructed mapping; no general ELF-loader claim is made.On the same fixup fixture, a real Ghidra session exported the byte-read and file-offset Evidence; a fresh target-free MCP server imported the bundle and returned both records exactly, including the byte-read loader-fixup limitation, in compact and full profiles. This verifies one historical handoff, not a per-fixup Ghidra provenance record.
On that ELF, a four-byte Ghidra read starting two bytes before the end of mapped memory returned
7788,returned_bytes: 2, andcomplete: falsein both MCP profiles. This checks the existing short-read contract on one boundary; the source hash remained unchanged.Validation performed
npm run build:cached,npm run check:fast,npm run docs:check, andgit diff --check— passed.--helpdisplayed both updated descriptions.Compatibility, safety, and release
No breaking changes or migration. Catalog/help text changes; provider data, source identity, and Evidence remain unchanged.
Author readiness
Human owner: