How To Keep An Addy Static [Solved]

Posts 1–4 of 4 · Page 1 of 1
How To Keep An Addy Static [Solved]
I've been wanting to code hacks as a sort of hobby to improve my usage of C++. I decided to begin with AssaultCube due to it having not anti-cheat protection such as PunkBuster. I used Ollydbg to disassemble the ac_client.exe and found the addy for health easily. I then just freezed the value by NOPing the line that changed the value. One problem though was this address changes every time I start up assaultcube as expected. How would I keep track of this value? I want my program to find this value next time it starts up. What would be the best way to write a DLL that patches memory values of the game?
I found this in the Combat Arms section:
Code:
#include <windows.h>
void testTH()
{
	MessageBoxA(NULL, "This is my MsgBox WOO :D", "My MsgBox", MB_OK);
}

BOOL WINAPI DllMain ( HMODULE hDll, DWORD dwReason, LPVOID lpReserved )
{
	DisableThreadLibraryCalls(hDll);
	if ( dwReason == DLL_PROCESS_ATTACH )
	{
		CreateThread(0, 0, (LPTHREAD_START_ROUTINE)testTH, 0, 0, 0);

	}

	return TRUE;
}
Would it be a good method to make a hack for any type of game?
I don't have a lot of experience with "Game Hacking" just other type of hacking. Keyloggers..
No I am not a "Hax0r" I don't C&P
Sorry if my English is bad I speak German and Spanish more Fluently
You can find the pointer to the player class that contains the health address. Pointers are usually static (unless you have pointers to pointers in which this becomes a nuisance), and they point to a specific memory location that can dynamically change. In this case, the static memory location is in fact a pointer to a pointer.
Code:
class playerstate
{
public:
    int health, armour;
    int primary, nextprimary;
    int gunselect;
    bool akimbo;
    int ammo[NUMGUNS], mag[NUMGUNS], gunwait[NUMGUNS];
This is a short exert from the PlayerState class found in Assault Cube. The static address of the pointer that points to the pointer that points to the player is 0x004E4DBC i believe. If you get the source code for AC, you can include all the headers in AC and put them in your project and use the classes as references. Take a look at the AC tutorial's if you need help.
Quote Originally Posted by zhaoyun333 View Post
You can find the pointer to the player class that contains the health address. Pointers are usually static (unless you have pointers to pointers in which this becomes a nuisance), and they point to a specific memory location that can dynamically change. In this case, the static memory location is in fact a pointer to a pointer.
Code:
class playerstate
{
public:
    int health, armour;
    int primary, nextprimary;
    int gunselect;
    bool akimbo;
    int ammo[NUMGUNS], mag[NUMGUNS], gunwait[NUMGUNS];
This is a short exert from the PlayerState class found in Assault Cube. The static address of the pointer that points to the pointer that points to the player is 0x004E4DBC i believe. If you get the source code for AC, you can include all the headers in AC and put them in your project and use the classes as references. Take a look at the AC tutorial's if you need help.
Thanks I figured this out though :P
Sorry for my useless post I totally forgot about pointers xD
I never had much use for pointers until now
I'll try to contribute to the forum more though I'll make some hacks once I learn
d3d and how to "hook" it to an application.
/request close
/Closed and Marked Solved.
Posts 1–4 of 4 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Talk with us