Stupid Ad is stupid --->
Hi,
i took a look at this old object dumper by kynox... he is using another method of getting the object manager...
Code:
DWORD GetObjManager( void )
{
THREADENTRY32 lpThreadEntry = {0};
HANDLE hSnapShot = CreateToolhelp32Snapshot(TH32CS_SNAPTHREAD, PROC_ID);
if(hSnapShot == INVALID_HANDLE_VALUE)
throw GetSnapshotHandleException;
lpThreadEntry.dwSize = sizeof(lpThreadEntry);
BOOL bThread = Thread32First(hSnapShot, &lpThreadEntry);
while(bThread)
{
if(lpThreadEntry.th32OwnerProcessID == PROC_ID)
{
HANDLE hThread = OpenThread(THREAD_ALL_ACCESS, false, lpThreadEntry.th32ThreadID);
if(!hThread)
throw GetThreadHandleException;
CONTEXT ctx = {CONTEXT_SEGMENTS};
LDT_ENTRY ldtEntry;
GetThreadContext(hThread, &ctx);
GetThreadSelectorEntry(hThread, ctx.SegFs, &ldtEntry);
DWORD dwThreadBase = ldtEntry.BaseLow|(ldtEntry.HighWord.Bytes.BaseMid<<16)|(ldtEntry.HighWord.Bytes.BaseHi<<24);
CloseHandle(hThread);
DWORD ObjManager = ReadOffset<DWORD>(ReadOffset<DWORD>(ReadOffset<DWORD>(dwThreadBase+0x2C))+0x10);
return ObjManager;
}
bThread = Thread32Next(hSnapShot, &lpThreadEntry);
}
CloseHandle(hSnapShot);
return NULL;
}
But for some reason it does not work with WoW 4.2.2
This should return the same as:
Code:
ReadOffset<DWORD>(ReadOffset<DWORD>(ModuleBase + g_clientConnection) + s_curMgr)
I'd really prefer the TLS method of getting the object manager.. However it just does not work :\