ydklijnsma

Deobfuscated hacker-in-a-hoodie logo by F-Secure

Feb 24th, 2014
433
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 4.19 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <!--
  3.    Deobfuscated version of the hacker-in-a-hoodie logo by F-Secure
  4.    Original info/files: https://twitter.com/mikko/status/437970730433511424
  5.    
  6.    
  7.    https://twitter.com/ydklijnsma
  8. -->
  9. <html>
  10. <head>
  11. <title>0xF-Secure</title>
  12. <style type="text/css">canvas {display: block;}</style>
  13. </head>
  14. <body>
  15. <script>
  16.     title_str = '0xF';
  17.     scroller_str = '\u263a\t\t\t\t0xF-Secure Labs squashing malware since 1988\t\t\t\t\u0ca0_\u0cb0\u0cc3\t\t\t\t\t\t\t\tsuch scan\t\t\t\tso detections\t\t\t\tmuch award\t\t\t\twow';
  18.  
  19.     /*
  20.         Generates a random a star position & direction
  21.    */
  22.    function randomize_starpos(spos) {
  23.        spos.x = Math.random() - .5;
  24.         spos.y = Math.random() - .5;
  25.         spos.s = Math.random()
  26.     }
  27.  
  28.     window_height = window.innerHeight;
  29.     windows_width = window.innerWidth;
  30.    
  31.     document.body.style.margin = 0;
  32.     render_canvas = document.createElement('canvas');
  33.     document.body.appendChild(render_canvas);
  34.    
  35.     render_canvas.height = window_height;
  36.     render_canvas.width = windows_width;
  37.    
  38.     c2d_context = render_canvas.getContext('2d');
  39.     c2d_context.shadowColor = '#7A9BD7';
  40.    
  41.     aspect_relative_minsize = Math.min(window_height, windows_width); // Used in text scaling relative to viewport size & aspect
  42.    scroller_xpos = windows_width; // Set starting position of the scroller (just outside the viewport)
  43.    
  44.     // Initialize the starfield table
  45.     starfield_table = [];
  46.     for (i = 0; (windows_width + window_height) / 4 > i; ++i) {
  47.         starfield_table[i] = [];
  48.         randomize_starpos(starfield_table[i]);
  49.         starfield_table[i].z = Math.random();
  50.     }
  51.    
  52.     elapsed_frames = 0; // Used for progress, counts frameticks
  53.     setInterval(function () {
  54.         pulse = Math.abs(Math.sin(elapsed_frames * .01)); // Pulse value for the title glow & scroller color rotation
  55.    
  56.        /*
  57.            Scroller
  58.        */
  59.        c2d_context.fillStyle = 'rgba(0, 0, 0, .2)';
  60.         c2d_context.fillRect(0, 0, windows_width, window_height); // Clear canvas
  61.         c2d_context.font = Math.round(aspect_relative_minsize / 20) + 'pt Courier'; // Set font-size relative to window size
  62.         scroller_pixelwidth = c2d_context.measureText(scroller_str).width; // Precalc scroller pixel width
  63.        
  64.         // Reset scroller if it has scrolled by completely
  65.         if(scroller_xpos > -scroller_pixelwidth) {
  66.             scroller_xpos -= .7;
  67.         } else {
  68.             scroller_xpos = windows_width;
  69.         }
  70.  
  71.         scroller_ypos = (.8 * window_height) + Math.sin(elapsed_frames / 20) * (window_height / 16);
  72.         c2d_context.fillStyle = 'hsl(' + Math.round(pulse * 360) + ', 99%, 70%)'; // Pulsating color change
  73.         c2d_context.fillText(scroller_str, scroller_xpos, scroller_ypos);
  74.        
  75.         c2d_context.fillStyle = 'white'; // Set fillstyle for stars & 0xF title
  76.        
  77.        /*
  78.            Starfield
  79.        */
  80.        for (index in starfield_table) {
  81.            star_pos = starfield_table[index];
  82.             Z = 1 / (star_pos.z -= 1e-3);
  83.             X = (star_pos.x += Math.sin(elapsed_frames / 450) / 2e3) * Z + .5;
  84.             Y = (star_pos.y += Math.sin(elapsed_frames / 650) / 2e3) * Z + .5;
  85.            
  86.             // Reset the star if its outside the viewport
  87.             if(0 > X || 0 > Y || X > 1 || Y > 1) {
  88.                 randomize_starpos(star_pos);
  89.                 star_pos.z = 1;
  90.             }
  91.  
  92.             rect_size = (1 - star_pos.z) * star_pos.s * 3;
  93.             c2d_context.fillRect(X * windows_width, Y * window_height, rect_size, rect_size);
  94.         }        
  95.        
  96.         /*
  97.             0xF title
  98.         */
  99.         c2d_context.shadowBlur = 15 * pulse + 5;
  100.         c2d_context.font = Math.round(aspect_relative_minsize / 3) - 1 + 'pt Courier'; // Set font-size relative to window size
  101.         title_width = c2d_context.measureText(title_str).width;
  102.         c2d_context.fillText(title_str, windows_width / 2 - title_width / 2, window_height / 2); // Render title centered
  103.         c2d_context.shadowBlur = 0;
  104.        
  105.         elapsed_frames++ // Frame counter
  106.     }, 9); // 111.111 FPS
  107. </script>
  108. </body>
  109. </html>
Add Comment
Please, Sign In to add comment