EndScene Hook not changing anything menu

User Tag List

Page 1 of 3 123 LastLast
Results 1 to 15 of 33
  1. #1
    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)

    EndScene Hook not changing anything

    I hooked EndScene(ghetto-ly) and I know it's worked, because I looked at it in olly, but there's no messagebox popping up. From what I understand, shouldn't it be popping up with every single frame, at least? Here's what I used(please be kind to the ASM...):

    Code:
     
    __asm {
    pushad;
    mov eax, [0x113C290];
    mov eax, [eax + 0x38A8];
    mov eax, [eax];
    mov edx, 0x42 * 0x4;
    mov eax, [eax + edx];
    mov eax, [eax];
    mov endScene, eax;
    popad;
    }
    oEndScene = (tEndScene)DetourFunction((PBYTE)endScene, (PBYTE)mEndScene);
    Code:
    
    void mEndScene(IDirect3DDevice9 * device)
    {
    if(run == TRUE)
    {
    MessageBox(NULL, L"It works.", L"It works.", MB_OK);
    run = FALSE;
    }
    return oEndScene(device);
    }
    

    EndScene Hook not changing anything
  2. #2
    Shynd's Avatar Contributor
    Reputation
    97
    Join Date
    May 2008
    Posts
    393
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Is run set to true? =p

  3. #3
    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)
    Yes lol. (filler)

  4. #4
    hypnodok's Avatar Member
    Reputation
    19
    Join Date
    Nov 2007
    Posts
    65
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Attach VSC++ and set a breakpoint on your hook.

  5. #5
    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)
    It never gets hit. I have it at the very top of my function.

  6. #6
    SKU's Avatar Contributor
    Reputation
    306
    Join Date
    May 2007
    Posts
    565
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    HRESULT
    42, not 0x42

  7. #7
    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)
    I changed the HRESULT, I didn't realize it was decimal o.O

  8. #8
    SKU's Avatar Contributor
    Reputation
    306
    Join Date
    May 2007
    Posts
    565
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Don't quite get why you use inline asm for that, but anyhow, you're doing too many reads.

    DWORD_PTR dwEndScene = 0; // really good choice with inline asm!
    __asm {
    pushad
    mov eax, 0x113c290
    mov eax, [eax]
    mov eax, [eax + 0x38a8]
    mov eax, [eax]
    mov eax, [eax + 0xA8]
    mov dwEndScene, eax
    popad
    }

    if (dwEndScene)
    oEndScene = ..
    Last edited by SKU; 05-29-2009 at 01:19 PM.

  9. #9
    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)
    I can't stand using pointers when I'm doing raw reads like this, I get lost in the parentheses and asterisks =/

    EDIT: There is consitently nothing at that address. Is it correct? I even tried C&P method, using help from sillyboy's code.

    oEndScene = (tEndScene)DetourFunction((PBYTE)(*reinterpret_cast<void***>(mg->pDevice))[42], (PBYTE)mEndScene);
    Last edited by lanman92; 05-29-2009 at 01:57 PM.

  10. #10
    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)
    Okay, sorry for double posting... The pointer to the class is always empty. There's info before and after the pDevice object, but nothing there. I followed the pointers once inside olly, and found EndScene. It seems that my program isn't finding it. Somehow.

  11. #11
    kynox's Avatar Account not activated by Email
    Reputation
    830
    Join Date
    Dec 2006
    Posts
    888
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    reinterpret_cast< PBYTE >( *reinterpret_cast< PDWORD* >( pDevice )[42] )

    Not hard at all..

  12. #12
    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)
    That's not my dilemma. The offset is always zero.
    [[0x1073B44]+0x38A8]]

  13. #13
    jjaa's Avatar Contributor
    Reputation
    245
    Join Date
    Dec 2006
    Posts
    562
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by lanman92 View Post
    That's not my dilemma. The offset is always zero.
    [[0x1073B44]+0x38A8]]
    http://www.mmowned.com/forums/wow-me...ml#post1525534

    DXEndScene = [[[[0x113C290] + 0x38A8]] + 42 * 4]

  14. #14
    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)
    Argh, that's what I had it set to, I was experimenting.

    EDIT: And to no surprise, it still doesn't work. I'm not sure what's going on =/ gonna try a diff offset.....
    Last edited by lanman92; 05-29-2009 at 10:39 PM.

  15. #15
    suicidity's Avatar Contributor
    Reputation
    207
    Join Date
    Oct 2006
    Posts
    1,439
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    As far as I understand..

    VTABLE(Device) = Ptr(0x113C290) + 0x38A8
    EndScene = VTABLE + (42 * 4); 42 is the location in the Virtual Table for EndScene, Multiplied by 4 bytes..

    The Information stored @ EndScene is what you would detour; The Device(VTABLE) is what you would use as a Pointer to use to display to your screen. So with that you could do something like..

    Code:
    typedef HRESULT (WINAPI *m_D3D_EndScene) (IDirect3DDevice9 *Device);
    
    m_D3D_EndScene    m_ofEndScene;
    
    HRESULT WINAPI MyEndScene(IDirect3DDevice9 *Device)
    {
        /*
            Draw Stuff.. 
    
            Maybe something like Device->Clear(...);
            Device->Clear(...) being the VTABLE/Device (Ptr(0x113C290) + 0x38A8);
        */
        return m_ofEndScene(Device);
    }
    
    void DllThread(void)
    {
        m_ofEndScene    = (m_D3D_EndScene)DetourFunction((PBYTE)EndScene, (PBYTE)MyEndScene);
    }
    That should work; Sorry if I cause a little confusion, I tried being as clear as possible.
    Last edited by suicidity; 05-30-2009 at 01:10 AM.


Page 1 of 3 123 LastLast

Similar Threads

  1. All my friends got HotS, but not me. Anything I could do to change that?
    By Hyperbeist in forum Heroes of the Storm General
    Replies: 7
    Last Post: 11-03-2014, 05:31 PM
  2. EndScene hook does not work
    By kingdeking in forum WoW Memory Editing
    Replies: 7
    Last Post: 08-05-2012, 04:32 PM
  3. Replies: 17
    Last Post: 09-25-2008, 07:53 AM
  4. [Race Change] Anything --> Skeleton
    By Scrubs in forum World of Warcraft Model Editing
    Replies: 14
    Last Post: 05-15-2008, 11:33 PM
All times are GMT -5. The time now is 05:33 AM. Powered by vBulletin® Version 4.2.3
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search