This is really, really, cool. I'm going to desecrate it by deobfuscating it merely because it gave me a deeper appreciation of how cool it is (and because I feel somewhat clever for being able to).

First, let's make it a little more readable...

use strict; $\=$/; $_=''; s//#?=>$":}\~>\\!;/; $/ =~ s//s{;};$")!{$"\\:<_!;/e; y{%*-.$'&(#-<}{@-~}s; { y(;-?)[\012r-{)!]s; y/T-_/`-|/; y/{-~/l-}/; redo if s/!/Y</g } print
The only changes other than adding whitespace are that I turned the literal newline in the first translation in the bare block into an escaped octal (\012), and I changed a bunch of substitution and transliteration and quote delimiters. Oh yeah, and I inverted the condition at the end of the block.

Now, taking that bad boy line by line...

use strict; $\=$/; $_='';
These are boring: we set the output record separator to something approximating a newline (platform dependent) so we get a newline at the end of the final printout (also achievable using the -l switch, but less obfuscated that way :-), and we set $_ to nothing in a strict compliant manner.
s//#?=>$":}\~>\\!;/;
This sets $_ to something interesting--remember, $" is a space for most purposes (says perlvar) so $_ is now "#?=> :}\~>\!;".
$/ =~ s//s{;};$")!{$"\\:<_!;/e;
is a mean, nasty, dirtyminded version of
s/;/$")!{$"\\:<_!/;
which really means
substr($_,-1)= $". ')!{' . $" . '\:<_!';
or
substr($_,-1)= ' )!{ \:<_!';
Which, in total, means that the first few lines break down to:
$_ = "#?=> :}~>\! )!{ \:<_!"
And a glimmer of where we're going seems to appear. (Note: we also screwed up our input record separator back there by prepending a "1" to it, owing to the sucessful subsitution inside the substitution, but we don't care.)

Update: killinrax points out that I missed this one: there was originally a literal newline in the left side of the substitution, so we've actually changed it to 1, rather than prepending a 1. D'oh!

Now, it gets interesting.

y{%*-.$'&(#-<}{@-~}s;
To make this easier to read, let's put in ASCII escapes:
y{%\052-\056$'&(\043-\074}{\100-\176}s;
Now, the first few things on the left side don't appear in $_, so we can take them out. The actual sequence on the left side is "%*+'-.$'&(" and none of those appears in $_, so we take out those 9 characters and the first nine on the right side, and we have
y{\043-\074}{\112-\176}s;
In fact, when we take out the parts that never get applied, what we really have is
y/#):</JPac/;
and $_ now reads "J?=> a}~>\! P!{ \ac_!".

Now we enter a bare block, which we will redo until there are no more !'s in $_ (which means we go through it twice, since that global substitution only succeeds once).

y(;-?)[\012r-{)!]s;
means
tr/\073-\077/\012r-{)!/s;
but applying the same principles we did above, we get
tr/\074-\077/r-{)!/s;
and then (since the right side is much longer than the left)
tr/\074-\077/r-u/s; or tr(<=>?)(rstu);
Which leaves us (the first time) with "Just a}~t\! P!{ \ac_!" as our string.

Next we have two very similar transliterations, which tranlate to

y/T-Z[\\]^_/`a-z{|/; y/{|}~/l-z{|}~/;
of which the only useful parts are going to be
y/Y\\_/ehk/; y/{}~/lno/;
This leaves us with "Just anoth! P!l hack!", to which we apply the substitution
s/!/Y</;
Then (since it succeeds) we redo the block, starting with "Just anothY< PY<l hackY<" and ending with "Just another Perl hacker". Since there are no more !s to apply the substitution to, it fails, and we exit the block, and print, getting our answer followed by a newline, because we set the output record separator to "\n" (assuming we're in Unix) way back at the top--remember that? :-)

So if we put it back together, the minimalist version (doing every operation, in almost the same order) is

#!/usr/bin/perl -lw use strict; $_=''; s//#?=> :}\~>\\!;/; substr($_,-1)= ' )!{ \:<_!'; y/#):</JPac/; s/!/Y</g; y(<=>?)(rstu); y/Y\\_/ehk/; y/{}~/lno/; print;
And the funny thing is, it's still almost impossible to read! All in all, an awesome obfu!



If God had meant us to fly, he would *never* have give us the railroads.
    --Michael Flanders


In reply to Re: Line Noise (deobfuscation attempt) by ChemBoy
in thread Line Noise by kilinrax

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.