First try on anything obfu. Ment to be released as a perldemo on a party about a year ago but I didn't manage to make it work then... soo, here it is now, a year late! rotating cube obfu. ;)
#!/usr/bin/perl
use Time::HiRes qw(usleep);$xxx=
"KZHZsCydd";;;;;$xxx=~tr /Csuckmydi*KYOUbIatChGAHZ
/psFUyouf**Kingn0obpImPla/;$l="."; $p="O";$q=3.141592;$k=180;$j=$k*2;
$e=0;@b=((""));@c=("");@s= ("");@d=(15,12,7);@m=([(0,5)
],[(5,4)],[(4,3)], [(3,0)],[(1,2)],[(2,7
)],[(7,6)],[( 6,1)],[(0,1)],[
(5,6)],
[(4,7)],
[(3,2)])
;@a=([(1
,1,1)],[
(1,1,-1)
],[(1,-1
,-1)],[(1
,-1,1)],[
(-1,-1,1)
],[(-1,1,
1)],[(-1 ,1,-1
)],[(-1,-1,-1
)]);sub p
{print@_} sub h{abs
@_[0]}sub r{int(@_[0]+
.5)}sub g{system
"clear"} sub f{p"\n";}
sub t{usleep@_[0]}for($i=0;$i<360;
$i++){$c[$i]=cos($i*($q/$k));$s[
$i]=sin($i*($q/$k));}sub u{($n)=
@_; @o=
((( $n*
4)% $j)
,(( $n*
2)%$j),
($n*8%$j));;for($i=0;$i<8;$i++)
{$bx=$a[$i][0]*$d[2];$by=$a[$i][1
]*$d[2];$bz=$a[$i][2]*$d[2];$rx=($c
[$o[0]]*$bx+$s[$o[0]]*$bz);;$rz=(-$s[
$o[0]]*$bx+$c[$o[0]]*$bz);$ry=($c[$o[1]
]*$by+$s[ $o[1]]*$rz);$rrx=($c[$o[2]]*$rx
-$s[$o[2]]*$ry);$rry=($s[$o[2]]*$rx+$c[$o[2
]]*$ry);$x[$i]=$d[0]+r($rrx);$y[$i]=r((($d[1]
-$rry)/2.5));}for($i=0;$i<12;$i++){$v=($x[$m[$i
][1]]-$x[$m[$i][0]]?($y[$m[$i][1]]-$y[$m[$i][0]])
/($x[$m[$i][1]]-$x[$m[$i][0]]):"n");$w=(h($x[$m[$i]
[1]]-$x[$m[$i][0]])>h($y[$m[$i][1]]-$y[$m[$i][0]])?$x
[$m[$i][1]]-$x[$m[$i][0]]:$y[$m[$i][1]]-$y[$m[$i][0]]);
do{$b[r($y[$m[$i][1]]-($w*(h($x[$m[$i][1]]-$x[$m[$i][0]])
#Perl
>h($y[$m[$i][1]]-$y[$m[$i][0]])?$v:1)))][r($x[$m[$i][1]]-
($w*(h($x[$m[$i][1]]-$x[$m[$i][0]])>h($y[$m[$i][1]]-$y[
$m[$i][0]])?1:($v!="n"?(1/$v):0))))]=$l;}while($w+=(h
($x[$m[$i][1]]-$x[$m[$i][0]])>h($y[$m[$i][1]]-$y[$m
[$i][0]])?($x[$m[$i][01]]-$x[$m[$i][0]]<0?1:-1):(
$y[$m[$i][1]]-$y[$m[$i][0]]<0?1:-1))and$w-(h($x
[$m[$i][1]]-$x[$m[$i][0]])>h($y[$m[$i][1]]-$y
[$m[$i][0]])?($x[$m[$i][1]]-$x[$m[$i][0]]<0
?1:-1):($y[$m[$i][1]]-$y[$m[$i ][0]]<0?1:
-1)))}for($i=0;$i<8;$i++){$b[$y[$i]][$x
[$i]]=$p;}f,f,f;for($i=0;$i<12;$i++){
for($z=0;$z<30;$z++){;p($b[$i][$z]?
$b[$i][$z]:pack('H8', 20));$b[$i]
[$z]=0;}f}}while(++$e){g;p$xxx;
u$e;t$j*$j;}
// Kalaspuff
In reply to Cube
by Kalaspuff
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.