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:
1 parent
d2b8a9229a
commit
5d1b595294
11 files changed
+5713
-1608
No files matched your search
@@ -4,7 +4,7 @@
|
||||
# build.sh --db (re-apply db/ to the project, re-decompile just the db functions into the dump, ~1 min)
|
||||
# build.sh --db --full (same, then redump everything, ~50 min: needed after db/fields.tsv changes)
|
||||
# Steps: import+auto-analysis -> ZHL sig/vtable names -> Lua-registration names -> NPC AI table
|
||||
# -> struct offsets re-anchored on getters -> struct/this types -> final dump.
|
||||
# -> REPENTOGON struct fields this exe confirms (getters, Lua field table) -> struct/this types -> final dump.
|
||||
set -e
|
||||
D="$(cd "$(dirname "$0")" && pwd)"
|
||||
export JAVA_HOME="$D/jdk" GHIDRA_MAXMEM=24G
|
||||
@@ -19,6 +19,9 @@ apply_db() { # db names -> struct types (zhl + db fields)
|
||||
grep -hv '^#' "$D/zhl_fields.tsv" "$D/lua_fields.tsv" "$D/db/fields.tsv" > "$D/build_fields.tsv" # later lines win
|
||||
G -process isaac-ng.exe -noanalysis -postScript ApplyTypes.java "$D/build_fields.tsv"
|
||||
G -process isaac-ng.exe -noanalysis -postScript ApplyLocals.java "$D/db/locals.tsv" # after types: names refer to that decompile
|
||||
P headers.py "$D/src/structs.hpp" "$D/zhl_fields.tsv" "$D/lua_fields.tsv" "$D/db/fields.tsv"
|
||||
echo '#include "structs.hpp"' | g++ -std=c++17 -fsyntax-only -I"$D/src" -x c++ - \
|
||||
|| echo "src/structs.hpp does not compile: a db/fields.tsv offset contradicts another" >&2
|
||||
}
|
||||
types_dump() { # final dump, built in dump.new and swapped in at the end so readers never see a half-written dump
|
||||
O="$D/dump.new"; command rm -rf "$O"
|
||||
@@ -59,8 +62,7 @@ G -process isaac-ng.exe -noanalysis -readOnly -postScript LuaAsm.java $LUA_REG "
|
||||
cat "$D/lua_names.tsv" "$D/lua_asm.tsv" | awk -F'\t' '!seen[$1]++' > "$D/lua_all.tsv"
|
||||
G -process isaac-ng.exe -noanalysis -postScript ApplyNames.java "$D/zhl_matches.tsv" "$D/zhl_vtables.tsv" "$D/lua_all.tsv"
|
||||
G -process isaac-ng.exe -noanalysis -postScript NpcTable.java $NPC_DISPATCH "$D/repentogon/libzhl/functions/Global.zhl" "$D/npc_ai.tsv"
|
||||
P fix_offsets.py "$D/dump/all.c" "$D/zhl_fields.tsv" "$D/zhl_fields.tsv.new" "$D/lua_all.tsv"
|
||||
command mv -f "$D/zhl_fields.tsv.new" "$D/zhl_fields.tsv"
|
||||
P zhl_fields.py "$D/dump/all.c" "$D/repentogon/libzhl/functions" "$D/lua_bindings.tsv" "$D/zhl_fields.tsv" "$D/lua_all.tsv"
|
||||
P lua_fields.py "$D/dump/all.c" "$D/lua_names.tsv" "$D/lua_asm.tsv" "$D/zhl_fields.tsv" "$D/lua_fields.tsv"
|
||||
apply_db
|
||||
types_dump
|
||||
Reference in new issue
Block a user