Login Status


ShareSource Site » Projects » sniffitzt » sniffitztWiki

Project: sniffitzt - a wow logging proxy [Wiki]

(*) Summary   [^] Files   [^] Screenshots   [_] Wiki   [!] Bug Tracker  
(») Mercurial Repository  
Project Wiki (Page: read_the_xml_data-dump)
Last Changed 2 months ago, by balrok

howto read the xml data dump

this is just a guide for small understanding and how you may get some information from there

first it would be good to have this dump with newlines (either take a new sniffitzt version or use sed (i just replaced the "><" with a newline)

a line in this file looks like this:

<packet date="12345" direction="s2c" opcode="123">123abfc</packet>
*date is the unix-timestamp when this packet gots logged (search for unix timestamp, you surely find a converter)

  • direction is s2c (server sends to client) or c2s (client sends to server) a c2c and s2s was not seen yet (:
  • opcode this represented by a decimal value, i tell you later more
  • packetdata itself, this is represented in hexdata and is in little endian

opcodes

to understand the opcodes you need the mangossources or look at http://mangos.svn.sourceforge.net/viewvc/mangos/trunk/src/game/Opcodes.h cmsg_* are clientmessages and smsg_* are servermessages then you have to convert the hex-value into a decimal value (i use http://www.parkenet.com/apl/HexDecConverter.html) and then you can search the log for this (my searchterm is allways "123" (with the quotation marks) because else it will find to much senseless stuff in the packet data)

the packet data:

maybe you first will have a look at http://en.wikipedia.org/wiki/Endianness#Little-endian i don't know if this data can be saved as big endian too to read the data you need to know, many bytes represent a value. if you take the mangossource as reference uint32() = 4byte uint64=8byte uint8=1 byte and if there is text sent with length its length bytes note a byte represents a value like a3,ff,00... you also have to watch out for this, if you reorder it to human-readable endianness

practical example:

i want to understand a random soundid.
first i look for the soundopcode in src/game/opcodes.h in mangossource
SMSG_PLAY_SOUND = 0x2D2,
hex 2d2 ->dec 722
and then i search in my favorite editor for "722" and the first packet i found is:
<packet date="1215510790" direction="S2C" opcode="722">14200000</packet>
so now i know that the server sent the data to me(direction = s2c), and if i want i even can get out which day and which hour this happened
to decrypt the packet-data i will look what information is inside, so i search the mangosdir with grep or ack
ack SMSG_PLAY_SOUND src/game
and get the following in BattlegroundMgr.cpp:
data->Initialize(SMSG_PLAY_SOUND, 4);
*data << uint32(soundid);
so the data is only one chunk with uint32, which means we can take those 4 bytes: 14 20 00 00
to convert them into decimal you need to change ther endianness (just reverse it, or maybe your from arabia, so you can easily read this (:
00 00 20 14 is the reversed order of the bytes
so you can use the hex-dec converter and get 8212

example #2

another (shorter example) to demonstrate what happens with 2 values
i search for SMSG_UPDATE_WORLD_STATE which is 707 in decimal system
mangos sends the following s575
data->Initialize(SMSG_UPDATE_WORLD_STATE, 4+4);
*data << uint32(field);
*data << uint32(value);
so 2 times 4 byte
an example packet looks like this
..direction="S2C" opcode="707">370C000058020000</packet..
field = 37 0C 00 00 = 00 00 0C 37 = 3127
value = 58 02 00 00 = 00 00 02 58 = 600

===bigger example

or another one (this time even more fields):
i take SMSG_MESSAGECHAT (to show you how you can read some text)
WorldPacket data(SMSG_MESSAGECHAT, 200);
data << (uint8)CHAT_MSG_SAY;
data << (uint32)language;
data << (uint64)GetGUID();
data << (uint32)language; //language 2.1.0 ?
data << (uint64)GetGUID();
data << (uint32)(text.length()+1);
data << text;
data << (uint8)chatTag();
and an examplestring looks like:
010700000052170D00000000002200000052170D00000000000A000000627566667320706C730000
splitted:
01 07000000 52170D0000000000 22000000 52170D0000000000 0A000000 627566667320706C7300 00
cause i found somewhere that CHAT_MSG_SAY=01 and i want a good text example (many stuff is senseless addon spam)
so
chat_msg_say = 01 (uint8 = 1byte (which doesnt have some endianness))
language1 = 07 00 00 00 = 00 00 00 07
guid1 = 52 17 0D 00 00 00 00 00 = 00 00 00 00 00 0D 17 52
language2 = 22 00 00 00 = 00 00 00 22
guid2 = 52 17 0D 00 00 00 00 00 = 00 00 00 00 00 0D 17 52
textlength = 0A 00 00 00 = 00 00 00 0A = 10
- so the text field will be 10 byte
textfields don't have endiannes, to make them human readable you just have to convert the asciichars, if you want to write a program for this, for python "chr" works for german letters good
if you want to do it by hand look at http://www.goascii.de/ there is a converter (you even can enter hex)
or if you're pr01337 you can read the hex ascii aswell as the normal text and ask yourself the whole time why we want to decrypt it ^^
text = 62 75 66 66 73 20 70 6C 73 00 = buffs pls 0x00
the 0x00 seems to terminate the strings.. and the decoded text is a cool way to see what intelligent game we all play (:

and last but not least, there is one bytefield missing:
chattag = 00