Coverage Report

Created: 2026-09-28 06:52

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/wireshark/epan/dissectors/packet-wow.c
Line
Count
Source
1
/* packet-wow.c
2
 * Routines for World of Warcraft (WoW) protocol dissection
3
 * Copyright 2008-2009, Stephen Fisher (see AUTHORS file)
4
 *
5
 * Wireshark - Network traffic analyzer
6
 * By Gerald Combs <gerald@wireshark.org>
7
 * Copyright 1998 Gerald Combs
8
 *
9
 * SPDX-License-Identifier: GPL-2.0-or-later
10
 */
11
12
/* This dissector is based on the MaNGOS project's source code, Stanford's
13
 * SRP protocol documents (http://srp.stanford.edu) and RFC 2945: "The SRP
14
 * Authentication and Key Exchange System." */
15
16
#include "config.h"
17
18
#include "packet-tcp.h"
19
#include <epan/charsets.h>
20
#include <epan/packet.h>
21
#include <epan/prefs.h>
22
#include <epan/wmem_scopes.h>
23
#include <ptvcursor.h>
24
25
void proto_register_wow(void);
26
void proto_reg_handoff_wow(void);
27
28
static dissector_handle_t wow_handle;
29
30
typedef enum {
31
  CMD_AUTH_LOGON_CHALLENGE       = 0x00,
32
  CMD_AUTH_LOGON_PROOF           = 0x01,
33
  CMD_AUTH_RECONNECT_CHALLENGE   = 0x02,
34
  CMD_AUTH_RECONNECT_PROOF       = 0x03,
35
    CMD_SURVEY_RESULT              = 0x04,
36
  CMD_REALM_LIST                 = 0x10,
37
  CMD_XFER_INITIATE              = 0x30,
38
  CMD_XFER_DATA                  = 0x31,
39
  CMD_XFER_ACCEPT                = 0x32,
40
  CMD_XFER_RESUME                = 0x33,
41
  CMD_XFER_CANCEL                = 0x34
42
} auth_cmd_e;
43
44
static const value_string cmd_vs[] = {
45
  { CMD_AUTH_LOGON_CHALLENGE,       "CMD_AUTH_LOGON_CHALLENGE" },
46
  { CMD_AUTH_LOGON_PROOF,           "CMD_AUTH_LOGON_PROOF" },
47
  { CMD_AUTH_RECONNECT_CHALLENGE,   "CMD_AUTH_RECONNECT_CHALLENGE" },
48
  { CMD_AUTH_RECONNECT_PROOF,       "CMD_AUTH_RECONNECT_PROOF" },
49
  { CMD_REALM_LIST,                 "CMD_REALM_LIST" },
50
  { CMD_XFER_INITIATE,              "CMD_XFER_INITIATE" },
51
  { CMD_XFER_DATA,                  "CMD_XFER_DATA" },
52
  { CMD_XFER_ACCEPT,                "CMD_XFER_ACCEPT" },
53
  { CMD_XFER_RESUME,                "CMD_XFER_RESUME" },
54
  { CMD_XFER_CANCEL,                "CMD_XFER_CANCEL" },
55
  { 0, NULL }
56
};
57
58
/* AUTOGENERATED_START_ENUM */
59
typedef enum {
60
    REALM_TYPE_PLAYER_VS_ENVIRONMENT = 0x0,
61
    REALM_TYPE_PLAYER_VS_PLAYER = 0x1,
62
    REALM_TYPE_ROLEPLAYING = 0x6,
63
    REALM_TYPE_ROLEPLAYING_PLAYER_VS_PLAYER = 0x8,
64
} e_realm_type;
65
static const value_string e_realm_type_strings[] =  {
66
    { REALM_TYPE_PLAYER_VS_ENVIRONMENT, "Player Vs Environment" },
67
    { REALM_TYPE_PLAYER_VS_PLAYER, "Player Vs Player" },
68
    { REALM_TYPE_ROLEPLAYING, "Roleplaying" },
69
    { REALM_TYPE_ROLEPLAYING_PLAYER_VS_PLAYER, "Roleplaying Player Vs Player" },
70
    { 0, NULL }
71
};
72
73
typedef enum {
74
    REALM_CATEGORY_DEFAULT = 0x0,
75
    REALM_CATEGORY_ONE = 0x1,
76
    REALM_CATEGORY_TWO = 0x2,
77
    REALM_CATEGORY_THREE = 0x3,
78
    REALM_CATEGORY_FIVE = 0x5,
79
} e_realm_category;
80
static const value_string e_realm_category_strings[] =  {
81
    { REALM_CATEGORY_DEFAULT, "Default" },
82
    { REALM_CATEGORY_ONE, "One" },
83
    { REALM_CATEGORY_TWO, "Two" },
84
    { REALM_CATEGORY_THREE, "Three" },
85
    { REALM_CATEGORY_FIVE, "Five" },
86
    { 0, NULL }
87
};
88
89
typedef enum {
90
    PROTOCOL_VERSION_TWO = 0x2,
91
    PROTOCOL_VERSION_THREE = 0x3,
92
    PROTOCOL_VERSION_FIVE = 0x5,
93
    PROTOCOL_VERSION_SIX = 0x6,
94
    PROTOCOL_VERSION_SEVEN = 0x7,
95
    PROTOCOL_VERSION_EIGHT = 0x8,
96
} e_protocol_version;
97
static const value_string e_protocol_version_strings[] =  {
98
    { PROTOCOL_VERSION_TWO, "Two" },
99
    { PROTOCOL_VERSION_THREE, "Three" },
100
    { PROTOCOL_VERSION_FIVE, "Five" },
101
    { PROTOCOL_VERSION_SIX, "Six" },
102
    { PROTOCOL_VERSION_SEVEN, "Seven" },
103
    { PROTOCOL_VERSION_EIGHT, "Eight" },
104
    { 0, NULL }
105
};
106
107
typedef enum {
108
    PLATFORM_X86 = 0x783836,
109
    PLATFORM_POWER_PC = 0x505043,
110
} e_platform;
111
static const value_string e_platform_strings[] =  {
112
    { PLATFORM_X86, "X86" },
113
    { PLATFORM_POWER_PC, "Power Pc" },
114
    { 0, NULL }
115
};
116
117
typedef enum {
118
    OS_WINDOWS = 0x57696E,
119
    OS_MAC_OS_X = 0x4F5358,
120
} e_os;
121
static const value_string e_os_strings[] =  {
122
    { OS_WINDOWS, "Windows" },
123
    { OS_MAC_OS_X, "Mac Os X" },
124
    { 0, NULL }
125
};
126
127
typedef enum {
128
    LOCALE_EN_GB = 0x656E4742,
129
    LOCALE_EN_US = 0x656E5553,
130
    LOCALE_ES_MX = 0x65734D58,
131
    LOCALE_PT_BR = 0x70744252,
132
    LOCALE_FR_FR = 0x66724652,
133
    LOCALE_DE_DE = 0x64654445,
134
    LOCALE_ES_ES = 0x65734553,
135
    LOCALE_PT_PT = 0x70745054,
136
    LOCALE_IT_IT = 0x69744954,
137
    LOCALE_RU_RU = 0x72755255,
138
    LOCALE_KO_KR = 0x6B6F4B52,
139
    LOCALE_ZH_TW = 0x7A685457,
140
    LOCALE_EN_TW = 0x656E5457,
141
    LOCALE_EN_CN = 0x656E434E,
142
} e_locale;
143
static const value_string e_locale_strings[] =  {
144
    { LOCALE_EN_GB, "En Gb" },
145
    { LOCALE_EN_US, "En Us" },
146
    { LOCALE_ES_MX, "Es Mx" },
147
    { LOCALE_PT_BR, "Pt Br" },
148
    { LOCALE_FR_FR, "Fr Fr" },
149
    { LOCALE_DE_DE, "De De" },
150
    { LOCALE_ES_ES, "Es Es" },
151
    { LOCALE_PT_PT, "Pt Pt" },
152
    { LOCALE_IT_IT, "It It" },
153
    { LOCALE_RU_RU, "Ru Ru" },
154
    { LOCALE_KO_KR, "Ko Kr" },
155
    { LOCALE_ZH_TW, "Zh Tw" },
156
    { LOCALE_EN_TW, "En Tw" },
157
    { LOCALE_EN_CN, "En Cn" },
158
    { 0, NULL }
159
};
160
161
typedef enum {
162
    LOGIN_RESULT_SUCCESS = 0x00,
163
    LOGIN_RESULT_FAIL_UNKNOWN0 = 0x01,
164
    LOGIN_RESULT_FAIL_UNKNOWN1 = 0x02,
165
    LOGIN_RESULT_FAIL_BANNED = 0x03,
166
    LOGIN_RESULT_FAIL_UNKNOWN_ACCOUNT = 0x04,
167
    LOGIN_RESULT_FAIL_INCORRECT_PASSWORD = 0x05,
168
    LOGIN_RESULT_FAIL_ALREADY_ONLINE = 0x06,
169
    LOGIN_RESULT_FAIL_NO_TIME = 0x07,
170
    LOGIN_RESULT_FAIL_DB_BUSY = 0x08,
171
    LOGIN_RESULT_FAIL_VERSION_INVALID = 0x09,
172
    LOGIN_RESULT_LOGIN_DOWNLOAD_FILE = 0x0A,
173
    LOGIN_RESULT_FAIL_INVALID_SERVER = 0x0B,
174
    LOGIN_RESULT_FAIL_SUSPENDED = 0x0C,
175
    LOGIN_RESULT_FAIL_NO_ACCESS = 0x0D,
176
    LOGIN_RESULT_SUCCESS_SURVEY = 0x0E,
177
    LOGIN_RESULT_FAIL_PARENTALCONTROL = 0x0F,
178
    LOGIN_RESULT_FAIL_LOCKED_ENFORCED = 0x10,
179
} e_login_result;
180
static const value_string e_login_result_strings[] =  {
181
    { LOGIN_RESULT_SUCCESS, "Success" },
182
    { LOGIN_RESULT_FAIL_UNKNOWN0, "Fail Unknown0" },
183
    { LOGIN_RESULT_FAIL_UNKNOWN1, "Fail Unknown1" },
184
    { LOGIN_RESULT_FAIL_BANNED, "Fail Banned" },
185
    { LOGIN_RESULT_FAIL_UNKNOWN_ACCOUNT, "Fail Unknown Account" },
186
    { LOGIN_RESULT_FAIL_INCORRECT_PASSWORD, "Fail Incorrect Password" },
187
    { LOGIN_RESULT_FAIL_ALREADY_ONLINE, "Fail Already Online" },
188
    { LOGIN_RESULT_FAIL_NO_TIME, "Fail No Time" },
189
    { LOGIN_RESULT_FAIL_DB_BUSY, "Fail Db Busy" },
190
    { LOGIN_RESULT_FAIL_VERSION_INVALID, "Fail Version Invalid" },
191
    { LOGIN_RESULT_LOGIN_DOWNLOAD_FILE, "Login Download File" },
192
    { LOGIN_RESULT_FAIL_INVALID_SERVER, "Fail Invalid Server" },
193
    { LOGIN_RESULT_FAIL_SUSPENDED, "Fail Suspended" },
194
    { LOGIN_RESULT_FAIL_NO_ACCESS, "Fail No Access" },
195
    { LOGIN_RESULT_SUCCESS_SURVEY, "Success Survey" },
196
    { LOGIN_RESULT_FAIL_PARENTALCONTROL, "Fail Parentalcontrol" },
197
    { LOGIN_RESULT_FAIL_LOCKED_ENFORCED, "Fail Locked Enforced" },
198
    { 0, NULL }
199
};
200
201
202
typedef enum {
203
    REALM_FLAG_NONE = 0x00,
204
    REALM_FLAG_INVALID = 0x01,
205
    REALM_FLAG_OFFLINE = 0x02,
206
    REALM_FLAG_SPECIFY_BUILD = 0x04,
207
    REALM_FLAG_FORCE_BLUE_RECOMMENDED = 0x20,
208
    REALM_FLAG_FORCE_GREEN_RECOMMENDED = 0x40,
209
    REALM_FLAG_FORCE_RED_FULL = 0x80,
210
} e_realm_flag;
211
212
typedef enum {
213
    SECURITY_FLAG_NONE = 0x0,
214
    SECURITY_FLAG_PIN = 0x1,
215
    SECURITY_FLAG_MATRIX_CARD = 0x2,
216
    SECURITY_FLAG_AUTHENTICATOR = 0x4,
217
} e_security_flag;
218
219
typedef enum {
220
    ACCOUNT_FLAG_GM = 0x000001,
221
    ACCOUNT_FLAG_TRIAL = 0x000008,
222
    ACCOUNT_FLAG_PROPASS = 0x800000,
223
} e_account_flag;
224
225
/* AUTOGENERATED_END_ENUM */
226
227
340
#define WOW_PORT 3724
228
229
138
#define WOW_CLIENT_TO_SERVER pinfo->destport == WOW_PORT
230
186
#define WOW_SERVER_TO_CLIENT pinfo->srcport  == WOW_PORT
231
232
/* Initialize the protocol and registered fields */
233
static int proto_wow;
234
235
236
/* More than 1 packet */
237
static int hf_wow_command;
238
static int hf_wow_string_length;
239
/* AUTOGENERATED_START_HF */
240
static int hf_wow_account_flag;
241
static int hf_wow_account_name;
242
static int hf_wow_address;
243
static int hf_wow_authenticator;
244
static int hf_wow_build;
245
static int hf_wow_cd_key_proof;
246
static int hf_wow_challenge_count;
247
static int hf_wow_challenge_data;
248
static int hf_wow_checksum_salt;
249
static int hf_wow_client_checksum;
250
static int hf_wow_client_ip_address;
251
static int hf_wow_client_proof;
252
static int hf_wow_client_public_key;
253
static int hf_wow_compressed_data_length;
254
static int hf_wow_crc_hash;
255
static int hf_wow_crc_salt;
256
static int hf_wow_data;
257
static int hf_wow_decompressed_size;
258
static int hf_wow_digit_count;
259
static int hf_wow_error;
260
static int hf_wow_file_md;
261
static int hf_wow_file_size;
262
static int hf_wow_filename;
263
static int hf_wow_footer_padding;
264
static int hf_wow_game_name;
265
static int hf_wow_generator;
266
static int hf_wow_generator_length;
267
static int hf_wow_hardware_survey_id;
268
static int hf_wow_header_padding;
269
static int hf_wow_height;
270
static int hf_wow_key_count;
271
static int hf_wow_large_safe_prime;
272
static int hf_wow_large_safe_prime_length;
273
static int hf_wow_locale;
274
static int hf_wow_locked;
275
static int hf_wow_login_result;
276
static int hf_wow_major;
277
static int hf_wow_matrix_card_proof;
278
static int hf_wow_minor;
279
static int hf_wow_name;
280
static int hf_wow_number_of_characters_on_realm;
281
static int hf_wow_number_of_realms;
282
static int hf_wow_number_of_telemetry_keys;
283
static int hf_wow_offset;
284
static int hf_wow_os;
285
static int hf_wow_padding;
286
static int hf_wow_patch;
287
static int hf_wow_pin_grid_seed;
288
static int hf_wow_pin_hash;
289
static int hf_wow_pin_salt;
290
static int hf_wow_platform;
291
static int hf_wow_population;
292
static int hf_wow_proof_data;
293
static int hf_wow_protocol_version;
294
static int hf_wow_protocol_version_int;
295
static int hf_wow_realm_category;
296
static int hf_wow_realm_flag;
297
static int hf_wow_realm_id;
298
static int hf_wow_realm_type;
299
static int hf_wow_required;
300
static int hf_wow_salt;
301
static int hf_wow_security_flag;
302
static int hf_wow_seed;
303
static int hf_wow_server_proof;
304
static int hf_wow_server_public_key;
305
static int hf_wow_size;
306
static int hf_wow_survey_id;
307
static int hf_wow_unknown_bytes;
308
static int hf_wow_unknown_int;
309
static int hf_wow_utc_timezone_offset;
310
static int hf_wow_width;
311
/* AUTOGENERATED_END_HF */
312
313
static bool wow_preference_desegment = true;
314
315
static int ett_wow;
316
static int ett_message;
317
318
struct game_version {
319
  int8_t major_version;
320
  int8_t minor_version;
321
  int8_t patch_version;
322
  int16_t revision;
323
};
324
325
static int32_t
326
get_null_terminated_string_length( tvbuff_t* tvb, int32_t offset)
327
0
{
328
0
    const int32_t maximum_length = 0xFF;
329
0
    for (int32_t length = 0; length < maximum_length; length++) {
330
0
        uint8_t character = tvb_get_uint8(tvb, offset + length);
331
0
        if (character == 0) {
332
            // Include the null character in the length
333
0
            return length + 1;
334
0
        }
335
0
    }
336
337
0
    return 0;
338
0
}
339
340
static void
341
0
add_cstring(ptvcursor_t* ptv, const int* hf) {
342
0
    int32_t len = get_null_terminated_string_length(ptvcursor_tvbuff(ptv), ptvcursor_current_offset(ptv));
343
0
    ptvcursor_add(ptv, *hf, len, ENC_UTF_8);
344
0
}
345
346
static void
347
21
add_string(ptvcursor_t* ptv, const int* hf) {
348
21
    uint32_t len = 0;
349
21
    ptvcursor_add_ret_uint(ptv, hf_wow_string_length, 1, ENC_NA, &len);
350
21
    ptvcursor_add(ptv, *hf, (int)len, ENC_UTF_8);
351
21
}
352
353
static unsigned
354
get_wow_pdu_len(packet_info *pinfo, tvbuff_t *tvb, int offset, void *data _U_)
355
40
{
356
40
  int8_t size_field_offset = -1;
357
40
  uint8_t cmd;
358
40
  uint16_t pkt_len;
359
360
40
  cmd = tvb_get_uint8(tvb, offset);
361
362
40
  if(WOW_SERVER_TO_CLIENT && cmd == CMD_REALM_LIST)
363
0
    size_field_offset = 1;
364
40
  if(WOW_CLIENT_TO_SERVER && cmd == CMD_AUTH_LOGON_CHALLENGE)
365
33
    size_field_offset = 2;
366
367
40
  pkt_len = tvb_get_letohs(tvb, size_field_offset);
368
369
40
  return pkt_len + size_field_offset + 2;
370
40
}
371
372
static void
373
52
add_body_fields(packet_info *pinfo, uint8_t header_opcode, ptvcursor_t *ptv, uint32_t *protocol_version) {
374
    /* AUTOGENERATED_START_VARIABLES */
375
52
    uint32_t compressed_data_length = 0;
376
52
    uint32_t flag = 0;
377
52
    uint32_t generator_length = 0;
378
52
    uint32_t large_safe_prime_length = 0;
379
52
    uint32_t number_of_realms = 0;
380
52
    uint32_t number_of_telemetry_keys = 0;
381
52
    uint32_t result = 0;
382
52
    uint32_t security_flag = 0;
383
52
    uint32_t size = 0;
384
/* AUTOGENERATED_END_VARIABLES */
385
386
    /* AUTOGENERATED_START_PARSER */
387
52
    switch (header_opcode) {
388
36
        case CMD_AUTH_LOGON_CHALLENGE:
389
36
            switch (*protocol_version) {
390
36
                case 2:
391
36
                    if (WOW_SERVER_TO_CLIENT) {
392
3
                        ptvcursor_add(ptv, hf_wow_protocol_version_int, 1, ENC_LITTLE_ENDIAN);
393
3
                        ptvcursor_add_ret_uint(ptv, hf_wow_login_result, 1, ENC_LITTLE_ENDIAN, &result);
394
3
                        if (result == LOGIN_RESULT_SUCCESS) {
395
2
                            ptvcursor_add(ptv, hf_wow_server_public_key, 32, ENC_NA);
396
2
                            ptvcursor_add_ret_uint(ptv, hf_wow_generator_length, 1, ENC_LITTLE_ENDIAN, &generator_length);
397
2
                            ptvcursor_add(ptv, hf_wow_generator, generator_length, ENC_NA);
398
2
                            ptvcursor_add_ret_uint(ptv, hf_wow_large_safe_prime_length, 1, ENC_LITTLE_ENDIAN, &large_safe_prime_length);
399
2
                            ptvcursor_add(ptv, hf_wow_large_safe_prime, large_safe_prime_length, ENC_NA);
400
2
                            ptvcursor_add(ptv, hf_wow_salt, 32, ENC_NA);
401
2
                            ptvcursor_add(ptv, hf_wow_crc_salt, 16, ENC_NA);
402
2
                        }
403
3
                    }
404
33
                    else {
405
33
                        ptvcursor_add(ptv, hf_wow_protocol_version, 1, ENC_LITTLE_ENDIAN);
406
33
                        ptvcursor_add(ptv, hf_wow_size, 2, ENC_LITTLE_ENDIAN);
407
33
                        ptvcursor_add(ptv, hf_wow_game_name, 4, ENC_LITTLE_ENDIAN);
408
33
                        ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Version");
409
33
                        ptvcursor_add(ptv, hf_wow_major, 1, ENC_LITTLE_ENDIAN);
410
33
                        ptvcursor_add(ptv, hf_wow_minor, 1, ENC_LITTLE_ENDIAN);
411
33
                        ptvcursor_add(ptv, hf_wow_patch, 1, ENC_LITTLE_ENDIAN);
412
33
                        ptvcursor_add(ptv, hf_wow_build, 2, ENC_LITTLE_ENDIAN);
413
33
                        ptvcursor_pop_subtree(ptv);
414
33
                        ptvcursor_add(ptv, hf_wow_platform, 4, ENC_LITTLE_ENDIAN);
415
33
                        ptvcursor_add(ptv, hf_wow_os, 4, ENC_LITTLE_ENDIAN);
416
33
                        ptvcursor_add(ptv, hf_wow_locale, 4, ENC_LITTLE_ENDIAN);
417
33
                        ptvcursor_add(ptv, hf_wow_utc_timezone_offset, 4, ENC_LITTLE_ENDIAN);
418
33
                        ptvcursor_add(ptv, hf_wow_client_ip_address, 4, ENC_LITTLE_ENDIAN);
419
33
                        add_string(ptv, &hf_wow_account_name);
420
33
                    }
421
36
                break;
422
0
                case 3:
423
0
                    if (WOW_SERVER_TO_CLIENT) {
424
0
                        ptvcursor_add(ptv, hf_wow_protocol_version_int, 1, ENC_LITTLE_ENDIAN);
425
0
                        ptvcursor_add_ret_uint(ptv, hf_wow_login_result, 1, ENC_LITTLE_ENDIAN, &result);
426
0
                        if (result == LOGIN_RESULT_SUCCESS) {
427
0
                            ptvcursor_add(ptv, hf_wow_server_public_key, 32, ENC_NA);
428
0
                            ptvcursor_add_ret_uint(ptv, hf_wow_generator_length, 1, ENC_LITTLE_ENDIAN, &generator_length);
429
0
                            ptvcursor_add(ptv, hf_wow_generator, generator_length, ENC_NA);
430
0
                            ptvcursor_add_ret_uint(ptv, hf_wow_large_safe_prime_length, 1, ENC_LITTLE_ENDIAN, &large_safe_prime_length);
431
0
                            ptvcursor_add(ptv, hf_wow_large_safe_prime, large_safe_prime_length, ENC_NA);
432
0
                            ptvcursor_add(ptv, hf_wow_salt, 32, ENC_NA);
433
0
                            ptvcursor_add(ptv, hf_wow_crc_salt, 16, ENC_NA);
434
0
                            ptvcursor_add_ret_uint(ptv, hf_wow_security_flag, 1, ENC_LITTLE_ENDIAN, &security_flag);
435
0
                            if (security_flag == SECURITY_FLAG_PIN) {
436
0
                                ptvcursor_add(ptv, hf_wow_pin_grid_seed, 4, ENC_LITTLE_ENDIAN);
437
0
                                ptvcursor_add(ptv, hf_wow_pin_salt, 16, ENC_NA);
438
0
                            }
439
0
                        }
440
0
                    }
441
0
                    else {
442
0
                        ptvcursor_add(ptv, hf_wow_protocol_version, 1, ENC_LITTLE_ENDIAN);
443
0
                        ptvcursor_add(ptv, hf_wow_size, 2, ENC_LITTLE_ENDIAN);
444
0
                        ptvcursor_add(ptv, hf_wow_game_name, 4, ENC_LITTLE_ENDIAN);
445
0
                        ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Version");
446
0
                        ptvcursor_add(ptv, hf_wow_major, 1, ENC_LITTLE_ENDIAN);
447
0
                        ptvcursor_add(ptv, hf_wow_minor, 1, ENC_LITTLE_ENDIAN);
448
0
                        ptvcursor_add(ptv, hf_wow_patch, 1, ENC_LITTLE_ENDIAN);
449
0
                        ptvcursor_add(ptv, hf_wow_build, 2, ENC_LITTLE_ENDIAN);
450
0
                        ptvcursor_pop_subtree(ptv);
451
0
                        ptvcursor_add(ptv, hf_wow_platform, 4, ENC_LITTLE_ENDIAN);
452
0
                        ptvcursor_add(ptv, hf_wow_os, 4, ENC_LITTLE_ENDIAN);
453
0
                        ptvcursor_add(ptv, hf_wow_locale, 4, ENC_LITTLE_ENDIAN);
454
0
                        ptvcursor_add(ptv, hf_wow_utc_timezone_offset, 4, ENC_LITTLE_ENDIAN);
455
0
                        ptvcursor_add(ptv, hf_wow_client_ip_address, 4, ENC_LITTLE_ENDIAN);
456
0
                        add_string(ptv, &hf_wow_account_name);
457
0
                    }
458
0
                break;
459
0
                case 5:
460
0
                case 6:
461
0
                case 7:
462
0
                    if (WOW_SERVER_TO_CLIENT) {
463
0
                        ptvcursor_add(ptv, hf_wow_protocol_version_int, 1, ENC_LITTLE_ENDIAN);
464
0
                        ptvcursor_add_ret_uint(ptv, hf_wow_login_result, 1, ENC_LITTLE_ENDIAN, &result);
465
0
                        if (result == LOGIN_RESULT_SUCCESS) {
466
0
                            ptvcursor_add(ptv, hf_wow_server_public_key, 32, ENC_NA);
467
0
                            ptvcursor_add_ret_uint(ptv, hf_wow_generator_length, 1, ENC_LITTLE_ENDIAN, &generator_length);
468
0
                            ptvcursor_add(ptv, hf_wow_generator, generator_length, ENC_NA);
469
0
                            ptvcursor_add_ret_uint(ptv, hf_wow_large_safe_prime_length, 1, ENC_LITTLE_ENDIAN, &large_safe_prime_length);
470
0
                            ptvcursor_add(ptv, hf_wow_large_safe_prime, large_safe_prime_length, ENC_NA);
471
0
                            ptvcursor_add(ptv, hf_wow_salt, 32, ENC_NA);
472
0
                            ptvcursor_add(ptv, hf_wow_crc_salt, 16, ENC_NA);
473
0
                            ptvcursor_add_ret_uint(ptv, hf_wow_security_flag, 1, ENC_LITTLE_ENDIAN, &security_flag);
474
0
                            if (security_flag & SECURITY_FLAG_PIN) {
475
0
                                ptvcursor_add(ptv, hf_wow_pin_grid_seed, 4, ENC_LITTLE_ENDIAN);
476
0
                                ptvcursor_add(ptv, hf_wow_pin_salt, 16, ENC_NA);
477
0
                            }
478
0
                            if (security_flag & SECURITY_FLAG_MATRIX_CARD) {
479
0
                                ptvcursor_add(ptv, hf_wow_width, 1, ENC_LITTLE_ENDIAN);
480
0
                                ptvcursor_add(ptv, hf_wow_height, 1, ENC_LITTLE_ENDIAN);
481
0
                                ptvcursor_add(ptv, hf_wow_digit_count, 1, ENC_LITTLE_ENDIAN);
482
0
                                ptvcursor_add(ptv, hf_wow_challenge_count, 1, ENC_LITTLE_ENDIAN);
483
0
                                ptvcursor_add(ptv, hf_wow_seed, 8, ENC_LITTLE_ENDIAN);
484
0
                            }
485
0
                        }
486
0
                    }
487
0
                    else {
488
0
                        ptvcursor_add(ptv, hf_wow_protocol_version, 1, ENC_LITTLE_ENDIAN);
489
0
                        ptvcursor_add(ptv, hf_wow_size, 2, ENC_LITTLE_ENDIAN);
490
0
                        ptvcursor_add(ptv, hf_wow_game_name, 4, ENC_LITTLE_ENDIAN);
491
0
                        ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Version");
492
0
                        ptvcursor_add(ptv, hf_wow_major, 1, ENC_LITTLE_ENDIAN);
493
0
                        ptvcursor_add(ptv, hf_wow_minor, 1, ENC_LITTLE_ENDIAN);
494
0
                        ptvcursor_add(ptv, hf_wow_patch, 1, ENC_LITTLE_ENDIAN);
495
0
                        ptvcursor_add(ptv, hf_wow_build, 2, ENC_LITTLE_ENDIAN);
496
0
                        ptvcursor_pop_subtree(ptv);
497
0
                        ptvcursor_add(ptv, hf_wow_platform, 4, ENC_LITTLE_ENDIAN);
498
0
                        ptvcursor_add(ptv, hf_wow_os, 4, ENC_LITTLE_ENDIAN);
499
0
                        ptvcursor_add(ptv, hf_wow_locale, 4, ENC_LITTLE_ENDIAN);
500
0
                        ptvcursor_add(ptv, hf_wow_utc_timezone_offset, 4, ENC_LITTLE_ENDIAN);
501
0
                        ptvcursor_add(ptv, hf_wow_client_ip_address, 4, ENC_LITTLE_ENDIAN);
502
0
                        add_string(ptv, &hf_wow_account_name);
503
0
                    }
504
0
                break;
505
0
                case 8:
506
0
                    if (WOW_SERVER_TO_CLIENT) {
507
0
                        ptvcursor_add(ptv, hf_wow_protocol_version_int, 1, ENC_LITTLE_ENDIAN);
508
0
                        ptvcursor_add_ret_uint(ptv, hf_wow_login_result, 1, ENC_LITTLE_ENDIAN, &result);
509
0
                        if (result == LOGIN_RESULT_SUCCESS) {
510
0
                            ptvcursor_add(ptv, hf_wow_server_public_key, 32, ENC_NA);
511
0
                            ptvcursor_add_ret_uint(ptv, hf_wow_generator_length, 1, ENC_LITTLE_ENDIAN, &generator_length);
512
0
                            ptvcursor_add(ptv, hf_wow_generator, generator_length, ENC_NA);
513
0
                            ptvcursor_add_ret_uint(ptv, hf_wow_large_safe_prime_length, 1, ENC_LITTLE_ENDIAN, &large_safe_prime_length);
514
0
                            ptvcursor_add(ptv, hf_wow_large_safe_prime, large_safe_prime_length, ENC_NA);
515
0
                            ptvcursor_add(ptv, hf_wow_salt, 32, ENC_NA);
516
0
                            ptvcursor_add(ptv, hf_wow_crc_salt, 16, ENC_NA);
517
0
                            ptvcursor_add_ret_uint(ptv, hf_wow_security_flag, 1, ENC_LITTLE_ENDIAN, &security_flag);
518
0
                            if (security_flag & SECURITY_FLAG_PIN) {
519
0
                                ptvcursor_add(ptv, hf_wow_pin_grid_seed, 4, ENC_LITTLE_ENDIAN);
520
0
                                ptvcursor_add(ptv, hf_wow_pin_salt, 16, ENC_NA);
521
0
                            }
522
0
                            if (security_flag & SECURITY_FLAG_MATRIX_CARD) {
523
0
                                ptvcursor_add(ptv, hf_wow_width, 1, ENC_LITTLE_ENDIAN);
524
0
                                ptvcursor_add(ptv, hf_wow_height, 1, ENC_LITTLE_ENDIAN);
525
0
                                ptvcursor_add(ptv, hf_wow_digit_count, 1, ENC_LITTLE_ENDIAN);
526
0
                                ptvcursor_add(ptv, hf_wow_challenge_count, 1, ENC_LITTLE_ENDIAN);
527
0
                                ptvcursor_add(ptv, hf_wow_seed, 8, ENC_LITTLE_ENDIAN);
528
0
                            }
529
0
                            if (security_flag & SECURITY_FLAG_AUTHENTICATOR) {
530
0
                                ptvcursor_add(ptv, hf_wow_required, 1, ENC_LITTLE_ENDIAN);
531
0
                            }
532
0
                        }
533
0
                    }
534
0
                    else {
535
0
                        ptvcursor_add(ptv, hf_wow_protocol_version, 1, ENC_LITTLE_ENDIAN);
536
0
                        ptvcursor_add(ptv, hf_wow_size, 2, ENC_LITTLE_ENDIAN);
537
0
                        ptvcursor_add(ptv, hf_wow_game_name, 4, ENC_LITTLE_ENDIAN);
538
0
                        ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Version");
539
0
                        ptvcursor_add(ptv, hf_wow_major, 1, ENC_LITTLE_ENDIAN);
540
0
                        ptvcursor_add(ptv, hf_wow_minor, 1, ENC_LITTLE_ENDIAN);
541
0
                        ptvcursor_add(ptv, hf_wow_patch, 1, ENC_LITTLE_ENDIAN);
542
0
                        ptvcursor_add(ptv, hf_wow_build, 2, ENC_LITTLE_ENDIAN);
543
0
                        ptvcursor_pop_subtree(ptv);
544
0
                        ptvcursor_add(ptv, hf_wow_platform, 4, ENC_LITTLE_ENDIAN);
545
0
                        ptvcursor_add(ptv, hf_wow_os, 4, ENC_LITTLE_ENDIAN);
546
0
                        ptvcursor_add(ptv, hf_wow_locale, 4, ENC_LITTLE_ENDIAN);
547
0
                        ptvcursor_add(ptv, hf_wow_utc_timezone_offset, 4, ENC_LITTLE_ENDIAN);
548
0
                        ptvcursor_add(ptv, hf_wow_client_ip_address, 4, ENC_LITTLE_ENDIAN);
549
0
                        add_string(ptv, &hf_wow_account_name);
550
0
                    }
551
0
                break;
552
36
            }
553
15
            break;
554
15
        case CMD_AUTH_LOGON_PROOF:
555
9
            switch (*protocol_version) {
556
9
                case 2:
557
9
                case 3:
558
9
                    if (WOW_SERVER_TO_CLIENT) {
559
2
                        ptvcursor_add_ret_uint(ptv, hf_wow_login_result, 1, ENC_LITTLE_ENDIAN, &result);
560
2
                        if (result == LOGIN_RESULT_SUCCESS) {
561
1
                            ptvcursor_add(ptv, hf_wow_server_proof, 20, ENC_NA);
562
1
                            ptvcursor_add(ptv, hf_wow_hardware_survey_id, 4, ENC_LITTLE_ENDIAN);
563
1
                        }
564
2
                    }
565
7
                    else {
566
7
                        ptvcursor_add(ptv, hf_wow_client_public_key, 32, ENC_NA);
567
7
                        ptvcursor_add(ptv, hf_wow_client_proof, 20, ENC_NA);
568
7
                        ptvcursor_add(ptv, hf_wow_crc_hash, 20, ENC_NA);
569
7
                        ptvcursor_add_ret_uint(ptv, hf_wow_number_of_telemetry_keys, 1, ENC_LITTLE_ENDIAN, &number_of_telemetry_keys);
570
49
                        for (uint32_t i1 = 0; i1 < number_of_telemetry_keys; ++i1) {
571
42
                            ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "TelemetryKey %i", i1);
572
42
                            ptvcursor_add(ptv, hf_wow_unknown_int, 2, ENC_LITTLE_ENDIAN);
573
42
                            ptvcursor_add(ptv, hf_wow_unknown_int, 4, ENC_LITTLE_ENDIAN);
574
42
                            ptvcursor_add(ptv, hf_wow_unknown_bytes, 4, ENC_NA);
575
42
                            ptvcursor_add(ptv, hf_wow_cd_key_proof, 20, ENC_NA);
576
42
                            ptvcursor_pop_subtree(ptv);
577
42
                        }
578
7
                    }
579
9
                break;
580
0
                case 5:
581
0
                case 6:
582
0
                case 7:
583
0
                    if (WOW_SERVER_TO_CLIENT) {
584
0
                        ptvcursor_add_ret_uint(ptv, hf_wow_login_result, 1, ENC_LITTLE_ENDIAN, &result);
585
0
                        if (result == LOGIN_RESULT_SUCCESS) {
586
0
                            ptvcursor_add(ptv, hf_wow_server_proof, 20, ENC_NA);
587
0
                            ptvcursor_add(ptv, hf_wow_hardware_survey_id, 4, ENC_LITTLE_ENDIAN);
588
0
                            ptvcursor_add(ptv, hf_wow_unknown_int, 2, ENC_LITTLE_ENDIAN);
589
0
                        }
590
0
                    }
591
0
                    else {
592
0
                        ptvcursor_add(ptv, hf_wow_client_public_key, 32, ENC_NA);
593
0
                        ptvcursor_add(ptv, hf_wow_client_proof, 20, ENC_NA);
594
0
                        ptvcursor_add(ptv, hf_wow_crc_hash, 20, ENC_NA);
595
0
                        ptvcursor_add_ret_uint(ptv, hf_wow_number_of_telemetry_keys, 1, ENC_LITTLE_ENDIAN, &number_of_telemetry_keys);
596
0
                        for (uint32_t i1 = 0; i1 < number_of_telemetry_keys; ++i1) {
597
0
                            ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "TelemetryKey %i", i1);
598
0
                            ptvcursor_add(ptv, hf_wow_unknown_int, 2, ENC_LITTLE_ENDIAN);
599
0
                            ptvcursor_add(ptv, hf_wow_unknown_int, 4, ENC_LITTLE_ENDIAN);
600
0
                            ptvcursor_add(ptv, hf_wow_unknown_bytes, 4, ENC_NA);
601
0
                            ptvcursor_add(ptv, hf_wow_cd_key_proof, 20, ENC_NA);
602
0
                            ptvcursor_pop_subtree(ptv);
603
0
                        }
604
0
                    }
605
0
                break;
606
0
                case 8:
607
0
                    if (WOW_SERVER_TO_CLIENT) {
608
0
                        ptvcursor_add_ret_uint(ptv, hf_wow_login_result, 1, ENC_LITTLE_ENDIAN, &result);
609
0
                        if (result == LOGIN_RESULT_SUCCESS) {
610
0
                            ptvcursor_add(ptv, hf_wow_server_proof, 20, ENC_NA);
611
0
                            ptvcursor_add(ptv, hf_wow_account_flag, 4, ENC_LITTLE_ENDIAN);
612
0
                            ptvcursor_add(ptv, hf_wow_hardware_survey_id, 4, ENC_LITTLE_ENDIAN);
613
0
                            ptvcursor_add(ptv, hf_wow_unknown_int, 2, ENC_LITTLE_ENDIAN);
614
0
                        }
615
0
                        else {
616
0
                            ptvcursor_add(ptv, hf_wow_padding, 2, ENC_LITTLE_ENDIAN);
617
0
                        }
618
0
                    }
619
0
                    else {
620
0
                        ptvcursor_add(ptv, hf_wow_client_public_key, 32, ENC_NA);
621
0
                        ptvcursor_add(ptv, hf_wow_client_proof, 20, ENC_NA);
622
0
                        ptvcursor_add(ptv, hf_wow_crc_hash, 20, ENC_NA);
623
0
                        ptvcursor_add_ret_uint(ptv, hf_wow_number_of_telemetry_keys, 1, ENC_LITTLE_ENDIAN, &number_of_telemetry_keys);
624
0
                        for (uint32_t i1 = 0; i1 < number_of_telemetry_keys; ++i1) {
625
0
                            ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "TelemetryKey %i", i1);
626
0
                            ptvcursor_add(ptv, hf_wow_unknown_int, 2, ENC_LITTLE_ENDIAN);
627
0
                            ptvcursor_add(ptv, hf_wow_unknown_int, 4, ENC_LITTLE_ENDIAN);
628
0
                            ptvcursor_add(ptv, hf_wow_unknown_bytes, 4, ENC_NA);
629
0
                            ptvcursor_add(ptv, hf_wow_cd_key_proof, 20, ENC_NA);
630
0
                            ptvcursor_pop_subtree(ptv);
631
0
                        }
632
0
                    }
