C# code that automatically gets Endscene (DirectX9) and Present (DirectX 11) offsets menu

User Tag List

Results 1 to 11 of 11
  1. #1
    highvoltz's Avatar Active Member
    Reputation
    47
    Join Date
    Dec 2009
    Posts
    29
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    C# code that automatically gets Endscene (DirectX9) and Present (DirectX 11) offsets

    The attached source code demonstrates how you can automatically get pointer to EndScene for DirectX9 or Present for DirectX11 depending on which directX version is being used in target Process (automatically detected).

    Sample usage.

    Code:
    Dirext3D dx3D = new Dirext3D(wowProc); // wowProc is a System.Diagnostics.Process
    InstallHook( dx3D.HookPtr);    // Yes, its this simple. HookPtr points to either Endscene or Present depending on which directX is being used in target process and InstallHook is my function that installs the hook.
    Credits:
    Apoc: Based off Apoc's source for getting Endscene offset using same technique. I improved on it and added support for directX 11 and automatic directX version detection and more. Also uses his Grey Magic library.
    Attached Files Attached Files
    Last edited by highvoltz; 11-07-2012 at 10:31 PM.

    C# code that automatically gets Endscene (DirectX9) and Present (DirectX 11) offsets
  2. #2
    Mike1786's Avatar Member
    Reputation
    2
    Join Date
    Feb 2012
    Posts
    18
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Super, thx, works great!!! +rep

  3. #3
    ~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)
    Thanks for the upload. I've been too lazy to update my work for DX11. Now maybe this convinces me to do it lol

  4. #4
    Shadowhunter12's Avatar Member
    Reputation
    1
    Join Date
    Sep 2012
    Posts
    44
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Removed. All Fixed
    Last edited by Shadowhunter12; 11-17-2012 at 10:20 AM.

  5. #5
    Shadowhunter12's Avatar Member
    Reputation
    1
    Join Date
    Sep 2012
    Posts
    44
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Removed. All Fixed
    Last edited by Shadowhunter12; 11-17-2012 at 10:20 AM.

  6. #6
    hb123220's Avatar Member
    Reputation
    8
    Join Date
    Mar 2012
    Posts
    41
    Thanks G/R
    3/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    is DirectX9 EndScene on win8 the same as win7 ??
    my bot hooks EndScene ,it works fine on xp and win7 ..,but wow crashes on win8......

  7. #7
    Kanyle's Avatar Corporal
    Reputation
    9
    Join Date
    Jul 2011
    Posts
    19
    Thanks G/R
    1/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Function entry point on Windows 8:

    Code:
    .text:1001F8DF 6A 14                          push    14h
    .text:1001F8E1 B8 0C 9A 14 10                 mov     eax, offset loc_10149A0C

  8. #8
    highvoltz's Avatar Active Member
    Reputation
    47
    Join Date
    Dec 2009
    Posts
    29
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    you can make your hook work on any version of Windows or DirectX if you use a short jump (2 bytes) to jump up to the function padding and replace the function padding with your long jump.

  9. #9
    schlicht's Avatar Private
    Reputation
    1
    Join Date
    Nov 2012
    Posts
    2
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for sharing!


    Unfortunately I'm getting errors like this:
    \D3DDevice.cs(56,23,56,36): error CS0122: 'System.Runtime.InteropServices.NativeMethods' is inaccessible due to its protection level
    \D3DDevice.cs(60,23,60,36): error CS0122: 'System.Runtime.InteropServices.NativeMethods' is inaccessible due to its protection level
    \D3DDevice.cs(107,25,107,38): error CS0122: 'System.Runtime.InteropServices.NativeMethods' is inaccessible due to its protection level
    \D3D11Device.cs(51,17,51,20): error CS0122: 'System.Diagnostics.Log' is inaccessible due to its protection level

    i searched the web, but couldn't find a solution. Anyone an idea?

    Best regards
    schlicht

  10. #10
    dan934's Avatar Banned
    Reputation
    33
    Join Date
    Jun 2009
    Posts
    80
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by schlicht View Post
    Thanks for sharing!


    Unfortunately I'm getting errors like this:
    \D3DDevice.cs(56,23,56,36): error CS0122: 'System.Runtime.InteropServices.NativeMethods' is inaccessible due to its protection level
    \D3DDevice.cs(60,23,60,36): error CS0122: 'System.Runtime.InteropServices.NativeMethods' is inaccessible due to its protection level
    \D3DDevice.cs(107,25,107,3: error CS0122: 'System.Runtime.InteropServices.NativeMethods' is inaccessible due to its protection level
    \D3D11Device.cs(51,17,51,20): error CS0122: 'System.Diagnostics.Log' is inaccessible due to its protection level

    i searched the web, but couldn't find a solution. Anyone an idea?

    Best regards
    schlicht
    This was used as an honorbuddy plugin i think, You need to add the Dll imports that it uses.

    Code:
    public static class NativeMethods
        {
            [DllImport("kernel32.dll", CharSet = CharSet.Auto)]
            public static extern IntPtr GetModuleHandle(string lpModuleName);
    
            [DllImport("kernel32", SetLastError = true, CharSet = CharSet.Unicode)]
            public static extern IntPtr LoadLibrary(string lpFileName);
    
            [DllImport("kernel32.dll", SetLastError = true)]
            [return: MarshalAs(UnmanagedType.Bool)]
            public static extern bool FreeLibrary(IntPtr hModule);
        }

  11. #11
    schlicht's Avatar Private
    Reputation
    1
    Join Date
    Nov 2012
    Posts
    2
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ahh okay, did not know that.
    Now it compiles.
    But it hangs somewhere forever and nothing happens.
    Thanks anyway!

Similar Threads

  1. Replies: 11
    Last Post: 12-23-2010, 09:30 PM
  2. How to get that place between loch modan and badlands.
    By Plokooni in forum World of Warcraft Exploration
    Replies: 10
    Last Post: 05-17-2009, 12:09 PM
  3. Get Twink loot and other GOOD loot in NOTIME!
    By Nolixz in forum World of Warcraft Guides
    Replies: 30
    Last Post: 02-25-2007, 03:25 PM
  4. Video, get under ogrimmar and on the wall
    By HumanWarrior in forum World of Warcraft Exploits
    Replies: 3
    Last Post: 06-04-2006, 09:43 AM
All times are GMT -5. The time now is 07:18 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