Monday 15 April 2013

c++ - Accesing values of another program -


So, I was wondering how I could use values ​​of different programs with my C ++ code.

I understand that I know the memory location and it has to be accessed in some way but I really do not know how

we say that I have There is a game where I have a character with certain health and I want to read that health with my C ++ code (as you can read different values ​​with cheating engine).

How do I complete it?

For clarity: Operating System is Windows

You (/

  int * money = 0x00400000 + 0x00ABCDEF;  

If you are smart, you can inject a DLL, you can use the pointer in your code

  int * money = 0x00400000 + 0x00ABCDEF; / / Director's funding address * money = 5000; // Set Money 5000. If / If you want a DLL example, here are some:  

<

It can be "dangerous" in the context of the application.

When you access an indicator that indicates a protected memory area, inaccessible memory, not for luggage or an invalid location Your application may crash but I do not know how the cheat engine prevents it, but you have a few options, which I recommend:

  • Quit the application honestly and The user knows that You can not handle it
  • Instead try / handle the problem with the hold block?
  • Try exiting the application
  • Do nothing and let the app behave weird / accident
  • ... greater than

    I have also written a pointer to myself which handles dereferencing and an error (return zero)

      // tap automatically when the last parameter Stops as the "Dereferences" template stops & lt; Square T = DWORD, square S = DWORD & gt; Structure Pointer {Private: std :: vector & lt; S & gt; Parameter; S variable; Bull Motin One; Public: // tap "Dereferences" template automatically as the last parameter & lt; Class ... Args & gt; Pointer (RGS ... Args) {std :: arrays & lt; S, sizeof ... (args) & gt; List = {args ...}; For (auto i: list) params.push_back (i); If (params.size ()> 1) MoreThanOne = true; More tanone = false; } T Resolive Pointer () {variable = params [0]; If (MoreThanOne) return (t) variables; Try {auto it = params.begin (); This ++; (; It! = Params.end (); ++ it) {if (* reinterpret_cast & lt; S * & gt; (variable) == NULL) Fixed stat_cast & lt; T & gt; (NULL); Variable = * reinterpret_cast & lt; S * & gt; (Variable) + * this; }} Hold (...) {return static_cast & lt; T & gt; (NULL); } Return (t) variables; } T Operator () () {Return ResolvePointer (); }};   

    Usage:

      Unsigned long ipaddr = htonl (pointer & lt; unsigned long & gt; (0x00400000 + 0x008E3A74,0x04,0x38, NULL) ( )); / / Pointer to IP address if the players (ipaddr! = NULL) // .... ....    

No comments:

Post a Comment