-
Notifications
You must be signed in to change notification settings - Fork 11
/
packet-bnetp-bncs.lua
8074 lines (6311 loc) · 240 KB
/
packet-bnetp-bncs.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
local X = require('xproto')
local p = X.protocol('bncs', 'Battle.net Chat Server Protocol',
{ key = 'bnetp.type', value = 0xFF })
--[[
`request_packet_data` is a custom DSL construct that
calls the `request` method on the state object to perform
reassembly of TCP PDUs all in one place.
--]]
p.api.request_packet_data = function(proto, ...)
local args = proto.utils.make_args_table_with_positional_map(
{ 'keyref', 'already_consumed' },
...
)
if not args.keyref or type(args.keyref) ~= 'string' then
error('keyref parameter is a required value of type string'
.. package.loaded.debug.traceback()
)
end
if args.already_consumed and type(args.already_consumed) ~= 'number' then
error('already_consumed parameter is an optional number'
.. package.loaded.debug.traceback()
)
end
return {
args = args,
dissect = function(self, state)
local plen = state.packet[self.args.keyref]
state:request(plen - (self.args.already_consumed or 0))
end
}
end
p:entrypoint {
p:lookahead_uint8_check(0xFF),
p:begin_packet(),
p:uint8 {
label = 'Header Type',
display = base.HEX,
key = 'type',
filter = 'type'
},
p:when {
p.conditions.keyEquals('isServerPacket', true),
{p:uint8 {
'Packet ID',
base.HEX,
p.descs.server_packets,
key = 'pid',
filter = 'pid'
}},
{p:uint8 {
'Packet ID',
base.HEX,
p.descs.client_packets,
key = 'pid',
filter = 'pid'
}},
},
p:uint16 {
label = 'Packet Length',
display = base.DEC,
key = 'plen',
filter = 'plen'
},
-- Before jumping to the corresponding packet description,
-- request all the data in this packet.
--
-- This is done for perfomace and also because `stringz`
-- can only request one byte at a time and some kind of
-- Wireshark reassembly limit is reached before the whole
-- packet can be dissected successfuly.
p:request_packet_data('plen', 4),
p:jump {
ref = 'pid',
ccollection = 'client_packets',
scollection = 'server_packets'
},
p:consume('plen'),
p:end_packet('plen')
}
p:collection {
name = 'client_packets',
packets = {
--[[doc
Message ID: 0x00
Message Name: SID_NULL
Direction: Client -> Server (Sent)
Used By: Starcraft Shareware, Starcraft Broodwar, Diablo Shareware, Diablo II,
Warcraft II, Warcraft III: The Frozen Throne, Starcraft,
Starcraft Japanese, Diablo, Diablo, Warcraft III,
Format: [blank]
Remarks: Keeps the connection alive. This message should be sent to the server
every 8 minutes (approximately).
Related: [0x00] SID_NULL (S->C)
]]
{
id = 0x00,
name = 'SID_NULL',
def = {},
},
--[[doc
Message ID: 0x02
Message Name: SID_STOPADV
Direction: Client -> Server (Sent)
Used By: Starcraft Shareware, Starcraft Broodwar, Diablo Shareware, Diablo II,
Warcraft II, Warcraft III: The Frozen Throne, Starcraft,
Starcraft Japanese, Diablo, Diablo, Warcraft III
Format: [blank]
Remarks: This message is sent to inform the server that a game should no longer
be advertised to other users. It is sent when a game starts, or when a
game is aborted (the host leaves).
All Battle.snp clients (DRTL, DSHR, STAR/SEXP, JSTR, SSHR, and W2BN)
always send this message when logging off, even if it not in a game.
]]
{
id = 0x02,
name = 'SID_STOPADV',
def = {},
},
--[[doc
Message ID: 0x05
Message Name: SID_CLIENTID
Direction: Client -> Server (Sent)
Used By: Starcraft Shareware, Diablo Shareware, Warcraft II, Starcraft Japanese
Format: (DWORD) Registration Version
(DWORD) Registration Authority
(DWORD) Account Number
(DWORD) Registration Token
(STRING) LAN Computer Name
(STRING) LAN Username
Remarks: This packet was used to ensure that the client's account number was
valid. All but the last two fields in this message are now ignored,
and may be set to zero.
The 'LAN Computer Name' field is the NetBIOS name of the computer. It
can be retrieved using the GetComputerName API.
The 'Lan Username' field is the name of the currently logged on user,
and may be retrieved using the GetUsername API.
The following information is historical:
The client would supply this data as issued by a Battle.net server. If
the Registration Version, Registration Authority, and Client Token
values equated to the account number supplied (Client ID), as
determined by an unknown formula, the server would respond with the
same values. If they were invalid, the server would assign new values.
Registration Version was always 1, Authority was the IP address of the
server that issued the account number. Thus, the Client Token was the
secret value, used to prove that the client really owned the account
in question.
Related: [0x05] SID_CLIENTID (S->C)
]]
{
id = 0x05,
name = 'SID_CLIENTID',
def = {
p:uint32("Registration Version"),
p:uint32("Registration Authority"),
p:uint32("Account Number"),
p:uint32("Registration Token"),
p:stringz("LAN Computer Name"),
p:stringz("LAN Username"),
},
},
--[[doc
Message ID: 0x06
Message Name: SID_STARTVERSIONING
Direction: Client -> Server (Sent)
Used By: Starcraft Shareware, Diablo Shareware, Warcraft II, Starcraft Japanese,
Diablo
Format: (DWORD) Platform ID
(DWORD) Product ID
(DWORD) Version Byte
(DWORD) Unknown (0)
Remarks: This message is sent to the server to start the process of checking
the game files. This message is part of the old logon process for
products before Starcraft.
Related: [0x06] SID_STARTVERSIONING (S->C)
]]
{
id = 0x06,
name = 'SID_STARTVERSIONING',
def = {
p:strdw("Platform ID", p.descs.PlatformID),
p:strdw("Product ID", p.descs.ClientTag),
p:uint32("Version Byte"),
p:uint32("Unknown"),
},
},
--[[doc
Message ID: 0x07
Message Name: SID_REPORTVERSION
Direction: Client -> Server (Sent)
Used By: Starcraft Shareware, Diablo Shareware, Warcraft II, Starcraft Japanese,
Diablo
Format: (DWORD) Platform ID
(DWORD) Product ID
(DWORD) Version Byte
(DWORD) EXE Version
(DWORD) EXE Hash
(STRING) EXE Information
Remarks: Contains CheckRevision response, version & EXE info.
Related: [0x07] SID_REPORTVERSION (S->C)
]]
{
id = 0x07,
name = 'SID_REPORTVERSION',
def = {
p:strdw("Platform ID", p.descs.PlatformID),
p:strdw("Product ID", p.descs.ClientTag),
p:uint32("Version Byte"),
p:uint32("EXE Version"),
p:uint32("EXE Hash"),
p:stringz("EXE Information"),
},
},
--[[doc
Message ID: 0x08
Message Name: SID_STARTADVEX
Direction: Client -> Server (Sent)
Used By: Starcraft Shareware
Format: (BOOLEAN) Password protected (32-bit)
(DWORD) Unknown
(DWORD) Unknown
(DWORD) Unknown
(DWORD) Unknown
(DWORD) Port
(STRING) Game name
(STRING) Game password
(STRING) Game stats - flags, creator, statstring
(STRING) Map name - 0x0d terminated
Remarks: Creates a game in a manner similar to SID_STARTADVEX2 and
SID_STARTADVEX3. This is only used by Starcraft Shareware.
Related: [0x08] SID_STARTADVEX (S->C), [0x1A] SID_STARTADVEX2 (C->S),
[0x1C] SID_STARTADVEX3 (C->S)
]]
{
id = 0x08,
name = 'SID_STARTADVEX',
def = {
p:uint32("Password protected", nil, p.descs.YesNo),
p:uint32("Unknown"),
p:uint32("Unknown"),
p:uint32("Unknown"),
p:uint32("Unknown"),
p:uint32("Port"),
p:stringz("Game name"),
p:stringz("Game password"),
p:stringz("Game stats - flags, creator, statstring"),
p:stringz("Map name - 0x0d terminated"),
},
},
--[[doc
Message ID: 0x09
Message Name: SID_GETADVLISTEX
Message Status: MORE RESEARCH NEEDED
Direction: Client -> Server (Sent)
Used By: Starcraft Shareware, Starcraft Broodwar, Diablo Shareware, Diablo II,
Warcraft II, Starcraft, Starcraft Japanese, Diablo, Diablo
Format: (WORD) Product-specific condition 1
(WORD) Product-specific condition 2
(DWORD) Product-specific condition 3
(DWORD) Product-specific condition 4
(DWORD) List count
(STRING) Game name
(STRING) Game password
(STRING) Game stats
Remarks: Retrieves a list of games.
Condition 1:
For STAR/SEXP/SSHR/JSTR and W2BN, Condition 1 is used to specify
a game type. A value of 0 indicates that any type is acceptable.
Possible game types:
0x00: All
0x02: Melee
0x03: Free for all
0x04: one vs one
0x05: CTF
0x06: Greed
0x07: Slaughter
0x08: Sudden Death
0x09: Ladder
0x10: Iron man ladder
0x0A: Use Map Settings
0x0B: Team Melee
0x0C: Team FFA
0x0D: Team CTF
0x0F: Top vs Bottom
For DRTL/DSHR, Condition 1 is used to specify a 'level range'.
This ensures that clients receive a list of games containing
players whose experience is similar to their own.
Possible ranges:
0x00: Level 1
0x01: 2 - 3
0x02: 4 - 5
0x03: 6 - 7
0x04: 8 - 9
0x05: 10 - 12
0x06: 13 - 16
0x07: 17 - 19
0x08: 20 - 24
0x09: 25 - 29
0x0A: 30 - 34
0x0B: 35 - 39
0x0C: 40 - 47
0x0D: 48 - 50
For all other games, this can be set to 0x00.
Condition 2:
Unknown. Set to 0x00.
Condition 3:
For STAR/SEXP/SSHR/JSTR, Condition 3 is set to 0x30. For
DRTL/DSHR, Condition 3 is set to 0xFFFF by the game, but setting
it to 0x00 will disable any viewing limitations, letting you
view all games.
Condition 4:
Unknown. Set to 0x00.
List count:
By default, DRTL/DSHR set this to 0x19. This is the number of
games to list. For a full listing, it's safe to use 0xFF.
Related: [0x09] SID_GETADVLISTEX (S->C)
]]
{
id = 0x09,
name = 'SID_GETADVLISTEX',
def = {
p:uint16('For STAR/SEXP/SSHR/JSTR and W2BN - game type', nil, p.descs.GameType),
p:uint16('Product-specific condition 2 (unknown, 0)'),
p:uint32('Product-specific condition 3'),
p:uint32('Product-specific condition 4 (unkown, 0)'),
p:uint32('List count'),
p:stringz('Game name'),
p:stringz('Game password'),
p:stringz('Game stats'),
},
},
--[[doc
Message ID: 0x0A
Message Name: SID_ENTERCHAT
Direction: Client -> Server (Sent)
Used By: Starcraft Shareware, Starcraft Broodwar, Diablo Shareware, Diablo II,
Warcraft II, Warcraft III: The Frozen Throne, Starcraft,
Starcraft Japanese, Diablo, Diablo, Warcraft III
Format: (STRING) Username *
(STRING) Statstring **
Remarks: Joins Chat.
* Null on WAR3/W3XP.
** Null on CDKey Products, except for D2DV and D2XP when on realm
characters..
Related: [0x0A] SID_ENTERCHAT (S->C)
]]
{
id = 0x0A,
name = 'SID_ENTERCHAT',
def = {
p:stringz("Username"),
p:stringz("Statstring"),
},
},
--[[doc
Message ID: 0x0B
Message Name: SID_GETCHANNELLIST
Direction: Client -> Server (Sent)
Used By: Starcraft Shareware, Starcraft Broodwar, Diablo Shareware, Diablo II,
Warcraft II, Warcraft III: The Frozen Throne, Starcraft,
Starcraft Japanese, Diablo, Diablo, Warcraft III
Format: (DWORD) Product ID
Remarks: Requests a list of channels that the client is permitted to enter.
In the past this packet returned a product list for the specified
Product ID, however, the Product ID field is now ignored -- it does
not need to be a valid Product ID, and can be set to zero. The list of
channels returned will be for the client's product, as specified
during the client's logon.
Related: [0x0B] SID_GETCHANNELLIST (S->C)
]]
{
id = 0x0B,
name = 'SID_GETCHANNELLIST',
def = {
p:strdw("Product ID", p.descs.ClientTag),
},
},
--[[doc
Message ID: 0x0C
Message Name: SID_JOINCHANNEL
Direction: Client -> Server (Sent)
Used By: Starcraft Shareware, Starcraft Broodwar, Diablo Shareware, Diablo II,
Warcraft II, Warcraft III: The Frozen Throne, Starcraft,
Starcraft Japanese, Diablo, Diablo, Warcraft III
Format: (DWORD) Flags
(STRING) Channel
Remarks: Joins a channel after entering chat.
The flags field may contain the following values:
0x00: NoCreate join
0x01: First join
0x02: Forced join
0x05: D2 first join
NoCreate Join:
This will only join the channel specified if it is not empty,
and is used by clients when selecting a channel from the
channels menu. If the channel is empty, Battle.net sends a
SID_CHATEVENT of type EID_CHANNELDOESNOTEXIST, upon which
official clients prompt for confirmation that the user wishes to
create the channel, in which case, it resends this packet with
Flags set to Forced Join (0x02).
First Join:
Places user in a channel starting with their product and
country, followed by a number, ie 'Brood War GBR-1'. Also
automatically sends MOTD after entering the channel. When using
this type, the Channel variable has no effect, but must be
present anyway to avoid an IP ban. This is sent when first
logging onto Battle.net
Forced Join:
This is sent when leaving a game, and joins the specified
channel without an supplying an MOTD.
D2 First Join:
The same as First join, but is used for D2DV/D2XP clients.
Related: [0x0F] SID_CHATEVENT (S->C)
]]
{
id = 0x0C,
name = 'SID_JOINCHANNEL',
def = {
p:uint32("Flags", nil, {
[0x00] = "NoCreate join",
[0x01] = "First join",
[0x02] = "Forced join",
[0x05] = "D2 first join",
}),
p:stringz("Channel"),
},
},
--[[doc
Message ID: 0x0E
Message Name: SID_CHATCOMMAND
Direction: Client -> Server (Sent)
Used By: Starcraft Shareware, Starcraft Broodwar, Diablo Shareware, Diablo II,
Warcraft II, Warcraft III: The Frozen Throne, Starcraft,
Starcraft Japanese, Diablo, Diablo, Warcraft III
Format: (STRING) Text
Remarks: Send text or a command to Battle.net using this packet.
For STAR/SEXP/SSHR/JSTR, Text is UTF-8 encoded (WIDESTRING).
It is generally accepted as unwise to send any character below a space
(0x20): this includes line feeds, carriage returns & control
characters. The maximum number of characters is 223 per message.
Related: [0x0F] SID_CHATEVENT (S->C)
]]
{
id = 0x0E,
name = 'SID_CHATCOMMAND',
def = {
p:stringz("Text"),
},
},
--[[doc
Message ID: 0x10
Message Name: SID_LEAVECHAT
Direction: Client -> Server (Sent)
Used By: Starcraft Shareware, Starcraft Broodwar, Diablo Shareware, Diablo II,
Warcraft II, Warcraft III: The Frozen Throne, Starcraft,
Starcraft Japanese, Diablo, Diablo, Warcraft III
Format: [blank]
Remarks: Leaves chat mode but does not disconnect. Generally sent when entering
a game. This is also sent by D2DV/D2XP when switching characters, and
by all products when logging off.
]]
{
id = 0x10,
name = 'SID_LEAVECHAT',
def = {},
},
--[[doc
Message ID: 0x12
Message Name: SID_LOCALEINFO
Direction: Client -> Server (Sent)
Used By: Diablo Shareware, Warcraft II, Diablo
Format: (FILETIME) System time
(FILETIME) Local time
(DWORD) Timezone bias
(DWORD) SystemDefaultLCID
(DWORD) UserDefaultLCID
(DWORD) UserDefaultLangID
(STRING) Abbreviated language name
(STRING) Country name
(STRING) Abbreviated country name
(STRING) Country (English)
Remarks: Informs the server of the client's locale information. Much of this
functionality has been incorporated into SID_AUTH_INFO, and more
in-depth remarks can be found there.
Related: [0x50] SID_AUTH_INFO (C->S)
]]
{
id = 0x12,
name = 'SID_LOCALEINFO',
def = {
p:wintime("System time"),
p:wintime("Local time"),
p:uint32("Timezone bias"),
p:uint32("SystemDefaultLCID"),
p:uint32("UserDefaultLCID"),
p:uint32("UserDefaultLangID"),
p:stringz("Abbreviated language name"),
p:stringz("Country name"),
p:stringz("Abbreviated country name"),
p:stringz("Country (English)"),
},
},
--[[doc
Message ID: 0x14
Message Name: SID_UDPPINGRESPONSE
Direction: Client -> Server (Sent)
Used By: Starcraft Shareware, Starcraft Broodwar, Diablo Shareware, Warcraft II,
Starcraft, Starcraft Japanese, Diablo
Format: (DWORD) UDPCode
Remarks: Enables UDP support.
Server supplies code via UDP packet PKT_SERVERPING (0x05). Usually
'bnet'.
Not responding will give you a UDP Plug in chat.
Related: [0x05] PKT_SERVERPING (S->C)
]]
{
id = 0x14,
name = 'SID_UDPPINGRESPONSE',
def = {
--[[doc or maybe uint32-hex? ]]
p:strdw("UDPCode"),
},
},
--[[doc
Message ID: 0x15
Message Name: SID_CHECKAD
Direction: Client -> Server (Sent)
Used By: Starcraft Shareware, Starcraft Broodwar, Diablo Shareware, Diablo II,
Warcraft II, Warcraft III: The Frozen Throne, Starcraft,
Starcraft Japanese, Diablo, Diablo, Warcraft III
Format: (DWORD) Platform ID
(DWORD) Product ID
(DWORD) ID of last displayed banner
(DWORD) Current time
Remarks: Requests ad banner information from battle.net.
Related: [0x15] SID_CHECKAD (S->C)
]]
{
id = 0x15,
name = 'SID_CHECKAD',
def = {
p:strdw("Platform ID", p.descs.PlatformID),
p:strdw("Product ID", p.descs.ClientTag),
p:uint32("ID of last displayed banner"),
p:posixtime("Current time"),
},
},
--[[doc
Message ID: 0x16
Message Name: SID_CLICKAD
Direction: Client -> Server (Sent)
Used By: Starcraft Shareware, Starcraft Broodwar, Diablo Shareware, Diablo II,
Warcraft II, Warcraft III: The Frozen Throne, Starcraft,
Starcraft Japanese, Diablo, Diablo, Warcraft III
Format: (DWORD) Ad ID
(DWORD) Request type
Remarks: The clients send this when an ad is clicked.
Request Type is 0 if the client used SID_QUERYADURL to get the ad's
data, 1 otherwise.
Related: [0x41] SID_QUERYADURL (C->S)
]]
{
id = 0x16,
name = 'SID_CLICKAD',
def = {
p:uint32("Ad ID"),
p:uint32("Request type", nil, {
[0] = "Client used SID_QUERYADURL",
[1] = "Client did not use SID_QUERYADURL",
}),
},
},
--[[doc
Message ID: 0x17
Message Name: SID_READMEMORY
Direction: Client -> Server (Sent)
Used By: Starcraft Shareware, Starcraft Broodwar, Diablo Shareware, Diablo II,
Warcraft II, Starcraft, Starcraft Japanese, Diablo, Diablo,
Format: (DWORD) Request ID
(VOID) Memory
Remarks: Rudimentary hack detection system. Was never used probably due to terrible implementation with little security. Yes, it is possible for a PvPGN server to read _EVERYTHING_ that is in the process' memory, including sensitive information such as your CDKey.
Source: http://darkblizz.org/Forum2/starcraft/the-lost-packets/msg19580
]]
{
id = 0x17,
name = 'SID_READMEMORY',
def = {
p:uint32("Request ID"),
p:consume("plen", "Memory", 'memory'),
},
},
--[[doc
Message ID: 0x18
Message Name: SID_REGISTRY
Message Status: DEFUNCT
Direction: Client -> Server (Sent)
Used By: Unknown
Format: (DWORD) Cookie
(STRING) Key Value
Remarks: Returns the requested registry value
Related: [0x18] SID_REGISTRY (S->C)
]]
{
id = 0x18,
name = 'SID_REGISTRY',
def = {
p:uint32("Cookie"),
p:stringz("Key Value"),
},
},
--[[doc
Message ID: 0x1A
Message Name: SID_STARTADVEX2
Message Status: DEFUNCT
Direction: Client -> Server (Sent)
Used By: Diablo Shareware, Diablo
Format: (DWORD) Password Protected
(DWORD) Unknown
(DWORD) Unknown
(DWORD) Unknown
(DWORD) Unknown
(DWORD) Port
(STRING) Game name
(STRING) Game password
(STRING) Unknown
(STRING) Game stats - Flags, Creator, Statstring
Remarks: This message is used by Diablo to create a game.
Related: [0x08] SID_STARTADVEX (C->S), [0x1C] SID_STARTADVEX3 (C->S)
]]
{
id = 0x1A,
name = 'SID_STARTADVEX2',
def = {
p:uint32("Password Protected"),
p:uint32("Unknown"),
p:uint32("Unknown"),
p:uint32("Unknown"),
p:uint32("Unknown"),
p:uint32("Port"),
p:stringz("Game name"),
p:stringz("Game password"),
p:stringz("Unknown"),
p:stringz("Game stats - Flags, Creator, Statstring"),
},
},
--[[doc
Message ID: 0x1B
Message Name: SID_GAMEDATAADDRESS
Message Status: DEFUNCT
Direction: Client -> Server (Sent)
Used By: Diablo
Format: (SOCKADDR) Address
Remarks: Specifies host & port that a game creator is using for a game.
]]
{
id = 0x1B,
name = 'SID_GAMEDATAADDRESS',
def = {
p:sockaddr("Address"),
},
},
--[[doc
Message ID: 0x1C
Message Name: SID_STARTADVEX3
Message Status: MORE RESEARCH NEEDED
Direction: Client -> Server (Sent)
Used By: Starcraft Shareware, Starcraft Broodwar, Diablo Shareware, Diablo II,
Warcraft II, Warcraft III: The Frozen Throne, Starcraft,
Starcraft Japanese, Diablo, Diablo, Warcraft III
Format: (DWORD) State
(DWORD) Time since creation
(WORD) Game Type
(WORD) Parameter
(DWORD) Unknown (1F)
(DWORD) Ladder
(STRING) Game name
(STRING) Game password
(STRING) Game Statstring
Remarks: Used by clients to inform the server that a game has been created, or
that the state of a created game has changed.
Bitwise flags for State:
0x01: Game is private
0x02: Game is full
0x04: Game contains players (other than creator)
0x08: Game is in progress
Possible values for Game Type:
0x02: Melee
0x03: Free for All
0x04: 1 vs 1
0x09: Ladder
0x0A: Use Map Settings
0x0F: Top vs Bottom
0x10: Iron Man Ladder (W2BN only)
Possible values for Ladder:
0x00: Game is NonLadder
0x01: Game is Ladder
0x03: Game is Iron Man Ladder (W2BN only)
It could be that the ladder is bitwise as well, and that 0x02 means
Iron Man and 0x03 just means Iron Man + Ladder.
Parameter appears to be 1 for all games except Top vs Bottom, where it
seems to depend on the size of each team. More research will be needed
to confirm.
Related: [0x08] SID_STARTADVEX (C->S), [0x1A] SID_STARTADVEX2 (C->S),
[0x1C] SID_STARTADVEX3 (S->C), Game Statstrings
]]
{
id = 0x1C,
name = 'SID_STARTADVEX3',
def = {
p:flags('State', p.uint32, {
{ 'Game is private', 0x01, p.descs.YesNo },
{ 'Game is full', 0x02, p.descs.YesNo },
{ 'Game contains players (other than creator)', 0x04, p.descs.YesNo },
{ 'Game is in progress', 0x08, p.descs.YesNo },
}),
p:uint32('Time since creation'),
p:uint16('Game Type', nil, {
[0x02] = 'Melee',
[0x03] = 'Free for All',
[0x04] = '1 vs 1',
[0x09] = 'Ladder',
[0x0A] = 'Use Map Settings',
[0x0F] = 'Top vs Bottom',
[0x10] = 'Iron Man Ladder (W2BN only)',
}),
p:uint16('Parameter'),
p:uint32('Unknown'),
p:uint32('Ladder', nil, {
[0x00] = 'NonLadder',
[0x01] = 'Ladder',
[0x03] = 'Iron Man Ladder (W2BN only)',
}),
p:stringz('Game name'),
p:stringz('Game password'),
p:stringz('Game statstring')
},
},
--[[doc
Message ID: 0x1E
Message Name: SID_CLIENTID2
Direction: Client -> Server (Sent)
Used By: Warcraft II, Starcraft Japanese, Diablo
Format: (DWORD) Server Version
For server version 1:
(DWORD) Registration Version
(DWORD) Registration Authority
For server version 0:
(DWORD) Registration Authority
(DWORD) Registration Version
(DWORD) Account Number
(DWORD) Registration Token
(STRING) LAN computer name
(STRING) LAN username
Remarks: See related link for more information.
Related: [0x05] SID_CLIENTID (C->S)
]]
{
id = 0x1E,
name = 'SID_CLIENTID2',
def = {
p:uint32("Server Version"),
p:uint32("Registration Version"),
p:uint32("Registration Authority"),
p:uint32("Registration Authority"),