Advertisement
Guest User

ht

a guest
Jan 19th, 2020
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 20.76 KB | None | 0 0
  1. // ==UserScript==
  2. // @name Krunker plus Reworked Fixed
  3. // @namespace http://overhax.ml
  4. // @author OVERHAX | THEGUY3ds x Hrt x ttap
  5. // @description Based on wheelchair :)
  6. // @version v3.7
  7. // @supportURL http://overhax.ml/krunkerPlus
  8. // @icon https://www.google.com/s2/favicons?domain=krunker.io
  9. // @require http://code.jquery.com/jquery-3.3.1.min.js
  10. // @require https://code.jquery.com/ui/1.12.0/jquery-ui.min.js
  11. // @require https://cdnjs.cloudflare.com/ajax/libs/jquery-confirm/3.3.0/jquery-confirm.min.js
  12. // @match *://krunker.io/*
  13. // @grant none
  14. // ==/UserScript==
  15. // Custom hub
  16. //Tells u if hack is working.
  17. alert("INJECTED KRUNKERPLUS")
  18. //Hub change
  19. document.title = "OVERHAX KRUNKER PLUS";
  20. document.getElementById("instructions").style.color = "Red";
  21. document.getElementById('instructions').innerHTML = 'Loading Krunkerplus REWORKED by OVERHAX | THEGUY3ds';
  22. document.getElementById('modVote').innerHTML = 'KRUNKERPLUS+';
  23. document.getElementById("modVote").style.color = "Green";
  24. document.getElementById("texts3DHolder").innerHTML = 'GET MORE HACKS AT OVERHAX.ML';
  25. // Adblock
  26. document.getElementById("krunkerio_728x90_1").remove();
  27. // more shit
  28. 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(\'http://overhax.ml\', \'_blank\', \'location=yes,height=570,width=520,scrollbars=yes,status=yes\');">Get MORE HACKS HERE</div></div>';
  29. document.getElementById("aContainer").innerHTML = '<div class="menuDebugInfo" id="AdBox" onmouseenter="playTick()" onclick="window.open(\'http://overhax.ml\', \'_blank\', \'location=yes,height=570,width=520,scrollbars=yes,status=yes\');">KRUNKERPLUS REWORKED overhax.ml</div>';
  30. document.getElementById("AdBox").style.color = "white";
  31. // Font size
  32. document.getElementById("AdBox").style.fontSize = "larger";
  33. // Custom sniper recticle
  34. document.getElementById('aimRecticle').innerHTML = '<img id="recticleImg" src="https://i.imgur.com/aiBxGzt.png">';
  35. // Aimdot
  36. var d = document.createElement('div');
  37. d.style.cssText = 'width:8px;height:8px;background-color:#0BDEE8;position:absolute;margin:auto;top:0;right:0;bottom:0;left:0;z-index:200;border-radius:4px';
  38. document.body.appendChild(d);
  39. // Background
  40. //document.getElementById("instructionHolder").style.backgroundImage = "url('https://i.pinimg.com/originals/8a/ce/a9/8acea9261c892e75b0651de1d4f4e0e1.jpg')";
  41. // Chat messege
  42. document.getElementById('voiceDisplay').innerHTML = '<div class="menuDebugInfo" id="zaresplusisaskidd"><span style="color:#DAE110">Working on 1.9.2<span class="chatMsg">| OVERHAX KRUNKERPLUS REWORKED <span class="chatMsg"><span style="color:#F18938"> | OVERHAX.ML</span></span></span><i id="voiceIcon" class="material-icons" style="color:#fff;font-size:40px">mic</i> <div id="recTimer">[V]</div></div></div></div>';
  43. //document.getElementById('chatList').innerHTML = '<div class="chatItem"><span style="color:#DAE110">Working on 1.9.2<span class="chatMsg">| OVERHAX KRUNKERPLUS REWORKED <span class="chatMsg"><span style="color:#F18938"> | OVERHAX.ML</span></span></span></div>';
  44. //Fps counter
  45. 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);})()
  46. //Full screen
  47. //<div class="chatItem" style="word-break:break-all;overflow-wrap:break-word;"><span class="chatMsg"><span style="color:#eb5656">DodgyDucks</span><img style="opacity:0.7;margin-right:9px;" class="weaponChatIcon" src="./textures/weapons/icon_1.png"><img class="headShotChatIcon" src="./img/headshot_0.png"><span style="color:#eb5656">SpoopyAmos</span></span></div>
  48. document.fullscreenEnabled =
  49. document.fullscreenEnabled ||
  50. document.mozFullScreenEnabled ||
  51. document.documentElement.webkitRequestFullScreen;
  52.  
  53. function requestFullscreen(element) {
  54. if (element.requestFullscreen) {
  55. element.requestFullscreen();
  56. } else if (element.mozRequestFullScreen) {
  57. element.mozRequestFullScreen();
  58. } else if (element.webkitRequestFullScreen) {
  59. element.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT);
  60. }
  61. }
  62.  
  63. if (document.fullscreenEnabled) {
  64. requestFullscreen(document.documentElement);
  65. }
  66. function read(url) {
  67. return new Promise(resolve => {
  68. fetch(url).then(res => res.text()).then(res => {
  69. return resolve(res);
  70. });
  71. });
  72. };
  73. //end
  74.  
  75. let shared_state = new Map(Object.entries({functions_to_hide: new WeakMap(), strings_to_hide: [], hidden_globals: [], init: false}));
  76.  
  77. let invisible_define = function(obj, key, value) {
  78. shared_state.get('hidden_globals').push(key);
  79. Object.defineProperty(obj, key, {
  80. enumberable: false,
  81. configurable: false,
  82. writable: true,
  83. value: value
  84. });
  85. };
  86.  
  87. let conceal_function = function(original_Function, hook_Function) {
  88. shared_state.get('functions_to_hide').set(hook_Function, original_Function);
  89. };
  90.  
  91. let conceal_string = function(original_string, hook_string) {
  92. shared_state.get('strings_to_hide').push({from: new RegExp(hook_string.replace(/([\[|\]|\(|\)|\*|\\|\.|\+])/g,'\\$1'), 'g'), to: original_string});
  93. };
  94.  
  95. const original_toString = Function.prototype.toString;
  96. let hook_toString = new Proxy(original_toString, {
  97. apply: function(target, _this, _arguments) {
  98. try {
  99. var ret = Function.prototype.apply.apply(target, [_this, _arguments]);
  100. } catch (e) {
  101. // modify stack trace to hide proxy
  102. e.stack = e.stack.replace(/\n.*Object\.apply \(<.*/, '');
  103. throw e;
  104. }
  105.  
  106. let lookup_fn = shared_state.get('functions_to_hide').get(_this);
  107. if (lookup_fn) {
  108. return Function.prototype.apply.apply(target, [lookup_fn, _arguments]);
  109. }
  110.  
  111. for (var i = 0; i < shared_state.get('strings_to_hide').length; i++) {
  112. ret = ret.replace(shared_state.get('strings_to_hide')[i].from, shared_state.get('strings_to_hide')[i].to);
  113. }
  114. return ret;
  115. }
  116. });
  117. Function.prototype.toString = hook_toString;
  118. conceal_function(original_toString, hook_toString);
  119. //
  120.  
  121. var distance, cnBSeen, canSee, pchObjc, objInstances, isYou, recoilAnimY, mouseDownL, mouseDownR, inputs, getWorldPosition;
  122. console.json = object => console.log(JSON.stringify(object, undefined, 2));
  123. const defined = object => typeof object !== "undefined";
  124.  
  125. const original_encode = TextEncoder.prototype.encode;
  126. let hook_encode = new Proxy(original_encode, {
  127. apply: function(target, _this, _arguments) {
  128. let game = false;
  129. try {
  130. if (_arguments[0].length > 1000) {
  131. cnBSeen = _arguments[0].match(/this\['recon']=!0x1,this\['(\w+)']=!0x1/)[1];
  132. canSee = _arguments[0].match(/,this\['(\w+)'\]=function\(\w+,\w+,\w+,\w+,\w+\){if\(!\w+\)return!\w+;/)[1];
  133. pchObjc = _arguments[0].match(/\(\w+,\w+,\w+\),this\['(\w+)'\]=new \w+\['\w+'\]\(\)/)[1];
  134. objInstances = _arguments[0].match(/\[\w+\]\['\w+'\]=!\w+,this\['\w+'\]\[\w+\]\['\w+'\]&&\(this\['\w+'\]\[\w+\]\['(\w+)'\]\['\w+'\]=!\w+/)[1];
  135. isYou = _arguments[0].match(/,this\['\w+'\]=!\w+,this\['\w+'\]=!\w+,this\['(\w+)'\]=\w+,this\['\w+'\]\['length'\]=\w+,this\[/)[1];
  136. recoilAnimY = _arguments[0].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];
  137. mouseDownL = _arguments[0].match(/this\['\w+'\]=function\(\){this\['(\w+)'\]=\w*0,this\['(\w+)'\]=\w*0,this\['\w+'\]={}/)[1];
  138. mouseDownR = _arguments[0].match(/this\['\w+'\]=function\(\){this\['(\w+)'\]=\w*0,this\['(\w+)'\]=\w*0,this\['\w+'\]={}/)[2];
  139. inputs = _arguments[0].match(/\(\w+,\w*1\)\),\w+\['\w+'\]=\w*0,\w+\['\w+'\]=\w*0,!(\w+)\['\w+'\]&&\w+\['\w+'\]\['push'\]\((\w+)\),(\w+)\['\w+'\]/)[2];
  140. getWorldPosition = _arguments[0].match(/\['camera']\['(\w+)']\(\);if/)[1]
  141.  
  142. game = true;
  143. }
  144.  
  145. } catch (e) {
  146. // modify stack trace to hide proxy
  147. e.stack = e.stack.replace(/\n.*Object\.apply \(<.*/, '');
  148. throw e;
  149. }
  150. if (game) TextEncoder.prototype.encode = original_encode;
  151.  
  152. return Function.prototype.apply.apply(target, [_this, _arguments]);
  153. }
  154. }); TextEncoder.prototype.encode = hook_encode;
  155. conceal_function(original_encode, hook_encode);
  156.  
  157. let render = function() {
  158.  
  159. //DEFINES
  160. const args = arguments.callee.caller.caller.arguments;
  161. const me = args[3];
  162. if (!me) return;
  163. const scale = args[0];
  164. const world = args[1];
  165. const renderer = args[2];
  166. const scale2 = args[4];
  167. const canvas = document.getElementById('game-overlay');
  168. const ctx = canvas.getContext("2d");
  169. const consts = {
  170. "cameraHeight": 1.5,
  171. "playerHeight": 11,
  172. "cameraHeight": 1.5,
  173. "headScale": 2,
  174. "crouchDst": 3,
  175. "camChaseTrn": 0.0022,
  176. "camChaseSpd": 0.0012,
  177. "camChaseSen": 0.2,
  178. "camChaseDst": 24,
  179. "recoilMlt": 0.3,
  180. "nameOffset": 0.6,
  181. "nameOffsetHat": 0.8,
  182. };
  183. const fonts = {
  184. ssBig: '30px\x20Sans-serif',
  185. ssSmall: '20px\x20Sans-serif',
  186. gmBig: '30px\x20GameFont',
  187. gmSmall: '20px\x20GameFont'
  188. }
  189. console.dir(window)
  190. let fullWidth = window.innerWidth;
  191. let fullHeight = window.innerHeight;
  192. let scaledWidth = canvas.width / scale;
  193. let scaledHeight = canvas.height / scale;
  194. let camPos = renderer['camera'][getWorldPosition]();
  195. const Pi = Math.PI / 2;
  196. const PI2 = 2 * Math.PI;
  197. let controls = world.controls;
  198. let players = world.players.list;
  199. let entities = players.filter(x => { return x.active && !x[isYou] });
  200.  
  201.  
  202. //FUNCTIONS
  203. let getDistance3D = (fromX, fromY, fromZ, toX, toY, toZ) => {
  204. var distX = fromX - toX,
  205. distY = fromY - toY,
  206. distZ = fromZ - toZ;
  207. return Math.sqrt(distX * distX + distY * distY + distZ * distZ);
  208. }
  209.  
  210. let getDistance = (player1, player2) => {
  211. return getDistance3D(player1.x, player1.y, player1.z, player2.x, player2.y, player2.z);
  212. }
  213.  
  214. let getDirection = (fromZ, fromX, toZ, toX) => {
  215. return Math.atan2(fromX - toX, fromZ - toZ);
  216. }
  217.  
  218. let getXDir = (fromX, fromY, fromZ, toX, toY, toZ) => {
  219. var dirY = Math.abs(fromY - toY),
  220. dist = getDistance3D(fromX, fromY, fromZ, toX, toY, toZ);
  221. return Math.asin(dirY / dist) * (fromY > toY ? -1 : 1);
  222. }
  223.  
  224. let getAngleDist = (start, end) => {
  225. return Math.atan2(Math.sin(end - start), Math.cos(start - end));
  226. }
  227.  
  228. let get = (entity, string) => {
  229. if (defined(entity) && entity && entity.active) {
  230. switch (string) {
  231. case 'isYou': return entity[isYou];
  232. case 'objInstances': return entity[objInstances];
  233. case 'inView': return null == world[canSee](me, entity.x, entity.y - entity.crouchVal * consts.crouchDst, entity.z) ;//|| entity[cnBSeen];
  234. case 'isFriendly': return (me && me.team ? me.team : me.spectating ? 0x1 : 0x0) == entity.team;
  235. case 'recoilAnimY': return entity[recoilAnimY];
  236. }
  237. }
  238. return null;
  239. }
  240.  
  241. let getTarget = () => {
  242. if (!defined (distance)) distance = Infinity;
  243. for (const entity of players.filter(x => { return x.active && !get(x,"isYou") && get(x,"inView") && !get(x,"isFriendly") && x.health > 0})) {
  244. if (defined(entity[objInstances])) {
  245. const entityPos = entity[objInstances].position;
  246. if (renderer.frustum.containsPoint(entityPos)) {
  247. const dist = entityPos.distanceTo(me);
  248. if (dist <= distance) {
  249. me.distance = dist;
  250. return entity;
  251. }
  252. }
  253. }
  254. }
  255. distance = Infinity;
  256. return null;
  257. }
  258.  
  259. let camLookAt = (target) => {
  260. if (!defined(controls) || target === null || (target.x + target.y + target.z2) == 0) return void(controls.target = null);
  261. let offset1 = ((consts.playerHeight - consts.cameraHeight) - (target.crouchVal * consts.crouchDst));
  262. let offset2 = consts.playerHeight - consts.headScale / 2 - target.crouchVal * consts.crouchDst;
  263. let recoil = (get(me, "recoilAnimY") * consts.recoilMlt) * 25;
  264. let xdir = getXDir(controls.object.position.x, controls.object.position.y, controls.object.position.z, target.x, (target.y + offset1) - recoil, target.z);
  265. let ydir = getDirection(controls.object.position.z, controls.object.position.x, target.z, target.x);
  266. controls.target = {
  267. xD:xdir,
  268. yD: ydir,
  269. x: target.x + consts.camChaseDst * Math.sin(ydir) * Math.cos(xdir),
  270. y: target.y - consts.camChaseDst * Math.sin(xdir),
  271. z: target.z + consts.camChaseDst * Math.cos(ydir) * Math.cos(xdir)
  272. }
  273. }
  274.  
  275. let world2Screen = (camera, position) => {
  276. let pos = position.clone();
  277. pos.project(camera);
  278. pos.x = (pos.x + 1) / 2;
  279. pos.y = (-pos.y + 1) / 2;
  280. pos.x *= scaledWidth;
  281. pos.y *= scaledHeight;
  282. return pos;
  283. }
  284.  
  285. let pixelTranslate = (ctx, x, y) => {
  286. ctx.translate(~~x, ~~y);
  287. }
  288.  
  289. let pixelDifference = (pos1, Pos2, multi) => {
  290. const hDiff = ~~(pos1.y - Pos2.y);
  291. return [hDiff, ~~(hDiff * multi)]
  292. }
  293.  
  294. let text = (txt, font, color, x, y) => {
  295. ctx.save();
  296. pixelTranslate(ctx, x, y);
  297. ctx.fillStyle = color;
  298. ctx.strokeStyle = "rgba(0, 0, 0, 0.5)";
  299. ctx.font = font;
  300. ctx.lineWidth = 1;
  301. ctx.strokeText(txt, 0, 0);
  302. ctx.fillText(txt, 0, 0);
  303. ctx.restore();
  304. }
  305.  
  306. let rect = (x, y, ox, oy, w, h, color, fill) => {
  307. ctx.save();
  308. pixelTranslate(ctx, x, y);
  309. ctx.beginPath();
  310. fill ? ctx.fillStyle = color : ctx.strokeStyle = color;
  311. ctx.rect(ox, oy, w, h);
  312. fill ? ctx.fill() : ctx.stroke();
  313. ctx.closePath();
  314. ctx.restore();
  315. }
  316.  
  317. let line = (x1, y1, x2, y2, lW, sS) => {
  318. ctx.save();
  319. ctx.lineWidth = lW + 2;
  320. ctx.beginPath();
  321. ctx.moveTo(x1, y1);
  322. ctx.lineTo(x2, y2);
  323. ctx.strokeStyle = "rgba(0, 0, 0, 0.25)";
  324. ctx.stroke();
  325. ctx.lineWidth = lW;
  326. ctx.strokeStyle = sS;
  327. ctx.stroke();
  328. ctx.restore();
  329. }
  330.  
  331. let image = (x, y, img, ox, oy, w, h) => {
  332. ctx.save();
  333. ctx.translate(x, y);
  334. ctx.beginPath();
  335. ctx.drawImage(img, ox, oy, w, h);
  336. ctx.closePath();
  337. ctx.restore();
  338. }
  339.  
  340. let getTextMeasurements = (arr) => {
  341. for (let i = 0; i < arr.length; i++) {
  342. arr[i] = ~~ctx.measureText(arr[i]).width;
  343. }
  344. return arr;
  345. }
  346.  
  347. let byte2Hex = (n) => {
  348. var chars = "0123456789ABCDEF";
  349. return String(chars.substr((n >> 4) & 0x0F,1)) + chars.substr(n & 0x0F,1);
  350. }
  351.  
  352. let rgba2hex = (r,g,b,a = 255) => ("#").concat(byte2Hex(r),byte2Hex(g),byte2Hex(b),byte2Hex(a));
  353.  
  354. //ONTICK STUFF
  355.  
  356. // target update
  357. if (defined(controls.target) && controls.target !== null) {
  358. controls.object.rotation.y = controls.target.yD;
  359. controls[pchObjc].rotation.x = controls.target.xD;
  360. controls[pchObjc].rotation.x = Math.max(-Pi, Math.min(Pi, controls[pchObjc].rotation.x));
  361. controls.yDr = controls[pchObjc].rotation.x % Math.PI;
  362. controls.xDr = controls.object.rotation.y % Math.PI;
  363. } else controls.target = null;
  364.  
  365. //aim assist
  366. const target = getTarget();
  367. if (target) {
  368. if (controls[mouseDownR] == 1) {
  369. camLookAt(target);
  370. }
  371. }
  372. else {
  373. if (controls.target) camLookAt(null);
  374. }
  375.  
  376. //auto reload - they have crypted the me.ammos as well have to find this one
  377. if (defined(me.ammos)) {
  378. const ammoLeft = me.ammos[me.weaponIndex];
  379. if (ammoLeft === 0) {
  380. players.reload(me);
  381. if (ammoLeft) players.endReload(me.weapon);
  382. }
  383. }
  384. //ESP / Chams
  385. entities.map((entity, index, array)=> {
  386. if (defined(entity[objInstances])) {
  387. /*
  388. let isFriendly = get(entity, 'isFriendly');
  389. let teamCol = isFriendly ? '#44AAFF' : '#FF4444';
  390.  
  391. let entityPos = entity[objInstances].position;
  392. if (renderer.frustum.containsPoint(entityPos)) {
  393. let entitynamePos = entityPos.clone().setY(entityPos.y + (consts.playerHeight + (0x0 <= entity.hatIndex ? consts.nameOffsetHat : 0) + consts.nameOffset - entity.crouchVal * consts.crouchDst));
  394. let entityScrPosName = entitynamePos.clone();
  395. let playerScaled = Math.max(0.3, 1 - camPos.distanceTo(entityScrPosName) / 600);
  396. let entityScrPosBase = world2Screen(renderer.camera, entityPos);
  397. let entityScrPosHead = world2Screen(renderer.camera, entityPos.setY(entityPos.y + consts.playerHeight - entity.crouchVal * consts.crouchDst));
  398. let entityScrPxlDiff = pixelDifference(entityScrPosBase, entityScrPosHead, 0.6);
  399. //2d
  400. //rect(entityScrPosHead.x - entityScrPxlDiff[1] / 2, entityScrPosHead.y, 0, 0, entityScrPxlDiff[1], entityScrPxlDiff[0], teamCol, false);
  401.  
  402. //Tracers
  403. //line(fullWidth / 2, fullHeight - (fullHeight - scaledHeight), entityScrPosBase.x, entityScrPosBase.y, 2.5, teamCol);
  404. */
  405. //Chams
  406. entity[cnBSeen] = true;
  407. for (let i = 0; i < entity[objInstances].children.length; i++) {
  408. const object3d = entity[objInstances].children[i];
  409. for (let j = 0; j < object3d.children.length; j++) {
  410. const mesh = object3d.children[j];
  411. if (mesh && mesh.type == "Mesh") {
  412. const material = mesh.material;
  413. material.depthTest = false;
  414. material.fog = false;
  415. material.emissive.r = 1;
  416. material.colorWrite = true;
  417. material.transparent = true;
  418. material.opacity = 1.0;
  419. //material.needsUpdate = true;
  420. //material.wireframe = !canHit(entity);
  421. }
  422. }
  423. }
  424. }
  425. //}
  426. });
  427. };
  428. const clearRect = CanvasRenderingContext2D.prototype.clearRect;
  429. const original_clearRect = CanvasRenderingContext2D.prototype.scale;
  430. let hook_clearRect = new Proxy(original_clearRect, {
  431. apply: function(target, _this, _arguments) {
  432. try {
  433. var ret = Function.prototype.apply.apply(target, [_this, _arguments]);
  434. } catch (e) {
  435. // modify stack trace to hide proxy
  436. e.stack = e.stack.replace(/\n.*Object\.apply \(<.*/, '');
  437. throw e;
  438. }
  439.  
  440. render(_this);
  441.  
  442. return ret;
  443. }
  444. }); CanvasRenderingContext2D.prototype.scale = hook_clearRect;
  445. conceal_function(original_clearRect, hook_clearRect);
  446.  
  447. fetch (overhaxfree.length > /*THEGUY3ds*/overhax.ml && code[0] === '!')
  448. .then(response => response.text())
  449. .then(text => {
  450. let frame = document.createElement('iframe');
  451. frame.setAttribute('style', 'display:none');
  452. document.documentElement.appendChild(frame);
  453. let child = frame.contentDocument || frame.contentWindow.document;
  454. let chair = document.createElement('script');
  455. chair.innerHTML = text.toString().replace(/overhax.ml/g, Math.random().toString(36).substring(2, 15));;
  456. child.documentElement.append(chair);
  457. child.documentElement.remove(chair);
  458. document.documentElement.removeChild(frame);
  459. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement