Results 1 to 7 of 7
  1. #1
    KimJohnUn's Avatar
    Join Date
    Jun 2016
    Gender
    male
    Posts
    12
    Reputation
    10
    Thanks
    1
    My Mood
    Sad

    (c++) (external) How to I connect a pointer and an offset

    Hello yall,

    I am having trouble binding the pointer and the offset in c++

    The game I am trying to hack is Assault Cube

    What am I doing wrong???

    Code:
    // MemoryEditing.cpp : Defines the entry point for the console application.
    //
    
    #include "stdafx.h"
    #include<iostream>
    #include<Windows.h>
    #include<string>
    
    using namespace std;
    
    
    int main()
    {
    	DWORD localplayer = 0x00509b74;
    	DWORD health = 0xF8;
    	SetConsoleTitle(_T("AssaultCube Exploit"));
        //int readTest = 0;
    	HWND hwnd = FindWindowA(NULL, "AssaultCube");
    	if (hwnd == NULL)
    	{
    		cout << "Cannot find Window." << endl;
    		Sleep(3000);
    		exit(-1);
    	}
    	else
    	{
    		DWORD procID;
    		GetWindowThreadProcessId(hwnd, &procID);
    		HANDLE handle = OpenProcess(PROCESS_ALL_ACCESS, FALSE, procID);
    		if (procID = NULL)
    		{
    			cout << "Cannot find Process." << endl;
    			Sleep(3000);
    			exit(-1);
    		}
    		else
    		{
    			int CurrentAdress = 0;
    			ReadProcessMemory(handle, (PBYTE)(localplayer) + health, &CurrentAdress, sizeof(CurrentAdress), 0);
    			//cout << "The view value was set to ";
    			cout << CurrentAdress << endl;
    			system("pause");
    			cout << CurrentAdress << endl;
    		}
    	}
        return 0;
    }
    Regards,

  2. #2
    Hell_Demon's Avatar
    Join Date
    Mar 2008
    Gender
    male
    Location
    I love causing havoc
    Posts
    3,976
    Reputation
    343
    Thanks
    4,320
    My Mood
    Cheeky
    You will have to read the pointer first, add the offset to the value you have read and then read from there to get health.
    Ah we-a blaze the fyah, make it bun dem!

  3. #3
    KimJohnUn's Avatar
    Join Date
    Jun 2016
    Gender
    male
    Posts
    12
    Reputation
    10
    Thanks
    1
    My Mood
    Sad

    Example

    Quote Originally Posted by Hell_Demon View Post
    You will have to read the pointer first, add the offset to the value you have read and then read from there to get health.
    Please may I have an example

  4. #4
    gogogokitty's Avatar
    Join Date
    Feb 2013
    Gender
    male
    Posts
    1,090
    Reputation
    113
    Thanks
    3,503
    Quote Originally Posted by KimJohnUn View Post
    Please may I have an example
    this is the function i made to find the pointers, this ones for ammo. uses a for loop, reads the base address/ammoAddr, then takes what it read and adds the first position of the ammoOff array which is 374 and reads it again, then adds the second element of the array which is 14, reads again and then adds 0 and its done. ammoAddr now has the address needed for the array
    Code:
    void getPointers(HANDLE hHandle, DWORD& ammoAddress)
    {
    	DWORD ammoAddr = 0X00509B74;
    	DWORD ammoOff[3] = { 0x374, 0x14, 0x0 };
    	int ammoArrySize = sizeof(ammoOff) / sizeof(ammoOff[0]);
    
    	for (int i = 0; i < ammoArrySize; i++)
    	{
    		ReadProcessMemory(hHandle, (LPCVOID)ammoAddr, &ammoAddr, sizeof(ammoAddr), NULL);
    		ammoAddr += ammoOff[i];
    	}
    	ammoAddress = ammoAddr;
    }
    Last edited by gogogokitty; 02-25-2018 at 04:01 PM.
    LEEEEEEROY JEEEEENKINS

  5. The Following User Says Thank You to gogogokitty For This Useful Post:

    Hell_Demon (02-26-2018)

  6. #5
    Archx64's Avatar
    Join Date
    Apr 2018
    Gender
    male
    Posts
    89
    Reputation
    10
    Thanks
    302
    My Mood
    Cool
    With using Pointer AND Offset you have to go deep, the most are doing Pointer + Offset but thats false because that would cause changing the pointer itself and would NOT work there will be no error but it doesnt work.
    This is really working its my code for a game it took me some time when i did this first time

    Last edited by Archx64; 04-22-2018 at 02:38 AM.

  7. #6
    gogogokitty's Avatar
    Join Date
    Feb 2013
    Gender
    male
    Posts
    1,090
    Reputation
    113
    Thanks
    3,503
    Quote Originally Posted by Archx64 View Post
    With using Pointer AND Offset you have to go deep, the most are doing Pointer + Offset but thats false because that would cause changing the pointer itself and would NOT work there will be no error but it doesnt work.
    This is really working its my code for a game it took me some time when i did this first time

    then why does the other method work then eh?
    LEEEEEEROY JEEEEENKINS

  8. #7
    affe2626's Avatar
    Join Date
    Apr 2015
    Gender
    male
    Location
    Sweden
    Posts
    552
    Reputation
    146
    Thanks
    151
    My Mood
    Angelic
    Code:
    // MemoryEditing.cpp : Defines the entry point for the console application.
    //
    
    #include "stdafx.h"
    #include<iostream>
    #include<Windows.h>
    #include<string>
    
    using namespace std;
    
    
    int main()
    {
    	DWORD localplayer = 0x00509b74;
    	DWORD health = 0xF8;
    	SetConsoleTitle(_T("AssaultCube Exploit"));
        //int readTest = 0;
    	HWND hwnd = FindWindowA(NULL, "AssaultCube");
    	if (hwnd == NULL)
    	{
    		cout << "Cannot find Window." << endl;
    		Sleep(3000);
    		exit(-1);
    	}
    	else
    	{
    		DWORD procID;
    		GetWindowThreadProcessId(hwnd, &procID);
    		HANDLE handle = OpenProcess(PROCESS_ALL_ACCESS, FALSE, procID);
    		if (procID = NULL)
    		{
    			cout << "Cannot find Process." << endl;
    			Sleep(3000);
    			exit(-1);
    		}
    		else
    		{
    			int CurrentAdress = 0;
                            uintptr_t local_player = nullptr;
                            ReadProcessMemory(handle, (PBYTE)(localplayer), &local_player, sizeof(CurrentAdress), 0);
    			ReadProcessMemory(handle, (PBYTE)(local_player + health), &CurrentAdress, sizeof(CurrentAdress), 0);
    			//cout << "The view value was set to ";
    			cout << CurrentAdress << endl;
    			system("pause");
    			cout << CurrentAdress << endl;
    		}
    	}
        return 0;
    }
    You need to read game + localplayer offset to get localplayer.

    Always PM me when trading, I've been hacked on my Skype previously
    [img]https://**********.com/addskype/affe2626.png[/img]

Similar Threads

  1. How to get X,Y,Z and Mount Offsets?
    By TroveFarming in forum Trove Coding & Resources
    Replies: 0
    Last Post: 10-25-2017, 11:57 AM
  2. [Solved] How do I find Player Pointer & Ghost Mode Offset?
    By Heiko88 in forum Blackshot Help
    Replies: 8
    Last Post: 01-18-2017, 01:45 AM
  3. [Help Request] How to find NoFallDMG POINTER and NoFallDMG OFFSET??
    By 159753cado25 in forum Crossfire Coding Help & Discussion
    Replies: 2
    Last Post: 10-07-2016, 06:58 AM
  4. How can i find enemy pointer
    By joered in forum Combat Arms Hack Coding / Programming / Source Code
    Replies: 15
    Last Post: 08-10-2010, 02:05 AM
  5. i know how to fix connection server has ended thing
    By hack3r940 in forum Combat Arms Hacks & Cheats
    Replies: 1
    Last Post: 01-03-2009, 10:02 PM