Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked

Re: Undocumented Operator Japh

by chargrill (Parson)
on Nov 21, 2006 at 22:52 UTC ( #585379=note: print w/replies, xml ) Need Help??

in reply to Undocumented Operator Japh

Clever! liverpole++

Here's a crack at deobfuscating it:

Update: Cleared up the "obfuscated deobfuscation" as noted by ysth, though the original test was written to most closely resemble (from at least my point of view) the original obfuscated code. Apologies for any confusion. Also added a little extra explanation (with reference to associated documentation).

s**lil*; $*=join'',sort split q**; s;.*;grr; &&s+(.(.)).+$2$1+; $; = qq-$_-;s,.*,ahc,;$,.=chop for split q,,,reverse;print for($,,$;,$*,$/)

Replies are listed 'Best First'.
Re^2: Undocumented Operator Japh
by liverpole (Monsignor) on Nov 22, 2006 at 12:59 UTC
    Nicely done, chargrill, as always++

    One of the fun parts of creating the obfuscation was writing the subroutine to "decrement" a word (eg. "Jus"-- => "Jur").

    It wasn't clear initially clear how many "increments" I was going to want to make, and if it turned out to be more than a few (as it certainly did), I needed to a subroutine to do it.

    This was what I ended up with:

    sub decrement_word { my ($pword) = @_; my @vals = map { ord $_ } (split //, $$pword); my $idx = $#vals; while (1) { if ($vals[$idx] != ord('a') and $vals[$idx] != ord('A')) { --$vals[$idx]; last; } if (0 == $idx) { shift @vals; last; } $vals[$idx] += 25; --$idx; } my $word = join '', map { chr } @vals; $$pword = $word; }

    It's too bad, I think, that a word "decrement" isn't part of the Perl language, at least for the obfuscatory potential it would provide. ;-)

Re^2: Undocumented Operator Japh
by ysth (Canon) on Nov 22, 2006 at 01:09 UTC

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (5)
As of 2023-06-06 13:10 GMT
Find Nodes?
    Voting Booth?
    How often do you go to conferences?

    Results (26 votes). Check out past polls.