3

I've played with using software like cheat engine to modify memory, null out code and even inject some code of my own. However finding the right spot to modify is always a difficulty. I'd like to be able to identify the code that is run when I click my mouse on an object (eventually to simulate the entire process). Is there a tool or method for doing this that anyone could suggest?

I've used ollydb and cheat engine a fair bit in the past.

  • This depends on the framework used to build the game. As an example, unity3d games are .net based, so .net tools(decompilers/debuggers/tracers/etc) should be used. Using Olly or Cheat Engine is possible but difficult. – 0xec Aug 30 '15 at 4:41
  • 3
5
  1. On windows you can

    find winproc function, search click messages within it and add breakpoint/trace from there...

  2. On different OS

    trace mouse handlers ...

  3. If OpenGL is used

    The Object selection is often done by it directly during rendering. You can trace calls to those functions used.

  4. If any framework is used

    learn what function for mouse it has and trace its calls ...

| improve this answer | |
2

An effective method in these cases (although not necessarily straightforward) is to use differential debugging.

The core principle is to run the application twice and record traces of the functions being executed, or even basic blocks if you need to get so granular.

The idea boils down to:

  • The first time you record a trace try to exercise as much functionality as possible, except what you are interested in (in your case, do not press that button!).
  • The second time you go directly for what you are interested in, press that button!

  • Now you can filter the noise out of the second trace by looking for hits that appear exclusively in the second (and not in the first)

This is not a perfect method but it works pretty well to narrow the search in several scenarios.

Shameless plug: Here a link to my blog where I discuss a similar (in nature) problem. There is even some old code to get you started.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.