Considering the fact that cristian is being a mad man about obfu , always posting the most amazingly unreadable code, WE , a collective of rebel obfu solvers , decided to stand up for CLEAN CODE and FREE PIZZA and BEER and CLEAN CODE !!! ( and also for fun ! )

So here goes for this one :

sub x{(caller())[ob-//]}
This defines the sub called x .
It invokes the function caller and takes a subscript of its last element because ob-// always evaluates to -1 .
This element of the result of caller happens to be the line number of where it is called !

Thus all the following subs: ob , fu , sc, etc..., that are only calling this x sub are in fact returning their own line numbers .

At the end comes the definition of the _ function :

sub _{ vec($_,$%,d_)=eval"$%x$_[$%]"; print chr vec($_,$%,d_) }
$% is equal to zero .
d_ is a call to a previously defined sub and if you count the lines you'll see it returns 8 .
This _ function is passed one argument.
For example in the first call :
_(&fu.a)
this is really 4a beacause &fu is defined at line 4 .
So :
eval"$%x$_[$%]";
is really in this case eval"0x4a" , since $_[$%] is subscript zero to @_, which is hex number 4a which is the ascii code for "J" ...

Lastly comes the vec stuff which is really just plain obfu , since what _ really does is print chr of 4a : you can replace the first vec call by a simple assign to $_, and then just print chr $_ . The vec is a binary way of storing the hex value to print.

The _ is then called multiple times on the appropriate hex values, each time printing the correct letter with chr :

_(&fu.a) calls on 4a -> J _(&te.&sc) calls on 75 -> u _(&te.&ob) calls on 73 -> s _(&te.&fu) calls on 74 -> t _(&ob-//.$%) calls on (3-1).'0' that is 0x20 -> Space
Note that in this last line &ob is used, while in the definition of the sub x it is plain ob that is used in ob-// returning -1 and not 2 for some unclear reason ...

Phew ! Wicked !


In reply to Re: Call .. Call ... Call .. by de_cristian_izer
in thread Call .. Call ... Call .. by cristian

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.