Advertisement
24001

Untitled

Dec 2nd, 2015
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.72 KB | None | 0 0
  1. // ==UserScript==
  2. // @name HKG tool Lite with deobfuscated code...
  3. // @namespace hkgagartoollite
  4. // @description HKG Agar tool Lite
  5. // @author Num JAI deob by greeb
  6. // @match http://agar.io/*
  7. // @grant GM_setClipboard
  8. // @grant GM_xmlhttpRequest
  9. // ==/UserScript==
  10.  
  11. var VERSION = "3.0.0";
  12. var $;
  13. var URL_JQUERY = "http://code.jquery.com/jquery-1.11.3.min.js";
  14. var URL_BOOTSTRAP = "https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js";
  15. //var URL_SOCKET_IO = "https://cdn.socket.io/socket.io-1.3.5.js";
  16. var URL_FACEBOOK = "http://connect.facebook.net/en_US/sdk.js";
  17. var URL_MAIN_OUT = "http://pastebin.com/raw.php?i=5KXwrqXW.js";
  18. var URL_CSS_FILE = "https://googledrive.com/host/0Bx5EmU2kLXq9alVNVTQxX0FFd1k/hkgagartoolpublic.css"
  19.  
  20. if (location.host == "agar.io" && location.pathname == "/") {
  21. location.href = "http://agar.io/aa" + location.hash;
  22. return;
  23. }
  24.  
  25. // Load script
  26. loadScript(URL_JQUERY, function () {
  27. $ = unsafeWindow.jQuery;
  28. $("head").append('<link href="https://fonts.googleapis.com/css?family=Ubuntu:700" rel="stylesheet" type="text/css">');
  29. $("head").append('<link rel="stylesheet" href="http://agar.io/css/glyphicons-social.css">');
  30. $("head").append('<link rel="stylesheet" href="http://agar.io/css/animate.css">');
  31. $("head").append('<link rel="stylesheet" href="http://agar.io/css/bootstrap.min.css">');
  32. $("head").append('<link rel="stylesheet" href="' + URL_CSS_FILE + '">');
  33.  
  34. loadScript(URL_BOOTSTRAP, function () {
  35. //loadScript(URL_SOCKET_IO, function () {
  36. loadScript(URL_MAIN_OUT, function () {
  37. loadScript(URL_FACEBOOK, function () {});
  38. });
  39. //});
  40. });
  41. });
  42.  
  43. function loadScript(url, callback) {
  44. var head = document.getElementsByTagName('head')[0];
  45. var script = document.createElement('script');
  46. script.type = 'text/javascript';
  47. script.src = url;
  48. script.onload = callback;
  49. head.appendChild(script);
  50. }
  51.  
  52. function receiveMessage(e) {
  53. if (e.origin != "http://agar.io" || !e.data.action)
  54. return;
  55.  
  56. var Action = unsafeWindow.Action;
  57.  
  58. if (e.data.action == Action.COPY) {
  59. GM_setClipboard(e.data.data);
  60. }
  61.  
  62. if (e.data.action == Action.IMAGE) {
  63. downloadResource(e.data.data, unsafeWindow.handleResource);
  64. }
  65. }
  66.  
  67. function downloadResource(url, callback) {
  68. GM_xmlhttpRequest({
  69. method : 'GET',
  70. url : url,
  71. responseType : 'blob',
  72. onload : function (res) {
  73. if (res.status === 200) {
  74. callback(url, window.URL.createObjectURL(res.response));
  75. } else {
  76. console.log("res.status=" + res.status);
  77. }
  78. },
  79. onerror : function (res) {
  80. console.log("GM_xmlhttpRequest error! ");
  81. callback(null);
  82. }
  83. });
  84. }
  85.  
  86. window.addEventListener("message", receiveMessage, false);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement