netcode-first-look
Skill0 starsChanged 48 days agoMITView on GitHub
Take a first look at a game's network traffic on your own machine. Capture one process with procpcap into a pcapng, read its live stats (packets, bytes, endpoints, payload entropy), open it in Wireshark, tie packets to in-game actions, and start a Lua dissector from procpcap's template. Use when the user asks to capture, sniff or analyze a game's packets, study its netcode or protocol, or find the code that sends a packet, for a game or server they own and run locally.
In this repository7 other files it gives its agents.
- find-a-valueSkill
- find-what-writesSkill
- make-a-signatureSkill
- safetySkill
- static-reconSkill
- walk-a-pointer-chainSkill
- write-a-trainerSkill
The file
We split this skill into the rules it gives an agent
8 rules. About 0 are common, 5 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 15
Check the safety skill. For traffic that means:
- Distinctive: line 17
Only the user's own client talking to a server the user runs: their own game, or an open-source game with a local server on the same …
- Distinctive: line 19
Never capture, decode or replay traffic to servers the user does not run, and never another person's traffic.
- Distinctive: line 24
If the program talks to a public server, stop and say why.
- Distinctive: line 42
Ask the user to start the capture in an Administrator terminal:
- Distinctive: line 56
Read the stats line procpcap prints each second, and have the user paste a few lines.
- Very specific: line 69
Stop with Ctrl+C. procpcap closes the file and prints the packet count.
- Very specific: line 91
Start a dissector from procpcap's examples\game-protocol.lua: set GAME_PORT, replace the placeholder fields with the ones found in step 7, …
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Netcode: a first look
Capture one program's traffic, measure whether it can be read at all, then line packets up with actions. Handbook: Ch. 28 Multiplayer Hacking and Network Analysis. Tutorial: the Pointer Lab tutorial does not use the network, so there is no lesson for this; practice on a client and server you run.
The boundary, first
Check the safety skill. For traffic that means:
- Only the user's own client talking to a server the user runs: their own game, or an open-source game with a local server on the same machine.
- Never capture, decode or replay traffic to servers the user does not run, and never another person's traffic. Do not help modify or inject packets for an online game.
- procpcap reads packets only. It does not block, change or inject them.
If the program talks to a public server, stop and say why.
What procpcap needs
procpcap uses the WinDivert driver:
- It must run in an Administrator terminal. Do not run it yourself and never try to elevate; ask the user to run the command.
WinDivert.dllandWinDivert64.sysmust sit next toprocpcap.exe. Antivirus often flags the driver, and Memory Integrity (HVCI) or Smart App Control can refuse to load it. That is the user's decision to change, not something to work around.
Procedure
- Get the process id. With Pointer Lab attached,
processeslists them; otherwise ask the user, or runtasklist /fi "imagename eq mygame.exe". Ask the user to start the capture in an Administrator terminal:
procpcap --pid 5120 -o capture.pcapng--name mygame --childrencaptures a launcher and the game it starts.-w - | wireshark -k -i -streams straight into Wireshark.- Script the actions while it runs. Ask the user to do one thing at a time and note the wall-clock second: idle for ten seconds, move, fire once, chat one word. Idle traffic is the baseline every other packet is compared against.
Read the stats line procpcap prints each second, and have the user paste a few lines. Its fields are packets per second, bytes per second, distinct endpoints, and the mean payload entropy in bits per byte (0 to 8).
Entropy What it usually means Under about 5 Plaintext or a simple binary layout. There is something to read 5 to 7 Mixed: compact binary fields, or partly compressed Near 8 Encrypted or compressed. Nothing to dissect until the key or the compression is found Endpoints above one or two while playing locally mean the program talks to something besides the local server; find out what before going on.
- Stop with Ctrl+C. procpcap closes the file and prints the packet count.
Each packet's comment holds
pid <n> <name>. Summarize the capture. If Wireshark's
tsharkis on PATH, these read the file without the GUI:tshark -r capture.pcapng -q -z conv,udp tshark -r capture.pcapng -q -z conv,tcp tshark -r capture.pcapng -q -z io,stat,1convgives the conversations (the server's port is the one to dissect);io,stat,1gives packets per second, where each scripted action should show as a bump over the idle baseline.- Line packets up with actions. In Wireshark, filter to the game's port
(
udp.port == 27015) and compare the packets sent in the second of an action with idle ones. Fields that change with the action (a sequence number that counts, a coordinate that moves, an opcode byte that differs between move and fire) are the start of the layout. - Start a dissector from procpcap's
examples\game-protocol.lua: setGAME_PORT, replace the placeholder fields with the ones found in step 7, and load it in Wireshark (Help > About Wireshark > Folders > Personal Lua Plugins, or Tools > Lua > Evaluate).
From a packet to the code that sends it
Static and live tools meet here:
static-recon:imports {"dll": "ws2_32.dll"}gives the IAT slot ofsend,sendtoorWSASend;xrefs_toon that slot gives every call site.Live, a hardware execute breakpoint on a call site shows its registers, which point at the buffer about to be sent:
breakpoint_add {"address": "mygame.exe+0x4A2C10", "kind": "execute", "label": "sendto call"} breakpoints_list {} read_bytes {"address": 2381400145672, "size": 64}The address and buffer here are examples.
breakpoints_listshows the last thread's registers; on x64 the buffer is in RDX forsendandsendto. The bytes read there should match a packet in the capture.
Success, and dead ends
Success is a capture of one process, an entropy reading, and at least one field whose value follows an in-game action.
| What happened | What it means | Next step |
| procpcap exits: not elevated | It needs Administrator | The user reruns it from an Administrator terminal |
| The driver will not load | Antivirus, HVCI or Smart App Control | The user's call. procpcap cannot be used until they allow it |
| 0 packets | Wrong pid (a launcher), or the game uses a helper process | --name <part of the name> --children |
| Entropy near 8 everywhere | Encrypted or compressed | The buffer at the send call is already encoded. Work back from that call site with static-recon (disassemble the caller) to the function that fills it |
| Traffic goes to hosts on the internet | Not a local-only setup | Stop. See the boundary above |
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

