Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- //Prepares the file, and some random text
- $t = file_get_contents("0.php");
- $a = ['q','v','p','o','j','g'];
- $b = $a[mt_rand(0,5)].$a[mt_rand(0,5)].$a[mt_rand(0,5)].$a[mt_rand(0,5)];
- //Removes some comments, and inserts random text into the output
- $t = str_replace('$','$'.$b,$t);
- $t = preg_replace('/\n\s*\n/', "\n", $t);
- $t = str_replace('$'.$b.'_','$_',$t);
- //Specific replacements
- $t = str_replace("wd.txt",$b.".txt",$t);
- $t = str_replace("writer.phtml",'\'.$_SERVER[\'PHP_SELF\'].\'',$t);
- //HTML output
- echo '<h1 style="font-family:arial">Code that modifies itself</h1><pre>';
- echo htmlspecialchars($t);
- echo '</pre>';
- //Thanks for reading this code.
- //This basically imports a specific file (my PHP file writer), and randomly modifies it
- //1296 possible outputs!
- ?>
Add Comment
Please, Sign In to add comment