I have written a Packet Sniffer in Java and it works perfect but now I have a text file with integers and I dont know how to decode them.
I already tried to use this : Minecraft Protocol, but I still can't decode the packets...
It seems that no integer is higher than 255, so this is a single byte per line output. The packet that you are seeing might be compressed, but it is impossible to say without seeing the configuration of your Minecraft user/server. If they are actually compressed - you will need to unzip them before you will be able to analyze them.
To help you with decoding, I highly recommend Wireshark. Download it and re-run your network capture. Then compare the decoded output with that of your program. Wireshark will give the meaning of each data member in a packet.
EDIT: What part of decoding is unclear for you? Using pen and paper and windows calculator in programming mode here is the decoding of first packet:
15 - Varint - length of the packet
0 - Varint - packet ID - Handshake
47 - VarInt - protocol version
Following bytes are length prefixed server address in UTF-8:
9 - Lenght
108 - l
111 - o
99 - c
97 - a
108 - l
104 - h
111 - o
115 - s
116 - t
Following 2 bytes are server port in unsigned short format (I guess 7777)
1 - Varint - Next state
Last 2 bytes are unclear to me.
In short - for each packet:
Find length of the packet
Find the packet type
Using packet type decode the rest
Asked in February 2016Viewed 2,338 timesVoted 13Answered 1 times