REDIVIVUS

Proposals / #1111

Type seven integer struct parameters from the offsets their bodies read (no typed caller)

checked · by dtchitt · submitted 2026-11-03

Each parameter is held as an integer but the body reads it only as the struct named, at offsets that match that struct's fields. None has a typed caller to copy from (most have no direct callers), so the claim rests on the field reads. D2COMP_LoadGuildEmblemIcon stores the DC6 at +0xBC and the two emblem colours at +0xC0/+0xC1 (pGuildEmblemImage, nGuildEmblemColor1/2). CurGateway returns +0xC, nCurGatewayIdx, the field SetCurGateway writes. ROSTER_CheckPlayerInSameParty compares the word at +0x22 (nPartyId) with -1 and with GetPlayerUnitPartyId. Q11_EndTaintedSun reads +0x18 (pQuestSpecificData) as its siblings typed D2QuestDataStrc do. DAMAGE_RollMinMaxDamageRange steps the seed at +0x20/+0x24 with 0x6AC690C5, D2UnitStrc.sSeed. MONSTER_FindUnitInPartySlot and its only caller check *pUnit is 0 or 1 (unit type), read +0xD0 nNodeTableIndex against 0xB, and index the game's pUnitNodes at +0x10F8.

Changes 9, applied together

  1. Retype variable win 0x005053a0 Stack[0x4]

    typeint32_t→D2CharSelCompStrc *
  2. Retype variable win 0x0042e690 Stack[0x4]

    typeint32_t→D2BNetGatewayAccessStr *
  3. Retype variable win 0x0047a120 ECX

    typeint32_t→D2RosterStrc *
  4. Retype variable win 0x0059a3c0 EAX

    typeint→D2QuestDataStrc *
  5. Retype variable win 0x0057d760 Stack[0x4]

    typeint32_t→D2UnitStrc *
  6. Retype variable win 0x005b1bc0 ECX

    typeint *→D2UnitStrc *
  7. Retype variable win 0x005b1bc0 EDX

    typeint32_t→SGAMEDATA *
  8. Retype variable win 0x005b1c00 ECX

    typeint32_t→SGAMEDATA *
  9. Retype variable win 0x005b1c00 EDX

    typeint *→D2UnitStrc *