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
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.