Pythorian

Base64 Decode Unpacker

Oct 6th, 2012
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.70 KB | None | 0 0
  1. <?php
  2.  
  3. $code = '';
  4.  
  5. if (isset($_POST['original']))
  6. {
  7.   $code = $_POST['original'];
  8.   while (strstr(substr($code,0,10), 'eval') !== false)
  9.   {
  10.     $code = trim(preg_replace(array('/<\?php/mi','/\?>/m','/^\s*#.*$/m','#^\s*//.*$#m','#/\*.*?\*/#ms' ),'', $code));
  11.     $code = str_replace('eval', 'echo', $code);
  12.     ob_start();
  13.     eval($code);
  14.     $code = ob_get_contents();
  15.     ob_end_clean();
  16.     $code = str_replace(array(' ', "\n"), array('&nbsp;', '<br />'), htmlentities($code));
  17.   }
  18.  
  19. }
  20.  
  21. ?>
  22. <html>
  23. <body>
  24. <form method="post">
  25. Original:
  26. <textarea name="original" rows="10" cols="80"><?php echo $code; ?></textarea>
  27. <br /><br /><input type="submit" value="Unpack">
  28.  
  29. </form>
  30. </body>
  31. </html>
Advertisement
Add Comment
Please, Sign In to add comment