Repository navigation
Conversation
Move the bounded, read-only fingerprinting of a caller-installed Ghidra processor extension out of the PSP module into GhidraProcessorExtension, parameterized by directory id, refusal label, profile name, failure code, required files and an optional installed-state check. The PSP wrappers keep their exports, refusal messages and PSP_EXTENSION_UNAVAILABLE code; the existing PSP boundary tests pass unmodified. The inspection now also retains each file's whole-millisecond mtime and first eight bytes for specification-owned checks; neither enters the content identity.
…tionengine-reloaded Add a bounded PS2 profile to the existing Ghidra provider, following the PSP precedent. The R5900 machine declaration (EF_MIPS_MACH_5900) selects it; filenames and entry addresses do not. Admission is limited to Linux x64 and little-endian ELF32 ET_EXEC MIPS III images declaring either: - n32 with the R5900 ABI flags record that ps2dev v2.0.0 PS2SDK emits, or - EABI64, the legacy-SDK header shape, with that record or with an inspected absence of every ABI declaration. Other ABIs, PIC/ASE/FP64/NAN2008 bits, unknown records, incomplete inspections and caller language overrides are refused before extension discovery. Generic MIPS, PSP and IOP headers keep their lanes. The import pins ElfLoader, r5900:LE:32:default and the default compiler specification, and the session handshake checks the observed language. The caller-installed extension is fingerprinted at profile resolution and again before launch; missing or incompatible installations fail with PS2_EXTENSION_UNAVAILABLE. Release archives ship only SLEIGH sources and Ghidra recompiles a missing, wrong-format or stale r5900.sla inside the installation, so REA requires a precompiled format-4 file that is not older than its .slaspec/.sinc sources. Evidence carries the support lane, ABI declaration, extension identity and limitations for MMI/VU0 decompilation, the single R5900 calling convention and the extension's synthetic memory blocks and RAM mirrors.
Add source-owned PS2 fixtures under tests/conformance/ps2: a standard PS2SDK n32 executable and a freestanding EABI64 control linked without an ABI flags record. Neither is executed and neither contains game data. scripts/verify-real-ghidra-mips.mjs gains --ps2 and --ps2-missing-extension. GNU readelf/objdump independently supply the header, raw ABI record, symbols and probe encodings. Public MCP and CLI must report the observed ElfLoader/r5900 language, known functions, a direct call, the leaf's caller and call-site xref, exact bytes and mnemonics for ADDIU, MMI PADDW/PCPYLD, R5900 MULT and VU0 VADD.xyzw, a global word, the marker string (allowing EE RAM mirrors), Evidence limitations, snapshot reopening, an A-B-A target switch and verified process cleanup. Without the extension both adapters must return PS2_EXTENSION_UNAVAILABLE. expectedMipsElfProfile now accepts an inspected ABI-record absence.
Describe the admission boundary, the bring-your-own extension with its required precompiled r5900.sla, the public CLI/MCP use, Evidence and limitations, and the real verification lane and its tested versions.
Map the build directory out of debug information at compile and link time. PS2SDK libraries are LTO objects whose link-time units otherwise record the build directory, so the verifier's temporary workspace changed the fixture digest on every run. Two builds in different directories are now byte-identical with ps2dev v2.0.0.
Every PS2 observation repeats the profile limitations, so their length is paid on each MCP call. In a God Hand investigation each callers/callees response was about 5.6 KB, of which the PS2 text was 1.1 KB. State each fact once and briefly and drop the language ID, which Evidence already carries as a profile parameter: 1110 -> 753 bytes per response, same facts, same phrases checked by the tests and the real verifier. Validation: ghidraPs2Extension, ps2-checks and psp-checks tests (96 passed); check:fast; real verify-real-ghidra-mips.mjs --ps2 passed.
Report the out-of-suite run on 11 EE executables from 7 caller-owned discs. All declare the legacy-SDK EABI64 shape, are admitted and analyse as r5900:LE:32:default, including a Metrowerks CodeWarrior build whose symbol table names every function. Two tasks hit REA's general MCP response budget rather than a profile limit. Replace the statement that no commercial executable was verified.
3 tasks done
3 tasks done
Owner
|
Thanks for documenting the differences from #5240. Both proposals affect the same PS2 profile and extension owner, with different ABI admission and verification evidence. Please coordinate on one integration path so the supported declarations and retained real-provider coverage are reviewed together. Both remain open while the scope is settled. |
3 of 22 tasks
5 of 29 tasks
2 tasks done
Owner
|
Thanks for the PS2 profile and for documenting the differences from #5240. Closing this as a duplicate: both proposals own the same Emotion Engine profile and extension, #5240 is the one still being updated, and this draft has conflicted with main since the coordination request on October 26. Please bring any ABI admission or verification evidence that #5240 lacks to that PR. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Every provider refuses PlayStation 2 Emotion Engine executables: MIPS ELF32
files that declare
EF_MIPS_MACH_5900fail with "Machine-specific MIPSvariants … need a separately supported processor profile". This adds a bounded
PS2 profile to the existing Ghidra provider, following the PSP precedent. REA
pins the language of the caller-installed
ghidra-emotionengine-reloaded
extension and fingerprints the extension, but never installs it.
Related: #5240 takes a similar approach for legacy ee-gcc retail executables.
This PR is kept separate so each can be reviewed on its own. The differences
are listed under "Change and scope".
Problem and expected behavior
rea function <PS2 ELF> <name> --provider ghidrafails witharchitecture_unsupported. With the extension installed and itsr5900.slaprecompiled, CLI and MCP:
ps2-ee-elf32-exec-r5900-v1;ElfLoader/r5900:LE:32:default/default;operations.
Without the extension they fail with
PS2_EXTENSION_UNAVAILABLEand aninstallation remedy.
Change and scope
GhidraProcessorExtension.ts: the PSP extension inspection, generalized andparameterized by id, label, profile, failure code, required files and an
optional installed-state check. PSP exports, messages and identity are
unchanged.
GhidraPs2Profile.ts/GhidraPs2Extension.ts: admission and the extensionspec. Admitted targets run on Linux x64 hosts and are little-endian ELF32
ET_EXEC, R5900 machine, MIPS III, with only NOREORDER/CPIC hints, andeither:
after every declaration table was inspected.
Everything else is refused: o32/EABI32/mixed ABIs, PIC/ASE/FP64/NAN2008,
unknown records, incomplete or carved inspections, and caller language
overrides.
Precompiled SLEIGH requirement. Release archives ship only sources, and
Ghidra 12.1
SleighLanguagerecompiles a missing, wrong-format or stale.slainside the installation. REA refuses anr5900.slawithout theformat-4 header or older than its
.slaspec/.sincsources. Analysistherefore never modifies the installation, and the fingerprint stays stable.
Wiring:
The PS2 limitations are kept short because every response repeats them.
tests/conformance/ps2/fixtures,--ps2/--ps2-missing-extensionmodesfor
scripts/verify-real-ghidra-mips.mjs, anddocs/ghidra-ps2.md.Not included: IRX/ERX, relocatable or shared images, ISO and other
containers, runtime overlays, VU microprograms, emulation, non-Linux-x64
hosts, and static recompilation.
Differences from #5240:
carries an ABI flags record.
r5900.slainstead of letting Ghidrawrite into the installation.
#5240 also admits an unspecified-ABI header. This PR does not, because no
producer evidence for that shape was available.
Contract and boundary impact
(
ghidraProcessorUnsupportedReason), then analysis-profile resolution.of a new processor family through an existing provider. No maintainer
decision yet; feedback welcome.
targets and the new failure code
PS2_EXTENSION_UNAVAILABLE.Linux x64 only; bridge unchanged. Generic MIPS, PSP and IOP (R3000)
headers keep their lanes or refusals.
mips_support_lane,ps2_abi_declaration,ps2_extension, and the pinned loader, language and compiler;applicable (static import; ephemeral project as before).
Expected effects:
.mdebugtargets,the caller-installed extension's STABS analyzer runs its bundled
stdump, as installed Ghidra code. This is documented and can bedisabled with
REA_GHIDRA_DISABLED_ANALYZERS.Evidence and regression coverage
tests/boundary/filesystem/ghidraPs2Extension.test.ts;tests/conformance/ghidra/ps2-checks.test.ts;tests/conformance/ghidra/mips-checks.mjs, which now accepts a null ABIrecord.
fixtures are refused as machine-specific MIPS variants.
e312d08b…, legacy EABI64dcc503da…):r5900:LE:32:default/default;li,paddw,pcpyld, three-operandmultandvadd.xyzw;its EE RAM mirrors;
repository). This was 11 EE executables from 7 discs: 6 USA titles from
2003–2006 and one modified disc.
0x20924000/0x20924001)with no record and are admitted.
r5900:LE:32:defaultand their entryfunctions decompile. They have 4,183–28,022 procedures each.
recovered from its symbol table; its runtime overlay sections stay outside
the image, as documented.
profile limit: a 28k-function string list, and the load image of the
CodeWarrior title with 56,477 relocations. A separate issue will propose
smaller responses.
god-hand-decomp record. With that project's function list as
REA_GHIDRA_SEED_FILEseeds:at the exact address;
jaldecoding (902/902 on the most-calledfunction);
.text).For evidence-bearing changes:
Validation performed
All on this branch, rebased onto
main47353e494; the branch also merges cleanly withb7f8bbb49, whose 5 newer commits touch no PS2, Ghidra, ELF or MIPS files. Environment: WSL2 Ubuntu24.04 (Linux x64), Node 24.18, Temurin JDK 21, Ghidra 12.1.3.
npm ci && npm run build:cached— passed.npm run check— passed (lint 0 errors, module boundaries, architecture guards).npm run test:focused -- <34 Ghidra extension/conformance/provider test files>— 945 passed, 1 skipped.node scripts/verify-real-ghidra-mips.mjs --ps2— passed (256 s).node scripts/verify-real-ghidra-mips.mjs --ps2-missing-extension— passed.node scripts/verify-real-ghidra-mips.mjs --psp(ghidra-allegrex v21.4, PSPDEV v20261001) — passed (186 s);--psp-missing-extension— passed.npm run docs:check/npm run verify:test-discovery— passed (re-run for the docs update).and Allegrex extensions installed — passed for 6 fixtures. The generic
MIPS32r2 control is still observed as
MIPS:LE:32:default, and theIOP-shaped R3000 ELF is still refused.
npm run check:pron the pre-rebase branch: 18 tests in 10 filesfailed. All of them are outside Ghidra/MIPS/PSP/PS2 and fail identically, or
flakily, on unmodified
mainin this environment (Kuna, WindowsHandleClose,ciStaticArtifacts, runtime URL mapping, mutation workflow, symlink race).
Compatibility, safety, and release
Linux x64 (WSL2). Windows and macOS hosts are refused for this profile.
extension is identified by content, not signed or sandboxed. The
.slafreshness rule keeps analysis from writing into the installation.
Author readiness
Human owner:
Before merge
type(scope): outcome.