Question

I want a little help. I know java and little c++. I have seen trainers for games which can set health of player and spawn cars etc. I want to make something similar to that.

For example we have minesweeper running. when i run my java program and click on a button it should call minesweepers function and minesweeper game should show that i won. So my question is how to establish a connection or something to another program running and calling the program's functions by passing arguments. how is it possible. I heard about reverse engineering and downloaded a program called OllyDBG. And a winject dll injector. i donot know what to do. Combining all these how can i make a program. Please give me ideas or codes or resources helpful.

Was it helpful?

Solution 2

Well, your starting sentence was: "I have seen trainers for games which can set health of player and spawn cars etc. I want to make something similar to that."

Here's a very nice reference code that does what you talked about in C++ http://www.codeproject.com/Articles/7468/Game-Wizard

First strengthen your C++ skills and then study what he does there.

A general description would be that the "victim" process memory is search for a certain value. Usually something that represents a value that you are aware of - for example, number of bullets of your character. Usually a big list of location in memory is found at first. But then, you shoot a bullet, and now the list that you previously found (and only it!) is searched for the new value. Each step discards the "false positive" finds, until in the end you know the location of the variable that you searched for. After doing this you are able to change it as well.

Now, going to the general topic - this technique is only a specific approach, and while very helpful in some cases, many times you need stronger and different tools.

Here's a very similar question: How can I find the data structure that represents mine layout of Minesweeper in memory?

I personally find IDA to be an amazing tool for reverse engineering and analyzing an application (both statically and dynamically). In combination with "idapython" (ida binding for python) it feels unstoppable :)

Reverse engineering requires that you have at least basic knowledge of your target machine architecture - for example, x86 instructions.

Search for IDA tutorials to get the hang of it. There are many "crackme's" floating around, those are challenges to crack (for educational purposes) varying types of application protections. It will teach you a lot.

You can also search google for "reverse engineering for beginners". The web has tons of resources on this topic. The amount of information can be intimidating at first, so make sure you find a basic site that helps you to build your skills gradually.

Another important term that you should know is "hooking". While making it yourself will teach you the most, there are libraries that perform this operation for you. The idea is to gain control over a certain function. Whenever anyone calls that function, the control is first passed to your code, and you can decide what to do. For example, you can decide to simply log this call to a file and call the original function, or you can do more complicated things.

I found http://tuts4you.com/ to contain many useful tutorials and snippets of information.

Oh, and as people said, Java is not your friend in this case. C/C++/Assembly probably are.

Starting a completely new topic, especially reverse engineering is tricky in the beginning, but I can assure you it's very rewarding.

Edit: I have a surprise for you: http://www.uninformed.org/?v=1&a=7

I simply googled reverse engineering tutorial mine sweeper ;)

Good luck :)

OTHER TIPS

First you need to reverse-engineer minesweeper to find out the memory location of different variables. Remember that you will probably not be able to run minesweeper's functions due to context, but you can inject code on it to run those. You can read memory easily, though.

To inject code, you must assemble it separately, and then write it in the process virtual space.

In windows API there are several functions that allow opening a process and accessing it memory, but you must have privileges for that.

In summary: To do that, the first thing you need to learn is how to disassemble and understand a program. Only then youll figure out how easy minesweeper is to understand.

BTW: minesweeper stores the map raw in memory. A simple memory inspector will allow you to get the map of it.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top