How do I grab packets from a client using a debugger?

12/14/2010 07:10 Lateralus#1
As the title says, how would I go about doing this? I'm planning to code a 1.0 server (in C++ mind you), but from what I know, there's no public documentation of packets, nor could I sniff them from a current server for these old clients.

Also, once I get the packets, how could I find out what each one (and its contents) actually references?

This is all to new to me. I've never done asynchronous socket programming before. Expect more questions.

Thanks in advance.
12/14/2010 09:36 IAmHawtness#2
If you want to use a debugger to grab packets, you'd be better off coding your own debugger. If you trace back/forward from the WS2_32.recv/send function, you'll find the place where the packet is stored post/pre encryption. The Send/RecvPacket function is something like
Code:
int SendPacket(PacketAddress, PacketLength)
So what you want to do is place a breakpoint at the Send/RecvPacket function and read its parameters: [esp+4], [esp+8] to read the packets

Finding out what the packets do is all about using your brain and logic. Breaking down packets in smaller parts and finding out what each part does is the easiest approach imo. If not, [Only registered and activated users can see links. Click Here To Register...] is probably a good place to look, even though his packet wiki is more up-to-date, I'm pretty sure CO has used similar packet structures ever since CO 1.0