Advertisement
Eqrrrrr

EqrRunsNoSkid

Nov 17th, 2019
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 30.46 KB | None | 0 0
  1. // ==UserScript==
  2. // @name Eqr Runs NO Skid Shit
  3. // @namespace https://github.com/EqrNigga
  4. // @version 1.8.9
  5. // @description EqrFuckedItUpV.1
  6. // @author EqrRunsNoSkidShit
  7. // @match *://krunker.io/*
  8. // @run-at document-start
  9. // @require https://ajax.googleapis.com/ajax/libs/webfont/1/webfont.js
  10. // @require https://krunkr.com/assets/js/canvas.gui.js?ver=0.6
  11. // @grant none
  12. // ==/UserScript==
  13. // Custom hub
  14. //Tells u if hack is working.
  15. alert("INJECTED I SMELL NIGGER")
  16. //Hub change
  17. document.title = "Eqr Kills Jews";
  18. document.getElementById("instructions").style.color = "Blue";
  19. document.getElementById('instructions').innerHTML = 'Game is Shitting';
  20. document.getElementById('modVote').innerHTML = 'Eqr Gases Black People';
  21. document.getElementById("modVote").style.color = "Yellow";
  22. document.getElementById("texts3DHolder").innerHTML = 'I Shot Bernie';
  23. // Adblock (Ads are sucks)
  24. document.getElementById("krunkerio_728x90_1").remove();
  25. // more shit
  26. document.getElementById("subLogoButtons").innerHTML = '<div class="button small buttonP" id="menuBtnHost" onmouseenter="playTick()" onclick="openHostWindow()">Host Game</div><div class="button small buttonR" id="menuBtnBrowser" onmouseenter="playTick()" onclick="showWindow(2)">Server Browser</div><div id="inviteButton" class="button small" onmouseenter="playTick()" onclick="copyInviteLink()">Invite</div><div class="button small" id="menuBtnJoin" onmouseenter="playTick()" onclick="showWindow(24)">Join</div><div class="button small buttonP" id="hackMenu" onmouseenter="playTick()" onclick="window.open(\'EatBootyNigga\', \'_blank\', \'location=yes,height=570,width=520,scrollbars=yes,status=yes\');">More Hacks Here</div></div>';
  27. document.getElementById("aContainer").innerHTML = 'Eqr Lmao';
  28. document.getElementById("aContainer").style.color = "Red";
  29. // Font size idk but made this shit rn wanted to chage to ajax.
  30. document.getElementById("aContainer").style.fontSize = "larger";
  31. // Custom sniper recticle until (I find a good one)
  32. // Aimdot "too op Goddamn!"
  33. var d = document.createElement('div');
  34. d.style.cssText = 'width:8px;height:8px;background-color:#00ff00;position:absolute;margin:auto;top:0;right:0;bottom:0;left:0;z-index:200;border-radius:4px';
  35. document.body.appendChild(d);
  36. // Chat messege
  37. document.getElementById('chatList').innerHTML = '<div class="chatItem" style="word-break:break-all;overflow-wrap:break-word;"><span class="chatMsg"><span style="color:#ffff00">Eqr Nigggaaaa</span><img style="opacity:2.0;margin-right:9px;" <span style="color:#00FFFF">V.3.4 EqrIsNotBlack</span><div class="chatItem" style="word-break:break-all;overflow-wrap:break-word;"><span class="chatMsg"><img style="opacity:0.7;margin-right:9px;"<span style="color: #ffff00">Eqr Fucking Shoots Black Lives Matter Protests Daily ;)//With number 1 you open menu)</span></span></span></div></div>';
  38. //Fps counter. Idk why this shet when you can put fps counter in settings but what ever. Eqr Fucking Hates Niggers
  39. javascript:(function(){var script=document.createElement('script');script.onload=function(){var stats=new Stats();document.body.appendChild(stats.dom);requestAnimationFrame(function loop(){stats.update();requestAnimationFrame(loop)});};script.src='//mrdoob.github.io/stats.js/build/stats.min.js';document.head.appendChild(script);})()
  40. //Full screen "most of ppl don't have time to full screen their shet but here made too ez. YEEET BOIII.
  41. document.fullscreenEnabled =
  42. document.fullscreenEnabled ||
  43. document.mozFullScreenEnabled ||
  44. document.documentElement.webkitRequestFullScreen;
  45.  
  46. function requestFullscreen(element) {
  47. if (element.requestFullscreen) {
  48. element.requestFullscreen();
  49. } else if (element.mozRequestFullScreen) {
  50. element.mozRequestFullScreen();
  51. } else if (element.webkitRequestFullScreen) {
  52. element.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT);
  53. }
  54. }
  55.  
  56. if (document.fullscreenEnabled) {
  57. requestFullscreen(document.documentElement);
  58. }
  59. function read(url) {
  60. return new Promise(resolve => {
  61. fetch(url).then(res => res.text()).then(res => {
  62. return resolve(res);
  63. });
  64. });
  65. };
  66. //end game editing.
  67. //If you read this I hate black people lmao.
  68. // Eqr Fucks White Niggas (C)
  69. WebFont.load({
  70. google: {
  71. families: ['Roboto']
  72. }
  73. });
  74. (function () {
  75. const replace = String.prototype.replace;
  76. const original_call = Function.prototype.call;
  77.  
  78. let anti_map = [];
  79.  
  80. const options = {
  81. aimbot: true,
  82. silentAim: false,
  83. boxEsp: true,
  84. boxColor: "rgba(244,100,80,1)",
  85. weaponEsp: true,
  86. healthEsp: true,
  87. nameEsp: true,
  88. chams: true,
  89. autoReload: true,
  90. autoJump: true,
  91. chamsColorStr: "rgba(255,0,0,1)",
  92. chamsRed: 255,
  93. chamsBlue: 0,
  94. chamsGreen: 0,
  95. };
  96. const styles = {
  97. fontFamily: "Roboto",
  98. itemHeight: 28,
  99. setup: {
  100. background: "#0B132B",
  101. color: "#4c698d",
  102. fontSize: "16px",
  103. header: {
  104. color: "#839cbc",
  105. fontSize: "20px",
  106. borderBottom: "#3A506B",
  107. paddingBottom: 20
  108. },
  109. steps: {
  110. background: "white",
  111. selected: "#5BC0BE",
  112. }
  113. },
  114. profiles: {
  115. background: "#090F22",
  116. borderBottom: "#4c698d"
  117. },
  118. folder: {
  119. header: {
  120. color: "#4c698d",
  121. fontSize: "15.4px",
  122. background: "#0B132B"
  123. }
  124. },
  125. item: {
  126. color: "#839cbc",
  127. fontSize: "13.2px",
  128. background: "#1C2541"
  129. },
  130. button: {
  131. background: "#1C2541",
  132. lineTop: "#5BC0BE",
  133. color: "#4c698d",
  134. hovered: "#5BC0BE",
  135. hoveredColor: "#242f53"
  136. },
  137. checkbox: {
  138. background: "#242f53",
  139. checkedBg: "#5BC0BE",
  140. hovered: "rgba(91,192,190,0.3)",
  141. width: 18,
  142. height: 18
  143. },
  144. input: {
  145. background: "#242f53",
  146. color: "#4c698d",
  147. cursor: "#839cbc",
  148. width: 120,
  149. height: 22
  150. },
  151. select: {
  152. background: "#242f53",
  153. color: "#4c698d",
  154. hovered: "#3A506B",
  155. width: 80,
  156. height: 20,
  157. },
  158. option: {
  159. background: "#242f53",
  160. color: "#4c698d",
  161. hovered: "#3A506B",
  162. hoveredColor: "white",
  163. outline: "#0B132B"
  164. },
  165. slider: {
  166. background: "#242f53",
  167. color: "#5BC0BE",
  168. slider: "#5BC0BE",
  169. hovered: "#3A506B",
  170. width: 89,
  171. height: 20,
  172. leftPadding: 100,
  173. input: {
  174. width: 43,
  175. }
  176. }
  177. }
  178.  
  179. // hook toString to conceal all hooks
  180. const original_toString = Function.prototype.toString;
  181. let hook_toString = new Proxy(original_toString, {
  182. apply: function (target, _this, _arguments) {
  183. for (var i = 0; i < anti_map.length; i++) {
  184. if (anti_map[i].from === _this) {
  185. return target.apply(anti_map[i].to, _arguments);
  186. }
  187. }
  188. return target.apply(_this, _arguments);
  189. }
  190. });
  191. // hide toString hook itself
  192. anti_map.push({
  193. from: hook_toString,
  194. to: original_toString
  195. });
  196. Function.prototype.toString = hook_toString;
  197.  
  198. let conceal_function = function (original_Function, hook_Function) {
  199. anti_map.push({
  200. from: hook_Function,
  201. to: original_Function
  202. });
  203. };
  204.  
  205. // hook Object.getOwnPropertyDescriptors to hide variables from window
  206. let hidden_globals = [];
  207. const original_getOwnPropertyDescriptors = Object.getOwnPropertyDescriptors;
  208. let hook_getOwnPropertyDescriptors = new Proxy(original_getOwnPropertyDescriptors, {
  209. apply: function (target, _this, _arguments) {
  210. let descriptors = target.apply(_this, _arguments);
  211. for (var i = 0; i < hidden_globals.length; i++) {
  212. delete descriptors[hidden_globals[i]];
  213. }
  214. return descriptors;
  215. }
  216. });
  217. Object.getOwnPropertyDescriptors = hook_getOwnPropertyDescriptors;
  218. conceal_function(original_getOwnPropertyDescriptors, hook_getOwnPropertyDescriptors);
  219.  
  220. let invisible_define = function (obj, key, value) {
  221. hidden_globals.push(key);
  222. Object.defineProperty(obj, key, {
  223. enumberable: false,
  224. configurable: false,
  225. writable: true,
  226. value: value
  227. });
  228. };
  229.  
  230. let global_invisible_define = function (key, value) {
  231. invisible_define(window, key, value);
  232. };
  233.  
  234. // we generate random keys for global variables and make it almost impossible(?)
  235. // for outsiders to find programatically
  236. let keyMap = {};
  237. let genKey = function () {
  238. // https://stackoverflow.com/questions/1349404/generate-random-string-characters-in-javascript
  239. let a = new Uint8Array(20);
  240. crypto.getRandomValues(a);
  241. return 'hrt' + Array.from(a, x => ('0' + x.toString(16)).substr(-2)).join('');
  242. }
  243.  
  244. keyMap['init'] = genKey();
  245. global_invisible_define(keyMap['init'], false);
  246.  
  247. keyMap['scalingFactor'] = genKey();
  248. global_invisible_define(keyMap['scalingFactor'], 0);
  249.  
  250. keyMap['options'] = genKey();
  251. global_invisible_define(keyMap['options'], options);
  252. console.log(window[keyMap['options']])
  253.  
  254. //Menu setup
  255.  
  256. keyMap['MyGUI'] = genKey();
  257. global_invisible_define(keyMap['MyGUI'], MyGUI);
  258. const menu = new window[keyMap['MyGUI']](false, 0, 0, 250, 250, styles, "wheelchair", 1)
  259.  
  260. keyMap['menu'] = genKey();
  261. global_invisible_define(keyMap['menu'], menu);
  262.  
  263. const poweredWheelAimbot = menu.addFolder("Aimbot", true)
  264. const poweredWheelVisuals = menu.addFolder("Visuals", true)
  265. const poweredWheelOther = menu.addFolder("Other", true)
  266.  
  267. poweredWheelAimbot.add("Aimbot", window[keyMap['options']], "aimbot", "Check")
  268. poweredWheelAimbot.add("Silent Aim", window[keyMap['options']], "silentAim", "Check")
  269. poweredWheelAimbot.add("Auto Reload", window[keyMap['options']], "autoReload", "Check")
  270. poweredWheelVisuals.add("Name Esp", window[keyMap['options']], "nameEsp", "Check")
  271. poweredWheelVisuals.add("Box Esp", window[keyMap['options']], "boxEsp", "Check")
  272. poweredWheelVisuals.add("Weapon Esp", window[keyMap['options']], "weaponEsp", "Check")
  273. poweredWheelVisuals.add("Health Esp", window[keyMap['options']], "healthEsp", "Check")
  274. poweredWheelVisuals.add("Chams", window[keyMap['options']], "chams", "Check")
  275. poweredWheelVisuals.add("Box Color", window[keyMap['options']], "boxColor", "Color")
  276. poweredWheelOther.add("Auto Jump", window[keyMap['options']], "autoJump", "Check")
  277. poweredWheelVisuals.add("Chams Color", window[keyMap['options']], "chamsColorStr", "Color")
  278. .onChange((val) => {
  279. const {
  280. 1: r,
  281. 2: g,
  282. 3: b
  283. } = val.match(/rgba\((\d+),(\d+),(\d+),\d+\)/)
  284. window[keyMap['options']].chamsRed = (r - 0) / (255 - 0)
  285. window[keyMap['options']].chamsGreen = (g - 0) / (255 - 0)
  286. window[keyMap['options']].chamsBlue = (b - 0) / (255 - 0)
  287. })
  288.  
  289.  
  290.  
  291. // drawVisuals gets overwritten later - place hook before anti cheat loads
  292. let drawVisuals = function () {};
  293. const original_clearRect = CanvasRenderingContext2D.prototype.clearRect;
  294. let hook_clearRect = new Proxy(original_clearRect, {
  295. apply: function (target, _this, _arguments) {
  296. if (_arguments.length === 5) {
  297. target.apply(_this, _arguments);
  298. } else {
  299. drawVisuals(_this);
  300. }
  301. }
  302. });
  303. conceal_function(original_clearRect, hook_clearRect);
  304. CanvasRenderingContext2D.prototype.clearRect = hook_clearRect;
  305.  
  306. var original_scale = CanvasRenderingContext2D.prototype.scale;
  307. let hook_scale = new Proxy(original_scale, {
  308. apply: function (target, _this, _arguments) {
  309. if (window[keyMap['scalingFactor']] === _arguments[0]) {
  310. window[keyMap['menu']].draw(_this, true)
  311. }
  312. target.apply(_this, _arguments);
  313. }
  314. });
  315. CanvasRenderingContext2D.prototype.scale = hook_scale;
  316. conceal_function(original_scale, hook_scale);
  317.  
  318. // me, inputs, world, consts, math are objects the rest are key strings
  319. let hrtCheat = function (me, inputs, world, consts, math, canSee, pchObjc, objInstances, isYou, recoilAnimY, mouseDownL, mouseDownR) {
  320. /* re implements code that we overwrote to place hook */
  321. let controls = world.controls;
  322. if (controls.scrollDelta) {
  323. controls.skipScroll = controls.scrollToSwap;
  324. if (!controls.scrollToSwap) {
  325. controls.fakeKey(0x4e20, 0x1);
  326. }
  327. }
  328. controls.scrollDelta = 0;
  329. controls.wSwap = 0;
  330. /******************************************************/
  331.  
  332. const playerHeight = 11;
  333. const crouchDst = 3;
  334. const headScale = 2;
  335. const hitBoxPad = 1;
  336. const armScale = 1.3;
  337. const chestWidth = 2.6;
  338. const armInset = -.1;
  339. const playerScale = (2 * armScale + chestWidth + armInset) / 2;
  340. const SHOOT = 5,
  341. SCOPE = 6,
  342. xDr = 3,
  343. yDr = 2,
  344. JUMP = 7,
  345. CROUCH = 8;
  346. let isEnemy = function (player) {
  347. return !me.team || player.team != me.team
  348. };
  349. let canHit = function (player) {
  350. return null == world[canSee](me, player.x3, player.y3 - player.crouchVal * crouchDst, player.z3)
  351. };
  352. let normaliseYaw = function (yaw) {
  353. return (yaw % Math.PI2 + Math.PI2) % Math.PI2;
  354. };
  355. let getDir = function (a, b, c, d) {
  356. return Math.atan2(b - d, a - c);
  357. };
  358. let getD3D = function (a, b, c, d, e, f) {
  359. let g = a - d,
  360. h = b - e,
  361. i = c - f;
  362. return Math.sqrt(g * g + h * h + i * i);
  363. };
  364. let getXDire = function (a, b, c, d, e, f) {
  365. let g = Math.abs(b - e),
  366. h = getD3D(a, b, c, d, e, f);
  367. return Math.asin(g / h) * (b > e ? -1 : 1);
  368. };
  369.  
  370. let dAngleTo = function (x, y, z) {
  371. let ty = normaliseYaw(getDir(controls.object.position.z, controls.object.position.x, z, x));
  372. let tx = getXDire(controls.object.position.x, controls.object.position.y, controls.object.position.z, x, y, z);
  373. let oy = normaliseYaw(controls.object.rotation.y);
  374. let ox = controls[pchObjc].rotation.x;
  375. let dYaw = Math.min(Math.abs(ty - oy), Math.abs(ty - oy - Math.PI2), Math.abs(ty - oy + Math.PI2));
  376. let dPitch = tx - ox;
  377. return Math.hypot(dYaw, dPitch);
  378. };
  379. let calcAngleTo = function (player) {
  380. return dAngleTo(player.x3, player.y3 + playerHeight - (headScale + hitBoxPad) / 2 - player.crouchVal * crouchDst, player.z3);
  381. };
  382. let calcDistanceTo = function (player) {
  383. return getD3D(player.x3, player.y3, player.z3, me.x, me.y, me.z)
  384. };
  385. let isCloseEnough = function (player) {
  386. let distance = calcDistanceTo(player);
  387. return me.weapon.range >= distance && ("Shotgun" != me.weapon.name || distance < 70) && ("Akimbo Uzi" != me.weapon.name || distance < 100);
  388. };
  389. let haveAmmo = function () {
  390. return !(me.ammos[me.weaponIndex] !== undefined && me.ammos[me.weaponIndex] == 0);
  391. };
  392.  
  393. let closest = null,
  394. closestAngle = Infinity;
  395. let players = world.players.list;
  396. if (window[keyMap['options']].aimbot) {
  397. // target selector - based on closest to aim
  398.  
  399. for (var i = 0; me.active && i < players.length; i++) {
  400. let e = players[i];
  401. if (e[isYou] || !e.active || !e[objInstances] || !isEnemy(e)) {
  402. continue;
  403. }
  404.  
  405. // experimental prediction removed
  406. e.x3 = e.x;
  407. e.y3 = e.y;
  408. e.z3 = e.z;
  409.  
  410. if (!isCloseEnough(e) || !canHit(e)) {
  411. continue;
  412. }
  413.  
  414. let angle = calcAngleTo(e);
  415. if (angle < closestAngle) {
  416. closestAngle = angle;
  417. closest = e;
  418. }
  419. }
  420. // aimbot
  421. let ty = controls.object.rotation.y,
  422. tx = controls[pchObjc].rotation.x;
  423. if (closest) {
  424. let target = closest;
  425. let y = target.y3 + playerHeight - (headScale /* + hitBoxPad*/ ) / 2 - target.crouchVal * crouchDst;
  426. if (me.weapon.nAuto && me.didShoot) {
  427. inputs[SHOOT] = 0;
  428. } else if (!me.aimVal) {
  429. inputs[SHOOT] = 1;
  430. inputs[SCOPE] = 1;
  431. } else {
  432. inputs[SCOPE] = 1;
  433. }
  434.  
  435. ty = getDir(controls.object.position.z, controls.object.position.x, target.z3, target.x3);
  436. tx = getXDire(controls.object.position.x, controls.object.position.y, controls.object.position.z, target.x3, y, target.z3);
  437.  
  438. // perfect recoil control
  439. tx -= .3 * me[recoilAnimY];
  440. } else {
  441. inputs[SHOOT] = controls[mouseDownL];
  442. inputs[SCOPE] = controls[mouseDownR];
  443. }
  444.  
  445. // silent aim
  446. const newY = (ty % Math.PI2).round(3);
  447. const newX = (tx % Math.PI2).round(3);
  448. inputs[xDr] = newX;
  449. inputs[yDr] = newY;
  450. if (!window[keyMap['options']].silentAim) {
  451. controls.object.rotation.y = newY
  452. controls[pchObjc].rotation.x = newX
  453. }
  454. }
  455. // auto reload
  456. if (window[keyMap['options']].autoReload) controls.keys[controls.reloadKey] = !haveAmmo();
  457.  
  458. // bhop
  459. if (window[keyMap['options']].autoJump) inputs[JUMP] = (controls.keys[controls.jumpKey] && !me.didJump) * 1;
  460.  
  461. // runs once to set up renders
  462. if (!window[keyMap['init']]) {
  463. window[keyMap['init']] = true;
  464.  
  465. drawVisuals = function (c) {
  466. let scalingFactor = arguments.callee.caller.caller.arguments[0];
  467. window[keyMap['scalingFactor']] = scalingFactor;
  468. let perspective = arguments.callee.caller.caller.arguments[2];
  469. let scaledWidth = c.canvas.width / scalingFactor;
  470. let scaledHeight = c.canvas.height / scalingFactor;
  471. let worldPosition = perspective.camera.getWorldPosition();
  472. for (var i = 0; i < world.players.list.length; i++) {
  473. let player = world.players.list[i];
  474. let e = players[i];
  475. if (e[isYou] || !e.active || !e[objInstances] || !isEnemy(e)) {
  476. continue;
  477. }
  478.  
  479. // the below variables correspond to the 2d box esps corners
  480. // note: we can already tell what ymin ymax is
  481. let xmin = Infinity;
  482. let xmax = -Infinity;
  483. let ymin = Infinity;
  484. let ymax = -Infinity;
  485. let br = false;
  486. for (var j = -1; !br && j < 2; j += 2) {
  487. for (var k = -1; !br && k < 2; k += 2) {
  488. for (var l = 0; !br && l < 2; l++) {
  489. let position = e[objInstances].position.clone();
  490. position.x += j * playerScale;
  491. position.z += k * playerScale;
  492. position.y += l * (playerHeight - e.crouchVal * crouchDst);
  493. if (!perspective.frustum.containsPoint(position)) {
  494. br = true;
  495. break;
  496. }
  497. position.project(perspective.camera);
  498. xmin = Math.min(xmin, position.x);
  499. xmax = Math.max(xmax, position.x);
  500. ymin = Math.min(ymin, position.y);
  501. ymax = Math.max(ymax, position.y);
  502. }
  503. }
  504. }
  505.  
  506. if (br) {
  507. continue;
  508. }
  509.  
  510. xmin = (xmin + 1) / 2;
  511. ymin = (ymin + 1) / 2;
  512. xmax = (xmax + 1) / 2;
  513. ymax = (ymax + 1) / 2;
  514.  
  515.  
  516. c.save();
  517. // save and restore these variables later so they got nothing on us
  518. const original_strokeStyle = c.strokeStyle;
  519. const original_lineWidth = c.lineWidth;
  520. const original_font = c.font;
  521. const original_fillStyle = c.fillStyle;
  522.  
  523. // perfect box esp
  524.  
  525. let distanceScale = Math.max(.3, 1 - getD3D(worldPosition.x, worldPosition.y, worldPosition.z, e.x, e.y, e.z) / 600);
  526. c.scale(distanceScale, distanceScale);
  527. let xScale = scaledWidth / distanceScale;
  528. let yScale = scaledHeight / distanceScale;
  529. ymin = yScale * (1 - ymin);
  530. ymax = yScale * (1 - ymax);
  531. xmin = xScale * xmin;
  532. xmax = xScale * xmax;
  533. if (window[keyMap['options']].boxEsp) {
  534. c.lineWidth = 5;
  535. c.strokeStyle = window[keyMap['options']].boxColor;
  536. c.beginPath();
  537. c.moveTo(xmin, ymin);
  538. c.lineTo(xmin, ymax);
  539. c.lineTo(xmax, ymax);
  540. c.lineTo(xmax, ymin);
  541. c.lineTo(xmin, ymin);
  542. c.stroke();
  543. }
  544.  
  545. // health bar
  546. if (window[keyMap['options']].healthEsp) {
  547. c.fillStyle = "rgba(255,50,50,1)";
  548. var barMaxHeight = ymax - ymin;
  549. c.fillRect(xmin - 7, ymin, -10, barMaxHeight);
  550. c.fillStyle = "#00FFFF";
  551. c.fillRect(xmin - 7, ymin, -10, barMaxHeight * (e.health / e.maxHealth));
  552. }
  553. // info
  554. var x = xmax + 7;
  555. var y = ymax;
  556. c.fillStyle = "white";
  557. c.strokeStyle = 'black';
  558. c.lineWidth = 1;
  559. if (window[keyMap['options']].nameEsp) {
  560. c.font = "60px Roboto";
  561. c.fillText(e.name, x, y);
  562. c.strokeText(e.name, x, y);
  563. }
  564. c.font = "30px Sans-serif";
  565. if (window[keyMap['options']].weaponEsp) {
  566. y += 35;
  567. c.fillText(e.weapon.name, x, y);
  568. c.strokeText(e.weapon.name, x, y);
  569. }
  570. if (window[keyMap['options']].healthEsp) {
  571. y += 35;
  572. c.fillText(e.health + ' HP', x, y);
  573. c.strokeText(e.health + ' HP', x, y);
  574. }
  575. c.strokeStyle = original_strokeStyle;
  576. c.lineWidth = original_lineWidth;
  577. c.font = original_font;
  578. c.fillStyle = original_fillStyle;
  579. c.restore();
  580.  
  581. // skelly chams
  582. // note: this can be done better
  583. var material = e.legMeshes[0].material;
  584. if (window[keyMap['options']].chams && material) {
  585. material.alphaTest = 1;
  586. material.depthTest = false;
  587. material.fog = false;
  588. material.emissive.r = window[keyMap['options']].chamsRed
  589. material.emissive.g = window[keyMap['options']].chamsGreen
  590. material.emissive.b = window[keyMap['options']].chamsBlue
  591. material.wireframe = true;
  592. } else if (!window[keyMap['options']].chams && material) {
  593. material.alphaTest = 0;
  594. material.depthTest = true;
  595. material.fog = true;
  596. material.emissive.r = 0;
  597. material.emissive.g = 0;
  598. material.emissive.b = 0;
  599. material.wireframe = false;
  600. }
  601. }
  602. };
  603. };
  604. };
  605. keyMap['hrtCheat'] = genKey();
  606. global_invisible_define(keyMap['hrtCheat'], hrtCheat);
  607.  
  608. const handler = {
  609. construct(target, args) {
  610. // ttap#4547
  611. if (args.length == 2 && args[1].length > 1337) {
  612. let script = args[1];
  613.  
  614. // anti anti chet & anti skid
  615. const version = script.match(/\w+\['exports'\]=(0[xX][0-9a-fA-F]+);/)[1];
  616. if (version !== "0x597b") {
  617. window[atob('ZG9jdW1lbnQ=')][atob('d3JpdGU=')](atob('VmVyc2lvbiBtaXNzbWF0Y2gg') + version);
  618. window[atob('bG9jYX' + 'Rpb24' + '=')][atob('aHJ' + 'lZg=' + '=')] = atob('aHR0cHM6' + 'Ly9naXRodWIuY2' + '9tL2hydC93aGVlb' + 'GNoYWly');
  619. }
  620.  
  621. var canSee = "'" + script.match(/,this\['(\w+)'\]=function\(\w+,\w+,\w+,\w+,\w+\){if\(!\w+\)return!\w+;/)[1] + "'";
  622. var pchObjc = "'" + script.match(/\(\w+,\w+,\w+\),this\['(\w+)'\]=new \w+\['\w+'\]\(\)/)[1] + "'";
  623. var objInstances = "'" + script.match(/\[\w+\]\['\w+'\]=!\w+,this\['\w+'\]\[\w+\]\['\w+'\]&&\(this\['\w+'\]\[\w+\]\['(\w+)'\]\['\w+'\]=!\w+/)[1] + "'";
  624. var isYou = "'" + script.match(/,this\['\w+'\]=!\w+,this\['\w+'\]=!\w+,this\['(\w+)'\]=\w+,this\['\w+'\]\['length'\]=\w+,this\[/)[1] + "'";
  625. var recoilAnimY = "'" + script.match(/\w*1,this\['\w+'\]=\w*0,this\['\w+'\]=\w*0,this\['\w+'\]=\w*1,this\['\w+'\]=\w*1,this\['\w+'\]=\w*0,this\['\w+'\]=\w*0,this\['(\w+)'\]=\w*0,this\['\w+'\]=\w*0,this\['\w+'\]=\w*0,this\['\w+'\]=\w*0,/)[1] + "'";
  626. var mouseDownL = "'" + script.match(/this\['\w+'\]=function\(\){this\['(\w+)'\]=\w*0,this\['(\w+)'\]=\w*0,this\['\w+'\]={}/)[1] + "'";
  627. var mouseDownR = "'" + script.match(/this\['\w+'\]=function\(\){this\['(\w+)'\]=\w*0,this\['(\w+)'\]=\w*0,this\['\w+'\]={}/)[2] + "'";
  628.  
  629. var inputs = script.match(/\(\w+,\w*1\)\),\w+\['\w+'\]=\w*0,\w+\['\w+'\]=\w*0,!(\w+)\['\w+'\]&&\w+\['\w+'\]\['push'\]\((\w+)\),(\w+)\['\w+'\]/)[2];
  630. var world = script.match(/\(\w+,\w*1\)\),\w+\['\w+'\]=\w*0,\w+\['\w+'\]=\w*0,!(\w+)\['\w+'\]&&\w+\['\w+'\]\['push'\]\((\w+)\),(\w+)\['\w+'\]/)[1];
  631. var consts = script.match(/\w+\['\w+'\]\),\w+\['\w+'\]\(\w+\['\w+'\],\w+\['\w+'\]\+\w+\['\w+'\]\*(\w+)/)[1];
  632. var me = script.match(/\(\w+,\w*1\)\),\w+\['\w+'\]=\w*0,\w+\['\w+'\]=\w*0,!(\w+)\['\w+'\]&&\w+\['\w+'\]\['push'\]\((\w+)\),(\w+)\['\w+'\]/)[3];
  633. var math = script.match(/\\x20\-50\%\)\\x20rotate\('\+\((\w+)\['\w+'\]\(\w+\[\w+\]\['\w+'\]/)[1];
  634.  
  635.  
  636. const code_to_overwrite = script.match(/(\w+\['\w+'\]&&\(\w+\['\w+'\]=\w+\['\w+'\],!\w+\['\w+'\]&&\w+\['\w+'\]\(\w+,\w*1\)\),\w+\['\w+'\]=\w*0,\w+\['\w+'\]=\w*0),!\w+\['\w+'\]&&\w+\['\w+'\]\['push'\]\(\w+\),\w+\['\w+'\]\(\w+,\w+,!\w*1,\w+\['\w+'\]\)/)[1];
  637. const ttapParams = [me, inputs, world, consts, math, canSee, pchObjc, objInstances, isYou, recoilAnimY, mouseDownL, mouseDownR].toString();
  638. let call_hrt = `window['` + keyMap['hrtCheat'] + `'](` + ttapParams + `)`;
  639.  
  640. /*
  641. pad to avoid stack trace line number detections
  642. the script will have the same length as it originally had
  643. */
  644. while (call_hrt.length < code_to_overwrite.length) {
  645. call_hrt += ' ';
  646. }
  647.  
  648. const hooked_call = Function.prototype.call;
  649. Function.prototype.call = original_call;
  650. /* the bIg mod */
  651. script = replace.call(script, code_to_overwrite, call_hrt);
  652.  
  653. /* Below are some misc features which I wouldn't consider bannable, third party clients could be using them */
  654. // all weapons trails on
  655. script = replace.call(script, /\w+\['weapon'\]&&\w+\['weapon'\]\['trail'\]/g, "true")
  656.  
  657. // color blind mode
  658. script = replace.call(script, /#9eeb56/g, '#00FFFF');
  659.  
  660. // no zoom
  661. script = replace.call(script, /,'zoom':.+?(?=,)/g, ",'zoom':1");
  662.  
  663. // script = replace.call(script, /(void this\['sendQueue'\]\['push'\]\(\[(\w+),(\w+)\]\);)/, '$1_[$2]=$3;');
  664. Function.prototype.call = hooked_call;
  665. /***********************************************************************************************************/
  666.  
  667. // bypass modification check of returned function
  668. const original_script = args[1];
  669. args[1] = script;
  670. let mod_fn = new target(...args);
  671. args[1] = original_script;
  672. let original_fn = new target(...args);
  673. conceal_function(original_fn, mod_fn);
  674. return mod_fn;
  675. }
  676. return new target(...args);
  677. }
  678. };
  679.  
  680. // we intercept game.js at the `Function` generation level
  681. const original_Function = Function;
  682. let hook_Function = new Proxy(Function, handler);
  683. conceal_function(original_Function, hook_Function);
  684. Function = hook_Function;
  685. })()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement