Assault Cube Nickname Hack

Posts 1–8 of 8 · Page 1 of 1
Assault Cube Nickname Hack
What is wrong with my code? I know that the username of your player is stored in 0x4E4DBC (player pointer) + 0x219 (username offset). So I tried to write a program that would get my player's username and it just returns either nothing or "c-". Here is my code:


Code:
#include <Windows.h>
#include <iostream>

DWORD base = (DWORD) GetModuleHandleA("ac_client.exe");
char baseaddie[10];
char *name =  (char*) ((base + 0x4E4DBC) + 0x219);
BOOL APIENTRY DllMain (HINSTANCE hInst     /* Library instance handle. */ ,
                       DWORD reason        /* Reason this function is being called. */ ,
                       LPVOID reserved     /* Not used. */ )
{
    switch (reason)
    {
      case DLL_PROCESS_ATTACH:
		  sprintf(baseaddie, "%X", base);
		 MessageBoxA(NULL, baseaddie, "Base Address", MB_OK);
        MessageBoxA(NULL, name, "Username", MB_OK);
        break;

      case DLL_PROCESS_DETACH:
        break;

      case DLL_THREAD_ATTACH:
        break;

      case DLL_THREAD_DETACH:
        break;
    }

    /* Returns TRUE on success, FALSE on failure */
    return TRUE;
}
Code:
HANDLE Game = GetCurrentProcess();//In the global scope
Code:
unsigned long Adress = 0x4E4DBC + 0x219;

char * userName;

ReadProcessMemory(Game,(LPVOID)Adress,&userName,(DWORD)sizeof(userName),NULL);
Or if this 0x4E4DBC is a pointer:

Code:
unsigned long PointerAddy = 0x4E4DBC;
unsigned long Offset = 0x219;
unsigned long Adress;

ReadProcessMemory(Game,(LPVOID)PointerAddy,&Adress,(DWORD)sizeof(Adress),NULL);



char * userName;

ReadProcessMemory(Game,(LPVOID)Adress + 0x219,&userName,(DWORD)sizeof(userName),NULL);
Quote Originally Posted by winberg View Post
Code:
HANDLE Game = GetCurrentProcess();//In the global scope
Code:
unsigned long Adress = 0x4E4DBC + 0x219;

char * userName;

ReadProcessMemory(Game,(LPVOID)Adress,&userName,(DWORD)sizeof(userName),NULL);
Or if this 0x4E4DBC is a pointer:

Code:
unsigned long PointerAddy = 0x4E4DBC;
unsigned long Offset = 0x219;
unsigned long Adress;

ReadProcessMemory(Game,(LPVOID)PointerAddy,&Adress,(DWORD)sizeof(Adress),NULL);



char * userName;

ReadProcessMemory(Game,(LPVOID)Adress + 0x219,&userName,(DWORD)sizeof(userName),NULL);

First your using address with out giving it a value. And second why create a variable for the offset if your not gonna use it. But besides that looks ok.
Quote Originally Posted by 258456 View Post
What is wrong with my code? I know that the username of your player is stored in 0x4E4DBC (player pointer) + 0x219 (username offset). So I tried to write a program that would get my player's username and it just returns either nothing or "c-". Here is my code:


Code:
#include <Windows.h>
#include <iostream>

DWORD base = (DWORD) GetModuleHandleA("ac_client.exe");
char baseaddie[10];
char *name =  (char*) ((base + 0x4E4DBC) + 0x219);
BOOL APIENTRY DllMain (HINSTANCE hInst     /* Library instance handle. */ ,
                       DWORD reason        /* Reason this function is being called. */ ,
                       LPVOID reserved     /* Not used. */ )
{
    switch (reason)
    {
      case DLL_PROCESS_ATTACH:
		  sprintf(baseaddie, "%X", base);
		 MessageBoxA(NULL, baseaddie, "Base Address", MB_OK);
        MessageBoxA(NULL, name, "Username", MB_OK);
        break;

      case DLL_PROCESS_DETACH:
        break;

      case DLL_THREAD_ATTACH:
        break;

      case DLL_THREAD_DETACH:
        break;
    }

    /* Returns TRUE on success, FALSE on failure */
    return TRUE;
}
Try:

Code:
char* pPlayer = (char*)(base + 0x4E4DBC);
MessageBox( NULL, (char*)&pPlayer[0x219], "Player name", MB_OK);
That ought to work if the name at that offset is a normal C style string. Are you sure the name is just kept in the player struct and that it's not a pointer to the name?

because if that's the case you could try this:

Code:
char* pPlayer = (char*)(base + 0x4E4DBC);
char* Name = (char*)pPlayer[0x219];
MessageBox( NULL, Name , "Player name", MB_OK);
It is just popping up blank in the messagebox when i used ur way schim. When i went to the address that the pointer is pointing to this is the command:

inc esi


It isn't a loop or anything so i don't understand how i am going to access it. I can change my name with cheat engine but other than that i can't do it with a program.
Quote Originally Posted by 258456 View Post
It is just popping up blank in the messagebox when i used ur way schim. When i went to the address that the pointer is pointing to this is the command:

inc esi


It isn't a loop or anything so i don't understand how i am going to access it. I can change my name with cheat engine but other than that i can't do it with a program.
If you're sure it's data at that point, you should right click->analyze code->threat selected data as bytes. See if the offset is correctly parsed.
Quote Originally Posted by .::SCHiM::. View Post
If you're sure it's data at that point, you should right click->analyze code->threat selected data as bytes. See if the offset is correctly parsed.
It doesn't even give me that option. If anyone has a copy of assault cube can you check it out please. The local player struct is at (baseaddress of ac_client.exe + 0x4E4DBC) and the offset of the name is 0x219.
Quote Originally Posted by wtfiwantthatname View Post
First your using address with out giving it a value. And second why create a variable for the offset if your not gonna use it. But besides that looks ok.
It was just a snippet.
And here ReadProcessMemory(Game,(LPVOID)PointerAddy,&Adress ,(DWORD)sizeof(Adress),NULL); i assign the adress.

Have you tried a std::string or a LPCSTR instead of char?
Posts 1–8 of 8 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Talk with us