All,
This is my first attempt at intentionally writing obfu though I once accidently
created some. Now it won't be hard to unravel since I have already
explained how it works.
#!/usr/bin/perl
use strict;
use warnings;
my $label;
($_) = <DATA>;
my $magic = join '', map {chr hex} /(..)/g;
eval $magic;
$label = 'START';
print "$label\n";
goto $label;
print "This will not print\n";
START:
print "Hello, world\n";
exit;
END:
print "Goodbye, cruel world\n";
__DATA__
7b6e6f207761726e696e67733b6e6f207374726963743b2a5449455343414c41523d73
+75627b626c6573737b7d7d3b2a53544f52453d7375627b7d3b2a46455443483d73756
+27b24612b2b3f454e443a53544152547d3b746965246c6162656c2c6d61696e7da
I welcome contributions that better obscure the "setup". It would have been even better if
goto worked inside a tied call. Be sure to use the
download link as linebreaks in the DATA segment will currently cause it not to function correctly.
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.