here u got some frags from my waypoint bot
Code:
#include <cstdlib>
#include <iostream>
#include <Windows.h>
#include <tlhelp32.h>
#include <string.h>
#include <vcclr.h>
BOOL SetDebugPrivileges()
{
BOOL bRET = FALSE;
TOKEN_PRIVILEGES tp;
HANDLE hToken;
if (LookupPrivilegeValue(NULL, SE_DEBUG_NAME, &tp.Privileges[0].Luid))
{
if (OpenProcessToken(GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES, &hToken))
{
if (hToken != INVALID_HANDLE_VALUE)
{
tp.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;
tp.PrivilegeCount = 1;
if (AdjustTokenPrivileges(hToken, FALSE, &tp, 0, 0, 0))
bRET = TRUE;
CloseHandle(hToken);
}
}
}
return bRET;
}
DWORD ProcId = 0;
void GetProcId(const char* chara)
{
PROCESSENTRY32 pe32;
HANDLE hSnapshot = NULL;
pe32.dwSize = sizeof( PROCESSENTRY32 );
hSnapshot = CreateToolhelp32Snapshot( TH32CS_SNAPPROCESS, 0 );
if( Process32First( hSnapshot, &pe32 ) )
{
do{
if( strcmp( pe32.szExeFile, chara ) == 0 )
break;
}while( Process32Next( hSnapshot, &pe32 ) );
}
if( hSnapshot != INVALID_HANDLE_VALUE )
CloseHandle( hSnapshot );
ProcId= pe32.th32ProcessID;
}
than
Code:
SetDebugPrivileges();
char chara[]="Wow.exe";
GetProcId(chara);
process = OpenProcess(PROCESS_ALL_ACCESS, FALSE, ProcId);
ReadProcessMemory(process,(LPVOID)aClientConnection,(LPVOID)&connection,sizeof(DWORD),0);//client connection <- simply read
simply code which should help