Your skill will accomplishwhat the force of many cannot 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

Replies are listed 'Best First'.
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"'

Create A New User
Node Status?
node history
Node Type: note [id://547996]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (5)
As of 2018-02-19 20:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
Voting Booth?
When it is dark outside I am happiest to see ...

Results (266 votes). Check out past polls.

Notices?