Advertisement
Guest User

Untitled

a guest
May 26th, 2017
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Globals:
  2. int colored wallsIf(colored walls)//your bool statement in globals
  3. texnum = (nNumVertices*100000)+nPrimitiveCount;//having it in texnums never hurts, unless its just a stride
  4. 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
  5. {
  6. {
  7. pDevice->SetTexture( 0, Red ); //we colored it red. How'd we get to color it check out the next shizznet under this, chams..
  8. }
  9. return pDrawIndexedPrimitive(pDevice, pType, nMinIndex, nNumVertices, nStartIndex, nPrimitiveCount)//==================================Defines============================================
  10. #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)
  11. #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)
  12. #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)
  13. #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)
  14. //=======================================================int m_Stride;
  15. int texnum;
  16. int nNumVertices;
  17. int nPrimitiveCount;
  18. LPDIRECT3DTEXTURE8 Red;
  19. LPDIRECT3DTEXTURE8 Yellow;
  20. LPDIRECT3DTEXTURE8 Green;
  21. LPDIRECT3DTEXTURE8 Blue;
  22. LPDIRECT3DTEXTURE8 Purple;
  23. LPDIRECT3DTEXTURE8 Orange;
  24. LPDIRECT3DTEXTURE8 Pink;
  25. LPDIRECT3DTEXTURE8 White;
  26. LPDIRECT3DTEXTURE8 Black;
  27. bool chams = false;
  28. bool Color = true//======================================================================================================================================================================================================================================================================================================================//
  29. HRESULT GenerateTexture(IDirect3DDevice8 *pD3Ddev, IDirect3DTexture8 **ppD3Dtex, DWORD colour32)
  30. {
  31. if( FAILED(pD3Ddev->CreateTexture(8, 8, 1, 0, D3DFMT_A4R4G4B4, D3DPOOL_MANAGED, ppD3Dtex)) )
  32. return E_FAIL;
  33. WORD colour16 = ((WORD)((colour32>>28)&0xF)<<12)
  34. |(WORD)(((colour32>>20)&0xF)<<8)
  35. |(WORD)(((colour32>>12)&0xF)<<4)
  36. |(WORD)(((colour32>>4)&0xF)<<0);
  37. D3DLOCKED_RECT d3dlr;
  38. (*ppD3Dtex)->LockRect(0, &d3dlr, 0, 0);
  39. WORD *pDst16 = (WORD*)d3dlr.pBits;
  40. for(int xy=0; xy < 8*8; xy++)
  41. *pDst16++ = colour16;
  42. (*ppD3Dtex)->UnlockRect(0);
  43. return S_OK;
  44. }
  45. //=============================================================================================================bool Color = truetypedef HRESULT ( WINAPI* oEndScene ) ( LPDIRECT3DDEVICE8 pDevice );
  46. oEndScene pEndScene;
  47. HRESULT WINAPI myEndScene(LPDIRECT3DDEVICE8 pDevice)
  48. {
  49. if(Color)
  50. {
  51. GenerateTexture(pDevice, &Red, D3DCOLOR_ARGB (255 , 255 , 0 , 0 ));
  52. GenerateTexture(pDevice, &Yellow, D3DCOLOR_ARGB (255 , 255 , 255 , 0 ));
  53. GenerateTexture(pDevice, &Green, D3DCOLOR_ARGB (255 , 0 , 255 , 0 ));
  54. GenerateTexture(pDevice, &Blue, D3DCOLOR_ARGB (255 , 0 , 0 , 255 ));
  55. GenerateTexture(pDevice, &Purple, D3DCOLOR_ARGB (255 , 102 , 0 , 153 ));
  56. GenerateTexture(pDevice, &Pink, D3DCOLOR_ARGB (255 , 255 , 20 , 147 ));
  57. GenerateTexture(pDevice, &Orange, D3DCOLOR_ARGB (255 , 255 , 165 , 0 ));
  58. GenerateTexture(pDevice, &Black, D3DCOLOR_ARGB (255 , 0 , 0 , 0 ));
  59. GenerateTexture(pDevice, &White, D3DCOLOR_ARGB (255 , 255 , 255 , 255 ));
  60. Color=false;
  61. }
  62. return pEndScene(pDevice);
  63. typedef HRESULT ( WINAPI* oDrawIndexedPrimitive ) ( LPDIRECT3DDEVICE8 pDevice, D3DPRIMITIVETYPE pType, UINT nMinIndex, UINT nNumVertices, UINT nStartIndex, UINT nPrimitiveCount );
  64. oDrawIndexedPrimitive pDrawIndexedPrimitive;
  65. HRESULT WINAPI myDrawIndexedPrimitive(LPDIRECT3DDEVICE8 pDevice, D3DPRIMITIVETYPE pType, UINT nMinIndex, UINT nNumVertices, UINT nStartIndex, UINT nPrimitiveCount)
  66. {
  67. if(chams)
  68. {
  69. texnum = (nNumVertices*100000)+nPrimitiveCount;
  70. if(m_Stride==40 &&
  71. (texnum==34900580)|| // Delta Force Head
  72. (texnum==36100604)|| // Spetsnaz Head
  73. (texnum==38000658)|| // Spetsnaz Legs
  74. (texnum==18300268)|| // Spetsnaz int m_Stride;
  75. int texnum;
  76. int nNumVertices;
  77. int nPrimitiveCount;
  78. bool chams = falsetexnum = (nNumVertices*100000)+nPrimitiveCountRenderState(D3DRS_ZENABLE, D3DZB_FALSE);
  79. pDevice->SetRenderState(D3DRS_ZFUNC,D3DCMP_NEVER);
  80. pDevice->SetTexture(0,Yellow);
  81. pDrawIndexedPrimitive(pDevice, pType, nMinIndex, nNumVertices, nStartIndex, nPrimitiveCount);
  82. pDevice->SetRenderState(D3DRS_ZENABLE, D3DZB_TRUE);
  83. pDevice->SetRenderState(D3DRS_ZFUNC,D3DCMP_LESSEQUAL);
  84. pDevice->SetTexture(0,Red)pDevice->SetTexture(0,Yellow)pDevice->SetTexture(0,Red);
  85. LPDIRECT3DTEXTURE8 Red;
  86. LPDIRECT3DTEXTURE8 Yellow;
  87. LPDIRECT3DTEXTURE8 Green;
  88. LPDIRECT3DTEXTURE8 Blue;
  89. LPDIRECT3DTEXTURE8 Purple;
  90. LPDIRECT3DTEXTURE8 Orange;
  91. LPDIRECT3DTEXTURE8 Pink;
  92. LPDIRECT3DTEXTURE8 White;
  93. LPDIRECT3DTEXTURE8 Blacktypedef HRESULT ( WINAPI* oSetStreamSource ) ( LPDIRECT3DDEVICE8 pDevice, UINT nStreamNumber, LPDIRECT3DVERTEXBUFFER8 pStreamData, UINT nStride );
  94. oSetStreamSource pSetStreamSource;
  95. HRESULT WINAPI mySetStreamSource(LPDIRECT3DDEVICE8 pDevice, UINT nStreamNumber, LPDIRECT3DVERTEXBUFFER8 pStreamData, UINT nStride)
  96. {
  97. if(nStreamNumber==0)
  98. m_Stride = nStride;
  99. return pSetStreamSource(pDevice, nStreamNumber, pStreamData, nStride);
  100. if (GetAsyncKeyState(VK_F1)&1) // if we click f1
  101. { chams = !chams; } // chams = if (GetAsyncKeyState(VK_F2)&1) // if we click f2
  102. { colored walls = !colored walls; } // colored walls = int nofog;
  103. int xray;
  104. int fullbrighttypedef HRESULT ( WINAPI* oSetRenderState ) ( LPDIRECT3DDEVICE8 pDevice, D3DRENDERSTATETYPE State, DWORD Value);
  105. oSetRenderState pSetRenderState;
  106. HRESULT WINAPI mySetRenderState(LPDIRECT3DDEVICE8 pDevice, D3DRENDERSTATETYPE State, DWORD Value)
  107. {
  108. if(fullbright)
  109. {
  110. pDevice->SetRenderState(D3DRS_LIGHTING, false); //d3d lighting off
  111. pDevice->SetRenderState(D3DRS_AMBIENT,D3DCOLOR_ARGB(255,255,255,255)); // use all colors to glow up the lighting ingame
  112. }
  113. if(nofog) // if nofog on
  114. { // then
  115. pDevice->SetRenderState(D3DRS_FOGENABLE, false); // Disable the Fog
  116. } // end of then
  117. if(xray)
  118. {
  119. if(m_Stride == Modelrecognition) //you can define the stride like this to
  120. {
  121. m_pD3Ddev->SetRenderState(D3DRS_ZENABLE, D3DZB_FALSE);
  122. }
  123. }
  124. return pSetRenderState(pDevice,State, Value);
  125. if (GetAsyncKeyState(VK_F3)&1) // if we click f3
  126. { //then
  127. nofog = !nofog; //nofog = on
  128. } //end of float ScreenCenterX = 0.0f;
  129. float ScreenCenterY = 0.0f;
  130. bool xhair = false;
  131. D3DCOLOR redt = D3DCOLOR_XRGB( 255, 0, 0 )if(xhair)
  132. {
  133. D3DRECT rec2 = {ScreenCenterX-20, ScreenCenterY, ScreenCenterX+ 20, ScreenCenterY+2};
  134. D3DRECT rec3 = {ScreenCenterX, ScreenCenterY-20, ScreenCenterX+ 2,ScreenCenterY+20};
  135. pDevice->Clear(1, &rec2, D3DCLEAR_TARGET,redt, 0, 0);
  136. pDevice->Clear(1, &rec3, D3DCLEAR_TARGET,redt, 0, 0)typedef HRESULT (WINAPI* oSetViewport)(LPDIRECT3DDEVICE8 pDevice,CONST D3DVIEWPORT8* pViewport);
  137. oSetViewport pSetViewport;
  138. HRESULT WINAPI mySetViewport(LPDIRECT3DDEVICE8 pDevice,CONST D3DVIEWPORT8* pViewport)
  139. {
  140. ScreenCenterX = ( float )pViewport->Width / 2;
  141. ScreenCenterY = ( float )pViewport->Height / 2;
  142. return pSetViewport(pDevice,pViewport);
  143. if (GetAsyncKeyState(VK_F8)&1) // if we click f8
  144. { xhair = !xhair; } // xhair = typedef HRESULT ( WINAPI* oDrawIndexedPrimitive ) ( LPDIRECT3DDEVICE8 pDevice, D3DPRIMITIVETYPE pType, UINT nMinIndex, UINT nNumVertices, UINT nStartIndex, UINT nPrimitiveCount );
  145. oDrawIndexedPrimitive pDrawIndexedPrimitive, OriginalDrawIndexedPrimitive;
  146. HRESULT WINAPI myDrawIndexedPrimitive(LPDIRECT3DDEVICE8 pDevice, D3DPRIMITIVETYPE pType, UINT nMinIndex, UINT nNumVertices, UINT nStartIndex, UINT nPrimitiveCount)
  147. {
  148. if(WireFame)
  149. if(m_Stride == modelrecog)
  150. { // then
  151. pDevice->SetRenderState(D3DRS_FILLMODE, D3DFILL_WIREFRAME);
  152. } // end of int WireFrameif (GetAsyncKeyState(VK_F3)&1) // if we click f3
  153. { //then
  154. wireframe = !wireframe; //wireframe = on
  155. } // end of if(m_Stride == 40)
  156. { // then
  157. pDevice->SetRenderState(D3DRS_FILLMODE, D3DFILL_WIREFRAME);
  158. } // end of then
  159. [/CODE]
  160.  
  161. int AsusWallhacktypedef HRESULT ( WINAPI* oDrawIndexedPrimitive ) ( LPDIRECT3DDEVICE8 pDevice, D3DPRIMITIVETYPE pType, UINT nMinIndex, UINT nNumVertices, UINT nStartIndex, UINT nPrimitiveCount );
  162. oDrawIndexedPrimitive pDrawIndexedPrimitive, OriginalDrawIndexedPrimitive;
  163. HRESULT WINAPI myDrawIndexedPrimitive(LPDIRECT3DDEVICE8 pDevice, D3DPRIMITIVETYPE pType, UINT nMinIndex, UINT nNumVertices, UINT nStartIndex, UINT nPrimitiveCount)
  164. {
  165. if(AsusWallhack)
  166. if(Model_rec//for walls)
  167. int noskyif(nosky)
  168. {
  169. if(modelrec)
  170. {
  171. return D3D_OK
  172. }
  173. int noflashif(noflash)
  174. {
  175. if(ModelRec)
  176. {
  177. return D3D_OK;
  178. }
  179. if(nosmoke)
  180. {
  181. if(ModelRec)
  182. {
  183. return D3D_OK;
  184. }
  185. if(nosmoke)
  186. {
  187. if(ModelRec)
  188. {
  189. return D3D_OK;
  190. }
  191. int nowater;
  192. if(nowater)
  193. {
  194. if(ModelRec)
  195. {
  196. return D3D_OK;
  197. }
  198. return D3D_OKreturn 0int GlassWallsif(GlassWalls)
  199. {
  200. if(ModelRec)
  201. {
  202. return D3D_OK;
  203. }
  204. //==========================================FindPatt======================================================================//
  205. bool bCompare(const BYTE* pData, const BYTE* bMask, const char* szMask)
  206. {
  207. for(;*szMask;++szMask,++pData,++bMask)
  208. if(*szMask=='x' && *pData!=*bMask) return 0;
  209. return (*szMask) == NULL;
  210. }
  211. //=======================================================================
  212. DWORD FindPattern(DWORD dwAddress,DWORD dwLen,BYTE *bMask,char * szMask)
  213. {
  214. for(DWORD i=0; i<dwLen; i++)
  215. if (bCompare((BYTE*)(dwAddress+i),bMask,szMask)) return (DWORD)(dwAddress+i);
  216. return 0;
  217. }
  218. //=======================================================================
  219. void *DetourFunc(BYTE *src, const BYTE *dst, const int len)
  220. {
  221. BYTE *jmp = (BYTE*)malloc(len+5);
  222. DWORD dwBack;
  223. VirtualProtect(src, len, PAGE_READWRITE, &dwBack);
  224. memcpy(jmp, src, len);
  225. jmp += len;
  226. jmp[0] = 0xE9;
  227. *(DWORD*)(jmp+1) = (DWORD)(src+len - jmp) - 5;
  228. src[0] = 0x90; //50
  229. src[1] = 0x90; // 58
  230. src[2] = 0xE9;
  231. *(DWORD*)(&src[3]) = (DWORD)(dst - src) - 7;
  232. for (int i=7; i<len; i++) src[i] = 0x90;
  233. VirtualProtect(src, len, dwBack, &dwBack);
  234. return (jmp-len);
  235. bool bCompare(const BYTE* pData, const BYTE* bMask, const char* szMask);
  236. DWORD FindPattern(DWORD dwAddress,DWORD dwLen,BYTE *bMask,char * szMask);
  237. void *DetourFunc(BYTE *src, const BYTE *dst, const int len);
  238. int D3D8BASE (void);
  239. int sleepthread2 (void);
  240. int sleepthread (void) DWORD* VTableHook = 0;
  241. DWORD hD3D8 = (DWORD)GetModuleHandle("d3d8.dll");
  242. DWORD VIRTUALTABLE = FindPattern(hD3D8, 0x128000, (PBYTE)"\xC7\x06\x00\x00\x00\x00\x89\x86\x00\x00\x00\x00\x89\x86", "xx????xx????xx");
  243. memcpy(&VTableHook, (void*)(VIRTUALTABLE+2), 4);
  244. DWORD dwEndScene = VTableHook[35];
  245. DWORD dwDrawIndexedPrimitive = VTableHook[71];
  246. DWORD dwSetStreamSource = VTableHook[83];
  247. DWORD dwSetViewport = VTableHook[40];
  248. DWORD dwSetRenderState = VTableHook[50];
  249. pDrawIndexedPrimitive = (oDrawIndexedPrimitive)DetourFunc((PBYTE)dwDrawIndexedPrimitive, (PBYTE)myDrawIndexedPrimitive, 7);
  250. pSetStreamSource = (oSetStreamSource)DetourFunc((PBYTE)dwSetStreamSource, (PBYTE)mySetStreamSource, 7);
  251. pEndScene = (oEndScene)DetourFunc((PBYTE)dwEndScene, (PBYTE)myEndScene, 7);
  252. pSetViewport = (oSetViewport)DetourFunc((PBYTE)dwSetViewport, (PBYTE)mySetViewport, 7);
  253. pSetRenderState = (oSetRenderState)DetourFunc((PBYTE)dwSetRenderState, (PBYTE)mySetRenderState, 7);
  254. return 0;
  255. }
  256. BOOL WINAPI DllMain ( HMODULE hDll, DWORD dwReason, LPVOID lpReserved )
  257. {
  258. DisableThreadLibraryCalls(hDll);
  259. if ( dwReason == DLL_PROCESS_ATTACH )
  260. {
  261. CreateThread(NULL, NULL, (LPTHREAD_START_ROUTINE)D3D8BASE, NULL, NULL, NULL);
  262. }
  263. return TRUE;
  264. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement