Memory Writing...
Well, I Made a simple console, with a int that you can see the value and change it anytime, Then i made a console application to write another value to that int..
But idk what is wrong, it says Memory Written but does not happen nothing, I found the adress with C.E 5.6 and 6 ( I didn reopen the console, so the adress didn changed...) ..Here is my code:
Possible problems:
Converting the adress to hex (i just 0xADRESS it)..
Please help me..
If my code is wrong, please give me a example..And PS: Idk why but the WriteProcessMemory is returning 0 =( now i see that..
But idk what is wrong, it says Memory Written but does not happen nothing, I found the adress with C.E 5.6 and 6 ( I didn reopen the console, so the adress didn changed...) ..Here is my code:
Code:
#include <iostream>
#include <Windows.h>
using namespace std;
int newvalue = 666;
int main() {
while(true) {
HWND hWnd = FindWindow(0,L"mhtest");
if(!hWnd) {
cout << "Window not found!" << endl;
system("cls");
} else {
cout << "Windows found! Starting the memory hacking process.." << endl; Sleep(2000); system("cls");
DWORD pID;
GetWindowThreadProcessId(hWnd, &pID);
HANDLE pA = OpenProcess(PROCESS_ALL_ACCESS,false, pID);
if(!pA) {
cout << "Cant acess the program.." << endl; Sleep(2000);
system("cls");
} else {
int ss = WriteProcessMemory(hWnd,(LPVOID)0x00E79138, &newvalue,(DWORD)sizeof(newvalue),NULL);
if(!ss) {
cout << "Failed to write the memory.." << ss << endl; Sleep(2000);
system("cls");
} else {
cout << "Memory written!.." << ss << endl; Sleep(2000);
system("cls");
}
}
}
}
}
Converting the adress to hex (i just 0xADRESS it)..
Please help me..
If my code is wrong, please give me a example..And PS: Idk why but the WriteProcessMemory is returning 0 =( now i see that..

