Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Easier than it seems

by teamster_jr (Curate)
on May 08, 2006 at 13:11 UTC ( #547996=note: print w/ replies, xml ) Need Help??


in reply to Easier than it seems

I couldn't sleep last night and started deobfuscating this. This is very rough and i haven't investigated too closely how it actually does stuff - just ran perltidy, then dropped some basic substitutions and dropped prints in certain places

as far as i can tell the first line ("with adspace available") sets a hash with this:
%}={ '6' => '1', '1' => '2', '3' => '6', '7' => '1', '2' => '3' };
and sets
$; $. $= $, to 3 1 6 2

Update

if we go through and recursively replace all the $} calls we get this:
sub e { my ( $s, $w, $x, $y, $z, $c ) = ( ( join '', map { chr } 6 * 6 * 3 + 6 + 1, 6 * 6 * 3 + 6 + 1 - 3, 6 * $= * 3 + 6 + 1 - 3 + 2, 6 * 6 * 3 - 3, $= * 6 * 3 - 3 + 3 + 2, 6 * 6 * 3 + $, * 3 + 2, 6 * 6 * 3 - 6, 6 * 6 - 2 - 2, 6 * 6 * 3 + 6 - 1, 2**( 6 + 1 ) - 3 - 1, 6 * 6 + 1, 6 * 6 * 3 + 6 + 1, 6 * 6 + 1, 6 * 6 * 3 + 6 + 1, 6 * 6 + 1, 6 * 6 * 3 + 6 + 1, 2**( 6 + 1 ) - 3 - 1, 6 * 6 + 2**3, 6 * 6, 6 * 6 * 3 + 2 * 3 + 2 * 3, 6 * 6 + 2**3, 6 * 6 * 3 + 6 - 1, 2**( 6 + 1 ) - 3 - 1, 6 * 6 * 3 - 3 - 2 - 2, 2**( 6 + 1 ) - 3 - 1, 6 * 6 + 2**3, 6 * 6, $= * 6 * 3 + 2 * 3 + 2 * 3 + 1 ), @_ ); $s =~ s/(.+)/$1/ee; 0 + $s; } print chr for( join '', do { 1 ^ 1 }, do { $- = e $;+ 1, $= + $., 3 + $., $= + 1, 2; $- += e 1 ^ 1, $; + $., 3, $= + $,, $= + 2; $- += e 1 ^ 1, 1, $,, $= * $; + $, * 2, 6 + $;; $- += e rand, 6 * $, + $= - $., 1 ^ 1, 1 ^ 1, 2 + 6 * 2 - 1; $-; }, do { $- = e rand, 1, 3 + $., 3 + 6 * 2, 6 * 3 - 3; $- += e 1 ^ 1, 1, 3, 6 * 3 * 6 + 1, 3 + $.; $- += e 1 ^ 1, $= - $., $,, $= - 1, 3 * 6 * 3 + 3; $- += e rand, 1, 1, 3, 6 + 6 * 3 - 1; $- += e 1 ^ 1, 1, 1 ^ 1, $,; $-; }, do { 2 * 6 * 3 * 2 - 6 * 2; }, do { $- = e 1 ^ 1, 6**3 + 6**2 * 3 - 2**2, $,, 2 + 1 + 6 * 3; $- += e rand, 6**2 - 3 + 3**( 2 * 2 ) - 3 * 3 * 2 + 1, 1 ^ 1, 1 ^ 1, 1 ^ 1; $-; }, do { $- = e 1 ^ 1, 1, 3, $=, $,; $- += 2**6 + 6**2 + 3 - 2; $-; }, do { 2 + 2**6 + 6**2 + 3**2; }, do { 1; }, do { 6; }, do { $- = e 6 * 6 - 2, -1 + 3**( 2 * 2 ) + 3 * 6 + 6, 3, $= * $, + $= - $., 3**2**2 + 6; $- += 6 * 3 + 2 + 3**2**2; $-; }, do { $- = e 1 ^ 1, 6**3 - 3**( 2 * 2 ) - 2**( 2 * 2 ) - 3 * 2 + 1, 2, 2**6 + 1, 3 * 3 * 3 + 2 * 2 * 2; $- += 3; $-; }, do { 6 * 3 * 6 * 3 * 6 - 6**( 2 * 2 ) + 1 + 3**6 + 6 * 2 * 6 - 3 * 3 * 2 + 6 * 6 * 3 * 6; }, do { -6 + 6 * 6 * 3 - 1; }, do { $- = e 6 + 3 + 2, 2 + 3 + 6, 3, 2 + 6 + 3, 3 + 6 + 2; $- += e rand, 6 * 6 + 3 + 2, 1, 6 + 3, 2**6 - 2**3 * 2**2; $-; }, do { $- = e rand, 0 - 6 + 6**3 * ( 2 * 2 ) + 1 - 2 - 3**3 * 2, 1; $- += $,; $-; }, do { $- = e $,, -2 * 2 + 3 * 3 * 2 * 3 * 2, 2, 2**( 2 * 2 ) * 6 - 2**( 2 * 2 ), -( 2 * 2 ) - 2**( 2 * 2 ) + 6 * 2**( 2 * 2 ); $- += 6 + 3; $-; }, do { $- = e 3, 3 * 3 * 6 + 2**( 2 * 2 ), $= - $., 2 + 3 * 1 * 2 * 3 + 2 * 3, 3; $- += e 1 + 3**( 2 * 2 ) + 2**( 2 * 2 ) + 1, 2**6 - 1 + 2 * 3 * 3 + 6 * 3, 3, 2 * 6 * 6 + 6 * 2 + 1, -6 + 2 * 6 + 2 * 6 * 6 + 1; $- += e 1, 1, $,, 6 * 6 - 1, $= + $.; $- += e 6 + 1, $= + $., 1 ^ 1, 2**( 3 + 2 ) + 6 * 3 - 1, 6 * 3 + 2 * 3; $-; }, do { -6 * 2 - 1 + 2**3**2 * 2; }, do { $- = e 1 ^ 1, 1, 3 + 1, -1 + 2 * 3**3 - 1, 2 * 3 * 2; $- += e 6 * 6 + 2 + 2, 2 + 2 + 6 * 6, $,, 1 + 2 * 3 * 2, 3 * 6 + 2; $- += e 6 * 2 + 6 - 1, 6 * 6 + 6 + 2, 1 ^ 1, rand, $= + 1; $- + 1 ^ 1; }
and the final regex:
) =~ m$.{\$a{\$a{\$a{\$=}}}}$g;
is just:
=~m/.{3}/g
essentially the bottom block calls sub e, which generates a string:
sprintf q|%s%s%s|,$x,q|e|,$y
(ie the third and fourth arguments with "e" in the middle); this generates:
0741171151160320971101111161041011140320801011141080321040970991071011 +14044
which when split into triplets are just ascii codes.
but of course i could be wrong :)
a


Comment on Re: Easier than it seems
Select or Download Code
Re^2: Easier than it seems
by Hue-Bond (Priest) on May 08, 2006 at 18:16 UTC
    (ie the third and fourth arguments with "e" in the middle)

    Yes. I wanted to insert some dummy code that used the other variables but forgot it :^). Now I think it was a good thing because otherwise that code would stand out among the rest. I also wanted to give the code a dollar shape, but didn't (and don't) know how.

    As for the generation of the code, turo, it wasn't automatic. Just search and replace here and there.

    --
    David Serrano

      no automation? ... umm, maybe you're the automated machine :-P
      good obfuscation though!

      cheers

      perl -Te 'print map { chr((ord)-((10,20,2,7)[$i++])) } split //,"turo"'

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://547996]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (5)
As of 2014-07-31 02:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (244 votes), past polls