Originally Posted by
Isaakske
As far as i know we dont have a memory class in C++ yet ?
Need to check doh
Because mem editing in C++ is not as obscure as C#? =P
But if the kids need a class..
Code:
class Memory
{
HANDLE Process;
public:
Memory(const char* Windowname)
{
HWND hwnd;
DWORD ProcessID;
while(!(hwnd = FindWindow(Windowname, NULL)))
if(hwnd = FindWindow(NULL, Windowname))
break;
else
Sleep(10);
while(!(GetWindowThreadProcessId(hwnd,&ProcessID)))
Sleep(10);
while(!(Process = OpenProcess(PROCESS_ALL_ACCESS,false,ProcessID)))
Sleep(10);
}
bool Write(void *Address, void *Value)
{
return WriteProcessMemory(Process, Address, Value, sizeof(Value), 0);
}
bool Read(void *Address, void *Buffer, size_t Length)
{
return ReadProcessMemory(Process, Address, Buffer, Length, 0);
}
};