Sign in to follow this  
ManaStone

Learning to program bots

Recommended Posts

I’m interested in creating bots or scripts for online games such as Ultima Online or Magic: The Gathering Online. I’m sure I’ve got a lot to learn before I can start doing stuff like that, but I’d like to know how I can go about getting started and just learning the fundamentals of what is involved. If I were to create a program like UO Razor, would I have to have a pretty good knowledge of the source code for the game, or would I be able to get all of my information from intercepting and dissecting the packets sent to the client? Also, are packets sent out by MMORPG’s usually encrypted? Does anyone know any links to tutorials or books that can help me?

Share this post


Link to post
Share on other sites
While it's possible to reverse-engineer the protocol by sniffing network data, I'd certainly recommend you make use of every scrap of source code you can get your hands on. When faced with a long stream of bits, it's much harder than you'd imagine to deduce the structs coming into play. If the source code isn't available and you don't have much experience in RCE then you may be getting in over your head.
You won't need to understand the ins and outs of the engine, but knowing what data are sent between the server and client, in what form, and how often, is absolutely essential. Fortunately, the requirements list pretty much ends there. The fact that fully-functional bots have been produced for this game proves that this can be done, and somebody out there knows the implementation.

As for encryption, I haven't heard of it being done. I'd imagine that such a system would be fairly pointless anyway: If somebody is going to hack your networking backend, then circumventing an XOR encryption would be childsplay. Any more powerful encryption that will stand up against the crackers will probably be too costly to implement in realtime within such a bottleneck.
However, networking data are routinely encoded. Something quick and stream-friendly such as Huffman or GZip is more or less required when such volumes of data are being trafficked. This can and probably will make your life a little bit trickier. Moreover, in situations where online game hacking is against the rules, servers often go to extraordinary lengths to verify the validity of the packets. While encryption is uncommon, checksums are standard (and can be rather tricky to forge). Also, servers have been known to force client-side checks to prevent tampering (CRC checks on the binaries and suchlike). Often, the hardest part of writing a bot will be convincing both the client and the server that it is not a bot.

If bots aren't allowed, this is not a project to take lightly. Otherwise, I'm sure it will be an enriching experience [smile].

Regards
Admiral

Share this post


Link to post
Share on other sites
Thanks for that information. Do you now how I would go about creating a program that intercepts and dissects packets though? I know very little about networking. I once had a operating system class where I did something very brief with sockets, but that is as far as my network programming experience goes. Would I also have to be an expert in multithreading to pull this off as well?

Share this post


Link to post
Share on other sites
Pick up a networking textbook, and read it from cover to cover?

You can play with "netcat" -- it is pretty useful for breaking down really simple protocols. But games tend not to be nearly so polite.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this