Unloading from EndScene hook menu

User Tag List

Results 1 to 3 of 3
  1. #1
    nerexis's Avatar Member CoreCoins Purchaser
    Reputation
    2
    Join Date
    Mar 2008
    Posts
    56
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Unloading from EndScene hook

    I have question about unloading a injected dll while using endscene hook. How to unload it in safe way, because using DetourDetach makes wow window dissapear due to error probably because my hooked endscene is executing and it's unloading in the same time.

    I was detaching hooked function in DLL_PROCESS_DETACH.

    Unloading from EndScene hook
  2. #2
    _Mike's Avatar Contributor
    Reputation
    310
    Join Date
    Apr 2008
    Posts
    531
    Thanks G/R
    0/2
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Don't use DLL_PROCESS_DETACH.
    Create a new thread, use some kind on synchronization to make sure it waits until your endscene hook is done, unhook, call FreeLibraryAndExitThread function

    For example:
    Code:
    EndSceneHook()
    {
      if(!TryEnterCriticalSection(&g_framelock))
        return; // something else is using the framelock. exit function.
    
      // do stuff..
    
      LeaveCriticalSection(&g_framelock);
    }
    
    UnloadDLLFunc() // called from a new thread
    {
      EnterCriticalSection(&g_framelock); // call blocks until framelock aquired. ie. it's guaranteed to not be in endscene
      // [unhook code]
      DeleteCriticalSection(&g_framelock);
    
      FreeLibraryAndExitThread(dllhandle, 0);
    }

  3. #3
    nerexis's Avatar Member CoreCoins Purchaser
    Reputation
    2
    Join Date
    Mar 2008
    Posts
    56
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Works! Thank you.

    Close thread, please.

Similar Threads

  1. [C# DLL] aHook, use ASM through EndScene hook
    By JuJuBoSc in forum WoW Memory Editing
    Replies: 81
    Last Post: 04-22-2024, 02:55 PM
  2. [C#] [Question] Running TraceLine from an Endscene Hook
    By Kaziko. in forum WoW Memory Editing
    Replies: 7
    Last Post: 02-01-2011, 05:28 AM
  3. Custom rendering in endscene hook
    By ggg898 in forum WoW Memory Editing
    Replies: 3
    Last Post: 09-11-2009, 09:38 AM
  4. [Test Theory] EndScene hook without Native Code (Kinda)
    By Apoc in forum WoW Memory Editing
    Replies: 7
    Last Post: 09-04-2009, 12:46 PM
  5. EndScene Hook not changing anything
    By lanman92 in forum WoW Memory Editing
    Replies: 32
    Last Post: 06-01-2009, 11:46 PM
All times are GMT -5. The time now is 07:07 PM. 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