633
0
                break;
634
9
            }
635
3
            break;
636
3
        case CMD_AUTH_RECONNECT_CHALLENGE:
637
3
            switch (*protocol_version) {
638
3
                case 2:
639
3
                case 5:
640
3
                case 6:
641
3
                case 7:
642
3
                    if (WOW_SERVER_TO_CLIENT) {
643
2
                        ptvcursor_add_ret_uint(ptv, hf_wow_login_result, 1, ENC_LITTLE_ENDIAN, &result);
644
2
                        if (result == LOGIN_RESULT_SUCCESS) {
645
1
                            ptvcursor_add(ptv, hf_wow_challenge_data, 16, ENC_NA);
646
1
                            ptvcursor_add(ptv, hf_wow_checksum_salt, 16, ENC_NA);
647
1
                        }
648
2
                    }
649
1
                    else {
650
1
                        ptvcursor_add(ptv, hf_wow_protocol_version, 1, ENC_LITTLE_ENDIAN);
651
1
                        ptvcursor_add(ptv, hf_wow_size, 2, ENC_LITTLE_ENDIAN);
652
1
                        ptvcursor_add(ptv, hf_wow_game_name, 4, ENC_LITTLE_ENDIAN);
653
1
                        ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Version");
654
1
                        ptvcursor_add(ptv, hf_wow_major, 1, ENC_LITTLE_ENDIAN);
655
1
                        ptvcursor_add(ptv, hf_wow_minor, 1, ENC_LITTLE_ENDIAN);
656
1
                        ptvcursor_add(ptv, hf_wow_patch, 1, ENC_LITTLE_ENDIAN);
657
1
                        ptvcursor_add(ptv, hf_wow_build, 2, ENC_LITTLE_ENDIAN);
658
1
                        ptvcursor_pop_subtree(ptv);
659
1
                        ptvcursor_add(ptv, hf_wow_platform, 4, ENC_LITTLE_ENDIAN);
660
1
                        ptvcursor_add(ptv, hf_wow_os, 4, ENC_LITTLE_ENDIAN);
661
1
                        ptvcursor_add(ptv, hf_wow_locale, 4, ENC_LITTLE_ENDIAN);
662
1
                        ptvcursor_add(ptv, hf_wow_utc_timezone_offset, 4, ENC_LITTLE_ENDIAN);
663
1
                        ptvcursor_add(ptv, hf_wow_client_ip_address, 4, ENC_LITTLE_ENDIAN);
664
1
                        add_string(ptv, &hf_wow_account_name);
665
1
                    }
666
3
                break;
667
0
                case 8:
668
0
                    if (WOW_SERVER_TO_CLIENT) {
669
0
                        ptvcursor_add_ret_uint(ptv, hf_wow_login_result, 1, ENC_LITTLE_ENDIAN, &result);
670
0
                        if (result == LOGIN_RESULT_SUCCESS) {
671
0
                            ptvcursor_add(ptv, hf_wow_challenge_data, 16, ENC_NA);
672
0
                            ptvcursor_add(ptv, hf_wow_checksum_salt, 16, ENC_NA);
673
0
                        }
674
0
                    }
675
0
                    else {
676
0
                        ptvcursor_add(ptv, hf_wow_protocol_version, 1, ENC_LITTLE_ENDIAN);
677
0
                        ptvcursor_add(ptv, hf_wow_size, 2, ENC_LITTLE_ENDIAN);
678
0
                        ptvcursor_add(ptv, hf_wow_game_name, 4, ENC_LITTLE_ENDIAN);
679
0
                        ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Version");
680
0
                        ptvcursor_add(ptv, hf_wow_major, 1, ENC_LITTLE_ENDIAN);
681
0
                        ptvcursor_add(ptv, hf_wow_minor, 1, ENC_LITTLE_ENDIAN);
682
0
                        ptvcursor_add(ptv, hf_wow_patch, 1, ENC_LITTLE_ENDIAN);
683
0
                        ptvcursor_add(ptv, hf_wow_build, 2, ENC_LITTLE_ENDIAN);
684
0
                        ptvcursor_pop_subtree(ptv);
685
0
                        ptvcursor_add(ptv, hf_wow_platform, 4, ENC_LITTLE_ENDIAN);
686
0
                        ptvcursor_add(ptv, hf_wow_os, 4, ENC_LITTLE_ENDIAN);
687
0
                        ptvcursor_add(ptv, hf_wow_locale, 4, ENC_LITTLE_ENDIAN);
688
0
                        ptvcursor_add(ptv, hf_wow_utc_timezone_offset, 4, ENC_LITTLE_ENDIAN);
689
0
                        ptvcursor_add(ptv, hf_wow_client_ip_address, 4, ENC_LITTLE_ENDIAN);
690
0
                        add_string(ptv, &hf_wow_account_name);
691
0
                    }
692
0
                break;
693
3
            }
