good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
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... 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... 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. This sets $_ to something interesting--remember, $" is a space for most purposes (says perlvar) so $_ is now "#?=> :}\~>\!;". is a mean, nasty, dirtyminded version of which really means or 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. To make this easier to read, let's put in ASCII escapes: 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 In fact, when we take out the parts that never get applied, what we really have is 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). means but applying the same principles we did above, we get and then (since the right side is much longer than the left) 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 of which the only useful parts are going to be This leaves us with "Just anoth! P!l hack!", to which we apply the substitution 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 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
|
|