Would you like to react to this message? Create an account in a few clicks or log in to continue.

Source Code WallHack

5 posters

 :: C++

Go down

Source Code WallHack Empty Source Code WallHack

Post by Agoeng_Jr Sat Jun 11, 2011 3:01 pm

Name.cpp
Code:


#include <windows.h>
#include <stdio.h>
#include <fstream>
#include "detours.h"
#pragma comment(lib,"detours.lib")
#include <d3d9.h>
#include <d3dx9.h>
#pragma comment(lib, "d3d9.lib")
#pragma comment(lib, "d3dx9.lib")
#define HOOK(func,addy) o##func = (t##func)DetourFunction((PBYTE)addy,(PBYTE)hk##func)
#define UNHOOK(func,addy) o##func = (t##func)DetourFunction((PBYTE)addy,(PBYTE)o##func)
#define ES  0
#define DIP 1
#define RES 2
#define SSS 3
#define SVP 4

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
};

typedef HRESULT (WINAPI* tEndScene)(LPDIRECT3DDEVICE9 pDevice);
tEndScene oEndScene = NULL;

typedef HRESULT (WINAPI* tSetViewport)(LPDIRECT3DDEVICE9 pDevice,CONST D3DVIEWPORT9* pViewport);
tSetViewport oSetViewport;


typedef HRESULT (WINAPI* tSetStreamSource)(LPDIRECT3DDEVICE9 pDevice,UINT StreamNumber,IDirect3DVertexBuffer9* pStreamData,UINT OffsetInBytes,UINT Stride);
tSetStreamSource oSetStreamSource;

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;





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)      D3DXCreateTextureFromFileInMemory(pDevice, (LPCVOID)&Blue, sizeof(Blue), &g_Blue);
        if(g_pLine != NULL){
        }
    return oEndScene(pDevice);
}
//---------------------------------------------------------------------------------------------------------------------------------

HRESULT WINAPI hkSetViewport(LPDIRECT3DDEVICE9 pDevice,CONST D3DVIEWPORT9* pViewport)
{   
        return oSetViewport(pDevice,pViewport);
}

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;
}

HRESULT WINAPI hkSetStreamSource(LPDIRECT3DDEVICE9 pDevice,UINT StreamNumber,IDirect3DVertexBuffer9* pStreamData,UINT OffsetInBytes,UINT Stride)
{
        if(StreamNumber == 0){
                m_stride = Stride;
        }
        return oSetStreamSource(pDevice, StreamNumber, pStreamData, OffsetInBytes, Stride);
}
LRESULT CALLBACK MsgProc(HWND hwnd,UINT uMsg,WPARAM wParam,LPARAM lParam){return DefWindowProc(hwnd, uMsg, wParam, lParam);}
void DX_Init(DWORD* table)
{
    WNDCLASSEX wc = {sizeof(WNDCLASSEX),CS_CLASSDC,MsgProc,0L,0L,GetModuleHandle(NULL),NULL,NULL,NULL,NULL,"DX",NULL};
    RegisterClassEx(&wc);
    HWND hWnd = CreateWindow("DX",NULL,WS_OVERLAPPEDWINDOW,100,100,300,300,GetDesktopWindow(),NULL,wc.hInstance,NULL);
    LPDIRECT3D9 pD3D = Direct3DCreate9( D3D_SDK_VERSION );
    D3DPRESENT_PARAMETERS d3dpp;
    ZeroMemory( &d3dpp, sizeof(d3dpp) );
    d3dpp.Windowed = TRUE;
    d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD;
    d3dpp.BackBufferFormat = D3DFMT_UNKNOWN;
    LPDIRECT3DDEVICE9 pd3dDevice;
    pD3D->CreateDevice(D3DADAPTER_DEFAULT,D3DDEVTYPE_HAL,hWnd,D3DCREATE_SOFTWARE_VERTEXPROCESSING,&d3dpp,&pd3dDevice);
    DWORD* pVTable = (DWORD*)pd3dDevice;
    pVTable = (DWORD*)pVTable[0];
    table[ES]  = pVTable[42];             
    table[DIP]  = pVTable[82];               
    table[RES]  = pVTable[16];               
    table[SSS]  = pVTable[100];                                   
    DestroyWindow(hWnd);
}
DWORD WINAPI VirtualMethodTableRepatchingLoopToCounterExtensionRepatching( LPVOID  Param )
{
    while(1) {
        Sleep(100);
        HookVTableFunction((PDWORD*)npDevice, (PBYTE)hkDrawIndexedPrimitive, 82);
        HookVTableFunction((PDWORD*)npDevice, (PBYTE)hkEndScene, 42);
        HookVTableFunction((PDWORD*)npDevice, (PBYTE)hkReset, 16);
                HookVTableFunction((PDWORD*)npDevice, (PBYTE)hkSetStreamSource, 100);
    }
    return 1;
}

