Thread: C++ Problem

Results 1 to 2 of 2
  1. #1
    xceman's Avatar
    Join Date
    Aug 2011
    Gender
    male
    Posts
    35
    Reputation
    10
    Thanks
    2
    My Mood
    Doh

    C++ Problem

    Hey,
    I made long time ago a project for hack in console.
    I tried to update it,but it's doesn't work o.o

    here source
    Code:
    #include <Windows.h>
    #include <stdio.h>
    #include <cstdlib>
    #include <iostream>
    #include <tlhelp32.h>
    #include <string>
    #include <fstream>
    #include <Psapi.h>
    
    #pragma comment(lib,"psapi.lib")
    
    using namespace std;
    
    DWORD GetProcessIdByName(WCHAR* szExeName);
    bool isRunning(string pName);
    
    DWORD addy = 0x00712801;
    
    HANDLE hProcess = NULL;
    DWORD dwProcessId = 0;
    int infblock;
    
    DWORD GetProcessIdByName(WCHAR* szExeName)
    {
        PROCESSENTRY32 pe = { sizeof(PROCESSENTRY32) };
        HANDLE hSnapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
    
        if(Process32First(hSnapshot, &pe))
        {
            while(Process32Next(hSnapshot, &pe))
            { 
                if(!wcscmp(pe.szExeFile, szExeName))
                { 
                    return pe.th32ProcessID;
                }
            }
        }
    
        return NULL;
    }
    
    bool isRunning(string pName)
    {
     unsigned long aProcesses[1024], cbNeeded, cProcesses;
     if(!EnumProcesses(aProcesses, sizeof(aProcesses), &cbNeeded))
      return false;
    
      cProcesses = cbNeeded / sizeof(unsigned long);
       for(unsigned int i = 0; i < cProcesses; i++)
       {
        if(aProcesses[i] == 0)
       continue;
    
      HANDLE hProcess = OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, 0, aProcesses[i]);
      char buffer[50];
      GetModuleBaseNameA(hProcess, 0, buffer, 50);
      CloseHandle(hProcess);
      if(pName == string(buffer))
       return true;
      }
     return false;
    }
    
    int main()
    {
    	SetConsoleTitleA("xCeManx Hack");
    
    	system("color a");
    
    		cout <<	"Hackhackhackhack!"
    			"1 = enable 0 = disable\n";
    
    		printf("\n~Block hack ");
    		scanf_s("%d", &infblock);
    
    		cout << "\nOk, now wait for S4Client.exe ...";
    
      while(isRunning("S4Client.exe")==false){}
    
      if(infblock == 1)
      {
    	  
    		dwProcessId = GetProcessIdByName(L"S4Client.exe"); 
    
            if(dwProcessId == 0) { return 0; }
    
            hProcess = OpenProcess(PROCESS_ALL_ACCESS, false, dwProcessId);
    
    		DWORD Value1 = 4170025729;
    		WriteProcessMemory(hProcess,(LPVOID)addy,(LPVOID)&Value1,sizeof(&Value1),NULL);
    
    
      } else if(infblock == 0){}
    }
    even if i delete those zero from addy
    Last edited by xceman; 01-10-2012 at 11:11 AM.
    "I wanna know if you like me, girl
    Give me sugar and honey
    No, we don't need any money
    We love each other
    'Cause love is for free
    Your love is for free, yeah
    Love is for free
    Your love is for free"

  2. #2
    258456's Avatar
    Join Date
    May 2010
    Gender
    male
    Location
    ghjghj
    Posts
    1,222
    Reputation
    18
    Thanks
    300
    My Mood
    Relaxed
    Well we would have to know which game and it sounds like you just need to get the new addresses. If you want to further your skills also try making a dll and inject it into the process so that you don't have to use WriteProcessMemory which is highly detectable and api's stick out in disassembly.

Similar Threads

  1. To All GunZ Down 02-07-06 PROBLEM
    By WertyRO in forum Gunz General
    Replies: 18
    Last Post: 02-09-2006, 07:41 PM
  2. Problem
    By lambda in forum Gunz General
    Replies: 3
    Last Post: 02-08-2006, 11:36 AM
  3. hacking problems
    By iwillkillyou in forum WarRock - International Hacks
    Replies: 11
    Last Post: 02-04-2006, 04:37 PM
  4. WPE problem...
    By styx23 in forum General Game Hacking
    Replies: 8
    Last Post: 01-18-2006, 07:51 PM
  5. Problem Wit Hacking Programs
    By f5awp in forum General Gaming
    Replies: 5
    Last Post: 01-10-2006, 05:44 AM