I'm writing my own obfuscated atob/btoa v5 converter, and am trying to capture the output from dc (which does some of the dirty work). I'm half tempted to call myself again inside a pipe to convert the file... but here's what I have so far (with explination):
#!/usr/bin/perl -0777
$f=<STDIN>; #suck the whole file in.
$d='16i[[z]P]sZ[[y]P]sY[la55~21+Sb55~21+Sb55~21+Sb55~21+'.
'Sb21+PLbPLbPLbPLbP]sX[?dsa0=Zla20202020=YlXxlAx]dsAx';
# DC Code. Basically take a 4 byte word and encode it into
# 5 bytes. Until it gets the signal to quit, of course.
open(DC,"|dc -e '$d' > out.d8a"); # open up DC
while($f) {
$f=~s/^(.{0,4})//s; $z=$1; $l+=length $z; # grab 4 bytes
$z.="\0" while((length $z) < 4); # pad it to spec
$z=unpack("H*",$z); print DC "\U$z\E\n"; # send it to DC
}
print DC "q\n"; # tell DC to quit.
--
$Stalag99{"URL"}="http://stalag99.keenspace.com";
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.