Kour.io Wallhack

Wallhacks for Kour.io

  1. // ==UserScript==
  2. // @name Kour.io Wallhack
  3. // @namespace http://tampermonkey.net/
  4. // @version 2024-04-01
  5. // @description Wallhacks for Kour.io
  6. // @author KourFan69
  7. // @match *://kour.io/*
  8. // @icon https://www.google.com/s2/favicons?sz=64&domain=tampermonkey.net
  9. // @grant none
  10. // @license MIT
  11. // ==/UserScript==
  12.  
  13. ( function() {
  14. 'use strict';
  15.  
  16. const WebGL = WebGL2RenderingContext.prototype;
  17. HTMLCanvasElement.prototype.getContext = new Proxy( HTMLCanvasElement.prototype.getContext, {
  18. apply( target, thisArgs, args ) {
  19. return Reflect.apply( ...arguments );
  20.  
  21. }
  22. } );
  23. if( window.observer != undefined ) {
  24. window.observer.disconnect();
  25. }
  26. window.MutationObserver = {
  27. observe : function() {
  28. console.log( "Observed" );
  29. }
  30. };
  31. if( window.location.href.indexOf( "/a" ) != -1 ) {
  32. window.location.href = "https://kour.io";
  33. }
  34. var gl = null;
  35. const handler = {
  36. apply( target, thisArgs, args ) {
  37. const program = thisArgs.getParameter( thisArgs.CURRENT_PROGRAM );
  38.  
  39. if( !program.uniforms ) {
  40.  
  41. program.uniforms = {
  42. enabled: thisArgs.getUniformLocation( program, 'enabled' ),
  43. threshold: thisArgs.getUniformLocation( program, 'threshold' )
  44. };
  45.  
  46. }
  47. var couldBePlayer = true;
  48. var threshold = 4.5;
  49. program.uniforms.enabled && thisArgs.uniform1i( program.uniforms.enabled, couldBePlayer );
  50. program.uniforms.threshold && thisArgs.uniform1f( program.uniforms.threshold, threshold );
  51. if( couldBePlayer ) {
  52. gl = thisArgs;
  53. }
  54.  
  55. Reflect.apply( ...arguments );
  56.  
  57. }
  58. };
  59.  
  60. WebGL.drawElements = new Proxy( WebGL.drawElements, handler );
  61. WebGL.drawElementsInstanced = new Proxy( WebGL.drawElementsInstanced, handler );
  62.  
  63. WebGL.shaderSource = new Proxy( WebGL.shaderSource, {
  64. apply( target, thisArgs, args ) {
  65. let [ shader, src ] = args;
  66. if( src.indexOf( 'gl_Position' ) > - 1 ) {
  67. if ( src.indexOf( 'OutlineEnabled' ) > - 1 ) {
  68. shader.isPlayerShader = true;
  69. }
  70. src = src.replace( `void main()
  71. {`, `
  72. out float vDepth;
  73. out float enabled;
  74. uniform float threshold;
  75.  
  76. void main() {
  77. enabled = 0.0;
  78.  
  79. ` );
  80. if( src.indexOf( "hlslcc_mtx4x4unity_WorldToObject" ) != -1 && src.indexOf( "_MaskSoftnessX" ) == -1
  81. && src.indexOf( "vs_TEXCOORD5.xyz = unity_SHC.xyz * vec3(u_xlat16_2) + u_xlat16_3.xyz;" ) != -1
  82. && src.indexOf( "_DetailAlbedoMap_ST" ) != -1
  83. && src.indexOf( "vs_TEXCOORD1.w = 0.0;" ) != -1
  84. ) {
  85. src = src.replace( "enabled = 0.0", `enabled = 1.0;
  86. if( in_POSITION0.y > 10.0 ) {
  87. //enabled = 2.0;
  88. }` );
  89. src = src.replace( /return;/, `
  90. gl_Position.z = 0.01 + gl_Position.z * 0.1;
  91. ` );
  92. }
  93.  
  94. } else if ( src.indexOf( 'SV_Target0' ) > - 1 ) {
  95. src = src.replace( 'void main', `
  96.  
  97. in float vDepth;
  98. in float enabled;
  99.  
  100. void main
  101.  
  102. ` ).replace( /return;/, `
  103.  
  104. if( enabled > 0.5 && SV_Target0.a == 1.0 ) {
  105.  
  106. SV_Target0 = mix( SV_Target0 * 0.8, vec4( 1.0, 0.0, 0.0, 1.0 ), 0.4 );
  107. if( enabled > 0.5 ) {
  108. //SV_Target0.xyz = vec3( 1.0, 0.0, 0.0 );
  109. }
  110. SV_Target0.a = 1.0;
  111.  
  112. }
  113.  
  114. ` );
  115. }
  116. args[ 1 ] = src;
  117. return Reflect.apply( ...arguments );
  118. }
  119. } );
  120. } )();