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

+1 -18
View File
@@ -87,21 +87,4 @@ with open(os.path.join(os.path.dirname(out), 'zhl_vtables.tsv'), 'w') as o:
name = nm.group(1) if nm else None
if name and name != 'skip': o.write('%s\t%d\t%s\n' % (cls, slot, name))
slot += 1
# struct fields from zhl: struct \t offset \t type name
with open(os.path.join(os.path.dirname(out), 'zhl_fields.tsv'), 'w') as o:
for f in sorted(glob.glob(os.path.join(zdir, '*.zhl'))):
struct_ = None
for l in open(f, errors='replace'):
m = structP.match(l)
if m:
struct_ = m.group(1)
b = re.search(r':\s*public\s+(\w+)', l)
if b: o.write('%s\tbase\t%s\n' % (struct_, b.group(1)))
m = re.match(r'^\s*([\w:<>,\s\*&]+?)\s*:\s*(0x[0-9a-fA-F]+)\s*;', l)
if not (m and struct_): continue
parts = re.findall(r'([^,:]+?)\s*:\s*(0x[0-9a-fA-F]+)', l.split(';')[0]) # "int _a : 0x0, _b : 0x4;" is two fields
ftype = parts[0][0].split()[:-1]
for decl, off in parts:
words = decl.split()
o.write('%s\t%s\t%s\n' % (struct_, off.lower(), ' '.join((words if len(words) > 1 else ftype + words))))
# struct fields: scripts/zhl_fields.py (keeps only the ones this exe confirms)