Struct fields only where this exe confirms them; 600 verified fields; generated src/structs.hpp

REPENTOGON targets 1.9.7.12 and its offsets drift, so they are no longer trusted by themselves:
scripts/zhl_fields.py (replaces fix_offsets.py) keeps a REPENTOGON field only when a getter or the
game's Lua field table confirms it, or it sits between two confirmed fields with the same shift.
8 agents verified the rest against code (Game/Manager/Entity_Player shift in steps; Room, ANM2,
EntityConfig unshifted). src/structs.hpp is generated from the confirmed fields with static_asserts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
shweetandClaude Opus 5.5 committed 2026-10-24 21:37:10 -04:00
1 parent d2b8a9229a
commit 5d1b595294
11 files changed
+5713 -1608

No files matched your search

+5 -2
View File
@@ -35,10 +35,13 @@ public class ApplyTypes extends GhidraScript {
if (depth > 8) return;
if (base.containsKey(cls)) addFields(s, base.get(cls), depth + 1);
for (String[] f : fields.getOrDefault(cls, List.of())) {
DataType dt = prim(f[2]);
java.util.regex.Matcher arr = java.util.regex.Pattern.compile("\\[(\\w+)\\]\\s*$").matcher(f[2]); // "int _trinketsID[2]"
String decl = arr.find() ? f[2].substring(0, arr.start()) : f[2];
DataType dt = prim(decl);
if (dt == null) continue;
if (arr.find(0)) dt = new ArrayDataType(dt, Integer.decode(arr.group(1)), dt.getLength());
int off = Integer.decode(f[1]);
String nm = f[2].replaceAll(".*\\s", "").replaceAll("[^\\w]", "");
String nm = decl.trim().replaceAll(".*\\s", "").replaceAll("[^\\w]", "");
try {
if (off + dt.getLength() > s.getLength()) s.growStructure(off + dt.getLength() - s.getLength());
s.replaceAtOffset(off, dt, dt.getLength(), nm, null);