REDIVIVUS

Proposals / #609

Type the Mac player-count filter input as a unit pointer

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

Ghidra vmac 105 · 3bccb89

PLAYER_CountPlayersWithFilter's second input is a D2UnitStrc pointer, currently int* pnFilter. The sole code caller loads D2ObjectOperateFnArg.pAttacker at+8 and passes it unchanged as argument2. The complete104-byte helper checks its unit type at+0 and copies it into the context's+4 pointer slot. The complete52-byte callback reads that slot and passes it as the first unit to the player-relationship flag lookup; no scalar-array interpretation occurs. Retype only Stack[8], preserving pnFilter, game input, cdecl and DWORD return. Full caller/target/callback and relevant iterator dataflow checked; additional incoming DATA is nonexecuting LINKEDIT. Mixed callback-context typing is outside this claim. Static Mac analysis only.

Changes 1, applied together

  1. Retype variable mac 0x001f878a Stack[0x8]

    typeint *→D2UnitStrc *