Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I use data discovered via a memory scanner in an external program?

Tags:

c

assembly

So, some background: I'm using a memory scanner called cheat engine to get real-time values for game stats (e.g. hp, mana, exp) in a non open-source video game that I'm trying to make a bot for.

For my bot to effectively use this information, I need to get it from cheat engine (or any memory scanner with similar functionality) to my bot code in a timely manner.

Now, one obvious way to do that would be to save all of the information to a file and then load the file in my bot code, but since this data needs updating about every half second or so, that isn't a real solution.

What I really need is either a terribly convenient memory scanner that allows you to use the information you uncover as a set of variables in some programming language (preferably java, c, or matlab), or a way to access the memory addresses found in one of the above languages.

This latter option should hopefully be doable, as cheat engine gives the memory address, controlling process ID, and data type.

like image 266
zergylord Avatar asked Aug 31 '11 18:08

zergylord


1 Answers

This question doesn't have an easy answer. As far as I can tell you are very new to this area, so what you really need is a proper introduction to the subject, and for that I recommend reading Exploiting Online Games: Cheating Massively Distributed Systems.

It's an awesome book and it shows in a detailed manner how game hacks work, and it dedicates an entire chapter on how to build bots.

If you want to write an application to read/write data to those memory addresses you need to investigate functions like ReadProcessMemory() and WriteProcessMemory(). Whatever language you to choose to implement your bot needs to provide access to the Windows API. This is needed because you have to manipulate another process' memory space.

There are lots of tutorials out there that shows how to do this using C and C++, since they are the preferred languages to do this kind of stuff. Another option is to use a macro tool if you want something simple to play the game for you.

Modern computer games implement their own anti-cheat mechanisms to make it a little more difficult for people like you (and me). And since this book presents attack and defense techniques I recommend it to anyone interested on how to exploit computer games. The book is fully loaded with code examples.

I'm sorry for not providing more information but I was criticized once in the past for helping people with your curiosity and I would also never do a better job than the authors of the book explaining how to do this stuff.

like image 176
karlphillip Avatar answered Nov 07 '22 05:11

karlphillip