in reply to Call .. Call ... Call ..

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 !

Replies are listed 'Best First'.
Re^2: Call .. Call ... Call ..
by cristian (Hermit) on May 27, 2005 at 13:34 UTC
    Excellent , i not to explain best. very good. I will try to create other code more more obfu. je je je. Greeting to yours monks.
Re^2: Call .. Call ... Call ..
by jdalbec (Deacon) on May 28, 2005 at 14:05 UTC