Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

The magic dollar

by xiper (Friar)
on Aug 21, 2003 at 22:57 UTC ( #285613=obfuscated: print w/replies, xml ) Need Help??

This is my first attempt at an obfu, nothing spectacularly complex, but hopefully it'll make you look twice. It actually started out as a JAPH, hence the output, but i decided it looked better like this. Any comments would be appreciated!

Tested on Win32 v5.8.0 & Solaris v5.6.1

#! /usr/bin/perl BEGIN { undef $; # behold, the magic dollar } $->new; $ ~= '10011011001111001110101000000100100011'; $ .= '31150460500070422151862305023215186070'; unless( $ == 0 ) { $_ = ( $ .. 9_630_151_829 ); # 9.6 billion dollars! $ .= $; } not map # opposite of map... :) { map { $ *= 2**6; $ ^= substr( $~, $_, 6 ); map { $ == $ =+ $_ } map { $_*( $*/=2 ) } # bare split? split( $, , $^ ); $ ..= chr( $ =+ 72 ); $ == $; } # look ma, it's a regex! /../g; $ ..= $ "##"; # huh? } # what on earth is going on here? split 6 or die $ .. $ /#.+$/g;

- ><iper

my JAPH: print"Just another Perl hacker\n"; # ^ look, no space! pretty tricky huh?

Replies are listed 'Best First'.
Re: The magic dollar
by halley (Prior) on Aug 22, 2003 at 18:34 UTC
    Okay, my brain dissembled a few of the perlvar dollar tricks, but couldn't get around the final split. So I broke down.
    perl -MO=Deparse
    Yikes. How set we are into patterns of convention, of expectations, of assumptions. What a little whitespace abuse will do.

    --
    [ e d @ h a l l e y . c c ]

Re: The magic dollar
by Anonymous Monk on Aug 21, 2003 at 23:04 UTC

      Have you seen "Things are not what they seem like".?

      This obfu isn't anything like it. Yes, it uses $; but it uses most of the rest of perlvar as well.

      It is quite clever. ++

      --
      John.

      Yes, some time ago. I though it was clever, mine appears to use a similar concept, but they're hardly the same...

      - ><iper

      my JAPH: print"Just another Perl hacker\n"; # ^ look, no space! pretty tricky huh?
Re: The magic dollar
by Anonymous Monk on Aug 26, 2003 at 06:50 UTC
    Can someone post a solution?
      I was only mildly impressed by this until I tried to sort it all out. It's a great one, really quite complex. I think the solution is pretty clear and correct. Nice job xiper.


      Brandan L.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: obfuscated [id://285613]
Approved by cfreak
Front-paged by broquaint
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (7)
As of 2023-01-27 15:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?