694
3
            break;
695
3
        case CMD_AUTH_RECONNECT_PROOF:
696
0
            switch (*protocol_version) {
697
0
                case 2:
698
0
                    if (WOW_SERVER_TO_CLIENT) {
699
0
                        ptvcursor_add(ptv, hf_wow_login_result, 1, ENC_LITTLE_ENDIAN);
700
0
                    }
701
0
                    else {
702
0
                        ptvcursor_add(ptv, hf_wow_proof_data, 16, ENC_NA);
703
0
                        ptvcursor_add(ptv, hf_wow_client_proof, 20, ENC_NA);
704
0
                        ptvcursor_add(ptv, hf_wow_client_checksum, 20, ENC_NA);
705
0
                        ptvcursor_add(ptv, hf_wow_key_count, 1, ENC_LITTLE_ENDIAN);
706
0
                    }
707
0
                break;
708
0
                case 5:
709
0
                case 6:
710
0
                case 7:
711
0
                    if (WOW_SERVER_TO_CLIENT) {
712
0
                        ptvcursor_add(ptv, hf_wow_login_result, 1, ENC_LITTLE_ENDIAN);
713
0
                        ptvcursor_add(ptv, hf_wow_padding, 2, ENC_LITTLE_ENDIAN);
714
0
                    }
715
0
                    else {
716
0
                        ptvcursor_add(ptv, hf_wow_proof_data, 16, ENC_NA);
717
0
                        ptvcursor_add(ptv, hf_wow_client_proof, 20, ENC_NA);
718
0
                        ptvcursor_add(ptv, hf_wow_client_checksum, 20, ENC_NA);
719
0
                        ptvcursor_add(ptv, hf_wow_key_count, 1, ENC_LITTLE_ENDIAN);
720
0
                    }
721
0
                break;
722
0
                case 8:
723
0
                    if (WOW_SERVER_TO_CLIENT) {
724
0
                        ptvcursor_add(ptv, hf_wow_login_result, 1, ENC_LITTLE_ENDIAN);
725
0
                        ptvcursor_add(ptv, hf_wow_padding, 2, ENC_LITTLE_ENDIAN);
726
0
                    }
727
0
                    else {
728
0
                        ptvcursor_add(ptv, hf_wow_proof_data, 16, ENC_NA);
729
0
                        ptvcursor_add(ptv, hf_wow_client_proof, 20, ENC_NA);
730
0
                        ptvcursor_add(ptv, hf_wow_client_checksum, 20, ENC_NA);
731
0
                        ptvcursor_add(ptv, hf_wow_key_count, 1, ENC_LITTLE_ENDIAN);
732
0
                    }
733
0
                break;
734
0
            }
