Bot programming?

Started by
3 comments, last by thedustbustr 16 years, 1 month ago
I'm interested in writing a bot for the game I play in order to make the game easier for other players. Basically there are some tasks that should be automated so players don't need to do those tasks, and a bot would greatly help the community. I'm interested in writing all of the networking code in order to communicate with the game client, but how would you go about that? Wouldn't you need to really understand the format of the messages the game is using, and how would you do that if so?
Advertisement
Usually this sort of thing is considered cheating and people get banned for doing it.
I'm aware of that. Bots are widely accepted in the game I play. It's just a bot that will be similar to irc text processing bots, and only exist so that we don't need more staff in order to do things that can easily be automated.
Which game?

This isn't just "lets code something to manipulate data on wire".

WoW provides Lua as scripting language. For others, you first need to bypass the natwork encryption. For third, you might need to inject directly into running exe. SecondLife offers very rich scripting and modeling language.

Quote:I'm interested in writing all of the networking code in order to communicate with the game client, but how would you go about that? Wouldn't you need to really understand the format of the messages the game is using, and how would you do that if so?


Through experience of reverse-engineering. Ask in emulator or bot communities for the game in question. They'll know much better. And yes, such low-level access requires you to read incoming traffic, and know not only what individual pieces of data are, but also how to generate logically correct response to send to server.

And semi-decent server will start raising red flags if validated network input starts causing exceptions - it means that packet confirms as valid, but its contents aren't.

There is no one answer, but if you need to manipulate data on wire, you're up a very difficult task.
If its a game which is meant to be difficult to reverse-engineer (eg any modern MMO), their network communications are encrypted, so you're not going to want to go that route. Most techniques revolve around modifying the game in-memory (reading local variables, changing the machine code, and how to not be detected when you do it). Check out Exploiting Online Games: Cheating Massively Distributed System by Greg Hoglund. I own it, a lot of it isn't too advanced but there are two really technical chapters with lots of source snippets. If this book helps you, check out Reversing: Secrets of Reverse Engineering by Eldad Eilam and Rootkits: Subverting the Windows Kernel by Greg Hoglund for more advanced material that you'll probably need to know. Game hacking isn't exactly easy.

Edited to add sidenote: the trick of reverse engineering the game binaries is to not have to figure much out. You manipulate code that was already written, without a full understanding as to how it works (eg the network protocols), to do things. Cool blog by Gamedev alias TheAdmiral on reverse engineering the Itunes DRM by wielding itunes decryption functions against itself.

If the target is open source you can modify and recompile the game client. If the target communications aren't encrypted, use Wireshark to capture the packets and figure out their network protocols, and connect to the server from your own client.

This topic is closed to new replies.

Advertisement