[PR #2079] [MERGED] feat(ghidra): support raw NMOS 6502 analysis #5009

Closed
opened 2026-10-31 00:57:57 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/2079
Author: @Zhong-fan
Created: 10/12/2026
Status: ✅ Merged
Merged: 10/13/2026
Merged by: @morluto

Base: main ← Head: feat/1641-6502-raw


📝 Commits (10+)

  • 9ea321b feat(ghidra): admit raw NMOS 6502 analysis
  • cf43d29 Merge remote-tracking branch 'origin/main' into feat/1641-6502-raw
  • 2d8a322 test(ghidra): require verified POSIX verifier cleanup
  • 292c383 Merge remote-tracking branch 'origin/main' into feat/1641-6502-raw
  • 2b922e9 Merge upstream Windows CI fixture fixes
  • 8336e96 test(ghidra): verify 6502 low-memory raw imports
  • 94df1ed docs(skill): document raw NMOS 6502 support
  • c70cf89 chore: merge main and preserve raw 6502 type boundaries
  • fa602c3 chore: reconcile documentation with latest main
  • 4cf97f4 fix(ghidra): preserve requested Windows raw source paths

📊 Changes

54 files changed (+1649 additions, -196 deletions)

View changed files

📝 .agents/skills/reverse-engineer-anything/references/native-and-artifacts.md (+5 -2)
📝 bridge/ghidra/ReaGhidraPrepareRaw.java (+15 -2)
📝 docs/cli.md (+3 -1)
📝 docs/ghidra-mips.md (+1 -1)
📝 docs/ghidra-riscv.md (+2 -2)
📝 docs/installation.md (+4 -1)
📝 docs/native-investigation.md (+5 -2)
📝 docs/raw-binary.md (+53 -10)
📝 docs/testing.md (+10 -0)
📝 docs/windows-ghidra-p0.md (+11 -3)
📝 experiments/analysis-efficiency/agent-trial.py (+3 -1)
📝 experiments/analysis-efficiency/test_codex_context.py (+4 -1)
📝 package.json (+1 -0)
➕ scripts/verify-real-ghidra-6502.mjs (+479 -0)
📝 src/application/BinaryTargetResolver.ts (+7 -5)
📝 src/application/DirectAnalysis.ts (+6 -0)
📝 src/application/binary/AnalysisSnapshotCache.ts (+5 -0)
📝 src/application/binary/BinarySession.ts (+12 -0)
📝 src/application/binary/BinarySessionExecution.ts (+12 -4)
📝 src/application/binary/BinarySessionOpen.ts (+12 -6)

...and 34 more files

📄 Description

Summary

Refs #1641. Support explicitly selected headerless NMOS 6502 images through REA's existing local Ghidra provider. The complete image must fit the 16-bit address space.

Change and scope

Use Ghidra's bundled 6502 language and verify the file-backed mapping, entry, and source bytes. Windows Ghidra admits the selected source before saved reads can replay; later reads can reuse the cache. Cartridge formats, bank switching, 65C02, and 65816 are outside this PR.

Contract and boundary impact

CLI and MCP accept 6502 with an explicit load address. Evidence records the selected language and measured mapping; nested Evidence and snapshot subjects reject 6502 for non-raw formats. Ghidra analyzes a private snapshot; original bytes remain unchanged. No new dependency or target-code execution.

Validation performed

  • npm run check:ci, 40 focused CLI/MCP tests, npm run docs:check, and npm run docs:build passed.
  • Real Ghidra 12.1.4 on Windows passed source-built CLI/MCP, low-memory and full-64-KiB checks, file-offset decompilation, saved-snapshot junction rejection, and cleanup. Real Linux/macOS Ghidra runs remain unverified.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/morluto/rea/pull/2079 **Author:** [@Zhong-fan](https://github.com/Zhong-fan) **Created:** 10/12/2026 **Status:** ✅ Merged **Merged:** 10/13/2026 **Merged by:** [@morluto](https://github.com/morluto) **Base:** `main` ← **Head:** `feat/1641-6502-raw` --- ### 📝 Commits (10+) - [`9ea321b`](https://github.com/morluto/rea/commit/9ea321b666f63fc4f415fdfc79511bfef241266d) feat(ghidra): admit raw NMOS 6502 analysis - [`cf43d29`](https://github.com/morluto/rea/commit/cf43d2967dd1eab2e791a25d56e4556f86b9c58c) Merge remote-tracking branch 'origin/main' into feat/1641-6502-raw - [`2d8a322`](https://github.com/morluto/rea/commit/2d8a32203e376e0b56667cf6f23ac259f6ca8f58) test(ghidra): require verified POSIX verifier cleanup - [`292c383`](https://github.com/morluto/rea/commit/292c3838a69933aa58e9e87abd929c6b9808fdff) Merge remote-tracking branch 'origin/main' into feat/1641-6502-raw - [`2b922e9`](https://github.com/morluto/rea/commit/2b922e9f310c94a42fc1b4c74fa218050e1c70aa) Merge upstream Windows CI fixture fixes - [`8336e96`](https://github.com/morluto/rea/commit/8336e96043dd2095a0772b2277249330fecda377) test(ghidra): verify 6502 low-memory raw imports - [`94df1ed`](https://github.com/morluto/rea/commit/94df1ed452d10daef51a00cba43ec9d25476af0e) docs(skill): document raw NMOS 6502 support - [`c70cf89`](https://github.com/morluto/rea/commit/c70cf8974648b6305276bcaf554706f4d2c8d893) chore: merge main and preserve raw 6502 type boundaries - [`fa602c3`](https://github.com/morluto/rea/commit/fa602c35a3b334355e03dfcc119af53694302046) chore: reconcile documentation with latest main - [`4cf97f4`](https://github.com/morluto/rea/commit/4cf97f483641ea18b65cbb034254c0ee59bb2ac1) fix(ghidra): preserve requested Windows raw source paths ### 📊 Changes **54 files changed** (+1649 additions, -196 deletions) <details> <summary>View changed files</summary> 📝 `.agents/skills/reverse-engineer-anything/references/native-and-artifacts.md` (+5 -2) 📝 `bridge/ghidra/ReaGhidraPrepareRaw.java` (+15 -2) 📝 `docs/cli.md` (+3 -1) 📝 `docs/ghidra-mips.md` (+1 -1) 📝 `docs/ghidra-riscv.md` (+2 -2) 📝 `docs/installation.md` (+4 -1) 📝 `docs/native-investigation.md` (+5 -2) 📝 `docs/raw-binary.md` (+53 -10) 📝 `docs/testing.md` (+10 -0) 📝 `docs/windows-ghidra-p0.md` (+11 -3) 📝 `experiments/analysis-efficiency/agent-trial.py` (+3 -1) 📝 `experiments/analysis-efficiency/test_codex_context.py` (+4 -1) 📝 `package.json` (+1 -0) ➕ `scripts/verify-real-ghidra-6502.mjs` (+479 -0) 📝 `src/application/BinaryTargetResolver.ts` (+7 -5) 📝 `src/application/DirectAnalysis.ts` (+6 -0) 📝 `src/application/binary/AnalysisSnapshotCache.ts` (+5 -0) 📝 `src/application/binary/BinarySession.ts` (+12 -0) 📝 `src/application/binary/BinarySessionExecution.ts` (+12 -4) 📝 `src/application/binary/BinarySessionOpen.ts` (+12 -6) _...and 34 more files_ </details> ### 📄 Description ## Summary Refs #1641. Support explicitly selected headerless NMOS 6502 images through REA's existing local Ghidra provider. The complete image must fit the 16-bit address space. ## Change and scope Use Ghidra's bundled 6502 language and verify the file-backed mapping, entry, and source bytes. Windows Ghidra admits the selected source before saved reads can replay; later reads can reuse the cache. Cartridge formats, bank switching, 65C02, and 65816 are outside this PR. ## Contract and boundary impact CLI and MCP accept `6502` with an explicit load address. Evidence records the selected language and measured mapping; nested Evidence and snapshot subjects reject `6502` for non-raw formats. Ghidra analyzes a private snapshot; original bytes remain unchanged. No new dependency or target-code execution. ## Validation performed - `npm run check:ci`, 40 focused CLI/MCP tests, `npm run docs:check`, and `npm run docs:build` passed. - Real Ghidra 12.1.4 on Windows passed source-built CLI/MCP, low-memory and full-64-KiB checks, file-offset decompilation, saved-snapshot junction rejection, and cleanup. Real Linux/macOS Ghidra runs remain unverified. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-31 00:57:57 +00:00
Sign in to join this conversation.
No milestone
No project
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#5009
No description provided.