REDIVIVUS

Proposals / #964

Mac SKILLS_CastSkillClientArgsReversed: __cdecl int32_t (pUnit, eSkill, nSkillLevel, nOwnerGUID)

applied · by KierTaylor · submitted 2026-11-02, applied 2026-11-02

Ghidra vmac 111 · 3c6740e

Mac body is a wrapper with four stack arguments: [EBP+8] -> ECX (pUnit) and [EBP+0xc] -> EDX (eSkill) of SKILLS_CastSkillClient (__fastcc int32_t (pUnit, eSkill, nOwnerGUID, nSkillLevel)), while [EBP+0x14] is pushed as its nOwnerGUID and [EBP+0x10] as its nSkillLevel (the two are swapped, hence the name); the result is returned. Windows twin 0x004c6660 does the same swap (its third parameter, typed short * pArg1, is forwarded as the skill level). On Mac all four are on the stack.

Changes 1, applied together

  1. Set prototype mac 0x00081f19

    signatureundefined SKILLS_CastSkillClientArgsReversed(void)→int32_t SKILLS_CastSkillClientArgsReversed(D2UnitStrc * pUnit, eD2Skills eSkill, uint32_t nSkillLevel, int32_t nOwnerGUID)
    conventionunknown→__cdecl