[Help]EndScene Hooking menu

User Tag List

Results 1 to 11 of 11
  1. #1
    jrozparovac's Avatar Private
    Reputation
    1
    Join Date
    Jan 2013
    Posts
    2
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [Help]EndScene Hooking

    Hello guys,
    first as a new member of ownedcore community I would like to thank you all for this incerdible forum which is full of many very usefull informations.

    Not to get to the point ...
    I would like to do bot so for last two weeks or so I've read many things about that task. One of the thing I've read here is hooking of EndScene. I understood that hooking EndScene is used to perform an operation before each frame is rendered. What I could not find is what operations most of the bots doing or why do you hooking endscene in world of warcraft?

    [Help]EndScene Hooking
  2. #2
    namreeb's Avatar Legendary

    Reputation
    668
    Join Date
    Sep 2008
    Posts
    1,029
    Thanks G/R
    8/222
    Trade Feedback
    0 (0%)
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)
    It's generally just an easy way to tick your bot's logic, update state, etc. and be reasonably sure that you are executing your code in the main thread of the game.

  3. #3
    jrozparovac's Avatar Private
    Reputation
    1
    Join Date
    Jan 2013
    Posts
    2
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you very much

  4. #4
    DarkLinux's Avatar Former Staff
    CoreCoins Purchaser Authenticator enabled
    Reputation
    1627
    Join Date
    May 2010
    Posts
    1,846
    Thanks G/R
    193/539
    Trade Feedback
    16 (100%)
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)
    Some lue functions must be called from the main thread, like JumpOrAscendStart(); or it will not work.. So call everything from EndScene..

    wow pedia

    DoString Code from around the forum...
    Filebeam - Beam up that File Scottie!

    One small problem is that FrameScript_Execute should be FrameScript_ExecuteBuffer

    FrameScript_ExecuteBuffer = 0x75AC0
    Direct3D9__Device = 0xB18ADC;
    Direct3D9__Device__idk= 0x2808;
    Direct3D9__Device__Endscene_idk = 0xA8;

    Or look at this so you dont need to update the Direct offsets,
    http://www.ownedcore.com/forums/worl...n-scanner.html (EverScan - An Open Source Warden Scanner)
    Last edited by DarkLinux; 01-10-2013 at 07:41 PM.

  5. #5
    zys924's Avatar Active Member
    Reputation
    20
    Join Date
    Nov 2009
    Posts
    113
    Thanks G/R
    0/7
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    There is only one defects for endscene hook. When the game window is minimized, the tick will be freezed so your bot logic is also stopped.

  6. #6
    Jadd's Avatar 🐸 Premium Seller
    Reputation
    1515
    Join Date
    May 2008
    Posts
    2,433
    Thanks G/R
    81/336
    Trade Feedback
    1 (100%)
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by zys924 View Post
    There is only one defects for endscene hook. When the game window is minimized, the tick will be freezed so your bot logic is also stopped.
    You should not use EndScene for keeping your bot updated. Instead, you should use the main thread's looped function or a function inside this loop. This applies for all games for the reason above. In WoW, the looped function is named SchedulerThreadProcProcess (0x004701E0 16357 x86 non-rebased), and it is called like so:

    Code:
    while ( !SchedulerThreadProcProcess(v3, v1, (int)&a1) )
      ;
    WoW also has some nice timer event functions you can work with. Try EventSetTimer. You specify a __cdecl callback function and interval (milliseconds). The function will be executed from the main thread, when the interval is hit. This is a good way to loop your bot's "refresh" code in the main thread, however the first call to EventSetTimer must also be from the main thread (NOT from a SchedulerThreadProcProcess hook, it does not work).

    Code:
    typedef BOOL( __cdecl *EventSetTimer_t )( UINT uInterval, void( __cdecl *pCallbackFunction )( void ), UINT unk1 );
    For example:

    Code:
    void __cdecl Pulse()
    {
    	Delegates::EventSetTimer( 10, Pulse, 0 );
    }
    It is nice not having to maintain function call intervals like you normally would, I would strongly recommend using this function as you can.
    Last edited by Jadd; 01-10-2013 at 09:51 PM.

  7. #7
    zys924's Avatar Active Member
    Reputation
    20
    Join Date
    Nov 2009
    Posts
    113
    Thanks G/R
    0/7
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Jadd View Post
    You should not use EndScene for keeping your bot updated. Instead, you should use the main thread's looped function or a function inside this loop. This applies for all games for the reason above. In WoW, the looped function is named SchedulerThreadProcProcess (0x004701E0 16357 x86 non-rebased), and it is called like so:

    Code:
    while ( !SchedulerThreadProcProcess(v3, v1, (int)&a1) )
      ;
    WoW also has some nice timer event functions you can work with. Try EventSetTimer. You specify a __cdecl callback function and interval (milliseconds). The function will be executed from the main thread, when the interval is hit. This is a good way to loop your bot's "refresh" code in the main thread, however the first call to EventSetTimer must also be from the main thread (NOT from a SchedulerThreadProcProcess hook, it does not work).

    Code:
    typedef BOOL( __cdecl *EventSetTimer_t )( UINT uInterval, void( __cdecl *pCallbackFunction )( void ), UINT unk1 );
    For example:

    Code:
    void __cdecl Pulse()
    {
    	Delegates::EventSetTimer( 10, Pulse, 0 );
    }
    It is nice not having to maintain function call intervals like you normally would, I would strongly recommend using this function as you can.
    In a word, thus, what you mean exactly is try to use EventSetTimer, which must be called from EndScene. Am I correct?
    BTW, this approach solves the freeze problem but turns to be more specific than the Direct hook. Everything comes with a price, isnt it?

  8. #8
    ~Unknown~'s Avatar Contributor
    Reputation
    193
    Join Date
    Jan 2009
    Posts
    211
    Thanks G/R
    0/5
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Jadd View Post
    You should not use EndScene for keeping your bot updated. Instead, you should use the main thread's looped function or a function inside this loop. This applies for all games for the reason above. In WoW, the looped function is named SchedulerThreadProcProcess (0x004701E0 16357 x86 non-rebased), and it is called like so:

    Code:
    while ( !SchedulerThreadProcProcess(v3, v1, (int)&a1) )
      ;
    This has me wondering. I haven't tried to search for it, but why is EndScene so popular if there are other functions that are better for this purpose? Is it because it is supposed to be "safer" because legit programs hook it to use overlays? or because originally people used it for their own overlays?

  9. #9
    Jadd's Avatar 🐸 Premium Seller
    Reputation
    1515
    Join Date
    May 2008
    Posts
    2,433
    Thanks G/R
    81/336
    Trade Feedback
    1 (100%)
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by zys924 View Post
    In a word, thus, what you mean exactly is try to use EventSetTimer, which must be called from EndScene. Am I correct?
    BTW, this approach solves the freeze problem but turns to be more specific than the Direct hook. Everything comes with a price, isnt it?
    In WoWPlus, we used EndScene to initialize our environment (functions that required main thread execution). This included interval hotkey checks, object manager refreshes, etc. - all of which made usage of EventSetTimer.

    We found another function recently called IEvtTimerDispatch (0x00472C70 16357 x86 non-rebased). It is called within SchedulerThreadProcProcess and is called just as often (minimized or not). I figure it's kind of hackish to use a function like this, but it works with EventSetTimer.


    Originally Posted by ~Unknown~ View Post
    This has me wondering. I haven't tried to search for it, but why is EndScene so popular if there are other functions that are better for this purpose? Is it because it is supposed to be "safer" because legit programs hook it to use overlays? or because originally people used it for their own overlays?
    That's a good point. As long as you don't have some sort of anti-cheat countermeasure, I would recommend the EndScene option. A lot of anti-cheats don't allow you to modify the main .text segment.

    But with that said, a lot of games enforce screenshot analysis assuming you can do anything malicious within EndScene (ESPs?) - so be careful in any case.

  10. #10
    ~Unknown~'s Avatar Contributor
    Reputation
    193
    Join Date
    Jan 2009
    Posts
    211
    Thanks G/R
    0/5
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Jadd View Post
    That's a good point. As long as you don't have some sort of anti-cheat countermeasure, I would recommend the EndScene option. A lot of anti-cheats don't allow you to modify the main .text segment.

    But with that said, a lot of games enforce screenshot analysis assuming you can do anything malicious within EndScene (ESPs?) - so be careful in any case.
    Yeah, that's good to know. I just read this after I finished hooking the SchedulerThreadProcProcess function you mention. It isn't all that difficult in WoW in particular, but I have pretty much zero knowledge of Warden so its probably in my best interest to stick with EndScene hooks. One day I'll stop being a noob and learn something about anti-cheat methods. Thanks. :P

  11. #11
    namreeb's Avatar Legendary

    Reputation
    668
    Join Date
    Sep 2008
    Posts
    1,029
    Thanks G/R
    8/222
    Trade Feedback
    0 (0%)
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)
    Note also that if you are including in an injected library some sort of GUI API, that it may also be using EndScene in its thread and context. So you are not guaranteed that EndScene is always called from the "main" thread.

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. Is EndScene hooking detectable?
    By xLeo123 in forum WoW Memory Editing
    Replies: 9
    Last Post: 01-13-2010, 03:49 PM
  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 08: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