REDIVIVUS

Proposals / #1099

Type 32 S2C client handlers' packet argument as the D2GSPacketSrv struct for their opcode

checked · by dtchitt · submitted 2026-11-03

These client handlers take the packet as char * pBytes, so the source reads *(uint16_t*)(pBytes + 6), although each opcode already has a D2GSPacketSrv struct. This is the typing asked for in the review of 655 and applied for 0x65 and 0x8D in 797. Each handler is the slot for its opcode in the client handler table (007114d0, 12 bytes per entry: the opcode times 12 gives the entry, and the xrefs below check 19 of them). The dispatcher passes the packet bytes in ECX. Every offset each body reads was checked against the struct and lands on a field of the width used (for 0x11: dwUnitGUID at 2, the overlay id word at 6; for 0xA3: 13 reads, all fields). 0x27, 0x29 and 0x7E only pass the pointer on. The name pBytes is chosen, so it stays; pPacket would match 797. Left out: 0x5E and 0x8F, whose table slots point to other functions, and 0x9C and 0x9D, which share ECX with a second variable.

Changes 32, applied together

  1. Retype variable win 0x0045c8b0 ECX

    typechar *→D2GSPacketSrv0x01 *
  2. Retype variable win 0x0045cb90 ECX

    typechar *→D2GSPacketSrv0x09 *
  3. Retype variable win 0x0045cc10 ECX

    typechar *→D2GSPacketSrv0x0A *
  4. Retype variable win 0x0045d0f0 ECX

    typechar *→D2GSPacketSrv0x11 *
  5. Retype variable win 0x0045d160 ECX

    typechar *→D2GSPacketSrv0x15 *
  6. Retype variable win 0x0045d880 ECX

    typechar *→D2GSPacketSrv0x20 *
  7. Retype variable win 0x0045ddb0 ECX

    typechar *→D2GSPacketSrv0x22_0x23 *
  8. Retype variable win 0x0045de10 ECX

    typechar *→D2GSPacketSrv0x23 *
  9. Retype variable win 0x0045dfc0 ECX

    typechar *→D2GSPacketSrv0x26 *
  10. Retype variable win 0x0045e0a0 ECX

    typechar *→D2GSPacketSrv0x27 *
  11. Retype variable win 0x0045d3a0 ECX

    typechar *→D2GSPacketSrv0x29 *
  12. Retype variable win 0x0045e110 ECX

    typechar *→D2GSPacketSrv0x2C *
  13. Retype variable win 0x0045cbd0 ECX

    typechar *→D2GSPacketSrv0x51 *
  14. Retype variable win 0x0045e300 ECX

    typechar *→D2GSPacketSrv0x53 *
  15. Retype variable win 0x0045e400 ECX

    typechar *→D2GSPacketSrv0x57 *
  16. Retype variable win 0x0045e530 ECX

    typechar *→D2GSPacketSrv0x5C *
  17. Retype variable win 0x0045e540 ECX

    typechar *→D2GSPacketSrv0x5D *
  18. Retype variable win 0x0045e5d0 ECX

    typechar *→D2GSPacketSrv0x5F *
  19. Retype variable win 0x0045d390 ECX

    typechar *→D2GSPacketSrv0x62 *
  20. Retype variable win 0x0045e850 ECX

    typechar *→D2GSPacketSrv0x79 *
  21. Retype variable win 0x0045e8d0 ECX

    typechar *→D2GSPacketSrv0x7B *
  22. Retype variable win 0x0045e970 ECX

    typechar *→D2GSPacketSrv0x7E *
  23. Retype variable win 0x0045ea70 ECX

    typechar *→D2GSPacketSrv0x8C *
  24. Retype variable win 0x0045e580 ECX

    typechar *→D2GSPacketSrv0x91 *
  25. Retype variable win 0x0045d5e0 ECX

    typechar *→D2GSPacketSrv0xA3 *
  26. Retype variable win 0x0045d6a0 ECX

    typechar *→D2GSPacketSrv0xA5 *
  27. Retype variable win 0x0045ede0 ECX

    typechar *→D2GSPacketSrv0xA7 *
  28. Retype variable win 0x0045ee20 ECX

    typechar *→D2GSPacketSrv0xA8 *
  29. Retype variable win 0x0045ef60 ECX

    typechar *→D2GSPacketSrv0xA9 *
  30. Retype variable win 0x0045efa0 ECX

    typechar *→D2GSPacketSrv0xAA *
  31. Retype variable win 0x0045f120 ECX

    typechar *→D2GSPacketSrv0xAB *
  32. Retype variable win 0x0045f5f0 ECX

    typechar *→D2GSPacketSrv0xAE *