REDIVIVUS

Proposals / #1164

Mac AnyPacketClickOnMap: __fastcc (pGame, pUnit, pPacket, nSize, pUnitTypeOut, pUnitIdOut)

checked · by KierTaylor · submitted 2026-11-05

Mac 0x00205b33 is "undefined (void)", convention unknown. Entry: EDI=EDX (unit). Stack: [EBP+8] packet bytes ([EAX+1] = unit type, compared with 5), [EBP+0xc] packet size (CMP 9), [EBP+0x10] and [EBP+0x14] out pointers zeroed at entry (0x00205b3e-0x00205b4a). Caller SCMD_0x02_WalkToEntity loads ECX=[EBP+8] (pGame), EDX=[EBP+0xc] (pUnit), stores [ESP]=[EBP+0x10] (pPacket), [ESP+4]=[EBP+0x14] (nSize) and two more, then tests EAX and reads its locals [EBP-0xc]/[EBP-0x10] as unit type and id for the next call (0x0020037e-0x002003b7). Windows twin 0x00549830 has the same six values and returns eD2ServerIncomingStatus.

Changes 1, applied together

  1. Set prototype mac 0x00205b33

    signatureundefined AnyPacketClickOnMap(void)→eD2ServerIncomingStatus AnyPacketClickOnMap(D2GameStrc * pGame, D2UnitStrc * pUnit, uint8_t * pPacket, size_t nSize, eD2UnitType * pUnitTypeOut, uint32_t * pUnitIdOut)
    conventionunknown→__fastcc