Advertisement
Guest User

Untitled

a guest
May 20th, 2018
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 39.02 KB | None | 0 0
  1. #include "Function.h"
  2. #include "Colors.h"
  3. #include "CMenu.h"
  4. #include "cSound.h"
  5. #include "Sounds.h"
  6. #include "cMenu.h"
  7. #include "cStruct.h"
  8. #include "Whatafak.h"
  9.  
  10. HRESULT APIENTRY SetTexture_hook(LPDIRECT3DDEVICE9 pDevice, DWORD Sampler, IDirect3DBaseTexture9 *pTexture)
  11. {
  12. if (InitOnce)
  13. {
  14. InitOnce = false;
  15. pDevice->GetViewport(&Viewport);
  16. ScreenCX = (float)Viewport.Width / 2.0f;
  17. ScreenCY = (float)Viewport.Height / 2.0f;
  18. LoadCfg();
  19.  
  20. }
  21.  
  22. if (SUCCEEDED(pDevice->GetVertexShader(&vShader)))
  23. if (vShader != NULL)
  24. if (SUCCEEDED(vShader->GetFunction(NULL, &vSize)))
  25. if (vShader != NULL) { vShader->Release(); vShader = NULL; }
  26.  
  27.  
  28. if (opt.d3d.wallhacks)
  29. {
  30. pDevice->SetRenderState(D3DRS_DEPTHBIAS, 0);
  31. if ((vSize == 2356 || vSize == 900 || vSize == 2008 || vSize == 640) || (Stride == 36 && vSize == 1436) || (Stride == 48 && vSize == 1436))
  32. {
  33. float bias = 1000.0f;
  34. float bias_float = static_cast<float>(-bias);
  35. bias_float /= 10000.0f;
  36. pDevice->SetRenderState(D3DRS_DEPTHBIAS, *(DWORD*)&bias_float);
  37. }
  38.  
  39. if (Stride == 48 || vSize == 2008 || vSize == 2356)
  40. {
  41. D3DXMATRIX matLegs;
  42. D3DXMatrixScaling(&matLegs, 0.0f, 0.0f, 0.0f);
  43. pDevice->SetVertexShaderConstantF(20, matLegs, 1);
  44.  
  45. D3DXMATRIX matChest;
  46. D3DXMatrixScaling(&matChest, 0.0f, 0.0f, 0.0f);
  47. pDevice->SetVertexShaderConstantF(25, matChest, 1);
  48. }
  49.  
  50.  
  51. if (Stride == 48 || vSize == 2300 || vSize == 900 ||
  52. vSize == 1952 || vSize == 640)
  53. AddWeapons(pDevice);
  54. }
  55.  
  56. if (opt.aimbooott.aimbot == 1 > 0)
  57. {
  58. if ((Stride == 48 && vSize > 1328) || (vSize == 2356 || vSize == 2008 || vSize == 1552))
  59. AddWeapons(pDevice);
  60. }
  61.  
  62. if (opt.d3d.frame)
  63. {
  64. pDevice->SetRenderState(D3DRS_FILLMODE, D3DFILL_WIREFRAME);
  65.  
  66. }
  67. else {
  68. pDevice->SetRenderState(D3DRS_FILLMODE, D3DFILL_SOLID);
  69.  
  70. }
  71.  
  72. if (opt.d3d.asus)
  73. {
  74. pDevice->SetRenderState(D3DRS_SRCBLEND, 3);
  75. pDevice->SetRenderState(D3DRS_DESTBLEND, 4);
  76. pDevice->SetRenderState(D3DRS_ALPHABLENDENABLE, true);
  77.  
  78. }
  79.  
  80. DWORD MODULEROS;
  81. MODULEROS = (DWORD)GetModuleHandleA("ros.exe");
  82. DWORD InGameAdrress = (MODULEROS + 0x1E21F28);
  83. DWORD* Verify = (DWORD*)(InGameAdrress);
  84. if (*Verify == 1)
  85. {
  86. DWORD adrMin1 = 0;
  87. DWORD ROS = (DWORD)GetModuleHandleA("ros.exe");
  88.  
  89. if (opt.d3d.Chams)
  90. {
  91. if (GetAsyncKeyState(VK_NUMPAD1) & 1)
  92. {
  93. *(byte*)(ROS + Chamsxx) += 10;
  94. }
  95. if (GetAsyncKeyState(VK_NUMPAD2) & 1)
  96. {
  97. *(byte*)(ROS + Chamsxx) -= 10;
  98. }
  99. }
  100. if (opt.player.superman)
  101. {
  102. if (ROS > 0)
  103. {
  104. adrMin1 = ROS + (DWORD)supermanhero;
  105. Write1((void *)(adrMin1), (void*)(PBYTE)"\x00\x00\xA0\x41", 4);
  106. }
  107. }
  108. if (!opt.player.superman)
  109. {
  110. if (ROS > 0)
  111. {
  112. adrMin1 = ROS + (DWORD)supermanhero;
  113. Write1((void *)(adrMin1), (void*)(PBYTE)"\xCD\xCC\x4C\x3D", 4);
  114. }
  115. }
  116.  
  117. if (opt.player.nofall)
  118. {
  119. if (ROS > 0)
  120. {
  121. adrMin1 = ROS + (DWORD)nofalldamage;
  122. Write1((void *)(adrMin1), (void*)(PBYTE)"\xF6\xC2\x06", 3);
  123. }
  124. }
  125. if (!opt.player.nofall)
  126. {
  127. if (ROS > 0)
  128. {
  129. adrMin1 = ROS + (DWORD)nofalldamage;
  130. Write1((void *)(adrMin1), (void*)(PBYTE)"\xF6\xC2\x02", 3);
  131. }
  132. }
  133.  
  134. if (opt.player.prone)
  135. {
  136. if (ROS > 0)
  137. {
  138. adrMin1 = ROS + (DWORD)Prone;
  139. Write1((void *)(adrMin1), (void*)(PBYTE)"\x18\xFE\x8A\x87", 4);
  140. }
  141. }
  142. if (!opt.player.prone)
  143. {
  144. if (ROS > 0)
  145. {
  146. adrMin1 = ROS + (DWORD)Prone;
  147. Write1((void *)(adrMin1), (void*)(PBYTE)"\xF3\x0F\x11\x87", 4);
  148. }
  149. }
  150.  
  151. if (opt.player.textture)
  152. {
  153. if (ROS > 0)
  154. {
  155. adrMin1 = ROS + (DWORD)flatflatbelat;
  156. Write1((void *)(adrMin1), (void*)(PBYTE)"\x90\x90\x90\x90\x90\x90\x90\x8B\xCE", 9);
  157. }
  158. }
  159. if (!opt.player.textture)
  160. {
  161. if (ROS > 0)
  162. {
  163. adrMin1 = ROS + (DWORD)flatflatbelat;
  164. Write1((void *)(adrMin1), (void*)(PBYTE)"\x0F\x11\x85\x58\xFE\xFF\xFF\x8B\xCE", 9);
  165. }
  166. }
  167.  
  168. /*if (opt.player.superjump > 0)
  169. memcpy((void*)(ROS + 0x547110), "\xF6\xC2\x06", 3);
  170. if (opt.player.superjump > 0)
  171. if (GetAsyncKeyState(VK_SPACE) & 1)
  172. {
  173.  
  174. *(float*)(*(DWORD*)(*(DWORD*)(*(DWORD*)(*(DWORD*)(*(DWORD*)(ROS + 0x219B39C) + 0x0) + 0x40) + 0x4) + 0x10) + 0x9c) = 105.0f;
  175. }
  176.  
  177. if (opt.player.paracute)
  178. {
  179. if (GetAsyncKeyState('F') & 1)
  180. {
  181.  
  182. *(float*)(*(DWORD*)(*(DWORD*)(*(DWORD*)(*(DWORD*)(*(DWORD*)(ROS + physics) + 0x0) + 0x40) + 0x4) + 0x10) + 0xAC) = -1000.0f;
  183. }
  184. }*/
  185.  
  186. if (opt.player.grass)
  187. {
  188. *(PFLOAT)(ROS + NoGrass) = -243773.5938;
  189. }
  190.  
  191. if (opt.player.wlkwtw)
  192. {
  193. *(PFLOAT)(ROS + addyWalkInsdWtr) = 2.031882773E-43;
  194. }
  195.  
  196. if (opt.weapon.zoom == 1)
  197. {
  198. *(PFLOAT)(ROS + zoomhack) = 0.00545329228;
  199. }
  200. if (opt.weapon.zoom == 2)
  201. {
  202. *(PFLOAT)(ROS + zoomhack) = 0.004f;
  203. }
  204.  
  205. if (opt.player.wlkthru)
  206. {
  207. *(PFLOAT)(ROS + addyGhostMode) = -0.89999998f;
  208. }
  209.  
  210. if (opt.player.nofog)
  211. {
  212. *(PFLOAT)(ROS + fog) = -1.775704964E-30;
  213. }
  214.  
  215. if (opt.player.speed == 1)
  216. {
  217. *(PFLOAT)(ROS + addySpeed) = 90.0f;
  218. }
  219. if (opt.player.speed == 2)
  220. {
  221. *(PFLOAT)(ROS + addySpeed) = 100.0f;
  222. }
  223. if (opt.player.speed == 3)
  224. {
  225. *(PFLOAT)(ROS + addySpeed) = 110.0f;
  226. }
  227. if (opt.player.speed == 4)
  228. {
  229. *(PFLOAT)(ROS + addySpeed) = 120.0f;
  230. }
  231. if (opt.player.speed == 5)
  232. {
  233. *(PFLOAT)(ROS + addySpeed) = 130.0f;
  234. }
  235. if (opt.player.speed == 6)
  236. {
  237. *(PFLOAT)(ROS + addySpeed) = 140.0f;
  238. }
  239. if (opt.player.speed == 7)
  240. {
  241. *(PFLOAT)(ROS + addySpeed) = 150.0f;
  242. }
  243.  
  244. if (opt.player.spectator)
  245. {
  246. *(BYTE*)(ROS + Spectate) = 2;
  247. }
  248.  
  249. //default values
  250. //grass default
  251. //foliage default
  252.  
  253.  
  254. if (!opt.player.spectator)
  255. {
  256. *(BYTE*)(ROS + Spectate) = 1;
  257. }
  258.  
  259. if (!opt.player.grass)
  260. {
  261. *(PFLOAT)(ROS + NoGrass) = -3.407189846;
  262. }
  263.  
  264. // remove water default
  265. if (!opt.player.wlkwtw)
  266. {
  267. *(PFLOAT)(ROS + addyWalkInsdWtr) = 2.017869789E-43;
  268. }
  269.  
  270. // speed hack default
  271. if (!opt.player.speed)
  272. {
  273. *(PFLOAT)(ROS + addySpeed) = 60.0f;
  274. }
  275.  
  276. //no fog default
  277. if (!opt.player.nofog)
  278. {
  279. *(PFLOAT)(ROS + fog) = -2.709510748E-35;
  280. }
  281.  
  282. //zoom hack default
  283. if (!opt.weapon.zoom)
  284. {
  285. *(PFLOAT)(ROS + zoomhack) = 0.0174532924;
  286. }
  287.  
  288. //wtw default
  289. if (!opt.player.wlkthru)
  290. {
  291. *(PFLOAT)(ROS + addyGhostMode) = -0.500f;
  292. }
  293. }
  294. return SetTexture_orig(pDevice, Sampler, pTexture);
  295. }
  296.  
  297. const char* getitemname(int a) {
  298. switch (a)
  299. {
  300. case 1: return "Lv 1 helmet";
  301. case 2: return "Lv 2 helmet";
  302. case 3: return "Lv 3 helmet";
  303. case 5: return "Lv 1 Armor";
  304. case 6: return "Lv 2 Armor";
  305. case 7: return "Lv 3 Armor";
  306. case 8: return "Lv 1 Backpack";
  307. case 9: return "Lv 2 Backpack";
  308. case 10: return "Lv 3 Backpack";
  309. case 19: return "Ghillie Suit";
  310. case 50: return "Fuel Barrel";
  311. case 101: return "Bandage";
  312. case 102: return "Med Kit";
  313. case 103: return "First Aid Kit";
  314. case 105: return "Sports Drink";
  315. case 106: return "Cardio Tonic";
  316. case 1001: return "M4A1 Rifle";
  317. case 1002: return "AKM Rifle";
  318. case 1003: return "M870 SG";
  319. case 1004: return "M1887 SG";
  320. case 1005: return "AA12 SG";
  321. case 1006: return "AWM SR";
  322. case 1007: return "Barett SR";
  323. case 1008: return "M249 MG";
  324. case 1009: return "M14EBR Rifle";
  325. case 1010: return "AR15 Rifle";
  326. case 1011: return "MP7 SMG";
  327. case 1012: return "PP19 SMG";
  328. case 1013: return "Thompson SMG";
  329. case 1014: return "G18C Pistol";
  330. case 1015: return "Desert Eagle";
  331. case 1017: return "Vector";
  332. case 1018: return "P90 SMG";
  333. case 1019: return "SAIGA-12 Shotgun";
  334. case 1020: return "WRO Hunting Rifle";
  335. case 1021: return "SVD SR";
  336. case 1022: return "M110 Sniper Rifle";
  337. case 1023: return "ACR Rifle";
  338. case 1024: return "AN94 Rifle";
  339. case 1025: return "MP5 SMG";
  340. case 1026: return "AUG Rifle";
  341. case 1027: return "QBU Sniper Rifle";
  342. case 1031: return "RPG Rocket Tube";
  343. case 1101: return "SG Ammo";
  344. case 1102: return "Rifle Ammo";
  345. case 1103: return "SR Ammo";
  346. case 1104: return "SMG Ammo";
  347. case 1105: return "Pistol Ammo";
  348. case 1106: return "RPG Ammo";
  349. case 1201: return "Rifle Silencer";
  350. case 1202: return "SR Silence";
  351. case 1204: return "SMG Silencer";
  352. case 1211: return "Rifle Compensator";
  353. case 1212: return "SR Compensator";
  354. case 1213: return "SMG Compensator";
  355. case 1221: return "Rifle Flash Hider";
  356. case 1222: return "SR Flash Hider";
  357. case 1223: return "SMG Smoke Hider";
  358. case 1231: return "SG Choke";
  359. case 1241: return "Triangle Grip";
  360. case 1242: return "Vertical Foregrip";
  361. case 1251: return "Rifle QD-Mag";
  362. case 1252: return "Rifle EX-Mag";
  363. case 1253: return "Rifle EX-QD-Mag";
  364. case 1261: return "SR Cheek Pad";
  365. case 1262: return "Tactical Stock";
  366. case 1263: return "SG Bullet Loop";
  367. case 1264: return "SR EX-Mag";
  368. case 1265: return "SR QD-Mag";
  369. case 1266: return "SR EX-QD-Mag";
  370. case 1271: return "Red Dot Sight";
  371. case 1272: return "Holo-Sight";
  372. case 1273: return "2x Scope";
  373. case 1274: return "4x Scope";
  374. case 1275: return "8x Scope";
  375. case 1276: return "SMG QD-Mag";
  376. case 1277: return "SMG EX-Mag";
  377. case 1278: return "SMG QD-EX-Mag";
  378. case 1279: return "Collapsible Stock";
  379. case 1303: return "Crowbar";
  380. case 1306: return "Frying Pan";
  381. case 1307: return "Rubber Chicken";
  382. case 1401: return "Grenade";
  383. case 1402: return "Stun Grenade";
  384. case 1403: return "Smoke Grenade";
  385. case 1404: return "Molotov Cocktail";
  386. case 1405: return "Chicken Grenade";
  387. case 1406: return "Flash Grenade";
  388.  
  389. default:return "no name";
  390. break;
  391. }
  392. }
  393.  
  394. cMenu Menu;
  395. copt opt;
  396. float ScreenCenterX = 0.0f;
  397. float ScreenCenterY = 0.0f;
  398.  
  399. D3DXVECTOR3 GetMidPoint(Vector3 V1, Vector3 V2)
  400. {
  401. return D3DXVECTOR3((V1.x + V2.x) / 2, (V1.y + V2.y) / 2, (V1.z + V2.z) / 2);
  402. }
  403.  
  404. DWORD WINAPI esper(IDirect3DDevice9* pDevice);
  405. DWORD WINAPI esper(IDirect3DDevice9* pDevice)
  406. {
  407. auto ros_base = reinterpret_cast<uintptr_t>(GetModuleHandle(NULL));
  408. auto Ros_Client = *(ClientApper**)(ros_base + OFFSET_CLIENT);
  409. auto mListItem = Ros_Client->m_pFirst->m_pStart;
  410. bool first = true;
  411. for (;;)
  412. {
  413. if (!first) mListItem = mListItem->m_pNext;
  414. first = false;
  415. if (mListItem == Ros_Client->m_pFirst->m_pEnd)
  416. break;
  417. auto entity_addy = (DWORD)(mListItem->m_pEntity ^ mListItem->m_EntityKey->Val);
  418. auto curEntity = (CEntity*)entity_addy;
  419.  
  420. DWORD MyEntity = *(DWORD*)(ros_base + OFFSET_LOCAL);
  421. D3DXVECTOR3 MyPosition;
  422. if ((DWORD)curEntity == MyEntity) {
  423. MyPosition = GetDecryptedPos(curEntity);
  424. }
  425. pDevice->GetViewport(&Viewport);
  426. int width = (int)Viewport.Width;
  427. int height = (int)Viewport.Height;
  428.  
  429. int m_pWorld = Memory::ReadMemory<int>(BAddress + OFFSET_PYGAME + 0x410);
  430.  
  431. int m_pSceneContext = Memory::ReadMemory<int>(m_pWorld + 0x8);
  432. int cameraBase = Memory::ReadMemory<int>(m_pSceneContext + 0x4);
  433.  
  434. if (!Memory::ReadMemoryC<D3DXMATRIX>(cameraBase + 0xC4) && ingame == true)
  435. {
  436. ingame = false;
  437. }
  438.  
  439. string pMeta_str(curEntity->m_pMeta->pName);
  440.  
  441. bool isPlayer = (std::string::npos != pMeta_str.find("Avatar"));
  442. bool isBot = (std::string::npos != pMeta_str.find("Robot"));
  443. bool isItem = (std::string::npos != pMeta_str.find("DtsProp"));
  444. bool isSupplyBox = (std::string::npos != pMeta_str.find("DtsPlayerHeritage"));
  445. bool isDead = (std::string::npos != pMeta_str.find("Heritage"));
  446. bool isAnoto = (std::string::npos != pMeta_str.find("No Name"));
  447. bool isPlane = (std::string::npos != pMeta_str.find("Plane"));
  448. bool isWeapon = (std::string::npos != pMeta_str.find("ClientWeaponEntity"));
  449. bool isCar = (std::string::npos != pMeta_str.find("LandCar"));
  450. bool isBicycle = (std::string::npos != pMeta_str.find("LandBike"));
  451. bool isExpress = (std::string::npos != pMeta_str.find("LandExpress"));
  452. bool isMotor = (std::string::npos != pMeta_str.find("LandMotor"));
  453. bool isGlider = (std::string::npos != pMeta_str.find("LandGlider"));
  454. bool isBoat = (std::string::npos != pMeta_str.find("LandBoat"));
  455. bool isBattleGround = (std::string::npos != pMeta_str.find("BattleGroundSpace"));
  456.  
  457.  
  458. D3DXMATRIX worldMatrix = Memory::ReadMemory<D3DXMATRIX>(cameraBase + 0xC4);
  459. D3DXVECTOR3 EntityPosition = GetDecryptedPos(curEntity);
  460. D3DXVECTOR3 vPlayerFoot(EntityPosition.x, EntityPosition.y, EntityPosition.z), vScreenFoot;
  461. D3DXVECTOR3 vPlayerHead(EntityPosition.x, EntityPosition.y, EntityPosition.z), vScreenHead;
  462. CPlayerBase* pBase = GetLocalPlayer();
  463. D3DXVECTOR3 mypos = pBase->GetDecryptedLocalPos(pBase);
  464. D3DXVECTOR3 pos = GetDecryptedEnemyPos(curEntity);
  465. D3DXVECTOR3 pRoot;
  466. D3DXVECTOR3 eHead;
  467. D3DXVECTOR3 pHead;
  468. int pDistance = Distance(mypos, pos, 10);
  469. int propID = curEntity->m_Table->pTable->Prop->mVal;
  470. std::string propItem = getitemname(propID);
  471. char* LootItems = const_cast<char*>(propItem.c_str());
  472. int pHealth = curEntity->m_Table->pTable->m_HpRow->HP;
  473.  
  474. int ScreenCenterX = Viewport.Width / 2;
  475. int ScreenCenterY = Viewport.Height;
  476.  
  477. float entityHeight = 21.5f;
  478. eHead.x = pos.x;
  479. eHead.y = pos.y + entityHeight;
  480. eHead.z = pos.z;
  481. ClientApp::WorldToScreen(pos, pRoot, worldMatrix, width, height);
  482. ClientApp::WorldToScreen(eHead, pHead, worldMatrix, width, height);
  483. struct Rectangle
  484. {
  485. int width;
  486. int height;
  487. int X;
  488. int Y;
  489. };
  490. Rectangle rect;
  491. rect.width = (int)(700 / pDistance);
  492. if (rect.width > 100)
  493. {
  494. rect.width = 100;
  495. }
  496. rect.height = (int)(pRoot.y - pHead.y);
  497. rect.X = (int)pRoot.x - rect.width / 2;
  498. rect.Y = (int)pRoot.y - rect.height;
  499. if (pDistance > 25)
  500. {
  501. rect.Y = (int)pRoot.y - rect.height + 15;
  502. }
  503.  
  504. if (ClientApp::WorldToScreen(vPlayerFoot, vScreenFoot, worldMatrix, width, height) && ClientApp::WorldToScreen(vPlayerHead, vScreenHead, worldMatrix, width, height))
  505. {
  506. if (opt.espopt.vehicle)
  507. {
  508. if (isCar) {
  509. DrawESPText(vScreenFoot.x, vScreenFoot.y + 8, Menu.YELLOW, DT_CENTER, "Car");
  510. char Distance[255];
  511. sprintf(Distance, "[ %dm ]", pDistance);
  512. DrawESPText(vScreenFoot.x, vScreenFoot.y + 20, PINK(255), DT_CENTER, Distance);
  513. }
  514. if (isBicycle) {
  515. DrawESPText(vScreenFoot.x, vScreenFoot.y + 8, Menu.YELLOW, DT_CENTER, "Bicycle");
  516. char Distance[255];
  517. sprintf(Distance, "[ %dm ]", pDistance);
  518. DrawESPText(vScreenFoot.x, vScreenFoot.y + 20, PINK(255), DT_CENTER, Distance);
  519. }
  520. if (isExpress) {
  521. DrawESPText(vScreenFoot.x, vScreenFoot.y + 8, Menu.YELLOW, DT_CENTER, "Cab Express");
  522. char Distance[255];
  523. sprintf(Distance, "[ %dm ]", pDistance);
  524. DrawESPText(vScreenFoot.x, vScreenFoot.y + 20, PINK(255), DT_CENTER, Distance);
  525. }
  526. if (isMotor) {
  527. DrawESPText(vScreenFoot.x, vScreenFoot.y + 8, Menu.YELLOW, DT_CENTER, "Motorcycle");
  528. char Distance[255];
  529. sprintf(Distance, "[ %dm ]", pDistance);
  530. DrawESPText(vScreenFoot.x, vScreenFoot.y + 20, PINK(255), DT_CENTER, Distance);
  531. }
  532. if (isGlider) {
  533. DrawESPText(vScreenFoot.x, vScreenFoot.y + 8, Menu.YELLOW, DT_CENTER, "Glider");
  534. char Distance[255];
  535. sprintf(Distance, "[ %dm ]", pDistance);
  536. DrawESPText(vScreenFoot.x, vScreenFoot.y + 20, PINK(255), DT_CENTER, Distance);
  537. }
  538. if (isPlane) {
  539. DrawESPText(vScreenFoot.x, vScreenFoot.y + 8, Menu.YELLOW, DT_CENTER, "Plane");
  540. char Distance[255];
  541. sprintf(Distance, "[ %dm ]", pDistance);
  542. DrawESPText(vScreenFoot.x, vScreenFoot.y + 20, PINK(255), DT_CENTER, Distance);
  543. }
  544. if (isBoat) {
  545. DrawESPText(vScreenFoot.x, vScreenFoot.y + 8, Menu.YELLOW, DT_CENTER, "Motor Boat");
  546. char Distance[255];
  547. sprintf(Distance, "[ %dm ]", pDistance);
  548. DrawESPText(vScreenFoot.x, vScreenFoot.y + 20, PINK(255), DT_CENTER, Distance);
  549. }
  550. if (isBattleGround) {
  551. DrawESPText(vScreenFoot.x, vScreenFoot.y + 8, Menu.YELLOW, DT_CENTER, "BattleGround");
  552. char Distance[255];
  553. sprintf(Distance, "[ %dm ]", pDistance);
  554. DrawESPText(vScreenFoot.x, vScreenFoot.y + 20, PINK(255), DT_CENTER, Distance);
  555. }
  556. }
  557.  
  558. if (opt.espopt.item)
  559. {
  560. if (isItem)
  561. {
  562. DrawESPText(vScreenFoot.x, vScreenFoot.y + 8, Menu.WHITE, DT_CENTER, LootItems);
  563. }
  564. }
  565.  
  566. if (opt.espopt.rare)
  567. {
  568. if (isItem)
  569. {
  570. if (strcmp(LootItems, "Lv 3 helmet") == 0 || strcmp(LootItems, "Lv 3 Armor") == 0 || strcmp(LootItems, "Lv 3 Backpack") == 0 || strcmp(LootItems, "Rifle Ammo") == 0 || strcmp(LootItems, "Med Kit") == 0 || strcmp(LootItems, "First Aid Kit") == 0 || strcmp(LootItems, "M4A1 Rifle") == 0 || strcmp(LootItems, "AKM Rifle") == 0 || strcmp(LootItems, "M14EBR Rifle") == 0 || strcmp(LootItems, "Rifle EX-QD-Mag") == 0 || strcmp(LootItems, "4x Scope") == 0 || strcmp(LootItems, "8x Scope") == 0 || strcmp(LootItems, "Rifle Silencer") == 0 || strcmp(LootItems, "SMG Silencer") == 0 || strcmp(LootItems, "SR Silence") == 0)
  571. {
  572. char Distance[100];
  573. sprintf(Distance, "[ %dm ]", pDistance);
  574. Menu.DrawLine(pDevice, ScreenCenterX, ScreenCenterY, vScreenFoot.x, vScreenFoot.y, Menu.BLUE);
  575. DrawESPText(vScreenFoot.x, vScreenFoot.y + 20, Menu.BLUE, DT_CENTER, Distance);
  576. DrawESPText(vScreenFoot.x, vScreenFoot.y + 8, Menu.BLUE, DT_CENTER, LootItems);
  577. }
  578. }
  579. }
  580.  
  581. if (opt.espopt.supplybox)
  582. {
  583. if (isSupplyBox)
  584. {
  585. DrawESPText(vScreenFoot.x, vScreenFoot.y + 8, Menu.PURPLE, DT_CENTER, "Loots");
  586. char Distance[100];
  587. sprintf(Distance, "[ %dm ]", pDistance);
  588. DrawESPText(vScreenFoot.x, vScreenFoot.y + 20, Menu.PURPLE, DT_CENTER, Distance);
  589. }
  590. }
  591.  
  592. if (opt.espopt.health)
  593. {
  594.  
  595. if (isPlayer && opt.espopt.health == 1)
  596. {
  597. Tools.Rainbowbar(pDevice, vScreenHead.x - 50, vScreenFoot.y + 25, curEntity->m_Table->pTable->m_HpRow->HP);
  598. }
  599.  
  600. if (isBot && opt.espopt.health == 1)
  601. {
  602. HealthBar(vScreenHead.x, vScreenFoot.y, curEntity->m_Table->pTable->m_HpBotRow->HP, pDevice);
  603. }
  604. }
  605.  
  606. if (opt.espopt.box2)
  607. {
  608. if ((isPlayer != 0))
  609. {
  610. Box2D(pHead, pRoot, RED(255), pDevice);
  611. }
  612. }
  613.  
  614. if (opt.espopt.box3)
  615. {
  616. if ((isPlayer != 0))
  617. {
  618.  
  619. if (opt.espopt.box3)
  620. {
  621. float dist2 = GetDistancez(mypos, pos, 10);
  622. Menu.Box3D(pDevice, pHead.x, pHead.y, vScreenHead.x, vScreenHead.y, dist2, Menu.RED);
  623. }
  624. }
  625. }
  626.  
  627. if (opt.espopt.dist)
  628. {
  629. if ((isPlayer != 0))
  630. {
  631. char Distance[100];
  632. sprintf(Distance, "[ %dm ]", pDistance);
  633. DrawESPText(vScreenHead.x, vScreenHead.y + 34, Menu.RED, DT_CENTER, Distance);
  634. }
  635.  
  636. if (isBot)
  637. {
  638. char Distance[100];
  639. sprintf(Distance, "[ %dm ]", pDistance);
  640. WriteText(pDevice, vScreenHead.x - 1, vScreenHead.y + 13, Menu.GREEN, Distance);
  641. }
  642. }
  643.  
  644. if (opt.espopt.name)
  645. {
  646. if (isPlayer && pHealth != 0)
  647. {
  648. char buff[20];
  649. Menu.DrawLine(pDevice, ScreenCenterX, ScreenCenterY, vScreenFoot.x, vScreenFoot.y, Menu.ORANGE);
  650. sprintf_s(buff, "%s", curEntity->m_Table->pTable->m_NickRow->m_NickName);
  651. DrawESPText(vScreenHead.x, vScreenHead.y + 10, Menu.ORANGE, DT_CENTER, buff);
  652. }
  653.  
  654. if (isBot)
  655. {
  656. Menu.DrawLine(pDevice, ScreenCenterX, ScreenCenterY, vScreenFoot.x, vScreenFoot.y, Menu.GREEN);
  657. WriteText(pDevice, vScreenHead.x + 15, vScreenHead.y + 3, Menu.GREEN, "BOT");
  658. }
  659. }
  660. }
  661. }
  662. }
  663. void PostReset(LPDIRECT3DDEVICE9 pDevice)
  664. {
  665. Menu.PostReset(pDevice);
  666. Menu.PreReset();
  667. return;
  668. }
  669.  
  670. void cMenu::ShowMenu(LPDIRECT3DDEVICE9 pDevice)
  671. {
  672.  
  673. int lm = GetAsyncKeyState(VK_LBUTTON) & 1;
  674. int rm = GetAsyncKeyState(VK_RBUTTON) & 1;
  675. int left = GetAsyncKeyState(VK_LEFT) & 1;
  676. int right = GetAsyncKeyState(VK_RIGHT) & 1;
  677. int up = GetAsyncKeyState(VK_UP) & 1;
  678. int down = GetAsyncKeyState(VK_DOWN) & 1;
  679.  
  680. Init();
  681. PostReset(pDevice);
  682.  
  683. if (GetAsyncKeyState(VK_INSERT) & 1)
  684. {
  685. SHOW = (!SHOW);
  686. SaveCfg();
  687. }
  688.  
  689. if (SHOW) {
  690.  
  691. GetCursorPos(&mpos);
  692. ScreenToClient(GetForegroundWindow(), &mpos);
  693.  
  694. if (opt.options.move && GetAsyncKeyState(VK_LCONTROL))
  695. {
  696. X = (((X <= mpos.x + 4) && (X >= mpos.x)) || ((X >= mpos.x - 4) && (X <= mpos.x))) ? (X = mpos.x) : (X += ((mpos.x - X) / 4));
  697. Y = (((Y <= mpos.y + 4) && (Y >= mpos.y)) || ((Y >= mpos.y - 4) && (Y <= mpos.y))) ? (Y = mpos.y) : (Y += ((mpos.y - Y) / 4));
  698. }
  699.  
  700. DrawBox(X, Y + 3, WIDTH, T_SPC, D3DCOLOR_ARGB(220, 50, 50, 50), 1, pDevice);
  701. DrawBorder(X, Y + 3, WIDTH, T_SPC, 1, D3DCOLOR_ARGB(220, 50, 50, 50), pDevice);
  702. DrawGameTextPixelFlag(MC_FCTR(X, MC_MAXX), Y + 5, D3DCOLOR_ARGB(255, 255, 255, 255), DT_CENTER | DT_SHADOW, "HAxCodER™");
  703.  
  704. DrawBox(X, MC_MSY, WIDTH, (NO*I_SPC), D3DCOLOR_ARGB(220, 50, 50, 50), 1, pDevice);
  705. DrawBorder(X, MC_MSY, WIDTH, (NO*I_SPC), 1, D3DCOLOR_ARGB(220, 5, 5, 5), pDevice);
  706.  
  707.  
  708. NO = 0;
  709. acat((char *)"MAIN", (char *)"Show|Hide", &opt.d3d.main);
  710. aitem((char *)" Cross Hair", (char *)"[OFF]|[Rainbow]|[Crosshair]|[Circle]", &opt.d3d.cross, opt.d3d.main, 1);
  711. aitem((char *)" Wall Hack", (char *)"[OFF]|[ON]", &opt.d3d.wallhacks, opt.d3d.main, 1);
  712. aitem((char *)" Player Chams", (char *)"[OFF]|[NUMPAD1/+]|[NUMPAD2/-]", &opt.d3d.Chams, opt.d3d.main, 1);
  713. aitem((char *)" Asus", (char *)"[OFF]|[ON]", &opt.d3d.asus, opt.d3d.main, 1);
  714. aitem((char *)" Wire Frame", (char *)"[OFF]|[ON]", &opt.d3d.frame, opt.d3d.main, 1);
  715.  
  716. acat((char *)"ESP", (char *)"Show|Hide", &opt.espopt.main);
  717. aitem((char *)" Distance", (char *)"[OFF]|[ON]", &opt.espopt.dist, opt.espopt.main, 1);
  718. aitem((char *)" Health Bar", (char *)"[OFF]|[ON]", &opt.espopt.health, opt.espopt.main, 1);
  719. aitem((char *)" 2D Box", (char *)"[OFF]|[ON]", &opt.espopt.box2, opt.espopt.main, 1);
  720. aitem((char *)" 3D Box", (char *)"[OFF]|[ON]", &opt.espopt.box3, opt.espopt.main, 1);
  721. aitem((char *)" Player Name", (char *)"[OFF]|[ON]", &opt.espopt.name, opt.espopt.main, 1);
  722. aitem((char *)" Vehicle Name", (char *)"[OFF]|[ON]", &opt.espopt.vehicle, opt.espopt.main, 1);
  723. aitem((char *)" Heritage & Air Drop", (char *)"[OFF]|[ON]", &opt.espopt.supplybox, opt.espopt.main, 1);
  724. aitem((char *)" Items Name", (char *)"[OFF]|[ON]", &opt.espopt.item, opt.espopt.main, 1);
  725. aitem((char *)" Rare Items", (char *)"[OFF]|[ON]", &opt.espopt.rare, opt.espopt.main, 1);
  726. //aitem((char *)" Skeleton", (char *)"[OFF]|[ON]", &opt.espopt.bones, opt.espopt.main, 1);
  727. aitem((char *)" DeadPlayer Items", (char *)"[OFF]|[ON]", &opt.espopt.dead, opt.espopt.main, 1);
  728.  
  729. acat((char *)"AIMBOT", (char *)"Show|Hide", &opt.aimbooott.main);
  730. aitem((char *)" Aimbot", (char *)"[OFF]|[ON]", &opt.aimbooott.aimbot, opt.aimbooott.main, 1);
  731. aitem((char *)" AimFOV", (char *)"[OFF]|[5%]|[10%]|[Recommended]|[20%]|[25%]|[25%]|[30%]|[35%]|[40%]|[45%]", &opt.aimbooott.aimfov, opt.aimbooott.main, 1);
  732. aitem((char *)" AimKeys", (char *)"[OFF]|[Shift]|[RMouse]|[LMouse]|[Ctrl]|[Alt]|[Space]|[X]|[C]", &opt.aimbooott.aimkey, opt.aimbooott.main, 1);
  733. aitem((char *)" AimSens", (char *)"[OFF]|[1]|[2]|[3]|[4]|[5]|[6]|[7]|[8]|[9]|[10]|[11]|[12]|[13]|[14]|[15]|[16]|[17]|[18]|[19]|[20]", &opt.aimbooott.aimsens, opt.aimbooott.main, 1);
  734. aitem((char *)" AimHeight", (char *)"[OFF]|[0]|[1]|[2]|[3]|[4]|[5]|[6]|[7]|[8]|[9]|[10]", &opt.aimbooott.aimheight, opt.aimbooott.main, 1);
  735. aitem((char *)" TriggerBot", (char *)"[OFF]|[ON]", &opt.aimbooott.autoshoot, opt.aimbooott.main, 1);
  736.  
  737. acat((char *)"WEAPON", (char *)"Show|Hide", &opt.weapon.main);
  738. aitem((char *)" NoSpread", (char *)"[OFF]|[ON]", &opt.weapon.NoSpread, opt.weapon.main, 1);
  739. //aitem((char *)" FastShoot /fix", (char *)"[OFF]|[ON]", &opt.weapon.FastShoot, opt.weapon.main, 1);
  740. aitem((char *)" Zoom", (char *)"[OFF]|[4x]|[x6]", &opt.weapon.zoom, opt.weapon.main, 1);
  741.  
  742. acat((char *)"PLAYER", (char *)"Show|Hide", &opt.player.main);
  743. aitem((char *)" Spectator", (char *)"[OFF]|[ON]", &opt.player.spectator, opt.player.main, 1);
  744. aitem((char *)" Remove Grass", (char *)"[OFF]|[ON]", &opt.player.grass, opt.player.main, 1);
  745. aitem((char *)" Speed Hack", (char *)"[OFF]|[90]|[100]|[110]|[120]|[130]|[140]|[150]", &opt.player.speed, opt.player.main, 1);
  746. aitem((char *)" Walk Through Wall", (char *)"[OFF]|[ON]", &opt.player.wlkthru, opt.player.main, 1);
  747. aitem((char *)" Walk Under Water", (char *)"[OFF]|[ON]", &opt.player.wlkwtw, opt.player.main, 1);
  748. aitem((char *)" Grave Mode", (char *)"[OFF]|[ON]", &opt.player.prone, opt.player.main, 1);
  749. aitem((char *)" Flat Texture", (char *)"[OFF]|[ON]", &opt.player.textture, opt.player.main, 1);
  750. aitem((char *)" Sky Walk", (char *)"[OFF]|[ON]", &opt.player.superman, opt.player.main, 1);
  751. aitem((char *)" No Ground", (char *)"[OFF]|[ON]", &opt.player.noground, opt.player.main, 1);
  752. aitem((char *)" Auto Climb", (char *)"[OFF]|[H]", &opt.player.climb, opt.player.main, 1);
  753. aitem((char *)" Remove Fog", (char *)"[OFF]|[ON]", &opt.player.nofog, opt.player.main, 1);
  754. aitem((char *)" No Fall Damage", (char *)"[OFF]|[ON]", &opt.player.nofall, opt.player.main, 1);
  755. //outdated aitem((char *)" Walk Jump", (char *)"[OFF]|[ON]", &opt.player.walkjump, opt.player.main, 1);
  756. aitem((char *)" High Jump", (char *)"[OFF]|[ON]", &opt.player.superjump, opt.player.main, 1);
  757. aitem((char *)" Fast Drop", (char *)"[OFF]|[F]", &opt.player.paracute, opt.player.main, 1);
  758.  
  759. acat("OPTIONS", "Show|Hide", &opt.options.main);
  760. aitem(" Move Menu", "[OFF]|[L-Ctrl]", &opt.options.move, opt.options.main, 1);
  761. aitem(" Save Set", "[OFF]|[Saving]", &opt.options.save, opt.options.main, 1);
  762. aitem(" Load Set", "[OFF]|[Loading]", &opt.options.load, opt.options.main, 1);
  763. aitem(" Reset Menu", "[OFF]|[Resetting]", &opt.options.reset, opt.options.main, 1);
  764.  
  765. opt.options.save = 0;
  766. opt.options.load = 0;
  767.  
  768. DrawBox(X, MC_ITEMY1(NO) + (F_SPC / 2), WIDTH, (F_SPC), D3DCOLOR_ARGB(220, 50, 50, 50), 1, pDevice);
  769. DrawBorder(X, MC_ITEMY1(NO) + (F_SPC / 2), WIDTH, (F_SPC), 1, D3DCOLOR_ARGB(220, 50, 50, 50), pDevice);
  770. DrawGameTextPixelFlag(MC_FCTR(X, MC_MAXX), MC_ITEMY1(NO) + (F_SPC / 2) + 2, D3DCOLOR_ARGB(255, 255, 255, 255), DT_CENTER | DT_SHADOW, "Private");
  771.  
  772. for (int no = 0; no<NO; no++)
  773. {
  774. D3DCOLOR text;
  775. D3DCOLOR text2;
  776. D3DCOLOR text3;
  777.  
  778. text = (*(items[no].val)>0) ? C_ON : C_OFF;
  779. text2 = (*(items[no].val)>0) ? C_ON2 : C_OFF2;
  780. text3 = (*(items[no].val)>0) ? C_ON2 : C_OFF3;
  781.  
  782. if (items[no].type == T_CAT)
  783. text = C_CAT;
  784.  
  785. if (I_CUR == no) {
  786. DrawBox(X, MC_ITEMY(no), WIDTH, I_SPC, D3DCOLOR_ARGB(255, 255, 255, 0), 1, pDevice);
  787. }
  788.  
  789. if (mpos.x>X && mpos.x<MC_MAXX && mpos.y>MC_ITEMY(no) && mpos.y<MC_ITEMY(no) + I_SPC) {
  790. DrawBox(X, MC_ITEMY(no), WIDTH, I_SPC, D3DCOLOR_ARGB(255, 255, 255, 0), 1, pDevice);
  791. }
  792.  
  793. if (items[no].type != T_CAT) {
  794. DrawBox(X + 10, MC_ITEMY(no) + 5, 5, 5, text3, 1, pDevice);
  795. DrawBorder(X + 10, MC_ITEMY(no) + 5, 5, 5, 1, C_BORDER, pDevice);
  796. }
  797.  
  798. if (items[no].type == T_CAT) {
  799. text2 = C_CAT;
  800. DrawGameTextPixelFlag(X + I_OFS, MC_ITEMY(no) + 2, text, DT_SHADOW, items[no].title);
  801. }
  802. else {
  803. DrawGameTextPixelFlag(X + I_OFS + 11, MC_ITEMY(no) + 2, text, DT_SHADOW, items[no].title);
  804. }
  805. DrawGameTextPixelFlag(X + S_OFS, MC_ITEMY(no) + 2, text2, DT_RIGHT | DT_SHADOW, items[no].state);
  806. }
  807.  
  808. int mno = 999;
  809.  
  810. if (mpos.x>X && mpos.x<MC_MAXX && mpos.y<MC_ITEMY(NO) && mpos.y>Y)
  811. mno = ((mpos.y - T_SPC)>Y) ? ((mpos.y - Y - T_SPC - (T_SPC / 2)) / I_SPC) : (999);
  812.  
  813. if (mno != 999 && rm && (*items[mno].val)>0)
  814. {
  815. (*items[mno].val) -= 1;
  816. Sound.wav.playsoundmem((LPCSTR)SWITCH);
  817. }
  818.  
  819. if (mno != 999 && lm && (*items[mno].val)<(items[mno].max - 1))
  820. {
  821. (*items[mno].val) += 1;
  822. Sound.wav.playsoundmem((LPCSTR)SWITCH);
  823. }
  824.  
  825.  
  826. if (left && (*items[I_CUR].val)>0)
  827. {
  828. (*items[I_CUR].val) -= 1;
  829. Sound.wav.playsoundmem((LPCSTR)SWITCH);
  830. }
  831.  
  832. if (right && (*items[I_CUR].val)<(items[I_CUR].max - 1))
  833. {
  834. (*items[I_CUR].val) += 1;
  835. Sound.wav.playsoundmem((LPCSTR)SWITCH);
  836. }
  837.  
  838. if (up) {
  839. do {
  840. I_CUR = (I_CUR == 0) ? (NO - 1) : (I_CUR - 1);
  841. } while (items[I_CUR].type == T_TEXT);
  842. Sound.wav.playsoundmem((LPCSTR)MOVE);
  843. }
  844.  
  845. if(down || items[I_CUR].type == T_TEXT) {
  846.  
  847. do {
  848. I_CUR = (I_CUR + 1) % NO;
  849. } while (items[I_CUR].type == T_TEXT);
  850. Sound.wav.playsoundmem((LPCSTR)MOVE);
  851. }
  852.  
  853. if (I_CUR>NO)I_CUR = NO - 1;
  854.  
  855. }
  856. }
  857.  
  858.  
  859. HRESULT APIENTRY Present_hook(IDirect3DDevice9* pDevice, const RECT *pSourceRect, const RECT *pDestRect, HWND hDestWindowOverride, const RGNDATA *pDirtyRegion)
  860. {
  861.  
  862. pDevice->GetViewport(&Viewport);
  863. ScreenCX = (float)Viewport.Width / 2.0f;
  864. ScreenCY = (float)Viewport.Height / 2.0f;
  865.  
  866. if (Font == NULL)
  867. D3DXCreateFont(pDevice, 16, 0, FW_BLACK, 0, FALSE, DEFAULT_CHARSET, OUT_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH | FF_DONTCARE, TEXT("Courier New"), &Font);
  868.  
  869. if (xdxd)
  870. {
  871. id = GetCurrentProcessId();
  872. processHandle = OpenProcess(PROCESS_ALL_ACCESS, FALSE, id);
  873. BAddress = (DWORD)GetModuleHandle(NULL);
  874.  
  875. xdxd = false;
  876. }
  877.  
  878. if (!Tools.Init)
  879. {
  880. D3DXCreateLine(pDevice, &Tools.pLine);
  881. Tools.Init = TRUE;
  882. }
  883.  
  884. Menu.ShowMenu(pDevice);
  885. DWORD MODULEROS;
  886. MODULEROS = (DWORD)GetModuleHandleA("ros.exe");
  887. DWORD InGameAdrress = (MODULEROS + 0x1E21F28);
  888. DWORD* Verify = (DWORD*)(InGameAdrress);
  889. if (*Verify == 1)
  890. {
  891. esper(pDevice);
  892. }
  893.  
  894. if (screenshot_taken && Font)
  895. {
  896. DrawCenteredString(Font, (int)Viewport.Width / 2, (int)Viewport.Height / 2, D3DCOLOR_ARGB(255, 255, 255, 255), "Someone reported you. Screenshot blocked. (gmcomplaint.jpg)");
  897.  
  898. static DWORD lastTime = timeGetTime();
  899. DWORD timePassed = timeGetTime() - lastTime;
  900. if (timePassed > 2000)
  901. {
  902. screenshot_taken = false;
  903. LoadCfg();
  904. lastTime = timeGetTime();
  905. }
  906. }
  907.  
  908. if (opt.d3d.cross == 1)
  909. {
  910. Tools.FillRGB(ScreenCX - 20, ScreenCY, 40, 1, D3DCOLOR_ARGB(255, 125, 0, 255), pDevice);//Purple
  911. Tools.FillRGB(ScreenCX, ScreenCY - 20, 1, 40, D3DCOLOR_ARGB(255, 125, 0, 255), pDevice);
  912. Tools.FillRGB(ScreenCX - 17, ScreenCY, 34, 1, D3DCOLOR_ARGB(255, 0, 0, 255), pDevice);//Blue
  913. Tools.FillRGB(ScreenCX, ScreenCY - 17, 1, 34, D3DCOLOR_ARGB(255, 0, 0, 255), pDevice);
  914. Tools.FillRGB(ScreenCX - 14, ScreenCY, 28, 1, D3DCOLOR_ARGB(255, 000, 139, 200), pDevice);//Cyan
  915. Tools.FillRGB(ScreenCX, ScreenCY - 14, 1, 28, D3DCOLOR_ARGB(255, 000, 139, 200), pDevice);
  916. Tools.FillRGB(ScreenCX - 11, ScreenCY, 22, 1, D3DCOLOR_ARGB(255, 0, 255, 0), pDevice);//Green
  917. Tools.FillRGB(ScreenCX, ScreenCY - 11, 1, 22, D3DCOLOR_ARGB(255, 0, 255, 0), pDevice);
  918. Tools.FillRGB(ScreenCX - 9, ScreenCY, 18, 1, D3DCOLOR_ARGB(255, 255, 255, 0), pDevice);//Yellow
  919. Tools.FillRGB(ScreenCX, ScreenCY - 9, 1, 18, D3DCOLOR_ARGB(255, 255, 255, 0), pDevice);
  920. Tools.FillRGB(ScreenCX - 6, ScreenCY, 12, 1, D3DCOLOR_ARGB(255, 255, 132, 0), pDevice);//Orange
  921. Tools.FillRGB(ScreenCX, ScreenCY - 6, 1, 12, D3DCOLOR_ARGB(255, 255, 132, 0), pDevice);
  922. Tools.FillRGB(ScreenCX - 3, ScreenCY, 6, 1, D3DCOLOR_ARGB(255, 255, 0, 0), pDevice);//Red
  923. Tools.FillRGB(ScreenCX, ScreenCY - 3, 1, 6, D3DCOLOR_ARGB(255, 255, 0, 0), pDevice);
  924. }
  925.  
  926. if (opt.d3d.cross == 2)
  927. {
  928. Tools.DrawCircle(D3DXVECTOR2(ScreenCX - 1, ScreenCY) - 1, 8, 8, D3DCOLOR_ARGB(255, 255, 0, 0));//Red
  929. Tools.FillRGB(ScreenCX - 13, ScreenCY, 10, 1, D3DCOLOR_ARGB(255, 255, 0, 0), pDevice);//Red
  930. Tools.FillRGB(ScreenCX + 4, ScreenCY, 10, 1, D3DCOLOR_ARGB(255, 255, 0, 0), pDevice);//Red
  931. Tools.FillRGB(ScreenCX, ScreenCY - 13, 1, 10, D3DCOLOR_ARGB(255, 255, 0, 0), pDevice);//Red
  932. Tools.FillRGB(ScreenCX, ScreenCY + 4, 1, 10, D3DCOLOR_ARGB(255, 255, 0, 0), pDevice);//Red
  933. Tools.DrawPoint(ScreenCX, ScreenCY, 1, 1, D3DCOLOR_ARGB(255, 0, 255, 0), pDevice);//Green
  934. }
  935.  
  936. if (opt.d3d.cross == 3)
  937. {
  938. Tools.DrawCircle(D3DXVECTOR2(ScreenCX, ScreenCY), 8, 8, D3DCOLOR_ARGB(255, 255, 0, 0));//Red
  939. Tools.FillRGB(ScreenCX - 17, ScreenCY, 10, 1, D3DCOLOR_ARGB(255, 255, 0, 0), pDevice);//Red
  940. Tools.FillRGB(ScreenCX + 9, ScreenCY, 10, 1, D3DCOLOR_ARGB(255, 255, 0, 0), pDevice);//Red
  941. Tools.FillRGB(ScreenCX, ScreenCY - 17, 1, 10, D3DCOLOR_ARGB(255, 255, 0, 0), pDevice);//Red
  942. Tools.FillRGB(ScreenCX, ScreenCY + 9, 1, 10, D3DCOLOR_ARGB(255, 255, 0, 0), pDevice);//Red
  943. Tools.DrawPoint(ScreenCX, ScreenCY, 1, 1, D3DCOLOR_ARGB(255, 0, 255, 0), pDevice);//Green
  944. }
  945.  
  946.  
  947. //Shift|RMouse|LMouse|Ctrl|Alt|Space|X|C
  948. if (opt.aimbooott.aimkey == 0) opt.aimbooott.Daimkey = 0;
  949. if (opt.aimbooott.aimkey == 1) opt.aimbooott.Daimkey = VK_SHIFT;
  950. if (opt.aimbooott.aimkey == 2) opt.aimbooott.Daimkey = VK_RBUTTON;
  951. if (opt.aimbooott.aimkey == 3) opt.aimbooott.Daimkey = VK_LBUTTON;
  952. if (opt.aimbooott.aimkey == 4) opt.aimbooott.Daimkey = VK_CONTROL;
  953. if (opt.aimbooott.aimkey == 5) opt.aimbooott.Daimkey = VK_MENU;
  954. if (opt.aimbooott.aimkey == 6) opt.aimbooott.Daimkey = VK_SPACE;
  955. if (opt.aimbooott.aimkey == 7) opt.aimbooott.Daimkey = 0x58;
  956. if (opt.aimbooott.aimkey == 8) opt.aimbooott.Daimkey = 0x43;
  957.  
  958. if (opt.aimbooott.aimbot && WeaponEspInfo.size() != NULL)
  959. {
  960. UINT BestTarget = -1;
  961. DOUBLE fClosestPos = 99999;
  962.  
  963. for (unsigned int i = 0; i < WeaponEspInfo.size(); i++)
  964. {
  965. float radiusx = (opt.aimbooott.aimfov*5.0f) * (ScreenCX / 100.0f);
  966. float radiusy = (opt.aimbooott.aimfov*5.0f) * (ScreenCY / 100.0f);
  967.  
  968. if (opt.aimbooott.aimfov == 0)
  969. {
  970. radiusx = 5.0f * (ScreenCX / 100.0f);
  971. radiusy = 5.0f * (ScreenCY / 100.0f);
  972. }
  973.  
  974. WeaponEspInfo[i].CrosshairDistance = GetDistance1(WeaponEspInfo[i].pOutX, WeaponEspInfo[i].pOutY, ScreenCX, ScreenCY);
  975.  
  976. if (WeaponEspInfo[i].pOutX >= ScreenCX - radiusx && WeaponEspInfo[i].pOutX <= ScreenCX + radiusx && WeaponEspInfo[i].pOutY >= ScreenCY - radiusy && WeaponEspInfo[i].pOutY <= ScreenCY + radiusy)
  977.  
  978. if (WeaponEspInfo[i].CrosshairDistance < fClosestPos)
  979. {
  980. fClosestPos = WeaponEspInfo[i].CrosshairDistance;
  981. BestTarget = i;
  982. }
  983. }
  984.  
  985.  
  986. if (BestTarget != -1 && WeaponEspInfo[BestTarget].RealDistance > 4.0f)
  987. {
  988. double DistX = WeaponEspInfo[BestTarget].pOutX - ScreenCX;
  989. double DistY = WeaponEspInfo[BestTarget].pOutY - ScreenCY;
  990.  
  991. //DistX /= (0.5f + (float)opt.aimbooott.aimsens*0.5f);
  992. //DistY /= (0.5f + (float)opt.aimbooott.aimsens*0.5f);
  993.  
  994. DistX = (int)floorf((float(DistX) / 2.0f) + opt.aimbooott.aimsens*0.5f);
  995. DistY = (int)floorf((float(DistY) / 2.0f) + opt.aimbooott.aimsens*0.5f);
  996.  
  997. if (GetAsyncKeyState(opt.aimbooott.Daimkey) & 0x8000)
  998. mouse_event(MOUSEEVENTF_MOVE, DistX, DistY, NULL, NULL);
  999.  
  1000. if ((!GetAsyncKeyState(VK_LBUTTON) && (opt.aimbooott.autoshoot == 1) && (GetAsyncKeyState(opt.aimbooott.Daimkey) & 0x8000)))
  1001. {
  1002. if (opt.aimbooott.autoshoot == 1 && !IsPressed)
  1003. {
  1004. IsPressed = true;
  1005. mouse_event(MOUSEEVENTF_LEFTDOWN, DistX, DistY, NULL, NULL);
  1006. }
  1007. }
  1008. }
  1009. }
  1010.  
  1011. WeaponEspInfo.clear();
  1012.  
  1013. if (opt.aimbooott.autoshoot == 1 && IsPressed)
  1014. {
  1015. if (timeGetTime() - astime >= asdelay)
  1016. {
  1017. IsPressed = false;
  1018. mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);
  1019. astime = timeGetTime();
  1020. }
  1021. }
  1022.  
  1023. return Present_orig(pDevice, pSourceRect, pDestRect, hDestWindowOverride, pDirtyRegion);
  1024. }
  1025.  
  1026. HRESULT APIENTRY Reset_hook(IDirect3DDevice9* pDevice, D3DPRESENT_PARAMETERS *pPresentationParameters)
  1027. {
  1028. if (Font)
  1029. Font->OnLostDevice();
  1030.  
  1031. if (Tools.pLine)
  1032. Tools.pLine->OnLostDevice();
  1033. HRESULT ResetReturn = Reset_orig(pDevice, pPresentationParameters);
  1034.  
  1035. if (SUCCEEDED(ResetReturn))
  1036. {
  1037. if (Font)
  1038. Font->OnResetDevice();
  1039. if (Tools.pLine)
  1040. Tools.pLine->OnResetDevice();
  1041. }
  1042. return ResetReturn;
  1043. }
  1044.  
  1045.  
  1046. HANDLE(WINAPI *Real_CreateFile)(LPCWSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, LPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes, HANDLE hTemplateFile) = CreateFileW;
  1047. HANDLE WINAPI Routed_CreateFile(LPCWSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, LPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes, HANDLE hTemplateFile)
  1048. {
  1049. char buffer[500];
  1050. wcstombs(buffer, lpFileName, 500);
  1051. if (strcmp(buffer + strlen(buffer) - 4, ".jpg") == 0)
  1052. {
  1053. Log("buffer == %s", buffer);
  1054. }
  1055. if (strcmp(buffer + strlen(buffer) - 4, ".bmp") == 0)
  1056. {
  1057. Log("buffer == %s", buffer);
  1058. }
  1059.  
  1060. return Real_CreateFile(lpFileName, dwDesiredAccess, dwShareMode, lpSecurityAttributes, dwCreationDisposition, dwFlagsAndAttributes, hTemplateFile);
  1061. }
  1062.  
  1063.  
  1064. DWORD WINAPI RosD3D(__in LPVOID lpParameter)
  1065. {
  1066. HMODULE dDll = NULL;
  1067. while (!dDll)
  1068. {
  1069. dDll = GetModuleHandleA("d3d9.dll");
  1070. Sleep(100);
  1071. }
  1072. CloseHandle(dDll);
  1073.  
  1074. IDirect3D9* d3d = NULL;
  1075. IDirect3DDevice9* d3ddev = NULL;
  1076.  
  1077. HWND tmpWnd = CreateWindowA("BUTTON", "RosD3D", WS_SYSMENU | WS_MINIMIZEBOX, CW_USEDEFAULT, CW_USEDEFAULT, 300, 300, NULL, NULL, Hand, NULL);
  1078. if (tmpWnd == NULL)
  1079. {
  1080. return 0;
  1081. }
  1082.  
  1083. d3d = Direct3DCreate9(D3D_SDK_VERSION);
  1084. if (d3d == NULL)
  1085. {
  1086. DestroyWindow(tmpWnd);
  1087. return 0;
  1088. }
  1089.  
  1090. D3DPRESENT_PARAMETERS d3dpp;
  1091. ZeroMemory(&d3dpp, sizeof(d3dpp));
  1092. d3dpp.Windowed = TRUE;
  1093. d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD;
  1094. d3dpp.hDeviceWindow = tmpWnd;
  1095. d3dpp.BackBufferFormat = D3DFMT_UNKNOWN;
  1096.  
  1097. HRESULT result = d3d->CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, tmpWnd, D3DCREATE_SOFTWARE_VERTEXPROCESSING, &d3dpp, &d3ddev);
  1098. if (result != D3D_OK)
  1099. {
  1100. d3d->Release();
  1101. DestroyWindow(tmpWnd);
  1102. return 0;
  1103. }
  1104.  
  1105. #if defined _M_X64
  1106. DWORD64* dVtable = (DWORD64*)d3ddev;
  1107. dVtable = (DWORD64*)dVtable[0];
  1108. #elif defined _M_IX86
  1109. DWORD* dVtable = (DWORD*)d3ddev;
  1110. dVtable = (DWORD*)dVtable[0];
  1111. #endif
  1112.  
  1113. SetStreamSource_orig = (SetStreamSource_t)dVtable[100];
  1114. SetTexture_orig = (SetTexture_t)dVtable[65];
  1115. Reset_orig = (Reset_t)dVtable[16];
  1116. Present_orig = (Present)dVtable[17];
  1117.  
  1118. Present_orig = (Present)DetourFunction((PBYTE)Present_orig, (PBYTE)Present_hook);
  1119. SetStreamSource_orig = (SetStreamSource_t)DetourFunction((PBYTE)SetStreamSource_orig, (PBYTE)SetStreamSource_hook);
  1120. SetTexture_orig = (SetTexture_t)DetourFunction((PBYTE)SetTexture_orig, (PBYTE)SetTexture_hook);
  1121. Reset_orig = (Reset_t)DetourFunction((PBYTE)Reset_orig, (PBYTE)Reset_hook);
  1122.  
  1123. if (MH_CreateHook((DWORD_PTR*)dVtable[32], &hkGetRenderTargetData, reinterpret_cast<void**>(&oGetRenderTargetData)) != MH_OK) { return 1; }
  1124. if (MH_EnableHook((DWORD_PTR*)dVtable[32]) != MH_OK) { return 1; }
  1125. if (MH_CreateHook((DWORD_PTR*)dVtable[36], &hkCreateOffscreenPlainSurface, reinterpret_cast<void**>(&oCreateOffscreenPlainSurface)) != MH_OK) { return 1; }
  1126. if (MH_EnableHook((DWORD_PTR*)dVtable[36]) != MH_OK) { return 1; }
  1127.  
  1128. HMODULE modd = LoadLibrary(TEXT("Kernel32.dll"));
  1129. void* ptrr = GetProcAddress(modd, "CreateFileW");
  1130. MH_CreateHook(ptrr, Routed_CreateFile, reinterpret_cast<void**>(&Real_CreateFile));
  1131. MH_EnableHook(ptrr);
  1132.  
  1133. d3ddev->Release();
  1134. d3d->Release();
  1135. DestroyWindow(tmpWnd);
  1136.  
  1137. return 1;
  1138. }
  1139.  
  1140.  
  1141. BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved)
  1142. {
  1143. switch (ul_reason_for_call)
  1144. {
  1145. case DLL_PROCESS_ATTACH:
  1146. Hand = hModule;
  1147. DisableThreadLibraryCalls(hModule);
  1148. GetModuleFileNameA(hModule, dlldir, 512);
  1149. for (int i = (int)strlen(dlldir); i > 0; i--)
  1150. {
  1151. if (dlldir[i] == '\\')
  1152. {
  1153. dlldir[i + 1] = 0;
  1154. break;
  1155. }
  1156. }
  1157. CreateThread(0, 0, RosD3D, 0, 0, 0);
  1158. break;
  1159. case DLL_PROCESS_DETACH:
  1160. break;
  1161. case DLL_THREAD_ATTACH:
  1162. case DLL_THREAD_DETACH:
  1163. break;
  1164. }
  1165. return TRUE;
  1166. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement