Greasy Fork is available in English.

ShellShockers Aimbot and ESP

yes

  1. // ==UserScript==
  2. // @name ShellShockers Aimbot and ESP
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.1
  5. // @description yes
  6. // @author PacyTense
  7. // @match *://shellshock.io/*
  8. // @run-at document-start
  9. // @grant none
  10. // @noframes
  11. // ==/UserScript==
  12.  
  13.  
  14.  
  15.  
  16. window.settings = {
  17. blueTeam: "#4254f5",
  18. redTeam: "#eb3326",
  19. orangeTeam: "#fca503",
  20. aimbotKey: "ShiftLeft",
  21. angleOrDistance: true,
  22. aimbotSmoothness: 2,
  23. maxAngle: 3,
  24. fov: 1.25,
  25. }
  26.  
  27.  
  28. window.aimbotToggled = false;
  29.  
  30. window.addEventListener('keydown', function(e){
  31. if(e.code == window.settings.aimbotKey){
  32. window.aimbotToggled = true;
  33. }
  34.  
  35. })
  36.  
  37. window.addEventListener('keyup', function(e){
  38. if(e.code == window.settings.aimbotKey){
  39. window.aimbotToggled = false;
  40. }
  41.  
  42. })
  43.  
  44. window.dist3d = (player1, player2)=>{return Math.sqrt((player1.x-player2.x)**2 + (player1.y-player2.y)**2 + (player1.z-player2.z)**2)};
  45.  
  46. window.angleDistance =(player1, player2)=>{
  47.  
  48.  
  49. let angle = window.getAngle(player1, player2);
  50.  
  51. const angleDist = Math.sqrt((player1.yaw - angle.yaw)**2 + (player1.pitch - angle.pitch)**2);
  52. return angleDist*window.dist3d(player1, player2);
  53.  
  54. }
  55.  
  56.  
  57. window.getNearestPlayer = function(us, enemies){
  58.  
  59. let nearestPlayer = {distance: null, player: null} //we leave it empty to start
  60.  
  61. enemies.forEach(them=>{
  62.  
  63. if(them){ //sometimes a glitched player slips thorugh, so lets make sure they are valid before we do anything
  64.  
  65. if(them.id != us.id){ //our own player is in here, so lets make sure to filter it out
  66.  
  67. if(them.hp > 0 && them.playing && (!us.team || (us.team != them.team)) && window.visiblePlayers[them.id]){
  68. //firstly lets make sure they arent dead hp > 0, then make sure they are playing and not spectating
  69. //then lets check if our team is equal to their team
  70. //one thing to note, in FFA both our teams are 0, so it would never run cause it would think we are on their team
  71. //so what we do is if(us.team) will return false for team = 0 and true for team != 0
  72. // so it is effectivly if our team is 0 (FFA) or our team isnt equal to their team```
  73.  
  74. let distance = 999;
  75. if(window.settings.angleOrDistance){
  76. distance = window.angleDistance(us,them) || 0;
  77. }else{
  78. distance = window.dist3d(us,them) || 0;
  79. }
  80. if( !nearestPlayer.distance || distance < nearestPlayer.distance ){
  81. nearestPlayer.distance = distance;
  82. nearestPlayer.player = them;
  83. }
  84. }
  85. }
  86. }
  87. })
  88. if(nearestPlayer.player){
  89. return nearestPlayer;
  90. }
  91. return null;
  92. }
  93.  
  94. window.calcAngle = function(us, them, dist){
  95. let delta = {x: them.x - us.x + 2*(them.dx * dist / us.weapon.subClass.velocity),
  96. y: them.y-us.y - 0.072,
  97. z: them.z - us.z + 2*(them.dz * dist / us.weapon.subClass.velocity)
  98. };
  99.  
  100. delta = new BABYLON.Vector3(delta.x, delta.y, delta.z).normalize();
  101. const newYaw = Math.radRange(-Math.atan2(delta.z, delta.x) + Math.PI / 2)
  102.  
  103. const newPitch = Math.clamp(-Math.asin(delta.y), -1.5, 1.5);
  104.  
  105.  
  106.  
  107. us.pitch += ((newPitch || 0)-us.pitch)/window.settings.aimbotSmoothness;
  108. us.yaw += ((newYaw || 0)-us.yaw)/window.settings.aimbotSmoothness;
  109.  
  110.  
  111. return 0;
  112. }
  113.  
  114. window.getAngle = function(us, them){
  115. let delta = {x: them.x - us.x ,
  116. y: them.y-us.y - 0.072,
  117. z: them.z - us.z,
  118. };
  119.  
  120. delta = new BABYLON.Vector3(delta.x, delta.y, delta.z).normalize();
  121. const newYaw = Math.radRange(-Math.atan2(delta.z, delta.x) + Math.PI / 2)
  122.  
  123. const newPitch = Math.clamp(-Math.asin(delta.y), -1.5, 1.5);
  124.  
  125.  
  126. return {pitch: newPitch || 0, yaw: newYaw || 0};
  127. }
  128.  
  129.  
  130.  
  131. //aimbot function
  132. window.otherPlayer;
  133. window.myPlayer;
  134.  
  135. window.espColourSettings = function(that){
  136. if(that.player.team==1){
  137. that.bodyMesh.overlayColor = hexToRgb(window.settings.blueTeam);
  138. }else if(that.player.team==2){
  139. that.bodyMesh.overlayColor = hexToRgb(window.settings.redTeam);
  140. }else{
  141. that.bodyMesh.overlayColor = hexToRgb(window.settings.orangeTeam);
  142. }
  143. that.bodyMesh.setRenderingGroupId(1);
  144. }
  145.  
  146. window.doAimbot = (ourPlayer,otherPlayers)=>{
  147.  
  148. if(!window.aimbotToggled){return};
  149. if(!window.myPlayer){
  150. otherPlayers.forEach(player=>{
  151. if(player){
  152. if(player.ws){
  153. window.myPlayer = player;
  154. }}
  155. })
  156. };
  157. //loop through other palyers
  158. let nearest = window.getNearestPlayer(ourPlayer, otherPlayers);
  159. if(nearest){
  160. //console.log(nearest.name);
  161. calcAngle(window.myPlayer, nearest.player, nearest.distance)
  162. }
  163.  
  164. };
  165. window.visiblePlayers = {};
  166.  
  167.  
  168. //The game Does hack check, where if a hack is detected, it sets ur uuid to 255 which stiops u from doing damage
  169. //what we do here is redefine the varaible to always return 0 so they can never flag us hehehe
  170. Object.defineProperty(window, "uuid", {get: ()=>{return 0}});
  171.  
  172.  
  173. //stuff from here on is code used to extract code from the games code, trippy right?
  174. const request = url => fetch(url).then(res => res.text());
  175. const injectInline = (data) => {
  176. let s = document.createElement('script');
  177. s.type = 'text/javascript';
  178. s.innerText = data;
  179. document.getElementsByTagName('head')[0].appendChild(s);
  180. }
  181.  
  182.  
  183. window.hexToRgb =(hex)=>{
  184. var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
  185. return result ? {
  186. r: parseInt(result[1], 16)/255,
  187. g: parseInt(result[2], 16)/255,
  188. b: parseInt(result[3], 16)/255,
  189. a: 1,
  190. } : null;
  191. }
  192.  
  193. const attemptPatch = (source) => {
  194. const patches = new Map()
  195.  
  196.  
  197. //we get a copy of theg games code, and search for specific location. We found our player stuff and then call our external function where we can run our aimbot logic!
  198. .set("RENDERHOOK", [/var (\w+)=([a-zA-Z$]+)\(this\.mesh,\.(\d+)\);/, "rep = `var ${match[1]} = ${match[2]}(this.mesh,.31);window.visiblePlayers[this.player.id]=${match[1]};${match[1]}=true;this.bodyMesh.renderOverlay = !0;window.espColourSettings(this);`", true])
  199. .set("PLAYERHOOK", [/if\([^(\/.,)]+\)([^(\/.,)]+)\.actor\.update\([^(\/.,)]+\);/, false])
  200. .set("ENEMYHOOK", [/var [^(\/.,=]+\=([^(\/.,\[\]]+)\[[^(\/.,\[\]]\];[^(\/.,=&]+\&\&\([^(\/.,=]+\.chatLineCap/, false])
  201. .set("AIMBOTHOOK", [/[^(\/.,]+\([^(\/.,]+,[^(\/.,]+\/\d+\),[^(\/.,]+\.runRenderLoop\(\(function\(\)\{/, "rep = `${match[0]}window.doAimbot(${variables.PLAYERHOOK[1]}, ${variables.ENEMYHOOK[1]});`", true])
  202.  
  203. variables = {};
  204.  
  205. for (const [name, item] of patches) {
  206. let match = source.match(item[0]);
  207.  
  208. if(!item[1]){
  209. if(match){
  210. variables[name] = match;
  211. }else{
  212. alert(`Failed to variable ${name}`);
  213. continue;
  214. }
  215. }else{
  216. let rep;
  217. try{
  218. eval(item[1]);
  219. }catch(e){
  220. alert(`Failed to patch ${name}`);
  221. continue;
  222. }
  223. console.log(rep);
  224.  
  225. const patched = source.replace(item[0], rep);
  226. if (source === patched) {
  227. alert(`Failed to patch ${name}`);
  228. continue;
  229. } else console.log("Successfully patched ", name);
  230. source = patched;
  231. }
  232. }
  233.  
  234. return source;
  235. }
  236.  
  237. (async function() {
  238. let script = await request(`https://shellshock.io/src/shellshock.min.js`);
  239. console.log(script);
  240. injectInline(attemptPatch(script)) //modify the games code and then apply it :))
  241. })();
  242.  
  243.  
  244.  
  245. //using a mutation observer oooohhh fancy ik! we can detect scripts before they run and patch them.
  246. let observer = new MutationObserver(mutations => {
  247.  
  248. for (const mutation of mutations) {
  249.  
  250. for (let node of mutation.addedNodes) {
  251.  
  252. if (node.tagName == 'HEAD') {
  253. } else if (node.tagName == 'SCRIPT' && node.src.includes("shellshock.min.js")) {
  254. node.outerHTML = ``
  255. //or we can make it point towards our own custom JS file...
  256. //node.src = "https://ourFileLocation/code.js"
  257. }
  258. }
  259. }
  260. });
  261.  
  262. observer.observe(document, {
  263. childList: true,
  264. subtree: true
  265. })