paulomendes1 How do I cheat?
Reputation: 0
Joined: 10 May 2016 Posts: 2
|
Posted: Fri May 13, 2016 6:25 pm Post subject: How I do a loop for when he finds GAMEOF in memory |
|
|
How I do a loop for when he finds GAMEOF in memory of the process
it takes 200 characters before and puts on a string.
#include <iostream>
#include <iomanip>
#include <windows.h>
#include <tlhelp32.h>
#include <shlwapi.h>
#include <shlobj.h>
#include <fstream>
#define ReadLimit 100*4096 //6 zeroes - for ReadProcessMemory
#define StaticCacheSize 2*40000
using namespace std;
int main()
{
char* value = new char[79];
HANDLE hProcess, hProcesses;
MEMORY_BASIC_INFORMATION MBI;
BYTE *Buf, pGlobalBuf;
DWORD ReadAddr, QueryAddr, BytesRead, BufSize;
ofstream meuArquivo;
// OpenProcess
HANDLE phandle = OpenProcess(PROCESS_VM_READ | PROCESS_QUERY_INFORMATION,
0,
28104);
// verifica se o soft está em execução
if (!phandle)
{
cout << "Programa não está em execução!";
}
QueryAddr = 0;
while (1)
{ //Enumerate process memory regions
VirtualQueryEx(phandle, (LPVOID) QueryAddr, &MBI, sizeof(MBI)); //if its bigger than 1 0 000 000 bytes, read only that amount
if (MBI.BaseAddress == 0 && QueryAddr != 0)
{
break;
} //memory regions finished
QueryAddr += (DWORD) MBI.RegionSize;
if (MBI.Protect & PAGE_NOACCESS || MBI.Protect & PAGE_GUARD /*|| MBI.Protect&PAGE_EXECUTE || MBI.Protect&PAGE_EXECUTE_READ || MBI.State&MEM_FREE*/)
{
continue;
}
ReadAddr = 0;
while (MBI.RegionSize > 0)
{
if (ReadAddr != 0)
{
ReadAddr += ReadLimit;
}
else
{
ReadAddr = (DWORD) MBI.BaseAddress;
}
if (MBI.RegionSize > ReadLimit)
{
BufSize = ReadLimit;
MBI.RegionSize -= ReadLimit;
}
else
{
BufSize = MBI.RegionSize;
MBI.RegionSize = 0;
}
BytesRead = 0;
ReadProcessMemory(phandle,
(LPVOID) ReadAddr,
&value[0],
BufSize,
&BytesRead);
}
}
return 0;
}
|
|