Answer the question
In order to leave comments, you need to log in
How to change process memory?
I decided the other day to try out an interesting topic, namely memory hacking.
I watched a tutorial ( https://www.youtube.com/watch?v=I0zPwg4iUDk), more or less adequate, where a person explains in detail what and how to do, but after watching the video several times and rewriting the code, I realized that I had nothing does not work. Through a simple debugging, I realized that the problematic place is in the memory entry itself.
In the cheat engine at this moment of the video (2:03), the value in the calculator does not change for me, that is, if it becomes 40, then I still have 20.
------------ ----------------
#include
#include
using std::cout;
using std::cerr;
using std::endl;
int main() {
int val = 200;
HWND hWnd = FindWindowA(0, "Calculator");
if (hWnd != 0) cout << "All things good. We are ready to get started!" <<endl;
else cerr << "Cannot find calculator app running." <<endl;
DWORD pID;
GetWindowThreadProcessId(hWnd, &pID);
HANDLE hProc = OpenProcess(PROCESS_ALL_ACCESS, FALSE, pID);
if (hProc) cout << "Still doin' good." <<endl;
else cerr << "Cannot find the process!" <<endl;
int success = WriteProcessMemory(hProc, (LPVOID)0x278AEC16570, &val, (DWORD)sizeof(val), NULL);
if (success > 0) cout << "Congratulations. You got that!" <<endl;
else cerr << "Try something else!
well, the output:
All things good. We are ready to get started!
Still doin' good.
Try something else!
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question