[PR #3429] feat(binary): recognize XEX2 and PowerPC PE basefiles #5740

Open
opened 2026-10-31 01:09:04 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/3429
Author: @fengqiaoqu
Created: 10/14/2026
Status: 🔄 Open

Base: main ← Head: codex/issue-3118-xex2-ppcbe-pe


📝 Commits (2)

  • 430b12f feat(binary): detect XEX2 containers and admit Xbox 360 PowerPC PE basefiles
  • 6ed4a76 test(binary): verify XEX2 extraction guidance

📊 Changes

9 files changed (+117 additions, -26 deletions)

View changed files

📝 src/domain/binaryTarget.fixture.ts (+2 -3)
📝 src/domain/binaryTarget.test.ts (+29 -0)
📝 src/domain/binaryTarget.ts (+9 -2)
📝 src/domain/binaryTargetTypes.ts (+11 -1)
📝 src/domain/peMachine.ts (+10 -1)
📝 src/dotnet/ManagedPeReader.ts (+7 -1)
📝 src/ghidra/GhidraPowerPcProfile.test.ts (+24 -0)
📝 src/ghidra/GhidraPowerPcProfile.ts (+6 -4)
📝 src/ghidra/GhidraProvider.behavior.test.ts (+19 -14)

📄 Description

Summary

Recognize Xbox 360 input identity without enabling an unverified analysis lane. An XEX2 container now returns guidance to extract the decrypted PE basefile externally and open that file. A caller-supplied PE with COFF machine 0x01f2 (IMAGE_FILE_MACHINE_POWERPCBE) is represented as pe / powerpc.

The shared PE machine decoder owns the new family mapping. PE headers remain little-endian. Ghidra continues to reject PowerPC PE inputs, and its ELF-only profile helpers do not select a language for them; the managed PE reader also refuses this machine. REA adds no decryption, decompression, key handling, target execution, or mutation authority. The complete Xbox 360 Ghidra loader lane remains a follow-up to #3118; this PR covers only format recognition and actionable refusal.

Review correction

The XEX2 regression now requires extract the decrypted PE basefile externally and open that file instead, in addition to the container identity. Weaker redundant assertions were removed. A generic unsupported XEX2 basefile error can no longer pass the test. The producer message and its consumers needed no further refactor for this test-coverage finding.

Validation

  • Focused source tests for binaryTarget.test.ts, GhidraPowerPcProfile.test.ts, GhidraProvider.behavior.test.ts, and the 12 src/dotnet/*.test.ts files — 411 passed, 1 failed. The failure is lets a configured language replace the lane default, which reports an unavailable synthetic Ghidra installation on this Windows host. It fails identically against unchanged main runtime code (9 passed, 1 failed in the baseline profile file). This is a recorded host limitation, not a complete suite pass.
  • Negative control: temporarily replace the production guidance with unsupported XEX2 basefile. The strengthened test fails specifically on the extraction instruction; restore the source and it passes. Temporary mutations were fully restored.
  • npm run check — passed: compile, typecheck, formatting, lint, module boundaries, knip, metadata, and architecture guards; zero lint errors.
  • npm run docs:check — passed, including 5 README consistency tests.
  • Host: Windows, Node v24.18.0, npm 11.16.0. Fixtures are synthetic; no real Xbox 360 basefile or real Ghidra/IDA/Hopper analysis run was performed or claimed.

Refs #3118. No advertised CLI/MCP schema, installation, or generated metadata changes are authored in this PR.

Author readiness

Human owner: @fengqiaoqu

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

🔄 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/3429 **Author:** [@fengqiaoqu](https://github.com/fengqiaoqu) **Created:** 10/14/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `codex/issue-3118-xex2-ppcbe-pe` --- ### 📝 Commits (2) - [`430b12f`](https://github.com/morluto/rea/commit/430b12fdb88876ff77b4045a9220f79c48c2e284) feat(binary): detect XEX2 containers and admit Xbox 360 PowerPC PE basefiles - [`6ed4a76`](https://github.com/morluto/rea/commit/6ed4a7636ee18c3b0760315c7dd3e8ae0c4db3ea) test(binary): verify XEX2 extraction guidance ### 📊 Changes **9 files changed** (+117 additions, -26 deletions) <details> <summary>View changed files</summary> 📝 `src/domain/binaryTarget.fixture.ts` (+2 -3) 📝 `src/domain/binaryTarget.test.ts` (+29 -0) 📝 `src/domain/binaryTarget.ts` (+9 -2) 📝 `src/domain/binaryTargetTypes.ts` (+11 -1) 📝 `src/domain/peMachine.ts` (+10 -1) 📝 `src/dotnet/ManagedPeReader.ts` (+7 -1) 📝 `src/ghidra/GhidraPowerPcProfile.test.ts` (+24 -0) 📝 `src/ghidra/GhidraPowerPcProfile.ts` (+6 -4) 📝 `src/ghidra/GhidraProvider.behavior.test.ts` (+19 -14) </details> ### 📄 Description ## Summary Recognize Xbox 360 input identity without enabling an unverified analysis lane. An `XEX2` container now returns guidance to extract the decrypted PE basefile externally and open that file. A caller-supplied PE with COFF machine `0x01f2` (`IMAGE_FILE_MACHINE_POWERPCBE`) is represented as `pe` / `powerpc`. The shared PE machine decoder owns the new family mapping. PE headers remain little-endian. Ghidra continues to reject PowerPC PE inputs, and its ELF-only profile helpers do not select a language for them; the managed PE reader also refuses this machine. REA adds no decryption, decompression, key handling, target execution, or mutation authority. The complete Xbox 360 Ghidra loader lane remains a follow-up to #3118; this PR covers only format recognition and actionable refusal. ## Review correction The XEX2 regression now requires `extract the decrypted PE basefile externally` and `open that file instead`, in addition to the container identity. Weaker redundant assertions were removed. A generic `unsupported XEX2 basefile` error can no longer pass the test. The producer message and its consumers needed no further refactor for this test-coverage finding. ## Validation - Focused source tests for `binaryTarget.test.ts`, `GhidraPowerPcProfile.test.ts`, `GhidraProvider.behavior.test.ts`, and the 12 `src/dotnet/*.test.ts` files — 411 passed, 1 failed. The failure is `lets a configured language replace the lane default`, which reports an unavailable synthetic Ghidra installation on this Windows host. It fails identically against unchanged main runtime code (9 passed, 1 failed in the baseline profile file). This is a recorded host limitation, not a complete suite pass. - Negative control: temporarily replace the production guidance with `unsupported XEX2 basefile`. The strengthened test fails specifically on the extraction instruction; restore the source and it passes. Temporary mutations were fully restored. - `npm run check` — passed: compile, typecheck, formatting, lint, module boundaries, knip, metadata, and architecture guards; zero lint errors. - `npm run docs:check` — passed, including 5 README consistency tests. - Host: Windows, Node v24.18.0, npm 11.16.0. Fixtures are synthetic; no real Xbox 360 basefile or real Ghidra/IDA/Hopper analysis run was performed or claimed. Refs #3118. No advertised CLI/MCP schema, installation, or generated metadata changes are authored in this PR. ## Author readiness Human owner: @fengqiaoqu - [x] I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work. - [x] I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps. - [x] I declare this PR ready for initial maintainer review. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
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#5740
No description provided.