Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Globals:
- int colored wallsIf(colored walls)//your bool statement in globals
- texnum = (nNumVertices*100000)+nPrimitiveCount;//having it in texnums never hurts, unless its just a stride
- if(m_Stride == model_rec)//Model Recognition, this recognizes what you want to color in, so we would have to get a Model Recognition logger, go in game and find the Stride for the wall/floor
- {
- {
- pDevice->SetTexture( 0, Red ); //we colored it red. How'd we get to color it check out the next shizznet under this, chams..
- }
- return pDrawIndexedPrimitive(pDevice, pType, nMinIndex, nNumVertices, nStartIndex, nPrimitiveCount)//==================================Defines============================================
- #define ForceRecon (nNumVertices == 83 && nPrimitiveCount == 137 || nNumVertices == 79 && nPrimitiveCount == 105 || nNumVertices == 142 && nPrimitiveCount == 174 || nNumVertices == 278 && nPrimitiveCount == 462 || nNumVertices == 263 && nPrimitiveCount == 290 || nNumVertices == 316 && nPrimitiveCount == 556)
- #define ForceReconAddons (nNumVertices == 432 && nPrimitiveCount == 354 || nNumVertices == 144 && nPrimitiveCount == 136 || nNumVertices == 299 && nPrimitiveCount == 311 || nNumVertices == 167 && nPrimitiveCount == 252 || nNumVertices == 298 && nPrimitiveCount == 506 || nNumVertices == 168 && nPrimitiveCount == 254 || nNumVertices == 860 && nNumVertices == 778 || nNumVertices == 648 && nPrimitiveCount == 710 || nNumVertices == 113 && nPrimitiveCount == 189 || nNumVertices == 142 && nPrimitiveCount == 172 || nNumVertices == 87 && nPrimitiveCount == 90 || nNumVertices == 79 && nPrimitiveCount == 105 || nNumVertices == 84 && nPrimitiveCount == 110 || nNumVertices == 70 && nPrimitiveCount == 70 || nNumVertices == 860 && nPrimitiveCount == 778 || nNumVertices == 85 && nPrimitiveCount == 137)
- #define Mulan (nNumVertices == 118 && nPrimitiveCount == 126|| nNumVertices == 121 && nPrimitiveCount == 180|| nNumVertices == 124 && nPrimitiveCount == 126|| nNumVertices == 295 && nPrimitiveCount == 482|| nNumVertices == 299 && nPrimitiveCount == 452|| nNumVertices == 474 && nPrimitiveCount == 728)
- #define MulanAddons (nNumVertices == 162 && nPrimitiveCount == 200|| nNumVertices == 120 && nPrimitiveCount == 188|| nNumVertices == 167 && nPrimitiveCount == 276|| nNumVertices == 108 && nPrimitiveCount == 198|| nNumVertices == 512 && nPrimitiveCount == 728|| nNumVertices == 790 && nPrimitiveCount == 881|| nNumVertices == 619 && nPrimitiveCount == 800|| nNumVertices == 399 && nPrimitiveCount == 532|| nNumVertices == 402 && nPrimitiveCount == 580|| nNumVertices == 102 && nPrimitiveCount == 170|| nNumVertices == 125 && nPrimitiveCount == 98|| nNumVertices == 116 && nPrimitiveCount == 128|| nNumVertices == 160 && nPrimitiveCount == 174)
- //=======================================================int m_Stride;
- int texnum;
- int nNumVertices;
- int nPrimitiveCount;
- LPDIRECT3DTEXTURE8 Red;
- LPDIRECT3DTEXTURE8 Yellow;
- LPDIRECT3DTEXTURE8 Green;
- LPDIRECT3DTEXTURE8 Blue;
- LPDIRECT3DTEXTURE8 Purple;
- LPDIRECT3DTEXTURE8 Orange;
- LPDIRECT3DTEXTURE8 Pink;
- LPDIRECT3DTEXTURE8 White;
- LPDIRECT3DTEXTURE8 Black;
- bool chams = false;
- bool Color = true//======================================================================================================================================================================================================================================================================================================================//
- HRESULT GenerateTexture(IDirect3DDevice8 *pD3Ddev, IDirect3DTexture8 **ppD3Dtex, DWORD colour32)
- {
- if( FAILED(pD3Ddev->CreateTexture(8, 8, 1, 0, D3DFMT_A4R4G4B4, D3DPOOL_MANAGED, ppD3Dtex)) )
- return E_FAIL;
- WORD colour16 = ((WORD)((colour32>>28)&0xF)<<12)
- |(WORD)(((colour32>>20)&0xF)<<8)
- |(WORD)(((colour32>>12)&0xF)<<4)
- |(WORD)(((colour32>>4)&0xF)<<0);
- D3DLOCKED_RECT d3dlr;
- (*ppD3Dtex)->LockRect(0, &d3dlr, 0, 0);
- WORD *pDst16 = (WORD*)d3dlr.pBits;
- for(int xy=0; xy < 8*8; xy++)
- *pDst16++ = colour16;
- (*ppD3Dtex)->UnlockRect(0);
- return S_OK;
- }
- //=============================================================================================================bool Color = truetypedef HRESULT ( WINAPI* oEndScene ) ( LPDIRECT3DDEVICE8 pDevice );
- oEndScene pEndScene;
- HRESULT WINAPI myEndScene(LPDIRECT3DDEVICE8 pDevice)
- {
- if(Color)
- {
- GenerateTexture(pDevice, &Red, D3DCOLOR_ARGB (255 , 255 , 0 , 0 ));
- GenerateTexture(pDevice, &Yellow, D3DCOLOR_ARGB (255 , 255 , 255 , 0 ));
- GenerateTexture(pDevice, &Green, D3DCOLOR_ARGB (255 , 0 , 255 , 0 ));
- GenerateTexture(pDevice, &Blue, D3DCOLOR_ARGB (255 , 0 , 0 , 255 ));
- GenerateTexture(pDevice, &Purple, D3DCOLOR_ARGB (255 , 102 , 0 , 153 ));
- GenerateTexture(pDevice, &Pink, D3DCOLOR_ARGB (255 , 255 , 20 , 147 ));
- GenerateTexture(pDevice, &Orange, D3DCOLOR_ARGB (255 , 255 , 165 , 0 ));
- GenerateTexture(pDevice, &Black, D3DCOLOR_ARGB (255 , 0 , 0 , 0 ));
- GenerateTexture(pDevice, &White, D3DCOLOR_ARGB (255 , 255 , 255 , 255 ));
- Color=false;
- }
- return pEndScene(pDevice);
- typedef HRESULT ( WINAPI* oDrawIndexedPrimitive ) ( LPDIRECT3DDEVICE8 pDevice, D3DPRIMITIVETYPE pType, UINT nMinIndex, UINT nNumVertices, UINT nStartIndex, UINT nPrimitiveCount );
- oDrawIndexedPrimitive pDrawIndexedPrimitive;
- HRESULT WINAPI myDrawIndexedPrimitive(LPDIRECT3DDEVICE8 pDevice, D3DPRIMITIVETYPE pType, UINT nMinIndex, UINT nNumVertices, UINT nStartIndex, UINT nPrimitiveCount)
- {
- if(chams)
- {
- texnum = (nNumVertices*100000)+nPrimitiveCount;
- if(m_Stride==40 &&
- (texnum==34900580)|| // Delta Force Head
- (texnum==36100604)|| // Spetsnaz Head
- (texnum==38000658)|| // Spetsnaz Legs
- (texnum==18300268)|| // Spetsnaz int m_Stride;
- int texnum;
- int nNumVertices;
- int nPrimitiveCount;
- bool chams = falsetexnum = (nNumVertices*100000)+nPrimitiveCountRenderState(D3DRS_ZENABLE, D3DZB_FALSE);
- pDevice->SetRenderState(D3DRS_ZFUNC,D3DCMP_NEVER);
- pDevice->SetTexture(0,Yellow);
- pDrawIndexedPrimitive(pDevice, pType, nMinIndex, nNumVertices, nStartIndex, nPrimitiveCount);
- pDevice->SetRenderState(D3DRS_ZENABLE, D3DZB_TRUE);
- pDevice->SetRenderState(D3DRS_ZFUNC,D3DCMP_LESSEQUAL);
- pDevice->SetTexture(0,Red)pDevice->SetTexture(0,Yellow)pDevice->SetTexture(0,Red);
- LPDIRECT3DTEXTURE8 Red;
- LPDIRECT3DTEXTURE8 Yellow;
- LPDIRECT3DTEXTURE8 Green;
- LPDIRECT3DTEXTURE8 Blue;
- LPDIRECT3DTEXTURE8 Purple;
- LPDIRECT3DTEXTURE8 Orange;
- LPDIRECT3DTEXTURE8 Pink;
- LPDIRECT3DTEXTURE8 White;
- LPDIRECT3DTEXTURE8 Blacktypedef HRESULT ( WINAPI* oSetStreamSource ) ( LPDIRECT3DDEVICE8 pDevice, UINT nStreamNumber, LPDIRECT3DVERTEXBUFFER8 pStreamData, UINT nStride );
- oSetStreamSource pSetStreamSource;
- HRESULT WINAPI mySetStreamSource(LPDIRECT3DDEVICE8 pDevice, UINT nStreamNumber, LPDIRECT3DVERTEXBUFFER8 pStreamData, UINT nStride)
- {
- if(nStreamNumber==0)
- m_Stride = nStride;
- return pSetStreamSource(pDevice, nStreamNumber, pStreamData, nStride);
- if (GetAsyncKeyState(VK_F1)&1) // if we click f1
- { chams = !chams; } // chams = if (GetAsyncKeyState(VK_F2)&1) // if we click f2
- { colored walls = !colored walls; } // colored walls = int nofog;
- int xray;
- int fullbrighttypedef HRESULT ( WINAPI* oSetRenderState ) ( LPDIRECT3DDEVICE8 pDevice, D3DRENDERSTATETYPE State, DWORD Value);
- oSetRenderState pSetRenderState;
- HRESULT WINAPI mySetRenderState(LPDIRECT3DDEVICE8 pDevice, D3DRENDERSTATETYPE State, DWORD Value)
- {
- if(fullbright)
- {
- pDevice->SetRenderState(D3DRS_LIGHTING, false); //d3d lighting off
- pDevice->SetRenderState(D3DRS_AMBIENT,D3DCOLOR_ARGB(255,255,255,255)); // use all colors to glow up the lighting ingame
- }
- if(nofog) // if nofog on
- { // then
- pDevice->SetRenderState(D3DRS_FOGENABLE, false); // Disable the Fog
- } // end of then
- if(xray)
- {
- if(m_Stride == Modelrecognition) //you can define the stride like this to
- {
- m_pD3Ddev->SetRenderState(D3DRS_ZENABLE, D3DZB_FALSE);
- }
- }
- return pSetRenderState(pDevice,State, Value);
- if (GetAsyncKeyState(VK_F3)&1) // if we click f3
- { //then
- nofog = !nofog; //nofog = on
- } //end of float ScreenCenterX = 0.0f;
- float ScreenCenterY = 0.0f;
- bool xhair = false;
- D3DCOLOR redt = D3DCOLOR_XRGB( 255, 0, 0 )if(xhair)
- {
- D3DRECT rec2 = {ScreenCenterX-20, ScreenCenterY, ScreenCenterX+ 20, ScreenCenterY+2};
- D3DRECT rec3 = {ScreenCenterX, ScreenCenterY-20, ScreenCenterX+ 2,ScreenCenterY+20};
- pDevice->Clear(1, &rec2, D3DCLEAR_TARGET,redt, 0, 0);
- pDevice->Clear(1, &rec3, D3DCLEAR_TARGET,redt, 0, 0)typedef HRESULT (WINAPI* oSetViewport)(LPDIRECT3DDEVICE8 pDevice,CONST D3DVIEWPORT8* pViewport);
- oSetViewport pSetViewport;
- HRESULT WINAPI mySetViewport(LPDIRECT3DDEVICE8 pDevice,CONST D3DVIEWPORT8* pViewport)
- {
- ScreenCenterX = ( float )pViewport->Width / 2;
- ScreenCenterY = ( float )pViewport->Height / 2;
- return pSetViewport(pDevice,pViewport);
- if (GetAsyncKeyState(VK_F8)&1) // if we click f8
- { xhair = !xhair; } // xhair = typedef HRESULT ( WINAPI* oDrawIndexedPrimitive ) ( LPDIRECT3DDEVICE8 pDevice, D3DPRIMITIVETYPE pType, UINT nMinIndex, UINT nNumVertices, UINT nStartIndex, UINT nPrimitiveCount );
- oDrawIndexedPrimitive pDrawIndexedPrimitive, OriginalDrawIndexedPrimitive;
- HRESULT WINAPI myDrawIndexedPrimitive(LPDIRECT3DDEVICE8 pDevice, D3DPRIMITIVETYPE pType, UINT nMinIndex, UINT nNumVertices, UINT nStartIndex, UINT nPrimitiveCount)
- {
- if(WireFame)
- if(m_Stride == modelrecog)
- { // then
- pDevice->SetRenderState(D3DRS_FILLMODE, D3DFILL_WIREFRAME);
- } // end of int WireFrameif (GetAsyncKeyState(VK_F3)&1) // if we click f3
- { //then
- wireframe = !wireframe; //wireframe = on
- } // end of if(m_Stride == 40)
- { // then
- pDevice->SetRenderState(D3DRS_FILLMODE, D3DFILL_WIREFRAME);
- } // end of then
- [/CODE]
- int AsusWallhacktypedef HRESULT ( WINAPI* oDrawIndexedPrimitive ) ( LPDIRECT3DDEVICE8 pDevice, D3DPRIMITIVETYPE pType, UINT nMinIndex, UINT nNumVertices, UINT nStartIndex, UINT nPrimitiveCount );
- oDrawIndexedPrimitive pDrawIndexedPrimitive, OriginalDrawIndexedPrimitive;
- HRESULT WINAPI myDrawIndexedPrimitive(LPDIRECT3DDEVICE8 pDevice, D3DPRIMITIVETYPE pType, UINT nMinIndex, UINT nNumVertices, UINT nStartIndex, UINT nPrimitiveCount)
- {
- if(AsusWallhack)
- if(Model_rec//for walls)
- int noskyif(nosky)
- {
- if(modelrec)
- {
- return D3D_OK
- }
- int noflashif(noflash)
- {
- if(ModelRec)
- {
- return D3D_OK;
- }
- if(nosmoke)
- {
- if(ModelRec)
- {
- return D3D_OK;
- }
- if(nosmoke)
- {
- if(ModelRec)
- {
- return D3D_OK;
- }
- int nowater;
- if(nowater)
- {
- if(ModelRec)
- {
- return D3D_OK;
- }
- return D3D_OKreturn 0int GlassWallsif(GlassWalls)
- {
- if(ModelRec)
- {
- return D3D_OK;
- }
- //==========================================FindPatt======================================================================//
- bool bCompare(const BYTE* pData, const BYTE* bMask, const char* szMask)
- {
- for(;*szMask;++szMask,++pData,++bMask)
- if(*szMask=='x' && *pData!=*bMask) return 0;
- return (*szMask) == NULL;
- }
- //=======================================================================
- DWORD FindPattern(DWORD dwAddress,DWORD dwLen,BYTE *bMask,char * szMask)
- {
- for(DWORD i=0; i<dwLen; i++)
- if (bCompare((BYTE*)(dwAddress+i),bMask,szMask)) return (DWORD)(dwAddress+i);
- return 0;
- }
- //=======================================================================
- void *DetourFunc(BYTE *src, const BYTE *dst, const int len)
- {
- BYTE *jmp = (BYTE*)malloc(len+5);
- DWORD dwBack;
- VirtualProtect(src, len, PAGE_READWRITE, &dwBack);
- memcpy(jmp, src, len);
- jmp += len;
- jmp[0] = 0xE9;
- *(DWORD*)(jmp+1) = (DWORD)(src+len - jmp) - 5;
- src[0] = 0x90; //50
- src[1] = 0x90; // 58
- src[2] = 0xE9;
- *(DWORD*)(&src[3]) = (DWORD)(dst - src) - 7;
- for (int i=7; i<len; i++) src[i] = 0x90;
- VirtualProtect(src, len, dwBack, &dwBack);
- return (jmp-len);
- bool bCompare(const BYTE* pData, const BYTE* bMask, const char* szMask);
- DWORD FindPattern(DWORD dwAddress,DWORD dwLen,BYTE *bMask,char * szMask);
- void *DetourFunc(BYTE *src, const BYTE *dst, const int len);
- int D3D8BASE (void);
- int sleepthread2 (void);
- int sleepthread (void) DWORD* VTableHook = 0;
- DWORD hD3D8 = (DWORD)GetModuleHandle("d3d8.dll");
- DWORD VIRTUALTABLE = FindPattern(hD3D8, 0x128000, (PBYTE)"\xC7\x06\x00\x00\x00\x00\x89\x86\x00\x00\x00\x00\x89\x86", "xx????xx????xx");
- memcpy(&VTableHook, (void*)(VIRTUALTABLE+2), 4);
- DWORD dwEndScene = VTableHook[35];
- DWORD dwDrawIndexedPrimitive = VTableHook[71];
- DWORD dwSetStreamSource = VTableHook[83];
- DWORD dwSetViewport = VTableHook[40];
- DWORD dwSetRenderState = VTableHook[50];
- pDrawIndexedPrimitive = (oDrawIndexedPrimitive)DetourFunc((PBYTE)dwDrawIndexedPrimitive, (PBYTE)myDrawIndexedPrimitive, 7);
- pSetStreamSource = (oSetStreamSource)DetourFunc((PBYTE)dwSetStreamSource, (PBYTE)mySetStreamSource, 7);
- pEndScene = (oEndScene)DetourFunc((PBYTE)dwEndScene, (PBYTE)myEndScene, 7);
- pSetViewport = (oSetViewport)DetourFunc((PBYTE)dwSetViewport, (PBYTE)mySetViewport, 7);
- pSetRenderState = (oSetRenderState)DetourFunc((PBYTE)dwSetRenderState, (PBYTE)mySetRenderState, 7);
- return 0;
- }
- BOOL WINAPI DllMain ( HMODULE hDll, DWORD dwReason, LPVOID lpReserved )
- {
- DisableThreadLibraryCalls(hDll);
- if ( dwReason == DLL_PROCESS_ATTACH )
- {
- CreateThread(NULL, NULL, (LPTHREAD_START_ROUTINE)D3D8BASE, NULL, NULL, NULL);
- }
- return TRUE;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement