-
Notifications
You must be signed in to change notification settings - Fork 40
/
Copy pathpwn3.lua
833 lines (573 loc) · 24.6 KB
/
pwn3.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
-- -----------------------------------------------------------
--
-- Name: Pwn Adventure 3 Wireshark Plugin
-- Version: v1.0.0 (01/05/2017)
-- Date: 20/06/2017
-- Created By: Antonin Beaujeant
-- Notes: For more information on this plugin visit https://blog.keyidentity.com/2017/06/20/pwnadventure3-building-a-wireshark-parser/
-- Feedback: If you have feedback on the plugin you can send it to pwn3<at>foxmole<dot>com
-- Protocol Documentation: https://blog.keyidentity.com/2017/06/13/pwnadventure3-network-protocol/
--
-- Release Notes:
-- 1.00 Initial Release.
-- - Authentication [missing info]
-- - Spawn position (1) [missing info]
-- - Spawn position (2) [missing info]
-- - Spawn position (3) [missing info]
-- - Send message
-- - Send answer
-- - Finish dialog
-- - Send dialog
-- - Purchase item
-- - Fire [missing info]
-- - Update health
-- - Spawn position (4) [missing info]
-- - Activate logic gate
-- - Spawn position (5) [missing info]
-- - Spawn position (6) [missing info]
-- - Remove quest
-- - Change location
-- - New inventory item
-- - Pick up item
-- - Event
-- - Fast travel
-- - Jump [missing info]
-- - Update mana
-- - New element [missing info]
-- - Update location [missing info]
-- - New quest
-- - Enemy position [missing info]
-- - New achievement
-- - Change PvP state
-- - Select quest
-- - Quest done
-- - Remove inventory item
-- - Run
-- - Respawn
-- - Teleport
-- - Change player state
-- - Change attack state
-- - Remove element
--
-- -----------------------------------------------------------
PWN3 = Proto ("pwn3", "Pwn Adventure 3 - Game server protocol")
-- FIELDS
local f = PWN3.fields
local opcodes = {
[0x0200] = "Authentication",
[0x1600] = "Spawn position [1]",
[0x1700] = "Spawn position [2]",
[0x2300] = "Spawn position [3]",
[0x232a] = "Send message",
[0x233e] = "Send answer",
[0x2366] = "Finish dialog",
[0x2373] = "Send dialog",
[0x2462] = "Purchase item",
[0x2a69] = "Fire",
[0x2b2b] = "Update health",
[0x3003] = "Spawn position [4]",
[0x3031] = "Activate logic gate",
[0x3206] = "Spawn position [5]",
[0x4103] = "Spawn position [6]",
[0x5e64] = "Remove quest",
[0x6368] = "Change location",
[0x6370] = "New inventory item",
[0x6565] = "Pick up item",
[0x6576] = "Event",
[0x6674] = "Fast travel",
[0x6a70] = "Jump",
[0x6d61] = "Update mana",
[0x6d6b] = "New element",
[0x6d76] = "Update location",
[0x6e71] = "New quest",
[0x7073] = "Enemy position",
[0x7075] = "New achievement",
[0x7076] = "Change PvP state",
[0x713d] = "Select quest",
[0x713e] = "Quest done",
[0x726d] = "Remove inventory item",
[0x726e] = "Run",
[0x7273] = "Respawn",
[0x7274] = "Teleport",
[0x7374] = "Change player state",
[0x7472] = "Change attack state",
[0x7878] = "Remove element"
}
local status = {
[0x00] = "Disable",
[0x01] = "Enable"
}
local speed = {
[0x00] = "Walk",
[0x01] = "Run"
}
local moves = {
[0x00] = "Neutral",
[0x7f] = "Forward",
[0x81] = "Backward"
}
local strafes = {
[0x00] = "Neutral",
[0x7f] = "Right",
[0x81] = "Left"
}
f.opcode = ProtoField.uint16 ("pwn3.opcode", "Action", base.HEX, opcodes)
f.posx = ProtoField.new ("X coordinate", "pwn3.posx", ftypes.FLOAT)
f.posy = ProtoField.new ("Y coordinate", "pwn3.posy", ftypes.FLOAT)
f.posz = ProtoField.new ("Z coordinate", "pwn3.posz", ftypes.FLOAT)
f.dirr = ProtoField.uint16 ("pwn3.dirr", "Direction roll", base.DEC)
f.diry = ProtoField.uint16 ("pwn3.diry", "Direction yaw", base.DEC)
f.dirp = ProtoField.uint16 ("pwn3.dirp", "Direction pitch", base.DEC)
f.vx = ProtoField.uint32 ("pwn3.vx", "Vector X", base.DEC)
f.vy = ProtoField.uint32 ("pwn3.vy", "Vector Y", base.DEC)
f.vz = ProtoField.uint32 ("pwn3.vz", "Vector Z", base.DEC)
f.mv = ProtoField.uint8 ("pwn3.mv", "Move", base.HEX, moves)
f.stf = ProtoField.uint8 ("pwn3.stf", "Strafe", base.HEX, strafes)
f.mana = ProtoField.uint32 ("pwn3.mana", "Mana", base.DEC)
f.health = ProtoField.uint32 ("pwn3.health", "Health", base.DEC)
f.gate = ProtoField.uint32 ("pwn3.gate", "Gate", base.DEC)
f.elid = ProtoField.uint16 ("pwn3.elid", "Element ID", base.DEC)
f.tid = ProtoField.uint16 ("pwn3.tid", "Target ID", base.DEC)
f.qt = ProtoField.uint16 ("pwn3.qt", "Quantity", base.DEC)
f.str = ProtoField.string ("pwn3.str", "String")
f.pvp = ProtoField.uint16 ("pwn3.pvp", "PvP status", base.HEX, status)
f.run = ProtoField.uint16 ("pwn3.run", "Speed", base.HEX, speed)
f.unknown = ProtoField.uint8 ("pwn3.unknown", "Unknown", base.HEX)
-- Create location node
function addLocation (location, offset, tree)
local branch
branch = tree:add (location(offset, 12), "Location")
branch:add_le (f.posx, location(offset, 4))
branch:add_le (f.posy, location(offset + 4, 4))
branch:add_le (f.posz, location(offset + 8, 4))
end
-- Create direction node
function addDirection (direction, offset, tree)
local branch
branch = tree:add (direction(offset, 6), "Direction")
branch:add_le (f.dirr, direction(offset, 2))
branch:add_le (f.diry, direction(offset + 2, 2))
branch:add_le (f.dirp, direction(offset + 4, 2))
end
-- Create vectors node
function addVectors (vectors, offset, tree)
local branch
branch = tree:add (vectors(offset, 12), "Vectors")
branch:add_le (f.vx, vectors(offset, 4))
branch:add_le (f.vy, vectors(offset + 4, 4))
branch:add_le (f.vz, vectors(offset + 8, 4))
end
-- DISSECTOR
function PWN3.dissector (buffer, pinfo, tree)
local subtree = tree:add (PWN3, buffer())
local offset = 0
while (offset < buffer:len()-1) do
local opcode = buffer(offset, 2):uint()
offset = offset + 2
-- Authentication
if (opcode == 0x0200 or opcode == 0x0500) then
local length = buffer(offset+2, 2):le_uint()
local branch = subtree:add (buffer(offset-2, 6+length), opcodes[opcode])
-- Unknown
branch:add (f.unknown, buffer(offset, 1))
offset = offset + 1
-- Unknown
branch:add (f.unknown, buffer(offset, 1))
offset = offset + 1
-- String length
offset = offset + 2
branch:add (f.str, buffer(offset, length))
offset = offset + length
-- Spawn position
elseif (opcode == 0x1600 or opcode == 0x1700 or opcode == 0x2300 or opcode == 0x3003 or opcode == 0x3206 or opcode == 0x4103) then
local branch = subtree:add (buffer(offset-2, 22), opcodes[opcode])
branch:add (f.opcode, buffer(offset-2, 2))
-- Unknown
branch:add (f.unknown, buffer(offset, 1))
offset = offset + 1
branch:add (f.unknown, buffer(offset, 1))
offset = offset + 1
addLocation (buffer, offset, branch)
offset = offset + 12
addDirection (buffer, offset, branch)
offset = offset + 6
-- Send message - Send answer
elseif (opcode == 0x232a or opcode == 0x233e) then
local length = buffer(offset, 2):le_uint()
local branch = subtree:add (buffer(offset-2, 4+length), opcodes[opcode])
-- String length
offset = offset + 2
branch:add (f.str, buffer(offset, length))
offset = offset + length
-- Finish dialog
elseif (opcode == 0x2366) then
local length = buffer(offset, 2):le_uint()
local branch = subtree:add (buffer(offset-2, 2), opcodes[opcode])
-- Send dialog
elseif (opcode == 0x2373) then
local length = buffer(offset+4, 2):le_uint()
local branch = subtree:add (buffer(offset-2, 8+length), opcodes[opcode])
-- Actor
branch:append_text (", Actor: " .. buffer(offset, 4):le_uint())
branch:add_le (f.elid, buffer(offset, 4))
offset = offset + 4
-- String length
offset = offset + 2
branch:add (f.str, buffer(offset, length))
offset = offset + length
-- Purchase item
elseif (opcode == 0x2462) then
local length = buffer(offset+4, 2):le_uint()
local branch = subtree:add (buffer(offset-2, 12+length), opcodes[opcode])
-- Unknown
branch:add_le (f.unknown, buffer(offset, 1))
offset = offset + 1
branch:add_le (f.unknown, buffer(offset, 1))
offset = offset + 1
branch:add_le (f.unknown, buffer(offset, 1))
offset = offset + 1
branch:add_le (f.unknown, buffer(offset, 1))
offset = offset + 1
-- String length
offset = offset + 2
branch:append_text (", Item: " .. buffer(offset, length):string())
branch:add (f.str, buffer(offset, length))
offset = offset + length
-- Quantity
branch:append_text (", Quantity: " .. buffer(offset, 4):le_uint())
branch:add_le (f.qt, buffer(offset, 4))
offset = offset + 4
-- Fire
elseif (opcode == 0x2a69) then
local length = buffer(offset, 2):le_uint()
local branch = subtree:add (buffer(offset-2, 16+length), opcodes[opcode])
branch:add (f.opcode, buffer(offset-2, 2))
-- String length
offset = offset + 2
branch:append_text (", Weapon: " .. buffer(offset, length):string())
branch:add (f.str, buffer(offset, length))
offset = offset + length
addVectors (buffer, offset, branch)
offset = offset + 12
-- Update health
elseif (opcode == 0x2b2b) then
local branch = subtree:add (buffer(offset-2, 10), opcodes[opcode])
branch:add (f.opcode, buffer(offset-2, 2))
branch:append_text (", Actor: " .. buffer(offset, 4):le_uint())
branch:add_le (f.elid, buffer(offset, 4))
offset = offset + 4
branch:append_text (", HP: " .. buffer(offset, 4):le_uint())
branch:add_le (f.health, buffer(offset, 4))
offset = offset + 4
-- Activate logic gate
elseif (opcode == 0x3031) then
local length = buffer(offset, 2):le_uint()
local branch = subtree:add (buffer(offset-2, 8+length), opcodes[opcode])
branch:add (f.opcode, buffer(offset-2, 2))
-- String length
offset = offset + 2
branch:append_text (", " .. buffer(offset, length):string())
branch:add (f.str, buffer(offset, length))
offset = offset + length
branch:append_text (", Gate: " .. buffer(offset, 4):le_uint())
branch:add_le (f.gate, buffer(offset, 4))
offset = offset + 4
-- Remove quest
elseif (opcode == 0x5e64) then
local length = buffer(offset, 2):le_uint()
local branch = subtree:add (buffer(offset-2, 4+length), opcodes[opcode])
branch:add (f.opcode, buffer(offset-2, 2))
-- String length
offset = offset + 2
branch:append_text (", Quest: " .. buffer(offset, length):string())
branch:add (f.str, buffer(offset, length))
offset = offset + length
-- Change location
elseif (opcode == 0x6368) then
local length = buffer(offset, 2):le_uint()
local branch = subtree:add (buffer(offset-2, 4+length), opcodes[opcode])
branch:add (f.opcode, buffer(offset-2, 2))
-- String length
offset = offset + 2
branch:append_text (", Location: " .. buffer(offset, length):string())
branch:add (f.str, buffer(offset, length))
offset = offset + length
-- New inventory item
elseif (opcode == 0x6370) then
local length = buffer(offset, 2):le_uint()
local branch = subtree:add (buffer(offset-2, 8+length), opcodes[opcode])
branch:add (f.opcode, buffer(offset-2, 2))
-- String length
offset = offset + 2
branch:append_text (", Item: " .. buffer(offset, length):string())
branch:add (f.str, buffer(offset, length))
offset = offset + length
branch:append_text (", Quantity: " .. buffer(offset, 4):le_uint())
branch:add_le (f.qt, buffer(offset, 4))
offset = offset + 4
-- Pick up item
elseif (opcode == 0x6565) then
local branch = subtree:add (buffer(offset-2, 6), opcodes[opcode])
branch:add (f.opcode, buffer(offset-2, 2))
branch:append_text (", Element: " .. buffer(offset, 4):le_uint())
branch:add_le (f.elid, buffer(offset, 4))
offset = offset + 4
-- Event
elseif (opcode == 0x6576) then
local length_first = buffer(offset, 2):le_uint()
local length_second = buffer(2+length_first+offset, 2):le_uint()
local branch = subtree:add (buffer(offset-2, 6+length_first+length_second), opcodes[opcode])
branch:add (f.opcode, buffer(offset-2, 2))
-- String length
offset = offset + 2
branch:append_text (", Text: " .. buffer(offset, length_first):string())
branch:add (f.str, buffer(offset, length_first))
offset = offset + length_first
-- String length
offset = offset + 2
branch:add (f.str, buffer(offset, length_second))
offset = offset + length_second
-- Fast travel
elseif (opcode == 0x6674) then
local length_from = buffer(offset, 2):le_uint()
local length_to = buffer(2+length_from+offset, 2):le_uint()
local branch = subtree:add (buffer(offset-2, 6+length_from+length_to), opcodes[opcode])
branch:add (f.opcode, buffer(offset-2, 2))
-- String length
offset = offset + 2
branch:append_text (", From: " .. buffer(offset, length_from):string())
branch:add (f.str, buffer(offset, length_from))
offset = offset + length_from
-- String length
offset = offset + 2
branch:append_text (", To: " .. buffer(offset, length_to):string())
branch:add (f.str, buffer(offset, length_to))
offset = offset + length_to
-- Jump
elseif (opcode == 0x6a70) then
local branch = subtree:add (buffer(offset-2, 3), opcodes[opcode])
branch:add (f.opcode, buffer(offset-2, 2))
-- Unknown
branch:add_le (f.unknown, buffer(offset, 1))
offset = offset + 1
-- Update mana
elseif (opcode == 0x6d61) then
local branch = subtree:add (buffer(offset-2, 6), opcodes[opcode])
branch:add (f.opcode, buffer(offset-2, 2))
branch:append_text (", Mana: " .. buffer(offset, 4):le_uint())
branch:add_le (f.mana, buffer(offset, 4))
offset = offset + 4
-- New element
elseif (opcode == 0x6d6b) then
local length = buffer(offset + 9, 2):le_uint()
local branch = subtree:add (buffer(offset-2, 35+length), opcodes[opcode])
branch:add (f.opcode, buffer(offset-2, 2))
branch:append_text (", ID: " .. buffer(offset, 4):le_uint())
branch:add_le (f.elid, buffer(offset, 4))
offset = offset + 4
-- Unknown
branch:add_le (f.unknown, buffer(offset, 1))
offset = offset + 1
branch:add_le (f.unknown, buffer(offset, 1))
offset = offset + 1
branch:add_le (f.unknown, buffer(offset, 1))
offset = offset + 1
branch:add_le (f.unknown, buffer(offset, 1))
offset = offset + 1
branch:add_le (f.unknown, buffer(offset, 1))
offset = offset + 1
-- String length
offset = offset + 2
branch:append_text (", Element: " .. buffer(offset, length):string())
branch:add (f.str, buffer(offset, length))
offset = offset + length
addLocation (buffer, offset, branch)
offset = offset + 12
addDirection (buffer, offset, branch)
offset = offset + 6
-- Unknown
branch:add_le (f.unknown, buffer(offset, 1))
offset = offset + 1
branch:add_le (f.unknown, buffer(offset, 1))
offset = offset + 1
branch:add_le (f.unknown, buffer(offset, 1))
offset = offset + 1
branch:add_le (f.unknown, buffer(offset, 1))
offset = offset + 1
-- Update location
elseif (opcode == 0x6d76) then
local branch = subtree:add (buffer(offset-2, 22), opcodes[opcode])
branch:add (f.opcode, buffer(offset-2, 2))
addLocation (buffer, offset, branch)
offset = offset + 12
addDirection (buffer, offset, branch)
offset = offset + 6
local mv = buffer(offset, 1):uint()
branch:add (f.mv, buffer(offset, 1))
offset = offset + 1
local stf = buffer(offset, 1):uint()
branch:add (f.stf, buffer(offset, 1))
offset = offset + 1
if mv == 0xc0 or mx == 0x08 then
-- Unknown
branch:add (f.unknown, buffer(offset, 1))
offset = offset + 1
branch:add (f.unknown, buffer(offset, 1))
offset = offset + 1
end
-- New quest
elseif (opcode == 0x6e71) then
local length = buffer(offset, 2):le_uint()
local branch = subtree:add (buffer(offset-2, 4+length), opcodes[opcode])
branch:add (f.opcode, buffer(offset-2, 2))
-- String length
offset = offset + 2
branch:append_text (", Quest: " .. buffer(offset, length):string())
branch:add (f.str, buffer(offset, length))
offset = offset + length
-- Enemy position
elseif (opcode == 0x7073) then
local branch = subtree:add (buffer(offset-2, 28), opcodes[opcode])
branch:add (f.opcode, buffer(offset-2, 2))
branch:append_text (", Actor: " .. buffer(offset, 4):le_uint())
branch:add_le (f.elid, buffer(offset, 4))
offset = offset + 4
addLocation (buffer, offset, branch)
offset = offset + 12
addDirection (buffer, offset, branch)
offset = offset + 6
-- Unknown
branch:add (f.unknown, buffer(offset, 1))
offset = offset + 1
branch:add (f.unknown, buffer(offset, 1))
offset = offset + 1
branch:add (f.unknown, buffer(offset, 1))
offset = offset + 1
branch:add (f.unknown, buffer(offset, 1))
offset = offset + 1
branch:add (f.unknown, buffer(offset, 1))
offset = offset + 1
branch:add (f.unknown, buffer(offset, 1))
offset = offset + 1
-- New achievement
elseif (opcode == 0x7075) then
local length = buffer(offset, 2):le_uint()
local branch = subtree:add (buffer(offset-2, 4+length), opcodes[opcode])
branch:add (f.opcode, buffer(offset-2, 2))
-- String length
offset = offset + 2
branch:append_text (", Achievement: " .. buffer(offset, length):string())
branch:add (f.str, buffer(offset, length))
offset = offset + length
-- Change PvP state
elseif (opcode == 0x7076) then
local branch = subtree:add (buffer(offset-2, 3), opcodes[opcode])
branch:add (f.opcode, buffer(offset-2, 2))
branch:append_text (", Status: " .. buffer(offset, 1))
branch:add_le (f.pvp, buffer(offset, 1))
offset = offset + 1
-- Select quest
elseif (opcode == 0x713d) then
local length = buffer(offset, 2):le_uint()
local branch = subtree:add (buffer(offset-2, 4+length), opcodes[opcode])
branch:add (f.opcode, buffer(offset-2, 2))
-- String length
offset = offset + 2
branch:append_text (", Quest: " .. buffer(offset, length))
branch:add (f.str, buffer(offset, length))
offset = offset + length
-- Quest finished
elseif (opcode == 0x713e) then
local length_loc = buffer(offset, 2):le_uint()
local length_quest = buffer(2+length_loc+offset, 2):le_uint()
local branch = subtree:add (buffer(offset-2, 6+length_loc+length_quest), opcodes[opcode])
branch:add (f.opcode, buffer(offset-2, 2))
-- String length
offset = offset + 2
branch:add (f.str, buffer(offset, length_loc))
offset = offset + length_loc
-- String length
offset = offset + 2
branch:append_text (", Quest: " .. buffer(offset, length_quest):string())
branch:add (f.str, buffer(offset, length_quest))
offset = offset + length_quest
-- Remove inventory item
elseif (opcode == 0x726d) then
local length = buffer(offset, 2):le_uint()
local branch = subtree:add (buffer(offset-2, 8+length), opcodes[opcode])
branch:add (f.opcode, buffer(offset-2, 2))
-- String length
offset = offset + 2
branch:append_text (", Item: " .. buffer(offset, length):string())
branch:add (f.str, buffer(offset, length))
offset = offset + length
-- Quantity
branch:append_text (", Quantity: " .. buffer(offset, 4):le_uint())
branch:add_le (f.qt, buffer(offset, 4))
offset = offset + 4
-- Run
elseif (opcode == 0x726e) then
local branch = subtree:add (buffer(offset-2, 3), opcodes[opcode])
branch:add (f.opcode, buffer(offset-2, 2))
branch:append_text (", Status: " .. buffer(offset, 1))
branch:add_le (f.run, buffer(offset, 1))
offset = offset + 1
-- Respawn
elseif (opcode == 0x7273) then
local branch = subtree:add (buffer(offset-2, 20), opcodes[opcode])
branch:add (f.opcode, buffer(offset-2, 2))
addLocation (buffer, offset, branch)
offset = offset + 12
addDirection (buffer, offset, branch)
offset = offset + 6
-- Change player state
elseif (opcode == 0x7374) then
local length = buffer(offset + 4, 2):le_uint()
local branch = subtree:add (buffer(offset-2, 8+length), opcodes[opcode])
branch:add (f.opcode, buffer(offset-2, 2))
branch:append_text (", Actor: " .. buffer(offset, 4):le_uint())
branch:add_le (f.elid, buffer(offset, 4))
offset = offset + 4
-- String length
offset = offset + 2
branch:append_text (", State: " .. buffer(offset, length):string())
branch:add (f.str, buffer(offset, length))
offset = offset + length
-- Unknown
branch:add (f.unknown, buffer(offset, 1))
offset = offset + 1
-- Change attack state
elseif (opcode == 0x7472) then
local length = buffer(offset + 4, 2):le_uint()
local branch = subtree:add (buffer(offset-2, 12+length), opcodes[opcode])
branch:add (f.opcode, buffer(offset-2, 2))
branch:append_text (", Actor: " .. buffer(offset, 4):le_uint())
branch:add_le (f.elid, buffer(offset, 4))
offset = offset + 4
-- String length
offset = offset + 2
branch:append_text (", State: " .. buffer(offset, length):string())
branch:add (f.str, buffer(offset, length))
offset = offset + length
branch:append_text (", Target: " .. buffer(offset, 4):le_uint())
branch:add_le (f.tid, buffer(offset, 4))
offset = offset + 4
-- Remove element
elseif (opcode == 0x7878) then
local branch = subtree:add (buffer(offset-2, 3), opcodes[opcode])
branch:add (f.opcode, buffer(offset-2, 2))
branch:append_text (", Element: " .. buffer(offset, 4):le_uint())
branch:add_le (f.elid, buffer(offset, 4))
offset = offset + 4
-- Not found
else
local branch = subtree:add (f.unknown, buffer(offset-2, 1))
offset = offset - 1
end
end
end
tcp_table = DissectorTable.get ("tcp.port")
tcp_table:add (3000, PWN3)
tcp_table:add (3001, PWN3)
tcp_table:add (3002, PWN3)
tcp_table:add (3003, PWN3)