wip(phase-33): B5 Ghidra regenerability — ExportAnnotations.java + ghidra_export_annotations.sh PROVEN (all 129 programs exported to byte-stable JSONL in 18.5 s), ghidra_annotations_delta.py (live − baseline), ImportAnnotations.java + ghidra_rebuild.sh WRITTEN but unproven (the resident rebuild hit an OSGi script-bundle load error — a compile error in the new importer breaks every script in the dir; the known bad LocalVariableImpl ctor is named in CURRENT_PHASE); Makefile print-% + GHIDRA_PROJ repo-relative; the six ghidra_*.sh repo-relative (BFM_GHIDRA_PROJ); DefineFunctions arg path; ImportPsyqGdt install-dir default; ExportSymbols R15 fix; scratch project under build/ (Ghidra refuses '.'-prefixed path components); SETUP P33 B5 section; checkpoint refreshed for the next session (S86 paused at 87% context)

This commit is contained in:
Drew T
2026-09-06 19:31:34 -06:00
parent 707ec491e4
commit cabab00c0e
17 changed files with 1036 additions and 31 deletions
+6 -2
View File
@@ -18,8 +18,12 @@ import java.util.List;
public class DefineFunctions extends GhidraScript {
public void run() throws Exception {
String prog = currentProgram.getName();
Path in = Paths.get(System.getProperty("user.home"), "bfm-decomp", ".run", prog + "_funcs.txt");
if (!Files.exists(in)) { println("DefineFunctions: no list at " + in); return; }
// P33 B5: the list path is arg 1 (tools/ghidra_rebuild.sh passes .run/ghidra_rebuild/<prog>_funcs.txt);
// without an arg the historical location .run/<prog>_funcs.txt under the CWD (the repo) is used —
// no more `user.home/bfm-decomp` assumption.
String[] args = getScriptArgs();
Path in = (args != null && args.length > 0) ? Paths.get(args[0]) : Paths.get(".run", prog + "_funcs.txt");
if (!Files.exists(in)) { println("DefineFunctions: no list at " + in.toAbsolutePath()); return; }
List<String> lines = Files.readAllLines(in);
int created = 0, existed = 0, failed = 0;
for (String ln : lines) {