bool hooked = false;
DWORD WINAPI LoopFunction( LPVOID lpParam  )
{
        if( hooked == false) {
            DWORD VTable[5] = {0};

            while(GetModuleHandle("d3d9.dll")==NULL) {
                Sleep(250);
            }
            DX_Init(VTable);
            HOOK(EndScene,VTable[ES]);         

            while(!npDevice) {
                Sleep(50);
            }
            UNHOOK(EndScene, VTable[ES]);               
            *(PDWORD)&oDrawIndexedPrimitive = VTable[DIP];
            *(PDWORD)&oEndScene = VTable[ES];
            *(PDWORD)&oReset = VTable[RES];
                        *(PDWORD)&oSetStreamSource = VTable[SSS];
                        *(PDWORD)&oSetViewport = VTable[SVP];
            CreateThread(NULL,0,&VirtualMethodTableRepatchingLoopToCounterExtensionRepatching,NULL,0,NULL);
            hooked = true;

            Sleep(200);

        }

    return 0;
}
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;
}
Agoeng_Jr
Agoeng_Jr
Admin
Admin

Jumlah posting : 142
Reputation : 9
Join date : 05.12.10
Age : 33
Lokasi : Macazzarct City

http://c4-forum.web-rpg.org

Kembali Ke Atas Go down

Source Code WallHack Empty Re: Source Code WallHack

Post by anjnkgila Sun Jun 12, 2011 2:27 am

Itu Tinggal option Include&Lib nya kan Om Agoeng

apak SC itu Cuma Segitu

Mohon Penjelasanya...
anjnkgila
anjnkgila
C4~ Member
C4~ Member

Jumlah posting : 27
Reputation : 1000
Join date : 10.05.11

Kembali Ke Atas Go down

Source Code WallHack Empty Re: Source Code WallHack

Post by ala2728 Sun Jun 12, 2011 4:46 am

dll.h nya mana om agung ..
ala2728
ala2728
C4~ Member
C4~ Member

Jumlah posting : 13
Reputation : 1000
Join date : 09.05.11
Age : 29
Lokasi : Jakarta Utara

http://andre-cheater.blogspot.com/

Kembali Ke Atas Go down

Source Code WallHack Empty Re: Source Code WallHack

Post by anjnkgila Sun Jun 12, 2011 9:08 am

Apakah Ada dll.hnya

Om Agoeng Kenapa Pertanyaan Saya tidak pernah di Respone
anjnkgila
anjnkgila
C4~ Member
C4~ Member

Jumlah posting : 27
Reputation : 1000
Join date : 10.05.11

Kembali Ke Atas Go down

Source Code WallHack Empty Re: Source Code WallHack

Post by anjnkgila Sun Jun 12, 2011 9:12 am

Om Agoeng Saya Menggunakan C++ 2008
yg Seperti ini :


Microsoft Visual C++ 2008 Express Portable

[You must be registered and logged in to see this link.]



You need to install .NET frameworks 2.0 and 3.5 to run this properly.
Portable VS2008 will store his settings in Thin stall folder, and default project folder is in
Thin stall folder so it is recommended to change default location for your projects to some
folder on local drive but that is not necessary if you like that default project location.


Apakah Bisa Di Gunakan
anjnkgila
anjnkgila
C4~ Member
C4~ Member

Jumlah posting : 27
Reputation : 1000
Join date : 10.05.11

Kembali Ke Atas Go down

Source Code WallHack Empty Re: Source Code WallHack

Post by adhit234 Mon Jun 13, 2011 1:46 am

anjnkgila wrote:Om Agoeng Saya Menggunakan C++ 2008
yg Seperti ini :


Microsoft Visual C++ 2008 Express Portable

[You must be registered and logged in to see this link.]



You need to install .NET frameworks 2.0 and 3.5 to run this properly.
Portable VS2008 will store his settings in Thin stall folder, and default project folder is in
Thin stall folder so it is recommended to change default location for your projects to some
folder on local drive but that is not necessary if you like that default project location.


Apakah Bisa Di Gunakan
skedar saran mnding pke yg puull biar lngkap....
klo pke yg potable biasanya gk lengkap sourcenya............

adhit234
C4~ Member
C4~ Member

Jumlah posting : 1
Reputation : 1000
Join date : 13.06.11

Kembali Ke Atas Go down

Source Code WallHack Empty Re: Source Code WallHack

Post by KZR Tue Jun 14, 2011 12:22 pm

agung Ini Sich SC nya Maider Dari N3
itu kurang lengkap gan udah gituh skrng Hooknya sudah old
Yg vTable nya
maaf gun oot dikit

KZR
C4~ Member
C4~ Member

Jumlah posting : 1
Reputation : 1000
Join date : 14.06.11

Kembali Ke Atas Go down

Source Code WallHack Empty Re: Source Code WallHack

Post by Sponsored content


Sponsored content


Kembali Ke Atas Go down

Kembali Ke Atas

- Similar topics

 :: C++

 
Permissions in this forum:
Anda tidak dapat menjawab topik