REDIVIVUS

Proposals / #1088

Type game server parameters held as int32_t as the game, damage, AI and packet list pointers their callers pass

checked · by dtchitt · submitted 2026-11-03

Eight game server parameters typed int32_t hold a pointer, and each body reads only fields of that struct at their width. CLIENT_SetPacketList clears pNext (0x204) of D2PacketListStrc and stores the parameter as the client's pPacketList. OBJECT_RollAndDispatchPopulateFn reads 0x4, 0x8 and 0xc of the D2ObjectRngStrc its one caller passes. OBJMODE_DropItemAtPosition copies wItemFormat (0x78) of SGAMEDATA into the item context and passes the same value on as an SGAMEDATA *; _oldSaveGameLoadingPart8_part1 passes bExpansion (0x70) to GetHirelingText. DAMAGE_ApplyUndeadBonusDamage adds to dwEnDmgPct (0xc) of D2DamageStrc. AI_BaalEvaluateCombatAction reads 0x14 of the D2AiGeneralStrc it is given, and it and AI_Diablo_DecideAction read nCmdArg[1] and nCmdArg[2] (0xc, 0x10) of a D2MonsterAiCmdStrc as an anchor point after a null check.

Changes 8, applied together

  1. Retype variable win 0x00539270 EDX

    typeint32_t→D2PacketListStrc *
  2. Retype variable win 0x00552400 EAX

    typeint32_t→D2ObjectRngStrc *
  3. Retype variable win 0x00585a80 ECX

    typeint32_t→SGAMEDATA *
  4. Retype variable win 0x00533bf0 ECX

    typeint32_t→SGAMEDATA *
  5. Retype variable win 0x0057b660 EBX

    typeint32_t→D2DamageStrc *
  6. Retype variable win 0x005fc630 Stack[0x8]

    typeint32_t→D2AiGeneralStrc *
  7. Retype variable win 0x005fc630 Stack[0x14]

    typeint32_t→D2MonsterAiCmdStrc *
  8. Retype variable win 0x005e8810 Stack[0x10]

    typeint32_t→D2MonsterAiCmdStrc *