[C++ HELP] Console Trainer

04/24/2011 11:41 Andrea1234567890#1
Hi guys,
I need help for console trainer. When I open the process to inject the trainer, it hides but doesn't change the values. If I suspend the process and I open the trainer, change the value, but If I don't suspend the process doesn't change the values...

This is the code, thank's for your help anybody answer...

PHP Code:
#include <Windows.h>
#include <stdio.h>
#include <cstdlib>
#include <iostream>
#include <tlhelp32.h>
#include <string>
#include <Psapi.h>

#pragma comment(lib,"psapi.lib")

using namespace std;

DWORD GetProcessIdByName(WCHARszExeName);
bool isRunning(string pName);

DWORD VARIABLE1 0x123456// HIDDEN
DWORD VARIABLE2 0x123456//HIDDEN
HANDLE hProcess NULL;
DWORD dwProcessId 0;

DWORD GetProcessIdByName(WCHARszExeName)
{
    
PROCESSENTRY32 pe = { sizeof(PROCESSENTRY32) };
    
HANDLE hSnapshot CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS0);

    if(
Process32First(hSnapshot, &pe))
    {
        while(
Process32Next(hSnapshot, &pe))
        { 
            if(!
wcscmp(pe.szExeFileszExeName))
            { 
                return 
pe.th32ProcessID;
            }
        }
    }

    return 
NULL;
}

bool isRunning(string pName)
{
 
unsigned long aProcesses[1024], cbNeededcProcesses;
 if(!
EnumProcesses(aProcessessizeof(aProcesses), &cbNeeded))
  return 
false;

  
cProcesses cbNeeded sizeof(unsigned long);
   for(
unsigned int i 0cProcessesi++)
   {
    if(
aProcesses[i] == 0)
   continue;

  
HANDLE hProcess OpenProcess(PROCESS_QUERY_INFORMATION PROCESS_VM_READ0aProcesses[i]);
  
char buffer[50];
  
GetModuleBaseNameA(hProcess0buffer50);
  
CloseHandle(hProcess);
  if(
pName == string(buffer))
   return 
true;
  }
 return 
false;
}

int main()
{
    
system("color a");
    
cout << "**************************\n"
            "Welcome to Unknown Project\n"
            "**************************\n\n"
            "Waiting for S4Client.exe...\n"
;
  
    while(
isRunning("S4Client.exe")==false){}
        
    
cout << "S4Client found\n";
    
cout << "Writing...";
        
Sleep(500);

        
dwProcessId GetProcessIdByName(L"S4Client.exe"); 

        if(
dwProcessId == 0) { return 0; }
        
        
hProcess OpenProcess(PROCESS_ALL_ACCESSfalsedwProcessId);

        
DWORD Value1 /* HIDDEN */;
        
DWORD Value2 /* HIDDEN */;
        
WriteProcessMemory(hProcess,(LPVOID)VARIABLE1,(LPVOID)&Value1,sizeof(&Value1),NULL);
        
WriteProcessMemory(hProcess,(LPVOID)VARIABLE2,(LPVOID)&Value2,sizeof(&Value2),NULL);

04/24/2011 13:37 MrSm!th#2
i am sure it is the protection of the xtrap driver
04/24/2011 13:48 Andrea1234567890#3
But Project HarmonY work, why? It's bypassed?
04/24/2011 13:53 MrSm!th#4
it has a technique to get around this