Files
Thomas MartinandClaude Opus 5.5 c924b0dd3b Add build pipeline: ISO to recompiled C++ for the main ELF and 25 modules
tools/pipeline.py (host-side, stdlib only) chains extract -> wrap -> Ghidra
export -> ps2_recomp (fork) -> report, skipping up-to-date work.

- Ghidra runs in one headless session with the r5900 language forced and a
  project-local settings directory (XDG_CONFIG_HOME) holding the Emotion
  Engine extension: Python started through the Windows app alias sees a
  redirected %APPDATA%, so Ghidra lost the extension and silently fell back
  to generic MIPS64. The stage now fails on any other language.
- ghidra_scripts/PipelineExport.java: per-program output names for batches
- modules are recompiled in overlay module mode (module_name = modNNN)

First full run: 26/26 inputs, 7191 functions, 8.69M lines of C++, 0 errors.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-20 20:03:31 +02:00

22 lines
862 B
Java

// Runs PS2Recomp's ExportPS2Functions on the current program, deriving the output
// names from the program: <outdir>/<name>.toml and <outdir>/<name>_functions.csv
// (a trailing ".elf" is dropped). Lets one headless session export a whole batch.
// Args: <outdir>
// @category VP2S
import java.io.File;
import ghidra.app.script.GhidraScript;
public class PipelineExport extends GhidraScript {
@Override
public void run() throws Exception {
String outDir = getScriptArgs()[0];
String base = currentProgram.getName().replaceFirst("\\.elf$", "");
File toml = new File(outDir, base + ".toml");
File csv = new File(outDir, base + "_functions.csv");
runScript("ExportPS2Functions.java", new String[] { toml.getPath(), csv.getPath() });
println("pipeline export: " + base + " -> " + toml.getPath());
}
}