HelpTrying external but I can't get the client module

Posts 18 of 8 · Page 1 of 1
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.
Code:
DWORD GetClient() {
		mEntry.dwSize = sizeof(MODULEENTRY32);
		snap = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE, pID);
		if (Module32First(snap, &mEntry) == TRUE)
		{
			while (Module32Next(snap, &mEntry) == TRUE)
			{
				if (strcmp(mEntry.szModule, "client.dll") == 0)
				{
					client = (DWORD)mEntry.modBaseAddr;
					break;
					
				}
			}
		}
		CloseHandle(snap);
		return client;
	}
Quote Originally Posted by samlarenskoog View Post
Code:
DWORD GetClient() {
		mEntry.dwSize = sizeof(MODULEENTRY32);
		snap = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE, pID);
		if (Module32First(snap, &mEntry) == TRUE)
		{
			while (Module32Next(snap, &mEntry) == TRUE)
			{
				if (strcmp(mEntry.szModule, "client.dll") == 0)
				{
					client = (DWORD)mEntry.modBaseAddr;
					break;
					
				}
			}
		}
		CloseHandle(snap);
		return client;
	}
There is basically no different here and I use _strcmp because strcmp is deprecated. They perform the same functions.

And it doesn't matter if it returns or not I am still setting my client to the base address even if I'm not returning it

- - - Updated - - -

Might I add that if anyone wants to see the rest of my code I will show high rep people privately. I don't want 1000's of kids using it
Try procmem until you can make your own class for this stuff... then it's just 3 lines:
Code:
Procmem Mem;
Mem.Process("csgo.exe");
ClientDLL = Mem.Module("client.dll");
Quote Originally Posted by ImWhacky View Post
Try procmem until you can make your own class for this stuff... then it's just 3 lines:
Code:
Procmem Mem;
Mem.Process("csgo.exe");
ClientDLL = Mem.Module("client.dll");
Not here to copy stuff and use others stuff, here for some info on stuff like this
Quote Originally Posted by SilentWarp View Post
Not here to copy stuff and use others stuff, here for some info on stuff like this
Should have read first my bad
Try this,

Code:
MODULEENTRY32 GetClient(char* mName) {
	MODULEENTRY32 mEntry;
	mEntry.dwSize = sizeof(MODULEENTRY32);
	snap = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE, pID);


	if (Module32First(snap, &mEntry) == true)
	{
		while (Module32Next(snap, &mEntry) == true)
		{
			if (strcmp(mEntry.szModule, (LPSTR)mName) == 0)
			{
				client = (DWORD)mEntry.hModule, mEntry.modBaseSize;
				break;
			}
		}
	}
	CloseHandle(snap);
	return client;
}
Been over a week since last update/bump after answers, assuming solved.

/Closed.
Posts 18 of 8 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Need help?