Krunker Skin Hack

unlocks all skins, client side only

  1. // ==UserScript==
  2. // @name Krunker Skin Hack
  3. // @version 1.0
  4. // @author SkidLamer - From The Gaming Gurus
  5. // @homepage https://skidlamer.github.io/
  6. // @supportURL https://discord.gg/2uqj5Y6h7s
  7. // @description unlocks all skins, client side only
  8. // @match *://krunker.io/*
  9. // @exclude *://krunker.io/editor*
  10. // @exclude *://krunker.io/social*
  11. // @run-at document-start
  12. // @grant none
  13. // @namespace https://greatest.deepsurf.us/users/731301
  14. // ==/UserScript==
  15.  
  16. ((global, sendEvent, sendMessage)=>{
  17. /* eslint-disable no-caller, no-undef, no-sequences */
  18.  
  19. console.log(this)
  20.  
  21. var config = {
  22. unlock:true
  23. }
  24.  
  25. function init(ws) {
  26. console.log(ws)
  27. sendEvent = ws._dispatchEvent.bind(ws);
  28. sendMessage = ws.send.bind(ws);
  29. ws.send = new Proxy(ws.send, {
  30. apply: function(target, that, args) {
  31. try {
  32. var original_fn = Function.prototype.apply.apply(target, [that, args]);
  33. } catch (e) {
  34. e.stack = e.stack = e.stack.replace(/\n.*Object\.apply.*/, '');
  35. throw e;
  36. }
  37.  
  38. if (args[0] === "en") {
  39. config.skins = {
  40. main: args[1][2][0],
  41. secondary: args[1][2][1],
  42. hat: args[1][3],
  43. body: args[1][4],
  44. knife: args[1][9],
  45. dye: args[1][14],
  46. waist: args[1][17],
  47. }
  48. }
  49.  
  50. return original_fn;
  51. }
  52. })
  53.  
  54. ws._dispatchEvent = new Proxy(ws._dispatchEvent, {
  55. apply: function(target, that, [type, event]) {
  56.  
  57. if (config.unlock && config.skins && type === "0") {
  58. let pInfo = event[0];
  59. let pSize = 38;
  60. while (pInfo.length % pSize !== 0) pSize++;
  61. for(let i = 0; i < pInfo.length; i += pSize) {
  62. if (pInfo[i] === ws.socketId||0) {
  63. pInfo[i + 12] = [config.skins.main, config.skins.secondary];
  64. pInfo[i + 13] = config.skins.hat;
  65. pInfo[i + 14] = config.skins.body;
  66. pInfo[i + 19] = config.skins.knife;
  67. pInfo[i + 24] = config.skins.dye;
  68. pInfo[i + 33] = config.skins.waist;
  69. }
  70. }
  71. }
  72.  
  73. return target.apply(that, arguments[2]);
  74. }
  75. })
  76. }
  77.  
  78. const $events = Symbol("events");
  79. const $skins = Symbol("skins");
  80. Object.defineProperties(Object.prototype, {
  81. events: {
  82. set: function(fn) {
  83. this.ahNum === 0 && init(this), this[$events] = fn;
  84. },
  85. get: function() {
  86. return this[$events]
  87. }
  88. },
  89.  
  90. skins: {
  91. set: function(fn) {
  92. this[$skins] = fn;
  93. if (void 0 == this.localSkins || !this.localSkins.length) {
  94. this.localSkins = Array.apply(null, Array(5e3)).map((x, i) => {
  95. return {
  96. ind: i,
  97. cnt: 0x1,
  98. }
  99. })
  100. }
  101. return fn;
  102. },
  103. get: function() {
  104. return config.unlock && this.stats ? this.localSkins : this[$skins];
  105. }
  106. },
  107. });
  108.  
  109. })(globalThis||window, null, null);