Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: (SPOILER) a new useless obfu

by meta4 (Monk)
on May 30, 2002 at 19:19 UTC ( [id://170486]=note: print w/replies, xml ) Need Help??


in reply to a new useless obfu

Poke A Dot.

When I saw you using dot equal (.=) to poke characters into dollar dot ($.), along with all those dots in your secret string and your regular expression, I was hoping for some cool use of dots. I was kind of disappointed in what I found. Strangely enough, two of the dots in the regular expression, the ones that theoretically could match any character, actually match the dots in the string! I don't know whether this is intentional or not, but it's not very obfuscating.

Points for stringing it all together in one statement though.

Here is a de-obfuscated version. The obfuscated version pretty much does what it looks like it does.

# your string of secret numbers $obfu = '16.115.16.117.6.106.16.113.1.116.1.32.11.36.11.76.16.120.16.1 +18.6.117.6.33.1.65.1.110.1.111.6.117.1.104.16.104.16.117.6.33.1.80.1. +101.1.114.6.109.1.32.16.75.1.97.6.100.6.108.11.103.6.115.16.37.16.62' +; # Split them on the periods @MagicNums = reverse split /\./, $obfu; while( @MagicNums != 0 ) { # Use the magic numbers two at a time $num1 = pop( @MagicNums ); $num2 = pop( @MagicNums ); # The mysterious formula to calulate the ascii value for # the next character $num = $num2 - ( $num1 / 5 - 1 ); # turn it into a character $char = chr( $num ); # String all the characters together to produce: # print "Just Another Perl Hacker"; $TheSecret .= $char; } # run the program eval $TheSecret;

Replies are listed 'Best First'.
Re: Re: a new useless obfu
by mt2k (Hermit) on May 30, 2002 at 21:31 UTC
    which is why I said it was an "attempt". I wasn't really trying for obfu I suppose, but the cool way that the actual code to be executed is "encoded" in numbers. Of course, it isn't hard to do... Just reverse that equation with the code in the string and you will get your numbers (as long as you add all those pesky dots.

    Granted, not really obfu (execpt maybe for that 'or eval $. and exit' part. Took a while to get the write operations ('or'/'and' to make it work right ;)

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (3)
As of 2024-04-26 04:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found