EndScene hooking, question menu

User Tag List

Results 1 to 5 of 5
  1. #1
    shikyo's Avatar Member
    Reputation
    3
    Join Date
    Dec 2008
    Posts
    10
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    EndScene hooking, question

    I noticed the bot I'm writing for WoW was crashing due to race conditions, so I figured learning how to hook EndScene would be a good idea. So, having spent the last 5 or so hours googling, reading and testing others peoples code I've stumbled into a question I can't seem to answer through google alone.

    The way most suited to my need seems to be injecting a DLL, finding EndScene through the VMTable and then putting in a little Detour. So far so easy I thought.
    The problem I´ve found is that since EndScene is a part of IDirect3DDevice9 I kind of need that device's VTable, the solution I've seen through google are either:

    1.Detour CreateDevice and get the address of the VTable.
    2.Create your own WNDCLASSEX, Window and eventually D3D Device.

    As I see it, the problems with 1 is that I need to be injected during the CreateDevice phase (I'm not). And with 2, although I suppose my device and WoW's device will be pointing to the same EndScene function, it seems rather ghetto... (Or maybe that's just me?)

    The third option that seemed somewhat reasonable was to:
    Find out the EndScene address inside of d3d9.dll (through IDA or the likes) and then once injected locate the DLL inside of WoW and then the address to EndScene would simply be DllAddressInWow+EndSceneAddressInDll

    I know there are even more methods (some more crazy than the other oO), but these three seemed to be the most suitable to my situation.

    So, my question (finally) is:
    Are there any other method I'm missing to see the VTable or are the first two methods what you'd use as well? If not, could you recommend me/point me in a direction as to where I could keep researching? And thirdly, any opinion about the third method?
    Last edited by shikyo; 02-04-2012 at 12:59 PM.

    EndScene hooking, question
  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)
    A good way to get the EndScene address is to use the symbols library by Microsoft. I think MaiN made a post about it a while back. Just google for it on this site only and you'll find it pretty quick.

  3. #3
    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)
    Number 2 can also **** up rendering in some cases if the parameters you use to create the device don't match the game's device in some aspect. From memory it was primarily the 'windowed' flag giving me trouble...

    Number 1 is the 'superior' solution imo, though symbols is also an option if you don't mind requiring an internet connection (as obviously it needs to connect to the symbols server).

    For 'public' code I'd pick option 1. For 'private' code either 1 or symbols, depending on your use case.

  4. #4
    shikyo's Avatar Member
    Reputation
    3
    Join Date
    Dec 2008
    Posts
    10
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for both your answers.
    Kind of just went ahead and did number 2 right after posting. Will look into symbols too though.
    And if I ever plan to make it "public" I'll just change it away from the second solution (Right now I'm the only one using it)

  5. #5
    MaiN's Avatar Elite User
    Reputation
    335
    Join Date
    Sep 2006
    Posts
    1,047
    Thanks G/R
    0/10
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by lanman92 View Post
    A good way to get the EndScene address is to use the symbols library by Microsoft. I think MaiN made a post about it a while back. Just google for it on this site only and you'll find it pretty quick.
    I think it was _Mike, not me.
    [16:15:41] Cypher: caus the CPU is a dick
    [16:16:07] kynox: CPU is mad
    [16:16:15] Cypher: CPU is all like
    [16:16:16] Cypher: whatever, i do what i want

Similar Threads

  1. [2.4.3][c#]Some questions about endscene hooking
    By squiggy in forum WoW Memory Editing
    Replies: 2
    Last Post: 06-11-2016, 12:24 PM
  2. [Question] CTM & EndScene Hook Safety
    By MadCoder in forum WoW Memory Editing
    Replies: 2
    Last Post: 03-01-2012, 09:35 AM
  3. [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
  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 03:52 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