Skip to content

bencvt/McPacketSniffer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

50 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

McPacketSniffer is a client-side mod for Minecraft that logs packets sent and received between the client and a Minecraft server. Packets are logged to a text file, one packet per line, one file per connection.

Why bother modding the client when you could just use one of dozens of external utilities? Several reasons:

  1. Inspecting Minecraft's internal Packet objects rather than sequences of raw bytes is less error-prone. Why reinvent the wheel when you can reuse the original?

  2. Game state can be readily accessed. For example, instead of just printing an entity's ID as it's sent in the packet, this mod can look up the entity, outputting its type and current coordinates.

  3. As of 1.3 the protocol is encrypted. This limits external utilities: they either have to be a full-fledged Minecraft protocol proxy or they have to interface with the Minecraft client somehow (i.e., read memory) to get at the key.

  4. The memory connection, used by the Minecraft client in single player mode to talk to the integrated server, uses the protocol too (minus the crypto). This internal connection can be inspected using McPacketSniffer as well, something you wouldn't be able to do at all using TCP-based utilities.

Installation

Installing this mod works exactly the same as any other Minecraft client mod.

  1. Download and extract the zip for the latest release.
  2. Patch the contents of the zip file into your minecraft.jar, being sure to remove the META-INF folder.

Utilities like Magic Launcher can automate this process. Highly recommended! Manually copying .class files is for the birds.

Neither ModLoader nor Forge is required.

Compatibility

McPacketSniffer modifies cf.class (MemoryConnection) and cg.class (TcpConnection). Any other mod that modifies these classes will potentially be incompatible with McPacketSniffer.

Note that Forge does modify these classes. However, McPacketSniffer provides a compatibility layer, verified working as of Forge 6.3.0. Just make sure to use McPacketSniffer's version of these classes in your final minecraft.jar.

Usage

McPacketSniffer is a utility; there is no GUI. It's all text files.

Start Minecraft with this mod installed, which will automatically create (minecraft-dir)/mods/McPacketSniffer/options.txt. You can open this file in a text editor to specify exactly what you want to log. Any changes you make will take effect within a few seconds; no need to restart Minecraft, though some settings won't take effect until you open a new server connection.

The packet logs are located in (minecraft-dir)/mods/McPacketSniffer/logs.

Note that the packet logs capture normal client <-> server traffic. This does not include every piece of data sent and received by the Minecraft client. Known exceptions:

  • Server pings (client <-> server)
  • Server login verification (client <-> session.minecraft.net)
  • Account login (client launcher <-> login.minecraft.net)
  • Resource downloads (client <-> s3.amazonaws.com)
  • Skins and capes (client <-> skins.minecraft.net)
  • Usage reporting (client <-> snoop.minecraft.net)
  • Mod-specific connections (client <-> wherever, e.g. the mod's website to automatically check for updates)

More info

McPacketSniffer is open source! Visit the official project page at github.com/bencvt/McPacketSniffer. Build instructions are located in README-dev.md.

If you're looking for a mod that captures just chat packets in a more user-friendly format, check out this mod's younger brother, McChatLogger. Unlike many brothers, McChatLogger and McPacketSniffer can run simultaneously without conflict.

About

Client-side, application-level Minecraft packet sniffing

Resources

License

Stars

Watchers

Forks

Packages

No packages published