Coverage Report

Created: 2025-02-15 06:25

/src/wireshark/epan/dissectors/packet-wow.c
Line
Count
Source (jump to first uncovered line)
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
14
#define WOW_PORT 3724
228
229
0
#define WOW_CLIENT_TO_SERVER pinfo->destport == WOW_PORT
230
0
#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
0
add_string(ptvcursor_t* ptv, const int* hf) {
348
0
    int32_t len = 0;
349
0
    ptvcursor_add_ret_uint(ptv, hf_wow_string_length, 1, ENC_NA, &len);
350
0
    ptvcursor_add(ptv, *hf, len, ENC_UTF_8);
351
0
}
352
353
static unsigned
354
get_wow_pdu_len(packet_info *pinfo, tvbuff_t *tvb, int offset, void *data _U_)
355
0
{
356
0
  int8_t size_field_offset = -1;
357
0
  uint8_t cmd;
358
0
  uint16_t pkt_len;
359
360
0
  cmd = tvb_get_uint8(tvb, offset);
361
362
0
  if(WOW_SERVER_TO_CLIENT && cmd == CMD_REALM_LIST)
363
0
    size_field_offset = 1;
364
0
  if(WOW_CLIENT_TO_SERVER && cmd == CMD_AUTH_LOGON_CHALLENGE)
365
0
    size_field_offset = 2;
366
367
0
  pkt_len = tvb_get_letohs(tvb, size_field_offset);
368
369
0
  return pkt_len + size_field_offset + 2;
370
0
}
371
372
static void
373
0
add_body_fields(packet_info *pinfo, uint8_t header_opcode, ptvcursor_t *ptv, uint32_t *protocol_version) {
374
    /* AUTOGENERATED_START_VARIABLES */
375
0
    uint32_t compressed_data_length = 0;
376
0
    uint32_t flag = 0;
377
0
    uint32_t generator_length = 0;
378
0
    uint32_t large_safe_prime_length = 0;
379
0
    uint32_t number_of_realms = 0;
380
0
    uint32_t number_of_telemetry_keys = 0;
381
0
    uint32_t result = 0;
382
0
    uint32_t security_flag = 0;
383
0
    uint32_t size = 0;
384
/* AUTOGENERATED_END_VARIABLES */
385
386
    /* AUTOGENERATED_START_PARSER */
387
0
    switch (header_opcode) {
388
0
        case CMD_AUTH_LOGON_CHALLENGE:
389
0
            switch (*protocol_version) {
390
0
                case 2:
391
0
                    if (WOW_SERVER_TO_CLIENT) {
392
0
                        ptvcursor_add(ptv, hf_wow_protocol_version_int, 1, ENC_LITTLE_ENDIAN);
393
0
                        ptvcursor_add_ret_uint(ptv, hf_wow_login_result, 1, ENC_LITTLE_ENDIAN, &result);
394
0
                        if (result == LOGIN_RESULT_SUCCESS) {
395
0
                            ptvcursor_add(ptv, hf_wow_server_public_key, 32, ENC_NA);
396
0
                            ptvcursor_add_ret_uint(ptv, hf_wow_generator_length, 1, ENC_LITTLE_ENDIAN, &generator_length);
397
0
                            ptvcursor_add(ptv, hf_wow_generator, generator_length, ENC_NA);
398
0
                            ptvcursor_add_ret_uint(ptv, hf_wow_large_safe_prime_length, 1, ENC_LITTLE_ENDIAN, &large_safe_prime_length);
399
0
                            ptvcursor_add(ptv, hf_wow_large_safe_prime, large_safe_prime_length, ENC_NA);
400
0
                            ptvcursor_add(ptv, hf_wow_salt, 32, ENC_NA);
401
0
                            ptvcursor_add(ptv, hf_wow_crc_salt, 16, ENC_NA);
402
0
                        }
403
0
                    }
404
0
                    else {
405
0
                        ptvcursor_add(ptv, hf_wow_protocol_version, 1, ENC_LITTLE_ENDIAN);
406
0
                        ptvcursor_add(ptv, hf_wow_size, 2, ENC_LITTLE_ENDIAN);
407
0
                        ptvcursor_add(ptv, hf_wow_game_name, 4, ENC_LITTLE_ENDIAN);
408
0
                        ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Version");
409
0
                        ptvcursor_add(ptv, hf_wow_major, 1, ENC_LITTLE_ENDIAN);
410
0
                        ptvcursor_add(ptv, hf_wow_minor, 1, ENC_LITTLE_ENDIAN);
411
0
                        ptvcursor_add(ptv, hf_wow_patch, 1, ENC_LITTLE_ENDIAN);
412
0
                        ptvcursor_add(ptv, hf_wow_build, 2, ENC_LITTLE_ENDIAN);
413
0
                        ptvcursor_pop_subtree(ptv);
414
0
                        ptvcursor_add(ptv, hf_wow_platform, 4, ENC_LITTLE_ENDIAN);
415
0
                        ptvcursor_add(ptv, hf_wow_os, 4, ENC_LITTLE_ENDIAN);
416
0
                        ptvcursor_add(ptv, hf_wow_locale, 4, ENC_LITTLE_ENDIAN);
417
0
                        ptvcursor_add(ptv, hf_wow_utc_timezone_offset, 4, ENC_LITTLE_ENDIAN);
418
0
                        ptvcursor_add(ptv, hf_wow_client_ip_address, 4, ENC_LITTLE_ENDIAN);
419
0
                        add_string(ptv, &hf_wow_account_name);
420
0
                    }
421
0
                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
0
            }
553
0
            break;
554
0
        case CMD_AUTH_LOGON_PROOF:
555
0
            switch (*protocol_version) {
556
0
                case 2:
557
0
                case 3:
558
0
                    if (WOW_SERVER_TO_CLIENT) {
559
0
                        ptvcursor_add_ret_uint(ptv, hf_wow_login_result, 1, ENC_LITTLE_ENDIAN, &result);
560
0
                        if (result == LOGIN_RESULT_SUCCESS) {
561
0
                            ptvcursor_add(ptv, hf_wow_server_proof, 20, ENC_NA);
562
0
                            ptvcursor_add(ptv, hf_wow_hardware_survey_id, 4, ENC_LITTLE_ENDIAN);
563
0
                        }
564
0
                    }
565
0
                    else {
566
0
                        ptvcursor_add(ptv, hf_wow_client_public_key, 32, ENC_NA);
567
0
                        ptvcursor_add(ptv, hf_wow_client_proof, 20, ENC_NA);
568
0
                        ptvcursor_add(ptv, hf_wow_crc_hash, 20, ENC_NA);
569
0
                        ptvcursor_add_ret_uint(ptv, hf_wow_number_of_telemetry_keys, 1, ENC_LITTLE_ENDIAN, &number_of_telemetry_keys);
570
0
                        for (uint32_t i1 = 0; i1 < number_of_telemetry_keys; ++i1) {
571
0
                            ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "TelemetryKey %i", i1);
572
0
                            ptvcursor_add(ptv, hf_wow_unknown_int, 2, ENC_LITTLE_ENDIAN);
573
0
                            ptvcursor_add(ptv, hf_wow_unknown_int, 4, ENC_LITTLE_ENDIAN);
574
0
                            ptvcursor_add(ptv, hf_wow_unknown_bytes, 4, ENC_NA);
575
0
                            ptvcursor_add(ptv, hf_wow_cd_key_proof, 20, ENC_NA);
576
0
                            ptvcursor_pop_subtree(ptv);
577
0
                        }
578
0
                    }
579
0
                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
0
            }
635
0
            break;
636
0
        case CMD_AUTH_RECONNECT_CHALLENGE:
637
0
            switch (*protocol_version) {
638
0
                case 2:
639
0
                case 5:
640
0
                case 6:
641
0
                case 7:
642
0
                    if (WOW_SERVER_TO_CLIENT) {
643
0
                        ptvcursor_add_ret_uint(ptv, hf_wow_login_result, 1, ENC_LITTLE_ENDIAN, &result);
644
0
                        if (result == LOGIN_RESULT_SUCCESS) {
645
0
                            ptvcursor_add(ptv, hf_wow_challenge_data, 16, ENC_NA);
646
0
                            ptvcursor_add(ptv, hf_wow_checksum_salt, 16, ENC_NA);
647
0
                        }
648
0
                    }
649
0
                    else {
650
0
                        ptvcursor_add(ptv, hf_wow_protocol_version, 1, ENC_LITTLE_ENDIAN);
651
0
                        ptvcursor_add(ptv, hf_wow_size, 2, ENC_LITTLE_ENDIAN);
652
0
                        ptvcursor_add(ptv, hf_wow_game_name, 4, ENC_LITTLE_ENDIAN);
653
0
                        ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Version");
654
0
                        ptvcursor_add(ptv, hf_wow_major, 1, ENC_LITTLE_ENDIAN);
655
0
                        ptvcursor_add(ptv, hf_wow_minor, 1, ENC_LITTLE_ENDIAN);
656
0
                        ptvcursor_add(ptv, hf_wow_patch, 1, ENC_LITTLE_ENDIAN);
657
0
                        ptvcursor_add(ptv, hf_wow_build, 2, ENC_LITTLE_ENDIAN);
658
0
                        ptvcursor_pop_subtree(ptv);
659
0
                        ptvcursor_add(ptv, hf_wow_platform, 4, ENC_LITTLE_ENDIAN);
660
0
                        ptvcursor_add(ptv, hf_wow_os, 4, ENC_LITTLE_ENDIAN);
661
0
                        ptvcursor_add(ptv, hf_wow_locale, 4, ENC_LITTLE_ENDIAN);
662
0
                        ptvcursor_add(ptv, hf_wow_utc_timezone_offset, 4, ENC_LITTLE_ENDIAN);
663
0
                        ptvcursor_add(ptv, hf_wow_client_ip_address, 4, ENC_LITTLE_ENDIAN);
664
0
                        add_string(ptv, &hf_wow_account_name);
665
0
                    }
666
0
                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
0
            }
694
0
            break;
695
0
        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
0
        case CMD_SURVEY_RESULT:
846
0
            ptvcursor_add(ptv, hf_wow_survey_id, 4, ENC_LITTLE_ENDIAN);
847
0
            ptvcursor_add(ptv, hf_wow_error, 1, ENC_LITTLE_ENDIAN);
848
0
            ptvcursor_add_ret_uint(ptv, hf_wow_compressed_data_length, 2, ENC_LITTLE_ENDIAN, &compressed_data_length);
849
0
            ptvcursor_add(ptv, hf_wow_data, compressed_data_length, ENC_NA);
850
0
            break;
851
0
        case CMD_XFER_DATA:
852
0
            ptvcursor_add_ret_uint(ptv, hf_wow_size, 2, ENC_LITTLE_ENDIAN, &size);
853
0
            ptvcursor_add(ptv, hf_wow_data, size, ENC_NA);
854
0
            break;
855
0
        case CMD_XFER_INITIATE:
856
0
            add_string(ptv, &hf_wow_filename);
857
0
            ptvcursor_add(ptv, hf_wow_file_size, 8, ENC_LITTLE_ENDIAN);
858
0
            ptvcursor_add(ptv, hf_wow_file_md, 16, ENC_NA);
859
0
            break;
860
0
        case CMD_XFER_RESUME:
861
0
            ptvcursor_add(ptv, hf_wow_offset, 8, ENC_LITTLE_ENDIAN);
862
0
            break;
863
864
0
        default:
865
0
            break;
866
0
    }
