Solved How do I add in the offset for health, with the player object adress

Hexui Undetected CSGO Cheats Sinkicheat PUBG Cheat
Oct 23, 2015
4
334
0
C++:
int nVal = 9999;
			HWND hwndMem = FindWindow(0, "AssaultCube");
			if (hwndMem == 0) {
				cout << "Couldn't find window" << endl;
			}
			else {
				cout << "Window found" << endl;
				DWORD PID;
				GetWindowThreadProcessId(hwndMem, &PID);
				HANDLE hProc = OpenProcess(PROCESS_ALL_ACCESS, false, PID);
				if (!hProc) {
					cout << "Could not open process" << endl;
				}
				else {
					int stat = WriteProcessMemory(hProc, (LPVOID)0x0245A1C0, &nVal, (DWORD)sizeof(nVal), NULL);
					if (stat > 0) {
						clog << "Memory written to process." << endl;
					}
					else {
						cerr << "Memory couldn't be written to process." << endl;
					}
					CloseHandle(hProc);
				}
			}
So, this line:
C++:
int stat = WriteProcessMemory(hProc, (LPVOID)0x0245A1C0, &nVal, (DWORD)sizeof(nVal), NULL);
Don't bother about the memory adress I put there, it's a dynamic one I used to test this. So what would I put in there (after (LPVOID)) ? I'm trying to get the health, and I got the player object adress, and the offset is F8, how would I do this?
 

Rake

Cesspool Admin
Administrator
Jan 21, 2014
12,205
78,998
2,400
int stat = WriteProcessMemory(hProc, (LPVOID)0x0245A1C0, &nVal, (DWORD)sizeof(nVal), NULL);
Hello John “Captainâ€￾ Silver from youtube, I'm glad you decided to make a post!

First off, please use "
C++:
 tags" when posting code, I have edited your post for you.  This is what you would want to do:

[code=cpp]
DWORD playerObjectAddress = 0xhhhhhhh;
DWORD healthOffset  = 0xh;

int stat = WriteProcessMemory(hProc, (LPVOID)(playerObjectAddress + healthOffset), &nVal, (DWORD)sizeof(nVal), NULL);
or alternatively with less code:

C++:
int stat = WriteProcessMemory(hProc, (LPVOID)(0xhhhhh +0xh), &nVal, (DWORD)sizeof(nVal), NULL);
and here is an example class method I was using in my external aimbot as an example

C++:
class playerClass
{
public:
    UINT_PTR PlayerAddress;
    char Name[16];
    BYTE Team;
    int Health;
    BYTE State;
    Vec3Pos vLocation;
    Vec3Angle vCurrentAngle;
    Vec3Angle vAimbotAngles;
    float Distance;
    float fCrosshairToTargetAngle;
    bool bWeaponSemiAuto = 0;

    //default constructor for local player
    playerClass()
    {
        PlayerAddress = Hack.localPlayerAddr;
        ReadProcessMemory(hProcHandle, (LPCVOID)(PlayerAddress + 0x225), &Name, 16, NULL);
        ReadProcessMemory(hProcHandle, (LPCVOID)(PlayerAddress + 0x32c), &Team, 1, NULL);
        ReadProcessMemory(hProcHandle, (LPCVOID)(PlayerAddress + 0xF8), &Health, 4, NULL);
        ReadProcessMemory(hProcHandle, (LPCVOID)(PlayerAddress + 0x34), &vLocation, 12, NULL);
        ReadProcessMemory(hProcHandle, (LPCVOID)(PlayerAddress + 0x338), &State, 1, NULL);
        ReadProcessMemory(hProcHandle, (LPCVOID)(PlayerAddress + 0x40), &vCurrentAngle, 12, NULL);//
    }

}localPlayer;
How To Hack Any Game 1 Solaire

How to Hack Any Game pt 2 Rake

Pointer Scanning Like a Boss

How to find Entity List Assault Cube
 
Last edited:
Oct 23, 2015
4
334
0
Rake;37517 said:
Hello John “Captainâ€￾ Silver from youtube, I'm glad you decided to make a post!

First off, please use "
C++:
 tags" when posting code, I have edited your post for you.  This is what you would want to do:

