Grabbing the DX device in endscene detour menu

Shout-Out

User Tag List

Results 1 to 1 of 1
  1. #1
    ggg898's Avatar Member
    Reputation
    10
    Join Date
    Jan 2009
    Posts
    39
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Grabbing the DX device in endscene detour

    I want to do some custom gui drawing and was trying to do that in my endscene detour hook.

    I dont have the dx device pointer, so i tried to grab it in my hook like this (my hooks are using __declspec(naked) __stdcall so i just grab the calling params from the stack by declaring some extra params);

    Half - pseudo code;

    IDirect3DDevice9* d3ddev = null;
    DWORD __declspec(naked) __stdcall EndSceneHook(void* returnAdress, void* dev)
    {
    save flags and registers ...

    d3ddev = (IDirect3DDevice9*) dev;

    d3ddev->SetRenderState(...);

    restore flags and regs...


    }


    Code crashes when calling any methods with d3ddev, like d3ddev ->SetFVF() and so on.

    d3ddev gets a fairly decent value, which happens to be the same as [[0x0123E908]+0x397C] (for 3.2.0a) which first bytes is pointer to the device functiontable, so it seems to be some object of any kind, and i thought it was the device...

    Anyone knows what Im doing wrong here? like if it is IDirect3DDevice9** that is passed to endscene() calls or something like that. It would be great to know if its something very obvious before i rewrite and hook CreateDevice at startup in order to get the device, since Im lazy

    Thanks in advance
    Last edited by ggg898; 09-08-2009 at 06:49 AM. Reason: forgot __stdcall

    Grabbing the DX device in endscene detour

Similar Threads

  1. Endscene Detour
    By unbekannt1 in forum Hearthstone: Heroes of Warcraft
    Replies: 10
    Last Post: 06-05-2014, 03:04 PM
  2. EndScene detour question
    By bad6oy30 in forum WoW Memory Editing
    Replies: 4
    Last Post: 02-23-2011, 05:37 PM
  3. Replies: 11
    Last Post: 01-06-2011, 02:59 PM
  4. C# Troubleshooting my endscene detour 3.3.5 (12340)
    By opulent in forum WoW Memory Editing
    Replies: 11
    Last Post: 07-26-2010, 05:00 AM
All times are GMT -5. The time now is 05:48 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