Hi, here is a program I wrote for starcraft 2 in Visual Studio C++ 2012;
When I'm in game and i find a value in CE and paste it in my code just to see if it works it says that my value is injected but in game nothing really changes, any ideas ?
Code:
#include <iostream>#include <windows.h>
using namespace std;
int main()
{
HWND sc2_window = FindWindow(0, ("StarCraft II"));
HANDLE hProcess;
DWORD programid;
int newValue = 900;
if (!sc2_window)
{
cout << "Cannot find Starcraft II window!" <<endl;
}else
{
cout << "Starcraft II window found!" << endl;
}
if (sc2_window)
{
DWORD programid;
GetWindowThreadProcessId(sc2_window, &programid);
cout << "ProgramID: ";
cout << (programid) << endl;
HANDLE handler_process = OpenProcess(PROCESS_ALL_ACCESS, FALSE, programid);
if (!handler_process)
{
cout << "Cannot open Starcraft II process!" << endl;
}else
{
cout << "Starcraft II process opened, writing memory ..." << endl;
int isSuccessful = WriteProcessMemory(handler_process, (LPVOID)0x35E8460, &newValue, (DWORD)sizeof(newValue), NULL);
if (isSuccessful > 0)
{
cout << "Memory Adress Successfully Writen!" << endl;
}else
{
cout << "Cannot Write Memory Address!" << endl;
}
}
}
cin.get();
return 0;
}