[code=cpp]
DWORD playerObjectAddress = 0xhhhhhhh;
DWORD healthOffset  = 0xh;

int stat = WriteProcessMemory(hProc, (LPVOID)(playerObjectAddress + healthOffset), &nVal, (DWORD)sizeof(nVal), NULL);
or alternatively with less code:

C++:
int stat = WriteProcessMemory(hProc, (LPVOID)(0xhhhhh +0xh), &nVal, (DWORD)sizeof(nVal), NULL);
and here is an example class method I was using in my external aimbot as an example

C++:
class playerClass
{
public:
	UINT_PTR PlayerAddress;
	char Name[16];
	BYTE Team;
	int Health;
	BYTE State;
	Vec3Pos vLocation;
	Vec3Angle vCurrentAngle;
	Vec3Angle vAimbotAngles;
	float Distance;
	float fCrosshairToTargetAngle;
	bool bWeaponSemiAuto = 0;

	//default constructor for local player
	playerClass()
	{
		PlayerAddress = Hack.localPlayerAddr;
		ReadProcessMemory(hProcHandle, (LPCVOID)(PlayerAddress + 0x225), &Name, 16, NULL);
		ReadProcessMemory(hProcHandle, (LPCVOID)(PlayerAddress + 0x32c), &Team, 1, NULL);
		ReadProcessMemory(hProcHandle, (LPCVOID)(PlayerAddress + 0xF8), &Health, 4, NULL);
		ReadProcessMemory(hProcHandle, (LPCVOID)(PlayerAddress + 0x34), &vLocation, 12, NULL);
		ReadProcessMemory(hProcHandle, (LPCVOID)(PlayerAddress + 0x338), &State, 1, NULL);
		ReadProcessMemory(hProcHandle, (LPCVOID)(PlayerAddress + 0x40), &vCurrentAngle, 12, NULL);//
	}

}localPlayer;
C++:
int stat = WriteProcessMemory(hProc, (LPVOID)(0x0050F4F4 + 0xF8), &nVal, (DWORD)sizeof(nVal), NULL);
Nothing happened, I'm doing this in assaultcube. Trying to change the health of the player.. No errors, it just didn't change the value..
 

Rake

Cesspool Admin
Administrator
Jan 21, 2014
12,205
78,998
2,400
0x0050F4F4 isn't the player object it's a pointer to the player object.

This is what you have to do:

C++:
DWORD localPlayer = 0;

ReadProcessMemory(hProc, (LPCVOID)(0x0050F4F4), &localPlayer, (DWORD)sizeof(nVal), NULL);
WriteProcessMemory(hProc, (LPVOID)(localPlayer + 0xF8), &nVal, (DWORD)sizeof(nVal), NULL);
Also I do suggest reading all the threads on GH, this topic has been explained 100's of times, but do feel free to post question also
 
Oct 23, 2015
4
334
0
Rake;37519 said:
0x0050F4F4 isn't the player object it's a pointer to the player object.

This is what you have to do:

C++:
DWORD localPlayer = 0;

ReadProcessMemory(hProc, (LPCVOID)(0x0050F4F4), &localPlayer, (DWORD)sizeof(nVal), NULL);
WriteProcessMemory(hProc, (LPVOID)(localPlayer + 0xF8), &nVal, (DWORD)sizeof(nVal), NULL);
Also I do suggest reading all the threads on GH, this topic has been explained 100's of times, but do feel free to post question also

So, how do you know this was the player object POINTER, because there was no "P>" showing to the adress in CE.. When I look in the data struct, it has the info about the player..
 
Attention! Before you post:

Read the How to Ask Questions Guide
99% of questions are answered in the Beginner's Guide, do it before asking a question.

No Hack Requests. Post in the correct section.  Search the forum first. Read the rules.

How to make a good post:

  • Fill out the form correctly
  • Tell us the game name & coding language
  • Post everything we need to know to help you
  • Ask specific questions, be descriptive
  • Post errors, line numbers & screenshots
  • Post code snippets using code tags
  • If it's a large project, zip it up and attach it

If you do not comply, your post may be deleted.  We want to help, please make a good post and we will do our best to help you.

Community Mods