Very nice. Although I had to cheat (had to print em) to figure out the unpack/pack combo, I was able so solve every thing else by hand. I had fun de-obfuing it. Note that the deobfu won't run the same as the original because spacing matters.

# A long string containing code is assigned to $raven. Colons # are actually spaces, as you will see later: my$raven=' # I admit, I had to cheat here; I actually had to print these # out to find out what they are. But then again, its pack # and unpack, its near impossible to solve them by hand... # Btw, a hint on the unpack one: it is actually quoted with # a q||, its not a bareword. the unpack one is in unicode, # which is translated to ascii; the pack is in hex (the * # means "apply to all characters"), and it returns a list # (which is ok, since print accepts a list!) # oh, and btw, these print the title. print:unpack("u",q|=5&AE(%)A=F5N(&)Y($5D9V%R($%L;&5N(%!O90H`|); print:pack("H*","51756f74682074686520726176656e203a0a"); # open $0 (the name of the file this is in) and assign it to # the filehandle LENORE. The < means the handle is for reading # only. open(LENORE,"<$0")||die$!; # $bird = 'nevermore'; $bird=q|nevermore|; # @saying = ('n', 'e', 'v', 'e', 'r', 'm', 'o', 'r', 'e'); @saying=split(//,$bird); # get rid of the shebang by using the filehandle in void context; # since the source code of the file is in <LENORE> because of # the open, using it in void context is kind of like shift(ing) it. <LENORE>; # same context to get rid of blank line <LENORE>; # loop through the rest of LENORE for(<LENORE>) { # replac all non space characters with a colon # \x3a is a colon btw :) (its in hex; 3a = 58 in # decimal; the \x "chr(s)" it; print chr(58) if # you don't believe me :) s|\S|\x3a|g; # globally replace all spaces (\x20 is a space; also, the # shape of ascii art is a silhoutte of a raven; the # silhoutte is what is being modified) with # '$saying[int$t++%9]', the e modifier makes it eval it, # below is an explanation of the inside: # first of all, the reason for the non-strict and # non-warnings is because $t is never declared. It # starts off at 0, and gets ++(ed) every pass through # the loop. Next, it gets modulus(ed) by 9, which # happens to be the size of @saying ($#saying). # Finally, this value is int(ed) so the value is an # integer. In this way, the phrase 'nevermore' is # "looped" through. s|\x20|$saying[int$t++%9]|ge; # $_ (current value of <LENORE>) is printed. print; # loop ends } # filehandle closed like a good boy ;) close(LENORE); # raven is end-quoted. '; # $_ is set to $raven $_=$raven; # all spaces are removed. $_=~s/\s//gx; # colons are changed to spaces; $_=~s/\x3a/\x20/g;eval # the whole bloody think is evalled (meaning all # of the code in $raven is evalled since $_ was # set to $raven. # ick sloppy! I need to show you guys a few tricks # to avoid things like this in shaping ;) ;;;;

P.S, don't be a panzy, shape by hand next time ;)


In reply to Re: The Raven by jryan
in thread The Raven by Beatnik

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.