Shell Shockers | FPS & Ping Controller

9/30/2024, 9:45:17 PM

  1. // ==UserScript==
  2. // @name Shell Shockers | FPS & Ping Controller
  3. // @grant GM_setValue
  4. // @grant GM_getValue
  5. // @grant GM_deleteValue
  6. // @grant GM_listValues
  7. // @grant GM_info
  8. // @grant GM_setClipboard
  9. // @grant GM_openInTab
  10. //
  11. // @grant GM.setValue
  12. // @grant GM.getValue
  13. // @grant GM.deleteValue
  14. // @grant GM.listValues
  15. // @grant GM.info
  16. // @grant GM.setClipboard
  17. // @grant GM.openInTab
  18.  
  19. // @version 3.0
  20. // @author wish?
  21. // @description 9/30/2024, 9:45:17 PM
  22.  
  23. // @match *://*.shellshock.io/*
  24. // @match *://*.shell.onlypuppy7.online/*
  25. // @match *://*.algebra.best/*
  26. // @match *://*.algebra.vip/*
  27. // @match *://*.biologyclass.club/*
  28. // @match *://*.deadlyegg.com/*
  29. // @match *://*.deathegg.world/*
  30. // @match *://*.eggboy.club/*
  31. // @match *://*.eggboy.xyz/*
  32. // @match *://*.eggcombat.com/*
  33. // @match *://*.egg.dance/*
  34. // @match *://*.eggfacts.fun/*
  35. // @match *://*.egghead.institute/*
  36. // @match *://*.eggisthenewblack.com/*
  37. // @match *://*.eggsarecool.com/*
  38. // @match *://*.geometry.best/*
  39. // @match *://*.geometry.monster/*
  40. // @match *://*.geometry.pw/*
  41. // @match *://*.geometry.report/*
  42. // @match *://*.hardboiled.life/*
  43. // @match *://*.hardshell.life/*
  44. // @match *://*.humanorganising.org/*
  45. // @match *://*.mathactivity.xyz/*
  46. // @match *://*.mathactivity.club/*
  47. // @match *://*.mathdrills.info/*
  48. // @match *://*.mathdrills.life/*
  49. // @match *://*.mathfun.rocks/*
  50. // @match *://*.mathgames.world/*
  51. // @match *://*.math.international/*
  52. // @match *://*.mathlete.fun/*
  53. // @match *://*.mathlete.pro/*
  54. // @match *://*.overeasy.club/*
  55. // @match *://*.risenegg.com/*
  56. // @match *://*.scrambled.tech/*
  57. // @match *://*.scrambled.today/*
  58. // @match *://*.scrambled.us/*
  59. // @match *://*.scrambled.world/*
  60. // @match *://*.shellshockers.club/*
  61. // @match *://*.shellshockers.life/*
  62. // @match *://*.shellshockers.site/*
  63. // @match *://*.shellshockers.us/*
  64. // @match *://*.shellshockers.world/*
  65. // @match *://*.shellshockers.xyz/*
  66. // @match *://*.shellsocks.com/*
  67. // @match *://*.softboiled.club/*
  68. // @match *://*.urbanegger.com/*
  69. // @match *://*.violentegg.club/*
  70. // @match *://*.violentegg.fun/*
  71. // @match *://*.yolk.best/*
  72. // @match *://*.yolk.life/*
  73. // @match *://*.yolk.rocks/*
  74. // @match *://*.yolk.tech/*
  75. // @match *://*.yolk.quest/*
  76. // @match *://*.yolk.today/*
  77. // @match *://*.zygote.cafe/*
  78. // @match *://*.shellshockers.best/*
  79. // @match *://*.eggboy.me/*
  80. // @grant none
  81. // @run-at document-start
  82. // @require https://cdnjs.cloudflare.com/ajax/libs/crypto-js/4.1.1/crypto-js.min.js
  83. // @require https://cdn.jsdelivr.net/npm/tweakpane@3.1.10/dist/tweakpane.min.js
  84. // @require https://cdn.jsdelivr.net/npm/@tweakpane/plugin-essentials@0.1.8/dist/tweakpane-plugin-essentials.min.js
  85. // @require https://cdnjs.cloudflare.com/ajax/libs/jszip/3.7.1/jszip.min.js
  86. //
  87. // @license MIT
  88. // @namespace https://greatest.deepsurf.us/users/1361048
  89. // ==/UserScript==
  90. // (function () {
  91. // const consoleMethods = ["log", "warn", "info", "error", "exception", "table", "trace"];
  92. // const _innerConsole = console;
  93.  
  94. // consoleMethods.forEach((method) => {
  95. // if (unsafeWindow.console[method]) {
  96. // Object.defineProperty(unsafeWindow.console, method, {
  97. // configurable: false,
  98. // get: (...args) => {
  99. // return _innerConsole[method].bind(_innerConsole);
  100. // },
  101. // set: () => {},
  102. // });
  103. // }
  104. // });
  105. // })();
  106. (function () {
  107. let noPointerPause;
  108. const clientKeysURL = `https://js.getstate.farm/vardata/`;
  109. let ss;
  110. let F = [];
  111. let H = {};
  112. let functionNames = [];
  113. let keyRetrieved = false;
  114.  
  115. let tp = {
  116. hideFPS: {
  117. hide: JSON.parse(localStorage.getItem("tp-hideFPS")) || false,
  118. min: JSON.parse(localStorage.getItem("tp-minFPS")) || 20,
  119. max: JSON.parse(localStorage.getItem("tp-maxFPS")) || 200,
  120. random: JSON.parse(localStorage.getItem("tp-randomFPS")) || false,
  121. },
  122. ping: {
  123. min: JSON.parse(localStorage.getItem("tp-minPing")) || 20,
  124. max: JSON.parse(localStorage.getItem("tp-maxPing")) || 200,
  125. random: JSON.parse(localStorage.getItem("tp-randomPing")) || false,
  126. }
  127. };
  128.  
  129. function hideFPS(value) {
  130. let fpsCounter = document.querySelector("#FPS");
  131. if (value) {
  132. if (fpsCounter) {
  133. fpsCounter.style.display = "none";
  134. }
  135. } else {
  136. fpsCounter.style.display = "block";
  137. }
  138. }
  139.  
  140. function randomise(min, max, active) {
  141. if (active) {
  142. const randomFPS = Math.floor(Math.random() * (max - min + 1)) + min;
  143.  
  144. let fpsCounter = document.querySelector("#FPS");
  145. if (fpsCounter) {
  146. fpsCounter.textContent = randomFPS;
  147. }
  148. }
  149. }
  150.  
  151. const makeDraggable = function (element, notMenu) {
  152. if (element) {
  153. let offsetX, offsetY;
  154. element.addEventListener("mousedown", function (e) {
  155. const dragElement = function (e) {
  156. const x = ((e.clientX - offsetX) / unsafeWindow.innerWidth) * 100;
  157. const y = ((e.clientY - offsetY) / unsafeWindow.innerHeight) * 100;
  158. const maxX = 100 - (element.offsetWidth / unsafeWindow.innerWidth) * 100;
  159. const maxY = 100 - (element.offsetHeight / unsafeWindow.innerHeight) * 100;
  160. element.style.left = `${Math.max(0, Math.min(x, maxX))}%`;
  161. element.style.top = `${Math.max(0, Math.min(y, maxY))}%`;
  162. };
  163. if (notMenu || e.target.classList.contains("tp-rotv_t")) {
  164. offsetX = e.clientX - element.getBoundingClientRect().left;
  165. offsetY = e.clientY - element.getBoundingClientRect().top;
  166. document.addEventListener("mousemove", dragElement);
  167. document.addEventListener("mouseup", function () {
  168. document.removeEventListener("mousemove", dragElement);
  169. });
  170. e.preventDefault(); // Prevent text selection during drag
  171. }
  172. });
  173. }
  174. };
  175.  
  176. const startUp = function () {
  177. console.log("startup");
  178. injectScript();
  179. console.log("after startup");
  180. };
  181.  
  182. let originalReplace = String.prototype.replace;
  183. let originalReplaceAll = String.prototype.replaceAll;
  184.  
  185. String.prototype.originalReplace = function () {
  186. return originalReplace.apply(this, arguments);
  187. };
  188. String.prototype.originalReplaceAll = function () {
  189. return originalReplaceAll.apply(this, arguments);
  190. };
  191.  
  192. const log = function (...args) {
  193. let condition;
  194. try {
  195. condition = false;
  196. } catch (error) {
  197. condition = GM_getValue(storageKey + "DisableLogs");
  198. }
  199. if (!condition) {
  200. console.log(...args);
  201. }
  202. };
  203.  
  204. const fetchTextContent = function (url) {
  205. try {
  206. var xhr = new XMLHttpRequest();
  207. xhr.open("GET", url, false);
  208. xhr.send();
  209. if (xhr.status === 200) {
  210. return xhr.responseText;
  211. } else {
  212. console.error("Error fetching " + url);
  213. return null;
  214. }
  215. } catch (err) {
  216. return null;
  217. }
  218. };
  219. const findKeyWithProperty = function (obj, propertyToFind) {
  220. for (const key in obj) {
  221. if (obj[key] === null || obj[key] === undefined) {
  222. continue;
  223. }
  224. if (!!obj[key] && (typeof obj[key] == "object" || typeof obj[key] == "function") && obj[key].hasOwnProperty(propertyToFind)) {
  225. return key;
  226. }
  227. }
  228. // Property not found
  229. return null;
  230. };
  231. const getScrambled = () => Array.from({ length: 10 }, () => String.fromCharCode(97 + Math.floor(Math.random() * 26))).join("");
  232. const createAnonFunction = function (name, func) {
  233. const funcName = getScrambled();
  234. unsafeWindow[funcName] = func;
  235. unsafeWindow[funcName] = function () {
  236. try {
  237. return func.apply(this, arguments);
  238. } catch (error) {
  239. log("Error in anonymous function:", error);
  240. }
  241. };
  242.  
  243. F[name] = unsafeWindow[funcName];
  244. functionNames[name] = funcName;
  245. };
  246.  
  247. const injectScript = function () {
  248. createAnonFunction("retrieveFunctions", function (vars) {
  249. ss = vars;
  250. window.globalSS = ss;
  251.  
  252. F.HIDEFPS();
  253. });
  254.  
  255. createAnonFunction("HIDEFPS", function () {
  256. ss.PLAYERS.forEach((PLAYER) => {
  257. if (PLAYER.hasOwnProperty("ws")) {
  258. ss.MYPLAYER = PLAYER;
  259. }
  260. });
  261.  
  262. H.actor = findKeyWithProperty(ss.MYPLAYER, H.mesh);
  263. });
  264.  
  265. createAnonFunction('FakePing', function(original) {
  266. if (tp.ping.random) {
  267. const randomPing = Math.floor(Math.random() * (tp.ping.max - tp.ping.min + 1)) + tp.ping.min;
  268. return randomPing;
  269. } else {
  270. return Date.now() - original;
  271. }
  272. });
  273. createAnonFunction('FakeFps', function(original) {
  274. if (tp.hideFPS.hide) return '';
  275. if (tp.hideFPS.random) {
  276. const randomPing = Math.floor(Math.random() * (tp.hideFPS.max - tp.hideFPS.min + 1)) + tp.hideFPS.min;
  277. return randomPing;
  278. } else {
  279. return original;
  280. }
  281. });
  282.  
  283. let _apc = HTMLElement.prototype.appendChild;
  284.  
  285. HTMLElement.prototype.appendChild = function(node) {
  286. if (node.tagName === 'SCRIPT' && node.innerHTML && node.innerHTML.startsWith('(()=>{')) {
  287. node.innerHTML = applyScript(node.innerHTML);
  288. }
  289. return _apc.call(this, node);
  290. }
  291.  
  292. function sha256(str) {
  293. const utf8 = new TextEncoder().encode(str);
  294. const k = Uint32Array.of(
  295. 0x428a2f98,
  296. 0x71374491,
  297. 0xb5c0fbcf,
  298. 0xe9b5dba5,
  299. 0x3956c25b,
  300. 0x59f111f1,
  301. 0x923f82a4,
  302. 0xab1c5ed5,
  303. 0xd807aa98,
  304. 0x12835b01,
  305. 0x243185be,
  306. 0x550c7dc3,
  307. 0x72be5d74,
  308. 0x80deb1fe,
  309. 0x9bdc06a7,
  310. 0xc19bf174,
  311. 0xe49b69c1,
  312. 0xefbe4786,
  313. 0x0fc19dc6,
  314. 0x240ca1cc,
  315. 0x2de92c6f,
  316. 0x4a7484aa,
  317. 0x5cb0a9dc,
  318. 0x76f988da,
  319. 0x983e5152,
  320. 0xa831c66d,
  321. 0xb00327c8,
  322. 0xbf597fc7,
  323. 0xc6e00bf3,
  324. 0xd5a79147,
  325. 0x06ca6351,
  326. 0x14292967,
  327. 0x27b70a85,
  328. 0x2e1b2138,
  329. 0x4d2c6dfc,
  330. 0x53380d13,
  331. 0x650a7354,
  332. 0x766a0abb,
  333. 0x81c2c92e,
  334. 0x92722c85,
  335. 0xa2bfe8a1,
  336. 0xa81a664b,
  337. 0xc24b8b70,
  338. 0xc76c51a3,
  339. 0xd192e819,
  340. 0xd6990624,
  341. 0xf40e3585,
  342. 0x106aa070,
  343. 0x19a4c116,
  344. 0x1e376c08,
  345. 0x2748774c,
  346. 0x34b0bcb5,
  347. 0x391c0cb3,
  348. 0x4ed8aa4a,
  349. 0x5b9cca4f,
  350. 0x682e6ff3,
  351. 0x748f82ee,
  352. 0x78a5636f,
  353. 0x84c87814,
  354. 0x8cc70208,
  355. 0x90befffa,
  356. 0xa4506ceb,
  357. 0xbef9a3f7,
  358. 0xc67178f2
  359. );
  360. let h = Uint32Array.of(0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19);
  361.  
  362. const pad = new Uint8Array(((utf8.length + 9) & ~63) + 64);
  363. pad.set(utf8), (pad[utf8.length] = 0x80);
  364. new DataView(pad.buffer).setUint32(pad.length - 4, utf8.length << 3, false);
  365.  
  366. let w = new Uint32Array(64),
  367. v,
  368. i,
  369. j,
  370. a,
  371. b,
  372. c,
  373. d,
  374. e,
  375. f,
  376. g,
  377. h0,
  378. S0,
  379. S1,
  380. ch,
  381. maj,
  382. temp1,
  383. temp2;
  384. for (i = 0; i < pad.length; i += 64) {
  385. v = new DataView(pad.buffer, i, 64);
  386. for (j = 0; j < 16; j++) w[j] = v.getUint32(j << 2, false);
  387. for (; j < 64; j++)
  388. w[j] =
  389. (w[j - 16] +
  390. ((w[j - 15] >>> 7) ^ (w[j - 15] << 25) ^ (w[j - 15] >>> 18) ^ (w[j - 15] << 14) ^ (w[j - 15] >>> 3)) +
  391. w[j - 7] +
  392. ((w[j - 2] >>> 17) ^ (w[j - 2] << 15) ^ (w[j - 2] >>> 19) ^ (w[j - 2] << 13) ^ (w[j - 2] >>> 10))) >>>
  393. 0;
  394.  
  395. [a, b, c, d, e, f, g, h0] = h;
  396. for (j = 0; j < 64; j++) {
  397. S1 = ((e >>> 6) | (e << 26)) ^ ((e >>> 11) | (e << 21)) ^ ((e >>> 25) | (e << 7));
  398. ch = (e & f) ^ (~e & g);
  399. temp1 = (h0 + S1 + ch + k[j] + w[j]) >>> 0;
  400. S0 = ((a >>> 2) | (a << 30)) ^ ((a >>> 13) | (a << 19)) ^ ((a >>> 22) | (a << 10));
  401. maj = (a & b) ^ (a & c) ^ (b & c);
  402. temp2 = (S0 + maj) >>> 0;
  403. (h0 = g), (g = f), (f = e), (e = (d + temp1) >>> 0), (d = c), (c = b), (b = a), (a = (temp1 + temp2) >>> 0);
  404. }
  405. (h[0] += a), (h[1] += b), (h[2] += c), (h[3] += d), (h[4] += e), (h[5] += f), (h[6] += g), (h[7] += h0);
  406. }
  407. // console.log(str);
  408.  
  409. return h.reduce((s, x) => s + x.toString(16).padStart(8, "0"), "");
  410. }
  411.  
  412. const applyScript = function (js) {
  413. let match;
  414. let clientKeys;
  415.  
  416. let originalJS = fetchTextContent("/js/shellshock.js");
  417.  
  418. const getVardata = function (hash) {
  419. return fetchTextContent(clientKeysURL + "latest.json?v=" + Date.now());
  420. };
  421.  
  422. let hash = sha256(originalJS);
  423. // console.log(hash);
  424. let onlineClientKeys = getVardata(hash);
  425.  
  426. try {
  427. clientKeys = JSON.parse(onlineClientKeys);
  428. } catch (e) {
  429. console.error(e);
  430. }
  431.  
  432. let H = clientKeys.vars;
  433. let C = clientKeys.commCodes?.codes;
  434.  
  435. const patterns = {
  436. scope: /,this\.(..)\.position\.z=2/,
  437. ping: /(case [A-Za-z$_]+\.[A-Za-z$_]+\:[A-Za-z$_]+\=)Date\.now\(\)-([A-Za-z$_]+),/,
  438. fps: /(document\.getElementById\("FPS"\)\.innerText=)(.*?)}/,
  439. };
  440.  
  441. const scopeVar = patterns.scope.exec(js)[1];
  442. H.extra = {
  443. scope: scopeVar,
  444. ping: patterns.ping.exec(js),
  445. fps: patterns.fps.exec(js),
  446. };
  447. unsafeWindow.H = H;
  448.  
  449. let injectionString = "";
  450.  
  451. try {
  452. //SERVERSYNC
  453. match = new RegExp(`function serverSync\\(\\)\\{(.*?)\\)\\}`).exec(js);
  454. log("SERVERSYNC:", match);
  455. H.SERVERSYNC = match ? match[1].replace(/[a-zA-Z$_\.\[\]]+shots/, 0) + ")" : "function(){log('no serversync womp womp')}";
  456. //PAUSE
  457. match = new RegExp(`,setTimeout\\(\\(\\(\\)=>\\{([=A-z0-9\\(\\),\\{ \\.;!\\|\\?:\\}]+send\\([a-zA-Z$_]+\\))`).exec(js);
  458. log("PAUSE:", match);
  459. H.PAUSE = match ? `function(){${match[1]}}` : "function(){log('no pause womp womp')}";
  460.  
  461. const variableNameRegex = /^[a-zA-Z0-9_$\[\]"\\\.,]*$/;
  462. console.log(H);
  463. for (let name in H) {
  464. let deobf = H[name];
  465. if (name == "SERVERSYNC" || name == "PAUSE" || variableNameRegex.test(deobf)) {
  466. //serversync should only be defined just before...
  467. injectionString = `${injectionString}${name}: (() => { let variable = "value_undefined"; try { eval("variable = ${deobf};"); } catch (error) { return "value_undefined"; }; return variable; })(),`;
  468. } else {
  469. }
  470. }
  471. console.log(injectionString);
  472.  
  473. log("%cSTATEFARM INJECTION STAGE 1: GATHER VARS", "color: yellow; font-weight: bold; font-size: 1.2em; text-decoration: underline;");
  474.  
  475. const modifyJS = function (find, replace) {
  476. let oldJS = js;
  477. try {
  478. js = js.originalReplaceAll(find, replace);
  479. } catch (err) {
  480. console.log(
  481. "%cReplacement failed! Likely a required var was not found. Attempted to replace " + find + " with: " + replace,
  482. "color: red; font-weight: bold; font-size: 0.6em; text-decoration: italic;"
  483. );
  484. }
  485. if (oldJS !== js) {
  486. console.log(
  487. "%cReplacement successful! Injected code: replaced: " + find + " with: " + replace,
  488. "color: green; font-weight: bold; font-size: 0.6em; text-decoration: italic;"
  489. );
  490. } else {
  491. console.log(
  492. "%cReplacement failed! Attempted to replace " + find + " with: " + replace,
  493. "color: red; font-weight: bold; font-size: 0.6em; text-decoration: italic;"
  494. );
  495. }
  496. };
  497.  
  498. const f = function (varName) {
  499. return varName.replace("$", "\\$");
  500. };
  501. const FUNCTIONPARAM = new RegExp("function " + f(H._connectFail) + "\\(([a-zA-Z$_]+)\\)").exec(js)[1];
  502. modifyJS(
  503. f(H.SCENE) + "." + f(H.render),
  504. `window["${functionNames.retrieveFunctions}"]({${injectionString}},true)||${f(H.SCENE)}.render`
  505. );
  506. modifyJS(H.extra.ping[0],
  507. `${H.extra.ping[1]}window.${functionNames.FakePing}(${H.extra.ping[2]}),`
  508. );
  509. modifyJS(H.extra.fps[0],
  510. `${H.extra.fps[1]}window.${functionNames.FakeFps}(${H.extra.fps[2]})}`
  511. )
  512.  
  513.  
  514.  
  515. log(H, "last");
  516. return js;
  517. } catch (e) {
  518. console.log(e);
  519. }
  520. };
  521. };
  522. // injectScript();
  523. startUp();
  524.  
  525. const Tweakpane = window.Tweakpane;
  526. const pane = new Tweakpane.Pane({
  527. title: "Hide FPS",
  528. expanded: true,
  529. });
  530. const paneEl = document.querySelector("div.tp-dfwv");
  531. paneEl.style.zIndex = 1000;
  532. paneEl.style.width = "300px";
  533.  
  534. function createFolders(NFolder) {
  535. let test = pane.addFolder({
  536. title: NFolder,
  537. expanded: false,
  538. });
  539. return test;
  540. }
  541.  
  542. const fpsFolder = createFolders("FPS Settings");
  543. const pingFolder = createFolders("Ping Settings");
  544.  
  545. function createInput(folder, obj, property, options, callback) {
  546. folder.addInput(obj, property, options).on("change", callback);
  547. }
  548.  
  549. makeDraggable(document.querySelector(".tp-dfwv"));
  550.  
  551. createInput(fpsFolder, tp.hideFPS, "hide", { label: "Hide FPS" }, (value) => {
  552. localStorage.setItem("tp-hideFPS", JSON.stringify(value.value));
  553. });
  554. createInput(fpsFolder, tp.hideFPS, "random", { label: "Randomise FPS" }, (value) => {
  555. localStorage.setItem("tp-randomFPS", JSON.stringify(value.value));
  556. });
  557. createInput(fpsFolder, tp.hideFPS, "min", { label: "Min FPS", view: "slider", min: 1, max: 999, step: 1 }, (value) => {
  558. localStorage.setItem("tp-minFPS", JSON.stringify(value.value));
  559. });
  560. createInput(fpsFolder, tp.hideFPS, "max", { label: "Max FPS", view: "slider", min: 1, max: 999, step: 1 }, (value) => {
  561. localStorage.setItem("tp-maxFPS", JSON.stringify(value.value));
  562. });
  563.  
  564. createInput(pingFolder, tp.ping, "min", { label: "Min Ping", view: "slider", min: 1, max: 999, step: 1 }, (value) => {
  565. localStorage.setItem("tp-minPing", JSON.stringify(value.value));
  566. });
  567. createInput(pingFolder, tp.ping, "max", { label: "Max Ping", view: "slider", min: 1, max: 999, step: 1 }, (value) => {
  568. localStorage.setItem("tp-maxPing", JSON.stringify(value.value));
  569. });
  570. createInput(pingFolder, tp.ping, "random", { label: "Randomise Ping" }, (value) => {
  571. localStorage.setItem("tp-randomPing", JSON.stringify(value.value));
  572. });
  573.  
  574.  
  575. document.addEventListener("keydown", (e) => {
  576. if (e.key === "h") {
  577. const element = document.querySelector(".tp-dfwv");
  578. element.style.display = element.style.display === "none" ? "block" : "none";
  579. }
  580. });
  581. })();