867
/* AUTOGENERATED_END_PARSER */
868
0
}
869
870
static int
871
dissect_wow_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
872
0
{
873
0
  col_set_str(pinfo->cinfo, COL_PROTOCOL, "WOW");
874
0
  col_clear(pinfo->cinfo, COL_INFO);
875
876
0
  uint32_t offset = 0;
877
0
  uint8_t header_opcode = tvb_get_uint8(tvb, offset);
878
879
0
  col_set_str(pinfo->cinfo, COL_INFO,
880
0
          val_to_str_const(header_opcode, cmd_vs,
881
0
               "Unrecognized packet type"));
882
883
0
  if(!tree) {
884
0
    return tvb_captured_length(tvb);
885
0
  }
886
887
0
  proto_item* ti = proto_tree_add_item(tree, proto_wow, tvb, 0, -1, ENC_NA);
888
0
  proto_tree* wow_tree = proto_item_add_subtree(ti, ett_wow);
889
890
0
  ptvcursor_t* ptv = ptvcursor_new(wmem_packet_scope(), wow_tree, tvb, offset);
891
892
0
  ptvcursor_add(ptv, hf_wow_command, 1, ENC_LITTLE_ENDIAN);
893
894
0
        conversation_t* conv = find_or_create_conversation(pinfo);
895
0
        uint32_t* protocol_version = (uint32_t*)conversation_get_proto_data(conv, proto_wow);
896
0
        if (protocol_version == NULL) {
897
0
            protocol_version = (uint32_t*)wmem_new0(wmem_file_scope(), uint32_t);
898
0
            conversation_add_proto_data(conv, proto_wow, protocol_version);
899
            // 2 is the lowest valid version.
900
0
            *protocol_version = 2;
901
0
        }
902
903
0
        add_body_fields(pinfo, header_opcode, ptv, protocol_version);
904
905
0
        return tvb_captured_length(tvb);
906
0
}
907
908
909
static int
910
dissect_wow(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
911
0
{
912
0
  int8_t size_field_offset = -1;
913
0
  uint8_t cmd;
914
915
0
  cmd = tvb_get_uint8(tvb, 0);
916
917
0
  if(WOW_SERVER_TO_CLIENT && cmd == CMD_REALM_LIST)
918
0
    size_field_offset = 1;
919
0
  if(WOW_CLIENT_TO_SERVER && cmd == CMD_AUTH_LOGON_CHALLENGE)
920
0
    size_field_offset = 2;
921
922
0
  if(size_field_offset > -1) {
923
0
    tcp_dissect_pdus(tvb, pinfo, tree, wow_preference_desegment,
924
0
         size_field_offset+2, get_wow_pdu_len,
925
0
         dissect_wow_pdu, data);
926
927
0
  } else {
928
    /* Doesn't have a size field, so it cannot span multiple
929
       segments.  Therefore, dissect this packet normally. */
930
0
    return dissect_wow_pdu(tvb, pinfo, tree, data);
931
0
  }
932
933
0
  return 0;
934
0
}
935
936
937
void
938
proto_register_wow(void)
939
14
{
940
14
  module_t *wow_module; /* For our preferences */
941
942
14
  static hf_register_info hf[] = {
943
14
        { &hf_wow_command,
944
14
          { "Command", "wow.cmd",
945
14
            FT_UINT8, BASE_HEX, VALS(cmd_vs), 0,
946
14
            "Type of packet", HFILL }
947
14
        },
948
14
        { &hf_wow_string_length,
949
14
            { "String Length", "wow.string.length",
950
14
                FT_UINT8, BASE_HEX_DEC, NULL, 0,
951
14
                "Length of following string", HFILL }
952
14
        },
953
        /* AUTOGENERATED_START_REGISTER */
954
14
        { &hf_wow_account_flag,
955
14
            { "Account Flag", "wow.account.flag",
956
14
                FT_UINT32, BASE_HEX_DEC, NULL, 0,
957
14
                NULL, HFILL
958
14
            }
959
14
        },
960
14
        { &hf_wow_account_name,
961
14
            { "Account Name", "wow.account.name",
962
14
                FT_STRINGZ, BASE_NONE, NULL, 0,
963
14
                NULL, HFILL
964
14
            }
965
14
        },
966
14
        { &hf_wow_address,
967
14
            { "Address", "wow.address",
968
14
                FT_STRINGZ, BASE_NONE, NULL, 0,
969
14
                NULL, HFILL
970
14
            }
971
14
        },
972
14
        { &hf_wow_authenticator,
973
14
            { "Authenticator", "wow.authenticator",
974
14
                FT_STRINGZ, BASE_NONE, NULL, 0,
975
14
                NULL, HFILL
976
14
            }
977
14
        },
978
14
        { &hf_wow_build,
979
14
            { "Build", "wow.build",
980
14
                FT_UINT16, BASE_HEX_DEC, NULL, 0,
981
14
                NULL, HFILL
982
14
            }
983
14
        },
984
14
        { &hf_wow_cd_key_proof,
985
14
            { "Cd Key Proof", "wow.cd.key.proof",
986
14
                FT_BYTES, BASE_NONE, NULL, 0,
987
14
                NULL, HFILL
988
14
            }
989
14
        },
990
14
        { &hf_wow_challenge_count,
991
14
            { "Challenge Count", "wow.challenge.count",
992
14
                FT_UINT8, BASE_HEX_DEC, NULL, 0,
993
14
                NULL, HFILL
994
14
            }
995
14
        },
996
14
        { &hf_wow_challenge_data,
997
14
            { "Challenge Data", "wow.challenge.data",
998
14
                FT_BYTES, BASE_NONE, NULL, 0,
999
14
                NULL, HFILL
1000
14
            }
1001
14
        },
1002
14
        { &hf_wow_checksum_salt,
1003
14
            { "Checksum Salt", "wow.checksum.salt",
1004
14
                FT_BYTES, BASE_NONE, NULL, 0,
1005
14
                NULL, HFILL
1006
14
            }
1007
14
        },
1008
14
        { &hf_wow_client_checksum,
1009
14
            { "Client Checksum", "wow.client.checksum",
1010
14
                FT_BYTES, BASE_NONE, NULL, 0,
1011
14
                NULL, HFILL
1012
14
            }
1013
14
        },
1014
14
        { &hf_wow_client_ip_address,
1015
14
            { "Client Ip Address", "wow.client.ip.address",
1016
14
                FT_UINT32, BASE_HEX_DEC, NULL, 0,
1017
14
                NULL, HFILL
1018
14
            }
1019
14
        },
1020
14
        { &hf_wow_client_proof,
1021
14
            { "Client Proof", "wow.client.proof",
1022
14
                FT_BYTES, BASE_NONE, NULL, 0,
1023
14
                NULL, HFILL
1024
14
            }
1025
14
        },
1026
14
        { &hf_wow_client_public_key,
1027
14
            { "Client Public Key", "wow.client.public.key",
1028
14
                FT_BYTES, BASE_NONE, NULL, 0,
1029
14
                NULL, HFILL
1030
14
            }
1031
14
        },
1032
14
        { &hf_wow_compressed_data_length,
1033
14
            { "Compressed Data Length", "wow.compressed.data.length",
1034
14
                FT_UINT16, BASE_HEX_DEC, NULL, 0,
1035
14
                NULL, HFILL
1036
14
            }
1037
14
        },
1038
14
        { &hf_wow_crc_hash,
1039
14
            { "Crc Hash", "wow.crc.hash",
1040
14
                FT_BYTES, BASE_NONE, NULL, 0,
1041
14
                NULL, HFILL
1042
14
            }
1043
14
        },
1044
14
        { &hf_wow_crc_salt,
1045
14
            { "Crc Salt", "wow.crc.salt",
1046
14
                FT_BYTES, BASE_NONE, NULL, 0,
1047
14
                NULL, HFILL
1048
14
            }
1049
14
        },
1050
14
        { &hf_wow_data,
1051
14
            { "Data", "wow.data",
1052
14
                FT_BYTES, BASE_NONE, NULL, 0,
1053
14
                NULL, HFILL
1054
14
            }
1055
14
        },
1056
14
        { &hf_wow_decompressed_size,
1057
14
            { "Decompressed Size", "wow.decompressed.size",
1058
14
                FT_UINT32, BASE_HEX_DEC, NULL, 0,
1059
14
                NULL, HFILL
1060
14
            }
1061
14
        },
1062
14
        { &hf_wow_digit_count,
1063
14
            { "Digit Count", "wow.digit.count",
1064
14
                FT_UINT8, BASE_HEX_DEC, NULL, 0,
1065
14
                NULL, HFILL
1066
14
            }
1067
14
        },
1068
14
        { &hf_wow_error,
1069
14
            { "Error", "wow.error",
1070
14
                FT_UINT8, BASE_HEX_DEC, NULL, 0,
1071
14
                NULL, HFILL
1072
14
            }
1073
14
        },
1074
14
        { &hf_wow_file_md,
1075
14
            { "File Md", "wow.file.md",
1076
14
                FT_BYTES, BASE_NONE, NULL, 0,
1077
14
                NULL, HFILL
1078
14
            }
1079
14
        },
1080
14
        { &hf_wow_file_size,
1081
14
            { "File Size", "wow.file.size",
1082
14
                FT_UINT64, BASE_HEX_DEC, NULL, 0,
1083
14
                NULL, HFILL
1084
14
            }
1085
14
        },
1086
14
        { &hf_wow_filename,
1087
14
            { "Filename", "wow.filename",
1088
14
                FT_STRINGZ, BASE_NONE, NULL, 0,
1089
14
                NULL, HFILL
1090
14
            }
1091
14
        },
1092
14
        { &hf_wow_footer_padding,
1093
14
            { "Footer Padding", "wow.footer.padding",
1094
14
                FT_UINT16, BASE_HEX_DEC, NULL, 0,
1095
14
                NULL, HFILL
1096
14
            }
1097
14
        },
1098
14
        { &hf_wow_game_name,
1099
14
            { "Game Name", "wow.game.name",
1100
14
                FT_UINT32, BASE_HEX_DEC, NULL, 0,
1101
14
                NULL, HFILL
1102
14
            }
1103
14
        },
1104
14
        { &hf_wow_generator,
1105
14
            { "Generator", "wow.generator",
1106
14
                FT_BYTES, BASE_NONE, NULL, 0,
1107
14
                NULL, HFILL
1108
14
            }
1109
14
        },
1110
14
        { &hf_wow_generator_length,
1111
14
            { "Generator Length", "wow.generator.length",
1112
14
                FT_UINT8, BASE_HEX_DEC, NULL, 0,
1113
14
                NULL, HFILL
1114
14
            }
1115
14
        },
1116
14
        { &hf_wow_hardware_survey_id,
1117
14
            { "Hardware Survey Id", "wow.hardware.survey.id",
1118
14
                FT_UINT32, BASE_HEX_DEC, NULL, 0,
1119
14
                NULL, HFILL
1120
14
            }
1121
14
        },
1122
14
        { &hf_wow_header_padding,
1123
14
            { "Header Padding", "wow.header.padding",
1124
14
                FT_UINT32, BASE_HEX_DEC, NULL, 0,
1125
14
                NULL, HFILL
1126
14
            }
1127
14
        },
1128
14
        { &hf_wow_height,
1129
14
            { "Height", "wow.height",
1130
14
                FT_UINT8, BASE_HEX_DEC, NULL, 0,
1131
14
                NULL, HFILL
1132
14
            }
1133
14
        },
1134
14
        { &hf_wow_key_count,
1135
14
            { "Key Count", "wow.key.count",
1136
14
                FT_UINT8, BASE_HEX_DEC, NULL, 0,
1137
14
                NULL, HFILL
1138
14
            }
1139
14
        },
1140
14
        { &hf_wow_large_safe_prime,
1141
14
            { "Large Safe Prime", "wow.large.safe.prime",
1142
14
                FT_BYTES, BASE_NONE, NULL, 0,
1143
14
                NULL, HFILL
1144
14
            }
1145
14
        },
1146
14
        { &hf_wow_large_safe_prime_length,
1147
14
            { "Large Safe Prime Length", "wow.large.safe.prime.length",
1148
14
                FT_UINT8, BASE_HEX_DEC, NULL, 0,
1149
14
                NULL, HFILL
1150
14
            }
1151
14
        },
1152
14
        { &hf_wow_locale,
1153
14
            { "Locale", "wow.locale",
1154
14
                FT_UINT32, BASE_HEX_DEC, VALS(e_locale_strings), 0,
1155
14
                NULL, HFILL
1156
14
            }
1157
14
        },
1158
14
        { &hf_wow_locked,
1159
14
            { "Locked", "wow.locked",
1160
14
                FT_UINT8, BASE_HEX_DEC, NULL, 0,
1161
14
                NULL, HFILL
1162
14
            }
1163
14
        },
1164
14
        { &hf_wow_login_result,
1165
14
            { "Login Result", "wow.login.result",
1166
14
                FT_UINT8, BASE_HEX_DEC, VALS(e_login_result_strings), 0,
1167
14
                NULL, HFILL
1168
14
            }
1169
14
        },
1170
14
        { &hf_wow_major,
1171
14
            { "Major", "wow.major",
1172
14
                FT_UINT8, BASE_HEX_DEC, NULL, 0,
1173
14
                NULL, HFILL
1174
14
            }
1175
14
        },
1176
14
        { &hf_wow_matrix_card_proof,
1177
14
            { "Matrix Card Proof", "wow.matrix.card.proof",
1178
14
                FT_BYTES, BASE_NONE, NULL, 0,
1179
14
                NULL, HFILL
1180
14
            }
1181
14
        },
1182
14
        { &hf_wow_minor,
1183
14
            { "Minor", "wow.minor",
1184
14
                FT_UINT8, BASE_HEX_DEC, NULL, 0,
1185
14
                NULL, HFILL
1186
14
            }
1187
14
        },
1188
14
        { &hf_wow_name,
1189
14
            { "Name", "wow.name",
1190
14
                FT_STRINGZ, BASE_NONE, NULL, 0,
1191
14
                NULL, HFILL
1192
14
            }
1193
14
        },
1194
14
        { &hf_wow_number_of_characters_on_realm,
1195
14
            { "Number Of Characters On Realm", "wow.number.of.characters.on.realm",
1196
14
                FT_UINT8, BASE_HEX_DEC, NULL, 0,
1197
14
                NULL, HFILL
1198
14
            }
1199
14
        },
1200
14
        { &hf_wow_number_of_realms,
1201
14
            { "Number Of Realms", "wow.number.of.realms",
1202
14
                FT_UINT16, BASE_HEX_DEC, NULL, 0,
1203
14
                NULL, HFILL
1204
14
            }
1205
14
        },
1206
14
        { &hf_wow_number_of_telemetry_keys,
1207
14
            { "Number Of Telemetry Keys", "wow.number.of.telemetry.keys",
1208
14
                FT_UINT8, BASE_HEX_DEC, NULL, 0,
1209
14
                NULL, HFILL
1210
14
            }
1211
14
        },
1212
14
        { &hf_wow_offset,
1213
14
            { "Offset", "wow.offset",
1214
14
                FT_UINT64, BASE_HEX_DEC, NULL, 0,
1215
14
                NULL, HFILL
1216
14
            }
1217
14
        },
1218
14
        { &hf_wow_os,
1219
14
            { "Os", "wow.os",
1220
14
                FT_UINT32, BASE_HEX_DEC, VALS(e_os_strings), 0,
1221
14
                NULL, HFILL
1222
14
            }
1223
14
        },
1224
14
        { &hf_wow_padding,
1225
14
            { "Padding", "wow.padding",
1226
14
                FT_UINT32, BASE_HEX_DEC, NULL, 0,
1227
14
                NULL, HFILL
1228
14
            }
1229
14
        },
1230
14
        { &hf_wow_patch,
1231
14
            { "Patch", "wow.patch",
1232
14
                FT_UINT8, BASE_HEX_DEC, NULL, 0,
1233
14
                NULL, HFILL
1234
14
            }
1235
14
        },
1236
14
        { &hf_wow_pin_grid_seed,
1237
14
            { "Pin Grid Seed", "wow.pin.grid.seed",
1238
14
                FT_UINT32, BASE_HEX_DEC, NULL, 0,
1239
14
                NULL, HFILL
1240
14
            }
1241
14
        },
1242
14
        { &hf_wow_pin_hash,
1243
14
            { "Pin Hash", "wow.pin.hash",
1244
14
                FT_BYTES, BASE_NONE, NULL, 0,
1245
14
                NULL, HFILL
1246
14
            }
1247
14
        },
1248
14
        { &hf_wow_pin_salt,
1249
14
            { "Pin Salt", "wow.pin.salt",
1250
14
                FT_BYTES, BASE_NONE, NULL, 0,
1251
14
                NULL, HFILL
1252
14
            }
1253
14
        },
1254
14
        { &hf_wow_platform,
1255
14
            { "Platform", "wow.platform",
1256
14
                FT_UINT32, BASE_HEX_DEC, VALS(e_platform_strings), 0,
1257
14
                NULL, HFILL
1258
14
            }
1259
14
        },
1260
14
        { &hf_wow_population,
1261
14
            { "Population", "wow.population",
1262
14
                FT_FLOAT, BASE_NONE, NULL, 0,
1263
14
                NULL, HFILL
1264
14
            }
1265
14
        },
1266
14
        { &hf_wow_proof_data,
1267
14
            { "Proof Data", "wow.proof.data",
1268
14
                FT_BYTES, BASE_NONE, NULL, 0,
1269
14
                NULL, HFILL
1270
14
            }
1271
14
        },
1272
14
        { &hf_wow_protocol_version,
1273
14
            { "Protocol Version", "wow.protocol.version",
1274
14
                FT_UINT8, BASE_HEX_DEC, VALS(e_protocol_version_strings), 0,
1275
14
                NULL, HFILL
1276
14
            }
1277
14
        },
1278
14
        { &hf_wow_protocol_version_int,
1279
14
            { "Protocol Version Int", "wow.protocol.version.int",
1280
14
                FT_UINT8, BASE_HEX_DEC, NULL, 0,
1281
14
                NULL, HFILL
1282
14
            }
1283
14
        },
1284
14
        { &hf_wow_realm_category,
1285
14
            { "Realm Category", "wow.realm.category",
1286
14
                FT_UINT8, BASE_HEX_DEC, VALS(e_realm_category_strings), 0,
1287
14
                NULL, HFILL
1288
14
            }
1289
14
        },
1290
14
        { &hf_wow_realm_flag,
1291
14
            { "Realm Flag", "wow.realm.flag",
1292
14
                FT_UINT8, BASE_HEX_DEC, NULL, 0,
1293
14
                NULL, HFILL
1294
14
            }
1295
14
        },
1296
14
        { &hf_wow_realm_id,
1297
14
            { "Realm Id", "wow.realm.id",
1298
14
                FT_UINT8, BASE_HEX_DEC, NULL, 0,
1299
14
                NULL, HFILL
1300
14
            }
1301
14
        },
1302
14
        { &hf_wow_realm_type,
1303
14
            { "Realm Type", "wow.realm.type",
1304
14
                FT_UINT8, BASE_HEX_DEC, VALS(e_realm_type_strings), 0,
1305
14
                NULL, HFILL
1306
14
            }
1307
14
        },
1308
14
        { &hf_wow_required,
1309
14
            { "Required", "wow.required",
1310
14
                FT_UINT8, BASE_HEX_DEC, NULL, 0,
1311
14
                NULL, HFILL
1312
14
            }
1313
14
        },
1314
14
        { &hf_wow_salt,
1315
14
            { "Salt", "wow.salt",
1316
14
                FT_BYTES, BASE_NONE, NULL, 0,
1317
14
                NULL, HFILL
1318
14
            }
1319
14
        },
1320
14
        { &hf_wow_security_flag,
1321
14
            { "Security Flag", "wow.security.flag",
1322
14
                FT_UINT8, BASE_HEX_DEC, NULL, 0,
1323
14
                NULL, HFILL
1324
14
            }
1325
14
        },
1326
14
        { &hf_wow_seed,
1327
14
            { "Seed", "wow.seed",
1328
14
                FT_UINT64, BASE_HEX_DEC, NULL, 0,
1329
14
                NULL, HFILL
1330
14
            }
1331
14
        },
1332
14
        { &hf_wow_server_proof,
1333
14
            { "Server Proof", "wow.server.proof",
1334
14
                FT_BYTES, BASE_NONE, NULL, 0,
1335
14
                NULL, HFILL
1336
14
            }
1337
14
        },
1338
14
        { &hf_wow_server_public_key,
1339
14
            { "Server Public Key", "wow.server.public.key",
1340
14
                FT_BYTES, BASE_NONE, NULL, 0,
1341
14
                NULL, HFILL
1342
14
            }
1343
14
        },
1344
14
        { &hf_wow_size,
1345
14
            { "Size", "wow.size",
1346
14
                FT_UINT16, BASE_HEX_DEC, NULL, 0,
1347
14
                NULL, HFILL
1348
14
            }
1349
14
        },
1350
14
        { &hf_wow_survey_id,
1351
14
            { "Survey Id", "wow.survey.id",
1352
14
                FT_UINT32, BASE_HEX_DEC, NULL, 0,
1353
14
                NULL, HFILL
1354
14
            }
1355
14
        },
1356
14
        { &hf_wow_unknown_bytes,
1357
14
            { "Unknown Bytes", "wow.unknown.bytes",
1358
14
                FT_BYTES, BASE_NONE, NULL, 0,
1359
14
                NULL, HFILL
1360
14
            }
1361
14
        },
1362
14
        { &hf_wow_unknown_int,
1363
14
            { "Unknown Int", "wow.unknown.int",
1364
14
                FT_UINT32, BASE_HEX_DEC, NULL, 0,
1365
14
                NULL, HFILL
1366
14
            }
1367
14
        },
1368
14
        { &hf_wow_utc_timezone_offset,
1369
14
            { "Utc Timezone Offset", "wow.utc.timezone.offset",
1370
14
                FT_UINT32, BASE_HEX_DEC, NULL, 0,
1371
14
                NULL, HFILL
1372
14
            }
1373
14
        },
1374
14
        { &hf_wow_width,
1375
14
            { "Width", "wow.width",
1376
14
                FT_UINT8, BASE_HEX_DEC, NULL, 0,
1377
14
                NULL, HFILL
1378
14
            }
1379
14
        },
1380
/* AUTOGENERATED_END_REGISTER */
1381
14
  };
1382
1383
14
  static int *ett[] = {
1384
14
    &ett_wow,
1385
14
        &ett_message,
1386
14
  };
1387
1388
14
  proto_wow = proto_register_protocol("World of Warcraft",
1389
14
              "WOW", "wow");
1390
1391
14
  proto_register_field_array(proto_wow, hf, array_length(hf));
1392
14
  proto_register_subtree_array(ett, array_length(ett));
1393
1394
14
  wow_handle = register_dissector("wow", dissect_wow, proto_wow);
1395
1396
14
  wow_module = prefs_register_protocol(proto_wow, NULL);
1397
1398
14
  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
14
}
1401
1402
void
1403
proto_reg_handoff_wow(void)
1404
14
{
1405
14
  dissector_add_uint_with_preference("tcp.port", WOW_PORT, wow_handle);
1406
14
}
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
 */