Takepoint.io - Anti Packet Injection

No more xss

  1. // ==UserScript==
  2. // @name Takepoint.io - Anti Packet Injection
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.0.1
  5. // @description No more xss
  6. // @author You
  7. // @match https://takepoint.io
  8. // @icon https://www.google.com/s2/favicons?domain=takepoint.io
  9. // @grant none
  10. // ==/UserScript==
  11.  
  12. (function() {
  13. 'use strict';
  14. setInterval(() => {
  15. var connection
  16. for(var i in sockets) {
  17. if(sockets[i].readyState == 1) connection = sockets[i]
  18. }
  19.  
  20. connection.onmessage = function (e) {
  21. var text = new TextDecoder().decode(e.data)
  22. var modifiedText = text.split("|")
  23. for(var i in modifiedText) {
  24. if(modifiedText[i] == " ") {
  25. var lc = i-1
  26. while(true) { //iterate backwards through each packet until we get to the player that sent them
  27. if(!modifiedText[lc].startsWith("c")) {
  28. modifiedText.splice(lc, 1)
  29. }
  30. else {
  31. break
  32. }
  33. lc--
  34. }
  35. }
  36. }
  37. modifiedText = modifiedText.join("|")
  38. var encoder = new TextEncoder()
  39. var view = encoder.encode(modifiedText)
  40. var uint8Array = new Uint8Array(view)
  41. var buffer = Module._malloc(uint8Array.length)
  42. writeArrayToMemory(uint8Array, buffer)
  43. connection.events.push([buffer, uint8Array.length, Module.getClientTime()])
  44. }
  45. }, 1000)
  46.  
  47. })();