On the last day of Christmas, Santa gave to me... an obfu to call my own
Ah, distinctly I remember, it was in the bleak December,... Gotta admit, he could've ment Christmas :)
Anyway, the idea has been spooking around in my head for several weeks now... I planned on posting it for my 500th post but I failed to complete it at that time...
#!/usr/bin/perl
my$raven='print:unpack("u"
,q|=5&AE(%)A=F5N (&)Y
($5D9V%R($%L;& 5N(
%!O90H`|);prin t:
pack("H*","5 1 7
56f74682074 686 5
2072617665 6e203
a0a");ope n(LEN
ORE,"<$0 ")||d
ie$!;$b ird=q
|never more|
;@say ing=sp
lit( //,$bir
d); <LENORE>
;< LENORE>;f
o r(<LENORE>
){s|\S|\x3a
|g;s|\x 20|$saying[i
nt$t++ %9]|ge;p
rint;}cl o s e (LENORE)
;';$_=$raven;$_=~s/\s//gx;
$_=~s/\x3a/\x20/g;eval;;;;
And yes, this DOESN'T run under strict :)
The details
How I got here?
- Look for a picture of a bird on the net
- Scale it accordingly
- Use a perl script with GD to convert it to ascii art
- Think about obfu code
- Think about obfu code
- Think about obfu code
- Think about obfu code
- Think about obfu code
- Stuff obfu code in a file and test it
- Write perl script to fill obfu code into ascii art
- Cheat a bit til it fits properly
- write perl script to test obfu code
Write perl script to post code to PM
- Wish EVERYONE a Merry Christmas and a happy new year!!
This is the snippet I used to shape the raven :)
#!/usr/bin/perl
open(RAVEN,"<raven.txt"); # ASCII Art
open(OBFU,"<obfu.pl"); #Store the obfu code here
<OBFU>;<OBFU>; #ignore 2 lines
$line=<OBFU>; #stff everything on 1 line please
@stuff=split(//,$line); #split it up
local $/=undef;
$raven=<RAVEN>; #read ascii art
$raven =~s/#/$stuff[$i++]/mge; #use # as marker for text
open(OUT,">out.pl");
print OUT '#!/usr/bin/perl',"\n\n",$raven; #write it
close(OUT);
Greetz
Beatnik
... Quidquid perl dictum sit, altum viditur.
In reply to The Raven
by Beatnik
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.