Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

A Hacktress' First Attempt

by SarahM (Monk)
on Mar 25, 2003 at 21:22 UTC ( #245794=obfuscated: print w/replies, xml ) Need Help??

This is my first attempt at writting a japh, so let me know what you think.
sub p () { #Look a p :^) use constant P=>' )'; #Another P :^\ use constant Q=>'* '; #Alright a Q ;^) substr(P,1,1); #There's that P again :^I } sub q () { #WOW another q :^O eval join '', split /./, s//rxlgcdjqfvbpsohduwyvcmbjdxopd/ & map { +tr/[a..z]/[z..a]/ . P | Q} split //; #Man, P or Q... how can I choose + :^/ } $, = p; #This is just too much of a give away :^( print q; #Just Another Perl Hacktress ;^P
PS. This might not work how you think it does ;^)

Replies are listed 'Best First'.
Re: A Hacktress' First Attempt
by Mr. Muskrat (Canon) on Mar 25, 2003 at 22:16 UTC

    SarahM++ for a fun obfuscation! You had me going in circles for a few minutes... I felt like I was chasing my tail!

    Deobfuscation follows:
    First we strip out all the comments being careful to remove *only* the comments. That leaves us with:
    sub p () { use constant P=>' )'; use constant Q=>'* '; substr(P,1,1); } sub q () { eval join '', split /./, s//rxlgcdjqfvbpsohduwyvcmbjdxopd/ & map { tr/[a..z]/[z..a]/ . P | Q } split //; } $, = p; print q; #Just Another Perl Hacktress ;^P
    That last line fooled you didn't it?

    The q subroutine is only there to confuse you and is not used at all. So we strip it out leaving us with:
    sub p () { use constant P=>' )'; use constant Q=>'* '; substr(P,1,1); } $, = p; print q; #Just Another Perl Hacktress ;^P
    "What is she up to?", you ask?
    $, (output field seperator) is set to the return value of the p subroutine (a space) but the real purpose of the p subroutine is to set the value of the P constant to the string ' )'. $, is not even used so let's strip it down again.
    use constant P => ' )'; print q; #Just Another Perl Hacktress ;^P
    This can be rewritten as:
     print ' #Just Another Perl Hacktress '^' )'

    A space XORed with a space yields a null (\000). A number sign (#) XORed with a ) yields a newline (\n).
    The output is '\000\nJust Another Perl Hacktress '.

    Fixed typo. Thanks LAI!

      Great deobfuing, Mr. Muskrat++

      Update: tpyo was fixed. The rest of my comment is pretty irrelevant now.

      LAI

      __END__
Re: A Hacktress' First Attempt
by beretboy (Chaplain) on Apr 06, 2003 at 03:34 UTC
    "You go girl^H^H^H^HHacktress!" - beretboy

    "Sanity is the playground of the unimaginative" -Unknown
A reply falls below the community's threshold of quality. You may see it by logging in.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (4)
As of 2021-07-27 22:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?