[CrackMonkey] uuencode in awk!

Nick Moffitt nick at zork.net
Wed Jul 26 18:44:18 PDT 2000


http://go-gnome.com

Better yet! 

lynx -source http://go-gnome.com | sudo bash

It has uudecode in awk!





my_uudecode () {
   _awkprog="/tmp/uudecode.$$.awk"
   _uudecode_out=$1

   rm -f ${_uudecode_out}
   cat > ${_awkprog} <<EOF
function x(l, p) {
  n="!\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\\\]^_";
  return index(n,substr(l,p+1,1));
}
/^begin/ {}
/^[^be]/ {
 len = x(\$0, 0);
 for (i=1;len>0;i+=4) {
  a=x(\$0,i);b=x(\$0,i+1);c=x(\$0,i+2);d=x(\$0,i+3);
  printf("%c",a*4+b/16);
  if (len>1) {
   printf("%c",b*16+c/4);
   if (len>2) {
    printf("%c",c*64+d);
   }
  }
  len-=3;
 }
}
EOF
    ${_awk} -f ${_awkprog} > ${_uudecode_out}
    rm -f ${_awkprog}
}



-- 
CrackMonkey.Org - Non-sequitur arguments and ad-hominem personal attacks
LinuxCabal.Org  - Co-location facilities and meeting space 
Pigdog.Org      - The Online Handbook for Bad People of the Future
                You are not entitled to your opinions.





More information about the Crackmonkey mailing list