From 6294bf5600764d511ca8c411ee852f590cf97826 Mon Sep 17 00:00:00 2001 From: Gtker Date: Sat, 24 Jul 2021 22:02:52 +0200 Subject: [PATCH] WOWW: Add character race to SMSG_CHAR_ENUM --- epan/dissectors/packet-woww.c | 39 ++++++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/epan/dissectors/packet-woww.c b/epan/dissectors/packet-woww.c index 873dd51d3a..0b24c91b0a 100644 --- a/epan/dissectors/packet-woww.c +++ b/epan/dissectors/packet-woww.c @@ -84,6 +84,7 @@ static int hf_woww_login_result = -1; static int hf_woww_amount_of_characters = -1; static int hf_woww_character_guid = -1; static int hf_woww_character_name = -1; +static int hf_woww_character_race = -1; #define WOWW_TCP_PORT 8085 @@ -148,6 +149,31 @@ typedef struct { guint8 opcode[]; } WowwDecryptedHeader_t; +typedef enum { + HUMAN = 1, + ORC = 2, + DWARF = 3, + NIGHT_ELF = 4, + UNDEAD = 5, + TAUREN = 6, + GNOME = 7, + TROLL = 8, + GOBLIN = 9, +} races; + +static const value_string races_strings[] = { + { HUMAN, "Human" }, + { ORC, "Orc" }, + { DWARF, "Dwarf" }, + { NIGHT_ELF, "Night Elf" }, + { UNDEAD, "Undead" }, + { TAUREN, "Tauren" }, + { GNOME, "Gnome" }, + { TROLL, "Troll" }, + { GOBLIN, "Goblin" }, + { 0, NULL } +}; + typedef enum { RESPONSE_SUCCESS = 0x00, RESPONSE_FAILURE = 0x01, @@ -2367,7 +2393,13 @@ parse_SMSG_CHAR_ENUM(proto_tree* tree, offset, len, ENC_UTF_8|ENC_NA); offset += len; - offset += length_of_fields_after_name; + len = 1; + guint8 race = tvb_get_guint8(tvb, offset); + proto_tree_add_item(char_tree, hf_woww_character_race, tvb, + offset, len, ENC_NA); + offset += len; + + offset += 149; } } @@ -2629,6 +2661,11 @@ proto_register_woww(void) FT_STRINGZ, BASE_NONE, NULL, 0, NULL, HFILL } }, + { &hf_woww_character_race, + { "Race", "woww.race", + FT_UINT8, BASE_HEX, VALS(races_strings), 0, + NULL, HFILL } + }, }; static gint *ett[] = {