735
0
            break;
736
0
        case CMD_REALM_LIST:
737
0
            switch (*protocol_version) {
738
0
                case 2:
739
0
                case 3:
740
0
                    if (WOW_SERVER_TO_CLIENT) {
741
0
                        ptvcursor_add(ptv, hf_wow_size, 2, ENC_LITTLE_ENDIAN);
742
0
                        ptvcursor_add(ptv, hf_wow_header_padding, 4, ENC_LITTLE_ENDIAN);
743
0
                        ptvcursor_add_ret_uint(ptv, hf_wow_number_of_realms, 1, ENC_LITTLE_ENDIAN, &number_of_realms);
744
0
                        for (uint32_t i1 = 0; i1 < number_of_realms; ++i1) {
745
0
                            ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Realm %i", i1);
746
0
                            ptvcursor_add(ptv, hf_wow_realm_type, 4, ENC_LITTLE_ENDIAN);
747
0
                            ptvcursor_add(ptv, hf_wow_realm_flag, 1, ENC_LITTLE_ENDIAN);
748
0
                            add_cstring(ptv, &hf_wow_name);
749
0
                            add_cstring(ptv, &hf_wow_address);
750
0
                            ptvcursor_add(ptv, hf_wow_population, 4, ENC_LITTLE_ENDIAN);
751
0
                            ptvcursor_add(ptv, hf_wow_number_of_characters_on_realm, 1, ENC_LITTLE_ENDIAN);
752
0
                            ptvcursor_add(ptv, hf_wow_realm_category, 1, ENC_LITTLE_ENDIAN);
753
0
                            ptvcursor_add(ptv, hf_wow_realm_id, 1, ENC_LITTLE_ENDIAN);
754
0
                            ptvcursor_pop_subtree(ptv);
755
0
                        }
756
0
                        ptvcursor_add(ptv, hf_wow_footer_padding, 2, ENC_LITTLE_ENDIAN);
757
0
                    }
758
0
                    else {
759
0
                        ptvcursor_add(ptv, hf_wow_padding, 4, ENC_LITTLE_ENDIAN);
760
0
                    }
761
0
                break;
762
0
                case 5:
763
0
                    if (WOW_SERVER_TO_CLIENT) {
764
0
                        ptvcursor_add(ptv, hf_wow_size, 2, ENC_LITTLE_ENDIAN);
765
0
                        ptvcursor_add(ptv, hf_wow_header_padding, 4, ENC_LITTLE_ENDIAN);
766
0
                        ptvcursor_add_ret_uint(ptv, hf_wow_number_of_realms, 1, ENC_LITTLE_ENDIAN, &number_of_realms);
767
0
                        for (uint32_t i1 = 0; i1 < number_of_realms; ++i1) {
768
0
                            ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Realm %i", i1);
769
0
                            ptvcursor_add(ptv, hf_wow_realm_type, 1, ENC_LITTLE_ENDIAN);
770
0
                            ptvcursor_add(ptv, hf_wow_locked, 1, ENC_NA);
771
0
                            ptvcursor_add(ptv, hf_wow_realm_flag, 1, ENC_LITTLE_ENDIAN);
772
0
                            add_cstring(ptv, &hf_wow_name);
773
0
                            add_cstring(ptv, &hf_wow_address);
774
0
                            ptvcursor_add(ptv, hf_wow_population, 4, ENC_LITTLE_ENDIAN);
775
0
                            ptvcursor_add(ptv, hf_wow_number_of_characters_on_realm, 1, ENC_LITTLE_ENDIAN);
776
0
                            ptvcursor_add(ptv, hf_wow_realm_category, 1, ENC_LITTLE_ENDIAN);
777
0
                            ptvcursor_add(ptv, hf_wow_realm_id, 1, ENC_LITTLE_ENDIAN);
778
0
                            ptvcursor_pop_subtree(ptv);
779
0
                        }
780
0
                        ptvcursor_add(ptv, hf_wow_footer_padding, 2, ENC_LITTLE_ENDIAN);
781
0
                    }
782
0
                    else {
783
0
                        ptvcursor_add(ptv, hf_wow_padding, 4, ENC_LITTLE_ENDIAN);
784
0
                    }
785
0
                break;
786
0
                case 6:
787
0
                case 7:
788
0
                    if (WOW_SERVER_TO_CLIENT) {
789
0
                        ptvcursor_add(ptv, hf_wow_size, 2, ENC_LITTLE_ENDIAN);
790
0
                        ptvcursor_add(ptv, hf_wow_header_padding, 4, ENC_LITTLE_ENDIAN);
791
0
                        ptvcursor_add_ret_uint(ptv, hf_wow_number_of_realms, 2, ENC_LITTLE_ENDIAN, &number_of_realms);
792
0
                        for (uint32_t i1 = 0; i1 < number_of_realms; ++i1) {
793
0
                            ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Realm %i", i1);
794
0
                            ptvcursor_add(ptv, hf_wow_realm_type, 1, ENC_LITTLE_ENDIAN);
795
0
                            ptvcursor_add(ptv, hf_wow_locked, 1, ENC_NA);
796
0
                            ptvcursor_add(ptv, hf_wow_realm_flag, 1, ENC_LITTLE_ENDIAN);
797
0
                            add_cstring(ptv, &hf_wow_name);
798
0
                            add_cstring(ptv, &hf_wow_address);
799
0
                            ptvcursor_add(ptv, hf_wow_population, 4, ENC_LITTLE_ENDIAN);
800
0
                            ptvcursor_add(ptv, hf_wow_number_of_characters_on_realm, 1, ENC_LITTLE_ENDIAN);
801
0
                            ptvcursor_add(ptv, hf_wow_realm_category, 1, ENC_LITTLE_ENDIAN);
802
0
                            ptvcursor_add(ptv, hf_wow_realm_id, 1, ENC_LITTLE_ENDIAN);
803
0
                            ptvcursor_pop_subtree(ptv);
804
0
                        }
805
0
                        ptvcursor_add(ptv, hf_wow_footer_padding, 2, ENC_LITTLE_ENDIAN);
806
0
                    }
807
0
                    else {
808
0
                        ptvcursor_add(ptv, hf_wow_padding, 4, ENC_LITTLE_ENDIAN);
809
0
                    }
810
0
                break;
811
0
                case 8:
812
0
                    if (WOW_SERVER_TO_CLIENT) {
813
0
                        ptvcursor_add(ptv, hf_wow_size, 2, ENC_LITTLE_ENDIAN);
814
0
                        ptvcursor_add(ptv, hf_wow_header_padding, 4, ENC_LITTLE_ENDIAN);
815
0
                        ptvcursor_add_ret_uint(ptv, hf_wow_number_of_realms, 2, ENC_LITTLE_ENDIAN, &number_of_realms);
816
0
                        for (uint32_t i1 = 0; i1 < number_of_realms; ++i1) {
817
0
                            ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Realm %i", i1);
818
0
                            ptvcursor_add(ptv, hf_wow_realm_type, 1, ENC_LITTLE_ENDIAN);
819
0
                            ptvcursor_add(ptv, hf_wow_locked, 1, ENC_NA);
820
0
                            ptvcursor_add_ret_uint(ptv, hf_wow_realm_flag, 1, ENC_LITTLE_ENDIAN, &flag);
821
0
                            add_cstring(ptv, &hf_wow_name);
822
0
                            add_cstring(ptv, &hf_wow_address);
823
0
                            ptvcursor_add(ptv, hf_wow_population, 4, ENC_LITTLE_ENDIAN);
824
0
                            ptvcursor_add(ptv, hf_wow_number_of_characters_on_realm, 1, ENC_LITTLE_ENDIAN);
825
0
                            ptvcursor_add(ptv, hf_wow_realm_category, 1, ENC_LITTLE_ENDIAN);
826
0
                            ptvcursor_add(ptv, hf_wow_realm_id, 1, ENC_LITTLE_ENDIAN);
827
0
                            if (flag & REALM_FLAG_SPECIFY_BUILD) {
828
0
                                ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Version");
829
0
                                ptvcursor_add(ptv, hf_wow_major, 1, ENC_LITTLE_ENDIAN);
830
0
                                ptvcursor_add(ptv, hf_wow_minor, 1, ENC_LITTLE_ENDIAN);
831
0
                                ptvcursor_add(ptv, hf_wow_patch, 1, ENC_LITTLE_ENDIAN);
832
0
                                ptvcursor_add(ptv, hf_wow_build, 2, ENC_LITTLE_ENDIAN);
833
0
                                ptvcursor_pop_subtree(ptv);
834
0
                            }
835
0
                            ptvcursor_pop_subtree(ptv);
836
0
                        }
837
0
                        ptvcursor_add(ptv, hf_wow_footer_padding, 2, ENC_LITTLE_ENDIAN);
838
0
                    }
839
0
                    else {
840
0
                        ptvcursor_add(ptv, hf_wow_padding, 4, ENC_LITTLE_ENDIAN);
841
0
                    }
842
0
                break;
843
0
            }
