REDIVIVUS

Proposals / #703

Name item, object and shop parameters from their callees, and type two quest init arguments

applied · by dtchitt · submitted 2026-11-01, applied 2026-11-01

Ghidra v1799 · 2663303

Most names come from the callee parameter the value reaches, counted from pushes and registers. Three need a note. INV_HandleShopAction: ShopAction's _2 is nonzero for a 500 ms click throttle and an immediate transaction, zero for the confirm path, so bSkipConfirm. Q04_InitializeCainGibbetObject and Q11_OnViperAmuletInit: Objects_InitFn07 and Objects_InitFn20 move their D2ObjectInitFnArg * from ECX to EDX and tail JMP in, so EDX is pInitArg, not D2UnitStrc **. MONSTER_SetAlignmentCallback: [EBP+8]+0x60 is the unit's inventory. Chosen names that look wrong: MONSTER_SetAlignmentCallback sets no alignment, it returns 3 unless the value is 4 or 5, then whether that inventory slot is empty; INV_HandleShopAction's nAction reaches ShopAction's dwItemCost. Left out: PLAYER_InteractWithUnit (callee name is a GUID-or-Y union), OrficeStaffCheck, INV_HandleShopAction's dwParam2.

Changes 20, applied together

  1. Rename variable win 0x004c2540 Stack[0x4]

    namenParam1→nAnimMode
  2. Rename variable win 0x004c2540 BX

    namenParam12→nX
  3. Rename variable win 0x004c2540 DI

    namenParam22→nY
  4. Rename variable win 0x0055c9a0 Stack[0x4]

    namenParam→nUpdateType
  5. Rename variable win 0x00582420 EDI

    namedwParam→nClassId
  6. Rename variable win 0x00582280 EDI

    namenParam→nMonsterId
  7. Rename variable win 0x0058bec0 EDI

    namedwParam→nUnitGUID
  8. Rename variable win 0x004db1e0 Stack[0x4]

    namebParam→nDirection
  9. Rename variable win 0x00487ba0 Stack[0x8]

    namedwParam1→dwSell
  10. Rename variable win 0x00487ba0 ESI

    namedwParam3→bSkipConfirm
  11. Rename variable win 0x00487ba0 EAX

    namedwParam4→dwMode
  12. Rename variable win 0x005492c0 Stack[0x4]

    namenParam1→pUnit
  13. Retype variable win 0x005492c0 Stack[0x4]

    typeint32_t→D2UnitStrc *
  14. Rename variable win 0x005492c0 EAX

    namenParam2→nGridOffset
  15. Rename variable win 0x0059a3f0 EDX

    namenParam→pInitArg
  16. Retype variable win 0x0059a3f0 EDX

    typeD2UnitStrc * *→D2ObjectInitFnArg *
  17. Rename variable win 0x00594060 EDX

    namenParam2→pInitArg
  18. Retype variable win 0x00594060 EDX

    typeD2UnitStrc * *→D2ObjectInitFnArg *
  19. Rename variable win 0x0065f6a0 Stack[0x8]

    namenParam1→pProperty
  20. Rename variable win 0x0065f470 Stack[0x8]

    namenParam1→pProperty