How to Make EndScene Hook work? menu

Shout-Out

User Tag List

Results 1 to 4 of 4
  1. #1
    misz's Avatar Member
    Reputation
    1
    Join Date
    Nov 2007
    Posts
    17
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How to Make EndScene Hook work?

    I have written a little application for gathering information about the character the player is currently playing. And I wanted to hook up to EndScene.

    I used the code APoc gave as a example in the WhiteMagic Thread.

    The Code Looks like:

    Code:
    
    using System;
    using System.Diagnostics;
    using System.Linq;
    using System.Runtime.InteropServices;
    using System.Windows.Forms;
    using WhiteMagic;
    namespace WoWInfo
    {
    publicpartialclassMain : Form,IProcessSelectorNotifier
    {
    privateProcess WoWProcess;
    public Main()
    {
    InitializeComponent();
    Process.EnterDebugMode();
    }
    privatevoid Main_Load(object sender, EventArgs e)
    {
    Process[] wowWins = Process.GetProcessesByName("wow");
    if (wowWins.Count() == 0)
    {
    // No wow windows open
    MessageBox.Show("Could not find WoW");
    Close();
    }
    else
    {
    // Open Process Selector
    WoWSelector sel = newWoWSelector(wowWins, this);
    sel.ShowDialog();
    }
    }
    publicvoid ProcessSelectionComplete(Process proc)
    {
    // A Async callback of the Process Selector
    WoWProcess = proc;
    }
    // Hook the EndScene
    privatevoid button1_Click(object sender, EventArgs e)
    {
    IntPtr endSceneAddr = DirectX.GetEndScenePointerManaged();
    Magic.Instance.Detours.CreateAndApply(Magic.Instance.RegisterDelegate<EndSceneDelegate>(endSceneAddr), EndSceneHandler, "EndScene");
    }
    [UnmanagedFunctionPointer(CallingConvention.Winapi)]
    publicdelegateintEndSceneDelegate(IntPtr instance);
     
    privatestaticreadonlyEndSceneDelegate EndSceneHandler = EndScene;
    privatestaticint EndScene(IntPtr instance)
    {
    MessageBox.Show("EndScene");
    return (int)Magic.Instance.Detours["EndScene"].CallOriginal(instance);
    }
    }
    }
    Everyting works great, except that the EndScene methood never gets called.

    Is there some special ASM code i have to inject to make the callback work.

    Thank you for all help, misz.

    How to Make EndScene Hook work?
  2. #2
    Scorpiona's Avatar Active Member
    Reputation
    17
    Join Date
    Mar 2009
    Posts
    42
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    WhiteMagic is for use with injected apps. It's obviously not going to work if you're trying to create a detour to a function that's in an external process.

  3. #3
    Nesox's Avatar ★ Elder ★
    Reputation
    1280
    Join Date
    Mar 2007
    Posts
    1,238
    Thanks G/R
    0/3
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Stop copy pasting shit you don't understand.
    Buy a book.

  4. #4
    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)
    Awww, why'd you ruin the fun in the first reply.

Similar Threads

  1. [guide] how to make programmer island working (EASY!)
    By azeon in forum WoW EMU Guides & Tutorials
    Replies: 79
    Last Post: 06-18-2010, 04:58 PM
  2. How to make Flying Mounts Work in Azeroth
    By r3anims in forum WoW EMU Guides & Tutorials
    Replies: 16
    Last Post: 09-04-2008, 04:11 AM
  3. [guide]: how to make .go scale work!
    By Szharz in forum WoW EMU Guides & Tutorials
    Replies: 30
    Last Post: 04-12-2008, 09:52 AM
  4. How to make older mods work (some of them)
    By The Mars Volta in forum World of Warcraft Bots and Programs
    Replies: 24
    Last Post: 06-04-2007, 07:20 PM
All times are GMT -5. The time now is 12:31 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