Hello!... Again
Alright, so i was trying to make my first WoW hack but got some problems! I think VirtualProtectEx is the thing thats wrong, i dont get it:confused: Here is my code :
Code:
#include <windows.h>
#include <tlhelp32.h>
#include <iostream>
#include <cstring>
using namespace std;
int main()
{
LONG address = 0x008D6080;
int newvalue = 18;
HWND hwnd;
HANDLE phandle;
DWORD pid;
hwnd = FindWindow(NULL, "World of Warcraft");
if (hwnd != 0)
{
cout << "World of Warcraft found...";
GetWindowThreadProcessId(hwnd, &pid);
phandle = OpenProcess(PROCESS_ALL_ACCESS, 0, pid);
}
else
{
Sleep(500);
main();
}
if(phandle != 0)
{
while(true)
{
cout << "Injection found...";
WriteProcessMemory(phandle, (LPVOID) address, (LPVOID) &newvalue, sizeof(newvalue), 0);
VirtualProtectEx(phandle, (LPVOID) address, sizeof(newvalue), PAGE_READWRITE, &pid);
WriteProcessMemory(phandle, (LPVOID) address, (LPVOID) &newvalue, sizeof(newvalue), 0);
cout << "Injection Complete...";
Sleep(1000);
}
}
cin.get();
return 0;
}