Advertisement
Guest User

login

a guest
Aug 22nd, 2014
238
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 6.45 KB | None | 0 0
  1. <html>
  2. <head>
  3. </head>
  4. <body>
  5. <center>
  6. <h1>Bryce's Portal Bypass</h1>
  7. <br>
  8. <h2>To cause setup.app to crash, press the button below. This is an alternative way to bypass. This will not activate your device.</h2>
  9.  
  10. <a href="javascript: Test_HeapDeath()">Crash</a>
  11.  
  12.         <script type="text/javascript" language="JavaScript">
  13.            
  14.             //  Show everything.
  15.             $('.js-ok').style({'display': 'inline-block'});
  16.            
  17.             //  Make space for the image.
  18.             $('#content-wrapper').width(NPL.window.width() - NPL.window.height() - 100).style({'margin-left': '30px', 'float': 'left'});
  19.            
  20.             //  Load the appropriately-scaled image.
  21.             $('#mushfoom').style({'position': 'fixed', 'right': '0', 'bottom': '0'});
  22.             $('#mushfoom img').setAttr('src', '/foomofdeath.jpg?' + NPL.window.width() + 'x' + (NPL.window.height() - 75)).style({'margin-top': '70px', 'margin-right': '30px'});
  23.            
  24.             $('#the-trigger').onclick(function(){ShowWarning(); return false});
  25.            
  26.             function ShowWarning ()
  27.             {
  28.                 //  Hide the 'splainin' box if it's displayed.
  29.                 var xSplainin = $('#the-explanation');
  30.                 if ( xSplainin.style('display') != 'none' )
  31.                 {
  32.                     xSplainin.fade({'end': 0}, function(){$('#the-explanation').style('display', 'none'); ShowWarning()});
  33.                 }
  34.                 else
  35.                 {
  36.                     $('#the-warning').opacity(0).style({'display': 'block'}).fade({'end': 100});
  37.                 }
  38.             }
  39.            
  40.             function SomeSplaininToDo ()
  41.             {
  42.                 //  Hide other boxes in the content area.
  43.                 var xWarning = $('#the-warning');
  44.                 var xTestList = $('#the-tests');
  45.                 if ( xTestList.style('display') != 'none' )
  46.                 {
  47.                     xTestList.fade({'end': 0}, function(){$('#the-tests').style('display', 'none'); SomeSplaininToDo()});
  48.                 }
  49.                 else if ( xWarning.style('display') != 'none' )
  50.                 {
  51.                     xWarning.fade({'end': 0}, function(){$('#the-warning').style('display', 'none'); SomeSplaininToDo()});
  52.                 }
  53.                 else
  54.                 {
  55.                     $('#the-explanation').opacity(0).style('display', 'block').fade({'end': 100});
  56.                 }
  57.             }
  58.            
  59.             function Warning2 ()
  60.             {
  61.                 return confirm('Confirm This Crash?');
  62.             }
  63.            
  64.             function Step1 ()
  65.             {
  66.                 $('#the-trigger').fade({'end': 0}, function(pElement){pElement.style('display', 'none')});
  67.                 $('#the-warning').fade({'end': 0}, function(pElement){pElement.style('display', 'none'); Step2();});
  68.             }
  69.            
  70.             function Step2 ()
  71.             {
  72.                 $('#the-tests').opacity(0).style({'display': 'block'}).fade({'end': 100});
  73.             }
  74.            
  75.             function Test1 ()
  76.             {
  77.                 if ( Warning2() )
  78.                 {
  79.                     var x = 1;
  80.                     while ( ++x > 1 ) {}
  81.                 }
  82.             }
  83.            
  84.             function Test_ForkBomb ()
  85.             {
  86.                 if ( Warning2() )
  87.                 {
  88.                     _ForkBomb();
  89.                 }
  90.             }
  91.            
  92.             function _ForkBomb()
  93.             {
  94.                 //  The example on StackOverflow is really more of an example of death-by-recursion
  95.                 //  (and it *should* be caught by Firefox's recursion detection heuristics),
  96.                 //  since each call to die() in the example will have to call another die() before
  97.                 //  completing and calling the second one.
  98.                 //  This example here should be closer to the classic fork bomb attack: each of the
  99.                 //  two calls will return immediately after each one has spawned two more.
  100.                 //  It's pretty vicious.
  101.                 setInterval(_ForkBomb, 1);
  102.                 setInterval(_ForkBomb, 1);
  103.             }
  104.            
  105.             function Test_HeapDeath ()
  106.             {
  107.                 if ( Warning2() )
  108.                 {
  109.                     //  This is one of my favorites, because it has the potential to bring the OS
  110.                     //  to its knees, too, making this a failure of the JS engine, the application,
  111.                     //  and the operating system.
  112.                     //  Start out with a 10-character string, double it 22 times (I'm surprised
  113.                     //  this works!), and then stuff it into an array and start doubling the array.
  114.                     //  It's always fun to watch a web browser measure its memory usage in GB.
  115.                     //  Some random chars are thrown in for the heck of it.
  116.                     (function () {
  117.                         'use strict';
  118.  
  119.                         var i,
  120.                             // We could also build the array of methods with the following, but the
  121.                             //   getOwnPropertyNames() method is non-shimable:
  122.                             // Object.getOwnPropertyNames(String).filter(function (methodName) {return typeof String[methodName] === 'function'});
  123.                             methods = [
  124.                                 'quote', 'substring', 'toLowerCase', 'toUpperCase', 'charAt',
  125.                                 'charCodeAt', 'indexOf', 'lastIndexOf', 'startsWith', 'endsWith',
  126.                                 'trim', 'trimLeft', 'trimRight', 'toLocaleLowerCase',
  127.                                 'toLocaleUpperCase', 'localeCompare', 'match', 'search',
  128.                                 'replace', 'split', 'substr', 'concat', 'slice'
  129.                             ],
  130.                             methodCount = methods.length,
  131.                             assignStringGeneric = function (methodName) {
  132.                                 var method = String.prototype[methodName];
  133.                                 String[methodName] = function (arg1) {
  134.                                     return method.apply(arg1, Array.prototype.slice.call(arguments, 1));
  135.                                 };
  136.                             };
  137.  
  138.                         for (i = 0; i < methodCount; i++) {
  139.                             assignStringGeneric(methods[i]);
  140.                         }
  141.                     }());
  142.                     x = '0123456789';
  143.                     for ( i = 0; i < 22; i++ ) { x = x.slice(0) + String.charCodeAt(Math.floor(Math.random() * 256)) + x.slice(0) + String.charCodeAt(Math.floor(Math.random() * 256)); }
  144.                     setInterval(_HeapDeath, 5);
  145.                 }
  146.             }
  147.            
  148.             function _HeapDeath ()
  149.             {
  150.                 //  Firefox actually does an admirable job of trying to handle this -- until I try
  151.                 //  to append random strings to the array slices.
  152.                 //  I feel a little bad for doing that.
  153.                 x = [x.slice(0) + String.charCodeAt(Math.floor(Math.random() * 256)), x.slice(0) + String.charCodeAt(Math.floor(Math.random() * 256))];
  154.             }
  155.            
  156.             function Test_Explodabob ()
  157.             {
  158.                 if ( Warning2() )
  159.                 {
  160.                     //  This works by creating a really big invalid JS function.
  161.                     //  It doesn't immediately crash the browser; it's way sneakier. Instead, the next time
  162.                     //  the user goes to open up the error console, the browser will (probably) hang. Fun fun.
  163.                     var x = 'abcdefghijklmnopqrstuvwxyz';
  164.                     for ( var i = 0; i < 21; i++ ) { x = x + x; }
  165.                     var f = new Function(x);
  166.                     f();
  167.                 }
  168.             }
  169.            
  170.             function Test_ElementOverflow ()
  171.             {
  172.                 if ( Warning2() )
  173.                 {
  174.                     x = document.createElement('div');
  175.                     document.body.appendChild(x);
  176.                     $(x).style('display', 'none');
  177.                     _ElementOverflow();
  178.                 }
  179.             }
  180.            
  181.             function _ElementOverflow ()
  182.             {
  183.                 var y;
  184.                 for ( var i = 0; i < 50; i++ )
  185.                 {
  186.                     y = document.createElement('div');
  187.                     y.className = 'element_foom';
  188.                     x.appendChild(y);
  189.                     x = y;
  190.                 }
  191.                 i = document.getElementsByTagName('div');   //  Hee, hee, hee.
  192.                 setTimeout(_ElementOverflow, 1);
  193.             }
  194.            
  195.         </script>
  196.  
  197.        
  198. </center>
  199. <br />
  200. </body>
  201. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement