Solved Can't write to pointer with offset directly

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

petruherro

Newbie
Full Member
Mar 10, 2016
17
104
0
I can't write to a pointer + a offset, i think it doesn't give me the correct address. this is the code i use:
C++:
float value = 10;
WriteProcessMemory(handle, (LPVOID)(0xB6F5F0 + 0x540), &value, sizeof(float), NULL);
However, when i take the address pointed by the pointer + offset in Cheat Engine and i replace it here it works ( the address pointed in cheat engine changes when i restart the game) :
I have no problem writing to a direct address.
0xB6F5F0 -> pointer
0x540 -> offset
 
Last edited:

Rake

Cesspool Admin
Administrator
Jan 21, 2014
12,185
78,998
2,399
I can't write to a pointer + a offset, i think it doesn't give me the correct address. this is the code i use:
C++:
float value = 10;
WriteProcessMemory(handle, (LPVOID)(0xB6F5F0 + 0x540), &value, sizeof(float), NULL);
However, when i take the address pointed by the pointer + offset in Cheat Engine and i replace it here it works ( the address pointed in cheat engine changes when i restart the game) :
I have no problem writing to a direct address.
0xB6F5F0 -> pointer
0x540 -> offset
You have to ReadProcessMemory on the pointer base address, get the result and then add the offset
C++:
float value = 10;
DWORD buffer = 0;

ReadProcessMemory(handle, (LPCVOID)0xB6F5F0, &buffer, sizeof(buffer), NULL);
WriteProcessMemory(handle, (LPVOID)(buffer + 0x540), &value, sizeof(float), NULL);
How To Hack Any Game 1 Solaire

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