Thread: Device Pointer

Page 2 of 2 FirstFirst 12
Results 16 to 24 of 24
  1. #16
    whit's Avatar
    Join Date
    Jan 2010
    Gender
    male
    Posts
    7,159
    Reputation
    490
    Thanks
    2,253
    O' Lawdy Can you post the whole Code

  2. #17
    aanthonyz's Avatar
    Join Date
    Aug 2010
    Gender
    male
    Location
    Hitler's Minivan
    Posts
    483
    Reputation
    27
    Thanks
    83
    My Mood
    Relaxed
    I already did...here it is again:
    Code:
    #include <windows.h>
    #include "Detour.h"
    #include <d3d9.h>
    
    typedef HRESULT(__stdcall* Real_EndScene)(LPDIRECT3DDEVICE9);
    Real_EndScene oEndScene = NULL;
    
    void *DetourFunc(BYTE *src, const BYTE *dst, const int len)
    {
    BYTE *jmp = (BYTE*)malloc(len+5);
    DWORD dwBack;
    VirtualProtect(src, len, PAGE_READWRITE, &dwBack);
    memcpy(jmp, src, len);
    jmp += len;
    jmp[0] = 0xE9;
    *(DWORD*)(jmp+1) = (DWORD)(src+len - jmp) - 5;
    src[0] = 0x90; //50
    src[1] = 0x90; // 58
    src[2] = 0xE9;
    *(DWORD*)(&src[3]) = (DWORD)(dst - src) - 7;
    for (int i=7; i<len; i++) src[i] = 0x90;
    VirtualProtect(src, len, dwBack, &dwBack);
    return (jmp-len);
    }
    
    HRESULT __stdcall hook_EndScene(LPDIRECT3DDEVICE9 pDevice)
    {
    	MessageBox(NULL,"Hooked","Hooked",MB_OK);
    	pDevice->SetRenderState(D3DRS_FILLMODE,D3DFILL_WIREFRAME);
    	return oEndScene(pDevice);
    }
    
    DWORD GetPointerDereference(int index)
    {
    	DWORD *DevicePointer = **(DWORD***)0x01C8ED88;
    	return DevicePointer[index];
    }
    
    DWORD GetPointerInlineAssembly(int index)
    {
    	DWORD DevicePointer = 0x01C8ED88;
    	__asm
    	{
    		mov eax,[DevicePointer]
    		mov ebx,[eax]
    		mov ecx,[ebx]
    		mov eax,index
    		mov ebx,4
    		mul ebx
    		mov edx,[ecx+eax]
    		mov DevicePointer,edx
    	}
    return DevicePointer;
    }
    
    void Hook()
    {
    	while(!GetModuleHandle("d3d9.dll"))
    	{
    		Sleep(100);
    	}
    	while( *(DWORD*)0x01C8ED88 == 0)
    	{
    		Sleep(100);
    	}
    	oEndScene = (Real_EndScene)DetourFunc((PBYTE)GetPointerInlineAssembly(42),(PBYTE)hook_EndScene,5);
    }
    
    bool __stdcall DllMain(HINSTANCE hInstance,DWORD reason, void* useless)
    {
    if(reason == DLL_PROCESS_ATTACH)
    	{
    	CreateThread(0,0,(LPTHREAD_START_ROUTINE)Hook,0,0,0);
    	}
    if(reason == DLL_PROCESS_DETACH)
    	{
    	}
    return true;
    }
    "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:


  3. #18
    why06's Avatar
    Join Date
    Jul 2009
    Gender
    male
    Location
    IBM
    Posts
    4,304
    Reputation
    170
    Thanks
    2,203
    My Mood
    Flirty
    Hmmm... I think I know what's wrong. When you created the project did you have precompiled header checked?

    "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

  4. #19
    ♪~ ᕕ(ᐛ)ᕗ's Avatar
    Join Date
    Jun 2010
    Gender
    male
    Location
    Uterus
    Posts
    9,119
    Reputation
    1096
    Thanks
    1,970
    My Mood
    Doh
    Quote Originally Posted by whit View Post
    i dont know who first thought of Hooking via Device Pionter
    where did u get that code?

  5. #20
    master131's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    Melbourne, Australia
    Posts
    8,858
    Reputation
    3438
    Thanks
    101,668
    My Mood
    Breezy
    I like copy pasta.
    Donate:
    BTC: 1GEny3y5tsYfw8E8A45upK6PKVAEcUDNv9


    Handy Tools/Hacks:
    Extreme Injector v3.7.3
    A powerful and advanced injector in a simple GUI.
    Can scramble DLLs on injection making them harder to detect and even make detected hacks work again!

    Minion Since: 13th January 2011
    Moderator Since: 6th May 2011
    Global Moderator Since: 29th April 2012
    Super User/Unknown Since: 23rd July 2013
    'Game Hacking' Team Since: 30th July 2013

    --My Art--
    [Roxas - Pixel Art, WIP]
    [Natsu - Drawn]
    [Natsu - Coloured]


    All drawings are coloured using Photoshop.

    --Gifts--
    [Kyle]

  6. #21
    whit's Avatar
    Join Date
    Jan 2010
    Gender
    male
    Posts
    7,159
    Reputation
    490
    Thanks
    2,253
    Quote Originally Posted by Play&Win View Post


    where did u get that code?
    What do you mean where i got it ?
    I typed it up myself

  7. #22
    aanthonyz's Avatar
    Join Date
    Aug 2010
    Gender
    male
    Location
    Hitler's Minivan
    Posts
    483
    Reputation
    27
    Thanks
    83
    My Mood
    Relaxed
    My project was empty.
    I chose Empty Project

    This code is copy and pasted from Void's tutorial. I want to get it to work first before I actually start learning from it.
    "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. #23
    aanthonyz's Avatar
    Join Date
    Aug 2010
    Gender
    male
    Location
    Hitler's Minivan
    Posts
    483
    Reputation
    27
    Thanks
    83
    My Mood
    Relaxed
    I resolved the issue, please close.
    "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:


  9. #24
    Hell_Demon's Avatar
    Join Date
    Mar 2008
    Gender
    male
    Location
    I love causing havoc
    Posts
    3,976
    Reputation
    343
    Thanks
    4,320
    My Mood
    Cheeky
    ~ closed on request ~
    Ah we-a blaze the fyah, make it bun dem!

Page 2 of 2 FirstFirst 12