1

Alright, I'm a little bit (honestly way too) confused about how the heck I can make a program interact with another program.

For example, let's say a game, a shooter, when you run an external program and you make your character not able to die, or immediately shoot when detects an enemy, etc...

I was reading a little bit about it, and they say you have to know how the "target" is composed. But I still don't get it.

For example, let's say we've got a simple code like this:

#include <iostream>
#include <windows.h> 

int main() {
    for(int h = 0; ; h++) {
        std::cout << "The H's value is: " << h << std::endl;
        Sleep(1000);
    }

    return 0;
}

Then, how do I create another program where I can change the H's value to zero everytime I press any key?

Don't get me wrong, I ain't trying to hack anyone or anything, I'm just curious about how those programs work.

(Sorry if I've got some grammar issues, English isn't my native language).

  • 2
    There a whole host of options [here](https://msdn.microsoft.com/en-us/library/windows/desktop/aa365574(v=vs.85).aspx). I'd probably try pipes first. Another option is [Boost.Interprocess](http://www.boost.org/doc/libs/1_62_0/doc/html/interprocess.html) although it will not be easy for a beginner. – Paul Rooney Dec 19 '16 at 23:06
  • Possible duplicate of [Keyboard Input & the Win32 message loop](http://stackoverflow.com/questions/2441457/keyboard-input-the-win32-message-loop) – Robert Prévost Dec 19 '16 at 23:06
  • Are you referring to networked games? – Mikel F Dec 19 '16 at 23:29
  • Are you talking about "targets" you have the source code of or targets that you only have the binaries of? – Yaeger Dec 19 '16 at 23:39
  • why do you want it to be another program? Normally a game is one big program – pm100 Dec 20 '16 at 00:28

1 Answers1

3

Specific to your program in the exapmle if we take that the program is already compiled and you are not allowed to make any changes to the source code the solution would be to build a program which will run with high enough privileges to examine this process's memory and directly change the in-memory value of h, which should be on the top of the stack(or almost).

Speaking of some more "legal" ways to do so you should check you should read about inter process communication which can be done with multiple methods. Read this.

However most "Bots" and programs which help cheaters in games are in many cases graphics based and are able to analyse the image and thus help aim. On the other hand some "recoil reducers" simply move your mouse in the opposite direction of the recoil of the gun in game. So there is a ton of approaches to your question and for every particular case the answer might be different.

tna0y
  • 1,842
  • 3
  • 16
  • 33