Results 1 to 3 of 3
  1. #1
    rgw4hgreherherh's Avatar
    Join Date
    Apr 2018
    Gender
    male
    Posts
    67
    Reputation
    10
    Thanks
    184
    My Mood
    Bitchy

    C++ Godmode Source (Skid Edition)

    Compile in x64
    If you can't figure out how to use it there's no hope for you
    Code:
    #include <iostream>
    #include <stdio.h>
    #include <string>
    #include <Windows.h>
    #include <TlHelp32.h>
    using namespace std;
    __int64 GetModuleBaseAddress(LPCSTR szProcessName, LPCSTR szModuleName) {
    	HANDLE hSnap = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
    	PROCESSENTRY32 pe32;
    	if (hSnap == INVALID_HANDLE_VALUE) {
    		return 0;
    	}
    	pe32.dwSize = sizeof(PROCESSENTRY32);
    	if (Process32First(hSnap, &pe32) == 0) {
    		CloseHandle(hSnap);
    		return 0;
    	}
    	do {
    		if (lstrcmp(pe32.szExeFile, szProcessName) == 0) {
    			int PID;
    			PID = pe32.th32ProcessID;
    			HANDLE hSnap = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE, PID);
    			MODULEENTRY32 xModule;
    			if (hSnap == INVALID_HANDLE_VALUE) {
    				return 0;
    			}
    			xModule.dwSize = sizeof(MODULEENTRY32);
    			if (Module32First(hSnap, &xModule) == 0) {
    				CloseHandle(hSnap);
    				return 0;
    			}
    			do {
    				if (lstrcmp(xModule.szModule, szModuleName) == 0) {
    					CloseHandle(hSnap);
    					return (__int64)xModule.modBaseAddr;
    				}
    			} while (Module32Next(hSnap, &xModule));
    			CloseHandle(hSnap);
    			return 0;
    		}
    	} while (Process32Next(hSnap, &pe32));
    	CloseHandle(hSnap);
    	return 0;
    }
    LPCSTR GameWindow;
    LPCSTR GameID;
    HWND WindowID;
    __int64 BaseAddress;
    DWORD PID;
    HANDLE pHandle;
    byte EnableGod = 9;
    byte DisableGod = 0;
    DWORD GodOffset = 0x189;
    DWORD HealthOffset = 0x280;
    DWORD MaxHealthOffset = 0x2A0;
    DWORD ArmorOffset = 0x14B8;
    DWORD PlayerOffset = 0x8;
    DWORD WorldOffset_SocialClub = 0x23DE120; // Update on when new dlc come out
    DWORD WorldOffset_Steam = 0x23E2130; // Update on when new dlc come out
    __int64 GodAddress;
    __int64 PedAddress;
    __int64 PlayerPedAddress;
    __int64 HealthAddress;
    __int64 MaxHealthAddress;
    __int64 ArmorAddress;
    __int64 WantedAddress;
    float MaxHealth;
    float MaxArmor = 50;
    void console() {
    	HWND console = GetConsoleWindow();
    	SetWindowLong(console, GWL_STYLE, GetWindowLong(console, GWL_STYLE) & ~WS_MAXIMIZEBOX & ~WS_SIZEBOX);
    	RECT r;
    	GetWindowRect(console, &r);
    	MoveWindow(console, r.left, r.top, 500, 500, TRUE);
    	system("color d");
    }
    void load() {
    	GameWindow = "Grand Theft Auto V";
    	GameID = "GTA5.exe";
    	WindowID = FindWindow(NULL, GameWindow);
    	BaseAddress = GetModuleBaseAddress(GameID, GameID);
    	GetWindowThreadProcessId(WindowID, &PID);
    	pHandle = OpenProcess(PROCESS_ALL_ACCESS, 0, PID);
    }
    void address() {
    	ReadProcessMemory(pHandle, (void*)(BaseAddress + WorldOffset_Steam), &PedAddress, sizeof(PedAddress), NULL);
    	ReadProcessMemory(pHandle, (void*)(PedAddress + PlayerOffset), &PlayerPedAddress, sizeof(PlayerPedAddress), NULL);
    	GodAddress = (PlayerPedAddress + GodOffset);
    	HealthAddress = (PlayerPedAddress + HealthOffset);
    	MaxHealthAddress = (PlayerPedAddress + MaxHealthOffset);
    	ArmorAddress = (PlayerPedAddress + ArmorOffset);
    }
    int main() {
    	load();
    	address();
    	console();
    	while (1)
    	{
    		if (BaseAddress == 0) {
    			MessageBox(NULL, "GTA5 is not running", "Error", MB_OK);
    			return -1;
    		}
    		int choice = 0;
    		cout << "1 = Toggle Godmode" << endl;
    		byte CheckGod = 0;
    		ReadProcessMemory(pHandle, (void*)(GodAddress), &CheckGod, sizeof(CheckGod), NULL);
    		if (CheckGod == 0) {
    			cout << "Godmode = Disabled" << endl;
    		}
    		if (CheckGod == 9) {
    			cout << "Godmode = Enabled" << endl;
    		}
    		cin >> choice;
    		if (choice == 1) {
    			if (CheckGod == 0)
    				WriteProcessMemory(pHandle, (void*)GodAddress, &EnableGod, sizeof(EnableGod), NULL);
    			if (CheckGod == 9)
    				WriteProcessMemory(pHandle, (void*)GodAddress, &DisableGod, sizeof(DisableGod), NULL);
    		}
    		system("CLS");
    	}
    	return 0;
    }
    Credits:
    People who found the offsets
    My ctrl, c, and v key

  2. The Following User Says Thank You to rgw4hgreherherh For This Useful Post:

    apporently (07-30-2018)

  3. #2
    apporently's Avatar
    Join Date
    Jul 2018
    Gender
    female
    Posts
    2
    Reputation
    10
    Thanks
    0
    holy shit it actually works. thanks for the post man!

  4. #3
    handy_8's Avatar
    Join Date
    Jan 2020
    Gender
    male
    Posts
    2
    Reputation
    10
    Thanks
    0
    how bro im new here

Similar Threads

  1. [Help Request] source code editing syntax error
    By sd999444 in forum Vindictus Help
    Replies: 6
    Last Post: 06-03-2011, 12:28 PM
  2. source files edit
    By briesmonis in forum Battlefield Play4Free Hacks
    Replies: 5
    Last Post: 04-19-2011, 01:54 PM
  3. Swift Source Code [Edited]
    By jhefrey in forum CrossFire Hack Coding / Programming / Source Code
    Replies: 23
    Last Post: 03-27-2011, 09:10 AM
  4. [Source Code] Edited Sir lauwy's Source Codes
    By ovenran in forum CrossFire Hack Coding / Programming / Source Code
    Replies: 56
    Last Post: 11-03-2010, 03:11 PM
  5. [SOLVED] External Esp source code editing question
    By Demented420 in forum Call of Duty Modern Warfare 2 Help
    Replies: 6
    Last Post: 06-04-2010, 11:13 AM