Problem
Ghidra's decompiler cannot recover names for some local variables and emits them as literal `UNNAMED`. These appear as-is in the decompiled C output:
UNNAMED = *(undefined1 *)((long)local_88 + *(long *)(local_88 + 4));
Root Cause
PcodeSerializer.java emits `UNNAMED` when `HighVariable.getName()` returns `"UNNAMED"`. The C++ pipeline stores and uses this string directly as the variable identifier.
In the JSON, these show up as:
DECLARE_LOCAL name=UNNAMED key=unique:00410216:22:0
DECLARE_LOCAL name=UNNAMED key=unique:0041021b:27:0
Proposed Fix
In `JsonDeserialize.cpp` or `FunctionBuilder.cpp`, when a variable name is `"UNNAMED"`, generate a synthetic name like `local_N` (using a counter or derived from the variable key).
Files
- `lib/patchestry/Ghidra/JsonDeserialize.cpp` — variable name handling (~line 715)
- `lib/patchestry/AST/FunctionBuilder.cpp` — DECLARE_LOCAL handler
Problem
Ghidra's decompiler cannot recover names for some local variables and emits them as literal `UNNAMED`. These appear as-is in the decompiled C output:
Root Cause
PcodeSerializer.java emits `UNNAMED` when `HighVariable.getName()` returns `"UNNAMED"`. The C++ pipeline stores and uses this string directly as the variable identifier.
In the JSON, these show up as:
Proposed Fix
In `JsonDeserialize.cpp` or `FunctionBuilder.cpp`, when a variable name is `"UNNAMED"`, generate a synthetic name like `local_N` (using a counter or derived from the variable key).
Files