Good one! I like the move away from a hex encoding of the JAPH but you soon get back to the dec ASCII code for JAPH. I have thrown in the prints to demonstrate the ease of decoding using prints to see what is going on.
Here is the whitespaced decode.
tachyon
# base string $a='-40300aa03aa01aa02-4-1-2-40503aa-4aaaaa02a-400ab-4-1-2aa-2aba-404- +4-1-2a-400-40503-40505a-403ab-4a-4-4a-1'; print "a1:$a\n"; # change base, sub with more 4xxxxx's $a=~s/b/-4aaa00/g; print "a2:$a\n"; # change again $a=~s/a/-3/g; print "a3:$a\n"; # change again, \ un-necessary $a=~s/\s//g; print "a4:$a\n"; # start a big substitution, in fact change to '.' sep dec ASCII chr for(0..77){ $b.='.' unless ($_*2)%3; print "$b\n"; $b.=4 + substr($a,$_*2,2); print "$b\n"; } # here is a one liner to print it out # just a . split print chr routine print chr $1 while $b=~/([^.]+)\./g # this is the rest of the code, which basically # generates the short code above then evals it #$b=~ s/\./),chr(/g; #$b=~s/^\),/print/; #$b=~s/0(\d\d)/$1/g; #eval($b.')');
Suggestions: use $_ for your string then use s;foo;; to change it (yes this is valid code). Try to avoid $a=...;$a=...;$a=...; as it is easy to brake the lines, and easy to see what gives. Use s/...../...../e so you can put heaps of code into the RHS. Use ; " ' as regex delims. Be original. Have fun. R&D (Rip-off and Duplicate!) This is my personal best so far. It uses lots of stuff to make it poetic as well as obfu. If you decode it that will be a (public) first. Working out why it parses is a good start, I'm not convinced I understand.
################################################################ # # # A Thought on Perl Poetry and the Immortal JAPH # # # # I, require strict* and do not require warnings*. My answer # # equals reference you unless answer equals 42. Question: If # # defined, by this paradigm, do you do, the hacker foo? Now # # join the data (why Fs & Os?), so the space or newline goes # # Character evaluate: Reverse split null, then for each foo: # # You ate foo, but I ate two. Answer -> Join with null, sort # # the spots, and print it join the dots. Go now and exit, do # # not die, else go to question and answer why? JAPH! (c)JADF # # # ################################################################ I, require strict and do(not require warnings); my $answer = \$u unless $answer == '42'; Question: if(defined by this_paradigm do you_do_the_hacker_foo(??)){sub AUTOLOAD{$_=$now=join'the',<DATA> ;y?FO?01?; s.o|the| |\n..goe;s/(.{7})/(chr(eval'($u,$ate)=(0,1); foreach $foo(reverse split "",$1){$u+=$ate*$foo;$but_I=$ate*=2;} $$answer'))/eg;$_= join'',sort/(..)/g and print join'',/.(.)/go; $now and exit, do(not die)}}else{goto Question and $answer;y???} __DATA__ OOFFOOOOOFOO OFOO OOFFFOOOFFO FOOO FFOO OFFO FFFOOFOOOFOF OFFFFOOF OFFFOOFOOOOO OFOO FOFO FFFF FOOO FOOF OOFO FOOO OFOF OOOO FFOF OOOF OFOF OOFO FFFO OFFF OOOO OFFO OOOF FFFO OFFO FOFOOOFFOFFO FFFFFOOOFOFF OOFFFFOOOFFO FFOO OFOF FOOFFOFOFOFF FFFOOFFOOFO FFFFFOOOOFOF OOOF FFOO OOOF FFOO OFOO FFOO OFFF FOOO FF OFOO FOOO OOOF FOFO OOFO OFFO OOFFOFOO FFFO FOOO FOFO OOFO FFOO OOFO FFOOOF OOOO OFFO FOOO OOFF OFOF
In reply to Re: My first obfu..
by tachyon
in thread My first obfu..
by lachlan
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |