REDIVIVUS

Proposals / #1233

Mac SAVE_SerializeInventoryItems: int __cdecl 8-arg prototype (pGame, pUnit, pInventory, pBuffer, nBufSize, ...)

checked · by KierTaylor · submitted 2026-11-05

Mac 0x002078e9 is "undefined (void)", convention unknown. Stack slots run to [EBP+0x24] (eight dwords) with no ECX/EDX use: [EBP+0x10] inventory (EDI, NULL-tested at 0x00207925), [EBP+0x14] output buffer ("JM" header word written at 0x0020791e), [EBP+0x18] buffer size (compared with 2 and 4, added to the buffer for the end pointer at 0x00207ee4), and [EBP+0x1c]/[EBP+0x20]/[EBP+0x24] forwarded unchanged as args 6-8 of each SAVE_SerializeItemIfValid (0x00207841) call (e.g. 0x00207c2b-0x00207c5a). Plain RET 0x00207f38. Same eight-slot shape as Windows twin 0x005317b0 int (pGame, D2UnitStrc* pUnit, D2InventoryStrc* pInventory, pBuffer, int32_t nBufSize, nParam2, nParam3, nParam4); the generic flags get fallback names because the checker refuses nParamN.

Changes 1, applied together

  1. Set prototype mac 0x002078e9

    signatureundefined SAVE_SerializeInventoryItems(void)→int SAVE_SerializeInventoryItems(D2GameStrc * pGame, D2UnitStrc * pUnit, D2InventoryStrc * pInventory, uint8_t * pBuffer, int32_t nBufSize, int32_t nTmp1, int32_t nTmp2, int32_t nTmp3)
    conventionunknown→__cdecl