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