Results 1 to 8 of 8
  1. #1
    aanthonyz's Avatar
    Join Date
    Aug 2010
    Gender
    male
    Location
    Hitler's Minivan
    Posts
    483
    Reputation
    27
    Thanks
    83
    My Mood
    Relaxed

    Steps for Hooking

    What are the steps I would need to take to hook Present/EndScene, so I can draw?
    "The best way to predict your future is to create it."

    Contributions I made:

    DirectX E-Books
    Hacking Tools
    Hacking into a PC

    Need Help?
    Send me a PM, or send me a email at : aanthonyz10@gmail.com

    Click My Dragon:


  2. #2
    whit's Avatar
    Join Date
    Jan 2010
    Gender
    male
    Posts
    7,159
    Reputation
    490
    Thanks
    2,253
    Patch the Vtable

  3. #3
    aanthonyz's Avatar
    Join Date
    Aug 2010
    Gender
    male
    Location
    Hitler's Minivan
    Posts
    483
    Reputation
    27
    Thanks
    83
    My Mood
    Relaxed
    OMG. A new computer vocabulary word...what is a VTable?
    "The best way to predict your future is to create it."

    Contributions I made:

    DirectX E-Books
    Hacking Tools
    Hacking into a PC

    Need Help?
    Send me a PM, or send me a email at : aanthonyz10@gmail.com

    Click My Dragon:


  4. #4
    why06's Avatar
    Join Date
    Jul 2009
    Gender
    male
    Location
    IBM
    Posts
    4,304
    Reputation
    170
    Thanks
    2,203
    My Mood
    Flirty
    Virtual Table. Its a table of function that a class inherits.

    When one class say called Dog is derived from the base class Animal, it can call all the inheritable methods and access all the inheritable data Animal can. This list of virtual functions is stored in memory as a pointer at the beginning of the class structure. Whenever Dog calls a function it inherited from Animal, or one it has overridden the vtable is used.

    More Details: Virtual method table - Wikipedia, the free encyclopedia
    Last edited by why06; 03-10-2011 at 06:02 AM.

    "Every gun that is made, every warship launched, every rocket fired signifies, in the final sense, a theft from those who hunger and are not fed, those who are cold and are not clothed. This world in arms is not spending money alone. It is spending the sweat of its laborers, the genius of its scientists, the hopes of its children. The cost of one modern heavy bomber is this: a modern brick school in more than 30 cities. It is two electric power plants, each serving a town of 60,000 population. It is two fine, fully equipped hospitals. It is some fifty miles of concrete pavement. We pay for a single fighter plane with a half million bushels of wheat. We pay for a single destroyer with new homes that could have housed more than 8,000 people. This is, I repeat, the best way of life to be found on the road the world has been taking. This is not a way of life at all, in any true sense. Under the cloud of threatening war, it is humanity hanging from a cross of iron."
    - Dwight D. Eisenhower

  5. The Following 3 Users Say Thank You to why06 For This Useful Post:

    aanthonyz (03-10-2011),topblast (03-31-2011),whit (03-10-2011)

  6. #5
    whit's Avatar
    Join Date
    Jan 2010
    Gender
    male
    Posts
    7,159
    Reputation
    490
    Thanks
    2,253
    Very good explanation @why06

  7. #6
    aanthonyz's Avatar
    Join Date
    Aug 2010
    Gender
    male
    Location
    Hitler's Minivan
    Posts
    483
    Reputation
    27
    Thanks
    83
    My Mood
    Relaxed
    Nice explanation. Question though, do I need to find the Device Pointer or is this method completely different?
    "The best way to predict your future is to create it."

    Contributions I made:

    DirectX E-Books
    Hacking Tools
    Hacking into a PC

    Need Help?
    Send me a PM, or send me a email at : aanthonyz10@gmail.com

    Click My Dragon:


  8. #7
    CAFlames's Avatar
    Join Date
    Jan 2010
    Gender
    male
    Location
    Where ever my imagination takes me
    Posts
    3,006
    Reputation
    202
    Thanks
    2,944
    My Mood
    Twisted
    Quote Originally Posted by aanthonyz View Post
    Nice explanation. Question though, do I need to find the Device Pointer or is this method completely different?
    VTable is hooked to find the pattern for device pointer.

    Go look at the hook in whit's base v3. notice how it finds the device pointer to use VTable in hook.

    Current Works:
    ---Horror Game





    [IMG]https://i645.photobucke*****m/albums/uu180/drgnforce9/Siggys/signature3.jpg[/IMG]
    Special thanks to drgnforce9 for my sig picture

    Quote Originally Posted by m_t_h View Post

    CAflames is one epic coder.

    Rep and thanks him.. or you're perma banned.

  9. #8
    topblast's Avatar
    Join Date
    Mar 2010
    Gender
    male
    Location
    Far from around you Programmer: C++ | VB | C# | JAVA
    Posts
    3,607
    Reputation
    149
    Thanks
    5,052
    My Mood
    Cool
    or you can simply create a normal device... .. hmm i think i should got the code here, but you can create the temporary device and get the pointer from it.

    [highlight=VB.NET]
    DWORD VTABLE(int INDEX)
    { DWORD hD3D;
    // wait for the d3dx dll
    hD3D=0;
    do {
    hD3D = (DWORD)GetModuleHandleA("d3d9.dll");
    Sleep(10);
    } while(!hD3D);
    LPDIRECT3D9 pD3d9 = NULL;
    LPDIRECT3DDEVICE9 pD3DDevice = NULL;
    pD3d9 = Direct3DCreate9(D3D_SDK_VERSION);
    if(pD3d9 == NULL){
    return -1;
    }
    D3DPRESENT_PARAMETERS pPresentParms;
    ZeroMemory(&pPresentParms,sizeof(pPresentParms));
    pPresentParms.Windowed = TRUE;
    pPresentParms.BackBufferFormat = D3DFMT_UNKNOWN;
    pPresentParms.SwapEffect = D3DSWAPEFFECT_DISCARD;
    if(FAILED(pD3d9->CreateDevice(D3DADAPTER_DEFAULT,D3DDEVTYPE_HAL,Ge tDesktopWindow(),D3DCREATE_SOFTWARE_VERTEXPROCESSI NG,&pPresentParms,&pD3DDevice))){
    return -1;
    }
    DWORD * dwTable = ( DWORD* )pD3DDevice;
    dwTable = ( DWORD* ) dwTable[0];
    /*
    dwTable[16];//reset
    dwTable[17];//present
    dwTable[82];//DrawIndexedPrimitive
    dwTable[100];//SetStreamSource
    dwTable[41];//BeginScene
    dwTable[42];//EndScene
    */
    return dwTable[INDEX];
    }
    [/highlight]
    Last edited by topblast; 03-31-2011 at 08:20 PM.
    I just like programming, that is all.

    Current Stuff:

    • GPU Programmer (Cuda)
    • Client/Server (Cloud Server)
    • Mobile App Development