Thread Local Storage (Way to get object manager) menu

User Tag List

Results 1 to 8 of 8
  1. #1
    Amrok's Avatar Banned
    Reputation
    4
    Join Date
    Apr 2009
    Posts
    59
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Thread Local Storage (Way to get object manager)

    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 :\
    Last edited by Amrok; 09-10-2011 at 11:35 AM.

    Thread Local Storage (Way to get object manager)
  2. #2
    lanman92's Avatar Active Member
    Reputation
    50
    Join Date
    Mar 2007
    Posts
    1,033
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Stupid thread is stupid.... Why make it harder than it has to be? Just use the second method you showed.

  3. #3
    Amrok's Avatar Banned
    Reputation
    4
    Join Date
    Apr 2009
    Posts
    59
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by lanman92 View Post
    Stupid thread is stupid.... Why make it harder than it has to be? Just use the second method you showed.
    Because if i get this to work my tool works with almost every patch

    GTFO static pointers i hate u
    Last edited by Amrok; 09-10-2011 at 12:06 PM.

  4. #4
    sitnspinlock's Avatar Elite User CoreCoins Purchaser
    Reputation
    398
    Join Date
    Sep 2010
    Posts
    439
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    heh I thought I was the only one that did this. I use my own implementation though, just enumerate the threads in start time order. The first one should be your thread of interest. Then use ntqueryinformationthread to grab the base of the thread environment block.

  5. #5
    Amrok's Avatar Banned
    Reputation
    4
    Join Date
    Apr 2009
    Posts
    59
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by everdox View Post
    heh I thought I was the only one that did this. I use my own implementation though, just enumerate the threads in start time order. The first one should be your thread of interest. Then use ntqueryinformationthread to grab the base of the thread environment block.
    Thanks

    Now i'll have to understand how to use that NtQueryInformationThread in my case... :\

  6. #6
    Cypher's Avatar Kynox's Sister's Pimp
    Reputation
    1358
    Join Date
    Apr 2006
    Posts
    5,368
    Thanks G/R
    0/6
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If you're injected you can avoid all the threading APIs and get access to TLS via compiler intrinsics (__readfsdword). Obviously though you need to have an EndScene hook set up for that to work.

    http://msdn.microsoft.com/en-us/libr...(v=vs.80).aspx

  7. #7
    Amrok's Avatar Banned
    Reputation
    4
    Join Date
    Apr 2009
    Posts
    59
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I got it working now The above code is correct just offsets were wrong.

    Solution:
    [[[ThreadBase+0x2C]]+0x8] instead of [[[ThreadBase+0x2C]]+0x10]

  8. #8
    flo8464's Avatar Active Member
    Reputation
    30
    Join Date
    Apr 2009
    Posts
    434
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Cypher View Post
    If you're injected you can avoid all the threading APIs and get access to TLS via compiler intrinsics (__readfsdword). Obviously though you need to have an EndScene hook set up for that to work.

    __readfsbyte, __readfsdword, __readfsqword, __readfsword (C++)
    He might call NtCurrentTeb directly.
    Or even better: EnumVisibleObjects.
    Hey, it compiles! Ship it!

Similar Threads

  1. Lazy leecher question: easy way to get quest objectives?
    By amadmonk in forum WoW Memory Editing
    Replies: 17
    Last Post: 02-07-2011, 03:13 PM
  2. [help] Getting a firm grip on the object manager...
    By yeahlol in forum WoW Bots Questions & Requests
    Replies: 3
    Last Post: 11-23-2010, 03:44 AM
  3. Replies: 9
    Last Post: 03-03-2010, 02:36 PM
  4. [Request] A way to get Object Doodad display IDS from WoW Viewer or...
    By DavidTwo2009 in forum WoW EMU Questions & Requests
    Replies: 1
    Last Post: 12-17-2009, 04:49 PM
  5. Easy way to get object sizes
    By crediar in forum WoW Memory Editing
    Replies: 8
    Last Post: 05-19-2008, 05:07 PM
All times are GMT -5. The time now is 03:50 AM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search