REDIVIVUS

Proposals / #751

Return flag-word pointers through the Windows GFX-state accessors

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

Ghidra v1804 · 39698f0

Win 00625be0 STATLIST_GetUnitGfxFlags returns an address into the existing int* D2StatListExStrc.pStateFlags allocation, or null, while its current return type is int32_t. Its forwarding wrapper 00639f70 STATES_AssertGetGfxFlags preserves that full returned address and is also int32_t. All seven direct getter callers and the wrapper's sole caller use the result as word-array storage or a memory-copy source. Restore int* on both returns, preserving each chosen pUnit name, one dword stack argument, __stdcall RET4, all locals and every caller/producer definition. Complete original Windows byte equality and CFG return checks support this pointer contract. No Mac pair, shared layout change, runtime test or byte-match gain is claimed.

Changes 2, applied together

  1. Set prototype win 0x00625be0

    signatureint32_t STATLIST_GetUnitGfxFlags(D2UnitStrc * pUnit)→int * STATLIST_GetUnitGfxFlags(D2UnitStrc * pUnit)
    convention__stdcall
  2. Set prototype win 0x00639f70

    signatureint32_t STATES_AssertGetGfxFlags(D2UnitStrc * pUnit)→int * STATES_AssertGetGfxFlags(D2UnitStrc * pUnit)
    convention__stdcall