Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Jumping Tux!

by X-3mE (Acolyte)
on Jul 18, 2004 at 13:39 UTC ( [id://375376] : obfuscated . print w/replies, xml ) Need Help??

Only 4 Bash. Inspired by an old obfu (that one with jumpin' balls). I'm not a script kiddie, I only wrote new tool for obfuscation, then I saw that script with Tux jumping in my perl scripts directory, and I thought to make an obfu... enjoy it.
Plz call it with 2 numeric args or it won't have effects. (the numeric args are the columns and the rows of your terminal)

'Njoy it guys
#!/usr/bin/perl ########################################### # Jumping Tux Obfu v0.1_alpha by X-3mE'89 # # Written for Perlmonks.org on 18/07/2k4 # ########################################### ###################################### # Tools used to create this obfu: # # # # . Slackware Linux 9.1 as O.S. # # . "banner" for the shape # # . "mask.pl v0.1_alpha" by X-3mE for# # converting normal code into obfu # # following a shape # # . xterm for doing tests # # . emacs for writing source # # # ###################################### # Usage: ./obfu.pl columns lines # example ./obfu.pl 80 24 (in a standard size xterm) $_=q! $x ma x= sh if t& @A RGV;$ yma x=shift &@ARGV ;if(($xmax == "")&or &($ymax=="")) &{ &die& "Usage:&$0&rows&c ols\n "&}$gfx0=("&&\e[1; 32m__ _____");$gfx1=(" &\ e[1;3 2m/&&&&&&&\\");$ gf x2=("\e[1;32m|&&0&&&0 &&|");$gfx3=("\e[1; 32m|&&&\e[1;33m, ^,\e[0m&&&\e[1;3 2m|\e[0m");$gfx4=("&\e [1;32m\\&&\e[1;33 m\\_/ \e [0m&&\e[1;32m/\e [0m") ;$ gfx5=("&\e[1;32m/ &&\e[ 1;37m___\e[0m&&\ e[1;3 2m \\\e[0m");$gfx6 =("\ e[ 1;32m|__\e[ 1;37m/& &&\\\e[0 m\e[ 1;32m__ |\e [0m ") ;$ gf x7 =( + "\ e[ 1; 32 m( __ )& && (_ _) \e [0 m" ); $g fx8= (" \e[1; 32m \\&&\ e[1;3 7m\ \___ /\e [0m& &\e [1; 32 m/ \e [0 m" ) ;$ gfx 9=( "\e [1; 33m|\ \^/ |_|\ \^/|\e[0 m");$ gfx10=( "\e[1;33m&\\_/& &&\\_/\ e[0m");$x =1;$y=5;$ xf=1;$yf=1;while(1)& {print&"\ec\e[31m\e[1;".(i nt(($xmax-21)/2)). "HJumpingTux&v0.1_alpha \n\e[2;".(int(( $xmax-21)/2))."H&&&& &by&X-3mE' 89\e[0m";limits ();print("\e [" .$ y. "; ".$x."H".$gfx0."\n"."\e[".($y+1 ).";".$x."H".$gfx1."\n"."\e[".( $y+2).";".$x."H".$gfx2."\n"."\e [".($y+3).";".$x."H".$gfx3."\n" ." \e[ ".( $y+ 4) .";". $x."H".$gfx4."\n"."\e[".($y+5). ";".$x."H".$gfx5."\n"."\e[".($y +6).";".$x."H".$gfx6."\n"."\e[ ".($y+7).";".$x."H".$gfx7."\n ". "\e [". ($y +8 ).";" .$x."H".$gfx8."\n"."\e[".($y+9) .";".$x."H".$gfx9."\n"."\e[".($ y+10).";".$x."H".$gfx10."\n"); if($x>=($xmax-12))&{$xf=0}if( $x <4 )& {$ xf =1 }i f( $xf==1)&{$x++}else&{$x--}if($y>=($ymax-11))&{$yf=0}i f($y<5)&{$yf=1}if($yf==1)&{$y++}else&{$y--}system(" sleep&0.05");}sub&limits&{print&"\e[3;2H";for($i=0;$ i<($xmax-3);$i++)&{print&'_'}print&"\e[4;1H/\e[4;".( $xmax-1)."H\\";for($i=5;$i<$ymax;$i++)&{print&"\e[". $i ." ;1 H| "} pr in t& "\ e[ $y ma x; 1H \\ "; fo r( $i =1 ;$ i< ($xmax -2 ); $i++)&{pri nt &' _'}print&' /' ;f or ($i =5; $i< $ym ax;$ i++) &{print&"\ e[".$i.";" .($xmax-1) ."H|"}prin t("\e[".$y max.";5HTy pe&Ctrl-Z&to&quit");} !; s/\s+//g; s/&/ /g; s/\\/\\\\/g; s/\\\\e/\\e/g; s/\\\\\\\\/\\\\/g; s/\\\\n/\\n/g; eval
X-3mE'89
"Considerate la vostra semenza:
    Fatti non foste a viver come bruti,
    Ma per seguir virtute e canoscenza"

Replies are listed 'Best First'.
Re: Jumping Tux!
by wfsp (Abbot) on Jul 18, 2004 at 15:54 UTC
    on winXP, activestate:
    obfu.pl 80 24
    produces...
    'sleep' is not recognized as an internal of external command.
    Plus a continuous scrolling of numbers. It may be good but it may need a health warning. When I get a 'proper' platform I'll try again!
    Take care, wfsp
      The perl code is calling the "sleep" command (ie command line program). I'm guessing WinXP doesn't have a program with that name.

      On my Slackware box though I get a message that says the argument is invalid because sleep(man 1) requires an integer number of seconds or minutes or hours or days.

      Changing the sleep command on line 121 from:
      sleep&0.05");}sub&limits&{print&"\e[3;2H";for($i=0;$
      to
      sleep&1");}sub&limits&{print&"\e[3;2H";for($i=0;$
      lets the program run but it runs at one frame per second.

      Kind of reminds me of the old FreeBSD console screen saver.
        Mmm, I've got Slackware too, but it doesn't give me problems at all. It just runs displayin' that jumping tux (and it jumps very fast!)

        X-3mE'89
        "Considerate la vostra semenza:
            Fatti non foste a viver come bruti,     Ma per seguir virtute e canoscenza"
        Divina Commedia, Inverno, Canto XXVI

Re: Jumping Tux!
by nimdokk (Vicar) on Jul 19, 2004 at 19:09 UTC
    Why did you use system (sleep...) instead of simply using Perl's sleep()? Haven't played with it much beyond changing that to get it to run on WinXP/ActiveState.
      It couldn't work properly on Windoze, since it's a _bash_ animation (then worx only under *nix) and perl's sleep() doesn't accept floating point numbers as arg.
      It doesn't display all that char's you can see under windows, but just a jumping colored tux.

      X-3mE'89
      "Considerate la vostra semenza:
          Fatti non foste a viver come bruti,     Ma per seguir virtute e canoscenza"
      Divina Commedia, Inverno, Canto XXVI

Re: Jumping Tux!
by sschneid (Deacon) on Jul 20, 2004 at 15:03 UTC
    It works under Fedora Core 1. My only beef is that it suggets using 'Ctrl-Z to quit', which doesn't really quit at all.

    Perhaps some sort of signal-capture is in order?

    -s.
      Dunno. Are you using Konsole? Try xterm, or the shell. On my slack ^Z worx... maybe it's SIGHUP, but i'm not sure. Try Ctrl-C or Ctrl-U.

      X-3mE'89
      "Considerate la vostra semenza:
          Fatti non foste a viver come bruti,
          Ma per seguir virtute e canoscenza"
      Divina Commedia, Inverno, Canto XXVI

        ^Z is the default mapping for suspending processes on most UNIX/Linux platforms. I've never seen it set to anything else.

        -s.