mirror of
https://github.com/morluto/rea.git
synced 2026-11-05 06:45:22 +00:00
[GH-ISSUE #6405] [Feature] Ghidra: export analyst names and comments from a session and re-apply them when the target is reopened #3835
Open
opened 2026-10-31 00:44:30 +00:00 by bsakaguchi
·
5 comments
No Branch/Tag specified
main
codex/procedure-reference-stacked
release-please--branches--main--components--rea-agents
release-please--branches--main--components--rea-agents--release-notes
codex/kuna-independent-retry
codex/byte-search-overlay-coverage
codex/open-failure-target-receipt
codex/kuna-xref-evidence
codex/ghidra-ambiguous-procedure-recovery
codex/function-source-bundle
codex/trace-function-integration-prototype
codex/snapshot-source-closure
codex/recorded-evidence-array-pages
codex/evidence-recovery-redesign
codex/trace-feature-address-scope
codex/call-discovery-scope
codex/ghidra-literal-candidate-evidence
codex/decompile-directory-independent-retry
codex/retry-provenance-base
codex/value-flow-capability-experiment
codex/ghidra-containing-instruction
cursor/readme-discord-button-ef9f
dependabot/github_actions/actions/setup-node-7.1.0
dependabot/github_actions/actions/upload-artifact-7.0.2
dependabot/npm_and_yarn/npm-minor-and-patch-d8d97ce6df
codex/kuna-1989
fix/8559-native-ui-fixture-ownership
fix/8555-go-verifier-mcp-ownership
codex/provider-capability-recovery
fix/8642-rizin-target-stdin
codex/ghidra-memory-effect-scope
codex/ghidra-annotation-entry-selector
codex/ghidra-readonly-recovery
codex/ghidra-regex-verifier-recovery
codex/evidence-discovery-view-guidance
fix/8545-bulk-append-overflow
fix/8428-navigation-refusal-alternatives
codex/address-context-recovery
codex/matching-member-limitations
codex/unknown-scope-contract
codex/evidence-view-guidance
feat/8373-native-trace-views
codex/ghidra-snapshot-verifier-binding
codex/elf-export-visibility
codex/evidence-view-recovery
codex/native-reference-cli-help
codex/provider-candidate-observation-scope
codex/kuna-session-verification
codex/ghidra-switch-lifetime-guidance
codex/pseudocode-paging-discovery
codex/clarify-evidence-view-support
codex/kuna-xrefs-selector-recovery
codex/context-capacity-recovery
codex/evidence-closure-large-links
codex/same-function-evidence-identity
codex/ghidra-verifier-inspected-jdk
codex/audit-guided-workflows
codex/crash-prompt-retained-dossiers
codex/analysis-view-error-recovery
codex/kuna-verifier-target-selection
codex/ghidra-selected-project-call-coverage
codex/docs-native-analysis-scope
codex/ghidra-java-socket-boundary
codex/ghidra-retained-snapshot-verifier
codex/ghidra-search-inventory-facts
fix/8284-zero-argument-parameter-bindings
fix/8198-ui-action-handler-offset
fix/8257-elf-entry-label-identity
fix/8304-deferred-output-schema-projection
fix/8277-call-path-computed-target-uncertainty
fix/pr-8089-conflicts
fix/ci-static-duplicate-export
dependabot/npm_and_yarn/lint-staged-17.6.0
dependabot/github_actions/actions/download-artifact-8.0.2
dependabot/npm_and_yarn/write-file-atomic-8.0.0
dependabot/npm_and_yarn/canonicalize-5.1.0
dependabot/github_actions/actions/cache/restore-6.1.0
dependabot/npm_and_yarn/toon-format/toon-4.4.0
dependabot/github_actions/actions/deploy-pages-5.0.1
codex/review-fixes-pr-2403
codex/review-fixes-pr-2400
codex/process-terminal-width
codex/test-brittleness-cleanup
verify/7167-browser-connect-macos
fix/7167-browser-connect
feat/native-matching-allowance-setting
feat/browser-scenario-dry-run
test/managed-caller-parameters-20261024
codex/parser-fortythird-boundaries
fix/6926-pinvoke-platform-decorations-20261023
fix/6889-har-body-encoding-20261023
fix/6888-sqlite-schema-budget-20261023
fix/dependency-security-gates-6708
cursor/evidence-overwrite-rebase-b4ac
feat/4057-verify-native-exports
fix/windows-acl-observer-overhead-20261022
cursor/erlang-beam-restack-4476
cursor/pe-certificate-review-bf32
fix/6116-javascript-application-fs-errors
fix/6061-unmapped-runtime-script-unknown
feat/browser-scenario-summary
fix/pe-certificates
codex/verify-3407
cursor/rebase-5699
cursor/rebase-5352
cursor/rebase-5600
cursor/fix-cli-schema-omission-10a8
codex/audit-hopper-shutdown-reasons-20261021
fix/demangle-swift-omitted-record
fix/nib-boolean-value-types
cursor/cancellation-partial-observation-a5ac
fix/ib-object-limit-reasons
fix/electron-fuse-limit-advice
fix/kuna-doctor-dangling-cache
fix/fixed-budget-refusal-advice
fix/js-ipc-listener-dedup
fix/js-return-member-provenance
fix/dmg-integrity-retry-advice
fix/ida-doctor-readiness
fix/kuna-version-probe-output-drain
fix/legacy-swift-runtime-name-matching
fix/dylib-lazy-load-commands
fix/browser-scenario-startup-cancel
fix/swift-nested-punycode-classification
fix/compare-unselected-scopes
fix/objc-method-budget-coverage
fix/dmg-mounted-root-observations
audit/ci-tests-20261019-round2
release/6.7.0
fix/wabt-cleanup-retry-resolution
fix/electron-fuse-elf-pe-architecture
fix/native-plist-descriptor-ownership
fix/kuna-caller-cleanup-ownership
experiment/atomic-codemode-20261016
review/first-contributor-3776
fix/call-resolution-full-read-cycles
fix/member-mutation-selection-repeat
experiment/atomic-re-tools-20261015
perf/member-mutation-lazy-origins
perf/static-network-mutation-index
fix/hopper-startup-lifecycle
audit/3050-windows-proof-20261015
feat/windows-window-capture-2183
audit/3049-windows-proof-20261015
audit/3735-macos-fixtures-20261015
fix/batch-decompile-null-pseudocode
fix/kuna-inventory-honors-jobs
experiment/browser-codemode-tool-design-20261015
fix/hopper-clean-runtime-argv
codex/review-2049-27f1b367
review-fixes/pr-2787-routing
fix/3360-scoped-this-emitters
fix/3367-replaced-global-effects
fix/3838-compact-any-value-items
test/hopper-download-probe-20261015
codex/windows-runtime-creation-red-green-20261015
codex/windows-readonly-root-red-green-20261015
codex/windows-root-share-red-green-20261015
codex/exp-1685-win-mcp-startup
codex/bug-sweep-20261015
investigate/2190-windows-package-phases
investigate/3543-macos-cli-deadline
perf/3281-reverse-tools-feedback-quality
fix/3406-hopper-doctor-fixture
fix/3341-wrapper-require-test-context
fix/3301-owned-uninstall-fixtures
fix/3164-compiler-input-ownership
fix/pcap-cleanup-stdout-newline-20261014
perf/interface-builder-summary
codex/review-fixes-pr-1977
fix/ghidra-effective-jvm-platform
fix/docs-turkish-rust-link-20261013
fix/main-maintenance-ci-20261010
fix/recover-binary-session-process-effects
codex/review-fixes-pr-2457
codex/ci-required-cancellation-gate
fix/main-format-baseline-20261013
fix/setup-preserve-entry-fields
cursor/restore-main-checks-1ffc
fix/ghidra-bridge-hashmap-import
codex/shared-ci-jadx-json-default-20261013
codex/shared-ci-ghidra-test-groups-20261013
codex/shared-ci-java-fixture-format-20261013
codex/fix-intrinsic-invocation-boundaries
test/release-preflight-reusable-jobs
test/js-parameter-provenance-expectation
fix/linux-hopper-verification-current
test/2419-ghidra-elf-probe-size
followup/pr-1544-native-ida
codex/fold-pr-2230-contribution
docs/readme-responsible-use
fix/issue-2064
fix/issue-2050
fix/issue-2053
fix/issue-1968
fix/issue-1945
experiment/codemode-bridge-20261011
fix/tool-effects-negative-wording-1904-20261012
fix/1842-electron-interop-provenance
feat/recover-javascript-multi-input
refactor/website-i18n-prep
fix/nativeaot-pe-virtual-extent
fix/browser-verifier-ci-hang
fix/pe-resources-input-selection
docs/beginner-friendly-guides
docs/beginner-setup-guide
fix/javascript-analysis-worker-1563
fix/1649-ghidra-duplicate-names
fix/javascript-export-keys-integration-1369
test/maintenance-boundary-contracts-20261011
review/javascript-export-keys-1369
review/process-live-progress-1483
test/javascript-1495-growth-ratio
fix/ci-escape-timing
docs/normalized-terminal-geometry-1450
release/6.3.0
archive/release-6.3.0-pr1381
release/6.2.0
fix/electron-preload-dynamic-override
fix/javascript-self-referential-bundler-edges
release/6.1.0
cursor/grok-client-cherry-pick-0b56
feat/signature-posture
feat/dyld-shared-cache
feat/artifact-integrity-policy
feat/pkg-inventory
release/6.0.0
chore/sync-release-5.0.0
release/5.0.0
cursor/cloud-agent-node-787e
fix/javascript-xhr-open-endpoints
review/pr-711-realpath-fallback-wording
cleanup/replay-confinement
codex/test-suite-performance
codex/issue-foundations
codex/address-open-issues-2026-07-20
agent/javascript-vite-rollup-esbuild-adapters
agent/process-cleanup
agent/triage-integration
agent/unknown-commands-registry
feat/mcp-identity-metadata
morlvps/issue_cleanup
codex/installer-redesign
morl/roadmap-investigation-core
morl/roadmap-investigation-docs
release-please--branches--main--components--rea
rea-agents-6.8.0
rea-agents-6.7.0
rea-agents-6.6.0
experiment/atomic-codemode-wait-runtime-20261016
rea-agents-6.5.0
rea-agents-6.4.0
rea-agents-6.3.0
rea-agents-6.2.0
rea-agents-6.1.0
rea-agents-6.0.0
rea-agents-5.0.0
rea-agents-4.1.0
rea-agents-4.0.1
rea-agents-4.0.0
rea-agents-3.2.1
rea-agents-3.2.0
rea-agents-3.1.0
rea-agents-3.0.0
rea-agents-2.7.0
rea-agents-2.6.0
rea-agents-2.5.1
rea-agents-2.5.0
rea-agents-2.4.0
rea-agents-2.3.0
rea-agents-2.2.0
rea-agents-2.1.0
rea-agents-2.0.0
rea-agents-1.7.0
rea-agents-1.6.0
rea-agents-1.5.0
rea-agents-1.4.0
rea-agents-1.3.0
rea-agents-1.2.0
rea-agents-1.1.0
rea-agents-1.0.0
rea-agents-0.5.0
rea-agents-0.4.0
rea-agents-0.3.0
rea-0.2.1
rea-0.2.0
Labels
Clear labels
area: bridge
area: bridge
area: build
area: build
area: build
area: cli
area: domain
area: evidence
area: mcp
area: native
area: providers
area: runtime
area: server
area: setup
area: tests
bug
design
documentation
enhancement
enhancement
enhancement
experiment
help wanted
i18n
invalid
P0: critical
P1: high
P2: medium
P2: medium
P2: medium
P3: low
performance
provider-request
pull-request
Mirrored from GitHub Pull Request
question
roadmap
triage
No labels
area: bridge
area: bridge
area: build
area: build
area: build
area: cli
area: domain
area: evidence
area: mcp
area: native
area: providers
area: runtime
area: server
area: setup
area: tests
bug
design
documentation
enhancement
enhancement
enhancement
experiment
help wanted
i18n
invalid
P0: critical
P1: high
P2: medium
P2: medium
P2: medium
P3: low
performance
provider-request
pull-request
question
roadmap
triage
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".
No due date set.
Dependencies
No dependencies set.
Reference
morluto/rea#3835
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @coygeek on GitHub (Oct 22, 2026).
Original GitHub issue: https://github.com/morluto/rea/issues/6405
Before submitting
Area
Native analysis or decompilation
Current limitation
Names and comments an agent applies in a Ghidra session are lost when the session ends, and REA offers no compact way to carry them into the next session. Examined at REA
maine83e3ceadd(source reading):docs/installation.md;docs/ghidra-dos.md). Besides a deliberateclose_binary, a server restart or a transport loss (#3509) ends the session and drops every name.REA_GHIDRA_SEED_FILEacceptsaddress<TAB>kind[<TAB>name]lines and applies them before auto-analysis, with the seed digest bound into the analysis profile (docs/installation.md, seed section).list_names, which returns the complete symbol inventory in one response with no paging (docs/ghidra-provider.md, "Inventory" row), filter the items whose source is user-defined, and hand-write a seed file. On large targets that inventory is expensive in tokens, and entry comments written byannotate_native_functionhave no re-import path at all.Use cases
match_native_functions) as a reviewable text file.Desired outcome and success criteria
close_binaryoption) writes the names applied during the session, and entry comments written throughannotate_native_function, to a caller-selected file. Only analyst edits from this session are written, not the whole symbol inventory.REA_GHIDRA_SEED_FILEtakes a single path, so the design must say how an exported file combines with an existing seed file (for example IL2CPP seeds).address_namereturns the names, callers'procedure_pseudo_codeshows them, and the comment reads back. A file whose digest does not match the target is refused with a typed error; an existing destination file is never overwritten; executable bytes stay unchanged; Windows P0 behavior stays read-only.If comments at arbitrary addresses are admitted for Ghidra (#6404), the export should include them.
Expected interaction with targets
Target and scope details (optional)
Reads the session database and writes one caller-selected output file; re-application reads that file. The target binary is never modified and no Ghidra project is saved. Non-goals: saving a Ghidra project, exporting types, prototypes or bookmarks, and general investigation notes (that is #4394, which could share the same storage decision).
Verification available so far
I can suggest a sample or manual check
Verification details (optional)
The success check above can run on the existing Ghidra verification fixture. Not run: no local Ghidra was available for this report.
Real-provider manual reapplication control
On macOS arm64, Node 24.22.1, Ghidra 12.1.4, Kuna 1.988 and REA
7abef04a5(draft #8567), an owned, unexecuted Mach-O was opened with Ghidra and a data address was namedrea_switch_labelthroughset_address_name. The returned Evidence retained the exact address and name in its parameters andtruereadback. After explicitly switching to Kuna and reopening Ghidra, the name was absent while the original mutation Evidence ID was still discoverable. An explicit newset_address_namecall using that record's address and name succeeded, andaddress_nameread the label back. The target digest87fa65dee009e59a8709a70a2aa731a0dc9cae47cf65d4c69292f7cad4897d93was unchanged.This is one manual same-target name control using the already returned Evidence; no automatic replay, independent file import, comment restoration, conflict handling or cross-target safety was tested. Separately, after an edit
close_binarywithsnapshot_pathrefused withevidence_integrity_mismatchand left the edited session open. This confirms an Evidence record can help a caller explicitly reconstruct one edit, but is not an edited-database checkpoint and does not establish a safe general replay contract.Function name and comments control
Using the same owned Mach-O and Ghidra/Kuna versions,
annotate_native_functionset a function name, a regular comment containingcafé, and an inline comment. The resulting Evidence retained all supplied parameters and exact readback. After switching to Kuna and reopening Ghidra,inspect_address_contextshowed the original function name; explicit reapplication of the retained parameters returned matching name and both comment readbacks. The prior annotation Evidence ID remained retained and the target hash was unchanged. This is still a manual same-target control, not a portable or automatic replay, conflict, identity-mismatch, or arbitrary-address comment test.During this control, address context reported both comment facets unavailable even while
analyze_functionreturned both comments in the active Ghidra session. This existing UX gap is tracked in #8363.Selected historical annotation record
On main
85013da0cafter #8528, real Ghidra 12.1.4 on macOS arm64 created function-annotation Evidence with a name, regular comment and inline comment on an owned Mach-O. After exporting the bundle and importing it into a fresh target-free MCP server,get_evidence_bundlewithdetail: "records"and the exact Evidence ID returned the complete original record unchanged in both compact and full output-schema profiles, including exact annotation readback. The response explicitly labels the selection historical and non-importable; no provider was opened in the importing session. The binary was unchanged and never executed.This improves individual historical-record retrieval and supersedes the older full-inventory/full-bundle-only alternatives for this use. It does not restore an edited database, offer automatic replay, or settle conflict and identity rules for a portable annotation workflow.
Alternatives considered
list_names+ filter + hand-written seed file: works but costs the full inventory per export, misses comments, and has no digest binding unless the agent adds one.Possible direction
Reuse the IL2CPP seed-writer contract (atomic exclusive creation,
docs/il2cpp-metadata.md) for output, and the existingREA_GHIDRA_SEED_FILEadmission for names. The Ghidra bridge marks analyst edits withSourceType.USER_DEFINED, but seed-applied names carry the same source (bridge/ghidra/ReaGhidraApplySeeds.java), so filtering on source would export every seed as well (an IL2CPP seed file can hold up to a million entries). The session needs to track its own edits separately.References
FUN_text in pseudocode.@morluto commented on GitHub (Oct 30, 2026):
Real REA/Ghidra 12.1.4 MCP follow-up on one self-built Mach-O clarifies an existing, limited recovery option and why an Evidence bundle is not an edit journal.
In two fresh sessions I applied the same two explicit name/comment changes to the same function in opposite orders (
alphathenbeta, andbetathenalpha). The live final pseudocode respectively showedbeta/note_betaandalpha/note_alpha. Both sessions produced the same two annotation Evidence IDs, and both exported bundles ordered those records the same way. Other Evidence in the bundles differed because I also captured each final pseudocode. Thus the annotation records alone cannot establish which of those changes was last; bundle order is canonical by Evidence ID, not chronological. This is expected for historical Evidence and is not a bug in the bundle contract.In a third fresh session I imported the first bundle: the live pseudocode remained unedited.
get_evidence_bundlewith an operation-filtered summary discovered both annotation records and their target/profile metadata. I retrieved the complete bundle, explicitly selected the knownbetarecord from my recorded sequence, checked its target SHA-256 and analysis-profile digest against the current session, and invokedannotate_native_functionon its recorded address with the selected name and comment. Live pseudocode then reflected that edit. The binary hash was unchanged. This was a manually selected replay of one function's name and regular entry comment, not automatic restoration, conflict resolution, data-label or inline-comment coverage, or a guarantee for a changed profile.For bounded access,
inspect_analysis_viewrejected both summary and native procedure views of the annotation Evidence as an unsupported parent operation. Its filtered discovery summary exposes the record identity and provenance but not the annotation payload; my script usedget_evidence_bundlecomplete for this small bundle. That does not establish a measured large-bundle failure. A prospective export/replay design should retain the current final state or explicit ordering and handle conflicts/clears; it must not infer edit order from Evidence IDs or silently apply stale observations.@morluto commented on GitHub (Oct 30, 2026):
The inventory alternative in the original report needs an update for current REA:
list_names({detail:"summary"})retains the complete observed inventory and returns counts plus a parent Evidence ID;inspect_analysis_viewwithkind:"native-inventory"pages the rows and can select fields. It is no longer necessary to transfer the whole inventory in one response. The view reports discovery coverage as unknown and its current request offers offset/limit and fields, not a source-type filter, so identifying all user-defined rows still requires examining the relevant pages. This small fixture is not a large-target token or latency measurement.I exercised a real Ghidra 12.1.4 MCP session on an owned Mach-O with one pre-analysis label seed, one session data-label edit and one session function rename/comment. The seeded label, edited data label and edited function all appeared as
symbol.source: user_definedin pagedlist_namesresults. The seed path/digest and caller-assertion limitation were separately retained in the analysis profile; the row's source classification alone did not distinguish a seed from a session edit. Paging all 24 observed rows in pages of four found the three names, while the function's comment remained in the annotation Evidence rather than this names inventory. The target SHA-256 was unchanged and the target was not executed.This supports retaining current session edit identity and comment state separately from the full symbol inventory, while recognizing that bounded inventory delivery already exists. It does not prove general edit-export or replay behavior, and does not claim that all user-defined names are session edits.
@morluto commented on GitHub (Oct 30, 2026):
A real Ghidra batch-naming control adds an ordering case for any future export/replay design. Two independent sessions submitted the same mapping of two mapped addresses to one name, with opposite JSON object key order. Each session applied the first address and returned
falsefor the second; the winning address differed. Both exported Evidence records correctly retained their opposite per-address Boolean results, but their canonicalparameters.namesmappings were identical and did not record input member order. #8238 tracks the existing mutation-order question; #8239 discusses per-item failure explanations.This does not make the Evidence bundle an edit journal or establish that automatic replay exists. A future replay should not infer the original order from the canonical object, blindly retry failed mutations, or treat failed entries as applied. Both target digests stayed unchanged and the binary was not executed.
@morluto commented on GitHub (Oct 31, 2026):
Real MCP follow-up on the same self-owned, unexecuted Mach-O, Ghidra 12.1.4 / Kuna 1.986 / REA
b43c329:"", and changed the inline comment. Its complete annotation readback retained the name, represented the cleared comment asnull, and returned the new inline comment.nullregular comment to"". The returned readback matched the selected name, absent regular comment, and inline comment. Close succeeded; target hash stayed unchanged.This is a manual, caller-directed recovery of one selected complete readback, not automatic replay or a conflict-safe general checkpoint. The second input omitted the name, so replaying just its original parameters would not restore the full selected readback after a fresh import.
nullis not a valid comment input and mapping it to""intentionally clears existing comments; that choice needs to be explicit. Selection used a separately retained Evidence ID, not bundle sort order. Other addresses, conflicts, selected projects, incompatible profiles, bulk labels, and automatic sequencing remain untested. Related provider-switch UX: #8289.For maintainer visibility: @gensokyo-dev @kaoru0822-kitauji @N0zoM1z0
@morluto commented on GitHub (Oct 31, 2026):
Data-label recovery control on the same unexecuted Mach-O, real REA MCP
b43c329, Ghidra 12.1.4 and Kuna 1.986:set_address_nameassignedaudit_count_labelto global address0x100004000and returnedtrue. Attempting the same name on the separate0x100004008global returnedfalse;address_nameconfirmed the second address retained_message. Both successful and unsuccessful edit observations appeared as separate complete retained Evidence records.After Ghidra → Kuna → Ghidra switching,
address_namereported the original_global_countand_message. A caller explicitly selected the successful record by its captured ID, verified target SHA-256 and profile digest, reapplied its recorded address/name, and checked both names. The intended label returned; the failed conflicting request was not replayed and the other global remained unchanged. The repeated successful edit produced the same Evidence ID as the first. Close succeeded and the target hash was unchanged.This is one caller-directed reapplication with an explicit readback, not an automatic bulk restore, conflict-resolution policy, or chronology inferred from Evidence IDs. It demonstrates that a successful boolean and a failed boolean can both be retained; a future replay workflow must distinguish outcomes and coordinate/target identity rather than treating every recorded edit request as applied. The existing #8239 tracks the separate lack of per-item failure reasons. Related switch behavior: #8289.
For maintainer visibility: @gensokyo-dev @kaoru0822-kitauji @N0zoM1z0