REDIVIVUS

Proposals / #717

Name generic parameters of item stat, belt, equip and save data functions

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

Ghidra v1805 · 8293ab3

Each name comes from a callee parameter the value reaches, or from what the function tests it for. ITEMMOD_AddStatToItem: the word at [EBP+0x14] indexes ItemStatCost and is pushed as eUnitStat, EDX reaches GetOrCreateStatList's nFlags, [EBP+0x20] its nState, and [EBP+0x1c] is shifted by the ItemStatCost bit count and passed as nValue. Not fully proven: nSubIndex, because only one of the two stat adders names that argument. The other four are flags or an index read directly from the machine code. Chosen names that look wrong: ITEMMODE_UnequipItemStats's pUnit (EDX) is the item, type 4 checked at 0055c74d, and pItem is the owner, so they look swapped; ITEM_CreateFromSaveData's pUnitDataItemDetails is also written as an out flag at 0062e484.

Changes 9, applied together

  1. Rename variable win 0x0065ea50 EDX

    namenParam22→dwFlags
  2. Rename variable win 0x0065ea50 Stack[0x10]

    namenParam→nStatId
  3. Rename variable win 0x0065ea50 Stack[0x14]

    namenParam12→nSubIndex
  4. Rename variable win 0x0065ea50 Stack[0x18]

    namenParam3→nValue
  5. Rename variable win 0x0065ea50 Stack[0x1c]

    namenParam4→nState
  6. Rename variable win 0x0063de60 Stack[0x10]

    namenParam2→bSkipRequirementsCheck
  7. Rename variable win 0x0063c7f0 Stack[0x8]

    namenParam→nBeltSlot
  8. Rename variable win 0x0055c730 Stack[0xc]

    namenParam→bUpdateResourceStats
  9. Rename variable win 0x00558cb0 Stack[0xc]

    namenParam1→bCheckItemHeader