Type PALSHIFT_GenerateShiftDuration’s input as a unit
Ghidra v1797 · 3bccb89
The ECX pUnitSeedBase input is a D2UnitStrc pointer, rather than a scalar or seed pointer. Sole caller UNIT_CreateMonster passes ECX=ESI at 0x004665ea. Complete caller CFG shows the only explicit ESI definition reaching the call is its AllocUnit result at 0x0046642c; that object is allocated as 0xf4 bytes and populated with unit type, class ID and GUID. The complete 84-byte helper reads unit+4 as nClassId and LEAs unit+0x20 as the embedded D2SeedStrc, then calls InitSeed_Param_666 and updates both seed dwords. These offsets match the existing unit layout. Null returns9; both exits are bare RET and EDX nSeedInput is preserved as the other input. Retype only existing ECX pUnitSeedBase to D2UnitStrc*, keeping its chosen name, return and convention. Full helper/caller/allocator/seed-init bytes match the original Windows PE. No runtime or byte-match benefit is claimed.
Changes 1, applied together
Retype variable
win 0x00477620 ECXtypeint32_t→D2UnitStrc *