I tried to make a simple money hack but the console just opens and immediately closes, heres the code.
Code: Select all
#include <iostream>
#include <Windows.h>
// FindWindow();
// GetWindowThreadProcessId()
// OpenProcess();
// WriteProcessMemory();
// CloseHandle();
using namespace std;
int main()
{
int newValue = 16000;
HWND hWnd = FindWindow(0, "Counter-Strike");
if (hWnd == 0) {
cout << "Cannot find window" << endl;
}
else {
DWORD pId;
GetWindowThreadProcessId(hWnd, &pId);
HANDLE hProc = OpenProcess(PROCESS_VM_WRITE, FALSE, pId);
if (!hProc) {
cout << "Cannot open process." << endl;
}
else {
int isSuccessful = WriteProcessMemory(hProc, (LPVOID)0x14b6d20, &newValue, (DWORD)sizeof(newValue), NULL);
if (isSuccessful > 0) {
cout << "Operation succeeded";
}
else {
cout << "Operation failed";
}
CloseHandle(hProc);
}
}
return 0;
}
DIRT 3 would be perfect since i've seen a coder named "bandiitc" do all kinds of crazy stuff in the game, and upon contacting him, he told me to use cheat engine for memory reading and editing, thats what i have been doing, but im stuck because of lack of knowledge.
Looking forward to get some help.