844
0
            break;
845
1
        case CMD_SURVEY_RESULT:
846
1
            ptvcursor_add(ptv, hf_wow_survey_id, 4, ENC_LITTLE_ENDIAN);
847
1
            ptvcursor_add(ptv, hf_wow_error, 1, ENC_LITTLE_ENDIAN);
848
1
            ptvcursor_add_ret_uint(ptv, hf_wow_compressed_data_length, 2, ENC_LITTLE_ENDIAN, &compressed_data_length);
849
1
            ptvcursor_add(ptv, hf_wow_data, compressed_data_length, ENC_NA);
850
1
            break;
851
1
        case CMD_XFER_DATA:
852
1
            ptvcursor_add_ret_uint(ptv, hf_wow_size, 2, ENC_LITTLE_ENDIAN, &size);
853
1
            ptvcursor_add(ptv, hf_wow_data, size, ENC_NA);
854
1
            break;
855
1
        case CMD_XFER_INITIATE:
856
1
            add_string(ptv, &hf_wow_filename);
857
1
            ptvcursor_add(ptv, hf_wow_file_size, 8, ENC_LITTLE_ENDIAN);
858
1
            ptvcursor_add(ptv, hf_wow_file_md, 16, ENC_NA);
859
1
            break;
860
0
        case CMD_XFER_RESUME:
