Results 1 to 1 of 1
  1. #1
    gogogokitty's Avatar
    Join Date
    Feb 2013
    Gender
    male
    Posts
    1,090
    Reputation
    113
    Thanks
    3,503

    easy source code for modifying ammo, money, amount of items and such

    this is not mine, i just filled it in and added examples for people that are newer to c++ than me if thats even possible. credits go to PerfectsDaily
    Code:
    #include "stdafx.h"
    #include <iostream>
    #include <Windows.h>
    #pragma comment(lib, "user32.lib")
    
    using namespace std;
    
    
    int _tmain(int argc, _TCHAR* argv[])
    {
    
    	cout << "gogogokitty199's contagion ammo modifier\n"; //first display message
    	cout << " \n";
    
    	HWND hWnd = FindWindow(0, L"Contagion"); //name of the game window, example (Contagion, Dayz, ect)
    	if (hWnd == 0){
    		cout << "could not find Contagion.exe . Please verify that your game is running!\n";
    	}
    	else {
    		cout << "Found Contagion \n";
    
    		DWORD proc_id;
    		GetWindowThreadProcessId(hWnd, &proc_id);
    
    		HANDLE hProc = OpenProcess(PROCESS_ALL_ACCESS, FALSE, proc_id);
    		if (!hProc) {
    			cout << "error could not find the process \n";
    		}
    		else {
    			cout << "Opened Contagion. \n";
    			
    			DWORD Pointer = 0x018EF124;		 //change the static pointer to one of a game that you want, just an example and this isnt correct
    			DWORD Pointed;
    			WORD Offset = 0x0;		//offset for the pointer
    			int CurrentAmmo = 0;	  //read ammo, money, items ect
    			int newValue;
    
    			ReadProcessMemory(hProc, (LPCVOID)(Pointer), &Pointed, 4, NULL);
    			ReadProcessMemory(hProc, (LPCVOID)(Pointer + Offset), &CurrentAmmo, 4, NULL);
    
    			cout << "Enter your desired amount of ammo, max is 250: ";  //this is just for contagion, ammo in mag limit is 250 max
    			cin >> newValue;
    
    			int Success = WriteProcessMemory(hProc, (LPVOID)(Pointed + Offset), &newValue, (DWORD) sizeof(newValue), NULL);
    
    			if (Success > 0){
    
    				ReadProcessMemory(hProc, (LPCVOID)(Pointer), &Pointed, 4, NULL);
    				ReadProcessMemory(hProc, (LPCVOID)(Pointer + Offset), &CurrentAmmo, 4, NULL);
    				cout << "your ammo has been loaded into your mag \n";   //write success
    				cin.get();
    				cout << "Press Enter to close \n";
    			}
    			else{
    				cout << "Error could not write to process memory";        //write failed
    				cout << "Press Enter to close \n";
    				cin.get();
    				
    			}
    		}
    	}
    		cin.get();
    		return 0;
    }
    i used contagion as a base example because its easy and simple.
    Last edited by gogogokitty; 01-15-2014 at 01:42 PM.

Similar Threads

  1. My source code for all my great hacks!!!
    By ilo66 in forum CrossFire Hacks & Cheats
    Replies: 32
    Last Post: 02-26-2010, 02:02 PM
  2. Source Code for a vb Tapper
    By zmansquared in forum Combat Arms Hack Coding / Programming / Source Code
    Replies: 0
    Last Post: 01-26-2010, 10:46 AM
  3. [REQUEST]Source Code For "Remember Me" in a checkbox
    By Dreamer in forum Visual Basic Programming
    Replies: 5
    Last Post: 11-28-2009, 03:22 AM
  4. [Request] Source Code For AFK Bot 4 CA
    By JIGS4W in forum Visual Basic Programming
    Replies: 2
    Last Post: 10-06-2009, 08:33 AM
  5. Source code for any d3d/memory hack
    By Ragehax in forum C++/C Programming
    Replies: 6
    Last Post: 10-01-2009, 09:10 PM