Solved Reading multi-level pointers (c++ dll)

Hexui Undetected CSGO Cheats Sinkicheat PUBG Cheat
Status
Not open for further replies.

st4t1c

Newbie
Feb 22, 2016
4
32
0
Hi, I'm new to c++ and also this is my first post on GH.

I need to modify a few multi-level pointers' values

The project is a dll

I did the following with 1 level pointers:
C++:
*(DWORD*)(base + structure.offset) = 1337; //base: DWORD base = *(DWORD*)structure.baseAddr.

But how do I do the same with multi-level pointers?
for example,
offset1 is 0xF4, offset2 is 0x34
Explain plox! Thanks!
 
Last edited:

Rake

Cesspool Admin
Administrator
Jan 21, 2014
12,073
78,998
2,371
Example:
C++:
int * weaponNum = (int*)((*(DWORD*)((*(DWORD*)(0x509B74)) + 0x374)) + 0x4);
0x509B74 = Base Address
0x374 = First Offset
0x4 = Second Offset
You just dereference, add offset and dereference again.

I generally never do it like this, I just ReClass it and then you only need 1 pointer assignment:
C++:
class weapon
{
public:
    char pad_0x0000[0x4]; //0x0000
    __int32 weaponNum; //0x0004 //DING DING
    playerent * owner; //0x0008
    DWORD * guninfo; //0x000C
    int * ammo2; //0x0010
    int * ammo; //0x0014
    int * gunWait;
    int shots;
    int breload;
};


class playerent
{
public:
    char _0x0000[4];
    vec vHead; //0x0004
    char _0x0010[36];
    vec vLocation; //0x0034
    vec vViewAngle; //0x0040
    char _0x004C[37];
    BYTE bScoping; //0x0071
    char _0x0072[134];
    __int32 health; //0x00F8
    __int32 armor; //0x00FC
    char _0x0100[292];
    BYTE bAttacking; //0x0224
    char name[16]; //0x0225
    char _0x0235[247];
    BYTE team; //0x032C
    char _0x032D[11];
    BYTE state; //0x0338
    char _0x0339[59];
    weapon* weapon; //0x0374 //DING DING
    char _0x0378[520];
};
C++:
playerent * localPlayer = (playerent*)*(DWORD*)(0x509B74);
How to Hack Any Game pt 2 Rake
 
Last edited:
Status
Not open for further replies.
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