H
H
hleb12022-03-15 00:47:51
Programming
hleb1, 2022-03-15 00:47:51

Memory modification - legal?

I know that OS forbids one program to change the state of another.
Tipo in one program is a variable health = 100, and the other cannot change it.
BUT!
Programs can communicate with each other, for example through sockets or pipes (Unix, at least).
Question: how do cheat codes change the state of the program? Yes, we found a variable responsible for health with a debugger and we want to change it... But how? Do we really need to write some kind of addition to the original program, so that it, in turn, could interact with the cheat code and change its state?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
H
HemulGM, 2022-03-15
@hleb1

Windows allows you to read and write to the memory of another process. Of course, everything is within the limits of your rights and the target program. An example of such a program is ArtMoney - a program that was popular in its time (and is still relevant now) for "hacking" a single-player game for money, experience, and so on.
Cheats work like this:
1. A library is created that can be connected to the target program. A library is a dll. This dll is located in the memory of a foreign process (for example, the ManualMap method).
2. In someone else's program, a thread is created that initiates this library and runs the desired function (entry point).
3. Now dll, in which your code has direct access to the entire memory of the process, as well as to the entire operation of the program. You can access classes, methods, properties, and so on.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question