2 * Routines for World of Warcraft (WoW) protocol dissection
3 * Copyright 2008-2009, Stephen Fisher (see AUTHORS file)
5 * Wireshark - Network traffic analyzer
6 * By Gerald Combs <gerald@wireshark.org>
7 * Copyright 1998 Gerald Combs
9 * SPDX-License-Identifier: GPL-2.0-or-later
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." */
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>
25 void proto_register_wow(void);
26 void proto_reg_handoff_wow(void);
28 static dissector_handle_t wow_handle
;
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,
39 CMD_XFER_ACCEPT
= 0x32,
40 CMD_XFER_RESUME
= 0x33,
41 CMD_XFER_CANCEL
= 0x34
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" },
58 /* AUTOGENERATED_START_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,
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" },
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,
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" },
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,
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" },
108 PLATFORM_X86
= 0x783836,
109 PLATFORM_POWER_PC
= 0x505043,
111 static const value_string e_platform_strings
[] = {
112 { PLATFORM_X86
, "X86" },
113 { PLATFORM_POWER_PC
, "Power Pc" },
118 OS_WINDOWS
= 0x57696E,
119 OS_MAC_OS_X
= 0x4F5358,
121 static const value_string e_os_strings
[] = {
122 { OS_WINDOWS
, "Windows" },
123 { OS_MAC_OS_X
, "Mac Os X" },
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,
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" },
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,
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" },
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,
213 SECURITY_FLAG_NONE
= 0x0,
214 SECURITY_FLAG_PIN
= 0x1,
215 SECURITY_FLAG_MATRIX_CARD
= 0x2,
216 SECURITY_FLAG_AUTHENTICATOR
= 0x4,
220 ACCOUNT_FLAG_GM
= 0x000001,
221 ACCOUNT_FLAG_TRIAL
= 0x000008,
222 ACCOUNT_FLAG_PROPASS
= 0x800000,
225 /* AUTOGENERATED_END_ENUM */
227 #define WOW_PORT 3724
229 #define WOW_CLIENT_TO_SERVER pinfo->destport == WOW_PORT
230 #define WOW_SERVER_TO_CLIENT pinfo->srcport == WOW_PORT
232 /* Initialize the protocol and registered fields */
233 static int proto_wow
;
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 */
313 static bool wow_preference_desegment
= true;
316 static int ett_message
;
318 struct game_version
{
319 int8_t major_version
;
320 int8_t minor_version
;
321 int8_t patch_version
;
326 get_null_terminated_string_length( tvbuff_t
* tvb
, int32_t offset
)
328 const int32_t maximum_length
= 0xFF;
329 for (int32_t length
= 0; length
< maximum_length
; length
++) {
330 uint8_t character
= tvb_get_uint8(tvb
, offset
+ length
);
331 if (character
== 0) {
332 // Include the null character in the length
341 add_cstring(ptvcursor_t
* ptv
, const int* hf
) {
342 int32_t len
= get_null_terminated_string_length(ptvcursor_tvbuff(ptv
), ptvcursor_current_offset(ptv
));
343 ptvcursor_add(ptv
, *hf
, len
, ENC_UTF_8
);
347 add_string(ptvcursor_t
* ptv
, const int* hf
) {
349 ptvcursor_add_ret_uint(ptv
, hf_wow_string_length
, 1, ENC_NA
, &len
);
350 ptvcursor_add(ptv
, *hf
, len
, ENC_UTF_8
);
354 get_wow_pdu_len(packet_info
*pinfo
, tvbuff_t
*tvb
, int offset
, void *data _U_
)
356 int8_t size_field_offset
= -1;
360 cmd
= tvb_get_uint8(tvb
, offset
);
362 if(WOW_SERVER_TO_CLIENT
&& cmd
== CMD_REALM_LIST
)
363 size_field_offset
= 1;
364 if(WOW_CLIENT_TO_SERVER
&& cmd
== CMD_AUTH_LOGON_CHALLENGE
)
365 size_field_offset
= 2;
367 pkt_len
= tvb_get_letohs(tvb
, size_field_offset
);
369 return pkt_len
+ size_field_offset
+ 2;
373 add_body_fields(packet_info
*pinfo
, uint8_t header_opcode
, ptvcursor_t
*ptv
, uint32_t *protocol_version
) {
374 /* AUTOGENERATED_START_VARIABLES */
375 uint32_t compressed_data_length
= 0;
377 uint32_t generator_length
= 0;
378 uint32_t large_safe_prime_length
= 0;
379 uint32_t number_of_realms
= 0;
380 uint32_t number_of_telemetry_keys
= 0;
382 uint32_t security_flag
= 0;
384 /* AUTOGENERATED_END_VARIABLES */
386 /* AUTOGENERATED_START_PARSER */
387 switch (header_opcode
) {
388 case CMD_AUTH_LOGON_CHALLENGE
:
389 switch (*protocol_version
) {
391 if (WOW_SERVER_TO_CLIENT
) {
392 ptvcursor_add(ptv
, hf_wow_protocol_version_int
, 1, ENC_LITTLE_ENDIAN
);
393 ptvcursor_add_ret_uint(ptv
, hf_wow_login_result
, 1, ENC_LITTLE_ENDIAN
, &result
);
394 if (result
== LOGIN_RESULT_SUCCESS
) {
395 ptvcursor_add(ptv
, hf_wow_server_public_key
, 32, ENC_NA
);
396 ptvcursor_add_ret_uint(ptv
, hf_wow_generator_length
, 1, ENC_LITTLE_ENDIAN
, &generator_length
);
397 ptvcursor_add(ptv
, hf_wow_generator
, generator_length
, ENC_NA
);
398 ptvcursor_add_ret_uint(ptv
, hf_wow_large_safe_prime_length
, 1, ENC_LITTLE_ENDIAN
, &large_safe_prime_length
);
399 ptvcursor_add(ptv
, hf_wow_large_safe_prime
, large_safe_prime_length
, ENC_NA
);
400 ptvcursor_add(ptv
, hf_wow_salt
, 32, ENC_NA
);
401 ptvcursor_add(ptv
, hf_wow_crc_salt
, 16, ENC_NA
);
405 ptvcursor_add(ptv
, hf_wow_protocol_version
, 1, ENC_LITTLE_ENDIAN
);
406 ptvcursor_add(ptv
, hf_wow_size
, 2, ENC_LITTLE_ENDIAN
);
407 ptvcursor_add(ptv
, hf_wow_game_name
, 4, ENC_LITTLE_ENDIAN
);
408 ptvcursor_add_text_with_subtree(ptv
, SUBTREE_UNDEFINED_LENGTH
, ett_message
, "Version");
409 ptvcursor_add(ptv
, hf_wow_major
, 1, ENC_LITTLE_ENDIAN
);
410 ptvcursor_add(ptv
, hf_wow_minor
, 1, ENC_LITTLE_ENDIAN
);
411 ptvcursor_add(ptv
, hf_wow_patch
, 1, ENC_LITTLE_ENDIAN
);
412 ptvcursor_add(ptv
, hf_wow_build
, 2, ENC_LITTLE_ENDIAN
);
413 ptvcursor_pop_subtree(ptv
);
414 ptvcursor_add(ptv
, hf_wow_platform
, 4, ENC_LITTLE_ENDIAN
);
415 ptvcursor_add(ptv
, hf_wow_os
, 4, ENC_LITTLE_ENDIAN
);
416 ptvcursor_add(ptv
, hf_wow_locale
, 4, ENC_LITTLE_ENDIAN
);
417 ptvcursor_add(ptv
, hf_wow_utc_timezone_offset
, 4, ENC_LITTLE_ENDIAN
);
418 ptvcursor_add(ptv
, hf_wow_client_ip_address
, 4, ENC_LITTLE_ENDIAN
);
419 add_string(ptv
, &hf_wow_account_name
);
423 if (WOW_SERVER_TO_CLIENT
) {
424 ptvcursor_add(ptv
, hf_wow_protocol_version_int
, 1, ENC_LITTLE_ENDIAN
);
425 ptvcursor_add_ret_uint(ptv
, hf_wow_login_result
, 1, ENC_LITTLE_ENDIAN
, &result
);
426 if (result
== LOGIN_RESULT_SUCCESS
) {
427 ptvcursor_add(ptv
, hf_wow_server_public_key
, 32, ENC_NA
);
428 ptvcursor_add_ret_uint(ptv
, hf_wow_generator_length
, 1, ENC_LITTLE_ENDIAN
, &generator_length
);
429 ptvcursor_add(ptv
, hf_wow_generator
, generator_length
, ENC_NA
);
430 ptvcursor_add_ret_uint(ptv
, hf_wow_large_safe_prime_length
, 1, ENC_LITTLE_ENDIAN
, &large_safe_prime_length
);
431 ptvcursor_add(ptv
, hf_wow_large_safe_prime
, large_safe_prime_length
, ENC_NA
);
432 ptvcursor_add(ptv
, hf_wow_salt
, 32, ENC_NA
);
433 ptvcursor_add(ptv
, hf_wow_crc_salt
, 16, ENC_NA
);
434 ptvcursor_add_ret_uint(ptv
, hf_wow_security_flag
, 1, ENC_LITTLE_ENDIAN
, &security_flag
);
435 if (security_flag
== SECURITY_FLAG_PIN
) {
436 ptvcursor_add(ptv
, hf_wow_pin_grid_seed
, 4, ENC_LITTLE_ENDIAN
);
437 ptvcursor_add(ptv
, hf_wow_pin_salt
, 16, ENC_NA
);
442 ptvcursor_add(ptv
, hf_wow_protocol_version
, 1, ENC_LITTLE_ENDIAN
);
443 ptvcursor_add(ptv
, hf_wow_size
, 2, ENC_LITTLE_ENDIAN
);
444 ptvcursor_add(ptv
, hf_wow_game_name
, 4, ENC_LITTLE_ENDIAN
);
445 ptvcursor_add_text_with_subtree(ptv
, SUBTREE_UNDEFINED_LENGTH
, ett_message
, "Version");
446 ptvcursor_add(ptv
, hf_wow_major
, 1, ENC_LITTLE_ENDIAN
);
447 ptvcursor_add(ptv
, hf_wow_minor
, 1, ENC_LITTLE_ENDIAN
);
448 ptvcursor_add(ptv
, hf_wow_patch
, 1, ENC_LITTLE_ENDIAN
);
449 ptvcursor_add(ptv
, hf_wow_build
, 2, ENC_LITTLE_ENDIAN
);
450 ptvcursor_pop_subtree(ptv
);
451 ptvcursor_add(ptv
, hf_wow_platform
, 4, ENC_LITTLE_ENDIAN
);
452 ptvcursor_add(ptv
, hf_wow_os
, 4, ENC_LITTLE_ENDIAN
);
453 ptvcursor_add(ptv
, hf_wow_locale
, 4, ENC_LITTLE_ENDIAN
);
454 ptvcursor_add(ptv
, hf_wow_utc_timezone_offset
, 4, ENC_LITTLE_ENDIAN
);
455 ptvcursor_add(ptv
, hf_wow_client_ip_address
, 4, ENC_LITTLE_ENDIAN
);
456 add_string(ptv
, &hf_wow_account_name
);
462 if (WOW_SERVER_TO_CLIENT
) {
463 ptvcursor_add(ptv
, hf_wow_protocol_version_int
, 1, ENC_LITTLE_ENDIAN
);
464 ptvcursor_add_ret_uint(ptv
, hf_wow_login_result
, 1, ENC_LITTLE_ENDIAN
, &result
);
465 if (result
== LOGIN_RESULT_SUCCESS
) {
466 ptvcursor_add(ptv
, hf_wow_server_public_key
, 32, ENC_NA
);
467 ptvcursor_add_ret_uint(ptv
, hf_wow_generator_length
, 1, ENC_LITTLE_ENDIAN
, &generator_length
);
468 ptvcursor_add(ptv
, hf_wow_generator
, generator_length
, ENC_NA
);
469 ptvcursor_add_ret_uint(ptv
, hf_wow_large_safe_prime_length
, 1, ENC_LITTLE_ENDIAN
, &large_safe_prime_length
);
470 ptvcursor_add(ptv
, hf_wow_large_safe_prime
, large_safe_prime_length
, ENC_NA
);
471 ptvcursor_add(ptv
, hf_wow_salt
, 32, ENC_NA
);
472 ptvcursor_add(ptv
, hf_wow_crc_salt
, 16, ENC_NA
);
473 ptvcursor_add_ret_uint(ptv
, hf_wow_security_flag
, 1, ENC_LITTLE_ENDIAN
, &security_flag
);
474 if (security_flag
& SECURITY_FLAG_PIN
) {
475 ptvcursor_add(ptv
, hf_wow_pin_grid_seed
, 4, ENC_LITTLE_ENDIAN
);
476 ptvcursor_add(ptv
, hf_wow_pin_salt
, 16, ENC_NA
);
478 if (security_flag
& SECURITY_FLAG_MATRIX_CARD
) {
479 ptvcursor_add(ptv
, hf_wow_width
, 1, ENC_LITTLE_ENDIAN
);
480 ptvcursor_add(ptv
, hf_wow_height
, 1, ENC_LITTLE_ENDIAN
);
481 ptvcursor_add(ptv
, hf_wow_digit_count
, 1, ENC_LITTLE_ENDIAN
);
482 ptvcursor_add(ptv
, hf_wow_challenge_count
, 1, ENC_LITTLE_ENDIAN
);
483 ptvcursor_add(ptv
, hf_wow_seed
, 8, ENC_LITTLE_ENDIAN
);
488 ptvcursor_add(ptv
, hf_wow_protocol_version
, 1, ENC_LITTLE_ENDIAN
);
489 ptvcursor_add(ptv
, hf_wow_size
, 2, ENC_LITTLE_ENDIAN
);
490 ptvcursor_add(ptv
, hf_wow_game_name
, 4, ENC_LITTLE_ENDIAN
);
491 ptvcursor_add_text_with_subtree(ptv
, SUBTREE_UNDEFINED_LENGTH
, ett_message
, "Version");
492 ptvcursor_add(ptv
, hf_wow_major
, 1, ENC_LITTLE_ENDIAN
);
493 ptvcursor_add(ptv
, hf_wow_minor
, 1, ENC_LITTLE_ENDIAN
);
494 ptvcursor_add(ptv
, hf_wow_patch
, 1, ENC_LITTLE_ENDIAN
);
495 ptvcursor_add(ptv
, hf_wow_build
, 2, ENC_LITTLE_ENDIAN
);
496 ptvcursor_pop_subtree(ptv
);
497 ptvcursor_add(ptv
, hf_wow_platform
, 4, ENC_LITTLE_ENDIAN
);
498 ptvcursor_add(ptv
, hf_wow_os
, 4, ENC_LITTLE_ENDIAN
);
499 ptvcursor_add(ptv
, hf_wow_locale
, 4, ENC_LITTLE_ENDIAN
);
500 ptvcursor_add(ptv
, hf_wow_utc_timezone_offset
, 4, ENC_LITTLE_ENDIAN
);
501 ptvcursor_add(ptv
, hf_wow_client_ip_address
, 4, ENC_LITTLE_ENDIAN
);
502 add_string(ptv
, &hf_wow_account_name
);
506 if (WOW_SERVER_TO_CLIENT
) {
507 ptvcursor_add(ptv
, hf_wow_protocol_version_int
, 1, ENC_LITTLE_ENDIAN
);
508 ptvcursor_add_ret_uint(ptv
, hf_wow_login_result
, 1, ENC_LITTLE_ENDIAN
, &result
);
509 if (result
== LOGIN_RESULT_SUCCESS
) {
510 ptvcursor_add(ptv
, hf_wow_server_public_key
, 32, ENC_NA
);
511 ptvcursor_add_ret_uint(ptv
, hf_wow_generator_length
, 1, ENC_LITTLE_ENDIAN
, &generator_length
);
512 ptvcursor_add(ptv
, hf_wow_generator
, generator_length
, ENC_NA
);
513 ptvcursor_add_ret_uint(ptv
, hf_wow_large_safe_prime_length
, 1, ENC_LITTLE_ENDIAN
, &large_safe_prime_length
);
514 ptvcursor_add(ptv
, hf_wow_large_safe_prime
, large_safe_prime_length
, ENC_NA
);
515 ptvcursor_add(ptv
, hf_wow_salt
, 32, ENC_NA
);
516 ptvcursor_add(ptv
, hf_wow_crc_salt
, 16, ENC_NA
);
517 ptvcursor_add_ret_uint(ptv
, hf_wow_security_flag
, 1, ENC_LITTLE_ENDIAN
, &security_flag
);
518 if (security_flag
& SECURITY_FLAG_PIN
) {
519 ptvcursor_add(ptv
, hf_wow_pin_grid_seed
, 4, ENC_LITTLE_ENDIAN
);
520 ptvcursor_add(ptv
, hf_wow_pin_salt
, 16, ENC_NA
);
522 if (security_flag
& SECURITY_FLAG_MATRIX_CARD
) {
523 ptvcursor_add(ptv
, hf_wow_width
, 1, ENC_LITTLE_ENDIAN
);
524 ptvcursor_add(ptv
, hf_wow_height
, 1, ENC_LITTLE_ENDIAN
);
525 ptvcursor_add(ptv
, hf_wow_digit_count
, 1, ENC_LITTLE_ENDIAN
);
526 ptvcursor_add(ptv
, hf_wow_challenge_count
, 1, ENC_LITTLE_ENDIAN
);
527 ptvcursor_add(ptv
, hf_wow_seed
, 8, ENC_LITTLE_ENDIAN
);
529 if (security_flag
& SECURITY_FLAG_AUTHENTICATOR
) {
530 ptvcursor_add(ptv
, hf_wow_required
, 1, ENC_LITTLE_ENDIAN
);
535 ptvcursor_add(ptv
, hf_wow_protocol_version
, 1, ENC_LITTLE_ENDIAN
);
536 ptvcursor_add(ptv
, hf_wow_size
, 2, ENC_LITTLE_ENDIAN
);
537 ptvcursor_add(ptv
, hf_wow_game_name
, 4, ENC_LITTLE_ENDIAN
);
538 ptvcursor_add_text_with_subtree(ptv
, SUBTREE_UNDEFINED_LENGTH
, ett_message
, "Version");
539 ptvcursor_add(ptv
, hf_wow_major
, 1, ENC_LITTLE_ENDIAN
);
540 ptvcursor_add(ptv
, hf_wow_minor
, 1, ENC_LITTLE_ENDIAN
);
541 ptvcursor_add(ptv
, hf_wow_patch
, 1, ENC_LITTLE_ENDIAN
);
542 ptvcursor_add(ptv
, hf_wow_build
, 2, ENC_LITTLE_ENDIAN
);
543 ptvcursor_pop_subtree(ptv
);
544 ptvcursor_add(ptv
, hf_wow_platform
, 4, ENC_LITTLE_ENDIAN
);
545 ptvcursor_add(ptv
, hf_wow_os
, 4, ENC_LITTLE_ENDIAN
);
546 ptvcursor_add(ptv
, hf_wow_locale
, 4, ENC_LITTLE_ENDIAN
);
547 ptvcursor_add(ptv
, hf_wow_utc_timezone_offset
, 4, ENC_LITTLE_ENDIAN
);
548 ptvcursor_add(ptv
, hf_wow_client_ip_address
, 4, ENC_LITTLE_ENDIAN
);
549 add_string(ptv
, &hf_wow_account_name
);
554 case CMD_AUTH_LOGON_PROOF
:
555 switch (*protocol_version
) {
558 if (WOW_SERVER_TO_CLIENT
) {
559 ptvcursor_add_ret_uint(ptv
, hf_wow_login_result
, 1, ENC_LITTLE_ENDIAN
, &result
);
560 if (result
== LOGIN_RESULT_SUCCESS
) {
561 ptvcursor_add(ptv
, hf_wow_server_proof
, 20, ENC_NA
);
562 ptvcursor_add(ptv
, hf_wow_hardware_survey_id
, 4, ENC_LITTLE_ENDIAN
);
566 ptvcursor_add(ptv
, hf_wow_client_public_key
, 32, ENC_NA
);
567 ptvcursor_add(ptv
, hf_wow_client_proof
, 20, ENC_NA
);
568 ptvcursor_add(ptv
, hf_wow_crc_hash
, 20, ENC_NA
);
569 ptvcursor_add_ret_uint(ptv
, hf_wow_number_of_telemetry_keys
, 1, ENC_LITTLE_ENDIAN
, &number_of_telemetry_keys
);
570 for (uint32_t i1
= 0; i1
< number_of_telemetry_keys
; ++i1
) {
571 ptvcursor_add_text_with_subtree(ptv
, SUBTREE_UNDEFINED_LENGTH
, ett_message
, "TelemetryKey %i", i1
);
572 ptvcursor_add(ptv
, hf_wow_unknown_int
, 2, ENC_LITTLE_ENDIAN
);
573 ptvcursor_add(ptv
, hf_wow_unknown_int
, 4, ENC_LITTLE_ENDIAN
);
574 ptvcursor_add(ptv
, hf_wow_unknown_bytes
, 4, ENC_NA
);
575 ptvcursor_add(ptv
, hf_wow_cd_key_proof
, 20, ENC_NA
);
576 ptvcursor_pop_subtree(ptv
);
583 if (WOW_SERVER_TO_CLIENT
) {
584 ptvcursor_add_ret_uint(ptv
, hf_wow_login_result
, 1, ENC_LITTLE_ENDIAN
, &result
);
585 if (result
== LOGIN_RESULT_SUCCESS
) {
586 ptvcursor_add(ptv
, hf_wow_server_proof
, 20, ENC_NA
);
587 ptvcursor_add(ptv
, hf_wow_hardware_survey_id
, 4, ENC_LITTLE_ENDIAN
);
588 ptvcursor_add(ptv
, hf_wow_unknown_int
, 2, ENC_LITTLE_ENDIAN
);
592 ptvcursor_add(ptv
, hf_wow_client_public_key
, 32, ENC_NA
);
593 ptvcursor_add(ptv
, hf_wow_client_proof
, 20, ENC_NA
);
594 ptvcursor_add(ptv
, hf_wow_crc_hash
, 20, ENC_NA
);
595 ptvcursor_add_ret_uint(ptv
, hf_wow_number_of_telemetry_keys
, 1, ENC_LITTLE_ENDIAN
, &number_of_telemetry_keys
);
596 for (uint32_t i1
= 0; i1
< number_of_telemetry_keys
; ++i1
) {
597 ptvcursor_add_text_with_subtree(ptv
, SUBTREE_UNDEFINED_LENGTH
, ett_message
, "TelemetryKey %i", i1
);
598 ptvcursor_add(ptv
, hf_wow_unknown_int
, 2, ENC_LITTLE_ENDIAN
);
599 ptvcursor_add(ptv
, hf_wow_unknown_int
, 4, ENC_LITTLE_ENDIAN
);
600 ptvcursor_add(ptv
, hf_wow_unknown_bytes
, 4, ENC_NA
);
601 ptvcursor_add(ptv
, hf_wow_cd_key_proof
, 20, ENC_NA
);
602 ptvcursor_pop_subtree(ptv
);
607 if (WOW_SERVER_TO_CLIENT
) {
608 ptvcursor_add_ret_uint(ptv
, hf_wow_login_result
, 1, ENC_LITTLE_ENDIAN
, &result
);
609 if (result
== LOGIN_RESULT_SUCCESS
) {
610 ptvcursor_add(ptv
, hf_wow_server_proof
, 20, ENC_NA
);
611 ptvcursor_add(ptv
, hf_wow_account_flag
, 4, ENC_LITTLE_ENDIAN
);
612 ptvcursor_add(ptv
, hf_wow_hardware_survey_id
, 4, ENC_LITTLE_ENDIAN
);
613 ptvcursor_add(ptv
, hf_wow_unknown_int
, 2, ENC_LITTLE_ENDIAN
);
616 ptvcursor_add(ptv
, hf_wow_padding
, 2, ENC_LITTLE_ENDIAN
);
620 ptvcursor_add(ptv
, hf_wow_client_public_key
, 32, ENC_NA
);
621 ptvcursor_add(ptv
, hf_wow_client_proof
, 20, ENC_NA
);
622 ptvcursor_add(ptv
, hf_wow_crc_hash
, 20, ENC_NA
);
623 ptvcursor_add_ret_uint(ptv
, hf_wow_number_of_telemetry_keys
, 1, ENC_LITTLE_ENDIAN
, &number_of_telemetry_keys
);
624 for (uint32_t i1
= 0; i1
< number_of_telemetry_keys
; ++i1
) {
625 ptvcursor_add_text_with_subtree(ptv
, SUBTREE_UNDEFINED_LENGTH
, ett_message
, "TelemetryKey %i", i1
);
626 ptvcursor_add(ptv
, hf_wow_unknown_int
, 2, ENC_LITTLE_ENDIAN
);
627 ptvcursor_add(ptv
, hf_wow_unknown_int
, 4, ENC_LITTLE_ENDIAN
);
628 ptvcursor_add(ptv
, hf_wow_unknown_bytes
, 4, ENC_NA
);
629 ptvcursor_add(ptv
, hf_wow_cd_key_proof
, 20, ENC_NA
);
630 ptvcursor_pop_subtree(ptv
);
636 case CMD_AUTH_RECONNECT_CHALLENGE
:
637 switch (*protocol_version
) {
642 if (WOW_SERVER_TO_CLIENT
) {
643 ptvcursor_add_ret_uint(ptv
, hf_wow_login_result
, 1, ENC_LITTLE_ENDIAN
, &result
);
644 if (result
== LOGIN_RESULT_SUCCESS
) {
645 ptvcursor_add(ptv
, hf_wow_challenge_data
, 16, ENC_NA
);
646 ptvcursor_add(ptv
, hf_wow_checksum_salt
, 16, ENC_NA
);
650 ptvcursor_add(ptv
, hf_wow_protocol_version
, 1, ENC_LITTLE_ENDIAN
);
651 ptvcursor_add(ptv
, hf_wow_size
, 2, ENC_LITTLE_ENDIAN
);
652 ptvcursor_add(ptv
, hf_wow_game_name
, 4, ENC_LITTLE_ENDIAN
);
653 ptvcursor_add_text_with_subtree(ptv
, SUBTREE_UNDEFINED_LENGTH
, ett_message
, "Version");
654 ptvcursor_add(ptv
, hf_wow_major
, 1, ENC_LITTLE_ENDIAN
);
655 ptvcursor_add(ptv
, hf_wow_minor
, 1, ENC_LITTLE_ENDIAN
);
656 ptvcursor_add(ptv
, hf_wow_patch
, 1, ENC_LITTLE_ENDIAN
);
657 ptvcursor_add(ptv
, hf_wow_build
, 2, ENC_LITTLE_ENDIAN
);
658 ptvcursor_pop_subtree(ptv
);
659 ptvcursor_add(ptv
, hf_wow_platform
, 4, ENC_LITTLE_ENDIAN
);
660 ptvcursor_add(ptv
, hf_wow_os
, 4, ENC_LITTLE_ENDIAN
);
661 ptvcursor_add(ptv
, hf_wow_locale
, 4, ENC_LITTLE_ENDIAN
);
662 ptvcursor_add(ptv
, hf_wow_utc_timezone_offset
, 4, ENC_LITTLE_ENDIAN
);
663 ptvcursor_add(ptv
, hf_wow_client_ip_address
, 4, ENC_LITTLE_ENDIAN
);
664 add_string(ptv
, &hf_wow_account_name
);
668 if (WOW_SERVER_TO_CLIENT
) {
669 ptvcursor_add_ret_uint(ptv
, hf_wow_login_result
, 1, ENC_LITTLE_ENDIAN
, &result
);
670 if (result
== LOGIN_RESULT_SUCCESS
) {
671 ptvcursor_add(ptv
, hf_wow_challenge_data
, 16, ENC_NA
);
672 ptvcursor_add(ptv
, hf_wow_checksum_salt
, 16, ENC_NA
);
676 ptvcursor_add(ptv
, hf_wow_protocol_version
, 1, ENC_LITTLE_ENDIAN
);
677 ptvcursor_add(ptv
, hf_wow_size
, 2, ENC_LITTLE_ENDIAN
);
678 ptvcursor_add(ptv
, hf_wow_game_name
, 4, ENC_LITTLE_ENDIAN
);
679 ptvcursor_add_text_with_subtree(ptv
, SUBTREE_UNDEFINED_LENGTH
, ett_message
, "Version");
680 ptvcursor_add(ptv
, hf_wow_major
, 1, ENC_LITTLE_ENDIAN
);
681 ptvcursor_add(ptv
, hf_wow_minor
, 1, ENC_LITTLE_ENDIAN
);
682 ptvcursor_add(ptv
, hf_wow_patch
, 1, ENC_LITTLE_ENDIAN
);
683 ptvcursor_add(ptv
, hf_wow_build
, 2, ENC_LITTLE_ENDIAN
);
684 ptvcursor_pop_subtree(ptv
);
685 ptvcursor_add(ptv
, hf_wow_platform
, 4, ENC_LITTLE_ENDIAN
);
686 ptvcursor_add(ptv
, hf_wow_os
, 4, ENC_LITTLE_ENDIAN
);
687 ptvcursor_add(ptv
, hf_wow_locale
, 4, ENC_LITTLE_ENDIAN
);
688 ptvcursor_add(ptv
, hf_wow_utc_timezone_offset
, 4, ENC_LITTLE_ENDIAN
);
689 ptvcursor_add(ptv
, hf_wow_client_ip_address
, 4, ENC_LITTLE_ENDIAN
);
690 add_string(ptv
, &hf_wow_account_name
);
695 case CMD_AUTH_RECONNECT_PROOF
:
696 switch (*protocol_version
) {
698 if (WOW_SERVER_TO_CLIENT
) {
699 ptvcursor_add(ptv
, hf_wow_login_result
, 1, ENC_LITTLE_ENDIAN
);
702 ptvcursor_add(ptv
, hf_wow_proof_data
, 16, ENC_NA
);
703 ptvcursor_add(ptv
, hf_wow_client_proof
, 20, ENC_NA
);
704 ptvcursor_add(ptv
, hf_wow_client_checksum
, 20, ENC_NA
);
705 ptvcursor_add(ptv
, hf_wow_key_count
, 1, ENC_LITTLE_ENDIAN
);
711 if (WOW_SERVER_TO_CLIENT
) {
712 ptvcursor_add(ptv
, hf_wow_login_result
, 1, ENC_LITTLE_ENDIAN
);
713 ptvcursor_add(ptv
, hf_wow_padding
, 2, ENC_LITTLE_ENDIAN
);
716 ptvcursor_add(ptv
, hf_wow_proof_data
, 16, ENC_NA
);
717 ptvcursor_add(ptv
, hf_wow_client_proof
, 20, ENC_NA
);
718 ptvcursor_add(ptv
, hf_wow_client_checksum
, 20, ENC_NA
);
719 ptvcursor_add(ptv
, hf_wow_key_count
, 1, ENC_LITTLE_ENDIAN
);
723 if (WOW_SERVER_TO_CLIENT
) {
724 ptvcursor_add(ptv
, hf_wow_login_result
, 1, ENC_LITTLE_ENDIAN
);
725 ptvcursor_add(ptv
, hf_wow_padding
, 2, ENC_LITTLE_ENDIAN
);
728 ptvcursor_add(ptv
, hf_wow_proof_data
, 16, ENC_NA
);
729 ptvcursor_add(ptv
, hf_wow_client_proof
, 20, ENC_NA
);
730 ptvcursor_add(ptv
, hf_wow_client_checksum
, 20, ENC_NA
);
731 ptvcursor_add(ptv
, hf_wow_key_count
, 1, ENC_LITTLE_ENDIAN
);
737 switch (*protocol_version
) {
740 if (WOW_SERVER_TO_CLIENT
) {
741 ptvcursor_add(ptv
, hf_wow_size
, 2, ENC_LITTLE_ENDIAN
);
742 ptvcursor_add(ptv
, hf_wow_header_padding
, 4, ENC_LITTLE_ENDIAN
);
743 ptvcursor_add_ret_uint(ptv
, hf_wow_number_of_realms
, 1, ENC_LITTLE_ENDIAN
, &number_of_realms
);
744 for (uint32_t i1
= 0; i1
< number_of_realms
; ++i1
) {
745 ptvcursor_add_text_with_subtree(ptv
, SUBTREE_UNDEFINED_LENGTH
, ett_message
, "Realm %i", i1
);
746 ptvcursor_add(ptv
, hf_wow_realm_type
, 4, ENC_LITTLE_ENDIAN
);
747 ptvcursor_add(ptv
, hf_wow_realm_flag
, 1, ENC_LITTLE_ENDIAN
);
748 add_cstring(ptv
, &hf_wow_name
);
749 add_cstring(ptv
, &hf_wow_address
);
750 ptvcursor_add(ptv
, hf_wow_population
, 4, ENC_LITTLE_ENDIAN
);
751 ptvcursor_add(ptv
, hf_wow_number_of_characters_on_realm
, 1, ENC_LITTLE_ENDIAN
);
752 ptvcursor_add(ptv
, hf_wow_realm_category
, 1, ENC_LITTLE_ENDIAN
);
753 ptvcursor_add(ptv
, hf_wow_realm_id
, 1, ENC_LITTLE_ENDIAN
);
754 ptvcursor_pop_subtree(ptv
);
756 ptvcursor_add(ptv
, hf_wow_footer_padding
, 2, ENC_LITTLE_ENDIAN
);
759 ptvcursor_add(ptv
, hf_wow_padding
, 4, ENC_LITTLE_ENDIAN
);
763 if (WOW_SERVER_TO_CLIENT
) {
764 ptvcursor_add(ptv
, hf_wow_size
, 2, ENC_LITTLE_ENDIAN
);
765 ptvcursor_add(ptv
, hf_wow_header_padding
, 4, ENC_LITTLE_ENDIAN
);
766 ptvcursor_add_ret_uint(ptv
, hf_wow_number_of_realms
, 1, ENC_LITTLE_ENDIAN
, &number_of_realms
);
767 for (uint32_t i1
= 0; i1
< number_of_realms
; ++i1
) {
768 ptvcursor_add_text_with_subtree(ptv
, SUBTREE_UNDEFINED_LENGTH
, ett_message
, "Realm %i", i1
);
769 ptvcursor_add(ptv
, hf_wow_realm_type
, 1, ENC_LITTLE_ENDIAN
);
770 ptvcursor_add(ptv
, hf_wow_locked
, 1, ENC_NA
);
771 ptvcursor_add(ptv
, hf_wow_realm_flag
, 1, ENC_LITTLE_ENDIAN
);
772 add_cstring(ptv
, &hf_wow_name
);
773 add_cstring(ptv
, &hf_wow_address
);
774 ptvcursor_add(ptv
, hf_wow_population
, 4, ENC_LITTLE_ENDIAN
);
775 ptvcursor_add(ptv
, hf_wow_number_of_characters_on_realm
, 1, ENC_LITTLE_ENDIAN
);
776 ptvcursor_add(ptv
, hf_wow_realm_category
, 1, ENC_LITTLE_ENDIAN
);
777 ptvcursor_add(ptv
, hf_wow_realm_id
, 1, ENC_LITTLE_ENDIAN
);
778 ptvcursor_pop_subtree(ptv
);
780 ptvcursor_add(ptv
, hf_wow_footer_padding
, 2, ENC_LITTLE_ENDIAN
);
783 ptvcursor_add(ptv
, hf_wow_padding
, 4, ENC_LITTLE_ENDIAN
);
788 if (WOW_SERVER_TO_CLIENT
) {
789 ptvcursor_add(ptv
, hf_wow_size
, 2, ENC_LITTLE_ENDIAN
);
790 ptvcursor_add(ptv
, hf_wow_header_padding
, 4, ENC_LITTLE_ENDIAN
);
791 ptvcursor_add_ret_uint(ptv
, hf_wow_number_of_realms
, 2, ENC_LITTLE_ENDIAN
, &number_of_realms
);
792 for (uint32_t i1
= 0; i1
< number_of_realms
; ++i1
) {
793 ptvcursor_add_text_with_subtree(ptv
, SUBTREE_UNDEFINED_LENGTH
, ett_message
, "Realm %i", i1
);
794 ptvcursor_add(ptv
, hf_wow_realm_type
, 1, ENC_LITTLE_ENDIAN
);
795 ptvcursor_add(ptv
, hf_wow_locked
, 1, ENC_NA
);
796 ptvcursor_add(ptv
, hf_wow_realm_flag
, 1, ENC_LITTLE_ENDIAN
);
797 add_cstring(ptv
, &hf_wow_name
);
798 add_cstring(ptv
, &hf_wow_address
);
799 ptvcursor_add(ptv
, hf_wow_population
, 4, ENC_LITTLE_ENDIAN
);
800 ptvcursor_add(ptv
, hf_wow_number_of_characters_on_realm
, 1, ENC_LITTLE_ENDIAN
);
801 ptvcursor_add(ptv
, hf_wow_realm_category
, 1, ENC_LITTLE_ENDIAN
);
802 ptvcursor_add(ptv
, hf_wow_realm_id
, 1, ENC_LITTLE_ENDIAN
);
803 ptvcursor_pop_subtree(ptv
);
805 ptvcursor_add(ptv
, hf_wow_footer_padding
, 2, ENC_LITTLE_ENDIAN
);
808 ptvcursor_add(ptv
, hf_wow_padding
, 4, ENC_LITTLE_ENDIAN
);
812 if (WOW_SERVER_TO_CLIENT
) {
813 ptvcursor_add(ptv
, hf_wow_size
, 2, ENC_LITTLE_ENDIAN
);
814 ptvcursor_add(ptv
, hf_wow_header_padding
, 4, ENC_LITTLE_ENDIAN
);
815 ptvcursor_add_ret_uint(ptv
, hf_wow_number_of_realms
, 2, ENC_LITTLE_ENDIAN
, &number_of_realms
);
816 for (uint32_t i1
= 0; i1
< number_of_realms
; ++i1
) {
817 ptvcursor_add_text_with_subtree(ptv
, SUBTREE_UNDEFINED_LENGTH
, ett_message
, "Realm %i", i1
);
818 ptvcursor_add(ptv
, hf_wow_realm_type
, 1, ENC_LITTLE_ENDIAN
);
819 ptvcursor_add(ptv
, hf_wow_locked
, 1, ENC_NA
);
820 ptvcursor_add_ret_uint(ptv
, hf_wow_realm_flag
, 1, ENC_LITTLE_ENDIAN
, &flag
);
821 add_cstring(ptv
, &hf_wow_name
);
822 add_cstring(ptv
, &hf_wow_address
);
823 ptvcursor_add(ptv
, hf_wow_population
, 4, ENC_LITTLE_ENDIAN
);
824 ptvcursor_add(ptv
, hf_wow_number_of_characters_on_realm
, 1, ENC_LITTLE_ENDIAN
);
825 ptvcursor_add(ptv
, hf_wow_realm_category
, 1, ENC_LITTLE_ENDIAN
);
826 ptvcursor_add(ptv
, hf_wow_realm_id
, 1, ENC_LITTLE_ENDIAN
);
827 if (flag
& REALM_FLAG_SPECIFY_BUILD
) {
828 ptvcursor_add_text_with_subtree(ptv
, SUBTREE_UNDEFINED_LENGTH
, ett_message
, "Version");
829 ptvcursor_add(ptv
, hf_wow_major
, 1, ENC_LITTLE_ENDIAN
);
830 ptvcursor_add(ptv
, hf_wow_minor
, 1, ENC_LITTLE_ENDIAN
);
831 ptvcursor_add(ptv
, hf_wow_patch
, 1, ENC_LITTLE_ENDIAN
);
832 ptvcursor_add(ptv
, hf_wow_build
, 2, ENC_LITTLE_ENDIAN
);
833 ptvcursor_pop_subtree(ptv
);
835 ptvcursor_pop_subtree(ptv
);
837 ptvcursor_add(ptv
, hf_wow_footer_padding
, 2, ENC_LITTLE_ENDIAN
);
840 ptvcursor_add(ptv
, hf_wow_padding
, 4, ENC_LITTLE_ENDIAN
);
845 case CMD_SURVEY_RESULT
:
846 ptvcursor_add(ptv
, hf_wow_survey_id
, 4, ENC_LITTLE_ENDIAN
);
847 ptvcursor_add(ptv
, hf_wow_error
, 1, ENC_LITTLE_ENDIAN
);
848 ptvcursor_add_ret_uint(ptv
, hf_wow_compressed_data_length
, 2, ENC_LITTLE_ENDIAN
, &compressed_data_length
);
849 ptvcursor_add(ptv
, hf_wow_data
, compressed_data_length
, ENC_NA
);
852 ptvcursor_add_ret_uint(ptv
, hf_wow_size
, 2, ENC_LITTLE_ENDIAN
, &size
);
853 ptvcursor_add(ptv
, hf_wow_data
, size
, ENC_NA
);
855 case CMD_XFER_INITIATE
:
856 add_string(ptv
, &hf_wow_filename
);
857 ptvcursor_add(ptv
, hf_wow_file_size
, 8, ENC_LITTLE_ENDIAN
);
858 ptvcursor_add(ptv
, hf_wow_file_md
, 16, ENC_NA
);
860 case CMD_XFER_RESUME
:
861 ptvcursor_add(ptv
, hf_wow_offset
, 8, ENC_LITTLE_ENDIAN
);
867 /* AUTOGENERATED_END_PARSER */
871 dissect_wow_pdu(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
)
873 col_set_str(pinfo
->cinfo
, COL_PROTOCOL
, "WOW");
874 col_clear(pinfo
->cinfo
, COL_INFO
);
877 uint8_t header_opcode
= tvb_get_uint8(tvb
, offset
);
879 col_set_str(pinfo
->cinfo
, COL_INFO
,
880 val_to_str_const(header_opcode
, cmd_vs
,
881 "Unrecognized packet type"));
884 return tvb_captured_length(tvb
);
887 proto_item
* ti
= proto_tree_add_item(tree
, proto_wow
, tvb
, 0, -1, ENC_NA
);
888 proto_tree
* wow_tree
= proto_item_add_subtree(ti
, ett_wow
);
890 ptvcursor_t
* ptv
= ptvcursor_new(wmem_packet_scope(), wow_tree
, tvb
, offset
);
892 ptvcursor_add(ptv
, hf_wow_command
, 1, ENC_LITTLE_ENDIAN
);
894 conversation_t
* conv
= find_or_create_conversation(pinfo
);
895 uint32_t* protocol_version
= (uint32_t*)conversation_get_proto_data(conv
, proto_wow
);
896 if (protocol_version
== NULL
) {
897 protocol_version
= (uint32_t*)wmem_new0(wmem_file_scope(), uint32_t);
898 conversation_add_proto_data(conv
, proto_wow
, protocol_version
);
899 // 2 is the lowest valid version.
900 *protocol_version
= 2;
903 add_body_fields(pinfo
, header_opcode
, ptv
, protocol_version
);
905 return tvb_captured_length(tvb
);
910 dissect_wow(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void *data
)
912 int8_t size_field_offset
= -1;
915 cmd
= tvb_get_uint8(tvb
, 0);
917 if(WOW_SERVER_TO_CLIENT
&& cmd
== CMD_REALM_LIST
)
918 size_field_offset
= 1;
919 if(WOW_CLIENT_TO_SERVER
&& cmd
== CMD_AUTH_LOGON_CHALLENGE
)
920 size_field_offset
= 2;
922 if(size_field_offset
> -1) {
923 tcp_dissect_pdus(tvb
, pinfo
, tree
, wow_preference_desegment
,
924 size_field_offset
+2, get_wow_pdu_len
,
925 dissect_wow_pdu
, data
);
928 /* Doesn't have a size field, so it cannot span multiple
929 segments. Therefore, dissect this packet normally. */
930 return dissect_wow_pdu(tvb
, pinfo
, tree
, data
);
938 proto_register_wow(void)
940 module_t
*wow_module
; /* For our preferences */
942 static hf_register_info hf
[] = {
944 { "Command", "wow.cmd",
945 FT_UINT8
, BASE_HEX
, VALS(cmd_vs
), 0,
946 "Type of packet", HFILL
}
948 { &hf_wow_string_length
,
949 { "String Length", "wow.string.length",
950 FT_UINT8
, BASE_HEX_DEC
, NULL
, 0,
951 "Length of following string", HFILL
}
953 /* AUTOGENERATED_START_REGISTER */
954 { &hf_wow_account_flag
,
955 { "Account Flag", "wow.account.flag",
956 FT_UINT32
, BASE_HEX_DEC
, NULL
, 0,
960 { &hf_wow_account_name
,
961 { "Account Name", "wow.account.name",
962 FT_STRINGZ
, BASE_NONE
, NULL
, 0,
967 { "Address", "wow.address",
968 FT_STRINGZ
, BASE_NONE
, NULL
, 0,
972 { &hf_wow_authenticator
,
973 { "Authenticator", "wow.authenticator",
974 FT_STRINGZ
, BASE_NONE
, NULL
, 0,
979 { "Build", "wow.build",
980 FT_UINT16
, BASE_HEX_DEC
, NULL
, 0,
984 { &hf_wow_cd_key_proof
,
985 { "Cd Key Proof", "wow.cd.key.proof",
986 FT_BYTES
, BASE_NONE
, NULL
, 0,
990 { &hf_wow_challenge_count
,
991 { "Challenge Count", "wow.challenge.count",
992 FT_UINT8
, BASE_HEX_DEC
, NULL
, 0,
996 { &hf_wow_challenge_data
,
997 { "Challenge Data", "wow.challenge.data",
998 FT_BYTES
, BASE_NONE
, NULL
, 0,
1002 { &hf_wow_checksum_salt
,
1003 { "Checksum Salt", "wow.checksum.salt",
1004 FT_BYTES
, BASE_NONE
, NULL
, 0,
1008 { &hf_wow_client_checksum
,
1009 { "Client Checksum", "wow.client.checksum",
1010 FT_BYTES
, BASE_NONE
, NULL
, 0,
1014 { &hf_wow_client_ip_address
,
1015 { "Client Ip Address", "wow.client.ip.address",
1016 FT_UINT32
, BASE_HEX_DEC
, NULL
, 0,
1020 { &hf_wow_client_proof
,
1021 { "Client Proof", "wow.client.proof",
1022 FT_BYTES
, BASE_NONE
, NULL
, 0,
1026 { &hf_wow_client_public_key
,
1027 { "Client Public Key", "wow.client.public.key",
1028 FT_BYTES
, BASE_NONE
, NULL
, 0,
1032 { &hf_wow_compressed_data_length
,
1033 { "Compressed Data Length", "wow.compressed.data.length",
1034 FT_UINT16
, BASE_HEX_DEC
, NULL
, 0,
1039 { "Crc Hash", "wow.crc.hash",
1040 FT_BYTES
, BASE_NONE
, NULL
, 0,
1045 { "Crc Salt", "wow.crc.salt",
1046 FT_BYTES
, BASE_NONE
, NULL
, 0,
1051 { "Data", "wow.data",
1052 FT_BYTES
, BASE_NONE
, NULL
, 0,
1056 { &hf_wow_decompressed_size
,
1057 { "Decompressed Size", "wow.decompressed.size",
1058 FT_UINT32
, BASE_HEX_DEC
, NULL
, 0,
1062 { &hf_wow_digit_count
,
1063 { "Digit Count", "wow.digit.count",
1064 FT_UINT8
, BASE_HEX_DEC
, NULL
, 0,
1069 { "Error", "wow.error",
1070 FT_UINT8
, BASE_HEX_DEC
, NULL
, 0,
1075 { "File Md", "wow.file.md",
1076 FT_BYTES
, BASE_NONE
, NULL
, 0,
1080 { &hf_wow_file_size
,
1081 { "File Size", "wow.file.size",
1082 FT_UINT64
, BASE_HEX_DEC
, NULL
, 0,
1087 { "Filename", "wow.filename",
1088 FT_STRINGZ
, BASE_NONE
, NULL
, 0,
1092 { &hf_wow_footer_padding
,
1093 { "Footer Padding", "wow.footer.padding",
1094 FT_UINT16
, BASE_HEX_DEC
, NULL
, 0,
1098 { &hf_wow_game_name
,
1099 { "Game Name", "wow.game.name",
1100 FT_UINT32
, BASE_HEX_DEC
, NULL
, 0,
1104 { &hf_wow_generator
,
1105 { "Generator", "wow.generator",
1106 FT_BYTES
, BASE_NONE
, NULL
, 0,
1110 { &hf_wow_generator_length
,
1111 { "Generator Length", "wow.generator.length",
1112 FT_UINT8
, BASE_HEX_DEC
, NULL
, 0,
1116 { &hf_wow_hardware_survey_id
,
1117 { "Hardware Survey Id", "wow.hardware.survey.id",
1118 FT_UINT32
, BASE_HEX_DEC
, NULL
, 0,
1122 { &hf_wow_header_padding
,
1123 { "Header Padding", "wow.header.padding",
1124 FT_UINT32
, BASE_HEX_DEC
, NULL
, 0,
1129 { "Height", "wow.height",
1130 FT_UINT8
, BASE_HEX_DEC
, NULL
, 0,
1134 { &hf_wow_key_count
,
1135 { "Key Count", "wow.key.count",
1136 FT_UINT8
, BASE_HEX_DEC
, NULL
, 0,
1140 { &hf_wow_large_safe_prime
,
1141 { "Large Safe Prime", "wow.large.safe.prime",
1142 FT_BYTES
, BASE_NONE
, NULL
, 0,
1146 { &hf_wow_large_safe_prime_length
,
1147 { "Large Safe Prime Length", "wow.large.safe.prime.length",
1148 FT_UINT8
, BASE_HEX_DEC
, NULL
, 0,
1153 { "Locale", "wow.locale",
1154 FT_UINT32
, BASE_HEX_DEC
, VALS(e_locale_strings
), 0,
1159 { "Locked", "wow.locked",
1160 FT_UINT8
, BASE_HEX_DEC
, NULL
, 0,
1164 { &hf_wow_login_result
,
1165 { "Login Result", "wow.login.result",
1166 FT_UINT8
, BASE_HEX_DEC
, VALS(e_login_result_strings
), 0,
1171 { "Major", "wow.major",
1172 FT_UINT8
, BASE_HEX_DEC
, NULL
, 0,
1176 { &hf_wow_matrix_card_proof
,
1177 { "Matrix Card Proof", "wow.matrix.card.proof",
1178 FT_BYTES
, BASE_NONE
, NULL
, 0,
1183 { "Minor", "wow.minor",
1184 FT_UINT8
, BASE_HEX_DEC
, NULL
, 0,
1189 { "Name", "wow.name",
1190 FT_STRINGZ
, BASE_NONE
, NULL
, 0,
1194 { &hf_wow_number_of_characters_on_realm
,
1195 { "Number Of Characters On Realm", "wow.number.of.characters.on.realm",
1196 FT_UINT8
, BASE_HEX_DEC
, NULL
, 0,
1200 { &hf_wow_number_of_realms
,
1201 { "Number Of Realms", "wow.number.of.realms",
1202 FT_UINT16
, BASE_HEX_DEC
, NULL
, 0,
1206 { &hf_wow_number_of_telemetry_keys
,
1207 { "Number Of Telemetry Keys", "wow.number.of.telemetry.keys",
1208 FT_UINT8
, BASE_HEX_DEC
, NULL
, 0,
1213 { "Offset", "wow.offset",
1214 FT_UINT64
, BASE_HEX_DEC
, NULL
, 0,
1220 FT_UINT32
, BASE_HEX_DEC
, VALS(e_os_strings
), 0,
1225 { "Padding", "wow.padding",
1226 FT_UINT32
, BASE_HEX_DEC
, NULL
, 0,
1231 { "Patch", "wow.patch",
1232 FT_UINT8
, BASE_HEX_DEC
, NULL
, 0,
1236 { &hf_wow_pin_grid_seed
,
1237 { "Pin Grid Seed", "wow.pin.grid.seed",
1238 FT_UINT32
, BASE_HEX_DEC
, NULL
, 0,
1243 { "Pin Hash", "wow.pin.hash",
1244 FT_BYTES
, BASE_NONE
, NULL
, 0,
1249 { "Pin Salt", "wow.pin.salt",
1250 FT_BYTES
, BASE_NONE
, NULL
, 0,
1255 { "Platform", "wow.platform",
1256 FT_UINT32
, BASE_HEX_DEC
, VALS(e_platform_strings
), 0,
1260 { &hf_wow_population
,
1261 { "Population", "wow.population",
1262 FT_FLOAT
, BASE_NONE
, NULL
, 0,
1266 { &hf_wow_proof_data
,
1267 { "Proof Data", "wow.proof.data",
1268 FT_BYTES
, BASE_NONE
, NULL
, 0,
1272 { &hf_wow_protocol_version
,
1273 { "Protocol Version", "wow.protocol.version",
1274 FT_UINT8
, BASE_HEX_DEC
, VALS(e_protocol_version_strings
), 0,
1278 { &hf_wow_protocol_version_int
,
1279 { "Protocol Version Int", "wow.protocol.version.int",
1280 FT_UINT8
, BASE_HEX_DEC
, NULL
, 0,
1284 { &hf_wow_realm_category
,
1285 { "Realm Category", "wow.realm.category",
1286 FT_UINT8
, BASE_HEX_DEC
, VALS(e_realm_category_strings
), 0,
1290 { &hf_wow_realm_flag
,
1291 { "Realm Flag", "wow.realm.flag",
1292 FT_UINT8
, BASE_HEX_DEC
, NULL
, 0,
1297 { "Realm Id", "wow.realm.id",
1298 FT_UINT8
, BASE_HEX_DEC
, NULL
, 0,
1302 { &hf_wow_realm_type
,
1303 { "Realm Type", "wow.realm.type",
1304 FT_UINT8
, BASE_HEX_DEC
, VALS(e_realm_type_strings
), 0,
1309 { "Required", "wow.required",
1310 FT_UINT8
, BASE_HEX_DEC
, NULL
, 0,
1315 { "Salt", "wow.salt",
1316 FT_BYTES
, BASE_NONE
, NULL
, 0,
1320 { &hf_wow_security_flag
,
1321 { "Security Flag", "wow.security.flag",
1322 FT_UINT8
, BASE_HEX_DEC
, NULL
, 0,
1327 { "Seed", "wow.seed",
1328 FT_UINT64
, BASE_HEX_DEC
, NULL
, 0,
1332 { &hf_wow_server_proof
,
1333 { "Server Proof", "wow.server.proof",
1334 FT_BYTES
, BASE_NONE
, NULL
, 0,
1338 { &hf_wow_server_public_key
,
1339 { "Server Public Key", "wow.server.public.key",
1340 FT_BYTES
, BASE_NONE
, NULL
, 0,
1345 { "Size", "wow.size",
1346 FT_UINT16
, BASE_HEX_DEC
, NULL
, 0,
1350 { &hf_wow_survey_id
,
1351 { "Survey Id", "wow.survey.id",
1352 FT_UINT32
, BASE_HEX_DEC
, NULL
, 0,
1356 { &hf_wow_unknown_bytes
,
1357 { "Unknown Bytes", "wow.unknown.bytes",
1358 FT_BYTES
, BASE_NONE
, NULL
, 0,
1362 { &hf_wow_unknown_int
,
1363 { "Unknown Int", "wow.unknown.int",
1364 FT_UINT32
, BASE_HEX_DEC
, NULL
, 0,
1368 { &hf_wow_utc_timezone_offset
,
1369 { "Utc Timezone Offset", "wow.utc.timezone.offset",
1370 FT_UINT32
, BASE_HEX_DEC
, NULL
, 0,
1375 { "Width", "wow.width",
1376 FT_UINT8
, BASE_HEX_DEC
, NULL
, 0,
1380 /* AUTOGENERATED_END_REGISTER */
1383 static int *ett
[] = {
1388 proto_wow
= proto_register_protocol("World of Warcraft",
1391 proto_register_field_array(proto_wow
, hf
, array_length(hf
));
1392 proto_register_subtree_array(ett
, array_length(ett
));
1394 wow_handle
= register_dissector("wow", dissect_wow
, proto_wow
);
1396 wow_module
= prefs_register_protocol(proto_wow
, NULL
);
1398 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
);
1403 proto_reg_handoff_wow(void)
1405 dissector_add_uint_with_preference("tcp.port", WOW_PORT
, wow_handle
);
1409 * Editor modelines - https://www.wireshark.org/tools/modelines.html
1414 * indent-tabs-mode: t
1417 * vi: set shiftwidth=8 tabstop=8 noexpandtab:
1418 * :indentSize=8:tabSize=8:noTabs=false: