Trying external but I can't get the client module
So I am trying to do some stuff externally for a while (just private). I am trying to get the client base address using this code:
Code:
int GetClient() {
mEntry.dwSize = sizeof(MODULEENTRY32);
snap = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE, pID);
if (Module32First(snap, &mEntry) == TRUE)
{
while (Module32Next(snap, &mEntry) == TRUE)
{
if (_stricmp(mEntry.szModule, "client.dll") == 0)
{
client = (DWORD)mEntry.modBaseAddr;
CloseHandle(snap);
return (1);
}
}
}
CloseHandle(snap);
return 0;
}
I haven't gone and copied this so it could just be completely the wrong method of getting it but... I tried.
It is always returning 0 so therefore it is never finding the module. I have the correct process ID so that isn't the issue. Any help would be appreciated.
Variables:
Code:
MODULEENTRY32 mEntry;
HANDLE module;
HANDLE snap;
int pID;
I get the process ID from my process handle and it matches that given by cheat engine.
Been over a week since last update/bump after answers, assuming solved.
/Closed.