Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Adamjaosn
- /*********************************************************/
- #include "Headers.h"
- #include "Hook.h"
- #include "Menu.h"
- #include <windows.h>
- #include <d3d9.h>
- #pragma comment(lib, "d3d9.lib")
- #include "detours.h"
- #include <d3dx9.h>
- #pragma comment(lib, "d3dx9.lib")
- #include <time.h>
- #include <stdlib.h>
- #include <fstream>
- #include <vector>
- #include <D3dx9tex.h>
- #include <stdio.h>
- #include <time.h>
- #include <tchar.h>
- #include <iostream>
- #include <tchar.h>
- #pragma comment(lib, "detours.lib")
- #pragma warning(disable:4996)
- #include <mmsystem.h>
- using namespace std;
- D3DCOLOR ESPColor;
- #define Rouge D3DCOLOR_ARGB(255,255,0,0)
- int wRed, wGreen;
- char wVal[255];
- int ZeroMemory;
- int SOLID;
- int WIREFRAME;
- int POINTCHAMS;
- int Ghost;
- int OldFPSView;
- int Made;
- int NewCham;
- int fire;
- int main;
- int CrossColors;
- //-----------//
- bool fCall = true;
- IDirect3DPixelShader9 *Front,
- *Back;
- //----------//
- IDirect3DPixelShader9* pShader;
- IDirect3DPixelShader9* pRed;
- IDirect3DPixelShader9* pYellow;
- IDirect3DPixelShader9* pGreen;
- IDirect3DPixelShader9* pWhite;
- IDirect3DPixelShader9* pOrange;
- IDirect3DPixelShader9* pBlue;
- IDirect3DPixelShader9* pBlack;
- IDirect3DPixelShader9* pLightYellow;
- IDirect3DPixelShader9* pMagenta;
- IDirect3DPixelShader9* pDarkBlue;
- IDirect3DPixelShader9* pTBlack;
- ///////////////////////////////////
- INT Fps = 0;
- FLOAT LastTickCount = 0.0f;
- FLOAT CurrentTickCount;
- CHAR FrameRate[50] = "";
- #define Player_Bodies
- #define naziEsp
- int FullBright;
- int espfunction;
- int EspOn;
- int IsAQS;
- int IsRapied;
- typedef HRESULT(WINAPI* Prototype_DrawIndexedPrimitive)(LPDIRECT3DDEVICE9, D3DPRIMITIVETYPE, INT, UINT, UINT, UINT, UINT);
- HRESULT WINAPI Hooked_DrawIndexedPrimitive(LPDIRECT3DDEVICE9 Device, D3DPRIMITIVETYPE PrimType, INT BaseVertexIndex, UINT MinVertexIndex, UINT NumVertices, UINT startIndex, UINT primCount);
- Prototype_DrawIndexedPrimitive Orginal_DrawIndexedPrimitive;
- DWORD FindDevice(DWORD Len)
- {
- DWORD dwObjBase = 0;
- dwObjBase = (DWORD)LoadLibrary("d3d9.dll");
- while (dwObjBase++ < dwObjBase + Len)
- {
- if ((*(WORD*)(dwObjBase + 0x00)) == 0x06C7
- && (*(WORD*)(dwObjBase + 0x06)) == 0x8689
- && (*(WORD*)(dwObjBase + 0x0C)) == 0x8689
- ) {
- dwObjBase += 2; break;
- }
- }
- return(dwObjBase);
- }
- void DrawLined(LPD3DXLINE pLine, float x, float y, float x2, float y2, float width, DWORD color) // allways put this voids on top so it might no lead to crashes or errors while building
- {
- D3DXVECTOR2 vLine[2];
- pLine->SetWidth(width);
- vLine[0].x = x;
- vLine[0].y = y;
- vLine[1].x = x2;
- vLine[1].y = y2;
- pLine->Begin();
- pLine->Draw(vLine, 2, color);
- pLine->End();
- return;
- }
- void Border(int x, int y, int w, int h, int px, D3DCOLOR BorderColor, LPDIRECT3DDEVICE9 pDevice)
- {
- FillRGB(x, (y + h - px), w, px, BorderColor, pDevice);
- FillRGB(x, y, px, h, BorderColor, pDevice);
- FillRGB(x, y, w, px, BorderColor, pDevice);
- FillRGB(x + w - px, y, px, h, BorderColor, pDevice);
- }
- void BOX(int x, int y, int w, int h, D3DCOLOR Color, D3DCOLOR BorderColor, LPDIRECT3DDEVICE9 pDevice)
- {
- FillRGB(x, y, w, h, Color, pDevice);
- }
- DWORD GetDeviceAddress(int VTableIndex)
- {
- PDWORD VTable;
- *(DWORD*)&VTable = *(DWORD*)FindDevice(0x128000);
- return VTable[VTableIndex];
- }
- HRESULT CreateMyShader(IDirect3DPixelShader9 **pShader, IDirect3DDevice9 *Device, float red, float yellow, 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, yellow / 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;
- }
- typedef HRESULT(WINAPI* CreateDevice_Prototype) (LPDIRECT3D9, UINT, D3DDEVTYPE, HWND, DWORD, D3DPRESENT_PARAMETERS*, LPDIRECT3DDEVICE9*);
- typedef HRESULT(WINAPI* Reset_Prototype) (LPDIRECT3DDEVICE9, D3DPRESENT_PARAMETERS*);
- typedef HRESULT(WINAPI* EndScene_Prototype) (LPDIRECT3DDEVICE9);
- typedef HRESULT(WINAPI* DrawIndexedPrimitive_Prototype)(LPDIRECT3DDEVICE9, D3DPRIMITIVETYPE, INT, UINT, UINT, UINT, UINT);
- CreateDevice_Prototype CreateDevice_Pointer = NULL;
- Reset_Prototype Reset_Pointer = NULL;
- EndScene_Prototype EndScene_Pointer = NULL;
- DrawIndexedPrimitive_Prototype DrawIndexedPrimitive_Pointer = NULL;
- HRESULT WINAPI Direct3DCreate9_VMTable(VOID);
- HRESULT WINAPI CreateDevice_Detour(LPDIRECT3D9, UINT, D3DDEVTYPE, HWND, DWORD, D3DPRESENT_PARAMETERS*, LPDIRECT3DDEVICE9*);
- HRESULT WINAPI Reset_Detour(LPDIRECT3DDEVICE9, D3DPRESENT_PARAMETERS*);
- HRESULT WINAPI EndScene_Detour(LPDIRECT3DDEVICE9);
- PDWORD Direct3D_VMTable = NULL;
- HRESULT WINAPI Direct3DCreate9_VMTable(VOID)
- {
- LPDIRECT3D9 Direct3D_Object = Direct3DCreate9(D3D_SDK_VERSION);
- if (Direct3D_Object == NULL)
- return D3DERR_INVALIDCALL;
- Direct3D_VMTable = (PDWORD)*(PDWORD)Direct3D_Object;
- Direct3D_Object->Release();
- DWORD dwProtect;
- if (VirtualProtect(&Direct3D_VMTable[16], sizeof(DWORD), PAGE_READWRITE, &dwProtect) != 0)
- {
- *(PDWORD)&CreateDevice_Pointer = Direct3D_VMTable[16];
- *(PDWORD)&Direct3D_VMTable[16] = (DWORD)CreateDevice_Detour;
- if (VirtualProtect(&Direct3D_VMTable[16], sizeof(DWORD), dwProtect, &dwProtect) == 0)
- return D3DERR_INVALIDCALL;
- }
- else
- return D3DERR_INVALIDCALL;
- return D3D_OK;
- }
- HRESULT WINAPI CreateDevice_Detour(LPDIRECT3D9 Direct3D_Object, UINT Adapter, D3DDEVTYPE DeviceType, HWND FocusWindow,
- DWORD BehaviorFlags, D3DPRESENT_PARAMETERS* PresentationParameters,
- LPDIRECT3DDEVICE9* Returned_Device_Interface)
- {
- HRESULT Returned_Result = CreateDevice_Pointer(Direct3D_Object, Adapter, DeviceType, FocusWindow, BehaviorFlags,
- PresentationParameters, Returned_Device_Interface);
- DWORD dwProtect;
- if (VirtualProtect(&Direct3D_VMTable[16], sizeof(DWORD), PAGE_READWRITE, &dwProtect) != 0)
- {
- *(PDWORD)&Direct3D_VMTable[16] = *(PDWORD)&CreateDevice_Pointer;
- CreateDevice_Pointer = NULL;
- if (VirtualProtect(&Direct3D_VMTable[16], sizeof(DWORD), dwProtect, &dwProtect) == 0)
- return D3DERR_INVALIDCALL;
- }
- else
- return D3DERR_INVALIDCALL;
- if (Returned_Result == D3D_OK)
- {
- Direct3D_VMTable = (PDWORD)*(PDWORD)*Returned_Device_Interface;
- *(PDWORD)&Reset_Pointer = (DWORD)Direct3D_VMTable[16];
- *(PDWORD)&EndScene_Pointer = (DWORD)Direct3D_VMTable[42];
- *(PDWORD)&DrawIndexedPrimitive_Pointer = (DWORD)Direct3D_VMTable[82];
- }
- return Returned_Result;
- }
- HRESULT WINAPI Reset_Detour(LPDIRECT3DDEVICE9 Device_Interface, D3DPRESENT_PARAMETERS* PresentationParameters)
- {
- return Reset_Pointer(Device_Interface, PresentationParameters);
- }
- HRESULT WINAPI EndScene_Detour(LPDIRECT3DDEVICE9 Device_Interface)
- {
- return EndScene_Pointer(Device_Interface);
- }
- //base Menu
- char * Colors[] = { "[Off]",
- "[Red]",
- "[Green]",
- "[White]",
- "Cyan",
- "Orange",
- "Yellow"
- };
- CHAR *OnOff[] = { "[Off]", "[On]" };
- CHAR *OnOff1[] = { "[On]", "Off" };
- CHAR *Color[] = { "Off", "Red","Green" };
- CHAR *Folder[] = { "[+]", "[-]" };
- CHAR *Folder1[] = { "[Red]", "[Green]", "[Blue]" };
- CHAR *Text[] = { "", "" };
- //Menu
- CHAR MenuTitle[MAX_PATH] = {"VIP Privite"}; //Título do menu aqui.
- CHAR MenuTitle2[MAX_PATH] = { "Made:10/15/18" }; //Título do menu aqui.
- CHAR MenuTitle4[MAX_PATH] = { "[Open/Close HomeKey]" }; //Título do menu aqui
- CHAR MenuTitle5[MAX_PATH] = { "MADE BY: CHEAT/HEAD" };
- CHAR Timestruct[MAX_PATH] = { "hh':'mm':'ss tt" }; //Estrutura do relógio.
- CHAR Timestruct1[MAX_PATH] = { "dd':'mm':'yy tt" }; //Estrutura do relógio.
- CHAR TimeString[MAX_PATH];
- CHAR DateString[MAX_PATH];
- CHAR section[MAX_PATH] = { "Xingcod3/passed" };
- CHAR MenuTitle8[MAX_PATH] = { "[F6 = Damagex3]" };
- CHAR MenuTitle9[MAX_PATH] = { "[F7 = Damagex20]" };
- CHAR MenuTitle10[MAX_PATH] = { "[F8 = Damagex800]" };
- CHAR MenuTitle11[MAX_PATH] = { "[F9 = Damagex2000]" };
- CHAR MenuTitle12[MAX_PATH] = { "[SideMouse = Damagex2]" };
- CHAR MenuTitle13[MAX_PATH] = { "[Mid Mouse = Damagex2]" };
- void DrawRect(IDirect3DDevice9* pD3Ddev, int baseX, int baseY, int baseW, int baseH, D3DCOLOR Color)
- {
- D3DRECT BarRect = { baseX, baseY, baseX + baseW, baseY + baseH };
- pD3Ddev->Clear(1, &BarRect, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, Color, 0, 0);
- }
- struct DirectX9VTable
- {
- DWORD CreateQuery; // 118
- };
- typedef HRESULT(__stdcall* mikeyQuery)(LPDIRECT3DDEVICE9 Device, D3DQUERYTYPE Type, IDirect3DQuery9** ppQuery);
- mikeyQuery yourHookz;
- HRESULT WINAPI tsunashit(LPDIRECT3DDEVICE9 pDevice, D3DQUERYTYPE Type, IDirect3DQuery9** ppQuery)
- {
- if (Type == D3DQUERYTYPE_OCCLUSION)
- {
- Type = D3DQUERYTYPE_TIMESTAMP;
- }
- return yourHookz(pDevice, Type, ppQuery);
- }
- //Variável da fonte:
- BOOL BFont = FALSE;
- //Variáveis globais:
- INT Variable[MAX_PATH];
- INT VFolder[MAX_PATH];
- HRESULT WINAPI Reset(LPDIRECT3DDEVICE9 pDevice, D3DPRESENT_PARAMETERS *pPresentationParameters)
- {
- PFont->OnLostDevice();
- pLine->OnLostDevice();
- HRESULT hTorna = OReset(pDevice, pPresentationParameters);
- if (SUCCEEDED(hTorna))
- PFont->OnResetDevice();
- pLine->OnResetDevice();
- return hTorna;
- }
- HRESULT TehShader(IDirect3DDevice9 *pD3Ddev, IDirect3DPixelShader9 **pShader, float r, float g, float b)
- {
- char szShader[256];
- ID3DXBuffer *pShaderBuf = NULL;
- sprintf(szShader, "ps_3_0\ndef c0, %f, %f, %f, %f\nmov oC0,c0", r, g, b, 1.0f);
- D3DXAssembleShader(szShader, sizeof(szShader), NULL, NULL, 0, &pShaderBuf, NULL);
- if (FAILED(pD3Ddev->CreatePixelShader((const DWORD*)pShaderBuf->GetBufferPointer(), pShader)))return E_FAIL;
- return S_OK;
- }
- int bshaddinge = true;
- void LBox(IDirect3DDevice9* pDevice, int x, int y, int w, int h, D3DCOLOR Outline) //this is the type of esp i draw, the box i use on my releases
- {
- naziEsp(x, y, w, h, Outline, pDevice);
- }
- float GetDistance(float Xx, float Yy, float xX, float yY) //our nowts
- {
- return sqrt((yY - Yy) * (yY - Yy) + (xX - Xx) * (xX - Xx));
- }
- #define Cyan D3DCOLOR_ARGB(255, 000, 255, 255)
- #define Green D3DCOLOR_ARGB(255, 000, 255, 000)
- bool bFont;
- int EspHeight = 2;
- struct ModelInfo_t //this logs our player so it can draw on X,Y,Z axis
- {
- float vOutX, vOutY; //our axis to draw on screen (d3d)
- INT iTeam; //if you have a team (for both) offset you can add it here)
- float CrosshairDistance; //our distance to middle (center) X/2 Y/2
- };
- std::vector<ModelInfo_t>ModelInfo; // finally this makes our model into a vector (translates) so it can successfully draw, now we make our drawing ESP FUNCTION :D
- void AddModel(LPDIRECT3DDEVICE9 pDevice, int iTeam)
- {
- float xx, yy;
- D3DXMATRIX matrix, worldmatrix, m1;
- D3DXVECTOR4 position, input;
- D3DVIEWPORT9 dip_viewport;
- pDevice->GetViewport(&dip_viewport);
- pDevice->GetVertexShaderConstantF(36, m1, 4);
- pDevice->GetVertexShaderConstantF(0, worldmatrix, 3);
- input.x = worldmatrix._14;
- input.y = worldmatrix._24;
- input.z = worldmatrix._34 + (float)EspHeight;
- D3DXMatrixTranspose(&matrix, &m1);
- D3DXVec4Transform(&position, &input, &matrix);
- position.x = input.x * matrix._11 + input.y * matrix._21 + input.z * matrix._31 + matrix._41; //this is a masterpiece I'm proud of making :D it is world to screen without classes :D
- position.y = input.x * matrix._12 + input.y * matrix._22 + input.z * matrix._32 + matrix._42;
- position.z = input.x * matrix._13 + input.y * matrix._23 + input.z * matrix._33 + matrix._43;
- position.w = input.x * matrix._14 + input.y * matrix._24 + input.z * matrix._34 + matrix._44;
- xx = ((position.x / position.w) * (dip_viewport.Width / 2.0f)) + dip_viewport.X + (dip_viewport.Width / 2.0f);
- yy = dip_viewport.Y + (dip_viewport.Height / 2.0f) - ((position.y / position.w) * (dip_viewport.Height / 2.0f));
- ModelInfo_t pModelInfo = { static_cast<float>(xx), static_cast<float>(yy), iTeam }; //this calls our model
- ModelInfo.push_back(pModelInfo); //and repeat (loop) ALWAYS REMEMBER TO CLEAR MEMORY AFTER DRAWING!
- }
- void InitESP(LPDIRECT3DDEVICE9 Device) //to call a function always add it to your present in this case it will be InitESP(Device) or your device name at the current function being placed
- {
- D3DVIEWPORT9 VP;
- memset(&VP, 0, sizeof(D3DVIEWPORT9));
- Device->GetViewport(&VP);
- float Vpx = (float)VP.Width / 2;
- float Vpy = (float)VP.Height / 2;
- D3DVIEWPORT9 Viewport1;
- Device->GetViewport(&Viewport1);
- DWORD ScreenX = Viewport1.Width / 2;
- DWORD ScreenY = Viewport1.Height / 2;
- if (ModelInfo.size() != NULL)
- {
- for (unsigned int i = 0; i < ModelInfo.size(); i++)
- {
- if (espfunction) // alright now we have it all set to draw in game but first! this function is not being called :O
- {
- ModelInfo[i].CrosshairDistance = GetDistance(ModelInfo[i].vOutX, ModelInfo[i].vOutY, ScreenX, ScreenY);
- if (ModelInfo[i].vOutX > 2 && ModelInfo[i].vOutY > 2)
- {
- DrawLined(pLine, ScreenX, ScreenY, (int)ModelInfo[i].vOutX - 24, (int)ModelInfo[i].vOutY - 24, 50, Red);//here you will have to mess with vOutX and vOutY to find the perfect cordinate to center your enemy
- }
- }
- }
- }
- ModelInfo.clear();
- }
- VOID WINAPI DrawESP(LPDIRECT3DDEVICE9 pDev,
- LONG X, LONG Y, LONG Size, BOOL IsVis)
- {
- if (EspOn)
- return;
- DWORD BoxColor = 1;
- if (!IsVis)
- BoxColor = D3DCOLOR_ARGB(255, 255, 255, 20); // Yellow
- else if (IsVis)
- BoxColor = D3DCOLOR_ARGB(255, 20, 255, 20); // Green
- D3DRECT R1 = { X - Size, Y - Size,
- X + Size, Y - Size + 1 };
- pDev->Clear(1, &R1, D3DCLEAR_TARGET, BoxColor, 1.0f, 0);
- D3DRECT R2 = { X - Size, Y + Size - 1,
- X + Size, Y + Size };
- pDev->Clear(1, &R2, D3DCLEAR_TARGET, BoxColor, 1.0f, 0);
- D3DRECT R3 = { X - Size, Y - Size,
- X - Size + 1, Y + Size };
- pDev->Clear(1, &R3, D3DCLEAR_TARGET, BoxColor, 1.0f, 0);
- D3DRECT R4 = { X + Size - 1, Y - Size,
- X + Size, Y + Size };
- pDev->Clear(1, &R4, D3DCLEAR_TARGET, BoxColor, 1.0f, 0);
- }
- HRESULT WINAPI Present(LPDIRECT3DDEVICE9 pDevice, CONST RECT *pSourceRect, CONST RECT *pDestRect, HWND hDestWindowOverride, CONST RGNDATA *pDirtyRegion)
- {
- InitESP(pDevice); //as in this case it will be pDevice, this calls our function to be looped and remember to clear!
- if (PFont)
- {
- pLine->Release();
- pLine = NULL;
- PFont->Release();
- PFont = NULL;
- BFont = FALSE;
- }
- if (!BFont)
- {
- D3DXCreateFont(pDevice, 12, 12, 400, 6, 4, 6, 25, 6, 6 | (0 << 3), "Times New Roman", &PFont);
- D3DXCreateLine(pDevice, &pLine);
- BFont = TRUE;
- }
- if (GetAsyncKeyState(VK_HOME) & 1)
- menu.ShowMenu = !menu.ShowMenu;
- if (menu.ShowMenu && PFont)
- {
- pDevice->SetRenderState(D3DRS_ZENABLE, D3DZB_FALSE);
- GetTimeFormat(0, 0, 0, 0, Timestruct, 20);//Estrutura do relógio.
- GetDateFormat(0, 0, 0, 0, Timestruct1, 30);//Estrutura do relógio.
- DrawBox(menu.matrixPos[0] + -10, menu.matrixPos[1] - 75, +300, 150, TBlack, TBlack, pDevice);// Side block
- DrawBox(menu.matrixPos[0] + 300, menu.matrixPos[1] - 25, +300, 380, TBlack, TBlack, pDevice);// Main Menu block
- DrawBox(menu.matrixPos[0] + 300, menu.matrixPos[1] - 25, +300, 25, LBlack, Black, pDevice);// Top Block
- DrawBox(menu.matrixPos[0] + 790, menu.matrixPos[1] - 10, +300, 50, MENU, Black, pDevice);//
- DrawBox(menu.matrixPos[0] + 300, menu.matrixPos[1] + 340, +300, 25, LBlack, Black, pDevice);//bottem Block
- WriteText(menu.matrixPos[0] + 330, menu.matrixPos[1] - 20, Green, MenuTitle);
- WriteText(menu.matrixPos[0] + 330, menu.matrixPos[1] - 19, Black, MenuTitle);
- WriteText(menu.matrixPos[0], menu.matrixPos[1] - 50, White, MenuTitle8);
- WriteText(menu.matrixPos[0], menu.matrixPos[1] - 49, Black, MenuTitle8);
- WriteText(menu.matrixPos[0], menu.matrixPos[1] - 40, White, MenuTitle9);
- WriteText(menu.matrixPos[0], menu.matrixPos[1] - 39, Black, MenuTitle9);
- WriteText(menu.matrixPos[0], menu.matrixPos[1] - 30, White, MenuTitle10);
- WriteText(menu.matrixPos[0], menu.matrixPos[1] - 29, Black, MenuTitle10);
- WriteText(menu.matrixPos[0], menu.matrixPos[1] - 20, White, MenuTitle11);
- WriteText(menu.matrixPos[0], menu.matrixPos[1] - 19, Black, MenuTitle11);
- WriteText(menu.matrixPos[0], menu.matrixPos[1] + 5, White, MenuTitle12);
- WriteText(menu.matrixPos[0], menu.matrixPos[1] + 6, Black, MenuTitle12);
- WriteText(menu.matrixPos[0], menu.matrixPos[1] + 20, White, MenuTitle13);
- WriteText(menu.matrixPos[0], menu.matrixPos[1] + 21, Black, MenuTitle13);
- WriteText(menu.matrixPos[0], menu.matrixPos[1] - 100, GREEN, MenuTitle4);
- WriteText(menu.matrixPos[0], menu.matrixPos[1] - 70, Green, section);
- WriteText(menu.matrixPos[0], menu.matrixPos[1] - 69, Black, section);
- sprintf_s(TimeString, "%s", Timestruct);//Buffer do relógio.
- sprintf_s(DateString, "%s", Timestruct1);//Buffer do relógio.
- WriteText(menu.matrixPos[0] + 800, menu.matrixPos[+1] + 10, Green, TimeString);//Texto do relógio.
- WriteText(menu.matrixPos[0] + 800, menu.matrixPos[+1] + 9, Black, TimeString);//Texto do relógio.
- WriteText(menu.matrixPos[0] + 800, menu.matrixPos[+1] + 20, Green, DateString);//Texto do relógio.
- WriteText(menu.matrixPos[0] + 800, menu.matrixPos[+1] + 19, Black, DateString);//Texto do relógio.
- DrawBorder(menu.matrixPos[0] + 300, ((menu.matrixPos[2] + 1) + (menu.MenuSelection * 15)), 300, 12, 1, Red, pDevice); // Selection
- DrawBorder(menu.matrixPos[0] + 300, ((menu.matrixPos[2] + 2) + (menu.MenuSelection * 15)), 300, 12, 1, Red, pDevice); // Selection
- WriteText(menu.matrixPos[0] + 325, menu.matrixPos[1] + 350, Red, MenuTitle5);
- WriteText(menu.matrixPos[0] + 325, menu.matrixPos[1] + 349, Red, MenuTitle5);
- menu.Current = 1;
- if (GetAsyncKeyState(VK_UP) & 1)
- menu.MenuSelection--;
- if (GetAsyncKeyState(VK_DOWN) & 1)
- menu.MenuSelection++;
- }
- Additem1("[Weapon]", 1, VFolder[0], 1, Folder);
- if (VFolder[0])
- {
- Additem("Ammo", 1, Variable[3], 0, OnOff1);
- Additem("Recoil", 1, Variable[5], 0, OnOff1);
- Additem("LessRecoil", 1, Variable[8], 0, OnOff);
- Additem("QuickScope", 1, IsAQS, 0, OnOff);
- Additem("RapidFire", 1, IsRapied, 0, OnOff);
- }
- Additem1("[CrossHair]", 1, VFolder[1], 2, Folder);
- if (VFolder[1])
- {
- Additem("Dot", 2, CrossColors, Variable[100], Colors);
- Additem("Circle", 1, Variable[12], 0, OnOff);
- Additem("Cross", 1, Variable[67], 0, OnOff);
- Additem("Plus", 1, Variable[70], 0, OnOff);
- Additem("Rainbow", 1, Variable[68], 0, OnOff);
- Additem("500damage", 1, Variable[99], 0, OnOff);
- }
- Additem1("[Visual]", 1, VFolder[2], 2, Folder);
- if (VFolder[2])
- {
- Additem("Flash", 1, Variable[7], +6, OnOff1);
- Additem("Chams0", 1, WIREFRAME, 0, OnOff);
- Additem("Chams2", 1, Ghost, 0, OnOff);
- Additem("Chams3", 1, POINTCHAMS, 0, OnOff);
- }
- Additem1("[Ghost]", 1, VFolder[3], 2, Folder);
- if (VFolder[3])
- {
- Additem("+Start", 1, Variable[4], 0, OnOff);
- Additem("-STOP", 1, Variable[6], 0, OnOff);
- }
- if (Variable[3]) //inf-ammo
- {
- //do your ON Stuff Here WHAT IS YOUR RECOIL ADDRESS? //test in game
- SuckThisMemoryByte((void*)(0x00D678A0), (void *)(PBYTE)"\x90\x90\x90\x90\x90\x90", 6); //ON
- }
- else
- {
- //do you have a memory write function? vamemory? for c++....... no c#
- SuckThisMemoryByte((void*)(0x00D678A0), (void *)(PBYTE)"\x8B\x81\x58\x03\x00\x00", 6); //OFF
- }
- if (Variable[3]) //inf=nade
- {
- //do your ON Stuff Here WHAT IS YOUR RECOIL ADDRESS? //test in game
- SuckThisMemoryByte((void*)(0x00D7D682), (void *)(PBYTE)"\x90\x90\x90\x90\x90\x90", 6); //ON
- }
- else
- {
- //do you have a memory write function? vamemory? for c++....... no c# this has 8 bytes, so 8 is the value
- SuckThisMemoryByte((void*)(0x00D7D682), (void *)(PBYTE)"\x8B\x86\x60\x03\x00\x00", 6); //OFF
- }
- if (Variable[5]) //no-recoil
- {
- //do your ON Stuff Here WHAT IS YOUR RECOIL ADDRESS? //test in game how much will this be? 4 correct :)
- SuckThisMemoryByte((void*)(0x00D980BF), (void *)(PBYTE)"\x90\x90\x90\x90\x90\x90\x90\x90", 8); //ON, not going to do it for you, you are supposed to know... erase it all together? no...... count how many bytes this has:
- }
- else
- {
- //do you have a memory write function? vamemory? for c++....... no c# done :D ty :)
- SuckThisMemoryByte((void*)(0x00D980BF), (void *)(PBYTE)"\xF3\x0F\x11\x86\xAC\x0F\x00\x00", 8); //OFF this off? yeah ok you are making a massive error..... as for now you must know that the 8 on the code is not supposed to be there .-.
- }
- if (Variable[4]) //ghosting start
- {
- //do your ON Stuff Here WHAT IS YOUR RECOIL ADDRESS? //test in game how much will this be? 4 correct :)
- SuckThisMemoryByte((void*)(0x00E4E991), (void *)(PBYTE)"\x90\x90\x90\x90", 4); //ON, not going to do it for you, you are supposed to know... erase it all together? no...... count how many bytes this has:
- }
- else
- {
- //do you have a memory write function? vamemory? for c++....... no c# done :D ty :)
- SuckThisMemoryByte((void*)(0x00E4E991), (void *)(PBYTE)"\xF3\x0F\x59\xC1", 4); //OFF this off? yeah ok you are making a massive error..... as for now you must know that the 8 on the code is not supposed to be there .-.
- }
- if (Variable[6]) //ghosting stop
- {
- //do your ON Stuff Here WHAT IS YOUR RECOIL ADDRESS? //test in game how much will this be? 4 correct :)
- SuckThisMemoryByte((void*)(0x00E4E9BD), (void *)(PBYTE)"\x90\x90\x90\x90\x90\x90\x90\x90", 8); //ON, not going to do it for you, you are supposed to know... erase it all together? no...... count how many bytes this has:
- }
- else
- {
- //do you have a memory write function? vamemory? for c++....... no c# done :D ty :)
- SuckThisMemoryByte((void*)(0x00E4E9BD), (void *)(PBYTE)"\xF3\x0F\x11\x86\x1C\x03\x00\x00", 8); //OFF this off? yeah ok you are making a massive error..... as for now you must know that the 8 on the code is not supposed to be there .-.
- }
- if (Variable[7]) //No flash
- {
- //do your ON Stuff Here WHAT IS YOUR RECOIL ADDRESS? //test in game how much will this be? 4 correct :)
- SuckThisMemoryByte((void*)(0x00D637BA), (void *)(PBYTE)"\xF3\x0F\x59\x44\x24\x08 ", 6); //ON, not going to do it for you, you are supposed to know... erase it all together? no...... count how many bytes this has:
- }
- else
- {
- //do you have a memory write function? vamemory? for c++....... no c# done :D ty :)
- SuckThisMemoryByte((void*)(0x00D637BA), (void *)(PBYTE)"\xF3\x0F\x5C\x44\x24\x08 ", 6); //OFF this off? yeah ok you are making a massive error..... as for now you must know that the 8 on the code is not supposed to be there .-.
- }
- if (Variable[12]) //Fake recoil
- {
- //do your ON Stuff Here WHAT IS YOUR RECOIL ADDRESS? //test in game how much will this be? 4 correct :)
- SuckThisMemoryByte((void*)(0x00D980A7), (void *)(PBYTE)"\x90\x90\x90\x90\x90\x90\x90\x90 ", 8); //ON, not going to do it for you, you are supposed to know... erase it all together? no...... count how many bytes this has:
- }
- else
- {
- //do you have a memory write function? vamemory? for c++....... no c# done :D ty :)
- SuckThisMemoryByte((void*)(0x00D980A7), (void *)(PBYTE)"\xF3\x0F\x58\x86\xA8\x0F\x00\x00 ", 8); //OFF this off? yeah ok you are making a massive error..... as for now you must know that the 8 on the code is not supposed to be there .-.
- }
- if (Variable[8]) //Low Recoil
- {
- //do your ON Stuff Here WHAT IS YOUR RECOIL ADDRESS? //test in game how much will this be? 4 correct :)
- SuckThisMemoryByte((void*)(0x00D980A7), (void *)(PBYTE)"\xF3\x0F\x5C\x86\xA8\x0F\x00\x00 ", 8); //ON, not going to do it for you, you are supposed to know... erase it all together? no...... count how many bytes this has:
- }
- else
- {
- //do you have a memory write function? vamemory? for c++....... no c# done :D ty :)
- SuckThisMemoryByte((void*)(0x00D980A7), (void *)(PBYTE)"\xF3\x0F\x58\x86\xA8\x0F\x00\x00 ", 8); //OFF this off? yeah ok you are making a massive error..... as for now you must know that the 8 on the code is not supposed to be there .-.
- }
- if (Variable[9]) //Less Recoil
- {
- //do your ON Stuff Here WHAT IS YOUR RECOIL ADDRESS? //test in game how much will this be? 4 correct :)
- SuckThisMemoryByte((void*)(0x00D9809F), (void *)(PBYTE)"\x90\x90\x90\x90\x90\x90\x90\x90 ", 8); //ON, not going to do it for you, you are supposed to know... erase it all together? no...... count how many bytes this has:
- }
- else
- {
- //do you have a memory write function? vamemory? for c++....... no c# done :D ty :)
- SuckThisMemoryByte((void*)(0x00D9809F), (void *)(PBYTE)"\xF3\x0F\x10\x83\xF0\x04\x00\x00 ", 8); //OFF this off? yeah ok you are making a massive error..... as for now you must know that the 8 on the code is not supposed to be there .-.
- }
- if (GetAsyncKeyState(VK_XBUTTON1) & 0x8000)
- {
- *(DWORD*)(
- *(DWORD*)(
- *(DWORD*)(
- *(DWORD*)(
- *(DWORD*)(
- *(DWORD*)((int)GetModuleHandleA("sf2.exe") + HANDDAM)
- + DAM2_OFFSET1) + DAM2_OFFSET2) + DAM2_OFFSET3) + DAM2_OFFSET4) + DAM2_OFFSET5) = 2;
- }
- if (GetAsyncKeyState(VK_MBUTTON) & 0x8000)
- {
- *(DWORD*)(
- *(DWORD*)(
- *(DWORD*)(
- *(DWORD*)(
- *(DWORD*)(
- *(DWORD*)((int)GetModuleHandleA("sf2.exe") + HANDDAM)
- + DAM2_OFFSET1) + DAM2_OFFSET2) + DAM2_OFFSET3) + DAM2_OFFSET4) + DAM2_OFFSET5) = 2;
- }
- if (GetAsyncKeyState(VK_F6) & 0x8000)
- {
- *(DWORD*)(
- *(DWORD*)(
- *(DWORD*)(
- *(DWORD*)(
- *(DWORD*)(
- *(DWORD*)((int)GetModuleHandleA("sf2.exe") + HANDDAM)
- + DAM2_OFFSET1) + DAM2_OFFSET2) + DAM2_OFFSET3) + DAM2_OFFSET4) + DAM2_OFFSET5) = 3;
- }
- if (GetAsyncKeyState(VK_F7) & 0x8000)
- {
- *(DWORD*)(
- *(DWORD*)(
- *(DWORD*)(
- *(DWORD*)(
- *(DWORD*)(
- *(DWORD*)((int)GetModuleHandleA("sf2.exe") + HANDDAM)
- + DAM2_OFFSET1) + DAM2_OFFSET2) + DAM2_OFFSET3) + DAM2_OFFSET4) + DAM2_OFFSET5) = 20;
- }
- if (Variable[99])
- {
- *(DWORD*)(
- *(DWORD*)(
- *(DWORD*)(
- *(DWORD*)(
- *(DWORD*)(
- *(DWORD*)((int)GetModuleHandleA("sf2.exe") + HANDDAM)
- + DAM2_OFFSET1) + DAM2_OFFSET2) + DAM2_OFFSET3) + DAM2_OFFSET4) + DAM2_OFFSET5) = 500;
- }
- if (GetAsyncKeyState(VK_F9) & 0x8000)
- {
- *(DWORD*)(
- *(DWORD*)(
- *(DWORD*)(
- *(DWORD*)(
- *(DWORD*)(
- *(DWORD*)((int)GetModuleHandleA("sf2.exe") + HANDDAM)
- + DAM2_OFFSET1) + DAM2_OFFSET2) + DAM2_OFFSET3) + DAM2_OFFSET4) + DAM2_OFFSET5) = 2000;
- }
- if (GetAsyncKeyState(VK_F9) & 0x8000)
- {
- *(DWORD*)(
- *(DWORD*)(
- *(DWORD*)(
- *(DWORD*)(
- *(DWORD*)(
- *(DWORD*)((int)GetModuleHandleA("sf2.exe") + Sup_Bullet)
- + Sup_OFFSET1) + Sup_OFFSET2) + Sup_OFFSET3) + Sup_OFFSET4) + Sup_OFFSET5) = 1195593728;
- }
- if (GetAsyncKeyState(VK_F11) & 0x8000)
- {
- *(DWORD*)(
- *(DWORD*)(
- *(DWORD*)(
- *(DWORD*)(
- *(DWORD*)(
- *(DWORD*)((int)GetModuleHandleA("sf2.exe") + HANDDAM)
- + DAM2_OFFSET1) + DAM2_OFFSET2) + DAM2_OFFSET3) + DAM2_OFFSET4) + DAM2_OFFSET5) = 600;
- }
- if (GetAsyncKeyState(VK_F11) & 0x8000)
- {
- *(DWORD*)(
- *(DWORD*)(
- *(DWORD*)(
- *(DWORD*)(
- *(DWORD*)(
- *(DWORD*)((int)GetModuleHandleA("sf2.exe") + Sup_Bullet)
- + Sup_OFFSET1) + Sup_OFFSET2) + Sup_OFFSET3) + Sup_OFFSET4) + Sup_OFFSET5) = 1195593728;
- }
- if (GetAsyncKeyState(VK_F8) & 0x8000)
- {
- *(DWORD*)(
- *(DWORD*)(
- *(DWORD*)(
- *(DWORD*)(
- *(DWORD*)(
- *(DWORD*)((int)GetModuleHandleA("sf2.exe") + Sup_Bullet1)
- + Sup1_OFFSET1) + Sup1_OFFSET2) + Sup1_OFFSET3) + Sup1_OFFSET4) + Sup1_OFFSET5) = 1195593728;
- }
- if (GetAsyncKeyState(VK_F9) & 0x8000)
- {
- *(DWORD*)(
- *(DWORD*)(
- *(DWORD*)(
- *(DWORD*)(
- *(DWORD*)(
- *(DWORD*)((int)GetModuleHandleA("sf2.exe") + Sup_Bullet1)
- + Sup1_OFFSET1) + Sup1_OFFSET2) + Sup1_OFFSET3) + Sup1_OFFSET4) + Sup1_OFFSET5) = 1195593728;
- }
- if (GetAsyncKeyState(VK_F9) & 0x8000)
- {
- *(DWORD*)(
- *(DWORD*)(
- *(DWORD*)(
- *(DWORD*)(
- *(DWORD*)(
- *(DWORD*)((int)GetModuleHandleA("sf2.exe") + Sup_Bullet)
- + Sup_OFFSET1) + Sup_OFFSET2) + Sup_OFFSET3) + Sup_OFFSET4) + Sup_OFFSET5) = 1195593728;
- }
- if (GetAsyncKeyState(VK_F8) & 0x8000)
- {
- *(DWORD*)(
- *(DWORD*)(
- *(DWORD*)(
- *(DWORD*)(
- *(DWORD*)(
- *(DWORD*)((int)GetModuleHandleA("sf2.exe") + Sup_Bullet)
- + Sup_OFFSET1) + Sup_OFFSET2) + Sup_OFFSET3) + Sup_OFFSET4) + Sup_OFFSET5) = 1195593728;
- }
- if (IsAQS) //If Our Variable Becomes True Then...
- {
- if (GetKeyState(VK_RBUTTON) == 1) //If You Press The Right Mouse Button...
- {
- Sleep(0); //Stops The Current Thread For 100 Ms.
- mouse_event(MOUSEEVENTF_RIGHTDOWN, 0, 0, 0, 0); //Right Mouse Down
- mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0); //1
- mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0); //2
- //1 + 2 = Left Mouse Click
- mouse_event(MOUSEEVENTF_RIGHTUP, 0, 0, 0, 0); //Right Mouse Up
- Sleep(1); //Already Explained...Stops The Current Thread For 100 Ms.
- GetKeyState(0x51);
- Sleep(1);
- GetKeyState(0x51);
- }
- }
- if (IsRapied)
- {
- if (GetKeyState(0x45) == 1)
- {
- // Push down the L
- mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0);
- // Lift up L
- mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);
- }
- if (GetKeyState(VK_F7) == 1);
- }
- if (menu.MenuSelection >= menu.Current)
- menu.MenuSelection = 1;
- else if (menu.MenuSelection <= 0)
- menu.MenuSelection = (menu.Current - 1);
- if (Variable[0])
- CrossHair(pDevice, Green);
- if (Variable[57])
- if (EspOn)
- if (Variable[66])
- CrossHair(pDevice, Green);
- if (Variable[9])
- CrossHair21(pDevice, Green);
- if (CrossColors)
- {
- CrossHair18(pDevice, Red);
- }
- else
- {
- if (Variable[100])
- CrossHair18(pDevice, Green);
- }
- if (Variable[67])
- {
- CrossHair77(pDevice, Green);
- }
- if (Variable[68])
- CrossHair78(pDevice, Green);
- if (Variable[70])
- {
- CrossHair79(pDevice, Green);
- }
- if (Variable[12])
- {
- DrawCircle(ScreenX + 512, ScreenY + 384, 13, 13, Red); //test? build this is what I use for my crosshair okir
- CrossHair18(pDevice, Green);
- }
- return OPresent(pDevice, pSourceRect, pDestRect, hDestWindowOverride, pDirtyRegion);
- }
- DWORD WINAPI Hook(LPVOID lpArgs)
- {
- HMODULE D3D9 = 0;
- while (!D3D9)
- {
- Sleep(100);
- D3D9 = GetModuleHandle("d3d9.dll");
- }
- DWORD VTable[3] = { 0 };
- CreateDevice(VTable);
- OReset = (TReset)DetourFunction((PBYTE)GetDeviceAddress(16), (PBYTE)Reset);
- OPresent = (TPresent)DetourFunction((PBYTE)GetDeviceAddress(17), (PBYTE)Present);
- Orginal_DrawIndexedPrimitive = (Prototype_DrawIndexedPrimitive)DetourFunction((PBYTE)GetDeviceAddress(82), (PBYTE)Hooked_DrawIndexedPrimitive);
- if (Direct3DCreate9_VMTable() == D3D_OK)
- {
- return TRUE;
- }
- DWORD dwVTable[2] = { 0 };
- CreateDevice(dwVTable);
- return TRUE;
- }
- BOOL WINAPI DllMain(HINSTANCE hinstModule, DWORD dwReason, LPVOID lpvReserved)
- {
- if (dwReason == DLL_PROCESS_ATTACH)
- {
- DisableThreadLibraryCalls(hinstModule);
- CreateThread(0, 0, &Hook, 0, 0, 0);
- }
- return TRUE;
- }
- //WAIT OK ok
- HRESULT WINAPI Hooked_DrawIndexedPrimitive(LPDIRECT3DDEVICE9 Device, D3DPRIMITIVETYPE PrimType, INT BaseVertexIndex, UINT MinVertexIndex, UINT NumVertices, UINT startIndex, UINT primCount)
- {
- IDirect3DVertexBuffer9* pStreamData = NULL;
- UINT xOffset, Stride;
- if (Device->GetStreamSource(0, &pStreamData, &xOffset, &Stride) == D3D_OK)
- pStreamData->Release();
- UINT pSizeOfData;
- if (SUCCEEDED(Device->GetPixelShader(&pShader)))
- if (pShader != NULL)
- if (SUCCEEDED(pShader->GetFunction(NULL, &pSizeOfData)))
- if (pShader != NULL){ pShader->Release(); pShader = NULL; }
- if (bshaddinge)
- {
- TehShader(Device, &pWhite, 255, 255, 255);
- TehShader(Device, &pBlue, 0, 0, 255);
- TehShader(Device, &pBlack, 0, 0, 0);
- TehShader(Device, &pYellow, 255, 255, 0);
- TehShader(Device, &pDarkBlue, 25, 0, 151);
- TehShader(Device, &pLightYellow, 255, 255, 51);
- TehShader(Device, &pMagenta, 225, 0, 255);
- TehShader(Device, &pRed, 255, 0, 0);
- bshaddinge = false;
- }
- if (WIREFRAME)
- {
- if (Stride == 32)
- {
- Device->SetRenderState(D3DRS_ZENABLE, false);
- Orginal_DrawIndexedPrimitive(Device, PrimType, BaseVertexIndex, MinVertexIndex, NumVertices, startIndex, primCount); //lets override these bitches... xd test
- Device->SetRenderState(D3DRS_ZENABLE, true);
- }
- }
- if (SOLID)
- {
- if (Stride == 32 && startIndex == 0)
- {
- Device->SetPixelShader(pBlack);
- Device->SetRenderState(D3DRS_ZENABLE, false);
- Orginal_DrawIndexedPrimitive(Device, PrimType, BaseVertexIndex, MinVertexIndex, NumVertices, startIndex, primCount); //lets override these bitches... xd test
- Device->SetRenderState(D3DRS_ZENABLE, true);
- Device->SetPixelShader(pWhite);
- Device->SetRenderState(D3DRS_FILLMODE, D3DFILL_WIREFRAME);
- }
- }
- if (POINTCHAMS)
- {
- if (Stride == 32)
- {
- Device->SetPixelShader(pBlue);
- Device->SetRenderState(D3DRS_FILLMODE, D3DFILL_WIREFRAME);
- Device->SetRenderState(D3DRS_ZENABLE, false);
- Orginal_DrawIndexedPrimitive(Device, PrimType, BaseVertexIndex, MinVertexIndex, NumVertices, startIndex, primCount); //lets override these bitches... xd test
- Device->SetRenderState(D3DRS_ZENABLE, true);
- Device->SetPixelShader(pRed);
- Device->SetRenderState(D3DRS_FILLMODE, D3DFILL_WIREFRAME);
- }
- }
- if (Ghost)
- {
- if (Stride == 32)
- {
- Device->SetPixelShader(pGreen);
- Device->SetRenderState(D3DRS_FILLMODE, D3DFILL_WIREFRAME);
- Device->SetRenderState(D3DRS_ZENABLE, false);
- Orginal_DrawIndexedPrimitive(Device, PrimType, BaseVertexIndex, MinVertexIndex, NumVertices, startIndex, primCount); //lets override these bitches... xd test
- Device->SetRenderState(D3DRS_ZENABLE, true);
- Device->SetPixelShader(pRed);
- Device->SetRenderState(D3DRS_FILLMODE, D3DFILL_WIREFRAME);
- }
- }
- if (NewCham)
- {
- if (Stride == 32)
- {
- Device->SetRenderState(D3DRS_ZENABLE, false);
- Orginal_DrawIndexedPrimitive(Device, PrimType, BaseVertexIndex, MinVertexIndex, NumVertices, startIndex, primCount);
- Device->SetRenderState(D3DRS_ZENABLE, true);
- }
- }
- if (Variable[403])
- {
- if (Stride == 32)
- {
- DWORD dwOldZEnable = D3DZB_TRUE;
- Device->SetPixelShader(Front);
- Orginal_DrawIndexedPrimitive(Device, PrimType, BaseVertexIndex, MinVertexIndex, NumVertices, startIndex, primCount);
- Device->SetRenderState(D3DRS_LIGHTING, false);
- Device->SetRenderState(D3DRS_AMBIENT, D3DCOLOR_ARGB(255, 255, 255, 255));
- Device->SetPixelShader(Back);
- }
- }
- return Orginal_DrawIndexedPrimitive(Device, PrimType, BaseVertexIndex, MinVertexIndex, NumVertices, startIndex, primCount);
- }
- // OLD CODE IN CASE OF ISSUES
- /*Device->SetPixelShader(pRed);
- Device->SetRenderState(D3DRS_ZENABLE, false);
- Orginal_DrawIndexedPrimitive(Device, PrimType, BaseVertexIndex, MinVertexIndex, NumVertices, startIndex, primCount);
- Device->SetRenderState(D3DRS_ZENABLE, true);
- Device->SetPixelShader(pRed);
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement