Advertisement
Pythorian

Untitled

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