Skip to content

Packet Viewer

Bartosz Korczyński edited this page Sep 13, 2021 · 10 revisions

WoW Database Editor has built-in support for viewing and analyzing sniffs parsed by TrinityCore's WoW Packet Parser. Every editor version is shipped with latest Packet Parser.

User interface

  1. Saves currently visible (filtered) packets as text file.
  2. Opens "dumper" menu to process sniff in various way (See below)
  3. Toggles word wrap in "packet view" (number 8)
  4. When enabled, each UPDATE_OBJECT packed is split into many packets, one per each update (see 'filtering' when it can help)
  5. List of most recently used filters
  6. Filter
  7. List of filtered packets
  8. Textual view of selected packet

Filtering

WoW Database Editor has support for very advanced packets filtering. The syntax is more or less typical of any programming language. Filter should return boolean type. Therefore, this is a valid filter:

(1 + 2) * 3 > 10 || 2 != 3

Of course such filter is pointless, because it is a const expression, always evaluates to true. However please note, any arithmetic operation is allowed in the filters. Allowed operators:

(int) < (int)
(int) > (int)
(int) >= (int)
(int) <= (int)
(int) == (int)
(int) != (int)
(bool) == (bool)
(bool) != (bool)
(bool) && (bool)
(bool) AND (bool)
(bool) || (bool)
(bool) OR (bool)
(string) IN (string)

Please note IN operator, which returns true if string is present in second string. For instance: "bc" IN "abbcc" evaluates to true, because "abbcc" contains "bc" substring. This can be used to analyze raw textual output.


Filters only makes sense when they depend on particular packet. Therefore, in filter you can use special variable packet, which contains few fields accessible via . operator:

(int) packet.id - id of packet
(string) packet.opcode - string representation of packet opcode, for instance `SMSG_ON_MONSTER_MOVE`
(string) packet.text - raw parser output as string, can be used for advanced filtering
(int) packet.entry - entry of main actor of packet, for instance for packet `SMSG_ON_MONSTER_MOVE` it would be entry of a creature, which moves. For majority of packets, it will be `0`, but can be useful sometimes.

Therefore below there are examples of valid filters:

  • Select only SMSG_ON_MONSTER_MOVE packets

    packet.opcode == "SMSG_ON_MONSTER_MOVE"
    
  • Select SMSG_ON_MONSTER_MOVE or SMSG_UPDATE_OBJECT packets

    packet.opcode == "SMSG_ON_MONSTER_MOVE" or packet.opcode == "SMSG_UPDATE_OBJECT"
    
  • Select only "Server to Client" packets (SMSG)

    "SMSG_" IN packet.opcode
    
  • Select all CreateObject of npc "Pleasure-Bot 8000" (79853)

     packet.opcode == "SMSG_UPDATE_OBJECT" and packet.entry == 79853 and "CreateObject" IN packet.text
    
  • Select packets with "actor" "Pleasure-Bot 8000" (79853) or "Trenchwing Scavenger" (59251)

     packet.entry == 79853 || packet.entry == 59251
    

Alternatively, if you are tired of typing "SMSG_ON_MONSTER_MOVE", for all opcodes you can use shorthand SMSG.ON_MONSTER_MOVE (note: dot instead of underscore + no quotation marks). Additionally, WDE will show completion window with all opcode names, once you type SMSG. or CMSG.. This is however only a pure syntax sugar. It has exactly same semantics (SMSG.ON_MONSTER_MOVE is also just a string).

   packet.opcode == SMSG.UPDATE_OBJECT

is equivalent to

   packet.opcode == "SMSG_UPDATE_OBJECT"

Additionally, WDE has two special functions that can be used in filters:

  • is_player() - returns true if packet actor is any player (returns false if packet doesn't contain actor, please note: only some packets have specified "actor")

  • is_me() - returns true if packet actor is player, who has been sniffing. This is detected via CMSG_PLAYER_LOGIN packet, therefore, if you start sniffing AFTER logging in to the world, there won't be any CMSG_PLAYER_LOGIN packet and no packet will be matched.

Removes all packets that come from other players, but doesn't remove the packet if the player is sniffing player:

 !is_player() || is_me()

Splitting UPDATE_OBJECT

Because packet SMSG_UPDATE_OBJECT contains information about various objects in a single packet, and filtering in the editor happens "per packet", it is not possible to filter only few updates. For this purpose, you can split UPDATE_OBJECT into multiple "fake" packets, which can be filtered separately.

Dumpers/processors

Apart from filtering, WoW Database Editor offers also extensive method of processing packets. You can access "dumpers" aka "processors" from the toolbar "Dump" button.

Dumpers process filtered packets one by one and open their output next. The list of dumpers is not long yet, however more processors are to come next! Currently available processors are:

  • Creature/gameobject name dump

    If you start working with a quest, it is probably a good idea to check what npcs/gameobjects are used in the sniff. This dumper print npc/object names/ids.

    NOTE: names are detected via SMSG_QUERY_GAME_OBJECT_RESPONSE and SMSG_QUERY_CREATURE_RESPONSE opcodes, so if you didn't clear the cache, during sniffing, then there won't be any npc/object names! ALWAYS CLEAR CACHE BEFORE SNIFFING.

  • Spell name dump

    Analogically to the previous, it is good to check what spells are used in the sniff. This dumper checks for all SPELL_START, SPELL_GO and AURA_UPDATE packets and print used spell names.

  • Story teller

    Story teller outputs sniff as a human readable "story". It is a nice start when scripting something, obviously it prints only few chosen packets, so it is not a complete replacement of reading packets, but it can give you a brief look what is going on.

Settings

You can open Packet Viewer settings via File -> Settings menu.

Settings are divided into two groups: viewer default settings and parser settings. WoW Packet Parser settings are redirected to the WPP, you can read more about them in the WPP Readme.

WIP

Clone this wiki locally