Форум АНТИЧАТ

Форум АНТИЧАТ (https://forum.antichat.xyz/index.php)
-   PHP, PERL, MySQL, JavaScript (https://forum.antichat.xyz/forumdisplay.php?f=37)
-   -   Полиморф на Perl (https://forum.antichat.xyz/showthread.php?t=81899)

x0x01 22.08.2008 08:41

Полиморф на Perl (пример)
 
На самом деле не полный полиморф, но пример, безусловно, интересен.
Код:

print "Hello, I'm polymorphic\n";

open(Myself, $0);
@Body = <Myself>;
close(Myself);

$Body = join("",@Body);
$cryptKey = int(rand(255));

for($i=0;$i<length($Body);$i++)
{@Crypt[$i]=(ord(substr($Body,$i,1))) * ($cryptKey);}

for($i=0;$i<6;$i++)
{$Var[$i]=chr(int(rand(25)+65)).int(rand(65535));}

$glue = chr(int(rand(25)+65));
$Crypt = join($glue,@Crypt);

open(File, ">$0");
print File "\$$Var[0]=\"$Crypt\";";
print File "\@$Var[1]=split(\"$glue\",\$$Var[0]);";
print File "for(\$$Var[2]=0;\$$Var[2]<(\@$Var[1]);\$$Var[2]++)
{\$$Var[3].=chr(\@$Var[1] [\$$Var[2]]/$cryptKey);}";
print File "open($Var[4],\">\$0\"); print $Var[4] \$$Var[3];
close($Var[4]); \@$Var[5]=(\"perl\",\"$0\"); system(\@$Var[5]);";
close(File);

Найдено тут


Время: 00:27