Hello everyone! I am interested in cheat development. I have coding knowledge but i can't get this working, so i would like to ask help to fix it and continue learning
I found a static pointer for the local player entity. I got the offset for the health too.
I made this simple code but after injecting the dll i looks like can't read any value.
Code:
#define _CRT_SECURE_NO_DEPRECATE
#include <stdio.h>
#include <Windows.h>
#include <iostream>
void showInjectionStatus();
DWORD moduleBase;
DWORD localPlayer;
int health;
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpReserved)
{
if (fdwReason == DLL_PROCESS_ATTACH)
{
DWORD moduleBase = (DWORD)GetModuleHandle(L"ac_client.exe");
DWORD localPlayer = *(DWORD*)(moduleBase + 0x18AC00);
showInjectionStatus();
}
return true;
}
void showInjectionStatus() {
//health = *(int*)(localPlayer + 0xEC);
AllocConsole();
freopen("CONOUT$", "w", stdout);
std::cout << "Cheat injected succesfully\n";
std::cout << "Cheat information:\n";
std::cout << "moduleBase: " << moduleBase << "\n";
std::cout << "localPlayer: " << localPlayer << "\n";
//std::cout << "Health: " << health;
}
Why it's not working?
Thank you