• Welcome to Valhalla Legends Archive.
 

D2GS Packet Research

Started by Ringo, June 02, 2005, 07:09 PM

Previous topic - Next topic
|

Warrior

Quote from: effect on March 09, 2006, 11:52 PM
Islam is a steaming pile of fucking dog shit. Everything about it is flawed, anybody who believes in it is a terrorist, if you disagree with me, then im sorry your wrong.

Quote from: Rule on May 07, 2006, 01:30 PM
Why don't you stop being American and start acting like a decent human?

NetNX

#76
woot i did it PSCODE OWNS


Edit: Goddamnit... Dosen't work right :'(

Ringo

Hi
Iv had alot to do lately so havent had noooo time for bnet.
But for almost a week now (Since last friday) server side warden has been turned off.
I updated 4 C > S packets in my chat bot, and it works as flawless as it did in 1.10!

Shame i got no time for d2 at the moment :(

LivedKrad

Quote from: Ringo on June 14, 2005, 09:23 PM
D2 1.10 Level ID's/Map sizes
ID  = Level's ID
sX  = Size X
sY  = Size Y
osX = Off Set Size X
osY = Off Set Size Y

Note:
Each set of 4 means that the area in question can be differnt (4 possible sides) in witch the X and Y and offset X and Y will give you an idea of the total square size of the map/level in witch the area sits;

Example;
Town is always right sided (WP on the right)
Bloodmoor has a 4 side dementions (based on sides of the town area that takes you to it) and all of them can go in 2 possible directions.
etc etc

Act 1:

ID    sX    sY    osX   osY   Name
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1     56    40    -1    -1    Town
1     0     80    80    -1    Wilderness
2     0     80    80    1000  Wilderness
3     0     80    80    1000  Wilderness
4     0     80    80    -1    Wilderness
5     0     80    80    -1    Wilderness
6     0     80    80    -1    Wilderness
8     200   200   1500  1000  Cave 1
9     200   200   1500  1300  Cave 2
10    200   200   1500  1600  Cave 3
11    200   200   1500  1900  Cave 4
12    200   200   1500  2200  Cave 5
13    24    24    1500  2500  Cave 2 Treasure
14    24    24    1500  2624  Cave 3 Treasure
15    24    24    1500  2748  Cave 4 Treasure
16    24    24    1500  2872  Cave 5 Treasure
17    40    48    -1    -1    Graveyard
18    200   200   2000  1000  Crypt 1 A
19    200   200   2000  1300  Crypt 2 A
20    8     8     2000  1600  Tower 2
21    200   200   2500  1000  Crypt 3 A
22    200   200   2500  1300  Crypt 3 B
23    200   200   2500  1600  Crypt 3 C
24    200   200   2500  1900  Crypt 3 D
25    30    30    2500  2200  Crypt 3 E
26    64    18    3000  1000  Monastery
27    56    40    0     -40   Courtyard 1
28    200   200   -1    -1    Barracks
29    200   200   3500  1000  Jail 1
30    200   200   3500  1300  Jail 2
31    200   200   3500  1600  Jail 3
32    18    20    4000  1000  Courtyard 2
33    28    34    -4    -34   Cathedral
34    200   200   4500  1000  Catacombs 1
35    200   200   4500  1300  Catacombs 2
36    200   200   4500  1600  Catacombs 3
37    22    31    4500  1900  Catacombs 4
38    43    48    5000  1000  Tristram
39    80    80    5000  1148  Moo Moo Farm


Act 2:

ID    sX    sY    osX   osY   Name
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
40    56    56    1000  1000  Town
41    80    80    -1    -1    Desert 1
42    80    80    -1    -1    Desert 2
43    80    80    -1    -1    Desert 3
44    80    80    -1    -1    Desert 4
45    32    32    -1    -1    Desert 5
46    80    80    2500  1000  Valley of the Kings
47    200   200   1500  1000  Sewer 1 A
48    200   200   1500  1300  Sewer 1 B
49    200   200   1500  1600  Sewer 1 C
50    16    19    2000  1000  Harem
51    100   100   2000  1119  Corrupt Harem 1
52    100   100   2000  1319  Basement 1
53    100   100   2000  1519  Basement 2
54    100   100   2000  1719  Basement 3
55    200   200   3000  1000  Tomb 1 A
56    200   200   3000  1300  Tomb 2 A
57    200   200   3000  1600  Tomb 2 B
58    200   200   3000  1900  Tomb 3 A
59    200   200   3000  2200  Tomb 1 Treasure
60    200   200   3000  2500  Tomb 2 Treasure
61    200   200   3000  2800  Tomb 3 Treasure
62    200   200   3500  1000  Lair 1 A
63    200   200   3500  1300  Lair 1 B
64    200   200   3500  1600  Lair 1 Treasure
65    200   200   4000  1000  Sewer 2 A
66    200   200   4500  1000  Tomb Tal 1
67    200   200   4500  1300  Tomb Tal 2
68    200   200   4500  1600  Tomb Tal 3
69    200   200   4500  1900  Tomb Tal 4
70    200   200   4500  2200  Tomb Tal 5
71    200   200   4500  2500  Tomb Tal 6
72    200   200   4500  2800  Tomb Tal 7
73    32    47    4500  3100  Duriel's Lair
74    200   200   5000  1000  Arcane


Act 3:

ID    sX    sY    osX   osY   Name
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
75    64    48    1000  1000  Town
76    64    192   -1    -1    Jungle 1
77    64    192   -1    -1    Jungle 2
78    64    192   -1    -1    Jungle 3
79    80    64    -1    -1    Kurast 1
80    80    64    -1    -1    Kurast 2
81    80    64    -1    -1    Kurast 3
82    48    16    -1    -1    Kurast 4
83    64    64    -1    -1    Travincal
84    200   200   1500  1000  Spider 1
85    200   200   1500  1300  Spider 2
86    200   200   2000  1000  Dungeon 1 A
87    200   200   2000  1300  Dungeon 1 B
88    200   200   2000  1600  Dungeon 2 A
89    200   200   2000  1900  Dungeon 2 B
90    40    40    2000  2200  Dungeon 1 Treasure
91    40    40    2000  2340  Dungeon 2 Treasure
92    200   200   2500  1000  Sewer 1
93    18    22    2500  1300  Sewer 2
94    24    24    3000  1000  Temple 1
95    24    24    3000  1124  Temple 2
96    24    24    3000  1248  Temple 3
97    24    24    3000  1372  Temple 4
98    24    24    3000  1496  Temple 5
99    24    24    3000  1620  Temple 6
100   200   200   3500  1000  Mephisto 1
101   200   200   3500  1300  Mephisto 2
102   41    29    3500  1600  Mephisto 3


Act 4:

ID    sX    sY    osX   osY   Name
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
103   32    24    1000  1000  Town
104   80    64    -1    -1    Mesa 1
105   64    80    -1    -1    Mesa 2
106   80    64    -1    -1    Mesa 3
107   200   200   -1    -1    Lava 1
108   120   120   1500  1000  Diablo 1


Act 5:

ID    sX    sY    osX   osY   Name
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
109   40    40    1000  1000  Town
110   240   48    760   1000  Siege 1
111   -1    -1    -1    -1    Barricade 1
112   -1    -1    -1    -1    Barricade 2
113   200   200   2000  1000  Ice Cave 1
114   64    64    2000  1300  Ice Cave 1A
115   200   200   2000  1464  Ice Cave 2
116   32    32    2000  1764  Ice Cave 2A
117   128   80    2000  1896  Barricade Snow
118   200   200   2000  2076  Ice Cave 3
119   32    32    2000  2376  Ice Cave 3A
120   20    28    2000  2508  Mountain Top
121   22    27    2000  2636  Temple Entrance
122   80    80    2000  2763  Temple 1
123   80    80    2000  2943  Temple 2
124   84    84    2500  1000  Temple Boss
125   200   200   2500  1184  Hell 1
126   200   200   2500  1484  Hell 2
127   200   200   2500  1784  Hell 3
128   200   200   2500  2084  Baal Temple 1
129   200   200   2500  2384  Baal Temple 2
130   200   200   2500  2684  Baal Temple 3
131   40    52    3000  1000  Throne Room
132   55    55    3000  1152  World Stone


I have no idea what this means. Can anyone clarify or help out?

Ringo

yay, warden's switched on  :-\

UserLoser.

Quote from: Ringo on September 16, 2005, 12:49 PM
yay, warden's switched on  :-\

Someone show some packet dumps of this, please.

Ringo

#81
Quote from: UserLoser on September 16, 2005, 03:27 PM
Quote from: Ringo on September 16, 2005, 12:49 PM
yay, warden's switched on  :-\

Someone show some packet dumps of this, please.

im to lazy to reinstall ethereal, so i hope this is enough

[22:03:33] Sent Logon
[22:03:33] Unknown D2GS data: 1
  01 00 04 08 30 00 01 01   ....0...

[22:03:33] Unknown D2GS data: 0
  00   .

[22:03:33] Got 2nd D2GS Startup Packet
[22:03:33]  02 5C
[22:03:33] Entering World..
[22:03:33] 0x59 we are in view
[22:03:34] 0x15 asigned my self to X=4873 Y=4228
[22:03:34] 0xAE - Warden Detected.
  AE 25 00 E7 C8 CC F7 BC 0A 6E AA 0A 90 FB B0 78   .%.......n.....X
  BB 5C CB 83 85 5A 85 51 3D 09 3E D3 55 4C 54 0C   .\...Z.Q..>.ULT.
  1B 30 DE 2A 82 D2 21 67   .0.*..!g


LivedKrad

What is wrong with my parser:


Dim newClump$, compressedPacket$, decompressedPacket$, compLength&, decompLength&, decompMax&, packetID As Byte
Dim offset As Integer, indLength As Long, indPacket As String
newClump = data

compLength = GPSize(newClump, offset)
compressedPacket = Mid(newClump, offset, compLength)
decompressedPacket = String$(compLength * 2 + 150, Chr$(0))
decompMax = Len(decompressedPacket)
Call GamePacketDecode(compressedPacket, compLength, decompressedPacket, decompMax, decompLength)
decompressedPacket = Mid(decompressedPacket, 1, decompLength)

While Len(decompressedPacket) > 0
  packetID = Asc(Mid$(decompressedPacket, 1, 1))
  indLength = D2Parse.GetSize(packetID, decompressedPacket)
  If indLength = -2 Then
   AddChat vbRed, "Over 179, packet id " & Hex(packetID) & ": " & DebugOutput(decompressedPacket)
   Exit Sub
  End If
  indPacket = Mid(decompressedPacket, 1, indLength)
  Call D2Parse.ParseD2GS(packetID, indLength, Mid$(indPacket, 2))
  AddChat vbWhite, "New decompressed packet 0x" & Hex(packetID) & ": " & DebugOutput(indPacket)
  decompressedPacket = Mid(decompressedPacket, indLength + 1)
Wend
End Sub



Public Function GPSize(ByVal d As String, ByRef Os As Integer) As Long
On Error Resume Next
Dim sD As Long
If Asc(Mid(d, 1, 1)) < &HF0 Then
    Os = 2
    GPSize = Asc(Mid(d, 1, 1)) - 1
Else
    sD = LeftShift(Asc(Mid(d, 1, 1)) And &HF, 8)
    Os = 3
    GPSize = sD + Asc(Mid(d, 2, 1)) - 2
End If



Public Function GetSize(ByVal ID As Byte, ByVal data As String) As Long
Dim interimVal As Integer
If ID > 179 Then
GetSize = -2: Exit Function
End If
interimVal = PACKET_SIZE(ID)

If interimVal = &HFFFFFFFF Then
 
  Select Case ID
   Case &H9C
    GetSize = Asc(Mid$(data, 3, 1)): Exit Function
   Case &H9D
    GetSize = Asc(Mid$(data, 3, 1)): Exit Function
   Case &H5B
    GetSize = Asc(Mid$(data, 2, 1)): Exit Function
   Case &HA8
    GetSize = Asc(Mid$(data, 7, 1)): Exit Function
   Case &HAA
    GetSize = Asc(Mid$(data, 7, 1)): Exit Function
   Case &HAC
    GetSize = Asc(Mid$(data, 13, 1)): Exit Function
   Case &HAE
    GetSize = 40
    'GetSize = Asc(Mid$(data, 9, 1)): Exit Function
   Case &H26
    p_data = Mid$(data, 2)
    GetSize = Parsechat: Exit Function
   Case &H94
    GetSize = 6 + (Asc(Mid$(data, 1, 1)) * 3): Exit Function
  End Select

End If

GetSize = interimVal: Exit Function 'return interimVal;
End Function



LivedKrad


PACKET_SIZE(0) = &H1: PACKET_SIZE(1) = &H8: PACKET_SIZE(2) = &H1: PACKET_SIZE(3) = &HC: PACKET_SIZE(4) = &H1
PACKET_SIZE(5) = &H1: PACKET_SIZE(6) = &H1: PACKET_SIZE(7) = &H6: PACKET_SIZE(8) = &H6: PACKET_SIZE(9) = &HB
PACKET_SIZE(10) = &H6: PACKET_SIZE(11) = &H6: PACKET_SIZE(12) = &H9: PACKET_SIZE(13) = &HD: PACKET_SIZE(14) = &HC
PACKET_SIZE(15) = &H10: PACKET_SIZE(16) = &H10: PACKET_SIZE(17) = &H8: PACKET_SIZE(18) = &H1A: PACKET_SIZE(19) = &HE
PACKET_SIZE(20) = &H12: PACKET_SIZE(21) = &HB: PACKET_SIZE(22) = &HFFFFFFFF: PACKET_SIZE(23) = 0: PACKET_SIZE(24) = &HF
PACKET_SIZE(25) = &H2: PACKET_SIZE(26) = &H2: PACKET_SIZE(27) = &H3: PACKET_SIZE(28) = &H5: PACKET_SIZE(29) = &H3
PACKET_SIZE(30) = &H4: PACKET_SIZE(31) = &H6: PACKET_SIZE(32) = &HA: PACKET_SIZE(33) = &HC: PACKET_SIZE(34) = &HC
PACKET_SIZE(35) = &HD: PACKET_SIZE(36) = &H5A: PACKET_SIZE(37) = &H5A: PACKET_SIZE(38) = &HFFFFFFFF: PACKET_SIZE(39) = &H28
PACKET_SIZE(40) = &H67: PACKET_SIZE(41) = &H61: PACKET_SIZE(42) = &HF: PACKET_SIZE(43) = &H0: PACKET_SIZE(44) = &H8
PACKET_SIZE(45) = &H0: PACKET_SIZE(46) = &H0: PACKET_SIZE(47) = &H0: PACKET_SIZE(48) = &H0: PACKET_SIZE(49) = &H0
PACKET_SIZE(50) = &H0: PACKET_SIZE(51) = &H0: PACKET_SIZE(52) = &H0: PACKET_SIZE(53) = &H0: PACKET_SIZE(54) = &H0
PACKET_SIZE(55) = &H0: PACKET_SIZE(56) = &H0: PACKET_SIZE(57) = &H0: PACKET_SIZE(58) = &H0: PACKET_SIZE(59) = &H0
PACKET_SIZE(60) = &H0: PACKET_SIZE(61) = &H0: PACKET_SIZE(62) = &HFFFFFFFF: PACKET_SIZE(63) = &H8: PACKET_SIZE(64) = &HD
PACKET_SIZE(65) = &H0: PACKET_SIZE(66) = &H6: PACKET_SIZE(67) = &H0: PACKET_SIZE(68) = &H0: PACKET_SIZE(69) = &HD
PACKET_SIZE(70) = &H0: PACKET_SIZE(71) = &HB: PACKET_SIZE(72) = &HB: PACKET_SIZE(73) = &H0: PACKET_SIZE(74) = &H0
PACKET_SIZE(75) = &H0: PACKET_SIZE(76) = &H10: PACKET_SIZE(77) = &H11: PACKET_SIZE(78) = &H7: PACKET_SIZE(79) = &H1
PACKET_SIZE(80) = &HF: PACKET_SIZE(81) = &HE: PACKET_SIZE(82) = &H2A: PACKET_SIZE(83) = &HA: PACKET_SIZE(84) = &H3
PACKET_SIZE(85) = &H0: PACKET_SIZE(86) = &H0: PACKET_SIZE(87) = &HE: PACKET_SIZE(88) = &H7: PACKET_SIZE(89) = &H1A
PACKET_SIZE(90) = &H28: PACKET_SIZE(91) = &HFFFFFFFF: PACKET_SIZE(92) = &H5: PACKET_SIZE(93) = &H6: PACKET_SIZE(94) = &H26
PACKET_SIZE(95) = &H5: PACKET_SIZE(96) = &H7: PACKET_SIZE(97) = &H2: PACKET_SIZE(98) = &H7: PACKET_SIZE(99) = &H15
PACKET_SIZE(100) = &H0: PACKET_SIZE(101) = &H7: PACKET_SIZE(102) = &H7: PACKET_SIZE(103) = &H10: PACKET_SIZE(104) = &H15
PACKET_SIZE(105) = &HC: PACKET_SIZE(106) = &HC: PACKET_SIZE(107) = &H10: PACKET_SIZE(108) = &H10: PACKET_SIZE(109) = &HA
PACKET_SIZE(110) = &H1: PACKET_SIZE(111) = &H1: PACKET_SIZE(112) = &H1: PACKET_SIZE(113) = &H1: PACKET_SIZE(114) = &H1
PACKET_SIZE(115) = &H20: PACKET_SIZE(116) = &HA: PACKET_SIZE(117) = &HD: PACKET_SIZE(118) = &H6: PACKET_SIZE(119) = &H2
PACKET_SIZE(120) = &H15: PACKET_SIZE(121) = &H6: PACKET_SIZE(122) = &HD: PACKET_SIZE(123) = &H8: PACKET_SIZE(124) = &H6
PACKET_SIZE(125) = &H12: PACKET_SIZE(126) = &H5: PACKET_SIZE(127) = &HA: PACKET_SIZE(128) = &H0: PACKET_SIZE(129) = &H14
PACKET_SIZE(130) = &H1D: PACKET_SIZE(131) = &H0: PACKET_SIZE(132) = &H0: PACKET_SIZE(133) = &H0: PACKET_SIZE(134) = &H0
PACKET_SIZE(135) = &H0: PACKET_SIZE(136) = &H0: PACKET_SIZE(137) = &H2: PACKET_SIZE(138) = &H6: PACKET_SIZE(139) = &H6
PACKET_SIZE(140) = &HB: PACKET_SIZE(141) = &H7: PACKET_SIZE(142) = &HA: PACKET_SIZE(143) = &H21: PACKET_SIZE(144) = &HD
PACKET_SIZE(145) = &H1A: PACKET_SIZE(146) = &H6: PACKET_SIZE(147) = &H8: PACKET_SIZE(148) = &HFFFFFFFF: PACKET_SIZE(149) = &HD
PACKET_SIZE(150) = &H9: PACKET_SIZE(151) = &H1: PACKET_SIZE(152) = &H7: PACKET_SIZE(153) = &H10: PACKET_SIZE(154) = &H11
PACKET_SIZE(155) = &H7: PACKET_SIZE(156) = &HFFFFFFFF: PACKET_SIZE(157) = &HFFFFFFFF: PACKET_SIZE(158) = &H7: PACKET_SIZE(159) = &H8
PACKET_SIZE(160) = &HA: PACKET_SIZE(161) = &H7: PACKET_SIZE(162) = &H8: PACKET_SIZE(163) = &H18: PACKET_SIZE(164) = &H3
PACKET_SIZE(165) = &H8: PACKET_SIZE(166) = &HFFFFFFFF: PACKET_SIZE(167) = &H7: PACKET_SIZE(168) = &HFFFFFFFF: PACKET_SIZE(169) = &H7
PACKET_SIZE(170) = &HFFFFFFFF: PACKET_SIZE(171) = &H7: PACKET_SIZE(172) = &HFFFFFFFF: PACKET_SIZE(173) = &H9: PACKET_SIZE(174) = &HFFFFFFFF
PACKET_SIZE(175) = &H1: PACKET_SIZE(176) = &H0: PACKET_SIZE(177) = &H35: PACKET_SIZE(178) = &HFFFFFFFF: PACKET_SIZE(179) = &H5

dxoigmn

Quote from: LivedKrad.fe on September 16, 2005, 07:04 PM

PACKET_SIZE(0) = &H1: PACKET_SIZE(1) = &H8: PACKET_SIZE(2) = &H1: PACKET_SIZE(3) = &HC: PACKET_SIZE(4) = &H1
...snip...
PACKET_SIZE(175) = &H1: PACKET_SIZE(176) = &H0: PACKET_SIZE(177) = &H35: PACKET_SIZE(178) = &HFFFFFFFF: PACKET_SIZE(179) = &H5


There are only 0xAF packets, that is they only go up to 0xAE; at least in terms of D2GS on Battle.net.

LivedKrad

That size table was taken from D2Client.dll from Diablo II v1.10. I guess the packet sizes have all changed now - can someone give me the correct ones?

dxoigmn

Quote from: LivedKrad.fe on September 16, 2005, 07:54 PM
That size table was taken from D2Client.dll from Diablo II v1.10. I guess the packet sizes have all changed now - can someone give me the correct ones?

Sure they were taking from D2Client? Usually you get those extra packet sizes from D2Net since it deals with playing games with others not on Battle.net Anyways, here is an update packet length table (which I don't think has changed since 1.10 :P):


        Private m_PacketLengths() As Integer = {&H1, &H8, &H1, &HC, &H1, &H1, &H1, &H6, &H6, &HB, &H6, &H6, &H9, &HD, &HC, &H10, _
                                              &H10, &H8, &H1A, &HE, &H12, &HB, -1, -1, &HF, &H2, &H2, &H3, &H5, &H3, &H4, &H6, _
                                              &HA, &HC, &HC, &HD, &H5A, &H5A, -1, &H28, &H67, &H61, &HF, &H0, &H8, &H0, &H0, &H0, _
                                              &H0, &H0, &H0, &H0, &H0, &H0, &H0, &H0, &H0, &H0, &H0, &H0, &H0, &H0, -1, &H8, _
                                              &HD, &H0, &H6, &H0, &H0, &HD, &H0, &HB, &HB, &H0, &H0, &H0, &H10, &H11, &H7, &H1, _
                                              &HF, &HE, &H2A, &HA, &H3, &H0, &H0, &HE, &H7, &H1A, &H28, -1, &H5, &H6, &H26, &H5, _
                                              &H7, &H2, &H7, &H15, &H0, &H7, &H7, &H10, &H15, &HC, &HC, &H10, &H10, &HA, &H1, &H1, _
                                              &H1, &H1, &H1, &H20, &HA, &HD, &H6, &H2, &H15, &H6, &HD, &H8, &H6, &H12, &H5, &HA, _
                                              &H4, &H14, &H1D, &H0, &H0, &H0, &H0, &H0, &H0, &H2, &H6, &H6, &HB, &H7, &HA, &H21, _
                                              &HD, &H1A, &H6, &H8, -1, &HD, &H9, &H1, &H7, &H10, &H11, &H7, -1, -1, &H7, &H8, _
                                              &HA, &H7, &H8, &H18, &H3, &H8, -1, &H7, -1, &H7, -1, &H7, -1, &H0, -1}

LivedKrad

Why is the supposed Warden packet listed as size 0 here, then? (0xAE)

dxoigmn

Quote from: LivedKrad.fe on September 16, 2005, 10:31 PM
Why is the supposed Warden packet listed as size 0 here, then? (0xAE)

It's -1. Indices start at 0, not 1! So 0xAE is the last packet in the bunch.

LivedKrad

Oh right! So, do you know where in the AE packet the size is defined?

|