Shell Shockers | Ad Blocker

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

  1. // ==UserScript==
  2. // @name Shell Shockers | Ad Blocker
  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 2.6
  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://greasyfork.org/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://raw.githubusercontent.com/StateFarmNetwork/client-keys/refs/heads/main/statefarm_`;
  109. let ss;
  110. let F = [];
  111. let H = {};
  112. let functionNames = [];
  113. let keyRetrieved = false;
  114.  
  115. const startUp = function () {
  116. console.log("startup");
  117. injectScript();
  118. console.log("after startup");
  119. };
  120.  
  121. let originalReplace = String.prototype.replace;
  122. let originalReplaceAll = String.prototype.replaceAll;
  123.  
  124. String.prototype.originalReplace = function () {
  125. return originalReplace.apply(this, arguments);
  126. };
  127. String.prototype.originalReplaceAll = function () {
  128. return originalReplaceAll.apply(this, arguments);
  129. };
  130.  
  131. const log = function (...args) {
  132. let condition;
  133. try {
  134. condition = false;
  135. } catch (error) {
  136. condition = GM_getValue(storageKey + "DisableLogs");
  137. }
  138. if (!condition) {
  139. console.log(...args);
  140. }
  141. };
  142.  
  143. const fetchTextContent = function (url) {
  144. try {
  145. var xhr = new XMLHttpRequest();
  146. xhr.open("GET", url, false);
  147. xhr.send();
  148. if (xhr.status === 200) {
  149. return xhr.responseText;
  150. } else {
  151. console.error("Error fetching " + url);
  152. return null;
  153. }
  154. } catch (err) {
  155. return null;
  156. }
  157. };
  158. const findKeyWithProperty = function (obj, propertyToFind) {
  159. for (const key in obj) {
  160. if (obj[key] === null || obj[key] === undefined) {
  161. continue;
  162. }
  163. if (!!obj[key] && (typeof obj[key] == "object" || typeof obj[key] == "function") && obj[key].hasOwnProperty(propertyToFind)) {
  164. return key;
  165. }
  166. }
  167. // Property not found
  168. return null;
  169. };
  170. const getScrambled = () => Array.from({ length: 10 }, () => String.fromCharCode(97 + Math.floor(Math.random() * 26))).join("");
  171. const createAnonFunction = function (name, func) {
  172. const funcName = getScrambled();
  173. unsafeWindow[funcName] = func;
  174. unsafeWindow[funcName] = function () {
  175. try {
  176. return func.apply(this, arguments);
  177. } catch (error) {
  178. log("Error in anonymous function:", error);
  179. }
  180. };
  181.  
  182. F[name] = unsafeWindow[funcName];
  183. functionNames[name] = funcName;
  184. };
  185.  
  186. const injectScript = function () {
  187. createAnonFunction("retrieveFunctions", function (vars) {
  188. // console.log(vars)
  189. ss = vars;
  190. unsafeWindow.globalSS = vars;
  191. // console.log("lmao");
  192.  
  193. F.customSounds();
  194. });
  195.  
  196. createAnonFunction("customSounds", function () {
  197. unsafeWindow.globalSS.PLAYERS.forEach((PLAYER) => {
  198. let H = unsafeWindow.H;
  199. if (PLAYER.hasOwnProperty("ws")) {
  200. unsafeWindow.globalSS.MYPLAYER = PLAYER;
  201. }
  202. });
  203.  
  204. H.actor = findKeyWithProperty(unsafeWindow.globalSS.MYPLAYER, H.mesh);
  205. });
  206. createAnonFunction("adBlocker", function (input) {
  207. try {
  208. if (input == 10 && false) {
  209. return 1;
  210. } else if (true) {
  211. if (typeof input == "boolean") {
  212. return true;
  213. } else if (input == 10) {
  214. return 5;
  215. } else if (input == "adsBlocked") {
  216. return false;
  217. }
  218. }
  219. return input;
  220. } catch (error) {
  221. return true;
  222. }
  223. });
  224.  
  225. let _apc = HTMLElement.prototype.appendChild;
  226. let shellshock_og = null;
  227.  
  228. HTMLElement.prototype.appendChild = function (node) {
  229. if (node.tagName === "SCRIPT" && node.innerHTML && node.innerHTML.startsWith("(()=>{")) {
  230. shellshock_og = node.innerHTML;
  231. node.innerHTML = applyScript(node.innerHTML);
  232. }
  233. return _apc.call(this, node);
  234. };
  235.  
  236. const proto = unsafeWindow.HTMLScriptElement.prototype;
  237. const existing = Object.getOwnPropertyDescriptor(proto, "textContent");
  238.  
  239. const original = existing || Object.getOwnPropertyDescriptor(unsafeWindow.Node.prototype, "textContent");
  240.  
  241. Object.defineProperty(proto, "textContent", {
  242. get: function () {
  243. // if (this === unsafeWindow.document.currentScript) {
  244. // prompt("[Hook] document.currentScript.textContent accessed");
  245. // debugger; // <-- triggers breakpoint
  246. // };
  247. let textContent = original.get.call(this);
  248. if (textContent && textContent.startsWith("(()=>{")) {
  249. return shellshock_og;
  250. } else {
  251. return textContent;
  252. }
  253. },
  254. set: original.set,
  255. configurable: true,
  256. enumerable: true,
  257. });
  258.  
  259. function sha256(str) {
  260. const utf8 = new TextEncoder().encode(str);
  261. const k = Uint32Array.of(
  262. 0x428a2f98,
  263. 0x71374491,
  264. 0xb5c0fbcf,
  265. 0xe9b5dba5,
  266. 0x3956c25b,
  267. 0x59f111f1,
  268. 0x923f82a4,
  269. 0xab1c5ed5,
  270. 0xd807aa98,
  271. 0x12835b01,
  272. 0x243185be,
  273. 0x550c7dc3,
  274. 0x72be5d74,
  275. 0x80deb1fe,
  276. 0x9bdc06a7,
  277. 0xc19bf174,
  278. 0xe49b69c1,
  279. 0xefbe4786,
  280. 0x0fc19dc6,
  281. 0x240ca1cc,
  282. 0x2de92c6f,
  283. 0x4a7484aa,
  284. 0x5cb0a9dc,
  285. 0x76f988da,
  286. 0x983e5152,
  287. 0xa831c66d,
  288. 0xb00327c8,
  289. 0xbf597fc7,
  290. 0xc6e00bf3,
  291. 0xd5a79147,
  292. 0x06ca6351,
  293. 0x14292967,
  294. 0x27b70a85,
  295. 0x2e1b2138,
  296. 0x4d2c6dfc,
  297. 0x53380d13,
  298. 0x650a7354,
  299. 0x766a0abb,
  300. 0x81c2c92e,
  301. 0x92722c85,
  302. 0xa2bfe8a1,
  303. 0xa81a664b,
  304. 0xc24b8b70,
  305. 0xc76c51a3,
  306. 0xd192e819,
  307. 0xd6990624,
  308. 0xf40e3585,
  309. 0x106aa070,
  310. 0x19a4c116,
  311. 0x1e376c08,
  312. 0x2748774c,
  313. 0x34b0bcb5,
  314. 0x391c0cb3,
  315. 0x4ed8aa4a,
  316. 0x5b9cca4f,
  317. 0x682e6ff3,
  318. 0x748f82ee,
  319. 0x78a5636f,
  320. 0x84c87814,
  321. 0x8cc70208,
  322. 0x90befffa,
  323. 0xa4506ceb,
  324. 0xbef9a3f7,
  325. 0xc67178f2
  326. );
  327. let h = Uint32Array.of(0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19);
  328.  
  329. const pad = new Uint8Array(((utf8.length + 9) & ~63) + 64);
  330. pad.set(utf8), (pad[utf8.length] = 0x80);
  331. new DataView(pad.buffer).setUint32(pad.length - 4, utf8.length << 3, false);
  332.  
  333. let w = new Uint32Array(64),
  334. v,
  335. i,
  336. j,
  337. a,
  338. b,
  339. c,
  340. d,
  341. e,
  342. f,
  343. g,
  344. h0,
  345. S0,
  346. S1,
  347. ch,
  348. maj,
  349. temp1,
  350. temp2;
  351. for (i = 0; i < pad.length; i += 64) {
  352. v = new DataView(pad.buffer, i, 64);
  353. for (j = 0; j < 16; j++) w[j] = v.getUint32(j << 2, false);
  354. for (; j < 64; j++)
  355. w[j] =
  356. (w[j - 16] +
  357. ((w[j - 15] >>> 7) ^ (w[j - 15] << 25) ^ (w[j - 15] >>> 18) ^ (w[j - 15] << 14) ^ (w[j - 15] >>> 3)) +
  358. w[j - 7] +
  359. ((w[j - 2] >>> 17) ^ (w[j - 2] << 15) ^ (w[j - 2] >>> 19) ^ (w[j - 2] << 13) ^ (w[j - 2] >>> 10))) >>>
  360. 0;
  361.  
  362. [a, b, c, d, e, f, g, h0] = h;
  363. for (j = 0; j < 64; j++) {
  364. S1 = ((e >>> 6) | (e << 26)) ^ ((e >>> 11) | (e << 21)) ^ ((e >>> 25) | (e << 7));
  365. ch = (e & f) ^ (~e & g);
  366. temp1 = (h0 + S1 + ch + k[j] + w[j]) >>> 0;
  367. S0 = ((a >>> 2) | (a << 30)) ^ ((a >>> 13) | (a << 19)) ^ ((a >>> 22) | (a << 10));
  368. maj = (a & b) ^ (a & c) ^ (b & c);
  369. temp2 = (S0 + maj) >>> 0;
  370. (h0 = g), (g = f), (f = e), (e = (d + temp1) >>> 0), (d = c), (c = b), (b = a), (a = (temp1 + temp2) >>> 0);
  371. }
  372. (h[0] += a), (h[1] += b), (h[2] += c), (h[3] += d), (h[4] += e), (h[5] += f), (h[6] += g), (h[7] += h0);
  373. }
  374. // console.log(str);
  375.  
  376. return h.reduce((s, x) => s + x.toString(16).padStart(8, "0"), "");
  377. }
  378.  
  379. const applyScript = function (js) {
  380. let match;
  381. let clientKeys;
  382.  
  383. let originalJS = fetchTextContent("/js/shellshock.js");
  384.  
  385. const getVardata = function (hash) {
  386. return fetchTextContent(clientKeysURL + "latest.json?v=" + Date.now());
  387. };
  388.  
  389. let hash = sha256(originalJS);
  390. // console.log(hash);
  391. let onlineClientKeys = getVardata(hash);
  392.  
  393. try {
  394. clientKeys = JSON.parse(onlineClientKeys);
  395. } catch (e) {
  396. console.error(e);
  397. }
  398.  
  399. let H = clientKeys.vars;
  400. let C = clientKeys.commCodes?.codes;
  401.  
  402. const patterns = {
  403. scope: /,this\.(..)\.position\.z=2/,
  404. };
  405.  
  406. const scopeVar = patterns.scope.exec(js)[1];
  407. H.extra = {
  408. scope: scopeVar,
  409. };
  410. unsafeWindow.H = H;
  411.  
  412. let injectionString = "";
  413.  
  414. try {
  415. //SERVERSYNC
  416. match = new RegExp(`function serverSync\\(\\)\\{(.*?)\\)\\}`).exec(js);
  417. log("SERVERSYNC:", match);
  418. H.SERVERSYNC = match ? match[1].replace(/[a-zA-Z$_\.\[\]]+shots/, 0) + ")" : "function(){log('no serversync womp womp')}";
  419. //PAUSE
  420. match = new RegExp(`,setTimeout\\(\\(\\(\\)=>\\{([=A-z0-9\\(\\),\\{ \\.;!\\|\\?:\\}]+send\\([a-zA-Z$_]+\\))`).exec(js);
  421. log("PAUSE:", match);
  422. H.PAUSE = match ? `function(){${match[1]}}` : "function(){log('no pause womp womp')}";
  423.  
  424. const variableNameRegex = /^[a-zA-Z0-9_$\[\]"\\\.,]*$/;
  425. console.log(H);
  426. for (let name in H) {
  427. let deobf = H[name];
  428. if (name == "SERVERSYNC" || name == "PAUSE" || variableNameRegex.test(deobf)) {
  429. //serversync should only be defined just before...
  430. injectionString = `${injectionString}${name}: (() => { let variable = "value_undefined"; try { eval("variable = ${deobf};"); } catch (error) { return "value_undefined"; }; return variable; })(),`;
  431. } else {
  432. }
  433. }
  434. console.log(injectionString);
  435.  
  436. log("%cSTATEFARM INJECTION STAGE 1: GATHER VARS", "color: yellow; font-weight: bold; font-size: 1.2em; text-decoration: underline;");
  437.  
  438. const modifyJS = function (find, replace) {
  439. let oldJS = js;
  440. try {
  441. js = js.originalReplaceAll(find, replace);
  442. } catch (err) {
  443. console.log(
  444. "%cReplacement failed! Likely a required var was not found. Attempted to replace " + find + " with: " + replace,
  445. "color: red; font-weight: bold; font-size: 0.6em; text-decoration: italic;"
  446. );
  447. }
  448. if (oldJS !== js) {
  449. console.log(
  450. "%cReplacement successful! Injected code: replaced: " + find + " with: " + replace,
  451. "color: green; font-weight: bold; font-size: 0.6em; text-decoration: italic;"
  452. );
  453. } else {
  454. console.log(
  455. "%cReplacement failed! Attempted to replace " + find + " with: " + replace,
  456. "color: red; font-weight: bold; font-size: 0.6em; text-decoration: italic;"
  457. );
  458. }
  459. };
  460.  
  461. const f = function (varName) {
  462. return varName.replace("$", "\\$");
  463. };
  464. const FUNCTIONPARAM = new RegExp("function " + f(H._connectFail) + "\\(([a-zA-Z$_]+)\\)").exec(js)[1];
  465. modifyJS(
  466. f(H.SCENE) + "." + f(H.render),
  467. `window["${functionNames.retrieveFunctions}"]({${injectionString}},true)||${f(H.SCENE)}.render`
  468. );
  469.  
  470. modifyJS("adsBlocked=" + FUNCTIONPARAM, "adsBlocked=" + functionNames.adBlocker + '("adsBlocked")');
  471. modifyJS('"user-has-adblock"', functionNames.adBlocker + '("user-has-adblock")');
  472. modifyJS("layed=!1", "layed=window." + functionNames.adBlocker + "(!1)");
  473. modifyJS("showAdBlockerVideo", "hideAdBlockerVideo"); //hello eggs bullshit
  474. modifyJS(H.USERDATA + ".playerAccount.isUpgraded()", functionNames.adBlocker + "(" + f(H.USERDATA) + ".playerAccount.isUpgraded())");
  475.  
  476. log(H, "last");
  477. return js;
  478. } catch (e) {
  479. console.log(e);
  480. }
  481. };
  482. };
  483. // injectScript();
  484. startUp();
  485. })();