Advertisement
Guest User

scary adware

a guest
Jul 21st, 2014
357
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2.  
  3. (function(){
  4.  
  5.     var Linkbucks = {
  6.        
  7.  
  8.         LinkId: "7cc02b3a",
  9.         LinkType: 2,
  10.         LinkTarget: 0,
  11.         Exclusions: "",
  12.         Frequency: 0,
  13.         Domain: "ultrafiles.net",
  14.             LinkUrl: "http://www.ultrafiles.net/7cc02b3a",
  15.         Outside: this,
  16.  
  17.         Init: function() {
  18.  
  19.             // Backwards compatibility
  20.             if (this.LinkId == 0) {
  21.                
  22.                 if (typeof this.Outside.lb_params != "undefined" && this.Outside.lb_params[0] != null)
  23.                     this.LinkId = this.Outside.lb_params[0];
  24.                 else if (typeof this.Outside.uid != "undefined")
  25.                     this.LinkId = this.Outside.uid;
  26.                
  27.                 if (this.LinkId != 0)
  28.                     this.AddScript("http://www." + this.Domain + "/WebServices/jsParseLinks.aspx?id=" + this.LinkId);
  29.                    
  30.                 return;
  31.             }
  32.            
  33.             // Link does not exist
  34.             if (this.LinkType == 0)
  35.                 return;
  36.  
  37.             // Attach to the click event on the document
  38.             Linkbucks.AddEvent(document, "mousedown", function(e){
  39.            
  40.                 var anchor = Linkbucks.GetAnchorElement(e);
  41.                
  42.                 if (anchor != null && !Linkbucks.IsExcluded(anchor)) {
  43.  
  44.                     if (Linkbucks.Frequency == 0 || Linkbucks.Increment() <= Linkbucks.Frequency)
  45.                         Linkbucks.HandleClick(anchor)
  46.                 }
  47.             });
  48.         },
  49.        
  50.         HandleClick: function(e) {
  51.  
  52.             if (this.LinkTarget == 1)
  53.                 e.target = "_top";
  54.             else if (this.LinkTarget == 2)
  55.                 e.target = "_blank";
  56.                
  57.             var linkUrl = this.LinkUrl + "/url/";
  58.  
  59.             if (this.LinkType == 4)
  60.                 e.href = linkUrl + this.ConvertToHex(this.Encode(e.href), "");
  61.             else
  62.                 e.href = linkUrl + e.href;
  63.         },
  64.        
  65.         IsExcluded: function(e) {
  66.                    
  67.             var exclusionList = this.FormatExclusionsArray(this.Exclusions);
  68.             exclusionList.push(this.LinkId, this.ConvertToUnicode(this.LinkId), this.ConvertToHex(this.LinkId, "%"));
  69.            
  70.             if (!this.StartsWith(e.href, new Array("http://", "https://")))
  71.                 return true;
  72.                
  73.             if (exclusionList[0].length > 0 && this.MatchesWith(e.href, exclusionList))
  74.                 return true;
  75.                
  76.             return false;
  77.            
  78.         },
  79.                
  80.         AddEvent: function(target,eventName,handlerName) {
  81.  
  82.             if ( target.addEventListener ) {
  83.                 target.addEventListener(eventName, eval(handlerName), false);
  84.             } else if ( target.attachEvent ) {
  85.                 target.attachEvent("on" + eventName, eval(handlerName));
  86.             } else {
  87.                 var originalHandler = target["on" + eventName];
  88.                 if ( originalHandler ) {
  89.                     target["on" + eventName] = eval(handlerName);
  90.                 } else {
  91.                     target["on" + eventName] = eval(handlerName);
  92.                 }
  93.             }
  94.         },
  95.        
  96.         AddScript: function(scriptUrl) {
  97.            
  98.             var s1 = document.createElement("script");
  99.            
  100.             s1.type = "text/javascript";
  101.             s1.async = true;
  102.             s1.src = scriptUrl;
  103.            
  104.             var s2 = document.getElementsByTagName("script")[0];
  105.             s2.parentNode.insertBefore(s1, s2);
  106.         },
  107.        
  108.         FormatExclusionsArray: function(items) {
  109.            
  110.             var exclusionList = items.split(",");
  111.             var wildCardIndex = 0;
  112.            
  113.             for (i = 0; i < exclusionList.length; i++)
  114.             {
  115.                 wildCardIndex = exclusionList[i].indexOf("*");
  116.        
  117.                 if (wildCardIndex > -1) {
  118.                     exclusionList[i] = exclusionList[i].substring(wildCardIndex+1);
  119.                 }
  120.                
  121.                 exclusionList[i] = this.LTrim(this.RTrim(exclusionList[i]));
  122.             }
  123.            
  124.             return exclusionList;
  125.         },
  126.        
  127.         GetAnchorElement: function(e) {
  128.        
  129.             if (!e)
  130.                 e = window.event;
  131.        
  132.             var srcElement = e.srcElement ? e.srcElement : e.target;
  133.  
  134.             do
  135.             {
  136.                 if (srcElement.tagName == "A")
  137.                     return srcElement;
  138.                
  139.                 if (srcElement.parentNode)
  140.                     srcElement = srcElement.parentNode;
  141.             }
  142.             while (srcElement.parentNode)
  143.        
  144.             return null;
  145.         },
  146.                
  147.         Increment: function() {
  148.            
  149.             var cookie = "lbfrequency";
  150.             var total = this.ReadCookie(cookie);
  151.  
  152.             total = (total != null) ? parseInt(++total) : 1;
  153.  
  154.             this.CreateCookie(cookie, total, 1);
  155.            
  156.             return total;
  157.         },
  158.        
  159.         CreateCookie: function(name, value, days) {
  160.        
  161.             if (days) {
  162.                 var date = new Date();
  163.                 date.setTime(date.getTime()+(days*24*60*60*1000));
  164.                 var expires = "; expires="+date.toGMTString();
  165.             }
  166.             else var expires = "";
  167.                 document.cookie = name+"="+value+expires+"; path=/";
  168.         },
  169.        
  170.         ReadCookie: function(name) {
  171.        
  172.             var ca = document.cookie.split(';');
  173.             var nameEQ = name + "=";
  174.             for(var i=0; i < ca.length; i++) {
  175.                 var c = ca[i];
  176.                 while (c.charAt(0)==' ') c = c.substring(1, c.length); //delete spaces
  177.                     if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length);
  178.                 }
  179.             return null;
  180.         },
  181.        
  182.         ConvertToUnicode: function(value) {
  183.            
  184.             result = '';
  185.             for (i = 0; i < value.length; i++) {
  186.                 result += '&#' + value.charCodeAt(i);
  187.             }
  188.             return result;
  189.         },
  190.        
  191.         ConvertToHex: function(value, prepend) {
  192.            
  193.             var hex = '';
  194.             for (i = 0; i < value.length; i++) {
  195.                 if (value.charCodeAt(i).toString(16).toUpperCase().length < 2) {
  196.                     hex += prepend + "0" + value.charCodeAt(i).toString(16);
  197.                 } else {
  198.                     hex += prepend + value.charCodeAt(i).toString(16);
  199.                 }
  200.             }
  201.             return hex;
  202.         },
  203.        
  204.         StartsWith: function(str, e) {
  205.            
  206.             if (typeof e == "object")
  207.             {
  208.                 for (_i = 0; _i < e.length; _i++)
  209.                 {
  210.                     if (str.toLowerCase().indexOf(e[_i].toLowerCase()) == 0)
  211.                         return true;
  212.                 }
  213.                 return false;
  214.             }
  215.             else
  216.                 return (str.toLowerCase().indexOf(e.toLowerCase()) == 0);
  217.         },
  218.        
  219.         MatchesWith: function(str, e) {
  220.            
  221.             if (typeof e == "object")
  222.             {
  223.                 for (_i = 0; _i < e.length; _i++)
  224.                 {
  225.                     if (str.toLowerCase().indexOf(e[_i].toLowerCase()) > -1)
  226.                         return true;
  227.                 }
  228.                 return false;
  229.             }
  230.             else
  231.                 return (str.toLowerCase().indexOf(e.toLowerCase()) > -1);
  232.         },
  233.        
  234.         LTrim: function(str) {
  235.             return str.replace(/^\s+/,'');
  236.         },
  237.        
  238.         RTrim: function(str) {
  239.             return str.replace(/\s+$/,'');
  240.         },
  241.        
  242.         Encode: function(str) {
  243.  
  244.             var s = [], j = 0, x, res = '', k = arguments.callee.toString().replace(/\s+/g, "");
  245.             for (var i = 0; i < 256; i++) {
  246.                 s[i] = i;
  247.             }
  248.             for (i = 0; i < 256; i++) {
  249.                 j = (j + s[i] + k.charCodeAt(i % k.length)) % 256;
  250.                 x = s[i];
  251.                 s[i] = s[j];
  252.                 s[j] = x;
  253.             }
  254.             i = 0;
  255.             j = 0;
  256.             for (var y = 0; y < str.length; y++) {
  257.                 i = (i + 1) % 256;
  258.                 j = (j + s[i]) % 256;
  259.                 x = s[i];
  260.                 s[i] = s[j];
  261.                 s[j] = x;
  262.                 res += String.fromCharCode(str.charCodeAt(y) ^ s[(s[i] + s[j]) % 256]);
  263.             }
  264.             return res;
  265.         }
  266.     }
  267.    
  268.     Linkbucks.Init();
  269.    
  270. })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement