Advertisement
QuickSniperBotHWIDS

JS HAck

Nov 13th, 2020
1,810
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 76.72 KB | None | 0 0
  1. // ==UserScript==
  2. // @name SkidFest Clear and Messy
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.1
  5. // @description try to take over the world!
  6. // @author SkidLamer and you when you steal it
  7. // @match https://krunker.io/*
  8. // @noframes
  9. // @grant none
  10. // @run-at document-start
  11. // ==/UserScript==
  12.  
  13.  
  14. /*
  15. allow-forms: form submission is allowed
  16. allow-scripts: scripts are executed
  17. allow-same-origin: the iframe uses the same “origin” that the page, so it no longer faces to CORS mechanism restrictions (permission to use AJAX requests, localStorage, cookies…)
  18. allow-top-navigation: the iframe can navigate to its top-level browsing context
  19. allow-popups: you can open a new window/a popup
  20. allow-pointer-lock: the Pointer Lock API is operable
  21. Note that you can’t reauthorize plugins execution.
  22.  
  23. For example, if your iframe needs to open a popup to a third service, and requires authentication to access this service, you’ll have to add these values:
  24.  
  25. allow-popup
  26. allow-same-origin
  27. allow-forms (the restriction applies to the iframe, but also to elements resulting)
  28. allow-scripts Allows to run scripts
  29. allow-top-navigation
  30. */
  31.  
  32. /*
  33. aimKey: {def: 221, val: 221}
  34. chatKey: {def: 13, val: 13}
  35. confirmKey: {def: 75, val: 75}
  36. crouchKey: {def: 16, val: 16}
  37. dropKey: {def: 90, val: 90}
  38. equipKey: {def: 67, val: 67}
  39. inspKey: {def: 88, val: 88}
  40. interactKey: {def: 71, val: 71}
  41. interactSecKey: {def: 72, val: 72}
  42. jumpKey: {def: 32, val: 32}
  43. meleeKey: {def: 81, val: 81}
  44. moveKeys: {def: Array(4), val: Array(4)}
  45. pListKey: {def: 18, val: 18}
  46. premiumKeys: {def: Array(4), val: Array(4)}
  47. primKey: {def: 84, val: 84}
  48. reloadKey: {def: 82, val: 82}
  49. sBoardKey: {def: 9, val: 9}
  50. shootKey: {def: 220, val: 220}
  51. sprayKey: {def: 70, val: 70}
  52. streakKeys: {def: Array(5), val: Array(5)}
  53. swapKey: {def: 69, val: 69}
  54. toggleKeys: {def: Array(6), val: Array(6)}
  55. voiceKey: {def: 86, val: 86}
  56. wepVisKey: {def: -1, val: -1}
  57. */
  58.  
  59. const isProxy = Symbol("isProxy");
  60. const original_Proxy = window.Proxy;
  61. const original_Reflect= window.Reflect;
  62. const original_fetch = window.fetch;
  63. const original_Object = window.Object;
  64. const original_Promise = window.Promise;
  65. const original_Function = window.Function;
  66. const original_MutationObserver = window.MutationObserver;
  67. const original_decode = window.TextDecoder.prototype.decode;
  68. const original_clearRect = window.CanvasRenderingContext2D.prototype.clearRect;
  69. const original_save = window.CanvasRenderingContext2D.prototype.save;
  70. const original_scale = window.CanvasRenderingContext2D.prototype.scale;
  71. const original_beginPath = window.CanvasRenderingContext2D.prototype.beginPath;
  72. const original_moveTo = window.CanvasRenderingContext2D.prototype.moveTo;
  73. const original_lineTo = window.CanvasRenderingContext2D.prototype.lineTo;
  74. const original_stroke = window.CanvasRenderingContext2D.prototype.stroke;
  75. const original_fillRect = window.CanvasRenderingContext2D.prototype.fillRect;
  76. const original_fillText = window.CanvasRenderingContext2D.prototype.fillText;
  77. const original_strokeText = window.CanvasRenderingContext2D.prototype.strokeText;
  78. const original_restore = window.CanvasRenderingContext2D.prototype.restore;
  79. //original_Object.assign(console, { log:_=>{}, dir:_=>{}, groupCollapsed:_=>{}, groupEnd:_=>{} });
  80. class Utilities {
  81. constructor(script) {
  82. this.script = script;
  83. this.downKeys = new Set();
  84. this.settings = null;
  85. this.vars = {};
  86. this.inputFrame = 0;
  87. this.renderFrame = 0;
  88. this.fps = 0;
  89. this.lists = {
  90. renderESP: {
  91. off: "Off",
  92. walls: "Walls",
  93. twoD: "2d",
  94. full: "Full"
  95. },
  96. renderChams: {
  97. off: "Off",
  98. white: "White",
  99. blue: "Blue",
  100. teal: "Teal",
  101. purple: "Purple",
  102. green: "Green",
  103. yellow: "Yellow",
  104. red: "Red",
  105. },
  106. autoBhop: {
  107. off: "Off",
  108. autoJump: "Auto Jump",
  109. keyJump: "Key Jump",
  110. autoSlide: "Auto Slide",
  111. keySlide: "Key Slide"
  112. },
  113. autoAim: {
  114. off: "Off",
  115. correction: "Aim Correction",
  116. assist: "Legit Aim Assist",
  117. easyassist: "Easy Aim Assist",
  118. silent: "Silent Aim",
  119. trigger: "Trigger Bot",
  120. quickScope: "Quick Scope"
  121. },
  122. audioStreams: {
  123. off: 'Off',
  124. _2000s: 'General German/English',
  125. _HipHopRNB: 'Hip Hop / RNB',
  126. _Oldskool: 'Hip Hop Oldskool',
  127. _Country: 'Country',
  128. _Pop: 'Pop',
  129. _Dance: 'Dance',
  130. _Dubstep: 'DubStep',
  131. _Lowfi: 'LoFi HipHop',
  132. _Jazz: 'Jazz',
  133. _Oldies: 'Golden Oldies',
  134. _Club: 'Club',
  135. _Folk: 'Folk',
  136. _ClassicRock: 'Classic Rock',
  137. _Metal: 'Heavy Metal',
  138. _DeathMetal: 'Death Metal',
  139. _Classical: 'Classical',
  140. _Alternative: 'Alternative',
  141. },
  142. }
  143. this.consts = {
  144. twoPI: Math.PI * 2,
  145. halfPI: Math.PI / 2,
  146. playerHeight: 11,
  147. cameraHeight: 1.5,
  148. headScale: 2,
  149. armScale: 1.3,
  150. armInset: 0.1,
  151. chestWidth: 2.6,
  152. hitBoxPad: 1,
  153. crouchDst: 3,
  154. recoilMlt: 0.27,//0.3,
  155. nameOffset: 0.6,
  156. nameOffsetHat: 0.8,
  157. };
  158. this.css = {
  159. noTextShadows: `*, .button.small, .bigShadowT { text-shadow: none !important; }`,
  160. hideAdverts: `#aMerger, #endAMerger { display: none !important }`,
  161. hideSocials: `.headerBarRight > .verticalSeparator, .imageButton { display: none }`
  162. };
  163. this.spinTimer = 1800;
  164. this.skinConfig = {};
  165. let wait = setInterval(_ => {
  166. this.head = document.head||document.getElementsByTagName('head')[0]
  167. if (this.head) {
  168. clearInterval(wait);
  169. original_Object.entries(this.css).forEach(entry => {
  170. this.css[entry[0]] = this.createElement("style", entry[1])
  171. })
  172. this.onLoad();
  173. }
  174. }, 100);
  175. }
  176. canStore() {
  177. return this.isDefined(Storage);
  178. }
  179.  
  180. saveVal(name, val) {
  181. if (this.canStore()) localStorage.setItem("kro_utilities_"+name, val);
  182. }
  183.  
  184. deleteVal(name) {
  185. if (this.canStore()) localStorage.removeItem("kro_utilities_"+name);
  186. }
  187.  
  188. getSavedVal(name) {
  189. if (this.canStore()) return localStorage.getItem("kro_utilities_"+name);
  190. return null;
  191. }
  192.  
  193. isType(item, type) {
  194. return typeof item === type;
  195. }
  196.  
  197. isDefined(object) {
  198. return !this.isType(object, "undefined") && object !== null;
  199. }
  200.  
  201. getStatic(s, d) {
  202. return this.isDefined(s) ? s : d
  203. }
  204.  
  205. crossDomain(url) {
  206. return "https://crossorigin.me/" + url;
  207. }
  208.  
  209. async waitFor(test, timeout_ms = 20000, doWhile = null) {
  210. let sleep = (ms) => new original_Promise((resolve) => setTimeout(resolve, ms));
  211. return new original_Promise(async (resolve, reject) => {
  212. if (typeof timeout_ms != "number") reject("Timeout argument not a number in waitFor(selector, timeout_ms)");
  213. let result, freq = 100;
  214. while (result === undefined || result === false || result === null || result.length === 0) {
  215. if (doWhile && doWhile instanceof original_Function) doWhile();
  216. if (timeout_ms % 1000 < freq) console.log("waiting for: ", test);
  217. if ((timeout_ms -= freq) < 0) {
  218. console.log( "Timeout : ", test );
  219. resolve(false);
  220. return;
  221. }
  222. await sleep(freq);
  223. result = typeof test === "string" ? original_Function(test)() : test();
  224. }
  225. console.log("Passed : ", test);
  226. resolve(result);
  227. });
  228. };
  229.  
  230. createSettings() {
  231. this.settings = {
  232. hideAdverts: {
  233. pre: "<div class='setHed'>Rendering</div>",
  234. name: "Hide Advertisments",
  235. val: true,
  236. html: () => this.generateSetting("checkbox", "hideAdverts", this),
  237. set: (value, init) => {
  238. if (value) this.head.appendChild(this.css.hideAdverts)
  239. else if (!init) this.css.hideAdverts.remove()
  240. }
  241. },
  242. hideStreams: {
  243. name: "Hide Streams",
  244. val: false,
  245. html: () => this.generateSetting("checkbox", "hideStreams", this),
  246. set: (value) => { window.streamContainer.style.display = value ? "none" : "inherit" }
  247. },
  248. hideMerch: {
  249. name: "Hide Merch",
  250. val: false,
  251. html: () => this.generateSetting("checkbox", "hideMerch", this),
  252. set: value => { window.merchHolder.style.display = value ? "none" : "inherit" }
  253. },
  254. noTextShadows: {
  255. name: "Remove Text Shadows",
  256. val: false,
  257. html: () => this.generateSetting("checkbox", "noTextShadows", this),
  258. set: (value, init) => {
  259. if (value) this.head.appendChild(this.css.noTextShadows)
  260. else if (!init) this.css.noTextShadows.remove()
  261. }
  262. },
  263. customCSS: {
  264. name: "Custom CSS",
  265. val: "",
  266. html: () => this.generateSetting("url", "customCSS", "URL to CSS file"),
  267. resources: { css: document.createElement("link") },
  268. set: (value, init) => {
  269. if (value.startsWith("http")&&value.endsWith(".css")) {
  270. //let proxy = 'https://cors-anywhere.herokuapp.com/';
  271. this.settings.customCSS.resources.css.href = value
  272. }
  273. if (init) {
  274. this.settings.customCSS.resources.css.rel = "stylesheet"
  275. try {
  276. this.head.appendChild(this.settings.customCSS.resources.css)
  277. } catch(e) {
  278. alert(e)
  279. this.settings.customCSS.resources.css = null
  280. }
  281. }
  282. }
  283. },
  284. renderESP: {
  285. name: "Player ESP Type",
  286. val: "off",
  287. html: () =>
  288. this.generateSetting("select", "renderESP", this.lists.renderESP),
  289. },
  290. renderTracers: {
  291. name: "Player Tracers",
  292. val: false,
  293. html: () => this.generateSetting("checkbox", "renderTracers"),
  294. },
  295. renderChams: {
  296. name: "Player Chams",
  297. val: "off",
  298. html: () =>
  299. this.generateSetting(
  300. "select",
  301. "renderChams",
  302. this.lists.renderChams
  303. ),
  304. },
  305. renderWireFrame: {
  306. name: "Player Wireframe",
  307. val: false,
  308. html: () => this.generateSetting("checkbox", "renderWireFrame"),
  309. },
  310. customBillboard: {
  311. name: "Custom Billboard Text",
  312. val: "",
  313. html: () =>
  314. this.generateSetting(
  315. "text",
  316. "customBillboard",
  317. "Custom Billboard Text"
  318. ),
  319. },
  320. autoReload: {
  321. pre: "<br><div class='setHed'>Weapon</div>",
  322. name: "Auto Reload",
  323. val: false,
  324. html: () => this.generateSetting("checkbox", "autoReload"),
  325. },
  326. autoAim: {
  327. name: "Auto Aim Type",
  328. val: "off",
  329. html: () =>
  330. this.generateSetting("select", "autoAim", this.lists.autoAim),
  331. },
  332. frustrumCheck: {
  333. name: "Line of Sight Check",
  334. val: false,
  335. html: () => this.generateSetting("checkbox", "frustrumCheck"),
  336. },
  337. wallPenetrate: {
  338. name: "Aim through Penetratables",
  339. val: false,
  340. html: () => this.generateSetting("checkbox", "wallPenetrate"),
  341. },
  342. autoBhop: {
  343. pre: "<br><div class='setHed'>Player</div>",
  344. name: "Auto Bhop Type",
  345. val: "off",
  346. html: () => this.generateSetting("select", "autoBhop", this.lists.autoBhop),
  347. },
  348. thirdPerson: {
  349. name: "Third Person",
  350. val: false,
  351. html: () => this.generateSetting("checkbox", "thirdPerson"),
  352. set: (value, init) => {
  353. if (value) this.thirdPerson = 1;
  354. else if (!init) this.thirdPerson = undefined;
  355. }
  356. },
  357. skinUnlock: {
  358. name: "Unlock Skins",
  359. val: false,
  360. html: () => this.generateSetting("checkbox", "skinUnlock", this),
  361. },
  362. disableWpnSnd: {
  363. pre: "<br><div class='setHed'>GamePlay</div>",
  364. name: "Disable Players Weapon Sounds",
  365. val: false,
  366. html: () => this.generateSetting("checkbox", "disableWpnSnd", this),
  367. },
  368. autoFindNew: {
  369. name: "New Lobby Finder",
  370. val: false,
  371. html: () => this.generateSetting("checkbox", "autoFindNew", this),
  372. },
  373. autoClick: {
  374. name: "Auto Start Game",
  375. val: false,
  376. html: () => this.generateSetting("checkbox", "autoClick", this),
  377. },
  378. inActivity: {
  379. name: "No InActivity Kick",
  380. val: true,
  381. html: () => this.generateSetting("checkbox", "autoClick", this),
  382. },
  383. aimSpeedMulti: {
  384. name: "Aim Speed Multiplier",
  385. val: 1,
  386. min: 1,
  387. max: 1.1,
  388. step: 0.01,
  389. html: () => this.generateSetting("slider", "aimSpeedMulti"),
  390. },
  391. playStream: {
  392. pre: "<br><div class='setHed'>Radio Stream Player</div>",
  393. name: "Stream Select",
  394. val: "off",
  395. html: () => this.generateSetting("select", "playStream", this.lists.audioStreams),
  396. set: (value) => {
  397. if (value == "off") {
  398. if ( this.settings.playStream.audio ) {
  399. this.settings.playStream.audio.pause();
  400. this.settings.playStream.audio.currentTime = 0;
  401. this.settings.playStream.audio = null;
  402. }
  403. return;
  404. }
  405. let url = this.settings.playStream.urls[value];
  406. if (!this.settings.playStream.audio) {
  407. this.settings.playStream.audio = new Audio(url);
  408. this.settings.playStream.audio.volume = this.settings.audioVolume.val||0.5
  409. } else {
  410. this.settings.playStream.audio.src = url;
  411. }
  412. this.settings.playStream.audio.load();
  413. this.settings.playStream.audio.play();
  414. },
  415. urls: {
  416. _2000s: 'http://0n-2000s.radionetz.de/0n-2000s.aac',
  417. _HipHopRNB: 'https://stream-mixtape-geo.ntslive.net/mixtape2',
  418. _Country: 'https://live.wostreaming.net/direct/wboc-waaifmmp3-ibc2',
  419. _Dance: 'http://streaming.radionomy.com/A-RADIO-TOP-40',
  420. _Pop: 'http://bigrradio.cdnstream1.com/5106_128',
  421. _Jazz: 'http://strm112.1.fm/ajazz_mobile_mp3',
  422. _Oldies: 'http://strm112.1.fm/60s_70s_mobile_mp3',
  423. _Club: 'http://strm112.1.fm/club_mobile_mp3',
  424. _Folk: 'https://freshgrass.streamguys1.com/irish-128mp3',
  425. _ClassicRock: 'http://1a-classicrock.radionetz.de/1a-classicrock.mp3',
  426. _Metal: 'http://streams.radiobob.de/metalcore/mp3-192',
  427. _DeathMetal: 'http://stream.laut.fm/beatdownx',
  428. _Classical: 'http://live-radio01.mediahubaustralia.com/FM2W/aac/',
  429. _Alternative: 'http://bigrradio.cdnstream1.com/5187_128',
  430. _Dubstep: 'http://streaming.radionomy.com/R1Dubstep?lang=en',
  431. _Lowfi: 'http://streams.fluxfm.de/Chillhop/mp3-256',
  432. _Oldskool: 'http://streams.90s90s.de/hiphop/mp3-128/',
  433. },
  434. audio: null,
  435. },
  436. audioVolume: {
  437. name: "Radio Volume",
  438. val: 0.5,
  439. min: 0,
  440. max: 1,
  441. step: 0.01,
  442. html: () => this.generateSetting("slider", "audioVolume"),
  443. set: (value) => { if (this.settings.playStream.audio) this.settings.playStream.audio.volume = value;}
  444. },
  445.  
  446. /*
  447.  
  448. playSound: {
  449. name: "Sound Player",
  450. val: "",
  451. html: () => `<hr><audio controls><source src='window.utilities.settings.playSound.sound.src'/></audio>` + this.generateSetting("url", "playSound", "URL to Sound file"),
  452. sound: null,
  453. set: (value, init) => {
  454. //if ( value && value.startsWith("http") && (value.endsWith(".webm") || value.endsWith(".mp3") || value.endsWith(".wav")) ) {
  455. //this.settings.playSound.sound = new window.Howl({src: value, autoplay: true, loop: true, volume: 1.0, rate: 1.0})
  456. //
  457. // if (init) {
  458. // if ( value.startsWith("http") && (value.endsWith(".webm") || value.endsWith(".mp3") || value.endsWith(".wav")) ) {
  459. // let proxy = 'https://cors-anywhere.herokuapp.com/';
  460. // let url = proxy + value;
  461. // try {
  462. // this.settings.playSound.sound = new window.Howl({src: value, autoplay: true, loop: true, volume: 1.0, rate: 1.0})
  463. // } catch(e) {
  464. // console.error(e)
  465. // this.settings.playSound.sound = null
  466. // }
  467. } else if (value) {
  468. alert("Sound file MUST be a .MP3, .webm or .wav !!")
  469. value = "";
  470. }
  471. // }
  472. }
  473. },*/
  474. };
  475.  
  476. // Inject Html
  477. let waitForWindows = setInterval(_ => {
  478. if (window.windows) {
  479. const menu = window.windows[21];
  480. menu.header = "Settings";
  481. menu.gen = _ => {
  482. var tmpHTML = `<div style='text-align:center'> <a onclick='window.open("https://skidlamer.github.io/")' class='menuLink'>GamingGurus Settings</center></a> <hr> </div>`;
  483. for (const key in this.settings) {
  484. if (this.settings[key].pre) tmpHTML += this.settings[key].pre;
  485. tmpHTML += "<div class='settName' id='" + key + "_div' style='display:" + (this.settings[key].hide ? 'none' : 'block') + "'>" + this.settings[key].name +
  486. " " + this.settings[key].html() + "</div>";
  487. }
  488. tmpHTML += `<br><hr><a onclick='window.utilities.resetSettings()' class='menuLink'>Reset Settings</a>`
  489. /// tmpHTML += `<audio controls><source src='window.utilities.settings.playSound.sound.src'/></audio>`
  490. return tmpHTML;
  491. };
  492. clearInterval(waitForWindows);
  493. }
  494. }, 100);
  495.  
  496. // setupSettings
  497. for (const key in this.settings) {
  498. this.settings[key].def = this.settings[key].val;
  499. if (!this.settings[key].disabled) {
  500. let tmpVal = this.getSavedVal(`kro_utilities_${key}`);
  501. this.settings[key].val = tmpVal !== null ? tmpVal : this.settings[key].val;
  502. if (this.settings[key].val == "false") this.settings[key].val = false;
  503. if (this.settings[key].val == "true") this.settings[key].val = true;
  504. if (this.settings[key].val == "undefined") this.settings[key].val = this.settings[key].def;
  505. if (this.settings[key].set) this.settings[key].set(this.settings[key].val, true);
  506. }
  507. }
  508. }
  509.  
  510. generateSetting(type, name, extra) {
  511. switch (type) {
  512. case 'checkbox':
  513. return `<label class="switch"><input type="checkbox" onclick="window.utilities.setSetting('${name}', this.checked)" ${this.settings[name].val ? 'checked' : ''}><span class="slider"></span></label>`;
  514. case 'slider':
  515. return `<span class='sliderVal' id='slid_utilities_${name}'>${this.settings[name].val}</span><div class='slidecontainer'><input type='range' min='${this.settings[name].min}' max='${this.settings[name].max}' step='${this.settings[name].step}' value='${this.settings[name].val}' class='sliderM' oninput="window.utilities.setSetting('${name}', this.value)"></div>`
  516. case 'select': {
  517. let temp = `<select onchange="window.utilities.setSetting(\x27${name}\x27, this.value)" class="inputGrey2">`;
  518. for (let option in extra) {
  519. temp += '<option value="' + option + '" ' + (option == this.settings[name].val ? 'selected' : '') + '>' + extra[option] + '</option>';
  520. }
  521. temp += '</select>';
  522. return temp;
  523. }
  524. default:
  525. return `<input type="${type}" name="${type}" id="slid_utilities_${name}"\n${'color' == type ? 'style="float:right;margin-top:5px"' : `class="inputGrey2" placeholder="${extra}"`}\nvalue="${this.settings[name].val}" oninput="window.utilities.setSetting(\x27${name}\x27, this.value)"/>`;
  526. }
  527. }
  528.  
  529. resetSettings() {
  530. if (confirm("Are you sure you want to reset all your settings? This will also refresh the page")) {
  531. original_Object.keys(localStorage).filter(x => x.includes("kro_utilities_")).forEach(x => localStorage.removeItem(x));
  532. location.reload();
  533. }
  534. }
  535.  
  536. setSetting(t, e) {
  537. this.settings[t].val = e;
  538. this.saveVal(`kro_utilities_${t}`, e);
  539. if (document.getElementById(`slid_utilities_${t}`)) document.getElementById(`slid_utilities_${t}`).innerHTML = e;
  540. if (this.settings[t].set) this.settings[t].set(e);
  541. }
  542. createObserver(elm, check, callback, onshow = true) {
  543. return new MutationObserver((mutationsList, observer) => {
  544. if (check == 'src' || onshow && mutationsList[0].target.style.display == 'block' || !onshow) {
  545. callback(mutationsList[0].target);
  546. }
  547. }).observe(elm, check == 'childList' ? {childList: true} : {attributes: true, attributeFilter: [check]});
  548. }
  549.  
  550. createListener(elm, type, callback = null) {
  551. if (!this.isDefined(elm)) {
  552. alert("Failed creating " + type + "listener");
  553. return
  554. }
  555. elm.addEventListener(type, event => callback(event));
  556. }
  557.  
  558. createElement(type, html, id) {
  559. let newElement = document.createElement(type)
  560. if (id) newElement.id = id
  561. newElement.innerHTML = html
  562. return newElement
  563. }
  564.  
  565. objectEntries(object, callback) {
  566. let descriptors = original_Object.getOwnPropertyDescriptors(object);
  567. original_Object.entries(descriptors).forEach(([key, { value, get, set, configurable, enumerable, writable }]) => callback([object, key, value, get, set, configurable, enumerable, writable]));
  568. }
  569.  
  570. getVersion() {
  571. const elems = document.getElementsByClassName('terms');
  572. const version = elems[elems.length - 1].innerText;
  573. return version;
  574. }
  575.  
  576. saveAs(name, data) {
  577. let blob = new Blob([data], {type: 'text/plain'});
  578. let el = window.document.createElement("a");
  579. el.href = window.URL.createObjectURL(blob);
  580. el.download = name;
  581. window.document.body.appendChild(el);
  582. el.click();
  583. window.document.body.removeChild(el);
  584. }
  585.  
  586. isKeyDown(key) {
  587. return this.downKeys.has(key);
  588. }
  589.  
  590. simulateKey(keyCode) {
  591. var oEvent = document.createEvent('KeyboardEvent');
  592. // Chromium Hack
  593. Object.defineProperty(oEvent, 'keyCode', {
  594. get : function() {
  595. return this.keyCodeVal;
  596. }
  597. });
  598. Object.defineProperty(oEvent, 'which', {
  599. get : function() {
  600. return this.keyCodeVal;
  601. }
  602. });
  603.  
  604. if (oEvent.initKeyboardEvent) {
  605. oEvent.initKeyboardEvent("keypress", true, true, document.defaultView, keyCode, keyCode, "", "", false, "");
  606. } else {
  607. oEvent.initKeyEvent("keypress", true, true, document.defaultView, false, false, false, false, keyCode, 0);
  608. }
  609.  
  610. oEvent.keyCodeVal = keyCode;
  611.  
  612. if (oEvent.keyCode !== keyCode) {
  613. alert("keyCode mismatch " + oEvent.keyCode + "(" + oEvent.which + ")");
  614. }
  615.  
  616. document.body.dispatchEvent(oEvent);
  617. }
  618.  
  619. toggleMenu() {
  620. let lock = document.pointerLockElement || document.mozPointerLockElement;
  621. if (lock) document.exitPointerLock();
  622. window.showWindow(22);
  623. if (this.isDefined(window.SOUND)) window.SOUND.play(`tick_0`,0.1)
  624. }
  625.  
  626. onLoad() {
  627. this.createSettings();
  628. this.deObfuscate();
  629. this.createObserver(window.instructionsUpdate, 'style', (target) => {
  630. if (this.settings.autoFindNew.val) {
  631. console.log(target)
  632. if (['Kicked', 'Banned', 'Disconnected', 'Error', 'Game is full'].some(text => target && target.innerHTML.includes(text))) {
  633. location = document.location.origin;
  634. }
  635. }
  636. });
  637.  
  638. this.createListener(document, "keyup", event => {
  639. if (this.downKeys.has(event.code)) this.downKeys.delete(event.code)
  640. })
  641.  
  642. this.createListener(document, "keydown", event => {
  643. if (event.code == "F1") {
  644. event.preventDefault();
  645. this.toggleMenu();
  646. }
  647. if ('INPUT' == document.activeElement.tagName || !window.endUI && window.endUI.style.display) return;
  648. switch (event.code) {
  649. case 'NumpadSubtract':
  650. console.dir(this)
  651. break;
  652. default:
  653. if (!this.downKeys.has(event.code)) this.downKeys.add(event.code);
  654. break;
  655. }
  656. })
  657.  
  658. this.createListener(document, "mouseup", event => {
  659. switch (event.button) {
  660. case 1:
  661. event.preventDefault();
  662. this.toggleMenu();
  663. break;
  664. default:
  665. break;
  666. }
  667. })
  668.  
  669. this.waitFor(_=>this.exports).then(exports => {
  670. if (!exports) return alert("Exports not Found");
  671. const found = new Set();
  672. const array = new Map([
  673. ["utility", ["getAnglesSSS", "rgbToHex"]],
  674. ["config", ["serverTickRate", "camChaseTrn", "cameraHeight", "hitBoxPad"]],
  675. ["overlay", ["render", "canvas"]],
  676. ["three", ["ACESFilmicToneMapping", "TextureLoader", "ObjectLoader"]],
  677. ["colors", ["challLvl", "getChallCol"]],
  678. ["ui", ["showEndScreen", "toggleControlUI", "toggleEndScreen", "updatePlayInstructions"]],
  679. ["ws", ["sendQueue"]],
  680. ])
  681. return this.waitFor(_ => found.size === array.size, 20000, () => {
  682. array.forEach((arr, name, map) => {
  683. this.objectEntries(exports, ([rootObject, rootKey, rootValue, rootGet, rootSet, rootConfigurable, rootEnumerable, rootWritable]) => {
  684. this.objectEntries(rootValue.exports, ([object, key, value, get, set, configurable, enumerable, writable]) => {
  685. if (!found.has(name) && arr.includes(key)) {
  686. found.add(name);
  687. this[name] = rootValue.exports;
  688. }
  689. })
  690. })
  691. })
  692. })
  693. })
  694. //e.stack = e.stack.replace(/\n.*Object\.apply.*/, '');
  695.  
  696. this.waitFor(_=>this.ws.connected === true, 40000).then(_=> {
  697. this.ws.send = new original_Proxy(this.ws.send, {
  698. apply(target, that, args) {
  699. try {
  700. var original_fn = Function.prototype.apply.apply(target, [that, args]);
  701. } catch (e) {
  702. e.stack = e.stack = e.stack.replace(/\n.*Object\.apply.*/, '');
  703. throw e;
  704. }
  705.  
  706. if (args[0] === "ent") {
  707. window.utilities.skinConfig = {
  708. main: args[1][2][0],
  709. secondary: args[1][2][1],
  710. hat: args[1][3],
  711. body: args[1][4],
  712. knife: args[1][9],
  713. dye: args[1][14],
  714. waist: args[1][17],
  715. }
  716. }
  717. return original_fn;
  718. // return target.apply(thisArg, msg);
  719. }
  720. })
  721.  
  722. this.ws._dispatchEvent = new original_Proxy(this.ws._dispatchEvent, {
  723. apply(target, thisArg, [type, msg]) {
  724. //console.log(type, msg)
  725. if (type =="init") {
  726. if(msg[9].bill && window.utilities.settings.customBillboard.val.length > 1) {
  727. msg[9].bill.txt = window.utilities.settings.customBillboard.val;
  728. }
  729. }
  730. if (window.utilities.settings.skinUnlock.val && window.utilities.skinConfig && type === "0") {
  731. let playersInfo = msg[0];
  732. let perPlayerSize = 38;
  733. while (playersInfo.length % perPlayerSize !== 0) perPlayerSize++;
  734. for(let i = 0; i < playersInfo.length; i += perPlayerSize) {
  735. if (playersInfo[i] === window.utilities.ws.socketId||0) {
  736. playersInfo[i + 12] = [window.utilities.skinConfig.main, window.utilities.skinConfig.secondary];
  737. playersInfo[i + 13] = window.utilities.skinConfig.hat;
  738. playersInfo[i + 14] = window.utilities.skinConfig.body;
  739. playersInfo[i + 19] = window.utilities.skinConfig.knife;
  740. playersInfo[i + 25] = window.utilities.skinConfig.dye;
  741. playersInfo[i + 33] = window.utilities.skinConfig.waist;
  742. }
  743. }
  744. }
  745. return target.apply(thisArg, arguments[2]);
  746. }
  747. })
  748.  
  749. const skins = Symbol("SkinUnlock")
  750. original_Object.defineProperty(original_Object.prototype, "skins", {
  751. enumerable: false,
  752. get() {
  753. if (window.utilities.settings.skinUnlock.val && this.stats) {
  754. let skins = [];
  755. for(let i = 0; i < 5000; i++) skins.push({ind: i, cnt: i});
  756. return skins;
  757. }
  758. return this[skins];
  759. },
  760. set(v) { this[skins] = v; }
  761. });
  762. })
  763.  
  764. if (this.isDefined(window.SOUND)) {
  765. window.SOUND.play = new original_Proxy(window.SOUND.play, {
  766. apply: function(target, that, [src, vol, loop, rate]) {
  767. if ( src.startsWith("fart_") ) return;
  768. return target.apply(that, [src, vol, loop, rate]);
  769. }
  770. })
  771. }
  772.  
  773. //tmpSound = this.sounds[tmpIndx];
  774. // if (!tmpSound) {
  775. // tmpSound = new Howl({
  776. // src: ".././sound/" + (window.activeHacker?
  777. // "fart_0":id) + ".mp3"
  778. // });
  779. // this.sounds[tmpIndx] = tmpSound;
  780. // }
  781.  
  782. //if (this.isDefined(SOUND)) {
  783. // const play = SOUND.play;
  784. // SOUND.play = function() {
  785. // if (arguments[0].startsWith("weapon_")) return;
  786. // return play.apply(this, arguments)
  787. // }
  788. //console.dir(window)
  789. // chrome.runtime.onMessage.addListener((message, MessageSender, sendResponse)=>{
  790. // console.log(message)
  791. //})
  792. //}
  793.  
  794. // create audio context
  795. //var AudioContext = window.AudioContext || window.webkitAudioContext;
  796. //var audioCtx = new AudioContext();
  797.  
  798. //AudioParam.prototype.setTargetAtTime = new original_Proxy(AudioParam.prototype.setTargetAtTime, {
  799. // apply: function(target, that, [audioTarget, startTime, timeConstant]) {
  800. // let flt = target.apply(that, [audioTarget, startTime, timeConstant]);
  801. // return isFinite(flt) ? flt : 0.0;
  802. // }
  803. // })
  804.  
  805. // AudioParam.prototype.setValueAtTime = new original_Proxy(AudioParam.prototype.setValueAtTime, {
  806. // apply: function(target, that, [value, startTime]) {
  807. // return target.apply(that, [value / 100, startTime+1]);
  808. // }
  809. // })
  810. }
  811.  
  812. patchScript() {
  813. const patches = new Map()
  814. .set("exports", [/(function\(\w,\w,(\w)\){)'use strict';(\(function\((\w)\){)\//, `$1$3 window.utilities.exports=$2.c; window.utilities.modules=$2.m;/`])
  815. //.set("exports", [/(function\(\w+,\w+,(\w+)\){\(function\(\w+\){)(\w+\['exports'])/,`$1window.utilities.exports=$2.c; window.utilities.modules=$2.m;$3`])
  816. .set("inView", [/if\((!\w+\['\w+'])\)continue;/, "if($1&&void 0 !== window.utilities.nameTags)continue;"])
  817. .set("inputs", [/(\w+\['tmpInpts']\[\w+\['tmpInpts']\['\w+']\?'\w+':'push']\()(\w+)/, `$1window.utilities.onInput($2)`])
  818. //.set("procInputs", [/this\['meleeAnim']\['armS']=0x0;},this\['\w+']=function\((\w+),\w+,\w+,\w+\){/, `$&window.cheat.onInput($1);`])
  819. //.set("wallBangs", [/!(\w+)\['transparent']/, "$&& (!cheat.settings.wallbangs || !$1.penetrable )"])
  820. .set("thirdPerson", [/(\w+)\[\'config\'\]\[\'thirdPerson\'\]/g, `void 0 !== window.utilities.thirdPerson`])
  821. //.set("onRender", [/\w+\['render']=function\((\w+,\w+,\w+,\w+,\w+,\w+,\w+,\w+)\){/, `$&window.cheat.onRender($1);`])
  822. .set("isHacker", [/(window\['activeHacker']=)!0x0/, `$1!0x1`])
  823. .set("Damage", [/\['send']\('vtw',(\w+)\)/, `['send']('kpd',$1)`])
  824. .set("fixHowler", [/(Howler\['orientation'](.+?)\)\),)/, ``])
  825. .set("respawnT", [/'respawnT':0x3e8/g, `'respawnT':0x0`])
  826. //.set("FPS", [/(window\['mozRequestAnimationFrame']\|\|function\(\w+\){window\['setTimeout'])\(\w+,0x3e8\/0x3c\);/, "$1()"])
  827. //.set("Update", [/(\w+=window\['setTimeout']\(function\(\){\w+)\((\w+)\+(\w+)\)/, "$1($2=$3=0)"])
  828. // .set("weaponZoom", [/(,'zoom':)(\d.+?),/g, "$1window.utilities.settings.weaponZoom.val||$2"])
  829.  
  830. console.groupCollapsed("PATCHING");
  831. let string = this.script;
  832. for (let [name, arr] of patches) {
  833. let found = arr[0].exec(string);
  834. if (found) {
  835. console.groupCollapsed(name);
  836. for (let i = 0; i < found.length; ++i) {
  837. if (i == 0) {
  838. console.log("Regex ", arr[0]);
  839. console.log("Found ", found[i]);
  840. console.log("Index ", found.index);
  841. } else console.log("$", i, " ", found[i]);
  842. }
  843. console.log("Replace " + arr[1]);
  844. const patched = string.substr(0, found.index) + String.prototype.replace.call( string.substr(found.index, string.length), arr[0], arr[1] );
  845. if (string === patched) {
  846. alert(`Failed to patch ${name}`);
  847. continue;
  848. } else {
  849. string = patched;
  850. console.log("patched");
  851. }
  852. console.groupEnd();
  853. } else {
  854. alert("Failed to find " + name);
  855. }
  856. }
  857. console.groupEnd();
  858. const spoonter = `console.log("ahoy thar Krunker Devs",'💩');`
  859. return spoonter + string;
  860. }
  861.  
  862. deObfuscate() {
  863. const obfu = {
  864. //\]\)continue;if\(!\w+\['(.+?)\']\)continue;
  865. inView: { regex: /if\(!\w+\['(\w+)']\)continue/, pos: 1 },
  866. //inView: { regex: /\]\)continue;if\(!\w+\['(.+?)\']\)continue;/, pos: 1 },
  867. //canSee: { regex: /\w+\['(\w+)']\(\w+,\w+\['x'],\w+\['y'],\w+\['z']\)\)&&/, pos: 1 },
  868. //procInputs: { regex: /this\['(\w+)']=function\((\w+),(\w+),\w+,\w+\){(this)\['recon']/, pos: 1 },
  869. aimVal: { regex: /this\['(\w+)']-=0x1\/\(this\['weapon']\['\w+']\/\w+\)/, pos: 1 },
  870. pchObjc: { regex: /0x0,this\['(\w+)']=new \w+\['Object3D']\(\),this/, pos: 1 },
  871. didShoot: { regex: /--,\w+\['(\w+)']=!0x0/, pos: 1 },
  872. nAuto: { regex: /'Single\\x20Fire','varN':'(\w+)'/, pos: 1 },
  873. crouchVal: { regex: /this\['(\w+)']\+=\w\['\w+']\*\w+,0x1<=this\['\w+']/, pos: 1 },
  874. recoilAnimY: { regex: /this\['(\w+)']=0x0,this\['recoilForce']=0x0/, pos: 1 },
  875. //recoilAnimY: { regex: /this\['recoilAnim']=0x0,this\[(.*?\(''\))]/, pos: 1 },
  876. ammos: { regex: /\['length'];for\(\w+=0x0;\w+<\w+\['(\w+)']\['length']/, pos: 1 },
  877. weaponIndex: { regex: /\['weaponConfig']\[\w+]\['secondary']&&\(\w+\['(\w+)']==\w+/, pos: 1 },
  878. isYou: { regex: /0x0,this\['(\w+)']=\w+,this\['\w+']=!0x0,this\['inputs']/, pos: 1 },
  879. objInstances: { regex: /\w+\['genObj3D']\(0x0,0x0,0x0\);if\(\w+\['(\w+)']=\w+\['genObj3D']/, pos: 1 },
  880. getWorldPosition: { regex: /{\w+=\w+\['camera']\['(\w+)']\(\);/, pos: 1 },
  881. //mouseDownL: { regex: /this\['\w+'\]=function\(\){this\['(\w+)'\]=\w*0,this\['(\w+)'\]=\w*0,this\['\w+'\]={}/, pos: 1 },
  882. mouseDownR: { regex: /this\['(\w+)']=0x0,this\['keys']=/, pos: 1 },
  883. reloadTimer: { regex: /this\['(\w+)']-=\w+,\w+\['reloadUIAnim']/, pos: 1 },///this\['(\w+)']&&\(this\['noMovTimer']=0x0/, pos: 1 },
  884. maxHealth: { regex: /this\['health']\/this\['(\w+)']\?/, pos: 1 },
  885. xDire: { regex: /this\['(\w+)']=\w+\['round']\(0x3\),this\['(\w+)']=\w+\['round']/, pos: 1 },
  886. yDire: { regex: /this\['(\w+)']=\w+\['round']\(0x3\),this\['(\w+)']=\w+\['round']/, pos: 2 },
  887. //xVel: { regex: /this\['x']\+=this\['(\w+)']\*\w+\['map']\['config']\['speedX']/, pos: 1 },
  888. yVel: { regex: /this\['y']\+=this\['(\w+)']\*\w+\['map']\['config']\['speedY']/, pos: 1 },
  889. //zVel: { regex: /this\['z']\+=this\['(\w+)']\*\w+\['map']\['config']\['speedZ']/, pos: 1 },
  890. };
  891. console.groupCollapsed("DEOBFUSCATE");
  892. for (let key in obfu) {
  893. let result = obfu[key].regex.exec(this.script);
  894. if (result) {
  895. window.utilities.vars[key] = result[obfu[key].pos];
  896. console.log("found: ", key, " at ", result.index, " value: ", window.utilities.vars[key]);
  897. } else {
  898. const str = "Failed to find " + key;
  899. console.error(str);
  900. alert(str);
  901. window.utilities.vars[key] = null;
  902. }
  903. }
  904. console.groupEnd();
  905. }
  906.  
  907. onRender() { /* hrt / ttap - https://github.com/hrt */
  908. this.renderFrame ++;
  909. if (this.renderFrame >= 100000) this.renderFrame = 0;
  910. let scaledWidth = this.ctx.canvas.width / this.scale;
  911. let scaledHeight = this.ctx.canvas.height / this.scale;
  912. let playerScale = (2 * this.consts.armScale + this.consts.chestWidth + this.consts.armInset) / 2
  913. let worldPosition = this.renderer.camera[this.vars.getWorldPosition]();
  914. let espVal = this.settings.renderESP.val;
  915. if (espVal ==="walls"||espVal ==="twoD") this.nameTags = undefined; else this.nameTags = true;
  916.  
  917. for (let iter = 0, length = this.game.players.list.length; iter < length; iter++) {
  918. let player = this.game.players.list[iter];
  919. if (player[this.vars.isYou] || !player.active || !player[this.vars.objInstances] || this.getIsFriendly(player)) {
  920. continue;
  921. }
  922.  
  923. if (espVal === "full") player[this.vars.inView] = false;
  924.  
  925. // the below variables correspond to the 2d box esps corners
  926. let xmin = Infinity;
  927. let xmax = -Infinity;
  928. let ymin = Infinity;
  929. let ymax = -Infinity;
  930. let br = false;
  931. for (let j = -1; !br && j < 2; j+=2) {
  932. for (let k = -1; !br && k < 2; k+=2) {
  933. for (let l = 0; !br && l < 2; l++) {
  934. let position = player[this.vars.objInstances].position.clone();
  935. position.x += j * playerScale;
  936. position.z += k * playerScale;
  937. position.y += l * (player.height - player[this.vars.crouchVal] * this.consts.crouchDst);
  938. if (!this.renderer.frustum.containsPoint(position)) {
  939. br = true;
  940. break;
  941. }
  942. position.project(this.renderer.camera);
  943. xmin = Math.min(xmin, position.x);
  944. xmax = Math.max(xmax, position.x);
  945. ymin = Math.min(ymin, position.y);
  946. ymax = Math.max(ymax, position.y);
  947. }
  948. }
  949. }
  950.  
  951. if (br) {
  952. continue;
  953. }
  954.  
  955. xmin = (xmin + 1) / 2;
  956. ymin = (ymin + 1) / 2;
  957. xmax = (xmax + 1) / 2;
  958. ymax = (ymax + 1) / 2;
  959.  
  960. // save and restore these variables later so they got nothing on us
  961. const original_strokeStyle = this.ctx.strokeStyle;
  962. const original_lineWidth = this.ctx.lineWidth;
  963. const original_font = this.ctx.font;
  964. const original_fillStyle = this.ctx.fillStyle;
  965.  
  966. //Tracers
  967. if (this.settings.renderTracers.val) {
  968. original_save.apply(this.ctx, []);
  969. let screenPos = this.world2Screen(player[this.vars.objInstances].position);
  970. this.ctx.lineWidth = 4.5;
  971. this.ctx.beginPath();
  972. this.ctx.moveTo(this.ctx.canvas.width/2, this.ctx.canvas.height - (this.ctx.canvas.height - scaledHeight));
  973. this.ctx.lineTo(screenPos.x, screenPos.y);
  974. this.ctx.strokeStyle = "rgba(0, 0, 0, 0.25)";
  975. this.ctx.stroke();
  976. this.ctx.lineWidth = 2.5;
  977. this.ctx.strokeStyle = "#FF0000";
  978. this.ctx.stroke();
  979. original_restore.apply(this.ctx, []);
  980. }
  981.  
  982. original_save.apply(this.ctx, []);
  983. if (espVal == "twoD" || espVal == "full") {
  984. // perfect box esp
  985. this.ctx.lineWidth = 5;
  986. this.ctx.strokeStyle = 'rgba(255,50,50,1)';
  987. let distanceScale = Math.max(.3, 1 - this.getD3D(worldPosition.x, worldPosition.y, worldPosition.z, player.x, player.y, player.z) / 600);
  988. original_scale.apply(this.ctx, [distanceScale, distanceScale]);
  989. let xScale = scaledWidth / distanceScale;
  990. let yScale = scaledHeight / distanceScale;
  991. original_beginPath.apply(this.ctx, []);
  992. ymin = yScale * (1 - ymin);
  993. ymax = yScale * (1 - ymax);
  994. xmin = xScale * xmin;
  995. xmax = xScale * xmax;
  996. original_moveTo.apply(this.ctx, [xmin, ymin]);
  997. original_lineTo.apply(this.ctx, [xmin, ymax]);
  998. original_lineTo.apply(this.ctx, [xmax, ymax]);
  999. original_lineTo.apply(this.ctx, [xmax, ymin]);
  1000. original_lineTo.apply(this.ctx, [xmin, ymin]);
  1001. original_stroke.apply(this.ctx, []);
  1002.  
  1003. if (espVal == "full") {
  1004. // health bar
  1005. this.ctx.fillStyle = "#000000";
  1006. let barMaxHeight = ymax - ymin;
  1007. original_fillRect.apply(this.ctx, [xmin - 7, ymin, -10, barMaxHeight]);
  1008. this.ctx.fillStyle = player.health > 75 ? "green" : player.health > 40 ? "orange" : "red";
  1009. original_fillRect.apply(this.ctx, [xmin - 7, ymin, -10, barMaxHeight * (player.health / player[this.vars.maxHealth])]);
  1010. // info
  1011. this.ctx.font = "48px Sans-serif";
  1012. this.ctx.fillStyle = "white";
  1013. this.ctx.strokeStyle='black';
  1014. this.ctx.lineWidth = 1;
  1015. let x = xmax + 7;
  1016. let y = ymax;
  1017. original_fillText.apply(this.ctx, [player.name||player.alias, x, y]);
  1018. original_strokeText.apply(this.ctx, [player.name||player.alias, x, y]);
  1019. this.ctx.font = "30px Sans-serif";
  1020. y += 35;
  1021. original_fillText.apply(this.ctx, [player.weapon.name, x, y]);
  1022. original_strokeText.apply(this.ctx, [player.weapon.name, x, y]);
  1023. y += 35;
  1024. original_fillText.apply(this.ctx, [player.health + ' HP', x, y]);
  1025. original_strokeText.apply(this.ctx, [player.health + ' HP', x, y]);
  1026. }
  1027. }
  1028.  
  1029. original_restore.apply(this.ctx, []);
  1030. this.ctx.strokeStyle = original_strokeStyle;
  1031. this.ctx.lineWidth = original_lineWidth;
  1032. this.ctx.font = original_font;
  1033. this.ctx.fillStyle = original_fillStyle;
  1034.  
  1035. // skelly chams
  1036. if (this.isDefined(player[this.vars.objInstances])) {
  1037. let obj = player[this.vars.objInstances];
  1038. if (!obj.visible) {
  1039. original_Object.defineProperty(player[this.vars.objInstances], 'visible', {
  1040. value: true,
  1041. writable: false
  1042. });
  1043. }
  1044. obj.traverse((child) => {
  1045. let chamColor = this.settings.renderChams.val;
  1046. let chamsEnabled = chamColor !== "off";
  1047. if (child && child.type == "Mesh" && child.material) {
  1048. child.material.depthTest = chamsEnabled ? false : true;
  1049. //child.material.opacity = chamsEnabled ? 0.85 : 1.0;
  1050. //child.material.transparent = true;//chamsEnabled ? true : false;
  1051. child.material.fog = chamsEnabled ? false : true;
  1052. if (child.material.emissive) {
  1053. child.material.emissive.r = chamColor == 'off' || chamColor == 'teal' || chamColor == 'green' || chamColor == 'blue' ? 0 : 0.55;
  1054. child.material.emissive.g = chamColor == 'off' || chamColor == 'purple' || chamColor == 'blue' || chamColor == 'red' ? 0 : 0.55;
  1055. child.material.emissive.b = chamColor == 'off' || chamColor == 'yellow' || chamColor == 'green' || chamColor == 'red' ? 0 : 0.55;
  1056. }
  1057.  
  1058. child.material.wireframe = this.settings.renderWireFrame.val ? true : false
  1059. }
  1060. })
  1061. }
  1062. }
  1063.  
  1064. // weapon Trails
  1065. //this.renderer.weaponADSOffY = 10;
  1066. //for(let i=0;i<this.me.trails.length;++i)if(!this.me.trails[i].mesh.visible) original_Object.defineProperty(this.me.trails[i].mesh, 'visible', {value: true, writable: false});
  1067. }
  1068.  
  1069. spinTick(input) {
  1070. //this.game.players.getSpin(this.self);
  1071. //this.game.players.saveSpin(this.self, angle);
  1072. const angle = this.getAngleDst(input[2], this.me[this.vars.xDire]);
  1073. this.spins = this.getStatic(this.spins, new Array());
  1074. this.spinTimer = this.getStatic(this.spinTimer, this.config.spinTimer);
  1075. this.serverTickRate = this.getStatic(this.serverTickRate, this.config.serverTickRate);
  1076. (this.spins.unshift(angle), this.spins.length > this.spinTimer / this.serverTickRate && (this.spins.length = Math.round(this.spinTimer / this.serverTickRate)))
  1077. for (var e = 0, i = 0; i < this.spins.length; ++i) e += this.spins[i];
  1078. return Math.abs(e * (180 / Math.PI));
  1079. }
  1080.  
  1081. /*
  1082. IsEO8: 10000
  1083. actionFreq: 0
  1084. active: true
  1085. alwaysName: true
  1086. assetID: ""
  1087. atkSound: 0
  1088. behavType: 0
  1089. behaviour: 1
  1090. bobD: 0.2
  1091. bobS: 0.004
  1092. bobVal: 39.56399999999977
  1093. breakAttack: 0
  1094. breakMove: 0
  1095. breakTimer: 0
  1096. canBSeen: false
  1097. canHit: false
  1098. canShoot: false
  1099. changeHealth: ƒ (m,o,p)
  1100. collides: ƒ (m)
  1101. dat: {health: 10000, mSize: 14, asset: 0, idl: 3206, src: "ghost_0"}
  1102. deathSound: 0
  1103. emitSound: ƒ (m,o,p,q,u)
  1104. fireRate: 2000
  1105. frameRT: 0
  1106. frames: 2
  1107. getData: ƒ ()
  1108. gravity: 0
  1109. health: 10000
  1110. hitDMG: 25
  1111. hitRange: 10
  1112. hitRate: 800
  1113. hitTimer: 0
  1114. idlSoundI: 5000
  1115. idlSoundT: 1335.048101081532
  1116. idleSound: 3206
  1117. index: 0
  1118. init: ƒ (m,q,u,v,w,x,y)
  1119. interface: undefined
  1120. interfaceT: undefined
  1121. isAI: true
  1122. kill: ƒ (m)
  1123. arguments: null
  1124. caller: null
  1125. length: 1
  1126. name: ""
  1127. prototype: {constructor: ƒ}
  1128. skins: (...)
  1129. __proto__: ƒ ()
  1130. [[FunctionLocation]]: VM4821:31
  1131. [[Scopes]]: Scopes[4]
  1132. killScore: 0
  1133. lastFrame: 0
  1134. mesh: fI {uuid: "8EA60AE3-B338-46A6-B372-641CAA8602EF", name: "", type: "Object3D", parent: jU, children: Array(1), …}
  1135. meshRef: h1 {uuid: "AC07BE32-1DA3-4BE3-ACF1-B34771A7341D", name: "", type: "Mesh", parent: fI, children: Array(0), …}
  1136. name: "Weeping Soul"
  1137. projType: 0
  1138. respawnR: false
  1139. respawnT: 0
  1140. reward: undefined
  1141. rotY: undefined
  1142. scale: 14
  1143. sentTo: []
  1144. shootTimer: 2000
  1145. shotOff: 2
  1146. shotSprd: 0.02
  1147. sid: 1
  1148. singleUse: undefined
  1149. spawnCap: 20
  1150. spawnMTim: 0
  1151. specAtkTim: 0
  1152. specAtkTim2: 0
  1153. speed: 0
  1154. startP: {x: 326, y: 8, z: 0}
  1155. tFrame: 0
  1156. target: null
  1157. triggerAction: undefined
  1158. triggerChance: undefined
  1159. triggerConstant: undefined
  1160. triggerConstantEvent: 0
  1161. triggerConstantTxt: undefined
  1162. triggerSound: (5) [undefined, undefined, undefined, undefined, undefined]
  1163. turnSpd: 0
  1164. update: ƒ (q)
  1165. usedSpecial: false
  1166. vision: 120
  1167. x: 326
  1168. xD: 2872.99
  1169. xray: false
  1170. y: 8
  1171. yD: 2871.42
  1172. z: 0
  1173. skins: (...)
  1174. __proto__: Object
  1175. */
  1176.  
  1177. raidBot(input) {
  1178. const key = { frame: 0, delta:1,ydir:2,xdir:3,moveDir:4,shoot:5,scope:6,jump:7,crouch:8,reload:9,weaponScroll:10,weaponSwap:11, moveLock:12}
  1179. let target = this.game.AI.ais.filter(enemy => {
  1180. return undefined !== enemy.mesh && enemy.mesh && enemy.mesh.children[0] && enemy.canBSeen && enemy.health > 0
  1181. }).sort((p1, p2) => this.getD3D(this.me.x, this.me.z, p1.x, p1.z) - this.getD3D(this.me.x, this.me.z, p2.x, p2.z)).shift();
  1182. if (target) {
  1183. let canSee = this.renderer.frustum.containsPoint(target.mesh.position)
  1184. let yDire = (this.getDir(this.me.z, this.me.x, target.z, target.x) || 0)
  1185. let xDire = ((this.getXDire(this.me.x, this.me.y, this.me.z, target.x, target.y + target.mesh.children[0].scale.y * 0.85, target.z) || 0) - this.consts.recoilMlt * this.me[this.vars.recoilAnimY])
  1186. if (this.me.weapon[this.vars.nAuto] && this.me[this.vars.didShoot]) { input[key.shoot] = 0; input[key.scope] = 0; this.me.inspecting = false; this.me.inspectX = 0; }
  1187. else {
  1188. if (!this.me.aimDir && canSee) {
  1189. input[key.scope] = 1;
  1190. if (!this.me[this.vars.aimVal]) {
  1191. input[key.shoot] = 1;
  1192. input[key.ydir] = yDire * 1e3
  1193. input[key.xdir] = xDire * 1e3
  1194. this.lookDir(xDire, yDire);
  1195. }
  1196. }
  1197. }
  1198. } else {
  1199. this.resetLookAt();
  1200. }
  1201. return input;
  1202. }
  1203.  
  1204. onInput(input) {
  1205.  
  1206. //this.game.config.deltaMlt = 1.5
  1207.  
  1208. const key = { frame: 0, delta:1,ydir:2,xdir:3,moveDir:4,shoot:5,scope:6,jump:7,crouch:8,reload:9,weaponScroll:10,weaponSwap:11, moveLock:12}
  1209. if (this.isDefined(this.controls) && this.isDefined(this.config) && this.settings.inActivity.val) {
  1210. this.controls.idleTimer = 0;
  1211. this.config.kickTimer = Infinity
  1212. }
  1213. if (this.me) {
  1214. this.inputFrame ++;
  1215. if (this.inputFrame >= 100000) this.inputFrame = 0;
  1216. if (!this.game.decreaseWeapon[isProxy]) {
  1217. this.game.decreaseWeapon = new original_Proxy(this.game.decreaseWeapon, {
  1218. apply: function(target, that, args) {
  1219. if (args[0] == this.me) return;
  1220. return target.apply(that, args);
  1221. },
  1222. get: function(target, key) {
  1223. return key === isProxy ? true : Reflect.get(target, key);
  1224. },
  1225. })
  1226. }
  1227. if (!this.game.increaseWeapon[isProxy]) {
  1228. this.game.increaseWeapon = new original_Proxy(this.game.increaseWeapon, {
  1229. apply: function(target, that, args) {
  1230. if (args[0] !== this.me) return;
  1231. return target.apply(that, args);
  1232. },
  1233. get: function(target, key) {
  1234. return key === isProxy ? true : Reflect.get(target, key);
  1235. },
  1236. })
  1237. }
  1238.  
  1239. if (!this.game.playerSound[isProxy]) {
  1240. this.game.playerSound = new original_Proxy(this.game.playerSound, {
  1241. apply: function(target, that, args) {
  1242. if (window.utilities.settings.disableWpnSnd.val && args[0] && typeof args[0] == "string" && args[0].startsWith("weapon_")) return;
  1243. return target.apply(that, args);
  1244. },
  1245. get: function(target, key) {
  1246. return key === isProxy ? true : Reflect.get(target, key);
  1247. },
  1248. })
  1249. }
  1250.  
  1251. if (this.me.streak && this.me.streak % 25 === 0) {
  1252. this.game.streaks[0].activate()
  1253. }
  1254.  
  1255. //if (this.streakCount == void 0) this.streakCount = document.querySelector("#streakVal");
  1256. //else if (this.streakCount.innerText == "25") {
  1257. // let nukeKey = this.controls.binds.streakKeys.val[0];
  1258. // . this.controls.keys[nukeKey] = 1;
  1259. // this.controls.didPressed[nukeKey] = 1;
  1260. // }
  1261. // let nukeKey = 32//this.controls.binds.streakKeys.val[0];
  1262. //this.simulateKey(nukeKey, "keydown");
  1263. // this.simulateKey(nukeKey, "keyup");
  1264. // if (this.game.nukeTimer) this.game.nukeTimer = 0;
  1265. // this.controls.keys[nukeKey] = 1;
  1266. // this.controls.didPressed[nukeKey] = 1;
  1267. // this.game.incStat("n", this.me);
  1268. // this.game.startNuke(this.me);
  1269. // this.me.nukes++;
  1270. //}
  1271.  
  1272. // autoReload
  1273. if (this.settings.autoReload.val) {
  1274. let ammoLeft = this.me[this.vars.ammos][this.me[this.vars.weaponIndex]];
  1275. let capacity = this.me.weapon.ammo;
  1276. //if (ammoLeft < capacity)
  1277.  
  1278. if (!ammoLeft) {
  1279. input[key.reload] = 1;
  1280. this.me.reload = 0;
  1281. }
  1282. //if (!this.me.canThrow) {
  1283. //this.me.refillKnife();
  1284. //console.dir(this.ws)
  1285. //this.ws.sendQueue.push(this.me.id, "4");
  1286.  
  1287. //this.ws.sendQueue.push([this.me.id, 'rfl']);
  1288. //this.ws.send.apply(this.ws, [this.me.id, 'rfl']);
  1289. //}
  1290. }
  1291.  
  1292. //Auto Bhop
  1293. //this.config.isProd =false
  1294. // this.config.inNode = true
  1295. //this.controls.speedLmt = 1.1;
  1296. //this.config.dltMx = 66;
  1297. this.config.marketFeeBypass = 1;
  1298. this.config.marketMinLVl = 1;
  1299.  
  1300. let autoBhop = this.settings.autoBhop.val;
  1301. if (autoBhop !== "off") {
  1302. if (this.isKeyDown("Space") || autoBhop == "autoJump" || autoBhop == "autoSlide") {
  1303. this.controls.keys[this.controls.binds.jumpKey.val] ^= 1;
  1304. if (this.controls.keys[this.controls.binds.jumpKey.val]) {
  1305. this.controls.didPressed[this.controls.binds.jumpKey.val] = 1;
  1306. }
  1307. if (this.isKeyDown("Space") || autoBhop == "autoSlide") {
  1308. if (this.me[this.vars.yVel] < -0.03 && this.me.canSlide) {
  1309. setTimeout(() => {
  1310. this.controls.keys[this.controls.binds.crouchKey.val] = 0;
  1311. }, this.me.slideTimer||325);
  1312. this.controls.keys[this.controls.binds.crouchKey.val] = 1;
  1313. this.controls.didPressed[this.controls.binds.crouchKey.val] = 1;
  1314. }
  1315. }//airTime
  1316. }
  1317. }
  1318.  
  1319. //Autoaim
  1320. if (this.inputFrame % 2 == 0) {
  1321. this.me.weapon.spdMlt = this.settings.aimSpeedMulti.val
  1322. }
  1323.  
  1324. if (this.settings.autoAim.val !== "off") {
  1325. //if (this.inputFrame % 50 == 0) {
  1326. // this.me.weapon.spdMlt = this.settings.aimSpeedMulti.val||1
  1327. //this.me.weapon.spdMlt = this.settings.speedMulti.val||1
  1328. //this.game.config.deltaMlt = this.settings.speedMulti.val||1
  1329. //} else {
  1330. // this.me.weapon.spdMlt = 1
  1331. // this.game.config.deltaMlt = 1
  1332. //}
  1333.  
  1334. let target = this.game.players.list.filter(enemy => {
  1335. return undefined !== enemy[this.vars.objInstances] && enemy[this.vars.objInstances] && !enemy[this.vars.isYou] && !this.getIsFriendly(enemy) && enemy.health > 0 && this.getInView(enemy)
  1336. }).sort((p1, p2) => this.getD3D(this.me.x, this.me.z, p1.x, p1.z) - this.getD3D(this.me.x, this.me.z, p2.x, p2.z)).shift();
  1337. if (target) {
  1338. // this.ws.sendQueue.push(this.me.id, "am", ["Purchased", null]);
  1339. // this.game.players.score(this.me, 0, 0, 1);
  1340. //let count = this.spinTick(input);
  1341. //if (count < 360) {
  1342. // input[2] = this.me[this.vars.xDire] + Math.PI;
  1343. //} else console.log("spins ", count);
  1344. //this.me[this.vars.yDire] = (this.getDir(this.me.z, this.me.x, target.z, target.x) || 0)
  1345. //this.me[this.vars.xDire] = ((this.getXDire(this.me.x, this.me.y, this.me.z, target.x, target.y + 100, target.z) || 0) - this.consts.recoilMlt * this.me[this.vars.recoilAnimY])
  1346.  
  1347.  
  1348. let canSee = this.renderer.frustum.containsPoint(target[this.vars.objInstances].position);
  1349. let yDire = (this.getDir(this.me.z, this.me.x, target.z, target.x) || 0)
  1350. let xDire = ((this.getXDire(this.me.x, this.me.y, this.me.z, target.x, target.y + target.jumpBobY*this.config.jumpVel - target[this.vars.crouchVal] * this.consts.crouchDst + this.me[this.vars.crouchVal] * this.consts.crouchDst, target.z) || 0) - this.consts.recoilMlt * this.me[this.vars.recoilAnimY])
  1351. if (this.me.weapon[this.vars.nAuto] && this.me[this.vars.didShoot]) {
  1352. input[key.shoot] = 0;
  1353. input[key.scope] = 0;
  1354. this.me.inspecting = false;
  1355. this.me.inspectX = 0;
  1356. }
  1357. else if (!canSee && this.settings.frustrumCheck.val) this.resetLookAt();
  1358. else {
  1359. input[key.scope] = this.settings.autoAim.val === "assist"||this.settings.autoAim.val === "correction" ? this.controls[this.vars.mouseDownR] : this.settings.autoAim.val === "trigger" ? canSee ? 1 : 0 : 1;
  1360. switch (this.settings.autoAim.val) {
  1361. case "quickScope":
  1362. input[key.scope] = 1;
  1363. if (!this.me[this.vars.aimVal]) {
  1364. input[key.shoot] = 1;
  1365. input[key.ydir] = yDire * 1e3
  1366. input[key.xdir] = xDire * 1e3
  1367. this.lookDir(xDire, yDire);
  1368. }
  1369. break;
  1370. case "assist": case "easyassist":
  1371. if (input[key.scope] || this.settings.autoAim.val === "easyassist") {
  1372. if (!this.me.aimDir && canSee || this.settings.autoAim.val === "easyassist") {
  1373. input[key.ydir] = yDire * 1e3
  1374. input[key.xdir] = xDire * 1e3
  1375. this.lookDir(xDire, yDire);
  1376. }
  1377. }
  1378. break;
  1379. case "silent":
  1380. if (!this.me[this.vars.aimVal]) input[key.shoot] = 1;
  1381. else input[key.scope] = 1;
  1382. input[key.ydir] = yDire * 1e3
  1383. input[key.xdir] = xDire * 1e3
  1384. break;
  1385. case "trigger":
  1386. if (!this.me.aimDir) {
  1387. if (!this.me[this.vars.aimVal] && this.me.aimTime > 180) {
  1388. input[key.shoot] = 1;
  1389. input[key.ydir] = yDire * 1e3
  1390. input[key.xdir] = xDire * 1e3
  1391. }
  1392. }
  1393. break;
  1394. case "correction":
  1395. if (input[key.shoot] == 1) {
  1396. input[key.ydir] = yDire * 1e3
  1397. input[key.xdir] = xDire * 1e3
  1398. }
  1399. break;
  1400. default:
  1401. this.resetLookAt();
  1402. break;
  1403. }
  1404. }
  1405. } else {
  1406. this.resetLookAt();
  1407. //input = this.raidBot(input);
  1408. }
  1409. }
  1410. }
  1411.  
  1412. //else if (this.settings.autoClick.val && !this.ui.hasEndScreen) {
  1413. //this.config.deathDelay = 0;
  1414. //this.controls.toggle(true);
  1415. //}
  1416.  
  1417. //this.game.config.deltaMlt = 1
  1418. return input;
  1419. }
  1420.  
  1421. getAngleDst(a, b) {
  1422. return Math.atan2(Math.sin(b - a), Math.cos(a - b));
  1423. };
  1424.  
  1425. getD3D(x1, y1, z1, x2, y2, z2) {
  1426. let dx = x1 - x2;
  1427. let dy = y1 - y2;
  1428. let dz = z1 - z2;
  1429. return Math.sqrt(dx * dx + dy * dy + dz * dz);
  1430. }
  1431.  
  1432. getAngleDst(a, b) {
  1433. return Math.atan2(Math.sin(b - a), Math.cos(a - b));
  1434. }
  1435.  
  1436. getXDire(x1, y1, z1, x2, y2, z2) {
  1437. let h = Math.abs(y1 - y2);
  1438. let dst = this.getD3D(x1, y1, z1, x2, y2, z2);
  1439. return (Math.asin(h / dst) * ((y1 > y2)?-1:1));
  1440. }
  1441.  
  1442. getDir(x1, y1, x2, y2) {
  1443. return Math.atan2(y1 - y2, x1 - x2);
  1444. }
  1445.  
  1446. getDistance(x1, y1, x2, y2) {
  1447. return Math.sqrt((x2 -= x1) * x2 + (y2 -= y1) * y2);
  1448. }
  1449.  
  1450. getCanSee(from, toX, toY, toZ, boxSize) {
  1451. if (!from) return 0;
  1452. boxSize = boxSize||0;
  1453. for (let obj, dist = this.getD3D(from.x, from.y, from.z, toX, toY, toZ), xDr = this.getDir(from.z, from.x, toZ, toX), yDr = this.getDir(this.getDistance(from.x, from.z, toX, toZ), toY, 0, from.y), dx = 1 / (dist * Math.sin(xDr - Math.PI) * Math.cos(yDr)), dz = 1 / (dist * Math.cos(xDr - Math.PI) * Math.cos(yDr)), dy = 1 / (dist * Math.sin(yDr)), yOffset = from.y + (from.height || 0) - this.consts.cameraHeight, aa = 0; aa < this.game.map.manager.objects.length; ++aa) {
  1454. if (!(obj = this.game.map.manager.objects[aa]).noShoot && obj.active && !obj.transparent && (!this.settings.wallPenetrate.val || (!obj.penetrable || !this.me.weapon.pierce))) {
  1455. let tmpDst = this.lineInRect(from.x, from.z, yOffset, dx, dz, dy, obj.x - Math.max(0, obj.width - boxSize), obj.z - Math.max(0, obj.length - boxSize), obj.y - Math.max(0, obj.height - boxSize), obj.x + Math.max(0, obj.width - boxSize), obj.z + Math.max(0, obj.length - boxSize), obj.y + Math.max(0, obj.height - boxSize));
  1456. if (tmpDst && 1 > tmpDst) return tmpDst;
  1457. }
  1458. }
  1459. //let terrain = this.game.map.terrain;
  1460. // if (terrain) {
  1461. // let terrainRaycast = terrain.raycast(from.x, -from.z, yOffset, 1 / dx, -1 / dz, 1 / dy);
  1462. // if (terrainRaycast) return this.getD3D(from.x, from.y, from.z, terrainRaycast.x, terrainRaycast.z, -terrainRaycast.y);
  1463. //}
  1464. return null;
  1465. }
  1466.  
  1467. lineInRect(lx1, lz1, ly1, dx, dz, dy, x1, z1, y1, x2, z2, y2) {
  1468. let t1 = (x1 - lx1) * dx;
  1469. let t2 = (x2 - lx1) * dx;
  1470. let t3 = (y1 - ly1) * dy;
  1471. let t4 = (y2 - ly1) * dy;
  1472. let t5 = (z1 - lz1) * dz;
  1473. let t6 = (z2 - lz1) * dz;
  1474. let tmin = Math.max(Math.max(Math.min(t1, t2), Math.min(t3, t4)), Math.min(t5, t6));
  1475. let tmax = Math.min(Math.min(Math.max(t1, t2), Math.max(t3, t4)), Math.max(t5, t6));
  1476. if (tmax < 0) return false;
  1477. if (tmin > tmax) return false;
  1478. return tmin;
  1479. }
  1480.  
  1481. lookDir(xDire, yDire) {
  1482. this.controls.object.rotation.y = yDire
  1483. this.controls[this.vars.pchObjc].rotation.x = xDire;
  1484. this.controls[this.vars.pchObjc].rotation.x = Math.max(-this.consts.halfPI, Math.min(this.consts.halfPI, this.controls[this.vars.pchObjc].rotation.x));
  1485. this.controls.yDr = (this.controls[this.vars.pchObjc].rotation.x % Math.PI).round(3);
  1486. this.controls.xDr = (this.controls.object.rotation.y % Math.PI).round(3);
  1487. this.renderer.camera.updateProjectionMatrix();
  1488. this.renderer.updateFrustum();
  1489. }
  1490.  
  1491. resetLookAt() {
  1492. this.controls.yDr = this.controls[this.vars.pchObjc].rotation.x;
  1493. this.controls.xDr = this.controls.object.rotation.y;
  1494. this.renderer.camera.updateProjectionMatrix();
  1495. this.renderer.updateFrustum();
  1496. }
  1497.  
  1498. world2Screen (position) {
  1499. let pos = position.clone();
  1500. let scaledWidth = this.ctx.canvas.width / this.scale;
  1501. let scaledHeight = this.ctx.canvas.height / this.scale;
  1502. pos.project(this.renderer.camera);
  1503. pos.x = (pos.x + 1) / 2;
  1504. pos.y = (-pos.y + 1) / 2;
  1505. pos.x *= scaledWidth;
  1506. pos.y *= scaledHeight;
  1507. return pos;
  1508. }
  1509.  
  1510. getInView(entity) {
  1511. return null == this.getCanSee(this.me, entity.x, entity.y, entity.z);
  1512. }
  1513.  
  1514. getIsFriendly(entity) {
  1515. return (this.me && this.me.team ? this.me.team : this.me.spectating ? 0x1 : 0x0) == entity.team
  1516. }
  1517. }
  1518.  
  1519. (function() {
  1520. var iframe, iframeWin, iframeDoc, script;
  1521. iframe = document.createElement("iframe");
  1522. iframe.src = location.origin;//href;
  1523. //iframe.sandbox = "allow-same-origin";// "allow-same-origin", "allow-scripts"};
  1524. iframe.style.display = 'none';
  1525. document.documentElement.appendChild(iframe);
  1526. iframeWin = iframe.contentWindow;
  1527. iframeDoc = iframe.contentDocument || iframeWin.document;
  1528. //script = document.createElement("script");
  1529. //script.innerHTML = Haxx.toString().concat("window.haxx = new Haxx()");
  1530. //iframeDoc.documentElement.append(script);
  1531. //iframeDoc.documentElement.remove(script);
  1532.  
  1533. iframeWin.fetch = new original_Proxy(original_fetch, {
  1534. apply(target, that, [url, opt]) {
  1535. const initWASM = function(module){module.onRuntimeInitialized();};
  1536. //if (url.startsWith("/pkg/maindemo.wasm")) return new original_Promise(resolve => resolve(null));
  1537. if (url.startsWith("/pkg/maindemo.js")) {
  1538. original_Function.prototype.apply.apply(target, [that, [url, opt]]).then(res => console.log(res));
  1539. return new original_Promise(resolve => resolve({text:_=>`window.initWASM = ${initWASM.toString()}`}));
  1540. }
  1541. if (!url.startsWith("seek-game", 30)) { console.log(url); return original_Function.prototype.apply.apply(target, [that, [url, opt]]); }
  1542. // else {
  1543. // try {
  1544. //new original_Promise(resolve => resolve(decodeURIComponent(/Token=(.+)&data/.exec(url)[1]))).then(token => { console.log("token:",token); return tokenPromise(token) });
  1545. // new original_Promise(resolve => resolve(decodeURIComponent(/Token=(.+)&data/.exec(url)[1]))).then(token => { console.log("token:",token); return tokenPromise(token, {csv:_=>new Promise.resolve(0)}) });
  1546.  
  1547. // } catch(e) {
  1548. // console.error(e.stack);
  1549. // }
  1550. // }
  1551. }
  1552. })
  1553.  
  1554. window.Function = new original_Proxy(original_Function, {
  1555. construct(target, args) {
  1556. const that = new target(...args);
  1557. if (args.length) {
  1558. let string = args[args.length - 1];
  1559.  
  1560. if (string.length > 38e5) {
  1561. window.utilities = new Utilities(string);
  1562. string = window.utilities.patchScript();
  1563. }
  1564.  
  1565. // If changed return with spoofed toString();
  1566. if (args[args.length - 1] !== string) {
  1567. args[args.length - 1] = string;
  1568. let patched = new target(...args);
  1569. patched.toString = () => that.toString();
  1570. return patched;
  1571. }
  1572. }
  1573. return that;
  1574. }
  1575. })
  1576.  
  1577. CanvasRenderingContext2D.prototype.clearRect = function(x, y, width, height) {
  1578. original_clearRect.apply(this, [x, y, width, height]);
  1579. if (void 0 !== window.utilities) window.utilities.ctx = this;
  1580. (function() {
  1581. const caller = arguments.callee.caller.caller;
  1582. if (caller) {
  1583. const renderArgs = caller.arguments;
  1584. if (renderArgs && void 0 !== window.utilities && window.utilities) {
  1585. ["scale", "game", "controls", "renderer", "me"].forEach((item, index)=>{
  1586. window.utilities[item] = renderArgs[index];
  1587. });
  1588. if (renderArgs[4]) {
  1589. window.utilities.onRender();
  1590. //window.requestAnimationFrame.call(window, renderArgs.callee.caller.bind(this));
  1591. }
  1592. if(window.utilities.settings && window.utilities.settings.autoClick.val && window.endUI.style.display == "none" && window.windowHolder.style.display == "none") {
  1593. renderArgs[2].toggle(true);
  1594. }
  1595. }
  1596. }
  1597. })();
  1598. }
  1599.  
  1600. let observer = new MutationObserver(mutations => {
  1601. for (let mutation of mutations) {
  1602. for (let node of mutation.addedNodes) {
  1603. if (node.tagName === 'SCRIPT' && node.type === "text/javascript" && node.innerHTML.startsWith("*!", 1)) {
  1604. node.innerHTML = `!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t){var n={onRuntimeInitialized:function(){function e(e){instructionHolder.style.display="block",instructions.innerHTML="<div style='color: rgba(255, 255, 255, 0.6)'>"+e+"</div><div style='margin-top:10px;font-size:20px;color:rgba(255,255,255,0.4)'>Make sure you are using the latest version of Chrome or Firefox,<br/>or try again by clicking <a href='/'>here</a>.</div>",instructionHolder.style.pointerEvents="all"}(async function(){"undefined"!=typeof TextEncoder&&"undefined"!=typeof TextDecoder?await n.initialize(n):e("Your browser is not supported.")})().catch(t=>{e("Failed to load game.")})}};window._debugTimeStart=Date.now(),fetch("/pkg/maindemo.wasm",{cache:"no-store"}).then(e=>e.arrayBuffer()).then(e=>{n.wasmBinary=e,fetch("/pkg/maindemo.js",{cache:"no-store"}).then(e=>e.text()).then(e=>{new Function(e)(),initWASM(n)})})}]);`
  1605. //node.innerHTML = atob("ZmV0Y2goImh0dHBzOi8va3J1bmtlci5pby9zb2NpYWwuaHRtbCIpLnRoZW4oZT0+ZS50ZXh0KCkpLnRoZW4oZT0+ZmV0Y2goImh0dHBzOi8va3J1bmtlci5pby9wa2cva3J1bmtlci4iKy9cdy5leHBvcnRzPSIoXHcrKSIvLmV4ZWMoZSlbMV0rIi52cmllcyIpKS50aGVuKGU9PmUuYXJyYXlCdWZmZXIoKSkudGhlbihlPT5uZXcgVWludDhBcnJheShlKSkudGhlbihlPT4obmV3IFRleHREZWNvZGVyKS5kZWNvZGUoZS5tYXAodD0+dF5lWzBdXiIhIi5jaGFyQ29kZUF0KDApKSkpLnRoZW4oZT0+bmV3IEZ1bmN0aW9uKCJfX0xPQURFUl9fbW1Ub2tlblByb21pc2UiLGUpKHdpbmRvdy5tbVRva2VuUHJvbWlzZSkpOw==");
  1606. }
  1607. }
  1608. }
  1609. if (void 0 !== window.utilities && window.utilities.me) {
  1610. observer.disconnect();
  1611. //delete iframe.contentWindow;
  1612. //if (void 0 !== iframe) document.documentElement.removeChild(iframe)
  1613. }
  1614. });
  1615. observer.observe(document, {
  1616. childList: true,
  1617. subtree: true
  1618. });
  1619.  
  1620.  
  1621. //document.documentElement.removeChild(iframe);
  1622. //
  1623. // iframe.contentWindow.fetch = function(
  1624. /*
  1625. fetch("https://matchmaker.krunker.io/seek-game?hostname=krunker.io&region=au-syd&autoChangeGame=false&validationToken=7YMd7Wn0roliEH%2FP0ar8w3%2FT%2FWSBen4mNj05pQ6%2BYwMJ0Xz%2BaNaSOrtLzOl%2F2Tla&game=SYD%3A7380s&dataQuery=%7B%22v%22%3A%22zHuND%22%7D", {
  1626. "headers": {
  1627. "accept": "",
  1628. "accept-language": "en-US,en;q=0.6;",
  1629. "cache-control": "no-cache",
  1630. "pragma": "no-cache",
  1631. "sec-fetch-dest": "empty",
  1632. "sec-fetch-mode": "cors",
  1633. "sec-fetch-site": "same-site"
  1634. },
  1635. "referrer": "https://krunker.io/",
  1636. "referrerPolicy": "strict-origin-when-cross-origin",
  1637. "body": null,
  1638. "method": "GET",
  1639. "mode": "cors",
  1640. "credentials": "omit"
  1641. });*/
  1642.  
  1643. //window.addEventListener('message', function(e) {
  1644. // if (e.origin=='null' && e.source == iframe.contentWindow) {
  1645. // //document.write(e.data.text);
  1646. // console.log(e.data.text);
  1647. // }
  1648. // });
  1649. //}, 0);
  1650. })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement