well.. I think I should make this easier.. because there is no point for it to morph 10 times.
this is actually like make a script that:
replicate self:
easy, read self(for script languages), or read the predefined string that store the source code(for non-script languages) and save as another copy somewhere in the hard disk
Manipulate replicated self:
make it unreadable but it still work like the original...
to do that, you just have to trash your code, sugar coat, encrypt, encode or anything possible to let it can't be easily understand...
here is my version... the most basic version because I have to tell you guys I don't know regex, which made this thing pretty hard.
if I do know regex, I can do a lot more operations... like trashing... but now I can only make variables harder to read >.< but this have done what is required... each copy of the script that generated can be used to regenerate a another copy that does the same thing but looks different.
I might update my version soon... doing some regex crash course...
I name this script... PHP Bacillus sphaericus... one of the oldest bacteria... >.<
PHP Code:
<?
$fp = fopen(__FILE__, 'rb');
$script = fread($fp, filesize(__FILE__));
$script = str_replace('$fp', '$V'.md5('$fp'),$script);
$script = str_replace('$script', '$V'.md5('$script'),$script);
$fp = fopen(md5($script).'.php', 'wb');
fwrite($fp, $script);
echo 'replicated';
?>