Results 1 to 7 of 7
  1. #1
    paradoxcod4's Avatar
    Join Date
    Oct 2010
    Gender
    male
    Posts
    19
    Reputation
    10
    Thanks
    8

    How to Make Wallhack

    Code:
    include <windows.h>
    #include <stdio.h>
    #include <fstream>
    #include "cDetours.h"
    #include <d3d9.h>
    #include <d3dx9.h>
    #pragma comment(lib, "d3d9.lib")
    #pragma comment(lib, "d3dx9.lib")
    
    #define HOOK(func,addy) o##func = (t##func)CreateDetour((DWORD)hk##func,(DWORD)addy,Detour_Type_0xB8,7)//Quick Hook using CreateDetour *********
    #define UNHOOK(func,addy) o##func = (t##func)CreateDetour((DWORD)o##func,(DWORD)addy,Detour_Type_0xB8,7)//Quick Unook using CreateDetour *********
    typedef HRESULT (WINAPI* tEndScene)(LPDIRECT3DDEVICE9 pDevice);
    tEndScene oEndScene = NULL;
    
    typedef HRESULT (WINAPI* tDrawIndexedPrimitive)(LPDIRECT3DDEVICE9 pDevice, D3DPRIMITIVETYPE PrimType,INT BaseVertexIndex,UINT MinVertexIndex,UINT NumVertices,UINT startIndex,UINT primCount);
    tDrawIndexedPrimitive oDrawIndexedPrimitive = NULL;
    
    typedef HRESULT(WINAPI* tReset)(LPDIRECT3DDEVICE9 pDevice, D3DPRESENT_PARAMETERS* pPresentationParameters);
    tReset oReset = NULL;
    
    LPDIRECT3DDEVICE9 npDevice;
    
    LPD3DXLINE g_pLine = NULL;
    D3DVIEWPORT9 g_ViewPort;
    
    LPDIRECT3DVERTEXBUFFER9 Stream_Data;
    UINT Offset = 0;
    UINT Stride = 0;
    bool WallHack = true;
    bool chams = true;
    int m_stride;
    
    LPDIRECT3DDEVICE9 g_pDevice = 0;
    
    int b = 0;
    
    LPDIRECT3DTEXTURE9 g_Blue = NULL;
    const BYTE Blue [60] =
    {
    0x42, 0x4D, 0x3C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x00, 0x36, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00,
    0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01,
    0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x00, 0x00, 0x12, 0x0B, 0x00, 0x00, 0x12, 0x0B, 0x00,
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0xFF, 0x00, 0x00, 0x00, 0x00, 0x00
    };
    
    LPDIRECT3DTEXTURE9 g_Oren = NULL;
    const BYTE oren[ 58 ] = {
    0x42, 0x4D, 0x3A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x00, 0x28, 0x00,
    0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x18, 0x00, 0x00, 0x00,
    0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xA5, 0xFF, 0x00
    };
    
    LPDIRECT3DTEXTURE9 g_Muda = NULL;
    const BYTE muda[60] =
    {
    0x42, 0x4D, 0x3C, 0x00,0x00, 0x00,
    0x00, 0x00, 0x00, 0x00, 0x36, 0x00,
    0x00, 0x00, 0x28, 0x00, 0x00, 0x00,
    0x01, 0x00, 0x00, 0x00, 0x01,0x00,
    0x00, 0x00, 0x01, 0x00, 0x20, 0x00,
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x00, 0x00, 0x12, 0x0B, 0x00, 0x00,
    0x12, 0x0B, 0x00, 0x00, 0x00, 0x00,
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0xFF, 0x80, 0x00, 0x00, 0x00, 0x00
    };
    
    void ReFont(LPDIRECT3DDEVICE9 pDevice)
    {
    if (g_pDevice != pDevice)
    {
    g_pDevice = pDevice;
    }
    }
    
    PBYTE HookVTableFunction( PDWORD* dwVTable, PBYTE dwHook, INT Index )
    {
    DWORD dwOld = 0;
    PBYTE pOrig = ((PBYTE)(*dwVTable)[Index]);
    (*dwVTable)[Index] = (DWORD)dwHook;
    return pOrig;
    }
    HRESULT WINAPI hkEndScene(LPDIRECT3DDEVICE9 pDevice)
    {
    
    while(!npDevice) {
    npDevice = pDevice; 
    }
    
    if(g_Oren == NULL) D3DXCreateTextureFromFileInMemory(pDevice, (LPCVOID)&oren, sizeof(oren), &g_Oren);
    if(g_Blue == NULL) D3DXCreateTextureFromFileInMemory(pDevice, (LPCVOID)&Blue, sizeof(Blue), &g_Blue); 
    if(g_Muda == NULL) D3DXCreateTextureFromFileInMemory(pDevice, (LPCVOID)&muda, sizeof(muda), &g_Muda); 
    
    if(g_pLine == NULL) D3DXCreateLine(pDevice, &g_pLine);
    
    pDevice->GetViewport(&g_ViewPort);
    if(g_Blue == NULL) D3DXCrea[Maaf Saya Kasar]xtureFromFileInMemory(pDevice, (LPCVOID)&Blue, sizeof(Blue), &g_Blue);
    if(g_pLine != NULL){
    }
    return oEndScene(pDevice);
    }
    HRESULT WINAPI hkDrawIndexedPrimitive(LPDIRECT3DDEVICE9 pDevice, D3DPRIMITIVETYPE PrimType,INT BaseVertexIndex,UINT MinVertexIndex,UINT NumVertices,UINT startIndex,UINT primCount)
    {
    if(pDevice->GetStreamSource(0, &Stream_Data, &Offset, &Stride) == D3D_OK)
    Stream_Data->Release();
    
    if(WallHack)
    {
    if(m_stride==52)
    {
    
    DWORD dwOldZEnable;
    pDevice-> GetRenderState (D3DRS_ZENABLE, & dwOldZEnable);
    pDevice-> SetRenderState (D3DRS_ZENABLE, D3DZB_FALSE);
    oDrawIndexedPrimitive(pDevice, PrimType, BaseVertexIndex, MinVertexIndex, NumVertices, startIndex, primCount);
    }
    }
    
    if(chams)
    {
    if(m_stride==44)
    {
    DWORD dwOldZEnable;
    pDevice-> GetRenderState (D3DRS_ZENABLE, & dwOldZEnable);
    pDevice-> SetRenderState (D3DRS_ZENABLE, D3DZB_FALSE);
    pDevice->SetRenderState( D3DRS_FILLMODE,D3DFILL_SOLID );
    pDevice->SetTexture( 0, g_Oren);
    oDrawIndexedPrimitive(pDevice, PrimType, BaseVertexIndex, MinVertexIndex, NumVertices, startIndex, primCount);
    pDevice-> SetRenderState (D3DRS_ZENABLE, dwOldZEnable);
    } 
    }
    
    return oDrawIndexedPrimitive(pDevice, PrimType, BaseVertexIndex, MinVertexIndex, NumVertices, startIndex, primCount);
    
    }
    HRESULT WINAPI hkReset(LPDIRECT3DDEVICE9 pDevice, D3DPRESENT_PARAMETERS* pPresentationParameters)
    {
    if( g_pLine )
    g_pLine->OnLostDevice();
    
    HRESULT iReturnValue = oReset(pDevice, pPresentationParameters);
    
    if(iReturnValue == D3D_OK) {
    
    if( g_pLine )
    g_pLine->OnResetDevice();
    }
    HRESULT hRet = oReset(pDevice, pPresentationParameters);
    return iReturnValue;
    }
    
    DWORD CreateDetour(DWORD dwThread,DWORD dwAdress,DWORD dwType,DWORD dwSize)
    {
    DWORD dwDetour,dwProtect,i;
    if (dwAdress&&dwThread&&dwSize>= dwSize)
    {
    dwDetour = (DWORD)VirtualAlloc(0,dwSize+dwSize,0x1000,0x40);
    if (dwDetour&&VirtualProtect((VOID*)dwAdress,dwSize,0x40,&dwProtect))
    {
    for (i=0;i<dwSize;i++) 
    {
    *(BYTE*)(dwDetour+i)=*(BYTE*)(dwAdress+i);
    }
    switch (dwType)
    {
    case Detour_Type_0xE9:
    {
    *(BYTE*)(dwDetour+dwSize+0)=0xE9;
    *(DWORD*)(dwDetour+dwSize+1)=(dwAdress-dwDetour-dwSize);
    *(BYTE*)(dwAdress+0)=0xE9;
    *(DWORD*)(dwAdress+1)=(dwThread-dwAdress-dwSize);
    }
    break;
    case Detour_Type_0xB8:
    {
    *(BYTE*)(dwDetour+dwSize+0)=0xB8;
    *(DWORD*)(dwDetour+dwSize+1)=(dwAdress+dwSize);
    *(WORD*)(dwDetour+dwSize+5)=0xE0FF; 
    *(BYTE*)(dwAdress+0)=0xB8; 
    *(DWORD*)(dwAdress+1)=(dwThread);
    *(WORD*)(dwAdress+5)=0xE0FF; 
    }
    break;
    case Detour_Type_0x68:
    {
    *(BYTE*)(dwDetour+dwSize+0)=0x68;
    *(DWORD*)(dwDetour+dwSize+1)=(dwAdress+dwSize);
    *(WORD*)(dwDetour+dwSize+5)=0xC3; 
    *(BYTE*)(dwAdress+0)=0x68; 
    *(DWORD*)(dwAdress+1)=(dwThread);
    *(WORD*)(dwAdress+5)=0xC3; 
    }
    break;
    }
    VirtualProtect((VOID*)dwAdress,dwSize,dwProtect,&dwProtect);
    VirtualProtect((VOID*)dwDetour,dwSize+dwSize,0x20,&dwProtect);
    return dwDetour;
    }
    }
    Sleep(15);
    return (0);
    }
    
    //This is the HOOK// 
    
    BOOL WINAPI DllMain(HMODULE hModule, DWORD dwReason, LPVOID lpvReserved)
    {
    if(dwReason == DLL_PROCESS_ATTACH){
    Beep(100,1000);
    
    CreateThread(0, 0, LoopFunction, 0, 0, 0);
    }
    return TRUE;

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

    lowbotnoob (11-27-2012),veryniceguy (11-27-2012)

  3. #2
    lowbotnoob's Avatar
    Join Date
    Nov 2012
    Gender
    male
    Posts
    12
    Reputation
    10
    Thanks
    2
    Very nice tutorial,i already made myself one

  4. #3
    Marindax12's Avatar
    Join Date
    Nov 2012
    Gender
    male
    Posts
    1
    Reputation
    10
    Thanks
    0
    Uhhm where do i put it in ?

  5. #4
    veryniceguy's Avatar
    Join Date
    Nov 2012
    Gender
    male
    Posts
    14
    Reputation
    10
    Thanks
    15
    Just download C++ then copy all the files press compile and your good to go

  6. #5
    The Corvo's Avatar
    Join Date
    Aug 2012
    Gender
    male
    Location
    $_SERVER['REMOTE_ADDR']
    Posts
    1,635
    Reputation
    270
    Thanks
    2,357
    My Mood
    Angelic
    Complaining about my post....

    You make a CTRL+C CTRL+V post.....

    Also you leeched this
    Last edited by The Corvo; 11-27-2012 at 12:46 PM.
    I'm only giving my skype through PM. If you got added by someone claiming to be me verify it with a pm!

  7. #6
    vistamtigamami's Avatar
    Join Date
    Oct 2010
    Gender
    male
    Posts
    18
    Reputation
    10
    Thanks
    5
    its very simpl i just made it works great[COLOR="Silver"]

  8. #7
    gamerhen's Avatar
    Join Date
    Dec 2012
    Gender
    male
    Location
    Nebraska
    Posts
    3
    Reputation
    10
    Thanks
    1
    My Mood
    Confused
    ok a little more instruction please im new to this!

Similar Threads

  1. [Tutorial] How to make WallHack
    By irish4 in forum Point Blank Hacks
    Replies: 5
    Last Post: 03-06-2011, 02:02 PM
  2. [HELP] HOW TO MAKE WALLHACK IN ONLINE GAME
    By gaymar001 in forum C++/C Programming
    Replies: 18
    Last Post: 05-07-2010, 04:01 PM
  3. [Help] how to make wallhack work on windows7?
    By apostolakis in forum CrossFire Hacks & Cheats
    Replies: 20
    Last Post: 02-17-2010, 05:15 PM
  4. How to make wallhack act like chams
    By JLJ1111 in forum Combat Arms Hacks & Cheats
    Replies: 24
    Last Post: 08-27-2009, 10:48 AM
  5. How I make wallhack?
    By RaidenDXX in forum WarRock - International Hacks
    Replies: 6
    Last Post: 01-23-2006, 01:28 PM