survev.io auto hack

try to take over the world!

  1. // ==UserScript==
  2. // @name survev.io auto hack
  3. // @namespace http://tampermonkey.net/
  4. // @version 2024-12-20
  5. // @description try to take over the world!
  6. // @author You
  7. // @match https://survev.io/*/*
  8. // @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
  9. // @grant none
  10. // ==/UserScript==
  11.  
  12. (function() {
  13. 'use strict';
  14. let espEnabled = true;
  15. let aimbotEnabled = true;
  16. let xrayEnabled = true;
  17. Object.defineProperty( Object.prototype, 'textureCacheIds', {
  18. set( value ) {
  19. this._textureCacheIds = value;
  20. if ( Array.isArray( value ) ) {
  21. const scope = this;
  22. value.push = new Proxy( value.push, {
  23. apply( target, thisArgs, args ) {
  24. if ( args[ 0 ].indexOf( 'ceiling' ) > - 1 ) {
  25. Object.defineProperty( scope, 'valid', {
  26. set( value ) {
  27. this._valid = value;
  28. },
  29. get() {
  30. return xrayEnabled ? false : this._valid;
  31. }
  32. } );
  33. }
  34. return Reflect.apply( ...arguments );
  35. }
  36. } );
  37. }
  38. },
  39. get() {
  40. return this._textureCacheIds;
  41. }
  42. } );
  43. const params = {
  44. get() {
  45. console.log( 'getting ctx', this );
  46. return null;
  47. }
  48. };
  49. Object.defineProperty( window, 'WebGLRenderingContext', params );
  50. Object.defineProperty( window, 'WebGL2RenderingContext', params );
  51. let ctx;
  52. HTMLCanvasElement.prototype.getContext = new Proxy( HTMLCanvasElement.prototype.getContext, {
  53. apply( target, thisArgs, args ) {
  54. const result = Reflect.apply( ...arguments );
  55. if ( thisArgs.parentNode ) {
  56. ctx = result;
  57. }
  58. return result;
  59. }
  60. } );
  61. const players = [];
  62. let radius;
  63. let mouseX = 0, mouseY = 0;
  64. window.addEventListener( 'mousemove', function ( event ) {
  65. if ( event.dispatchedByMe !== true ) {
  66. mouseX = event.clientX;
  67. mouseY = event.clientY;
  68. }
  69. } );
  70. window.addEventListener( 'keyup', function ( event ) {
  71. switch ( String.fromCharCode( event.keyCode ) ) {
  72. case 'N' : espEnabled = ! espEnabled; break;
  73. case 'B' : aimbotEnabled = ! aimbotEnabled; break;
  74. case 'H' : xrayEnabled = ! xrayEnabled; break;
  75. }
  76. } );
  77. const Context2D = CanvasRenderingContext2D.prototype;
  78. Context2D.drawImage = new Proxy( Context2D.drawImage, {
  79. apply( target, thisArgs, args ) {
  80. if ( aimbotEnabled && args[ 0 ].src && args[ 0 ].src.indexOf( 'loadout' ) > - 1 && args[ 8 ] === 142 ) {
  81. const { a, b, e, f } = thisArgs.getTransform();
  82. radius = Math.hypot( a, b ) * args[ 8 ] + 10;
  83. const centerX = thisArgs.canvas.width / 2;
  84. const centerY = thisArgs.canvas.height / 2;
  85. if ( e !== centerX && f !== centerY ) {
  86. players.push( { x: e, y: f } );
  87. }
  88. }
  89. return Reflect.apply( ...arguments );
  90. }
  91. } );
  92. window.requestAnimationFrame = new Proxy( window.requestAnimationFrame, {
  93. apply( target, thisArgs, args ) {
  94. args[ 0 ] = new Proxy( args[ 0 ], {
  95. apply( target, thisArgs, args ) {
  96. players.length = 0;
  97. Reflect.apply( ...arguments );
  98. ctx.fillStyle = '#fff';
  99. const array = [
  100. [ '[B] Aimbot', aimbotEnabled ],
  101. [ '[N] ESP', espEnabled ],
  102. [ '[H] X-Ray', xrayEnabled ]
  103. ];
  104. const fontSize = 20;
  105. ctx.textAlign = 'center';
  106. ctx.textBaseline = 'top';
  107. ctx.font = 'bolder ' + fontSize + 'px monospace';
  108. for ( let i = 0; i < array.length; i ++ ) {
  109. const [ text, status ] = array[ i ];
  110. ctx.globalAlpha = status ? 1 : 0.5;
  111. ctx.fillText( text + ': ' + ( status ? 'ON' : 'OFF' ), ctx.canvas.width / 2, 10 + i * fontSize );
  112. }
  113. ctx.globalAlpha = 1;
  114. if ( players.length === 0 ) {
  115. return;
  116. }
  117. ctx.lineWidth = 5;
  118. ctx.strokeStyle = 'red';
  119. if ( espEnabled ) {
  120. const centerX = ctx.canvas.width / 2;
  121. const centerY = ctx.canvas.height / 2;
  122. ctx.beginPath();
  123. for ( let i = 0; i < players.length; i ++ ) {
  124. const player = players[ i ];
  125. ctx.moveTo( centerX, centerY );
  126. ctx.lineTo( player.x, player.y );
  127. }
  128. ctx.stroke();
  129. }
  130. if ( aimbotEnabled ) {
  131. let minDistance = Infinity;
  132. let targetPlayer;
  133. for ( let i = 0; i < players.length; i ++ ) {
  134. const player = players[ i ];
  135. const distance = Math.hypot( player.x - mouseX, player.y - mouseY );
  136. if ( distance < minDistance ) {
  137. minDistance = distance;
  138. targetPlayer = player;
  139. }
  140. }
  141. ctx.beginPath();
  142. ctx.arc( targetPlayer.x, targetPlayer.y, radius, 0, Math.PI * 2 );
  143. ctx.stroke();
  144. window.dispatchEvent( new MouseEvent( 'mousemove', {
  145. clientX: targetPlayer.x,
  146. clientY: targetPlayer.y,
  147. dispatchedByMe: true
  148. } ) );
  149. }
  150. }
  151. } );
  152. return Reflect.apply( ...arguments );
  153. }
  154. } );
  155. window.addEventListener( 'DOMContentLoaded', function () {
  156. const value = parseInt( new URLSearchParams( window.location.search ).get( 'showAd' ), 16 );
  157. const shouldShowAd = isNaN( value ) || Date.now() - value < 0 || Date.now() - value > 10 * 60 * 1000;
  158. const el = document.createElement( 'div' );
  159. el.innerHTML = `<style>
  160. .my-dialog {
  161. position: absolute;
  162. left: 50%;
  163. top: 50%;
  164. padding: 20px;
  165. background: rgba(0, 0, 0, 0.9);
  166. box-shadow: 0 0 0 1000vw rgba(0, 0, 0, 0.5);
  167. border-radius: 5px;
  168. color: #fff;
  169. transform: translate(-50%, -50%);
  170. text-align: center;
  171. z-index: 999999;
  172. }
  173. .my-dialog * {
  174. color: #fff;
  175. }
  176. .my-close {
  177. position: absolute;
  178. right: 5px;
  179. top: 5px;
  180. width: 20px;
  181. height: 20px;
  182. opacity: 0.5;
  183. cursor: pointer;
  184. }
  185. .my-close:before, .my-close:after {
  186. content: ' ';
  187. position: absolute;
  188. left: 50%;
  189. top: 50%;
  190. width: 100%;
  191. height: 20%;
  192. transform: translate(-50%, -50%) rotate(-45deg);
  193. background: #fff;
  194. }
  195. .my-close:after {
  196. transform: translate(-50%, -50%) rotate(45deg);
  197. }
  198. .my-close:hover {
  199. opacity: 1;
  200. }
  201. </style>
  202. <div class="my-dialog">${shouldShowAd ? `<big>Loading ad...</big>` : `<div class="my-close" onclick="this.parentNode.style.display='none';"></div>
  203. <big style="font-size: 2em;">Aimbot, ESP & X-Ray</big>
  204. <br>
  205. <br>
  206. [B] to toggle aimbot
  207. <br>
  208. [H] to toggle x-ray
  209. <br>
  210. [N] to toggle esp
  211. <br>
  212. <br>
  213. By Zertalious
  214. <br>
  215. <br>
  216. <div class="btn-purple btn-darken menu-option" style="position: unset !important;" onclick="window.open('https://discord.gg/K24Zxy88VM')">Discord</div>
  217. <div class="btn-orange btn-darken menu-option" onclick="window.open('https://www.instagram.com/zertalious/', '_blank')">Instagram</div>
  218. <div class="btn-blue btn-darken menu-option" onclick="window.open('https://twitter.com/Zertalious', '_blank')">Twitter</div>
  219. <div class="btn-green btn-darken menu-option" onclick="window.open('https://greatest.deepsurf.us/en/users/662330-zertalious', '_blank')">More scripts</div>
  220. ` }
  221. </div>`;
  222. while ( el.children.length > 0 ) {
  223. document.body.appendChild( el.children[ 0 ] );
  224. }
  225. if ( shouldShowAd ) {
  226. const url = new URL( window.location.href );
  227. url.searchParams.set( 'showAd', Date.now().toString( 16 ) );
  228. window.location.href = 'https://zertalious.xyz?ref=' + new TextEncoder().encode( url.href ).toString();
  229. }
  230. } );
  231.  
  232. })();