-3

I am a beginner in C++ and I'm trying to get the Health-Value of the player in CS:GO, but I face some problem. With CheatEngine I found that the playerbase is "client_panorama.dll" + 0xCBD6B4 and the offset to the health value is 0x100. That works fine, but I have trouble converting this to c++. I'm using dll injection, but in my injected DLL I am not able to get the same addresses as in CheatEngine. Picture of CE: https://i.stack.imgur.com/KIF0B.jpg

I was looking on several forums for a solution, but I was not able to find one. This is my code attempt so far:

DWORD dwClientBase = (DWORD)GetModuleHandleA((LPCSTR)"client_panorama.dll");
DWORD dwClientBaseOffset = 0xCBD6B4;
DWORD dwOffset = 0x100;

DWORD dwplayerBase = *(DWORD *)(dwClientBase + dwClientBaseOffset);

But with this attemp I does not get the same PlayerBase Adress as in Cheatengine.

Backround: I'm not trying to make a hack, but to learn how to extract information out of a real game. In the future I want to try programming AIs for real games and therefore it is very helpful if you have more information than just the visual output of the game.

Thanks for you help, Varsius

Varsius
  • 25
  • 1
  • 4
  • You forgot to add `dwOffset`, but you're better off showing all numbers involved for a real case before we can better help you. – Botje Jan 03 '19 at 12:16

1 Answers1

0

Your code is correct. If your code executes correctly then dwplayerBase will equal the address of the player object.

If you wanted to get the health address, you would need to then add dwOffset. I believe your confusion is because you were expected the health address. To get it, just add this line:

DWORD healthAddr = dwplayerBase + dwOffset;
GuidedHacking
  • 3,628
  • 1
  • 9
  • 59