[C++] Problem setting up TLS menu

User Tag List

Results 1 to 3 of 3
  1. #1
    Cromon's Avatar Legendary


    Reputation
    840
    Join Date
    Mar 2008
    Posts
    714
    Thanks G/R
    0/7
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [C++] Problem setting up TLS

    Hello!

    Sorry if my posting is a bit short, but im in hurry. In the evening i may add some more detailed description to it :P

    Im using the following code to set up the objMgr in the TLS of my thread:
    Code:
    extern "C"
    __declspec(dllexport)
    void OnInject()
    {
    	UIError(9, "OnInject");
    	LPDWORD curMgr = (LPDWORD)0x00C79CE0;
    	LPDWORD objMgr = (LPDWORD)((*curMgr) + 0x2ED0);
    	UIError(9, "ObjMgr loaded!");
    	__asm
    	{
    		push ecx
    		push eax
    		mov ecx, fs:[0x2C]
    		mov ecx, [ecx]
    		add ecx, 8
    		mov eax, objMgr
    		mov [ecx], eax
    		pop eax
    		pop ecx
    	}
    	MessageBox(0, "", "", MB_YESNO);
    	unsigned long long guid = GetActivePlayer();
    	char msg[255];
    	sprintf(msg, "%I64u", guid);
    	MessageBox(0, msg, "", MB_YESNO);
    }
    It has 2 big issues:
    Randomly it crashes somewhere in the __asm-Block without a wow-exception-window but just "WoW has stopped working". If it works GetActivePlayer returns an incorrect GUID.

    What am i doing wrong here?

    /Edit:
    It returns the correct GUID, that was my fault

    Greetings
    Cromon
    Last edited by Cromon; 07-20-2010 at 07:18 AM.

    [C++] Problem setting up TLS
  2. #2
    Cypher's Avatar Kynox's Sister's Pimp
    Reputation
    1356
    Join Date
    Apr 2006
    Posts
    5,368
    Thanks G/R
    0/4
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If you're already injected then why not just hook IDirect3DDevice9::EndScene? Then you don't have to worry about thread safety, race conditions, etc.

  3. #3
    Cromon's Avatar Legendary


    Reputation
    840
    Join Date
    Mar 2008
    Posts
    714
    Thanks G/R
    0/7
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well, lets say I'm trying some things where i need my own thread (they're just for fun and wont be used in a real project). From what i've seen the problem mostly coming from UIError (which is short for BroadcastUIError). If i remove that everywhere and change the signature of OnInject to LPTHREAD_START_ROUTINE errors disappear constantly. So it seems to work for now.

Similar Threads

  1. [Trinity] Problem with the root in setting up server
    By cadenz in forum WoW EMU Questions & Requests
    Replies: 0
    Last Post: 01-07-2016, 06:31 PM
  2. Problem with my settings?
    By Afflicktion in forum Diablo 3 General
    Replies: 4
    Last Post: 05-17-2012, 04:54 AM
  3. TLS problems..
    By arynock in forum WoW Memory Editing
    Replies: 13
    Last Post: 07-20-2008, 04:57 AM
  4. Wrath 5-piece set bug
    By Matt in forum World of Warcraft Exploits
    Replies: 1
    Last Post: 12-09-2006, 05:50 PM
  5. Site problems
    By Shanaar in forum Community Chat
    Replies: 10
    Last Post: 05-14-2006, 01:15 AM
All times are GMT -5. The time now is 09:35 AM. Powered by vBulletin® Version 4.2.3
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search