Name generic parameters of item stat, belt, equip and save data functions
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
Rename variable
win 0x0065ea50 EDXnamenParam22→dwFlagsRename variable
win 0x0065ea50 Stack[0x10]namenParam→nStatIdRename variable
win 0x0065ea50 Stack[0x14]namenParam12→nSubIndexRename variable
win 0x0065ea50 Stack[0x18]namenParam3→nValueRename variable
win 0x0065ea50 Stack[0x1c]namenParam4→nStateRename variable
win 0x0063de60 Stack[0x10]namenParam2→bSkipRequirementsCheckRename variable
win 0x0063c7f0 Stack[0x8]namenParam→nBeltSlotRename variable
win 0x0055c730 Stack[0xc]namenParam→bUpdateResourceStatsRename variable
win 0x00558cb0 Stack[0xc]namenParam1→bCheckItemHeader