Results 1 to 1 of 1
  1. #1
    Qmo's Avatar
    Join Date
    Mar 2011
    Gender
    male
    Location
    #cmd<user> CONTRIBUTION GAME HACKING
    Posts
    2,008
    Reputation
    246
    Thanks
    5,873
    My Mood
    Relaxed

    Arrow [C++] D3D9 Hooking via Detours

    [C++] D3D9 Hooking via Detours
    Chapter 1


    DirectX9.0 - 11 Hooking via C++


    Ok, so beings that this was requested, I decided to write this up. I hope this helps someone and if not, sorry First and for most, this tutorial is strictly for DirectX9 and I guarantee you it will not work for other versions without some major editing in the wrapper. At the end of this I will also include some instructions on how to turn this injected hook into a wrapper to the point where you can just compile it as d3d9.dll and drop it into your games directory and run it via that method too.
    (I suggest the "wrapper" method as most cheat detections don't find it as a hack due to some machines needing the d3d9.dll in that folder to work.)

    I am writing this tutorial to be used with C++ but you can translate it to what ever language you wish to program in as it's pretty basic and not too major. The wrapper is where the most work comes to play so you will need to do that on your own. Sorry, I don't know other languages outside of C++, MASM, and VB2010 so you are on your own when translating.

    Part 1. Introduction and Such


    Before we begin, let me go over what this does and how it works. Firstly, this main tutorial method is via injection. What this does is creates a remote thread in the process as its starting up and injects your hook and calls its DllMain (or main function of the DLL) and hooks the Direct3D9Create function. From there, when the game, or DX app you are using calls Direct3D9Create, it will call your hooked function instead of the original. When that happens, instead of using the default DirectX functions, it will use your wrapper "proxy" functions that are modified to your need and such. This allows you to add to the game, or app, such as wireframe, colored primitives, etc. Such things you see in hacks and so on.

    Along with that, it opens up the window for any other extra feature(s) you can come up with on your own. The boundaries are small, just what you are able to do and such.

    This tutorial is going to explain how to do the basics, create the hook, show an example wrapper, and explain a few small things along with the hook. I will include a full example as well that I will find some random free program to show you how it works and such in as well. I will add wireframe mode to a toggle key to show you how to add some of your own code into the hook as well

    Part 2. Tools Needed

    This is a small list of the things you will need to be able to use this tutorial.
    Microsoft Visual Studio 2010
    You do not need the full version to create things, you can use the express edition as far as I know to compile things as long as they are non-commercial (from what I was told). If not, find the full version on a warez site or be nice and purchase it

    Microsoft Detours Library 1.5
    Download from MS
    Due to some unknown reason, the makers of the Detours library have removed the functions used in this tutorial from the new version. So you will need to download a precompiled version here

    Microsoft DirectX 9.0c SDK
    And again, another free download from Microsoft for developers. (Aren't they so nice to programmers)

    Note: You need to have a real version of Windows for this download so if you don't, just google around for it. I don't think the version matters.
    I used the July 2005 update for most of my old projects, but have installed the Mai 2009 version and my stuff still compiles fine so either should be ok.

    Misc Tools
    A brain, patience, the willing to read and learn, coffee.
    HERE For LINK to stage a more in-depth : https://www.mpgh.net/forum/31-c-c-pro...ml#post5191014
    Last edited by Qmo; 09-21-2011 at 01:43 AM.





    اَللّهُ اَكْبَرُ

    .:If u can respect other people work, then u will get what u want:.

  2. The Following 3 Users Say Thank You to Qmo For This Useful Post:

    Alcazer (09-21-2011),harukazen (09-22-2011),killbyme (10-08-2011)

Similar Threads

  1. [Source Code] D3D9 Hooking Via Detours
    By Qmo in forum C++/C Programming
    Replies: 36
    Last Post: 12-09-2011, 02:12 PM
  2. [Release] NEW Public D3D9 Hook [22/07/10]
    By D3athBringer in forum WarRock - International Hacks
    Replies: 158
    Last Post: 07-25-2010, 11:52 PM
  3. D3D9 Hook problem [solved]
    By why06 in forum C++/C Programming
    Replies: 12
    Last Post: 03-28-2010, 08:02 PM
  4. D3D9 hook undetected
    By systemfiles in forum PunkBuster
    Replies: 1
    Last Post: 11-28-2009, 01:12 AM
  5. D3D9 Hooking
    By Someguytwo in forum C++/C Programming
    Replies: 9
    Last Post: 01-18-2008, 10:31 AM