Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*==============================================================*/
- // Source Credits ZrC-CyBâ„¢ Hacks || Copyright 2015
- // Creator & Edited By Y.L.A.S
- // Wallhack & Crosshair PointBlank Online || GameGuard XignCode3 OR Xtrap
- // Work Region Indonesia, Brazil, Thailand, Turkey, Global And Kaybo Server
- // Website : http://zero-cyberz-vip.net
- // Facebook : http://www.facebook.com/zero.cyberz.hacks
- // YouTube : http://www.youtube.com/channel/UCbug-ZLP4Yjo8KaXYLfLjtQ
- /*==============================================================*/
- #include <windows.h>
- #include "Include.h"
- #include "cStride.h"
- /*--------------------------------------------------------------*/
- #define PISSS 3.14159265
- #define GREEN D3DCOLOR_ARGB(255, 000, 255, 000)
- HMODULE hGfxDx = LoadLibrary("i3GfxDx.dll");
- LPTSTR PBi3Gfx = "i3GfxDx.dll";
- DWORD DwStartGfx = (DWORD)GetModuleHandleA(PBi3Gfx);
- LPDIRECT3DVERTEXBUFFER9 Stream_Data;
- D3DVIEWPORT9 g_ViewPort;
- LPDIRECT3DDEVICE9 npDevice, pGDevice;
- DWORD EndRender, ResultEndRender, g_pRenderContext, Resultg_pRenderContext;
- int Cross = 1; //True || On
- int Wallhack = 1; //True || On
- int DontSmoke = 1; //True || On
- int DontFog = 1; //True || On
- UINT Offset = 0;
- UINT Stride = 0;
- /*-------------------------------------------------------------------------------------------------------------------*/
- 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;
- /*---------------------------------------- Declaration D3DTLVERTEX ----------------------------------------------------*/
- struct D3DTLVERTEX
- {
- float fX;
- float fY;
- float fZ;
- float fRHW;
- D3DCOLOR Color;
- float fU;
- float fV;
- };
- D3DTLVERTEX CreateD3DTLVERTEX (float X, float Y, float Z, float RHW, D3DCOLOR color, float U, float V)
- {
- D3DTLVERTEX v;
- v.fX = X;
- v.fY = Y;
- v.fZ = Z;
- v.fRHW = RHW;
- v.Color = color;
- v.fU = U;
- v.fV = V;
- return v;
- }
- /*---------------------------------------- Declaration Circle ----------------------------------------------------*/
- void Circle( float x, float y, float rad, bool center, DWORD color ,LPDIRECT3DDEVICE9 pDevice)
- {
- const int NUMPOINTS = 34;
- if(!center)
- {
- x -= rad;
- y -= rad;
- }
- D3DTLVERTEX Circle[NUMPOINTS + 1];
- int i;
- float X;
- float Y;
- float Theta;
- float WedgeAngle;
- WedgeAngle = (float)( (2*PISSS) / NUMPOINTS );
- for( i=0; i<=NUMPOINTS; i++ )
- {
- Theta = i * WedgeAngle;
- X = (float)( x + rad * cos(Theta) );
- Y = (float)( y - rad * sin(Theta) );
- Circle[i] = CreateD3DTLVERTEX( X, Y, 0.0f, 1.0f, color, 0.0f, 0.0f );
- }
- pDevice->SetFVF( D3DFVF_XYZRHW | D3DFVF_DIFFUSE | D3DFVF_TEX1 );
- pDevice->SetTexture( 0, NULL );
- pDevice->DrawPrimitiveUP( D3DPT_LINESTRIP, NUMPOINTS, &Circle[0], sizeof(Circle[0]) );
- }
- /*---------------------------------------- Declaration FillRGB ----------------------------------------------------*/
- void FillRGB( int x, int y, int w, int h, D3DCOLOR color, IDirect3DDevice9* pDevice )
- {
- if( w < 0 )w = 1;
- if( h < 0 )h = 1;
- if( x < 0 )x = 1;
- if( y < 0 )y = 1;
- D3DRECT rec = { x, y, x + w, y + h };
- pDevice->Clear( 1, &rec, D3DCLEAR_TARGET, color, 0, 0 );
- }
- /*------------------------------------------- Declaration DrawCross ------------------------------------------------------*/
- void Crosshair(LPDIRECT3DDEVICE9 pDevice, D3DCOLOR Color)
- {
- int x = ( GetSystemMetrics( 0 ) / 2);
- int y = ( GetSystemMetrics( 1 ) / 2);
- Circle (x,y,6,true,Color,pDevice);
- FillRGB(x-10, y, 7, 1,Color,pDevice);
- FillRGB(x+4, y, 7, 1,Color,pDevice);
- FillRGB(x, y-10, 1, 7,Color,pDevice);
- FillRGB(x, y+4, 1, 7,Color,pDevice);
- }
- void DrawCrosshair(LPDIRECT3DDEVICE9 pDevice)
- {
- if(Cross)
- {
- Crosshair(pDevice, GREEN);
- }
- }
- /*------------------------------------------- Declaration DrawEndScene ------------------------------------------------------*/
- HRESULT WINAPI hkEndScene(LPDIRECT3DDEVICE9 pDevice)
- {
- pDevice->GetViewport(&g_ViewPort);
- DrawCrosshair(pDevice);
- return oEndScene(pDevice);
- }
- /*------------------------------------------- Declaration DrawIndexPrim ------------------------------------------------------*/
- 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();
- }
- /*--------------------------------- Declaration Wallhack --------------------------------------------*/
- if(Wallhack)
- {
- if(All_Stide)
- {
- pDevice->Clear(0, 0, D3DCLEAR_ZBUFFER, D3DCOLOR_XRGB(0, 0, 0), 1.0f, 0);
- oDrawIndexedPrimitive(pDevice, PrimType, BaseVertexIndex, MinVertexIndex, NumVertices, startIndex, primCount);
- }
- }
- /*--------------------------------- Declaration NoSmoke --------------------------------------------*/
- if(DontSmoke)
- {
- if ((NumVertices == 192) || (NumVertices == 256))
- {
- return D3D_OK;
- return 0;
- }
- }
- /*--------------------------------- Declaration NoFog Map --------------------------------------------*/
- if(DontFog)
- {
- pDevice->SetRenderState(D3DRS_FOGENABLE, false);
- }
- return oDrawIndexedPrimitive(pDevice, PrimType, BaseVertexIndex, MinVertexIndex, NumVertices, startIndex, primCount);
- }
- /*------------------------------------------- Declaration DrawReset ------------------------------------------------------*/
- HRESULT WINAPI hkReset(LPDIRECT3DDEVICE9 pDevice, D3DPRESENT_PARAMETERS* pPresentationParameters)
- {
- if(oReset == D3D_OK)
- {
- }
- return oReset(pDevice, pPresentationParameters);
- }
- /*------------------------------------------- Declaration Function ------------------------------------------------------*/
- void Hooked(PDWORD target, PDWORD newfunc)
- {
- DWORD Jmpto=(DWORD)(newfunc)-(DWORD)target-5;
- DWORD a;
- VirtualProtect(target, 8, PAGE_EXECUTE_READWRITE, &a);
- *(PBYTE)(target)=0xE9;
- *(PDWORD)((DWORD)(target)+1)=Jmpto;
- VirtualProtect(target, 8, a, &a);
- }
- /*------------------------------------------- Declaration SearchAddress ------------------------------------------------------*/
- void SearchAddress(void)
- {
- DWORD DwStartAddress = 0x400000;
- do {
- DwStartAddress = (DWORD)GetModuleHandle("PointBlank.exe");
- }while(!DwStartAddress);
- EndRender = (DWORD)GetProcAddress(GetModuleHandleA(PBi3Gfx), "?EndRender@i3RenderContext@@QAEXXZ");
- g_pRenderContext = (DWORD)GetProcAddress(GetModuleHandleA(PBi3Gfx), "?g_pRenderContext@@3PAVi3RenderContext@@A");
- Resultg_pRenderContext = g_pRenderContext;
- ReadProcessMemory(GetCurrentProcess(), (LPCVOID) (EndRender+0x2), &ResultEndRender, sizeof(ResultEndRender), NULL);
- }
- /*------------------------------------------- Declaration HookEngine ------------------------------------------------------*/
- DWORD WINAPI HookEngine(void)
- {
- if (hGfxDx > 0){
- DWORD tmp1 = Resultg_pRenderContext;
- DWORD tmp2 = 0;
- Sleep(1);
- while(!pGDevice){
- if(IsBadReadPtr((PDWORD)tmp1,4)==NULL)tmp2 = *(PDWORD)((DWORD)(tmp1))+ResultEndRender;
- Sleep(1);
- if(IsBadReadPtr((PDWORD)tmp2,4)==NULL){
- DWORD OldProtect;
- VirtualProtect((void*)(tmp2), 4, PAGE_EXECUTE_READWRITE, &OldProtect);
- memcpy(&pGDevice, (void *)tmp2, 4);
- VirtualProtect((void*)(tmp2), 4, OldProtect, NULL);}
- }
- DWORD *g_pDevice = (DWORD*)pGDevice;
- g_pDevice = (DWORD*)g_pDevice[0];
- while(!npDevice)npDevice = (LPDIRECT3DDEVICE9)(DWORD*)g_pDevice;
- *(PDWORD)&oEndScene = g_pDevice[42];
- *(PDWORD)&oDrawIndexedPrimitive = g_pDevice[82];
- *(PDWORD)&oReset = g_pDevice[16];
- Hooked((PDWORD)(g_pDevice[1] - 5), (PDWORD)(g_pDevice[4] - 5));
- Hooked((PDWORD)(g_pDevice[2] - 5), (PDWORD)(g_pDevice[5] - 5));
- Hooked((PDWORD)(g_pDevice[3] - 5), (PDWORD)(g_pDevice[6] - 5));
- Hooked((PDWORD)(g_pDevice[4] - 5), (PDWORD)hkEndScene);
- Hooked((PDWORD)(g_pDevice[5] - 5), (PDWORD)hkDrawIndexedPrimitive);
- Hooked((PDWORD)(g_pDevice[6] - 5), (PDWORD)hkReset);
- for(;;)
- {
- g_pDevice[42] = (DWORD)g_pDevice[1] - 5;
- g_pDevice[82] = (DWORD)g_pDevice[2] - 5;
- g_pDevice[16] = (DWORD)g_pDevice[3] - 5;
- }
- Sleep(100);
- }
- return (0);
- }
- /*--------------------------------------- Declaration Caller AllThread --------------------------------------------------*/
- void ZrCCyBCallerThread(void)
- {
- SearchAddress();
- CreateThread(NULL, NULL, (LPTHREAD_START_ROUTINE)HookEngine,NULL,NULL,NULL);
- }
- /*------------------------------------------- Declaration Attach Dll ------------------------------------------------------*/
- BOOL WINAPI DllMain(HMODULE hModule, DWORD dwReason, LPVOID lpvReserved)
- {
- if(dwReason == DLL_PROCESS_ATTACH){
- DisableThreadLibraryCalls(hModule);
- CreateThread(NULL, NULL, (LPTHREAD_START_ROUTINE)ZrCCyBCallerThread,NULL,NULL,NULL);
- Beep(1000, 100);
- }
- return TRUE;
- }
- /*-------------------------------------------------------------------------------------------------------------------*/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement