• Welcome to Valhalla Legends Archive.
 

Validate my research

Started by taylorjonl, January 04, 2004, 10:19 PM

Previous topic - Next topic

taylorjonl

I am attempting to understand how Diablo II and Battlenet communicate.  I would like to do this because I like to know how stuff works and I would like to write my own bot without any outside code I didn't write.  I have spent the last few weeks sniffing packets and reading off this site.  Here is what I have come up with and would like a veteran to validate my research.

When you start up the game and click on the 'Battlenet' button the game makes a BNCS connection to a battlenet server.  When you enter a username/password it then creates a MCP connection to a battlenet server, this server is designated in the 0x3e packet that is sent from the server in the BNCS connection.  Once you create/join a game it then creates a D2GS connection to a server who is named in the 0x04 packet to the client in the MCP connection.  I think the D2GS packets from Server to Client are compressed via a huffman compression algorithm but I will screw with that when I get there.

Let me tell you what I am attempting to do.  I want to write a proxy server that I can read/modify/send packets that are controlled by a Java/Perl/Python module.  Basically it will be similar to JED/D2JSP but without accessing D2 memory.  It will only be released to my closest friends as I don't want to screw the realms like has been done in the past.

With that in mind tell me if I am on the right track.  You may or may not be able to assist me but any assistance is appreciated.

I think I can hijack the D2 connections by modifying the packets mentioned above and giving the IP of my proxy instead of the battlenet server.  I have been able to hijack the first connection but after that they bypass my proxy, I think because of those packets.

Can anyone provide some insight?

Kp

Quote from: taylorjonl on January 04, 2004, 10:19 PM
I think I can hijack the D2 connections by modifying the packets mentioned above and giving the IP of my proxy instead of the battlenet server.  I have been able to hijack the first connection but after that they bypass my proxy, I think because of those packets.

Can anyone provide some insight?

I don't do D2, so I can't confirm or deny your findings.  However, a simple tip for you to avoid being bypassed - since you're already proxying the connection, have your proxy detect the message which passes the MCP connection info and modify it to specify your proxy as the destination, which can then become an MCP-proxy as well.
[19:20:23] (BotNet) <[vL]Kp> Any idiot can make a bot with CSB, and many do!

taylorjonl

#2
Quote from: Kp on January 04, 2004, 10:29 PM
I don't do D2, so I can't confirm or deny your findings.  However, a simple tip for you to avoid being bypassed - since you're already proxying the connection, have your proxy detect the message which passes the MCP connection info and modify it to specify your proxy as the destination, which can then become an MCP-proxy as well.

I am working on it but am currenctly reworking my code because I have made some finding since I wrote it.  I would like to find out if I am way off base so I don't have to rewrite if I am incorrect.

I am a 'code nazi' and am very picky about my code so don't settle for less than perfect looking code.