Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "CMenu.h"
- #include "CSound.h"
- #include "Main.h"
- #include <detours.h>
- #pragma message("credits :")
- #pragma message("HighBrow")
- #pragma message("UC")
- #pragma message("Seller -> zNova")
- #pragma message("Thanks for BUYING")
- cMenu Menu;
- copt opt;
- cSound Sound;
- float ScreenCenterX = 0.0f;
- float ScreenCenterY = 0.0f;
- typedef HRESULT(APIENTRY *SetStreamSource_t)(IDirect3DDevice9*, UINT, IDirect3DVertexBuffer9*, UINT, UINT);
- HRESULT APIENTRY SetStreamSource_hook(IDirect3DDevice9*, UINT, IDirect3DVertexBuffer9*, UINT, UINT);
- SetStreamSource_t SetStreamSource_orig = 0;
- typedef HRESULT(APIENTRY *SetTexture_t)(IDirect3DDevice9*, DWORD, IDirect3DBaseTexture9 *);
- HRESULT APIENTRY SetTexture_hook(IDirect3DDevice9*, DWORD, IDirect3DBaseTexture9 *);
- SetTexture_t SetTexture_orig = 0;
- typedef HRESULT(APIENTRY* Present_t) (IDirect3DDevice9*, const RECT *, const RECT *, HWND, const RGNDATA *);
- HRESULT APIENTRY Present_hook(IDirect3DDevice9*, const RECT *, const RECT *, HWND, const RGNDATA *);
- Present_t Present_orig = 0;
- typedef HRESULT(APIENTRY *DrawIndexedPrimitive_t)(IDirect3DDevice9*, D3DPRIMITIVETYPE, INT, UINT, UINT, UINT, UINT);
- HRESULT APIENTRY DrawIndexedPrimitive_hook(IDirect3DDevice9*, D3DPRIMITIVETYPE, INT, UINT, UINT, UINT, UINT);
- DrawIndexedPrimitive_t DrawIndexedPrimitive_orig = 0;
- typedef HRESULT(APIENTRY *SetVertexShaderConstantF_t)(IDirect3DDevice9*, UINT, const float*, UINT);
- HRESULT APIENTRY SetVertexShaderConstantF_hook(IDirect3DDevice9*, UINT, const float*, UINT);
- SetVertexShaderConstantF_t SetVertexShaderConstantF_orig = 0;
- typedef HRESULT(APIENTRY *GetRenderTargetData_t)(IDirect3DDevice9*, IDirect3DSurface9 *pRenderTarget, IDirect3DSurface9 *pDestSurface);
- GetRenderTargetData_t oGetRenderTargetData = 0;
- typedef HRESULT(APIENTRY *CreateOffscreenPlainSurface_t)(IDirect3DDevice9*, UINT Width, UINT Height, D3DFORMAT Format, D3DPOOL Pool, IDirect3DSurface9 **ppSurface, HANDLE *pSharedHandle);
- CreateOffscreenPlainSurface_t oCreateOffscreenPlainSurface = 0;
- //SAVE THE ENDSCENE FOR FUTURE PLANS ;)
- //typedef HRESULT(APIENTRY* EndScene_t) (IDirect3DDevice9*);
- //HRESULT APIENTRY EndScene_hook(IDirect3DDevice9*);
- //EndScene_t EndScene_orig = 0;
- typedef HRESULT(APIENTRY *Reset_t)(IDirect3DDevice9*, D3DPRESENT_PARAMETERS*);
- HRESULT APIENTRY Reset_hook(IDirect3DDevice9*, D3DPRESENT_PARAMETERS*);
- Reset_t Reset_orig = 0;
- //==========================================================================================================================
- HRESULT APIENTRY hkGetRenderTargetData(LPDIRECT3DDEVICE9 pDevice, IDirect3DSurface9 *pRenderTarget, IDirect3DSurface9 *pDestSurface)
- {
- //called
- screenshot_taken = true;
- //temp disable visuals (it is too late to do this, screens are still dirty)
- opt.d3d.chams = 0;
- opt.d3d.grass = 0;
- opt.misc.fog = 0;
- //Log("pRenderTarget == %d && pDestSurface == %d", pRenderTarget, pDestSurface);
- return oGetRenderTargetData(pDevice, pRenderTarget, pDestSurface);
- }
- //==========================================================================================================================
- HRESULT APIENTRY hkCreateOffscreenPlainSurface(LPDIRECT3DDEVICE9 pDevice, UINT Width, UINT Height, D3DFORMAT Format, D3DPOOL Pool, IDirect3DSurface9 **ppSurface, HANDLE *pSharedHandle)
- {
- //temp disable visuals (it is too late to do this, screens are still dirty)
- opt.d3d.chams = 0;
- opt.d3d.grass = 0;
- opt.misc.fog = 0;
- screenshot_taken = true;
- //prevent local screenshot (is screenshot still uploaded to gm?)
- Width = 1;
- Height = 1;
- //Log("Width == %d && Height == %d && Format == %d && Pool == %d", Width, Height, Format, Pool);
- Log("Screenshot blocked.");
- return oCreateOffscreenPlainSurface(pDevice, Width, Height, Format, Pool, ppSurface, pSharedHandle);
- }
- //==========================================================================================================================
- HRESULT APIENTRY SetStreamSource_hook(LPDIRECT3DDEVICE9 pDevice, UINT StreamNumber, IDirect3DVertexBuffer9* pStreamData, UINT OffsetInBytes, UINT sStride)
- {
- if (StreamNumber == 0)
- Stride = sStride;
- return SetStreamSource_orig(pDevice, StreamNumber, pStreamData, OffsetInBytes, sStride);
- }
- HRESULT APIENTRY SetVertexShaderConstantF_hook(LPDIRECT3DDEVICE9 pDevice, UINT StartRegister, const float *pConstantData, UINT Vector4fCount)
- {
- if (pConstantData != NULL)
- {
- mStartregister = StartRegister;
- mVectorCount = Vector4fCount;
- }
- return SetVertexShaderConstantF_orig(pDevice, StartRegister, pConstantData, Vector4fCount);
- }
- //==========================================================================================================================
- HRESULT APIENTRY SetTexture_hook(LPDIRECT3DDEVICE9 pDevice, DWORD Sampler, IDirect3DBaseTexture9 *pTexture)
- {
- if (InitOnce)
- {
- InitOnce = false;
- pDevice->GetViewport(&Viewport);
- ScreenCX = (float)Viewport.Width / 2.0f;
- ScreenCY = (float)Viewport.Height / 2.0f;
- }
- //get vSize
- if (SUCCEEDED(pDevice->GetVertexShader(&vShader)))
- if (vShader != NULL)
- if (SUCCEEDED(vShader->GetFunction(NULL, &vSize)))
- if (vShader != NULL) { vShader->Release(); vShader = NULL; }
- //wallhack
- if (opt.d3d.chams > 0)
- {
- pDevice->SetRenderState(D3DRS_DEPTHBIAS, 0);
- if ((vSize == 2356 || vSize == 900 || vSize == 2008 || vSize == 640) || (Stride == 36 && vSize == 1436) || (Stride == 48 && vSize == 1436))
- //if (vSize == 2008|| vSize == 2356|| vSize == 640 || vSize == 1436)
- {
- if (opt.d3d.chams == 2 && vSize != 1436)
- {
- float sColor[4] = { 0.0f, 1.0f, 0.0f, 1.0f };//green
- pDevice->SetPixelShaderConstantF(0, sColor, 1);
- //SetTexture_orig(pDevice, 0, Red);
- //SetTexture_orig(pDevice, 1, Red);
- }
- float bias = 1000.0f;
- float bias_float = static_cast<float>(-bias);
- bias_float /= 10000.0f;
- pDevice->SetRenderState(D3DRS_DEPTHBIAS, *(DWORD*)&bias_float);
- }
- }
- //worldtoscreen weapons in hand
- if (opt.Aimbot.aimbot == 1 || opt.ESP.activate > 0)
- {
- if ((Stride == 48 && vSize > 1328) || (vSize == 2356 || vSize == 2008 || vSize == 1552))//1040crap,1328crap
- //if (Stride == 48 || vSize == 2008 || vSize == 1552)
- AddWeapons(pDevice);
- }
- if (opt.d3d.nograss == 1)
- {
- pDevice->SetRenderState(D3DRS_FILLMODE, D3DFILL_SOLID);
- if (vSize == 1660 || vSize == 1704)//grass
- {
- pDevice->SetRenderState(D3DRS_FILLMODE, D3DFILL_POINT);
- }
- }
- if (opt.d3d.nofog == 1)
- {
- if (Stride == 48 || vSize == 2008 || vSize == 2356)
- {
- D3DXMATRIX matLegs;
- D3DXMatrixScaling(&matLegs, 0.0f, 0.0f, 0.0f);
- pDevice->SetVertexShaderConstantF(20, matLegs, 1);//legs
- D3DXMATRIX matChest;
- D3DXMatrixScaling(&matChest, 0.0f, 0.0f, 0.0f);
- pDevice->SetVertexShaderConstantF(25, matChest, 1);//chest
- }
- }
- if (opt.d3d.swireframe == 1)
- {
- if (Stride == 44)
- {
- pDevice->SetRenderState(D3DRS_FILLMODE, D3DFILL_WIREFRAME);
- }
- if (Stride == 40)
- {
- pDevice->SetRenderState(D3DRS_FILLMODE, D3DFILL_WIREFRAME);
- }
- if (Stride == 32)
- {
- pDevice->SetRenderState(D3DRS_FILLMODE, D3DFILL_WIREFRAME);
- }
- }
- if (opt.d3d.swireframe == 2)
- {
- if (Stride == 44)
- {
- pDevice->SetRenderState(D3DRS_FILLMODE, D3DFILL_POINT);
- }
- if (Stride == 40)
- {
- pDevice->SetRenderState(D3DRS_FILLMODE, D3DFILL_POINT);
- }
- if (Stride == 32)
- {
- pDevice->SetRenderState(D3DRS_FILLMODE, D3DFILL_POINT);
- }
- }
- if (!opt.d3d.swireframe)
- {
- if (Stride == 44)
- {
- pDevice->SetRenderState(D3DRS_FILLMODE, D3DFILL_SOLID);
- }
- if (Stride == 40)
- {
- pDevice->SetRenderState(D3DRS_FILLMODE, D3DFILL_SOLID);
- }
- if (Stride == 32)
- {
- pDevice->SetRenderState(D3DRS_FILLMODE, D3DFILL_SOLID);
- }
- }
- return SetTexture_orig(pDevice, Sampler, pTexture);
- }
- void zNova(void *adress, void *bytes, int size)
- {
- DWORD dwProtect;
- VirtualProtect((void*)adress, size, PAGE_EXECUTE_READWRITE, &dwProtect);
- memcpy((void *)adress, (PBYTE)bytes, size);
- VirtualProtect((void*)adress, size, dwProtect, &dwProtect);
- }
- //Memory Hacks
- DWORD WINAPI FF(LPVOID param)
- {
- DWORD Baser;
- Baser = (DWORD)GetModuleHandleA("ros.exe");
- while(1)
- //nag [atch ba ros ? hindi pa
- {
- if (opt.misc.FastFall == 1)
- {
- //ok na w sa fast fall ? auto on nalang cguro sige
- if (GetAsyncKeyState(VK_F10) & 1)
- {
- *(float*)(*(DWORD*)(*(DWORD*)(*(DWORD*)(*(DWORD*)(*(DWORD*)(Baser + physics) + 0x0) + 0x40) + 0x4) + 0x10) + 0x4C) = 990.0f;
- }
- if (!opt.misc.FastFall)
- {
- *(float*)(*(DWORD*)(*(DWORD*)(*(DWORD*)(*(DWORD*)(*(DWORD*)(Baser + physics) + 0x0) + 0x40) + 0x4) + 0x10) + 0x4C) = 450.0f;
- }
- }
- Sleep(10);
- }
- return 0;
- }
- void Crap(void)
- {
- //messy coding is it ?
- //ti's not global yet this works perfectly and i recommend a simple ingame check ;)
- //ito na yung memory hacks paano i update yung addys?
- //yung addys ako na bahala iuupdate kita lagi awtss
- //walang string to sa olly or ida sa C.E manual reverse wala akong aob nito mga to pero may tool panghanap dito cgeh2x
- //Defines Variables
- DWORD Base = (DWORD)GetModuleHandleA("ros.exe");
- const unsigned long Sky = (DWORD)GetModuleHandle(NULL) + 0x5432CA;
- const unsigned long grass = (DWORD)GetModuleHandle(NULL) + 0xC37F80;//grass updated
- const unsigned long ground = (DWORD)GetModuleHandle(NULL) + 0x16E4A28;
- const unsigned long ptw = (DWORD)GetModuleHandle(NULL) + 0x175A6B8;//ptw updated
- const unsigned long fogger = (DWORD)GetModuleHandle(NULL) + 0xC37FFE;//fog updated
- const unsigned long Zoom = (DWORD)GetModuleHandle(NULL) + 0x1716BCC;//updated
- const unsigned long water = (DWORD)GetModuleHandle(NULL) + 0x39665C;//updated
- const unsigned long fly = (DWORD)GetModuleHandle(NULL) + 0x182E5E0;//updated
- const unsigned long G = (DWORD)GetModuleHandle(NULL) + 0x16E9A28;
- const unsigned long B = (DWORD)GetModuleHandle(NULL) + 0x170A70C;
- const unsigned long Foliage = (DWORD)GetModuleHandle(NULL) + 0xBB5A94;
- if (!GetModuleHandleA("ros.exe")) return;
- memcpy((void*)(Base + 0x5432A2), "\xB8\xCA\x16\xDB\x42\x56\x8D\x71\x6C\x90\x90", 11);
- if (opt.misc.SuperJump == 0) *(float*)(Base + 0x5432A3) = 109.5445099f;
- if (opt.misc.SuperJump == 1) *(float*)(Base + 0x5432A3) = 150.0f;
- if (opt.misc.SuperJump == 2) *(float*)(Base + 0x5432A3) = 200.0f;
- if (opt.misc.SuperJump == 3) *(float*)(Base + 0x5432A3) = 250.0f;
- if (opt.misc.SuperJump == 4) *(float*)(Base + 0x5432A3) = 300.0f;
- if (opt.misc.SuperJump == 5) *(float*)(Base + 0x5432A3) = 350.0f;
- //End Defines
- //BYTES & defaults
- BYTE FogOn[5] = { 0xF3,0x0F,0x11,0x4D,0xE8 };
- BYTE FogOFF[5] = { 0xF3,0x0F,0x11,0x45,0xE8 };
- //END BYTES & DEFAULTS
- if (opt.misc.ground)
- *(float*)(G) = 1.0f;
- else
- *(float*)(G) = 0.0f;
- //START MEMORY HACKS
- if (opt.d3d.playercolor)
- {
- float red, green, blue; //RGB
- Chams* pColor = pClassManager.GetChamsColorBase();
- if (!pColor)return;
- if (opt.d3d.playercolor == 1) { red = 0; green = 255; blue = 0; }; //Green
- if (opt.d3d.playercolor == 2) { red = 255; green = 0; blue = 0; }; //Red
- if (opt.d3d.playercolor == 3) { red = 0; green = 0; blue = 255; }; //Blue
- if (opt.d3d.playercolor == 4) { red = 255; green = 255; blue = 0; }; //Yellow
- if (opt.d3d.playercolor == 5) { red = 255; green = 255; blue = 255; }; //White
- if (opt.d3d.playercolor == 6) { red = 255; green = 0; blue = 255; }; //Purple
- if (opt.d3d.playercolor == 7) { red = 0; green = 255; blue = 255; }; //Cyan
- pColor->ChamGreen = green;
- pColor->ChamRed = red;
- pColor->ChamBlue = blue;
- }
- else //Restore Default Player Color
- {
- Chams* pColor = pClassManager.GetChamsColorBase();
- if (!pColor)return;
- pColor->ChamGreen = 0.7764999866;
- pColor->ChamRed = 0.8000000119;
- pColor->ChamBlue = 0.7372999787;
- }
- if (opt.misc.skywalk)
- {
- *(PFLOAT)(Sky) = -1.530092002E-30;
- }
- if (!opt.misc.skywalk)
- {
- *(PFLOAT)(Sky) = -1.554743905E-30;
- }
- if (opt.misc.climb)
- {
- *(BYTE*)(Base + 0x543B10) = 0x4C; //on
- }
- if (!opt.misc.climb)
- {
- *(BYTE*)(Base + 0x543B10) = 0x5C; //off
- }
- if (opt.misc.NFD)
- {
- memcpy((void*)(Base + 0x545CA8), "\xF6\xC2\x06", 3);
- }
- if (!opt.misc.NFD)
- {
- memcpy((void*)(Base + 0x545CA8), "\xF6\xC2\x02", 3);
- }
- if (opt.misc.grave)
- {
- memcpy((void*)(Base + 0x544578), "\x90\x90\x90\x90\x90\x90\x90\x90", 8);
- }
- if (opt.d3d.nograss)
- {
- *(PFLOAT)(grass) = -243773.5938;
- }
- if (opt.misc.build)
- {
- *(float*)(B) = -1.1f;
- }
- if (!opt.misc.build)
- {
- *(float*)(B) = -1.0f;
- }
- if (opt.misc.fly)
- {
- *(PFLOAT)(fly) = 40.0f;
- }
- if (opt.misc.water)
- {
- *(PFLOAT)(water) = 2.031882773E-43;
- }
- if (opt.misc.zoom == 1)
- {
- *(PFLOAT)(Zoom) = 0.00545329228;
- }
- if (opt.misc.zoom == 2)
- {
- *(PFLOAT)(Zoom) = 0.004f;
- }
- if (opt.misc.WTW)
- {
- *(PFLOAT)(ptw) = -0.89999998f;
- }
- if (opt.misc.fog)
- {
- zNova((void*)(fogger), (void*)FogOn, 5);
- }
- if (opt.misc.speed == 1)
- {
- *(float*)(Base + 0x1763A30) = 90.0f;
- }
- if (opt.misc.speed == 2)
- {
- *(float*)(Base + 0x1763A30) = 100.0f;
- }
- if (opt.misc.speed == 3)
- {
- *(float*)(Base + 0x1763A30) = 110.0f;
- }
- if (opt.misc.speed == 4)
- {
- *(float*)(Base + 0x1763A30) = 120.0f;
- }
- if (opt.misc.speed == 5)
- {
- *(float*)(Base + 0x1763A30) = 130.0f;
- }
- if (opt.misc.speed == 6)
- {
- *(float*)(Base + 0x1763A30) = 140.0f;
- }
- if (opt.misc.speed == 7)
- {
- *(float*)(Base + 0x1763A30) = 150.0f;
- }
- //default values
- //grass default
- //foliage default
- if (opt.misc.Fol)
- {
- *(float*)(Foliage) = -243773.5938;
- }
- if (!opt.misc.Fol)
- {
- *(float*)(Foliage) = -3.719689846;
- }
- if (!opt.misc.grave)
- {
- memcpy((void*)(Base + 0x544578), "\xF3\x0F\x11\x87\xE0\x00\x00\x00", 8);
- }
- if (!opt.d3d.nograss)
- {
- *(PFLOAT)(grass) = -3.407189846;
- }
- // remove water default
- if (!opt.misc.water)
- {
- *(PFLOAT)(water) = 2.017869789E-43;
- }
- // speed hack default
- if (!opt.misc.speed)
- {
- *(float*)(Base + 0x1763A30) = 60.0f;
- }
- //no fog default
- if (!opt.misc.fog)
- {
- zNova((void*)(fogger), (void*)FogOFF, 5);
- }
- //zoom hack default
- if (!opt.misc.zoom)
- {
- *(PFLOAT)(Zoom) = 0.0174532924;
- }
- //fly hack default
- if (!opt.misc.fly)
- {
- *(PFLOAT)(fly) = 0.0f;
- }
- //wtw default
- if (!opt.misc.WTW)
- {
- *(PFLOAT)(ptw) = -0.500f;
- }
- }
- void PreReset( LPDIRECT3DDEVICE9 pDevice )
- {
- Menu.PreReset();
- return;
- }
- void PostReset( LPDIRECT3DDEVICE9 pDevice )
- {
- Menu.PostReset(pDevice);
- return;
- }
- bool WorldToScreen(D3DXVECTOR3 pos, D3DXVECTOR3 &screen, D3DXMATRIX matrix, int windowWidth, int windowHeight)
- {
- D3DXVECTOR4 clipCoords;
- clipCoords.x = pos.x*matrix[0] + pos.y*matrix[4] + pos.z*matrix[8] + matrix[12];
- clipCoords.y = pos.x*matrix[1] + pos.y*matrix[5] + pos.z*matrix[9] + matrix[13];
- clipCoords.z = pos.x*matrix[2] + pos.y*matrix[6] + pos.z*matrix[10] + matrix[14];
- clipCoords.w = pos.x*matrix[3] + pos.y*matrix[7] + pos.z*matrix[11] + matrix[15];
- if (clipCoords.w < 0.1f)
- return false;
- D3DXVECTOR3 NDC;
- NDC.x = clipCoords.x / clipCoords.w;
- NDC.y = clipCoords.y / clipCoords.w;
- NDC.z = clipCoords.z / clipCoords.w;
- screen.x = (windowWidth / 2 * NDC.x) + (NDC.x + windowWidth / 2);
- screen.y = -(windowHeight / 2 * NDC.y) + (NDC.y + windowHeight / 2);
- return true;
- }
- HRESULT CreateMyShader(IDirect3DPixelShader9 **pShader, IDirect3DDevice9 *Device, float red, float green, float blue, float alpha)
- {
- ID3DXBuffer *MyBuffer = NULL;
- char MyShader[256];
- sprintf(MyShader, "ps.1.1\ndef c0, %f, %f, %f, %f\nmov r0,c0", red / 255, green / 255, blue / 255, alpha / 255);
- D3DXAssembleShader(MyShader, sizeof(MyShader), NULL, NULL, 0, &MyBuffer, NULL);
- if (FAILED(Device->CreatePixelShader((const DWORD*)MyBuffer->GetBufferPointer(), pShader)))return E_FAIL;
- return S_OK;
- }
- //==========================================================================================================================
- HRESULT APIENTRY Present_hook(IDirect3DDevice9* pDevice, const RECT *pSourceRect, const RECT *pDestRect, HWND hDestWindowOverride, const RGNDATA *pDirtyRegion)
- {
- pDevice->GetViewport(&Viewport);
- ScreenCX = (float)Viewport.Width / 2.0f;
- ScreenCY = (float)Viewport.Height / 2.0f;
- /*
- if(!Direct3DInitialize)
- {
- Direct3DInitialize = true;
- CreateMyShader(&Front, pDevice, 255, 0, 0, 255);
- CreateMyShader(&Back, pDevice, 255, 255, 0, 255);
- }*/
- _asm pushad;
- if (!Tools.Init)
- {
- D3DXCreateLine(pDevice, &Tools.pLine);
- Tools.Init = TRUE;
- }
- PostReset(pDevice);
- Menu.ShowMenu(pDevice);
- PreReset(pDevice);
- pDevice->GetViewport(&Tools.g_ViewPort);
- ScreenCenterX = (float)Tools.g_ViewPort.Width / 2;
- ScreenCenterY = (float)Tools.g_ViewPort.Height / 2;
- if (opt.d3d.cross)
- {
- Tools.FillRGB(ScreenCenterX - 14, ScreenCenterY, 10, 1, D3DXCOLOR(1.0, 0.0, 0.0, 1.0), pDevice);//Left line
- Tools.FillRGB(ScreenCenterX + 5, ScreenCenterY, 10, 1, D3DXCOLOR(1.0, 0.0, 0.0, 1.0), pDevice);//Right line
- Tools.FillRGB(ScreenCenterX, ScreenCenterY - 14, 1, 10, D3DXCOLOR(1.0, 0.0, 0.0, 1.0), pDevice);//Top line
- Tools.FillRGB(ScreenCenterX, ScreenCenterY + 5, 1, 10, D3DXCOLOR(1.0, 0.0, 0.0, 1.0), pDevice);//Bottom line
- Tools.DrawCircle(D3DXVECTOR2(ScreenCenterX, ScreenCenterY), 8, 60, D3DXCOLOR(1.0, 0.0, 0.0, 1.0));//Circle
- Tools.DrawPoint(ScreenCenterX, ScreenCenterY, 1, 1, D3DXCOLOR(0.0, 1.0, 0.0, 1.0), pDevice);//Point
- }
- _asm popad;
- if (Font == NULL)
- D3DXCreateFont(pDevice, 14, 0, FW_BOLD, 0, FALSE, DEFAULT_CHARSET, OUT_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH | FF_DONTCARE, TEXT("Italic"), &Font);
- if (screenshot_taken && Font)
- {
- DrawCenteredString(Font, (int)Viewport.Width / 2, (int)Viewport.Height / 2, D3DCOLOR_ARGB(255, 255, 255, 255), "Someone reported you. Screenshot blocked. (gmcomplaint.jpg)");
- static DWORD lastTime = timeGetTime();
- DWORD timePassed = timeGetTime() - lastTime;
- if (timePassed>2000)
- {
- screenshot_taken = false;
- lastTime = timeGetTime();
- }
- }
- //Shift|RMouse|LMouse|Ctrl|Alt|Space|X|C
- if (opt.Aimbot.key == 0) Daimkey = 0;
- if (opt.Aimbot.key == 1) Daimkey = VK_SHIFT;
- if (opt.Aimbot.key == 2) Daimkey = VK_RBUTTON;
- if (opt.Aimbot.key == 3) Daimkey = VK_LBUTTON;
- if (opt.Aimbot.key == 4) Daimkey = VK_CONTROL;
- if (opt.Aimbot.key == 5) Daimkey = VK_MENU;
- if (opt.Aimbot.key == 6) Daimkey = VK_SPACE;
- if (opt.Aimbot.key == 7) Daimkey = 0x58; //X
- if (opt.Aimbot.key == 8) Daimkey = 0x43; //C
- if (opt.ESP.activate > 0 && WeaponEspInfo.size() != NULL)
- {
- for (unsigned int i = 0; i < WeaponEspInfo.size(); i++)
- {
- //box esp
- if (WeaponEspInfo[i].pOutX > 1.0f && WeaponEspInfo[i].pOutY > 1.0f && (float)WeaponEspInfo[i].RealDistance > 4.0f)
- DrawCornerBox(pDevice, (int)WeaponEspInfo[i].pOutX, (int)WeaponEspInfo[i].pOutY + 20, 20, 30, 1, D3DCOLOR_ARGB(255, 255, 255, 255));
- //line esp
- if (WeaponEspInfo[i].pOutX > 1.0f && WeaponEspInfo[i].pOutY > 1.0f && (float)WeaponEspInfo[i].RealDistance > 4.0f)//&& (float)WeaponEspInfo[i].vSizeod == 2008)//long range weapon
- DrawLine(pDevice, (int)WeaponEspInfo[i].pOutX, (int)WeaponEspInfo[i].pOutY, ScreenCX, ScreenCY * ((float)opt.ESP.activate * 0.2f), 20, D3DCOLOR_ARGB(255, 255, 255, 255), 1);//0.1up, 1.0middle, 2.0down
- //else if (WeaponEspInfo[i].pOutX > 1.0f && WeaponEspInfo[i].pOutY > 1.0f && (float)WeaponEspInfo[i].RealDistance > 4.0f && (float)WeaponEspInfo[i].vSizeod != 2008)//short/mid range weapon
- //DrawLine(pDevice, (int)WeaponEspInfo[i].pOutX, (int)WeaponEspInfo[i].pOutY, ScreenCX, ScreenCY * ((float)esp * 0.2f), 20, D3DCOLOR_ARGB(255, 0, 255, 0), 1);//0.1up, 1.0middle, 2.0down
- //distance esp
- if (WeaponEspInfo[i].pOutX > 1.0f && WeaponEspInfo[i].pOutY > 1.0f && (float)WeaponEspInfo[i].RealDistance > 200.0f)
- DrawCenteredString(Font, (int)WeaponEspInfo[i].pOutX, (int)WeaponEspInfo[i].pOutY - 20.0f, D3DCOLOR_ARGB(255, 255, 255, 255), "%.f", (float)WeaponEspInfo[i].RealDistance);
- else if (WeaponEspInfo[i].pOutX > 1.0f && WeaponEspInfo[i].pOutY > 1.0f && (float)WeaponEspInfo[i].RealDistance > 4.0f && (float)WeaponEspInfo[i].RealDistance <= 200.0f)
- DrawCenteredString(Font, (int)WeaponEspInfo[i].pOutX, (int)WeaponEspInfo[i].pOutY - 20.0f, D3DCOLOR_ARGB(255, 255, 255, 0), "%.f", (float)WeaponEspInfo[i].RealDistance);
- //text esp
- //if (WeaponEspInfo[i].pOutX > 1.0f && WeaponEspInfo[i].pOutY > 1.0f && (float)WeaponEspInfo[i].distance > 4.0f)
- //DrawString(Font, (int)WeaponEspInfo[i].pOutX, (int)WeaponEspInfo[i].pOutY, D3DCOLOR_ARGB(255, 255, 255, 255), "o");
- }
- }
- //ito na yun try mo cgwh2x
- if (opt.Aimbot.aimbot == 1 && WeaponEspInfo.size() != NULL)
- {
- UINT BestTarget = -1;
- DOUBLE fClosestPos = 99999;
- for (unsigned int i = 0; i < WeaponEspInfo.size(); i++)
- {
- //aimfov
- float radiusx = (opt.Aimbot.fov*5.0f) * (ScreenCX / 100.0f);
- float radiusy = (opt.Aimbot.fov*5.0f) * (ScreenCY / 100.0f);
- if (opt.Aimbot.fov == 0)
- {
- radiusx = 5.0f * (ScreenCX / 100.0f);
- radiusy = 5.0f * (ScreenCY / 100.0f);
- }
- //get crosshairdistance
- WeaponEspInfo[i].CrosshairDistance = GetDistance(WeaponEspInfo[i].pOutX, WeaponEspInfo[i].pOutY, ScreenCX, ScreenCY);
- //if in fov
- if (WeaponEspInfo[i].pOutX >= ScreenCX - radiusx && WeaponEspInfo[i].pOutX <= ScreenCX + radiusx && WeaponEspInfo[i].pOutY >= ScreenCY - radiusy && WeaponEspInfo[i].pOutY <= ScreenCY + radiusy)
- //get closest/nearest target to crosshair
- if (WeaponEspInfo[i].CrosshairDistance < fClosestPos)
- {
- fClosestPos = WeaponEspInfo[i].CrosshairDistance;
- BestTarget = i;
- }
- }
- //if nearest target to crosshair
- if (BestTarget != -1 && WeaponEspInfo[BestTarget].RealDistance > 4.0f)//do not aim at self
- {
- double DistX = WeaponEspInfo[BestTarget].pOutX - ScreenCX;
- double DistY = WeaponEspInfo[BestTarget].pOutY - ScreenCY;
- DistX /= (0.5f + (float)opt.Aimbot.sens*0.5f);
- DistY /= (0.5f + (float)opt.Aimbot.sens*0.5f);
- //aim
- if (GetAsyncKeyState(Daimkey) & 0x8000)
- mouse_event(MOUSEEVENTF_MOVE, (float)DistX, (float)DistY, 0, NULL);
- //autoshoot on
- if ((!GetAsyncKeyState(VK_LBUTTON) && (opt.Aimbot.autoshoot == 1) && (GetAsyncKeyState(Daimkey) & 0x8000))) //
- {
- if (opt.Aimbot.autoshoot == 1 && !IsPressed)
- {
- IsPressed = true;
- mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0);
- }
- }
- }
- }
- WeaponEspInfo.clear();
- //autoshoot off
- if (opt.Aimbot.autoshoot == 1 && IsPressed)
- {
- if (timeGetTime() - astime >= asdelay)
- {
- IsPressed = false;
- mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);
- astime = timeGetTime();
- }
- }
- DWORD ROS = (DWORD)GetModuleHandleA("ros.exe");
- int inGame = *(int*)(isInBattleGround + ROS);
- if(inGame == 1)
- Crap();//ito ok lang ba sa loob lang ng laro gagana mga memory hacks ? oo
- return Present_orig(pDevice, pSourceRect, pDestRect, hDestWindowOverride, pDirtyRegion);
- }
- typedef HRESULT ( WINAPI* oReset )( LPDIRECT3DDEVICE9 pDevice, D3DPRESENT_PARAMETERS* pPresentationParameters );
- oReset pReset;
- //==========================================================================================================================
- HRESULT APIENTRY Reset_hook(IDirect3DDevice9* pDevice, D3DPRESENT_PARAMETERS *pPresentationParameters)
- {
- _asm pushad;
- if (Tools.pLine)
- Tools.pLine->OnLostDevice();
- HRESULT ResetReturn = Reset_orig(pDevice, pPresentationParameters);
- if (SUCCEEDED(ResetReturn))
- {
- if (Tools.pLine)
- Tools.pLine->OnResetDevice();
- }
- _asm popad;
- return ResetReturn;
- }
- typedef HRESULT ( WINAPI* oEndScene )( LPDIRECT3DDEVICE9 pDevice );
- oEndScene pEndScene;
- //==========================================================================================================================
- HANDLE(WINAPI *Real_CreateFile)(LPCWSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, LPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes, HANDLE hTemplateFile) = CreateFileW;
- HANDLE WINAPI Routed_CreateFile(LPCWSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, LPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes, HANDLE hTemplateFile)
- {
- char buffer[500];
- wcstombs(buffer, lpFileName, 500);
- if (strcmp(buffer + strlen(buffer) - 4, ".jpg") == 0)//find gm_complaint_x.jpg
- {
- Log("buffer == %s", buffer);//log jpg
- }
- return Real_CreateFile(lpFileName, dwDesiredAccess, dwShareMode, lpSecurityAttributes, dwCreationDisposition, dwFlagsAndAttributes, hTemplateFile);
- }
- DWORD WINAPI RosD3D(__in LPVOID lpParameter)
- {
- HMODULE dDll = NULL;
- while (!dDll)
- {
- dDll = GetModuleHandleA("d3d9.dll");
- Sleep(100);
- }
- CloseHandle(dDll);
- IDirect3D9* d3d = NULL;
- IDirect3DDevice9* d3ddev = NULL;
- HWND tmpWnd = CreateWindowA("BUTTON", "RosD3D", WS_SYSMENU | WS_MINIMIZEBOX, CW_USEDEFAULT, CW_USEDEFAULT, 300, 300, NULL, NULL, Hand, NULL);
- if (tmpWnd == NULL)
- {
- return 0;
- }
- d3d = Direct3DCreate9(D3D_SDK_VERSION);
- if (d3d == NULL)
- {
- DestroyWindow(tmpWnd);
- return 0;
- }
- D3DPRESENT_PARAMETERS d3dpp;
- ZeroMemory(&d3dpp, sizeof(d3dpp));
- d3dpp.Windowed = TRUE;
- d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD;
- d3dpp.hDeviceWindow = tmpWnd;
- d3dpp.BackBufferFormat = D3DFMT_UNKNOWN;
- HRESULT result = d3d->CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, tmpWnd, D3DCREATE_SOFTWARE_VERTEXPROCESSING, &d3dpp, &d3ddev);
- if (result != D3D_OK)
- {
- d3d->Release();
- DestroyWindow(tmpWnd);
- return 0;
- }
- #if defined _M_X64
- DWORD64* dVtable = (DWORD64*)d3ddev;
- dVtable = (DWORD64*)dVtable[0];
- #elif defined _M_IX86
- DWORD* dVtable = (DWORD*)d3ddev;
- dVtable = (DWORD*)dVtable[0];
- #endif
- SetStreamSource_orig = (SetStreamSource_t)dVtable[100];
- SetVertexShaderConstantF_orig = (SetVertexShaderConstantF_t)dVtable[94];
- SetTexture_orig = (SetTexture_t)dVtable[65];
- Reset_orig = (Reset_t)dVtable[16];
- Present_orig = (Present_t)dVtable[17];
- Present_orig = (Present_t)DetourFunction((PBYTE)Present_orig, (PBYTE)Present_hook);
- SetStreamSource_orig = (SetStreamSource_t)DetourFunction((PBYTE)SetStreamSource_orig, (PBYTE)SetStreamSource_hook);
- SetTexture_orig = (SetTexture_t)DetourFunction((PBYTE)SetTexture_orig, (PBYTE)SetTexture_hook);
- SetVertexShaderConstantF_orig = (SetVertexShaderConstantF_t)DetourFunction((PBYTE)SetVertexShaderConstantF_orig, (PBYTE)SetVertexShaderConstantF_hook);
- Reset_orig = (Reset_t)DetourFunction((PBYTE)Reset_orig, (PBYTE)Reset_hook);
- /*HMODULE mod = LoadLibrary(TEXT("Kernel32.dll"));
- void* ptr = GetProcAddress(mod, "CreateFileW");*/
- Sleep(1000);
- return 0;
- }
- BOOL WINAPI DllMain(HMODULE hDll, DWORD dwReason, LPVOID lpReserved)
- {
- switch(dwReason)
- {
- case DLL_PROCESS_ATTACH:
- Hand = hDll;
- DisableThreadLibraryCalls(hDll); // disable unwanted thread notifications to reduce overhead
- //CreateThread(NULL, NULL, (LPTHREAD_START_ROUTINE)DIRECT3D, hDll, NULL, NULL);
- GetModuleFileNameA( hDll, dlldir, 512 );
- for(int i = ( int )strlen( dlldir ); i > 0; i--)
- {
- if(dlldir[i] == '\\')
- {
- dlldir[i+1] = 0;
- break;
- }
- }
- CreateThread(0, 0, RosD3D, 0, 0, 0); //init our hooks
- CreateThread(0, 0, FF, 0, 0, 0);//call our FastFall
- break;
- case DLL_PROCESS_DETACH:
- break;
- }
- return TRUE;
- }
- //THANKS FOR BUYING
- //STILL UNDETECTED 4/20/2018
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement