Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

cyclic s///

by oha (Friar)
on Nov 06, 2007 at 16:43 UTC ( #649256=obfuscated: print w/replies, xml ) Need Help??

probably there are few places where the code is executed as expected, but the results arent:
$a=$_=q[s/\n(.*?)\W#([^\n]*)/\n$2 #$1/gs;print "%=2Zi5" #"!'5F,&" #'o8$\%t']. q[ #"')\"E,&\n" ^ 'OHA.IT' ;]; {eval; redo unless $a eq $_}
The main program is in the last line: a hacked loop which stop when $a eq $_. (see redo)
before that we assign $a and $_ with the same value, so it seems that the loop will stop after the first cycle, but that's wrong!
While evaluating $_, $_ is not localized so the first instruction of $_ (s///) will change $_ itself; by rotating the following lines comments.
so the print will process "%=2Zi5" the first time, "!'5F,&" the second and so on.
this string is bitwise xor-ed with 'OHA.IT' (see perlop) returning 'just a','nother',' perl ','hacker'

By itself, the hiding of the information isn't so strong, but i liked the way the code is executed.
oh... i forgot.. there is another trick inside!

Oha

Replies are listed 'Best First'.
Re: cyclic s///
by LassiLantar (Monk) on Nov 09, 2007 at 21:35 UTC

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (4)
As of 2022-01-16 21:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:












    Results (50 votes). Check out past polls.

    Notices?