Advertisement
Guest User

Untitled

a guest
Oct 20th, 2019
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.51 KB | None | 0 0
  1. #include "stdafx.h"
  2. #include "Engine.h"
  3.  
  4. #define _LTClientShell 0x166FCE0
  5.  
  6. INT Cabeca, Nuca, OmbroD, ObroE, CotoveloD, CotoveloE, MaoD, MaoE, Peito = 1, Saco, JoelhoD, JoelhoE, PeD, PeE;
  7. int AutoFire, Visivelmente, iAimFov, smmooth;
  8. DWORD Aimkey;
  9. bool inGame()
  10. {
  11. DWORD CShell = (DWORD)GetModuleHandleA("CShell.dll");
  12. //DWORD pLTClientShell = *(DWORD*)(CShell + dw_pLTClientShell);
  13. DWORD pLTClientShell = *(DWORD*)(CShell + _LTClientShell);
  14. cPlayer* player = GetPlayerByIndex(pLTClientShell, GetMyIndex(pLTClientShell));
  15. if ((player != NULL) && (strlen(player->Name) > 2) && (player->Object != NULL))
  16. return true;
  17. return false;
  18. }
  19.  
  20.  
  21. bool IsValidClientAim(cPlayer* Clients)
  22. {
  23. if ((Clients != 0)
  24. && (Clients->Health != 0)
  25. && (strlen(Clients->Name))
  26. && ((Clients->Object != NULL)))
  27. return true;
  28. return false;
  29. }
  30.  
  31.  
  32.  
  33. //bool isValidClientAim(CPlayer* Clients)
  34. //{
  35. // if ((Clients != NULL) && (Clients->Health > 0) && (strlen(Clients->Name) > 2) && (Clients->Object != NULL))
  36. // return true;
  37. // return false;
  38. //}
  39.  
  40. D3DTLVERTEX CreateD3DTLVERTEX(float X, float Y, float Z, float RHW, D3DCOLOR color, float U, float V) {
  41. D3DTLVERTEX v = { X, Y, Z, RHW, color };
  42. return v;
  43. }
  44. void DrawCircle(int x, int y, float radius, D3DCOLOR color, IDirect3DDevice9* pDevice)
  45. {
  46. const DWORD D3D_FVF = D3DFVF_XYZRHW | D3DFVF_DIFFUSE | D3DFVF_TEX1;
  47. const int NUMPOINTS = 30;
  48. const float PI = (float)3.141592654f;
  49.  
  50. D3DTLVERTEX Circle[NUMPOINTS + 1];
  51. float X, Y, Theta, WedgeAngle;
  52. WedgeAngle = (float)((2 * PI) / NUMPOINTS);
  53.  
  54. for (int i = 0; i <= NUMPOINTS; i++)
  55. {
  56. Theta = i * WedgeAngle;
  57. X = (float)(x + radius * cos(Theta));
  58. Y = (float)(y - radius * sin(Theta));
  59. Circle[i] = CreateD3DTLVERTEX(X, Y, 0.0f, 1.0f, color, 0.0f, 0.0f);
  60. }
  61.  
  62. pDevice->SetRenderState(D3DRS_ZENABLE, 0);
  63. pDevice->SetRenderState(D3DRS_FOGENABLE, false);
  64. pDevice->SetRenderState(D3DRS_LIGHTING, false);
  65. pDevice->SetRenderState(D3DRS_ALPHATESTENABLE, true);
  66. pDevice->SetRenderState(D3DRS_ALPHABLENDENABLE, true);
  67. pDevice->SetRenderState(D3DRS_ALPHAFUNC, D3DCMP_GREATEREQUAL);
  68. pDevice->SetRenderState(D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA);
  69.  
  70. pDevice->SetFVF(D3D_FVF);
  71. pDevice->SetTexture(0, NULL);
  72. pDevice->DrawPrimitiveUP(D3DPT_LINESTRIP, NUMPOINTS, &Circle[0], sizeof(Circle[0]));
  73. pDevice->SetTexture(0, NULL);
  74. }
  75.  
  76. int AimbotPosition;
  77. int Aimbot;
  78. bool LMOUSE;
  79. INT iFov;
  80. INT AimFov;
  81. INT CriarFovAimbot;
  82. void PlayerAimbot(LPDIRECT3DDEVICE9 pDevice)
  83. {
  84. DWORD CShell = (DWORD)GetModuleHandleA("CShell.dll");
  85. DWORD ClientFX = (DWORD)GetModuleHandleA("ClientFx.fxd");
  86. if (CShell != NULL && ClientFX != NULL)
  87. {
  88. DWORD pCLTPlayerClient = *(DWORD*)(CShell + aCLTPlayerClient + PlayerClientOffset);
  89. if (pCLTPlayerClient && inGame() && Aimbot)
  90. {
  91. int TargetIndex, BONE_ID;
  92. BONE_ID = 6;//HEAD
  93. switch (AimbotPosition)
  94. {
  95. case 1: BONE_ID = 6; break;//Head
  96. case 2: BONE_ID = 5; break;//Neck
  97. case 3: BONE_ID = 2; break;//Body
  98. case 4: BONE_ID = 10; break;//LeftHand
  99. case 5: BONE_ID = 17; break;//RightHand
  100. case 6: BONE_ID = 23; break;//FeftFoot
  101. case 7: BONE_ID = 28; break;//RightFoot
  102. default: BONE_ID = 6;//HEAD
  103. }
  104. int iAimAt = -1;
  105. float MaxDistance = 0xFFFFFFF;
  106.  
  107. D3DVIEWPORT9 viewP;
  108. pDevice->GetViewport(&viewP);
  109. float ScreenX = viewP.Width / 2;
  110. float ScreenY = viewP.Height / 2;
  111.  
  112. DWORD pLTClientShell = *(DWORD*)(CShell + _LTClientShell);
  113. cPlayer* Me = GetPlayerByIndex(pLTClientShell, GetMyIndex(pLTClientShell));
  114. if (pLTClientShell != NULL)
  115. {
  116. for (int i = 0; i < 16; i++)
  117. {
  118. cPlayer* pPlayer = GetPlayerByIndex(pLTClientShell, i);
  119. D3DXVECTOR3 pos = GetBonePosition(pPlayer->Object, 6);
  120.  
  121. if (Trans3DTo2D(pDevice, &pos))
  122. {
  123. POINT pt;
  124. D3DVIEWPORT9 Viewport;
  125. pDevice->GetViewport(&Viewport);
  126. DWORD x1 = Viewport.Width / 2;
  127. DWORD y1 = Viewport.Height / 2;
  128. pt.x = x1;
  129. pt.y = y1;
  130. if (iAimFov)
  131. {
  132. if (iFov == 0)
  133. AimFov = 10.0f;
  134. else if (iFov == 1)
  135. AimFov = 30.0f;
  136. else if (iFov == 2)
  137. AimFov = 60.0f;
  138. else if (iFov == 3)
  139. AimFov = 90.0f;
  140. else if (iFov == 4)
  141. AimFov = 120.0f;
  142. else if (iFov == 5)
  143. AimFov = 180.0f;
  144. else if (iFov == 6)
  145. AimFov = 360.0f;
  146.  
  147. }
  148. if (CriarFovAimbot)
  149. {
  150. int PI222 = 6.283185307179586;
  151. POINT pt;
  152. D3DVIEWPORT9 Viewport;
  153. pDevice->GetViewport(&Viewport);
  154. DWORD posx = Viewport.Width / 2;
  155. DWORD posy = Viewport.Height / 2;
  156. pt.x = posx;
  157. pt.y = posy;
  158. DrawCircle(pt.x - 1, pt.y, iFov * PI222, D3DCOLOR_ARGB(255, 000, 000, 000), pDevice);
  159. DrawCircle(pt.x, pt.y, iFov * PI222, D3DCOLOR_ARGB(255, 000, 255, 000), pDevice);
  160. }
  161.  
  162. float radiusx = (AimFov * 5.0f) * (ScreenX / 100.0f);
  163. float radiusy = (AimFov * 5.0f) * (ScreenY / 100.0f);
  164.  
  165. if (AimFov == 0)
  166. {
  167. radiusx = 5.0f * (ScreenX / 100.0f);
  168. radiusy = 5.0f * (ScreenY / 100.0f);
  169. }
  170.  
  171. float Tmp = GetDistance(pos.x, pos.y, ScreenX, ScreenY);
  172.  
  173. //if in fov
  174. if (pos.x >= ScreenX - radiusx && pos.x <= ScreenX + radiusx && pos.y >= ScreenY - radiusy && pos.y <= ScreenY + radiusy)
  175. {
  176. if (Tmp < MaxDistance)
  177. {
  178. MaxDistance = Tmp;
  179. iAimAt = i;
  180. }
  181. }
  182. }
  183.  
  184. }
  185.  
  186. if (iAimAt == -1)
  187. return;
  188. if (iAimAt > -1)
  189. {
  190. cPlayer* Target = GetPlayerByIndex(pLTClientShell, iAimAt);
  191. D3DXVECTOR3 AimPos = GetBonePosition(Target->Object, BONE_ID);
  192.  
  193. if (Visivelmente && IsVisible(GetBonePosition(Me->Object, BONE_ID), GetBonePosition(Target->Object, BONE_ID)))
  194. {
  195. if (Target != Me && !IsTM(pLTClientShell, Target) && IsValidClientAim(Target))
  196. {
  197. if (Trans3DTo2D(pDevice, &AimPos))
  198. {
  199. float DistX = AimPos.x - ScreenX;
  200. float DistY = AimPos.y - ScreenY;
  201.  
  202. int aimsens = 5;
  203. DistX /= (0.5f + (float)aimsens * 0.5f);
  204. DistY /= (0.5f + (float)aimsens * 0.5f);
  205.  
  206. if (LMOUSE)
  207. {
  208. Aimkey = VK_LBUTTON;
  209. }
  210. if (GetAsyncKeyState(Aimkey))
  211. {
  212. mouse_event(MOUSEEVENTF_MOVE, (float)DistX, (float)DistY, 0, NULL);
  213.  
  214. }
  215. if (AutoFire)
  216. {
  217. mouse_event(MOUSEEVENTF_LEFTDOWN, NULL, NULL, NULL, NULL);
  218. mouse_event(MOUSEEVENTF_LEFTUP, NULL, NULL, NULL, NULL);
  219.  
  220. }
  221. }
  222. }
  223. }
  224. }
  225. }
  226. }
  227. }
  228. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement