REDIVIVUS

Proposals / #673

Correct the roster-display helper’s unit input and GUID local

applied · by Commit-Will · submitted 2026-11-01, applied 2026-11-01

Ghidra v1797 · 3bccb89

pPetEntry@EAX is a D2UnitStrc pointer. Sole caller DRAW_UnitUnderMouse saves its typed unit input in ESI, dispatches on unit type, then MOV EAX,ESI at0x004550f4 supplies this helper. Complete168-byte helper reads unit GUID at+0xc and animation mode at+0x10, matching the existing unit layout. Its persisted nOwnerGUID@ECX local is also mis-typed as D2RosterStrc*: both definitions write a full32-bit scalar, either that GUID or0xffffffff, and the sole use passes it to GetRosterOwnerGUID(DWORD). Retype only the EAX input to D2UnitStrc* and that ECX local to DWORD. All names, custom EAX/EBX inputs, stacked outputs, uint32_t return and convention remain. Full target/caller/lookup bytes, all six caller switch entries and reaching definitions were independently verified against the original Windows PE. The misleading chosen name pPetEntry is preserved; no runtime or byte-match gain is claimed.

Changes 2, applied together

  1. Retype variable win 0x00452c70 EAX

    typeint32_t→D2UnitStrc *
  2. Retype variable win 0x00452c70 ECX

    typeD2RosterStrc *→DWORD