http://qs1969.pair.com?node_id=90268

Another one I've been playing with. Perhaps a little silly, but hey -- it's obfuscated, right?

Nevermind. Just don't stare at the result for too long ;-)

I don't do win32, so my apologies to all the windows users if this script fails to execute correctly -- I can't test whether that 'system(cls)' part works. If everything else fails, add any non-zero argument to the command line.



Update: just noticed (and removed) an unnecessary variable in the code. Thank you all for being considerate enough not to point that mistake ;-)

Update 2: added the 'require' line. Thanks, ChemBoy!

#!/usr/bin/perl -w # -w is good for you use strict; # or die slow, horrible death while debugging require 5.005; # for '{} for()' ;-) my $japh; $_='$.=q:SUB%SUB{};sub%SUB{SUB{};}sub%SUB{$_[0]->{V}=$_[1];}sub% SUB{$_=$_[0]->{V}x20;$\=++$_[0]->{A};s/\s/./g;my@t=split//;pop;p ush@_,map{"%"x60}(1..20);$/=0;for(0..600){$\+=0.045;($,,$.)=(30+ 2*$/*sin$\,%10-%$/*cos$\);(!@t)&&last;substr($_[$.],$,,1)%=~%s/% /shift@t/e%unless((%$,<0)or(%$,>=%60)or($.<%0)or($.>=%20));%$/+= 0.03;}%$\=%$/="";join"\n",@_;}SUB%($japh,"p");%:;$.=~s/SUB/$_/fo r%map{join%"",map{chr%(%ord($_)-1)}%split//}qw{%qbdlbhf%q<%UJFTD BMBS%cmftt%TUPSF%GFUDI%ujf%}%;$_=$.;';s/\s//g;s/%/ /g;eval;eval; $japh="Just another perl hacker."; for ( 0..1000 ) { $ARGV[0] or ($^O eq 'MSWin32') ? system('cls') : print `clear`; print "$japh\n"; }


-marcink

Replies are listed 'Best First'.
(jeffa) Re: 1001 JAPHs
by jeffa (Bishop) on Jun 22, 2001 at 02:23 UTC
    Watch out marcink, you'll get sued for eye damage, like Steve Martin in The Jerk. 8P

    For those new to obfuscation, try this little trick:

    • first, comment out the 3rd line: #my $japh;
    • next, add 'my' to the 5th to last line: my $japh="Just Another Perl Hacker";
    Nice work!

    Jeff

    R-R-R--R-R-R--R-R-R--R-R-R--R-R-R--
    L-L--L-L--L-L--L-L--L-L--L-L--L-L--
    
      For those new to obfuscation, try this little trick:

      Spoilsport ;-)

      Actually, the obfuscation here is not very complicated. I don't even know whether this thing qualifies as an obfu. I mean, it's hard to read, but there is just enough mangling to hide 5 or 6 keywords to protect the guilty of abusing a little known Perl feature to make it do the job... then again, that looks like a pretty generic description of quite a number of obfus ;-)

      The thing I like about this particular piece of code is that I learned one more obscure Perl detail that makes me really, really afraid I might at some time be forced to actually use it.



      -marcink
Re: 1001 JAPHs
by mpolo (Chaplain) on Jun 21, 2001 at 10:45 UTC
    I will not use Java...


    I will not use Java...


    I will not use Java...


    Darn. I think I looked at the output too long!

    It certainly wasn't the output I expected. Nice job.

Re: 1001 JAPHs
by Brovnik (Hermit) on Jun 21, 2001 at 12:58 UTC
    The sin and cos give away that there are curves/circles involved, but otherwise well hidden.
    --
    Brovnik
Re: 1001 JAPHs
by VSarkiss (Monsignor) on Jun 21, 2001 at 19:11 UTC
    Cannot... deconstruct...
    Getting... sleepy...

    Seriously, I loved this one! Fun output and very well hidden.

Re: 1001 JAPHs
by Superbabeteam (Initiate) on Jun 23, 2001 at 08:02 UTC
    This is really cool! nice job.
Re: 1001 JAPHs
by beretboy (Chaplain) on Jun 21, 2001 at 23:51 UTC
    wow thats cool! kudos man. lots of kudos
Re: 1001 JAPHs
by Malkavian (Friar) on Jun 26, 2001 at 18:06 UTC
    Yeesh!!
    Great Obfu.. I'd have written more, but my sense of balance means I'm hanging onto the edge of my keyboard trying not to fall over.
    Nice! :)

    Malk