Interfacing with external applications

Started by
5 comments, last by Rocket05 20 years, 1 month ago
I''ve been interested in writing bots for a few games i play alot (starcraft & rise of nations). The biggest challange i''ve found so far has been trying to come up with a way to interface with these games... im not sure whether it''d be easier to analyze and reverse engineer the game''s code, or to attempt to write something that would analyze the graphics on the screen and send keypresses to the application like a user would. Is this even the right direction to go at all? Does anyone have experience doing this?
"I never let schooling interfere with my education" - Mark Twain
Advertisement
So why would you write a bot for a game that is meant to be played by a human?
--God has paid us the intolerable compliment of loving us, in the deepest, most tragic, most inexorable sense.- C.S. Lewis
You can teach a bot to play as efficiently as possible, thus making them very good opponents, a great source to learn from in terms of efficiency. The point of a bot being that it can dynamically take in the conditions, and quickly output the most efficient decision path.

[edited by - Rocket05 on February 29, 2004 1:04:48 PM]
"I never let schooling interfere with my education" - Mark Twain
quote:Original post by antareus
So why would you write a bot for a game that is meant to be played by a human?


Why do humans exist? Why would anyone buy a computer? .. ..

Anyhow, reading the screen is certainly possible , assuming you have access to the game''s window screen data in the first place.it may be slow though.. Reverse engineering is likely the only way go about this task, unless there are tools for the game that allow mods. good luck..
If there's no direct way to access the screen, the less efficient but garenteed way is to send print screen messages to windows, so it'll be taking a screenshot and putting it in the clipboard.

As far as reverse engineering goes, Is there any simple/quick way to map out what's code or data in the application's memory? Is it possible to monitor the application's IP register and watch what code its executing?

[edited by - Rocket05 on February 29, 2004 1:13:16 PM]
"I never let schooling interfere with my education" - Mark Twain
It''s very easy to read another program''s memory. Have a look at these windows API functions: OpenProcess, CloseHandle, ReadProcessMemory. You may need to change the security access of the game if they''ve set it to discourage such things. As a side note, it''s vastly easier to do this with the .NET framework, which came as somethign of a suprise.
Reading the memory is easy, yes, but deciphering it... does anybody have an advice with that?
"I never let schooling interfere with my education" - Mark Twain

This topic is closed to new replies.

Advertisement