I thought I knew how packets worked, but I'm just not understanding how to capture and read them...

I am playing this online game which is connected to a server (some server off of battle.net).

I want to know how to search my way through the packets and filter them.
Basically I am looking for these packets:

Message ID:	0x0E
 	 
Message Name:	SID_CHATCOMMAND
 	 
Direction:	Client -> Server (Sent)
 	 
Format:	(STRING) Text
 	 
Remarks:	Send text or a command to Battle.net using this packet.

For STAR/SEXP/SSHR/JSTR, Text is UTF-8 encoded (WIDESTRING).

It is generally accepted as unwise to send any character below a space (0x20): this includes line feeds, carriage returns & control characters. The maximum number of characters is 223 per message.

I simply want to always be looking for and returning these packets, and if the strings are equal to one of my special commands, then it will run another separate function.

Something like:

while sniffing: findpackets(packetinfo) if findpackets == "/find" dofunctionz()[code=python]while sniffing:
findpackets(packetinfo)
if findpackets == "/find"
dofunctionz()

wireshark or microsofts network monitor could be a alternative.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.