REDIVIVUS

Proposals / #1039

Recover the Mac unit-to-act helper input and exact existing act result

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

Ghidra vmac 111 · 3cfe190

Mac 0x00076e9e currently declares an undefined result and undefined4 pUnit. Its actual caller supplies a D2UnitStrc and stores AL into that same unit's eAct field. Recover D2UnitStrc * pUnit and the existing eAct result while preserving the chosen names, one Stack[4] slot and __cdecl. Native unit hash lookup, discriminated path/room/level chain and five bounded level thresholds establish the unit input and act values 0..4. The caller uses AL then overwrites EAX; the enum claim comes from that producer and field consumer, rather than MOVZX alone. Nine recorded bodies total 721 code bytes plus 20 table bytes. All match separate assembly; current layouts and native frame/tail checks agree. Opaque calls have conditional fallthrough IF they return, including the explicit zero result after the assertion call. No helper, caller, shared type, ABI, name or arity changes; static Mac evidence only.

Changes 1, applied together

  1. Set prototype mac 0x00076e9e

    signatureundefined SCMD_GetActFromUnit(undefined4 pUnit)→eAct SCMD_GetActFromUnit(D2UnitStrc * pUnit)
    convention__cdecl