861
0
            ptvcursor_add(ptv, hf_wow_offset, 8, ENC_LITTLE_ENDIAN);
862
0
            break;
863
864
1
        default:
865
1
            break;
866
52
    }
867
/* AUTOGENERATED_END_PARSER */
868
52
}
869
870
static int
871
dissect_wow_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
872
52
{
873
52
  col_set_str(pinfo->cinfo, COL_PROTOCOL, "WOW");
874
52
  col_clear(pinfo->cinfo, COL_INFO);
875
876
52
  uint32_t offset = 0;
877
52
  uint8_t header_opcode = tvb_get_uint8(tvb, offset);
878
879
52
  col_set_str(pinfo->cinfo, COL_INFO,
880
52
          val_to_str_const(header_opcode, cmd_vs,
881
52
               "Unrecognized packet type"));
882
883
52
  if(!tree) {
884
0
    return tvb_captured_length(tvb);
885
0
  }
886
887
52
  proto_item* ti = proto_tree_add_item(tree, proto_wow, tvb, 0, -1, ENC_NA);
888
52
  proto_tree* wow_tree = proto_item_add_subtree(ti, ett_wow);
889
890
52
  ptvcursor_t* ptv = ptvcursor_new(pinfo->pool, wow_tree, tvb, offset);
891
892
52
  ptvcursor_add(ptv, hf_wow_command, 1, ENC_LITTLE_ENDIAN);
893
894
52
        conversation_t* conv = find_or_create_conversation(pinfo);
895
52
        uint32_t* protocol_version = (uint32_t*)conversation_get_proto_data(conv, proto_wow);
896
52
        if (protocol_version == NULL) {
897
6
            protocol_version = (uint32_t*)wmem_new0(wmem_file_scope(), uint32_t);
898
6
            conversation_add_proto_data(conv, proto_wow, protocol_version);
899
            // 2 is the lowest valid version.
900
6
            *protocol_version = 2;
901
6
        }
902
903
52
        add_body_fields(pinfo, header_opcode, ptv, protocol_version);
904
905
52
        return tvb_captured_length(tvb);
906
52
}
907
908
909
static int
910
dissect_wow(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
911
29
{
912
29
  int8_t size_field_offset = -1;
913
29
  uint8_t cmd;
914
915
29
  cmd = tvb_get_uint8(tvb, 0);
916
917
29
  if(WOW_SERVER_TO_CLIENT && cmd == CMD_REALM_LIST)
918
0
    size_field_offset = 1;
919
29
  if(WOW_CLIENT_TO_SERVER && cmd == CMD_AUTH_LOGON_CHALLENGE)
920
10
    size_field_offset = 2;
921
922
29
  if(size_field_offset > -1) {
923
10
    tcp_dissect_pdus(tvb, pinfo, tree, wow_preference_desegment,
924
10
         size_field_offset+2, get_wow_pdu_len,
925
10
         dissect_wow_pdu, data);
926
927
19
  } else {
928
    /* Doesn't have a size field, so it cannot span multiple
929
       segments.  Therefore, dissect this packet normally. */
930
19
    return dissect_wow_pdu(tvb, pinfo, tree, data);
931
19
  }
932
933
10
  return 0;
934
29
}
935
936
937
void
938
proto_register_wow(void)
939
16
{
940
16
  module_t *wow_module; /* For our preferences */
941
942
16
  static hf_register_info hf[] = {
943
16
        { &hf_wow_command,
944
16
          { "Command", "wow.cmd",
945
16
            FT_UINT8, BASE_HEX, VALS(cmd_vs), 0,
946
16
            "Type of packet", HFILL }
947
16
        },
948
16
        { &hf_wow_string_length,
949
16
            { "String Length", "wow.string.length",
950
16
                FT_UINT8, BASE_HEX_DEC, NULL, 0,
951
16
                "Length of following string", HFILL }
952
16
        },
953
        /* AUTOGENERATED_START_REGISTER */
954
16
        { &hf_wow_account_flag,
955
16
            { "Account Flag", "wow.account.flag",
956
16
                FT_UINT32, BASE_HEX_DEC, NULL, 0,
957
16
                NULL, HFILL
958
16
            }
959
16
        },
960
16
        { &hf_wow_account_name,
961
16
            { "Account Name", "wow.account.name",
962
16
                FT_STRINGZ, BASE_NONE, NULL, 0,
963
16
                NULL, HFILL
964
16
            }
965
16
        },
966
16
        { &hf_wow_address,
967
16
            { "Address", "wow.address",
968
16
                FT_STRINGZ, BASE_NONE, NULL, 0,
969
16
                NULL, HFILL
970
16
            }
971
16
        },
972
16
        { &hf_wow_authenticator,
973
16
            { "Authenticator", "wow.authenticator",
974
16
                FT_STRINGZ, BASE_NONE, NULL, 0,
975
16
                NULL, HFILL
976
16
            }
977
16
        },
978
16
        { &hf_wow_build,
979
16
            { "Build", "wow.build",
980
16
                FT_UINT16, BASE_HEX_DEC, NULL, 0,
981
16
                NULL, HFILL
982
16
            }
983
16
        },
984
16
        { &hf_wow_cd_key_proof,
985
16
            { "Cd Key Proof", "wow.cd.key.proof",
986
16
                FT_BYTES, BASE_NONE, NULL, 0,
987
16
                NULL, HFILL
988
16
            }
989
16
        },
990
16
        { &hf_wow_challenge_count,
991
16
            { "Challenge Count", "wow.challenge.count",
992
16
                FT_UINT8, BASE_HEX_DEC, NULL, 0,
993
16
                NULL, HFILL
994
16
            }
995
16
        },
996
16
        { &hf_wow_challenge_data,
997
16
            { "Challenge Data", "wow.challenge.data",
998
16
                FT_BYTES, BASE_NONE, NULL, 0,
999
16
                NULL, HFILL
1000
16
            }
1001
16
        },
1002
16
        { &hf_wow_checksum_salt,
1003
16
            { "Checksum Salt", "wow.checksum.salt",
1004
16
                FT_BYTES, BASE_NONE, NULL, 0,
1005
16
                NULL, HFILL
1006
16
            }
1007
16
        },
1008
16
        { &hf_wow_client_checksum,
1009
16
            { "Client Checksum", "wow.client.checksum",
1010
16
                FT_BYTES, BASE_NONE, NULL, 0,
1011
16
                NULL, HFILL
1012
16
            }
1013
16
        },
1014
16
        { &hf_wow_client_ip_address,
1015
16
            { "Client Ip Address", "wow.client.ip.address",
1016
16
                FT_UINT32, BASE_HEX_DEC, NULL, 0,
1017
16
                NULL, HFILL
1018
16
            }
1019
16
        },
1020
16
        { &hf_wow_client_proof,
1021
16
            { "Client Proof", "wow.client.proof",
1022
16
                FT_BYTES, BASE_NONE, NULL, 0,
1023
16
                NULL, HFILL
1024
16
            }
1025
16
        },
1026
16
        { &hf_wow_client_public_key,
1027
16
            { "Client Public Key", "wow.client.public.key",
1028
16
                FT_BYTES, BASE_NONE, NULL, 0,
1029
16
                NULL, HFILL
1030
16
            }
1031
16
        },
1032
16
        { &hf_wow_compressed_data_length,
1033
16
            { "Compressed Data Length", "wow.compressed.data.length",
1034
16
                FT_UINT16, BASE_HEX_DEC, NULL, 0,
1035
16
                NULL, HFILL
1036
16
            }
1037
16
        },
1038
16
        { &hf_wow_crc_hash,
1039
16
            { "Crc Hash", "wow.crc.hash",
1040
16
                FT_BYTES, BASE_NONE, NULL, 0,
1041
16
                NULL, HFILL
1042
16
            }
1043
16
        },
1044
16
        { &hf_wow_crc_salt,
1045
16
            { "Crc Salt", "wow.crc.salt",
1046
16
                FT_BYTES, BASE_NONE, NULL, 0,
1047
16
                NULL, HFILL
1048
16
            }
1049
16
        },
1050
16
        { &hf_wow_data,
1051
16
            { "Data", "wow.data",
1052
16
                FT_BYTES, BASE_NONE, NULL, 0,
1053
16
                NULL, HFILL
1054
16
            }
1055
16
        },
1056
16
        { &hf_wow_decompressed_size,
1057
16
            { "Decompressed Size", "wow.decompressed.size",
1058
16
                FT_UINT32, BASE_HEX_DEC, NULL, 0,
1059
16
                NULL, HFILL
1060
16
            }
1061
16
        },
1062
16
        { &hf_wow_digit_count,
1063
16
            { "Digit Count", "wow.digit.count",
1064
16
                FT_UINT8, BASE_HEX_DEC, NULL, 0,
1065
16
                NULL, HFILL
1066
16
            }
1067
16
        },
1068
16
        { &hf_wow_error,
1069
16
            { "Error", "wow.error",
1070
16
                FT_UINT8, BASE_HEX_DEC, NULL, 0,
1071
16
                NULL, HFILL
1072
16
            }
1073
16
        },
1074
16
        { &hf_wow_file_md,
1075
16
            { "File Md", "wow.file.md",
1076
16
                FT_BYTES, BASE_NONE, NULL, 0,
1077
16
                NULL, HFILL
1078
16
            }
1079
16
        },
1080
16
        { &hf_wow_file_size,
1081
16
            { "File Size", "wow.file.size",
1082
16
                FT_UINT64, BASE_HEX_DEC, NULL, 0,
1083
16
                NULL, HFILL
1084
16
            }
1085
16
        },
1086
16
        { &hf_wow_filename,
1087
16
            { "Filename", "wow.filename",
1088
16
                FT_STRINGZ, BASE_NONE, NULL, 0,
1089
16
                NULL, HFILL
1090
16
            }
1091
16
        },
1092
16
        { &hf_wow_footer_padding,
1093
16
            { "Footer Padding", "wow.footer.padding",
1094
16
                FT_UINT16, BASE_HEX_DEC, NULL, 0,
1095
16
                NULL, HFILL
1096
16
            }
1097
16
        },
1098
16
        { &hf_wow_game_name,
1099
16
            { "Game Name", "wow.game.name",
1100
16
                FT_UINT32, BASE_HEX_DEC, NULL, 0,
1101
16
                NULL, HFILL
1102
16
            }
1103
16
        },
1104
16
        { &hf_wow_generator,
1105
16
            { "Generator", "wow.generator",
1106
16
                FT_BYTES, BASE_NONE, NULL, 0,
1107
16
                NULL, HFILL
1108
16
            }
1109
16
        },
1110
16
        { &hf_wow_generator_length,
1111
16
            { "Generator Length", "wow.generator.length",
1112
16
                FT_UINT8, BASE_HEX_DEC, NULL, 0,
1113
16
                NULL, HFILL
1114
16
            }
1115
16
        },
1116
16
        { &hf_wow_hardware_survey_id,
1117
16
            { "Hardware Survey Id", "wow.hardware.survey.id",
1118
16
                FT_UINT32, BASE_HEX_DEC, NULL, 0,
1119
16
                NULL, HFILL
1120
16
            }
1121
16
        },
1122
16
        { &hf_wow_header_padding,
1123
16
            { "Header Padding", "wow.header.padding",
1124
16
                FT_UINT32, BASE_HEX_DEC, NULL, 0,
1125
16
                NULL, HFILL
1126
16
            }
1127
16
        },
1128
16
        { &hf_wow_height,
1129
16
            { "Height", "wow.height",
1130
16
                FT_UINT8, BASE_HEX_DEC, NULL, 0,
1131
16
                NULL, HFILL
1132
16
            }
1133
16
        },
1134
16
        { &hf_wow_key_count,
1135
16
            { "Key Count", "wow.key.count",
1136
16
                FT_UINT8, BASE_HEX_DEC, NULL, 0,
1137
16
                NULL, HFILL
1138
16
            }
1139
16
        },
1140
16
        { &hf_wow_large_safe_prime,
1141
16
            { "Large Safe Prime", "wow.large.safe.prime",
1142
16
                FT_BYTES, BASE_NONE, NULL, 0,
1143
16
                NULL, HFILL
1144
16
            }
1145
16
        },
1146
16
        { &hf_wow_large_safe_prime_length,
1147
16
            { "Large Safe Prime Length", "wow.large.safe.prime.length",
1148
16
                FT_UINT8, BASE_HEX_DEC, NULL, 0,
1149
16
                NULL, HFILL
1150
16
            }
1151
16
        },
1152
16
        { &hf_wow_locale,
1153
16
            { "Locale", "wow.locale",
1154
16
                FT_UINT32, BASE_HEX_DEC, VALS(e_locale_strings), 0,
1155
16
                NULL, HFILL
1156
16
            }
1157
16
        },
1158
16
        { &hf_wow_locked,
1159
16
            { "Locked", "wow.locked",
1160
16
                FT_UINT8, BASE_HEX_DEC, NULL, 0,
1161
16
                NULL, HFILL
1162
16
            }
1163
16
        },
1164
16
        { &hf_wow_login_result,
1165
16
            { "Login Result", "wow.login.result",
1166
16
                FT_UINT8, BASE_HEX_DEC, VALS(e_login_result_strings), 0,
1167
16
                NULL, HFILL
1168
16
            }
1169
16
        },
1170
16
        { &hf_wow_major,
1171
16
            { "Major", "wow.major",
1172
16
                FT_UINT8, BASE_HEX_DEC, NULL, 0,
1173
16
                NULL, HFILL
1174
16
            }
1175
16
        },
1176
16
        { &hf_wow_matrix_card_proof,
1177
16
            { "Matrix Card Proof", "wow.matrix.card.proof",
1178
16
                FT_BYTES, BASE_NONE, NULL, 0,
1179
16
                NULL, HFILL
1180
16
            }
1181
16
        },
1182
16
        { &hf_wow_minor,
1183
16
            { "Minor", "wow.minor",
1184
16
                FT_UINT8, BASE_HEX_DEC, NULL, 0,
1185
16
                NULL, HFILL
1186
16
            }
1187
16
        },
1188
16
        { &hf_wow_name,
1189
16
            { "Name", "wow.name",
1190
16
                FT_STRINGZ, BASE_NONE, NULL, 0,
1191
16
                NULL, HFILL
1192
16
            }
1193
16
        },
1194
16
        { &hf_wow_number_of_characters_on_realm,
1195
16
            { "Number Of Characters On Realm", "wow.number.of.characters.on.realm",
1196
16
                FT_UINT8, BASE_HEX_DEC, NULL, 0,
1197
16
                NULL, HFILL
1198
16
            }
1199
16
        },
1200
16
        { &hf_wow_number_of_realms,
1201
16
            { "Number Of Realms", "wow.number.of.realms",
1202
16
                FT_UINT16, BASE_HEX_DEC, NULL, 0,
1203
16
                NULL, HFILL
1204
16
            }
1205
16
        },
1206
16
        { &hf_wow_number_of_telemetry_keys,
1207
16
            { "Number Of Telemetry Keys", "wow.number.of.telemetry.keys",
1208
16
                FT_UINT8, BASE_HEX_DEC, NULL, 0,
1209
16
                NULL, HFILL
1210
16
            }
1211
16
        },
1212
16
        { &hf_wow_offset,
1213
16
            { "Offset", "wow.offset",
1214
16
                FT_UINT64, BASE_HEX_DEC, NULL, 0,
1215
16
                NULL, HFILL
1216
16
            }
1217
16
        },
1218
16
        { &hf_wow_os,
1219
16
            { "Os", "wow.os",
1220
16
                FT_UINT32, BASE_HEX_DEC, VALS(e_os_strings), 0,
1221
16
                NULL, HFILL
1222
16
            }
1223
16
        },
1224
16
        { &hf_wow_padding,
1225
16
            { "Padding", "wow.padding",
1226
16
                FT_UINT32, BASE_HEX_DEC, NULL, 0,
1227
16
                NULL, HFILL
1228
16
            }
1229
16
        },
1230
16
        { &hf_wow_patch,
1231
16
            { "Patch", "wow.patch",
1232
16
                FT_UINT8, BASE_HEX_DEC, NULL, 0,
1233
16
                NULL, HFILL
1234
16
            }
1235
16
        },
1236
16
        { &hf_wow_pin_grid_seed,
1237
16
            { "Pin Grid Seed", "wow.pin.grid.seed",
1238
16
                FT_UINT32, BASE_HEX_DEC, NULL, 0,
1239
16
                NULL, HFILL
1240
16
            }
1241
16
        },
1242
16
        { &hf_wow_pin_hash,
1243
16
            { "Pin Hash", "wow.pin.hash",
1244
16
                FT_BYTES, BASE_NONE, NULL, 0,
1245
16
                NULL, HFILL
1246
16
            }
1247
16
        },
1248
16
        { &hf_wow_pin_salt,
1249
16
            { "Pin Salt", "wow.pin.salt",
1250
16
                FT_BYTES, BASE_NONE, NULL, 0,
1251
16
                NULL, HFILL
1252
16
            }
1253
16
        },
1254
16
        { &hf_wow_platform,
1255
16
            { "Platform", "wow.platform",
1256
16
                FT_UINT32, BASE_HEX_DEC, VALS(e_platform_strings), 0,
1257
16
                NULL, HFILL
1258
16
            }
1259
16
        },
1260
16
        { &hf_wow_population,
1261
16
            { "Population", "wow.population",
1262
16
                FT_FLOAT, BASE_NONE, NULL, 0,
1263
16
                NULL, HFILL
1264
16
            }
1265
16
        },
1266
16
        { &hf_wow_proof_data,
1267
16
            { "Proof Data", "wow.proof.data",
1268
16
                FT_BYTES, BASE_NONE, NULL, 0,
1269
16
                NULL, HFILL
1270
16
            }
1271
16
        },
1272
16
        { &hf_wow_protocol_version,
1273
16
            { "Protocol Version", "wow.protocol.version",
1274
16
                FT_UINT8, BASE_HEX_DEC, VALS(e_protocol_version_strings), 0,
1275
16
                NULL, HFILL
1276
16
            }
1277
16
        },
1278
16
        { &hf_wow_protocol_version_int,
1279
16
            { "Protocol Version Int", "wow.protocol.version.int",
1280
16
                FT_UINT8, BASE_HEX_DEC, NULL, 0,
1281
16
                NULL, HFILL
1282
16
            }
1283
16
        },
1284
16
        { &hf_wow_realm_category,
1285
16
            { "Realm Category", "wow.realm.category",
1286
16
                FT_UINT8, BASE_HEX_DEC, VALS(e_realm_category_strings), 0,
1287
16
                NULL, HFILL
1288
16
            }
1289
16
        },
1290
16
        { &hf_wow_realm_flag,
1291
16
            { "Realm Flag", "wow.realm.flag",
1292
16
                FT_UINT8, BASE_HEX_DEC, NULL, 0,
1293
16
                NULL, HFILL
1294
16
            }
1295
16
        },
1296
16
        { &hf_wow_realm_id,
1297
16
            { "Realm Id", "wow.realm.id",
1298
16
                FT_UINT8, BASE_HEX_DEC, NULL, 0,
1299
16
                NULL, HFILL
1300
16
            }
1301
16
        },
1302
16
        { &hf_wow_realm_type,
1303
16
            { "Realm Type", "wow.realm.type",
1304
16
                FT_UINT8, BASE_HEX_DEC, VALS(e_realm_type_strings), 0,
1305
16
                NULL, HFILL
1306
16
            }
1307
16
        },
1308
16
        { &hf_wow_required,
1309
16
            { "Required", "wow.required",
1310
16
                FT_UINT8, BASE_HEX_DEC, NULL, 0,
1311
16
                NULL, HFILL
1312
16
            }
1313
16
        },
1314
16
        { &hf_wow_salt,
1315
16
            { "Salt", "wow.salt",
1316
16
                FT_BYTES, BASE_NONE, NULL, 0,
1317
16
                NULL, HFILL
1318
16
            }
1319
16
        },
1320
16
        { &hf_wow_security_flag,
1321
16
            { "Security Flag", "wow.security.flag",
1322
16
                FT_UINT8, BASE_HEX_DEC, NULL, 0,
1323
16
                NULL, HFILL
1324
16
            }
1325
16
        },
1326
16
        { &hf_wow_seed,
1327
16
            { "Seed", "wow.seed",
1328
16
                FT_UINT64, BASE_HEX_DEC, NULL, 0,
1329
16
                NULL, HFILL
1330
16
            }
1331
16
        },
1332
16
        { &hf_wow_server_proof,
1333
16
            { "Server Proof", "wow.server.proof",
1334
16
                FT_BYTES, BASE_NONE, NULL, 0,
1335
16
                NULL, HFILL
1336
16
            }
1337
16
        },
1338
16
        { &hf_wow_server_public_key,
1339
16
            { "Server Public Key", "wow.server.public.key",
1340
16
                FT_BYTES, BASE_NONE, NULL, 0,
1341
16
                NULL, HFILL
1342
16
            }
1343
16
        },
1344
16
        { &hf_wow_size,
1345
16
            { "Size", "wow.size",
1346
16
                FT_UINT16, BASE_HEX_DEC, NULL, 0,
1347
16
                NULL, HFILL
1348
16
            }
1349
16
        },
1350
16
        { &hf_wow_survey_id,
1351
16
            { "Survey Id", "wow.survey.id",
1352
16
                FT_UINT32, BASE_HEX_DEC, NULL, 0,
1353
16
                NULL, HFILL
1354
16
            }
1355
16
        },
1356
16
        { &hf_wow_unknown_bytes,
1357
16
            { "Unknown Bytes", "wow.unknown.bytes",
1358
16
                FT_BYTES, BASE_NONE, NULL, 0,
1359
16
                NULL, HFILL
1360
16
            }
1361
16
        },
1362
16
        { &hf_wow_unknown_int,
1363
16
            { "Unknown Int", "wow.unknown.int",
1364
16
                FT_UINT32, BASE_HEX_DEC, NULL, 0,
1365
16
                NULL, HFILL
1366
16
            }
1367
16
        },
1368
16
        { &hf_wow_utc_timezone_offset,
1369
16
            { "Utc Timezone Offset", "wow.utc.timezone.offset",
1370
16
                FT_UINT32, BASE_HEX_DEC, NULL, 0,
1371
16
                NULL, HFILL
1372
16
            }
1373
16
        },
1374
16
        { &hf_wow_width,
1375
16
            { "Width", "wow.width",
1376
16
                FT_UINT8, BASE_HEX_DEC, NULL, 0,
1377
16
                NULL, HFILL
1378
16
            }
1379
16
        },
1380
/* AUTOGENERATED_END_REGISTER */
1381
16
  };
1382
1383
16
  static int *ett[] = {
1384
16
    &ett_wow,
1385
16
        &ett_message,
1386
16
  };
1387
1388
16
  proto_wow = proto_register_protocol("World of Warcraft",
1389
16
              "WOW", "wow");
1390
1391
16
  proto_register_field_array(proto_wow, hf, array_length(hf));
1392
16
  proto_register_subtree_array(ett, array_length(ett));
1393
1394
16
  wow_handle = register_dissector("wow", dissect_wow, proto_wow);
1395
1396
16
  wow_module = prefs_register_protocol(proto_wow, NULL);
1397
1398
16
  prefs_register_bool_preference(wow_module, "desegment", "Reassemble wow messages spanning multiple TCP segments.", "Whether the wow dissector should reassemble messages spanning multiple TCP segments.  To use this option, you must also enable \"Allow subdissectors to reassemble TCP streams\" in the TCP protocol settings.", &wow_preference_desegment);
1399
1400
16
}
1401
1402
void
1403
proto_reg_handoff_wow(void)
1404
16
{
1405
16
  dissector_add_uint_with_preference("tcp.port", WOW_PORT, wow_handle);
1406
16
}
1407
1408
/*
1409
 * Editor modelines  -  https://www.wireshark.org/tools/modelines.html
1410
 *
1411
 * Local variables:
1412
 * c-basic-offset: 8
1413
 * tab-width: 8
1414
 * indent-tabs-mode: t
1415
 * End:
1416
 *
1417
 * vi: set shiftwidth=8 tabstop=8 noexpandtab:
1418
 * :indentSize=8:tabSize=8:noTabs=false:
1419
 */