ApplyTypes grows each struct to its RTTI size: this[1] misreads 1363 -> 941, prototypes applied 3266.
scripts/source_tree.py now writes src/game/classes.hpp (477 classes, every free and namespace function declared,
Ghidra p-code intrinsics as macros) and one .cpp per class with its decompiled method bodies; member calls become
direct calls ((Class *)(obj))->Class::method(args) and field_0xN bytes explicit offsets. --check compiles the tree:
652/3315 method bodies compile against the header (19.7%), the rest mostly need the data globals and Ghidra types
DumpAll exports from the next build. CLAUDE.md is untracked (gitignored).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
classes.tsv (vtable.py --classes): 194 RTTI classes with vftable, direct bases (offsets from the PMD), vtable slots and,
for 176, the exact size from the deleting destructor's sized delete. Sizes flow into structs.hpp (static_assert sizeof)
and, next build, into Ghidra's structs (ApplyTypes 'size' rows) so this[1]._x stops standing in for the tail.
scripts/source_tree.py generates src/game/classes.hpp: 293 classes with real bases, vtables in slot order (overrides,
REPENTOGON slot names, vfunc_N placeholders), fields at their offsets, 2400 method declarations; it compiles with
clang --target=i686-pc-windows-msvc and all 174 sizeof / 1899 offsetof asserts hold. Round 26's prototypes are held.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Prototypes applied 3163 -> 3241, rejected 113 -> 35 (a locals row had named the stand-in local like the parameter).
Round 25 agents may fix wrong names and retype in place (39 same-name rows). Dropped the row naming Level::load_room's
this 'pit'; locals_round.py no longer merges renames of this. Round 25's prototypes are held in db/protos.zhl.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Purge unknown 139 -> 11, prototypes applied 3032 -> 3163 (round 24's 12 included), param_N lines 33145 -> 31116,
in_ECX 35059 -> 32432; Room::Update/Render get a typed this. ApplyLocals: a same-name row with a type retypes in place,
and an unparseable type fails only its row. notes/decomp_issues.md collects what the round 23-24 agents found wrong.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Round 23: 2490 locals in 50 functions (default names there 5761 -> 2946). Round 24: 1116 locals in 79 more.
3032 prototypes applied. db/protos.zhl also holds round 24's 12 prototypes for the next build.
scripts/locals_round.py: pick / locals / protos steps of a locals round (the /tmp copies were lost in a reboot).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
3899 of 3920 db/locals.tsv names now show in the dump (UseCard's 56 still wait). Delirium, Heretic, Reap Creep,
Entity_Effect::Render, Game::BombTearflagEffects, Menu_Stats, ... plus 18 prototypes from round 11.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
UsePill, Game::Render, Entity_Laser::update_laser, Room::render_water, the Beast, CreateGlitchedCollectible, the NPC
dispatcher, ... Entity_Player::UseCard still fails in ApplyLocals ('Bad instruction count exceeded', not the instruction
limit: raising it did not help), so its 56 rows wait.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Entity_Player::UseActiveItem/update_effects/EvaluateItems/Update/TakeDamage, Entity_Tear::Update, Entity_Familiar::Update,
EntityConfig::LoadEntities, Room::Init, Level::place_special_rooms, Hush, Mega Satan, ... (only single-role variables:
damageSource, isPenalized, genRng, secretRoomIdx, daemonsTailRng). Entity_Player::UseCard's 56 rows did not apply
(ApplyLocals could not decompile it this run; it now prints the decompiler's error).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Ghidra had KAGE_LogMessage marked non-returning, so ~1,200 functions were cut off at their first log call. ApplyProtos
clears the flag on any function with a RET, re-disassembles after its calls and regrows the callers: 'does not return'
5337 -> 2355 (all genuine: _invalid_parameter_noinfo_noreturn, _Xlen, _CxxThrowException), dump 1.235M -> 1.299M lines.
596 more prototypes, ~20% with REPENTOGON register notation: param_N lines 44610 -> 42588, in_XMM 1237 -> 734.
12 renames from the agents (HUD::LoadGraphics at 008ed350 = Menu_OnlineLobby::load_member_sprite, Room::MamaMegaExplosion
= Weapon::fire_bomb, vector_iterate_noop = PlayerManager::get_total_luck, log_room_transition = RoomTransition::start, ...).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Whole-program optimisation passes many floats in XMM registers and some arguments in ECX/EDX with the caller popping the
stack; those declarations were skipped. Every prototype is now applied with explicit storage (this in ECX for __thiscall).
Tested on a project copy: 1103 -> 1158 applied from the existing files (REPENTOGON's register declarations now fit),
e.g. void __thiscall Game::SetBloom(Game *this,int Time,float Strength).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every db/protos.zhl line is checked against the callee's RET n. Typed parameters make more pointers typed: named
->members 104k -> 115k (field_0x 3946 -> 4576 as newly typed pointers show their unknown members), param_N lines
47349 -> 44610. 83 targets skipped: XMM float args/returns or ECX/EDX + caller-cleaned stack (whole-program optimisation).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
field_0x 5868 -> 3946, named ->members 99k -> 104k, unnamed code 19% -> 13.5% of bytes, 9132 FUN_ left.
LayerState/ChallengeParam/DailyChallenge/Menu_Online/GameStateItemPool/ItemPool_Item/BackwardsStageDesc, left in Ghidra by
an early unfiltered import, now come from 86 verified rows (all offsets held; GlowingHourglassState's tail is +0x188 here).
Corrections: libpng/libjpeg/libvorbis misnames, wrong ZHL matches (Manager::ResizeWindow = Cutscene::ANM2Part::Update,
NPCAI_Pathfinder::EvadeTarget = netplay), GameOver::Show, Level::load_room. std::vector<bool> is 0x10 (bit count).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ApplyTypes: std_vector/string/deque/map/set/list members get MSVC layouts (_begin/_end/_capacity ...), structs used as a
member type are built even when small (BitSet128 _tearFlags._l, KColor, RNG were dropped), structs padded to a multiple
of 4 (PlayerCostumeMap stride 0x10). headers.py prints STL members at their real size and pads to the alignment.
Round 6: 99 fields (Manager ItemConfig lists/InfoDisplay/lobby settings, Game transitions/PreloadManager, PersistentGameData
arrays, HomingLaser, EntityList), 500 names, 6 corrections (Menu_Challenge::Render, Level::compute_room_distances, ...).
9622 FUN_ left, in_ECX + 0x 17363 -> 16720.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Shows &g_game->_deathmatchManager (462 uses of field_0x26614) and lets ItemConfig grow past a 4-byte stub, so Manager
accesses read (g_manager->_itemConfig).field_0xc. Takes effect on the next build.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The FUN_ placement (1d43433) fit any small-offset function to a dense class: 29 library functions went to OptionsConfig,
ScoreSheet/Popup/NightmareScene/Room code to Entity_Player or Entity. Reverted, and the 72 placed functions moved back to
global. Corrections include wrong ZHL signature matches (Entity_Familiar::RestoreState is a libpng writer,
Entity_Pickup::TriggerShopPurchase a netplay message reader, LoadArchiveFile is Gamepad_processEvents) and
theora/vorbis/miniz misnames. 10134 FUN_ left; raw in_ECX + 0x 17363 (+1.1k from the un-placing).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
g_game/g_manager typed: 1483 g_manager-> and 834 g_game-> member accesses now visible (field_0x 10636 -> 14385 counts them);
named members 81k -> 91k, raw in_ECX + 0x 18425 -> 16225. ApplyGlobals takes array types (char[5]).
apply_db.py used to truncate all.c before computing the new text, so a killed build left it empty.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Entity _mass (0x2d4) and _depthOffset (0x2b0) were REPENTOGON fields kept by bracketing and both wrong
(Lua getters read 0x37c / 0x358). Bracketed fields now need direct confirmation; 155 are being re-verified.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Entity._sprite (ANM2, now its full 0x114) was being overwritten by _spriteOffset/_spriteScale/_isFlipX,
which are sprite members; every sprite access had fallen back to field_0x48/0x78/0x7c/0x8c.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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>
Entity_Player::Update, RoomTransition::ChangeRoom, PlayerHUD::RenderHearts, ReviveFromTrinket,
Menu_Game::Update, MenuManager::Render were on the wrong functions; real Beast and Scourge bodies
found; the Lua Font table was attributed to KColor; Weapon vtable slots from the exe's RTTI.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- db/names.tsv: 163 names from src/anm2 and src/rooms labels (2 fix wrong ZHL names)
- ApplyTypes: embed known structs (Entity._sprite is an ANM2) instead of skipping them
- scripts/lua_fields.py -> lua_fields.tsv: 96 fields from the game's own Lua getters
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Ghidra 12.2 project and full dump of isaac-ng.exe v1.9.7.17, query scripts, notes
indexed by entity, anm2/rooms reimplementations, and db/ (names + fields) that
build.sh re-applies. Fixes awk numeric address comparison in find.sh/decompile.sh.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>