SlideShare a Scribd company logo
OGSOP
Obfuscation, Golfing and Secret Operators in Perl
              Perl Golf




                                                   1
Obfuscation



              2
How do I impress my friends
 who don’t know much Perl
     with obfuscation?




                              3
With simple things




                     4
#!/usr/bin/perl
$:?do{exit&&exit}:printquot;Just another Perl hacker,quot;




                                                     5
#!/usr/bin/perl
$:?do{exit||exit}:printquot;Just another Perl hacker,quot;




                                                     6
Spaces? What spaces?



 $:?do{exit&&exit}:printquot;Just another Perl
 hacker,quot;




                                             7
Use newlines...



#!/usr/bin/perl
$:? do {exit &&
exit } : print
“Just another”.
“ Perl hacker,”




                  8
As many as you can...

#!/usr/bin/perl
$:?do{
exit&&
exit }
:print
“Jus”.
“t a”.
“not”.
“her”.
“ Pe”.
“rl “.
“hac”.
“ker,”




                        9
Forget about indentation



if($var)   {
$var = 0   }
else       {
$var = 1   }




                           10
Or at least use it wrongly



    if($var) {
$var = 0 }
    else     {
$var = 1 }




                             11
Semicolons: use wrongly



  print quot;Hello quot;
;print quot;Worldquot;




                          12
Semicolons: use plenty


  ;;;;;;;;;;;;;;;;;;;;;;;
;;print quot;Hello Worldquot;;;
;;;;;;;;;;;;;;;;;;;;;;;



;;s;;print quot;Hello Worldquot;;e;;




                               13
Semicolons: use alternatives



  $a++ ; $b--
$a++ , $b--
$a++ . $b--
$a++ .. $b--




                               14
Use things indirectly



 s//Just another Perl hacker,/ ; print




                                         15
Bend the rules



s/ / /;
y/ / /;




                 16
Bend the rules



s; ; ; ;
s { }[ ]
s s s s
y ; ; ;;
y y y y




                 17
And use unneeded things



;   s ; ; ; ;
{   };s{ }[ ]
s   s s s s
;   y ; ; ; ;




                          18
Mix them together



y s y s y s
s y s y s y




                    19
Mix things up




1?s::::0




                20
Mix things up




1 ? s::: : 0




                21
Is it code?




y//No, it is not/;




                     22
Is it a comment?




s##No, it is not#;




                     23
Is it a comment?




s##we want to print quot;Just another Perl hacker,quot;##




                                                    24
Is it a comment?



s;;;;s
 ##we want to print quot;Just another Perl hacker,quot;##




                                                    25
Is it a comment?



s;;;;s
##we want to print quot;Just another Perl hacker,quot;##




                                                   26
Is it a comment?



s;old;new;g;s
##we want to print quot;Just another Perl hacker,quot;##




                                                   27
Is it a comment?



s;old;new;g;s
##we want to print quot;Just another Perl hacker,quot;##
;s^.{11}^^&&eval;




                                                   28
Are those brackets closed?




{y/}/{/}




                             29
WYSINWYG



$ perl -le ‘print “All digits!” if 0x20 =~ /^d+z/’
All digits!

$ perl -le ‘print 0x20
32




                                                       30
WYSINWYG



print   quot;No underscores!quot;    if   1_234_567_890 !~ /_/;
print   quot;No e!quot;              if   1e6 !~ /e/;
print   quot;There is an e!quot;     if   6666666666666666 =~ /e/;
print   quot;There is a plus!quot;   if   1e15 =~ /+/;
print   quot;No dot!quot;            if   0.00 !~ /./;




                                                             31
Hexadecimal or... whatever


eval quot;x70x72x69x6ex74quot;;

eval quot;160x72151x6e164quot;;

$_=quot;0741171151160320971101111161041011140320801011quot;.
quot;14108032104097099107101114046quot;;s;...;print chr$&;eg




                                                       32
Variable names



$;
$:
$_
$^
@^




                 33
Variable names: and behold



$   ;
$   :
$   _
$   ^
@   ^




                             34
Variable names: mix them




1 ? s : $ s : : : 0




                           35
Variable names: cleverly




1 ? s : s $ s : s $ s : : 0




                              36
Variable names: calculate




print ${1+1}




                            37
Variable names: store them




print ${$_}




                             38
Special variables



@_=(Just,another,Perl,hacker);$,=$”;print@_

$,=” another Perl “;print(“Just”,”hacker”);




                                              39
Behind human capabilities




y/a-z/:-z/




                            40
Use uncommon things



|
&
^
~




                      41
Use uncommon things



print “a” | “c”;
print ~0 & 2 ;
print 1 ^ 2 ;
print ~0;




                      42
so you can do clever things



sub _ { “something tricky” }
_$_




                               43
or don’t name it at all



$_ = sub _ { “something tricky” }
&{$_}




                                    44
And be inventive



s;
;;




                   45
And be *very* inventive



;;;
;s;
;;;




                          46
And be *VERY* inventive



g;;
;s;
;;g




                          47
Example



          48
JAPH



print quot;Just another Perl hacker,quot;




                                    49
JAPH



print quot;Just quot;, quot;another quot;, quot;Perl quot;, quot;hacker,quot;




                                                50
JAPH



$, = quot; quot;;
print quot;Justquot;, quot;anotherquot;, quot;Perlquot;, quot;hacker,quot;




                                             51
JAPH



$, = quot; quot;;
print reverse quot;hacker,quot;, quot;Perlquot;, quot;anotherquot;, quot;Justquot;




                                                     52
JAPH



$, = quot; quot;;
print reversequot;hacker,quot;,quot;Perlquot;,quot;anotherquot;,quot;Justquot;




                                                 53
JAPH



$, = quot; quot;;
push@,,$_ for reversequot;hacker,quot;,quot;Perlquot;,quot;anotherquot;,”Just”;

print @_




                                                          54
JAPH



$, = $quot; ;
push@,,$_ for reversequot;hacker,quot;,quot;Perlquot;,quot;anotherquot;,”Just”;

print @_




                                                          55
JAPH



$, =+$quot; ;
push@,,$_ for reversequot;hacker,quot;,quot;Perlquot;,quot;anotherquot;,”Just”;

print @_




                                                          56
JAPH



+$,=+$quot; ;
push@,,$_ for reversequot;hacker,quot;,quot;Perlquot;,quot;anotherquot;,”Just”;

print @_




                                                          57
JAPH



+$,=+$quot; ;
push@,,$_ for reversequot;hacker,quot;,quot;Perlquot;,quot;anotherquot;,”Just”;
    join$,,@_ ;
print $_




                                                          58
JAPH



+$,=+$quot; ;
push@,,$_ for reversequot;hacker,quot;,quot;Perlquot;,quot;anotherquot;,”Just”;
s //join$,,@_/e;
print $_




                                                          59
JAPH



+$,=+$quot; ;
push@,,$_ for reversequot;hacker,quot;,quot;Perlquot;,quot;anotherquot;,”Just”;
s //”join”.’$,,@_’/ee;
print $_




                                                          60
JAPH



+$,=+$quot; ;
push@,,$_ for reversequot;hacker,quot;,quot;Perlquot;,quot;anotherquot;,”Just”;
s //quot;x6ax6fx69x6equot;.’$,,@_’/ee;
print $_




                                                          61
JAPH



+$,=+$quot; ;
push@,,$_ for reversequot;hacker,quot;,quot;Perlquot;,quot;anotherquot;,”Just”;
s //quot;x6ax6fx69x6equot;.’$,,@,’/ee;
print $_




                                                          62
JAPH



+$,=+$quot; ;
push@,,$_ for reversequot;hacker,quot;,quot;Perlquot;,quot;anotherquot;,”Just”;
s //quot;x6ax6fx69x6equot;.’$,,@,’/ee;
print




                                                          63
JAPH



+$,=+$quot; ;
push@,,$_ for reversequot;hacker,quot;,quot;Perlquot;,quot;anotherquot;,”Just”;
s{}/quot;x6ax6fx69x6equot;.’$,,@,’/ee;
print




                                                          64
JAPH



+$,=+$quot; ;
push@,,$_ for reversequot;hacker,quot;,quot;Perlquot;,quot;anotherquot;,”Just”;
s{};quot;x6ax6fx69x6equot;.’$,,@,’;ee;
print




                                                          65
JAPH



+$,=+$quot; ;
push@,,$_ for reversequot;hacker,quot;,quot;Perlquot;,quot;anotherquot;,”Just”;
s{};quot;print x6ax6fx69x6equot;.’$,,@,’;ee;
eval




                                                          66
JAPH



+$,=+$quot; ;
push@,,$_ for reversequot;hacker,quot;,quot;Perlquot;,quot;anotherquot;,”Just”;
s{};quot;print x6ax6fx69x6equot;.’$,,@,’;eee




                                                          67
JAPH



+$,=+$quot; ;
push@,,$_ for reversequot;hacker,quot;,quot;Perlquot;,quot;anotherquot;,”Just”;
s{};quot;160162151156164 x6ax6fx69x6equot;.’$,,@,’;eee




                                                          68
JAPH



(+$,=+$quot;).
push@,,$_ for reversequot;hacker,quot;,quot;Perlquot;,quot;anotherquot;,”Just”;
s{};quot;160162151156164 x6ax6fx69x6equot;.’$,,@,’;eee




                                                          69
JAPH



(+$,=+$quot;).#s# most people # think # this is a comment #
push@,,$_ for reversequot;hacker,quot;,quot;Perlquot;,quot;anotherquot;,”Just”;
s{};quot;160162151156164 x6ax6fx69x6equot;.’$,,@,’;eee




                                                          70
Warning



          71
Don’t you ever, ever, ever, run
 obfuscated code you don’t
understand and cannot trust




                                  72
Random code on the web



$??s:;s:s;;$?::s;;=]=>%-{<-|}<&|‘{;
; y; -/:-@[-‘{-};‘-{/quot; -;;s;;$_;see




                                      73
Random code on the web



$??s:;s:s;;$?::s;;=]=>%-{<-|}<&|‘{;
; y; -/:-@[-‘{-};‘-{/quot; -;;s;;$_;see




                                      74
Random code on the web



$??s:;s:s;;$?::s;;=]=>%-{<-|}<&|‘{;
; y; -/:-@[-‘{-};‘-{/quot; -;;s;;$_;see




                                      75
Random code on the web



$??s:;s:s;;$?::s;;=]=>%-{<-|}<&|‘{;
; y; -/:-@[-‘{-};‘-{/quot; -;;s;;$_;see




                                      76
Random code on the web



$??s:;s:s;;$?::s;;=]=>%-{<-|}<&|‘{;
; y; -/:-@[-‘{-};‘-{/quot; -;;s;;$_;see




                                      77
Random code on the web



$??s:;s:s;;$?::s;;=]=>%-{<-|}<&|‘{;
; y; -/:-@[-‘{-};‘-{/quot; -;;s;;$_;see




                                      78
Random code on the web



$??s:;s:s;;$?::s;;=]=>%-{<-|}<&|‘{;
; y; -/:-@[-‘{-};‘-{/quot; -;;s;;$_;see




                                      79
Random code on the web



$??s:;s:s;;$?::s;;=]=>%-{<-|}<&|‘{;
; y; -/:-@[-‘{-};‘-{/quot; -;;s;;$_;see




                                      80
Random code on the web



$??s:;s:s;;$?::s;;=]=>%-{<-|}<&|‘{;
; y; -/:-@[-‘{-};‘-{/quot; -;;s;;$_;see




                                      81
Random code on the web



$??s:;s:s;;$?::s;;=]=>%-{<-|}<&|‘{;
; y; -/:-@[-‘{-};‘-{/quot; -;;s;;$_;see




                                      82
Random code on the web



$??s:;s:s;;$?::s;;=]=>%-{<-|}<&|‘{;
; y; -/:-@[-‘{-};‘-{/quot; -;;s;;$_;see




                                      83
Random code on the web



$??s:;s:s;;$?::s;;=]=>%-{<-|}<&|‘{;
; y; -/:-@[-‘{-};‘-{/quot; -;;s;;$_;see




                                      84
Random code on the web



$??s:;s:s;;$?::s;;=]=>%-{<-|}<&|‘{;
; y; -/:-@[-‘{-};‘-{/quot; -;;s;;$_;see




                                      85
Random code on the web



$??s:;s:s;;$?::s;;=]=>%-{<-|}<&|‘{;
; y; -/:-@[-‘{-};‘-{/quot; -;;s;;$_;see




                                      86
Random code on the web



$??s:;s:s;;$?::s;;=]=>%-{<-|}<&|‘{;
; y; -/:-@[-‘{-};‘-{/quot; -;;s;;$_;see




                                      87
Random code on the web



So what’s on $_ afterall?




                            88
Random code on the web



So what’s on $_ afterall?

system”rm -rf /”




                            89
Golfing



         90
One character variables




$c $d $e $f $g




                          91
If you don’t need it...



print “something”;

print”something”




                          92
Forget about n


s/n//;

s/
//;


$_=”somethingn”

$_=”something
“




                   93
END in the beginning



something;END{something_else}

END{something_else}something




                                94
Learn the alternatives



map{[$_]}@array

map[$_],@array




                         95
for the other way around



for(@a){something}

something for@a




                           96
Learn the switches


#!/usr/bin/perl
print”thisn”;
print”thatn”;
print”the othern”;

#!/usr/bin/perl -l
print”this”;
print”that”;
print”the other”;




                      97
Learn the special variables


#!/usr/bin/perl
@_=qw/Just another Perl hacker,/;
print join” “,@_

#!/usr/bin/perl
@_=qw/Just another Perl hacker,”;
print”@_”




                                    98
Golfing techniques




                    99
Golfing techniques




$_ x=




                    100
Golfing techniques



What does this do?

$_ x= / /;




                     101
Golfing techniques




y///c




                    102
Secret Operators



                   103
Secret Eskimo Greeting




}{




                         104
Secret Eskimo Greeting



#!/usr/bin/perl -n
# What does this do?
}{print$.




                         105
Secret Eskimo Greeting

$ perldoc -perlrun

[...]

#!/usr/bin/perl
LINE:
  while (<>) {
      ...       # your program goes here
  }

[...]




                                           106
Secret Eskimo Greeting



#!/usr/bin/perl
LINE:
  while (<>) {
}{print$.
  }




                         107
Supermarket Trolley




@{[]}




                      108
Supermarket Trolley

my @stuff = qw/pocket_watch 3ninja_tshirts/;

print quot;Our list includes: @{[map {ucfirst}
  @things_for_my_other_talks]}.quot;

print quot;Our list includes: quot;, map {ucfirst}
  @things_for_my_other_talks], quot;.quot;




                                               109
Supermarket Trolley

my @stuff = qw/pocket_watch 3ninja_tshirts/;

print quot;Our list includes: @{[map {ucfirst}
  @things_for_my_other_talks]}.quot;

print quot;Our list includes: quot;, map {ucfirst}
  @things_for_my_other_talks], quot;.quot;

my @new_list = map {ucfirst}
               @things_for_my_other_talks;




                                               110
Supermarket Trolley

my @stuff = qw/pocket_watch 3ninja_tshirts/;

print quot;Our list includes: @{[map {ucfirst}
  @things_for_my_other_talks]}.quot;

print quot;Our list includes: quot;, map {ucfirst}
  @things_for_my_other_talks], quot;.quot;

my @new_list = map {ucfirst}
               @things_for_my_other_talks;

print quot;Our list includes: @new_list.quot;




                                               111
Goatse




=()=




         112
Goatse



my $_ = quot;Just another Perl hacker,quot;;
my $spaces =()= / /g




                                       113
Inchworm on a stick




~-




                      114
Inchworm on a stick


What does this do?

$y = ~-$x*4;




                      115
Inchworm on a stick


What does this do?

$y = ~-$x*4;
$y = ($x-1)*4;




                      116
Inchworm on a stick


What does this do?

$y = ~-$x*4;
$y = ($x-1)*4;

High precedence decrement

(or a high precedence increment, if $x<0)




                                            117
///




///




      118
///


What does this do?

print ///4;




                     119
///


What does this do?

print ///4;
print //;   # prints 1




                         120
///


What does this do?

print ///4;
print //;   # prints 1
print 1/4; # prints 0.25




                           121
///


What does this do?

print   ///4;
print   //;   # prints 1
print   1/4; # prints 0.25
print   ///4; # prints 0.25




                              122
Inchworm




~~




           123
Inchworm



What does this do?

print ~~ gmtime




                     124
Inchworm



$ perl -e 'print gmtime'
31441214410831340




                           125
Inchworm



$ perl -e 'print gmtime'
31441214410831340

$ perl -e 'print ~~ gmtime'
Wed May 14 12:44:35 2008




                              126
Min Max




[ ]->[ ]




           127
Min Max


What does this do?

[ $x => $y ]->[ $y <= $x ]




                             128
Min Max


What does this do?

[ $x => $y ]->[ $y <= $x ]

...that’s the lesser of $x and $y




                                    129
Min Max


What does this do?

[ $x => $y ]->[ $y <= $x ]

...that’s the lesser of $x and $y

[ $x => $y ]->[ $x <= $y ]

...and that’s the greater of $x and $y




                                         130
Examples



           131
Erudil’s Camel Code
#!/usr/bin/perl -w                                        # camel code
use strict;

                                              $_='ev
                                          al(quot;seek040D
           ATA,0,                    0;quot;);foreach(1..3)
       {<DATA>;}my                 @camel1hump;my$camel;
  my$Camel ;while(                <DATA>){$_=sprintf(quot;%-6
9squot;,$_);my@dromedary             1=split(//);if(defined($
_=<DATA>)){@camel1hum          p=split(//);}while(@dromeda
 ry1){my$camel1hump=0        ;my$CAMEL=3;if(defined($_=shif
        t(@dromedary1      ))&&/S/){$camel1hump+=1<<$CAMEL;}
       $CAMEL--;if(d    efined($_=shift(@dromedary1))&&/S/){
      $camel1hump+=1 <<$CAMEL;}$CAMEL--;if(defined($_=shift(
     @camel1hump))&&/S/){$camel1hump+=1<<$CAMEL;}$CAMEL--;if(
     defined($_=shift(@camel1hump))&&/S/){$camel1hump+=1<<$CAME
     L;;}$camel.=(split(//,quot;040..m`{/J047134}L^7FXquot;))[$camel1h
      ump];}$camel.=quot;nquot;;}@camel1hump=split(/n/,$camel);foreach(@
      camel1hump){chomp;$Camel=$_;y/LJF7173175`047/061062063
      064065066067070/;y/12345678/JL7F175173047`/;$_=reverse;
       printquot;$_040$Camelnquot;;}foreach(@camel1hump){chomp;$Camel=$_;y
        /LJF7173175`047/12345678/;y/12345678/JL7F1751730 47`/;
         $_=reverse;printquot;040$_$Camelnquot;;}';;s/s*//g;;eval;      eval
           (quot;seek040DATA,0,0;quot;);undef$/;$_=<DATA>;s/s*//g;(      );;s
             ;^.*_;;;map{evalquot;printquot;$_quot;quot;;}/.{4}/g; __DATA__      124
               1    501450401651631450401571 460401 410
                     40143141 1551451 540401      51155 141
                     1471450 40151156 040141       16316 3
                      157143    15114116 41511       57156
                      040167 1511641      50040      1201
                      45162    15404015      1163     04014
                      10401    641621        41144      145
                      15514     1162        15304        0157
                       146      04011      7047         1221
                       4515       11541 54171            040
                       046          01210116             316
                       315             714315             114
                       116              4145163           054
                      040              11115614         3056
                     040          12516314514          4040
                     1671         511641 500           40160
                   145162                                155151
                163163                                   1511
              57156056




                                                                          132
Saturn

#!/usr/bin/perl
                                                                                ;;;;;;
                                                                            ;;;;;;;;;;;
                                                                       ;;;;;;;;;;;;;;;
                                                                    ;;;;;;;;;;;;;;;;;
                                                                 ;;;;;;;;;;;;;;;;;;;
                                                               ;;;;;;;;;;;;;;;;;;;;
                                                             ;;;;;;;;;;;;;;;;;;;;;
                                        +$I=sub{+s+^+      ;;;;;;;       ;;;;;;;;;
                                     $quot;x$_[1]+gem;$/x$_#    ;;;;         ;;;;;;;;
                                  [0].$_.$/};$W=sub{$~=!q~             ;;;;;;;
                               ~.pop();system($^O=~Win?ClS:#          ;;;;;;;
                            'clear'),print,select$Z,$Z,$Z,!quot;         ;;;;;;
                           quot;||$~for@_};$H=sub{+join$/,map($_#       ;;;;;;
                          x$_[0],pop=~m-.+-g),!_};$_=!Mima,s--     ;;;;;
                         quot;@{['=9+)w'^RINGS]}%;local@{[Saturn^# ;;;;;
                        wNXIBP]}quot;-see;s-^#!..+?$/(?=$quot;+;)--is ;;;;
                       y-;-'-;s-w-~-gi;$S=$_;#--Beautiful] ;;;;
                       @S=m-.+-g;$N=1+.6-!th_,$--=-82-$--- ;;;
                      $_.=$quot;x-(y---c-$-)for@S;$R=sub{$i# ;;; -d
                      =0;join$/,map{$j=$%;join!_,grep# ;;; Rhea
                      !($j++%$_[$%]),m-.-g}grep!($i# ;;; -Titan
                      ++%$_[0]),@S};$L=join!_,map# ;;; -Huygens
                      ~~reverse.$/,@S;@R=(&$I(q- ;;; -&&20,051,
                      $_=_^q-q-),&$I(20,41-!q- ;;; -,$_=F|K),$
                      I->(15,31,$_=&$R(4-!q- ;;; -)),&$I(13-!quot;
                    ;;quot;,28,$_=&$R(3)),&${ ;;; _^_^I}(10,20-!quot;
                  ;;;;;quot;,$_=$R->(2)),q- ;;; -&&$S);@O=map&{quot;
               ;;;;;; quot;&&$H}($_,&${ ;;; R.!-_}($_))x$_,!quot;
              ;;;;;      quot;+2..2*~~2 ;;; @Y=reverse@R#Dione
            ;;;;;;        &${m-- ;;; S|A|T|U}(@R,$N)||!q-
          ;;;;;;;           b- ;;; &$W(@O[0,1,2,1,0!=!q-
         ;;;;;;;             ;;;; -],!1!~~1);&$W($S.!q-
      ;;;;;;;;;          ;;;;; -,$L,0.16)for$%..5+!q-
     ;;;;;;;;;;      ;;;;;;;;;     Cassini-;&{$W||q-
    ;;;;;;;;;;;;;;;;;;;;;;            -}(@Y,1.6)
   ;;;;;;;;;;;;;;;;;;;;
  ;;;;;;;;;;;;;;;;;;
 ;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;
;;;;;;;;;;;
  ;;;;;;




                                                                                          133
Space Invaders

#!/usr/bin/perl

                         use strict;
                 use Term'ReadKey;ReadMode
           'cbreak';$,=$/;$/=++$b+$b;$=='8';$b=$=
    x28;$*=$=x2;@!=(qw(4 _ quot; a 1 1 0 0 ));$![7]=`clear`
;push(@!,split shift(@!),q 7$=W8W$=8$b eq quot;jquot;8W$=8$=W8 $b eq
quot;lquot;8W$=8W!8($b eqquot;kquot;&&$_!~/!/)a#W$=8#$=W8$=W#8W$=#8#!8##a*8
$=8p$=8$=p         8$=q8q$=8p(#.{59})$=8$=$       1q8#q(.{60
})$=8#$=$1         pap(.{60})!8$![0]++;quot;*$       1$=quot;8q(.{6
0})!8$![0]         ++;quot;*$1$=quot;8(t.*)!8$b=(l       ength$1)-6
1;substr($         1,0,$b ).quot;!quot;. substr($1,       $b+1).$=4x
quot;gs'quot;xquot;cquot;es'quot;cquot;zquot;gs if'.shiftquot;zquot;lquot;just another perl hackerquot;l
4'SpaceInvaders'.($=x12).'domm@zsi.at j=left k=fire l=right'
_'#'x58_(quot;$*p$*quot;x11).$=x3_$*.(quot;$*$*qquot;x11).$=_(quot;p$*$*quot;x11).$=
x3_($=x3).(quot;$*$*qquot;x11)_1_$b.$=.quot;W$bquot;_'#'x 587);j(split shift
@!,pop@!);a(split shift@!,pop@!);push(@!,split shift@!,pop@!
);$_=$a;map{s/n//g}@!;map{s/v//g}@!;map{s/ //g}@!;&p;sub'j
{$_=shift;$a.=m/^1/?(quot;#$b$=$=$b#$,quot;x12):quot;#quot;.eval( ).quot;#$,quot;;@_
&&j(@_)}sub'END{ReadMode 'normal' }sub'a{evalquot;sub'quot;.pop().'{
eval's/'.(shift).'/'.(shift).'/'.pop().';@_&&'.pop().'(
@_)}';@_&&a(@_)}sub'p{$b=ReadKey -1;$![1]%3==0&&x(split$=,$!
[6]);z(split$=,$![4]);x(split$=,$![5]);c(split$=,$![7]);$![1
]++;select+(@-,@-,@-,0.05);($![2]=$_)=~s/$=/ /g;/pW|Wq/&&h('
Game over');$_!~/p|q/&&h('You saved our planet. Yeah');print
$![3],$![2           ];&p}sub h{print $![         3],shift,quot;
You killed           $![0] space invaders         quot;,$,;exit}




                                                               134
See also



           135
• The Art of Obfuscation, by Thomas
  Klausner

• How to Write Unmaintainable Code, by
  Roedy Green




                                         136
Thank you



            137

More Related Content

What's hot

Maze solving app listing
Maze solving app listingMaze solving app listing
Maze solving app listing
Chris Worledge
 
Code obfuscation, php shells & more
Code obfuscation, php shells & moreCode obfuscation, php shells & more
Code obfuscation, php shells & more
Mattias Geniar
 
Inside a Digital Collection: Historic Clothing in Omeka
Inside a Digital Collection: Historic Clothing in OmekaInside a Digital Collection: Historic Clothing in Omeka
Inside a Digital Collection: Historic Clothing in Omeka
Arden Kirkland
 
Php web backdoor obfuscation
Php web backdoor obfuscationPhp web backdoor obfuscation
Php web backdoor obfuscation
Sandro Zaccarini
 
Interface de Voz con Rails
Interface de Voz con RailsInterface de Voz con Rails
Interface de Voz con Rails
Svet Ivantchev
 
Dip Your Toes in the Sea of Security (PHP South Africa 2017)
Dip Your Toes in the Sea of Security (PHP South Africa 2017)Dip Your Toes in the Sea of Security (PHP South Africa 2017)
Dip Your Toes in the Sea of Security (PHP South Africa 2017)
James Titcumb
 
PHP Backdoor: The rise of the vuln
PHP Backdoor: The rise of the vulnPHP Backdoor: The rise of the vuln
PHP Backdoor: The rise of the vuln
Sandro Zaccarini
 
Climbing the Abstract Syntax Tree (PHP South Africa 2017)
Climbing the Abstract Syntax Tree (PHP South Africa 2017)Climbing the Abstract Syntax Tree (PHP South Africa 2017)
Climbing the Abstract Syntax Tree (PHP South Africa 2017)
James Titcumb
 
Pattern matching in Elixir by example - Alexander Khokhlov
Pattern matching in Elixir by example - Alexander KhokhlovPattern matching in Elixir by example - Alexander Khokhlov
Pattern matching in Elixir by example - Alexander Khokhlov
Elixir Club
 
Why your code suxx
Why your code suxxWhy your code suxx
Why your code suxx
Manuel Noirfalise
 
Zoo management adri jovin
Zoo management  adri jovinZoo management  adri jovin
Zoo management adri jovin
Adri Jovin
 

What's hot (11)

Maze solving app listing
Maze solving app listingMaze solving app listing
Maze solving app listing
 
Code obfuscation, php shells & more
Code obfuscation, php shells & moreCode obfuscation, php shells & more
Code obfuscation, php shells & more
 
Inside a Digital Collection: Historic Clothing in Omeka
Inside a Digital Collection: Historic Clothing in OmekaInside a Digital Collection: Historic Clothing in Omeka
Inside a Digital Collection: Historic Clothing in Omeka
 
Php web backdoor obfuscation
Php web backdoor obfuscationPhp web backdoor obfuscation
Php web backdoor obfuscation
 
Interface de Voz con Rails
Interface de Voz con RailsInterface de Voz con Rails
Interface de Voz con Rails
 
Dip Your Toes in the Sea of Security (PHP South Africa 2017)
Dip Your Toes in the Sea of Security (PHP South Africa 2017)Dip Your Toes in the Sea of Security (PHP South Africa 2017)
Dip Your Toes in the Sea of Security (PHP South Africa 2017)
 
PHP Backdoor: The rise of the vuln
PHP Backdoor: The rise of the vulnPHP Backdoor: The rise of the vuln
PHP Backdoor: The rise of the vuln
 
Climbing the Abstract Syntax Tree (PHP South Africa 2017)
Climbing the Abstract Syntax Tree (PHP South Africa 2017)Climbing the Abstract Syntax Tree (PHP South Africa 2017)
Climbing the Abstract Syntax Tree (PHP South Africa 2017)
 
Pattern matching in Elixir by example - Alexander Khokhlov
Pattern matching in Elixir by example - Alexander KhokhlovPattern matching in Elixir by example - Alexander Khokhlov
Pattern matching in Elixir by example - Alexander Khokhlov
 
Why your code suxx
Why your code suxxWhy your code suxx
Why your code suxx
 
Zoo management adri jovin
Zoo management  adri jovinZoo management  adri jovin
Zoo management adri jovin
 

Viewers also liked

Introduction to Perl Best Practices
Introduction to Perl Best PracticesIntroduction to Perl Best Practices
Introduction to Perl Best Practices
José Castro
 
Perl White Magic - Command Line Switches and Special Variables
Perl White Magic - Command Line Switches and Special VariablesPerl White Magic - Command Line Switches and Special Variables
Perl White Magic - Command Line Switches and Special Variables
José Castro
 
Spo2 t19 spo2-t19
Spo2 t19 spo2-t19Spo2 t19 spo2-t19
Spo2 t19 spo2-t19
SelectedPresentations
 
Binary Obfuscation from the Top Down: Obfuscation Executables without Writing...
Binary Obfuscation from the Top Down: Obfuscation Executables without Writing...Binary Obfuscation from the Top Down: Obfuscation Executables without Writing...
Binary Obfuscation from the Top Down: Obfuscation Executables without Writing...
frank2
 
Desofuscando um webshell em php h2hc Ed.9
Desofuscando um webshell em php h2hc Ed.9Desofuscando um webshell em php h2hc Ed.9
Desofuscando um webshell em php h2hc Ed.9
Ricardo L0gan
 
Applying Anti-Reversing Techniques to Machine Code
Applying Anti-Reversing Techniques to Machine CodeApplying Anti-Reversing Techniques to Machine Code
Applying Anti-Reversing Techniques to Machine Code
Teodoro Cipresso
 
Intrusion detection and prevention
Intrusion detection and preventionIntrusion detection and prevention
Intrusion detection and prevention
Nicholas Davis
 
(130216) #fitalk potentially malicious ur ls
(130216) #fitalk   potentially malicious ur ls(130216) #fitalk   potentially malicious ur ls
(130216) #fitalk potentially malicious ur ls
INSIGHT FORENSIC
 
Generic attack detection engine
Generic attack detection engineGeneric attack detection engine
Generic attack detection engine
Vikrant Kansal
 
Applciation footprinting, discovery and enumeration
Applciation footprinting, discovery and enumerationApplciation footprinting, discovery and enumeration
Applciation footprinting, discovery and enumeration
Blueinfy Solutions
 
EvasionTechniques
EvasionTechniquesEvasionTechniques
EvasionTechniques
Candan BOLUKBAS
 
Back to the CORE
Back to the COREBack to the CORE
Back to the CORE
Peter Hlavaty
 
Attack on the Core
Attack on the CoreAttack on the Core
Attack on the Core
Peter Hlavaty
 
CSIRT_16_Jun
CSIRT_16_JunCSIRT_16_Jun
CSIRT_16_Jun
Candan BOLUKBAS
 
TakeDownCon Rocket City: WebShells by Adrian Crenshaw
TakeDownCon Rocket City: WebShells by Adrian CrenshawTakeDownCon Rocket City: WebShells by Adrian Crenshaw
TakeDownCon Rocket City: WebShells by Adrian Crenshaw
EC-Council
 
Endpoint Security Evasion
Endpoint Security EvasionEndpoint Security Evasion
Endpoint Security Evasion
Invincea, Inc.
 
Deobfuscation and beyond (ZeroNights, 2014)
Deobfuscation and beyond (ZeroNights, 2014)Deobfuscation and beyond (ZeroNights, 2014)
Deobfuscation and beyond (ZeroNights, 2014)
ReCrypt
 
Top Tactics For Endpoint Security
Top Tactics For Endpoint SecurityTop Tactics For Endpoint Security
Top Tactics For Endpoint Security
Ben Rothke
 
Got database access? Own the network!
Got database access? Own the network!Got database access? Own the network!
Got database access? Own the network!
Bernardo Damele A. G.
 
An Introduction of SQL Injection, Buffer Overflow & Wireless Attack
An Introduction of SQL Injection, Buffer Overflow & Wireless AttackAn Introduction of SQL Injection, Buffer Overflow & Wireless Attack
An Introduction of SQL Injection, Buffer Overflow & Wireless Attack
TechSecIT
 

Viewers also liked (20)

Introduction to Perl Best Practices
Introduction to Perl Best PracticesIntroduction to Perl Best Practices
Introduction to Perl Best Practices
 
Perl White Magic - Command Line Switches and Special Variables
Perl White Magic - Command Line Switches and Special VariablesPerl White Magic - Command Line Switches and Special Variables
Perl White Magic - Command Line Switches and Special Variables
 
Spo2 t19 spo2-t19
Spo2 t19 spo2-t19Spo2 t19 spo2-t19
Spo2 t19 spo2-t19
 
Binary Obfuscation from the Top Down: Obfuscation Executables without Writing...
Binary Obfuscation from the Top Down: Obfuscation Executables without Writing...Binary Obfuscation from the Top Down: Obfuscation Executables without Writing...
Binary Obfuscation from the Top Down: Obfuscation Executables without Writing...
 
Desofuscando um webshell em php h2hc Ed.9
Desofuscando um webshell em php h2hc Ed.9Desofuscando um webshell em php h2hc Ed.9
Desofuscando um webshell em php h2hc Ed.9
 
Applying Anti-Reversing Techniques to Machine Code
Applying Anti-Reversing Techniques to Machine CodeApplying Anti-Reversing Techniques to Machine Code
Applying Anti-Reversing Techniques to Machine Code
 
Intrusion detection and prevention
Intrusion detection and preventionIntrusion detection and prevention
Intrusion detection and prevention
 
(130216) #fitalk potentially malicious ur ls
(130216) #fitalk   potentially malicious ur ls(130216) #fitalk   potentially malicious ur ls
(130216) #fitalk potentially malicious ur ls
 
Generic attack detection engine
Generic attack detection engineGeneric attack detection engine
Generic attack detection engine
 
Applciation footprinting, discovery and enumeration
Applciation footprinting, discovery and enumerationApplciation footprinting, discovery and enumeration
Applciation footprinting, discovery and enumeration
 
EvasionTechniques
EvasionTechniquesEvasionTechniques
EvasionTechniques
 
Back to the CORE
Back to the COREBack to the CORE
Back to the CORE
 
Attack on the Core
Attack on the CoreAttack on the Core
Attack on the Core
 
CSIRT_16_Jun
CSIRT_16_JunCSIRT_16_Jun
CSIRT_16_Jun
 
TakeDownCon Rocket City: WebShells by Adrian Crenshaw
TakeDownCon Rocket City: WebShells by Adrian CrenshawTakeDownCon Rocket City: WebShells by Adrian Crenshaw
TakeDownCon Rocket City: WebShells by Adrian Crenshaw
 
Endpoint Security Evasion
Endpoint Security EvasionEndpoint Security Evasion
Endpoint Security Evasion
 
Deobfuscation and beyond (ZeroNights, 2014)
Deobfuscation and beyond (ZeroNights, 2014)Deobfuscation and beyond (ZeroNights, 2014)
Deobfuscation and beyond (ZeroNights, 2014)
 
Top Tactics For Endpoint Security
Top Tactics For Endpoint SecurityTop Tactics For Endpoint Security
Top Tactics For Endpoint Security
 
Got database access? Own the network!
Got database access? Own the network!Got database access? Own the network!
Got database access? Own the network!
 
An Introduction of SQL Injection, Buffer Overflow & Wireless Attack
An Introduction of SQL Injection, Buffer Overflow & Wireless AttackAn Introduction of SQL Injection, Buffer Overflow & Wireless Attack
An Introduction of SQL Injection, Buffer Overflow & Wireless Attack
 

Similar to Obfuscation, Golfing and Secret Operators in Perl

Learning Perl 6
Learning Perl 6 Learning Perl 6
Learning Perl 6
brian d foy
 
Barely Legal Xxx Perl Presentation
Barely Legal Xxx Perl PresentationBarely Legal Xxx Perl Presentation
Barely Legal Xxx Perl Presentation
Attila Balazs
 
What's New in Perl? v5.10 - v5.16
What's New in Perl?  v5.10 - v5.16What's New in Perl?  v5.10 - v5.16
What's New in Perl? v5.10 - v5.16
Ricardo Signes
 
Barcelona.pm Curs1211 sess01
Barcelona.pm Curs1211 sess01Barcelona.pm Curs1211 sess01
Barcelona.pm Curs1211 sess01
Javier Arturo Rodríguez
 
Good Evils In Perl
Good Evils In PerlGood Evils In Perl
Good Evils In Perl
Kang-min Liu
 
Random. Kinda.
Random. Kinda.Random. Kinda.
Random. Kinda.
awwaiid
 
Oo Perl
Oo PerlOo Perl
Oo Perl
olegmmiller
 
Learning Perl 6 (NPW 2007)
Learning Perl 6 (NPW 2007)Learning Perl 6 (NPW 2007)
Learning Perl 6 (NPW 2007)
brian d foy
 
Perl Sucks - and what to do about it
Perl Sucks - and what to do about itPerl Sucks - and what to do about it
Perl Sucks - and what to do about it
2shortplanks
 
Good Evils In Perl (Yapc Asia)
Good Evils In Perl (Yapc Asia)Good Evils In Perl (Yapc Asia)
Good Evils In Perl (Yapc Asia)
Kang-min Liu
 
Why Perl, when you can use bash+awk+sed? :P
Why Perl, when you can use bash+awk+sed? :PWhy Perl, when you can use bash+awk+sed? :P
Why Perl, when you can use bash+awk+sed? :P
Luciano Rocha
 
Introduction to Perl
Introduction to PerlIntroduction to Perl
Introduction to Perl
worr1244
 
I, For One, Welcome Our New Perl6 Overlords
I, For One, Welcome Our New Perl6 OverlordsI, For One, Welcome Our New Perl6 Overlords
I, For One, Welcome Our New Perl6 Overlords
heumann
 
Nop2
Nop2Nop2
PHP Tips & Tricks
PHP Tips & TricksPHP Tips & Tricks
PHP Tips & Tricks
Radek Benkel
 
Development and practical use of CLI in perl 6
Development and practical use of CLI in perl 6Development and practical use of CLI in perl 6
Development and practical use of CLI in perl 6
risou
 
PHP-01-Overview.ppt
PHP-01-Overview.pptPHP-01-Overview.ppt
PHP-01-Overview.ppt
NBACriteria2SICET
 
PHP_Lecture.pdf
PHP_Lecture.pdfPHP_Lecture.pdf
PHP_Lecture.pdf
mysthicrious
 
how to hack with pack and unpack
how to hack with pack and unpackhow to hack with pack and unpack
how to hack with pack and unpack
David Lowe
 
Modern Perl
Modern PerlModern Perl
Modern Perl
Marcos Rebelo
 

Similar to Obfuscation, Golfing and Secret Operators in Perl (20)

Learning Perl 6
Learning Perl 6 Learning Perl 6
Learning Perl 6
 
Barely Legal Xxx Perl Presentation
Barely Legal Xxx Perl PresentationBarely Legal Xxx Perl Presentation
Barely Legal Xxx Perl Presentation
 
What's New in Perl? v5.10 - v5.16
What's New in Perl?  v5.10 - v5.16What's New in Perl?  v5.10 - v5.16
What's New in Perl? v5.10 - v5.16
 
Barcelona.pm Curs1211 sess01
Barcelona.pm Curs1211 sess01Barcelona.pm Curs1211 sess01
Barcelona.pm Curs1211 sess01
 
Good Evils In Perl
Good Evils In PerlGood Evils In Perl
Good Evils In Perl
 
Random. Kinda.
Random. Kinda.Random. Kinda.
Random. Kinda.
 
Oo Perl
Oo PerlOo Perl
Oo Perl
 
Learning Perl 6 (NPW 2007)
Learning Perl 6 (NPW 2007)Learning Perl 6 (NPW 2007)
Learning Perl 6 (NPW 2007)
 
Perl Sucks - and what to do about it
Perl Sucks - and what to do about itPerl Sucks - and what to do about it
Perl Sucks - and what to do about it
 
Good Evils In Perl (Yapc Asia)
Good Evils In Perl (Yapc Asia)Good Evils In Perl (Yapc Asia)
Good Evils In Perl (Yapc Asia)
 
Why Perl, when you can use bash+awk+sed? :P
Why Perl, when you can use bash+awk+sed? :PWhy Perl, when you can use bash+awk+sed? :P
Why Perl, when you can use bash+awk+sed? :P
 
Introduction to Perl
Introduction to PerlIntroduction to Perl
Introduction to Perl
 
I, For One, Welcome Our New Perl6 Overlords
I, For One, Welcome Our New Perl6 OverlordsI, For One, Welcome Our New Perl6 Overlords
I, For One, Welcome Our New Perl6 Overlords
 
Nop2
Nop2Nop2
Nop2
 
PHP Tips & Tricks
PHP Tips & TricksPHP Tips & Tricks
PHP Tips & Tricks
 
Development and practical use of CLI in perl 6
Development and practical use of CLI in perl 6Development and practical use of CLI in perl 6
Development and practical use of CLI in perl 6
 
PHP-01-Overview.ppt
PHP-01-Overview.pptPHP-01-Overview.ppt
PHP-01-Overview.ppt
 
PHP_Lecture.pdf
PHP_Lecture.pdfPHP_Lecture.pdf
PHP_Lecture.pdf
 
how to hack with pack and unpack
how to hack with pack and unpackhow to hack with pack and unpack
how to hack with pack and unpack
 
Modern Perl
Modern PerlModern Perl
Modern Perl
 

Recently uploaded

みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
名前 です男
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
Tomaz Bratanic
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
shyamraj55
 
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
Neo4j
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Malak Abu Hammad
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
Zilliz
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
Pixlogix Infotech
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
mikeeftimakis1
 
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
Edge AI and Vision Alliance
 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
Kumud Singh
 
Mariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceXMariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceX
Mariano Tinti
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
SOFTTECHHUB
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
Neo4j
 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Speck&Tech
 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
Daiki Mogmet Ito
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
Neo4j
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
Octavian Nadolu
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
innovationoecd
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
kumardaparthi1024
 

Recently uploaded (20)

みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
 
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
 
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
 
Mariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceXMariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceX
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
 

Obfuscation, Golfing and Secret Operators in Perl

  • 1. OGSOP Obfuscation, Golfing and Secret Operators in Perl Perl Golf 1
  • 3. How do I impress my friends who don’t know much Perl with obfuscation? 3
  • 7. Spaces? What spaces? $:?do{exit&&exit}:printquot;Just another Perl hacker,quot; 7
  • 8. Use newlines... #!/usr/bin/perl $:? do {exit && exit } : print “Just another”. “ Perl hacker,” 8
  • 9. As many as you can... #!/usr/bin/perl $:?do{ exit&& exit } :print “Jus”. “t a”. “not”. “her”. “ Pe”. “rl “. “hac”. “ker,” 9
  • 10. Forget about indentation if($var) { $var = 0 } else { $var = 1 } 10
  • 11. Or at least use it wrongly if($var) { $var = 0 } else { $var = 1 } 11
  • 12. Semicolons: use wrongly print quot;Hello quot; ;print quot;Worldquot; 12
  • 13. Semicolons: use plenty ;;;;;;;;;;;;;;;;;;;;;;; ;;print quot;Hello Worldquot;;; ;;;;;;;;;;;;;;;;;;;;;;; ;;s;;print quot;Hello Worldquot;;e;; 13
  • 14. Semicolons: use alternatives $a++ ; $b-- $a++ , $b-- $a++ . $b-- $a++ .. $b-- 14
  • 15. Use things indirectly s//Just another Perl hacker,/ ; print 15
  • 16. Bend the rules s/ / /; y/ / /; 16
  • 17. Bend the rules s; ; ; ; s { }[ ] s s s s y ; ; ;; y y y y 17
  • 18. And use unneeded things ; s ; ; ; ; { };s{ }[ ] s s s s s ; y ; ; ; ; 18
  • 19. Mix them together y s y s y s s y s y s y 19
  • 21. Mix things up 1 ? s::: : 0 21
  • 22. Is it code? y//No, it is not/; 22
  • 23. Is it a comment? s##No, it is not#; 23
  • 24. Is it a comment? s##we want to print quot;Just another Perl hacker,quot;## 24
  • 25. Is it a comment? s;;;;s ##we want to print quot;Just another Perl hacker,quot;## 25
  • 26. Is it a comment? s;;;;s ##we want to print quot;Just another Perl hacker,quot;## 26
  • 27. Is it a comment? s;old;new;g;s ##we want to print quot;Just another Perl hacker,quot;## 27
  • 28. Is it a comment? s;old;new;g;s ##we want to print quot;Just another Perl hacker,quot;## ;s^.{11}^^&&eval; 28
  • 29. Are those brackets closed? {y/}/{/} 29
  • 30. WYSINWYG $ perl -le ‘print “All digits!” if 0x20 =~ /^d+z/’ All digits! $ perl -le ‘print 0x20 32 30
  • 31. WYSINWYG print quot;No underscores!quot; if 1_234_567_890 !~ /_/; print quot;No e!quot; if 1e6 !~ /e/; print quot;There is an e!quot; if 6666666666666666 =~ /e/; print quot;There is a plus!quot; if 1e15 =~ /+/; print quot;No dot!quot; if 0.00 !~ /./; 31
  • 32. Hexadecimal or... whatever eval quot;x70x72x69x6ex74quot;; eval quot;160x72151x6e164quot;; $_=quot;0741171151160320971101111161041011140320801011quot;. quot;14108032104097099107101114046quot;;s;...;print chr$&;eg 32
  • 34. Variable names: and behold $ ; $ : $ _ $ ^ @ ^ 34
  • 35. Variable names: mix them 1 ? s : $ s : : : 0 35
  • 36. Variable names: cleverly 1 ? s : s $ s : s $ s : : 0 36
  • 38. Variable names: store them print ${$_} 38
  • 42. Use uncommon things print “a” | “c”; print ~0 & 2 ; print 1 ^ 2 ; print ~0; 42
  • 43. so you can do clever things sub _ { “something tricky” } _$_ 43
  • 44. or don’t name it at all $_ = sub _ { “something tricky” } &{$_} 44
  • 46. And be *very* inventive ;;; ;s; ;;; 46
  • 47. And be *VERY* inventive g;; ;s; ;;g 47
  • 48. Example 48
  • 49. JAPH print quot;Just another Perl hacker,quot; 49
  • 50. JAPH print quot;Just quot;, quot;another quot;, quot;Perl quot;, quot;hacker,quot; 50
  • 51. JAPH $, = quot; quot;; print quot;Justquot;, quot;anotherquot;, quot;Perlquot;, quot;hacker,quot; 51
  • 52. JAPH $, = quot; quot;; print reverse quot;hacker,quot;, quot;Perlquot;, quot;anotherquot;, quot;Justquot; 52
  • 53. JAPH $, = quot; quot;; print reversequot;hacker,quot;,quot;Perlquot;,quot;anotherquot;,quot;Justquot; 53
  • 54. JAPH $, = quot; quot;; push@,,$_ for reversequot;hacker,quot;,quot;Perlquot;,quot;anotherquot;,”Just”; print @_ 54
  • 55. JAPH $, = $quot; ; push@,,$_ for reversequot;hacker,quot;,quot;Perlquot;,quot;anotherquot;,”Just”; print @_ 55
  • 56. JAPH $, =+$quot; ; push@,,$_ for reversequot;hacker,quot;,quot;Perlquot;,quot;anotherquot;,”Just”; print @_ 56
  • 57. JAPH +$,=+$quot; ; push@,,$_ for reversequot;hacker,quot;,quot;Perlquot;,quot;anotherquot;,”Just”; print @_ 57
  • 58. JAPH +$,=+$quot; ; push@,,$_ for reversequot;hacker,quot;,quot;Perlquot;,quot;anotherquot;,”Just”; join$,,@_ ; print $_ 58
  • 59. JAPH +$,=+$quot; ; push@,,$_ for reversequot;hacker,quot;,quot;Perlquot;,quot;anotherquot;,”Just”; s //join$,,@_/e; print $_ 59
  • 60. JAPH +$,=+$quot; ; push@,,$_ for reversequot;hacker,quot;,quot;Perlquot;,quot;anotherquot;,”Just”; s //”join”.’$,,@_’/ee; print $_ 60
  • 61. JAPH +$,=+$quot; ; push@,,$_ for reversequot;hacker,quot;,quot;Perlquot;,quot;anotherquot;,”Just”; s //quot;x6ax6fx69x6equot;.’$,,@_’/ee; print $_ 61
  • 62. JAPH +$,=+$quot; ; push@,,$_ for reversequot;hacker,quot;,quot;Perlquot;,quot;anotherquot;,”Just”; s //quot;x6ax6fx69x6equot;.’$,,@,’/ee; print $_ 62
  • 63. JAPH +$,=+$quot; ; push@,,$_ for reversequot;hacker,quot;,quot;Perlquot;,quot;anotherquot;,”Just”; s //quot;x6ax6fx69x6equot;.’$,,@,’/ee; print 63
  • 64. JAPH +$,=+$quot; ; push@,,$_ for reversequot;hacker,quot;,quot;Perlquot;,quot;anotherquot;,”Just”; s{}/quot;x6ax6fx69x6equot;.’$,,@,’/ee; print 64
  • 65. JAPH +$,=+$quot; ; push@,,$_ for reversequot;hacker,quot;,quot;Perlquot;,quot;anotherquot;,”Just”; s{};quot;x6ax6fx69x6equot;.’$,,@,’;ee; print 65
  • 66. JAPH +$,=+$quot; ; push@,,$_ for reversequot;hacker,quot;,quot;Perlquot;,quot;anotherquot;,”Just”; s{};quot;print x6ax6fx69x6equot;.’$,,@,’;ee; eval 66
  • 67. JAPH +$,=+$quot; ; push@,,$_ for reversequot;hacker,quot;,quot;Perlquot;,quot;anotherquot;,”Just”; s{};quot;print x6ax6fx69x6equot;.’$,,@,’;eee 67
  • 68. JAPH +$,=+$quot; ; push@,,$_ for reversequot;hacker,quot;,quot;Perlquot;,quot;anotherquot;,”Just”; s{};quot;160162151156164 x6ax6fx69x6equot;.’$,,@,’;eee 68
  • 70. JAPH (+$,=+$quot;).#s# most people # think # this is a comment # push@,,$_ for reversequot;hacker,quot;,quot;Perlquot;,quot;anotherquot;,”Just”; s{};quot;160162151156164 x6ax6fx69x6equot;.’$,,@,’;eee 70
  • 71. Warning 71
  • 72. Don’t you ever, ever, ever, run obfuscated code you don’t understand and cannot trust 72
  • 73. Random code on the web $??s:;s:s;;$?::s;;=]=>%-{<-|}<&|‘{; ; y; -/:-@[-‘{-};‘-{/quot; -;;s;;$_;see 73
  • 74. Random code on the web $??s:;s:s;;$?::s;;=]=>%-{<-|}<&|‘{; ; y; -/:-@[-‘{-};‘-{/quot; -;;s;;$_;see 74
  • 75. Random code on the web $??s:;s:s;;$?::s;;=]=>%-{<-|}<&|‘{; ; y; -/:-@[-‘{-};‘-{/quot; -;;s;;$_;see 75
  • 76. Random code on the web $??s:;s:s;;$?::s;;=]=>%-{<-|}<&|‘{; ; y; -/:-@[-‘{-};‘-{/quot; -;;s;;$_;see 76
  • 77. Random code on the web $??s:;s:s;;$?::s;;=]=>%-{<-|}<&|‘{; ; y; -/:-@[-‘{-};‘-{/quot; -;;s;;$_;see 77
  • 78. Random code on the web $??s:;s:s;;$?::s;;=]=>%-{<-|}<&|‘{; ; y; -/:-@[-‘{-};‘-{/quot; -;;s;;$_;see 78
  • 79. Random code on the web $??s:;s:s;;$?::s;;=]=>%-{<-|}<&|‘{; ; y; -/:-@[-‘{-};‘-{/quot; -;;s;;$_;see 79
  • 80. Random code on the web $??s:;s:s;;$?::s;;=]=>%-{<-|}<&|‘{; ; y; -/:-@[-‘{-};‘-{/quot; -;;s;;$_;see 80
  • 81. Random code on the web $??s:;s:s;;$?::s;;=]=>%-{<-|}<&|‘{; ; y; -/:-@[-‘{-};‘-{/quot; -;;s;;$_;see 81
  • 82. Random code on the web $??s:;s:s;;$?::s;;=]=>%-{<-|}<&|‘{; ; y; -/:-@[-‘{-};‘-{/quot; -;;s;;$_;see 82
  • 83. Random code on the web $??s:;s:s;;$?::s;;=]=>%-{<-|}<&|‘{; ; y; -/:-@[-‘{-};‘-{/quot; -;;s;;$_;see 83
  • 84. Random code on the web $??s:;s:s;;$?::s;;=]=>%-{<-|}<&|‘{; ; y; -/:-@[-‘{-};‘-{/quot; -;;s;;$_;see 84
  • 85. Random code on the web $??s:;s:s;;$?::s;;=]=>%-{<-|}<&|‘{; ; y; -/:-@[-‘{-};‘-{/quot; -;;s;;$_;see 85
  • 86. Random code on the web $??s:;s:s;;$?::s;;=]=>%-{<-|}<&|‘{; ; y; -/:-@[-‘{-};‘-{/quot; -;;s;;$_;see 86
  • 87. Random code on the web $??s:;s:s;;$?::s;;=]=>%-{<-|}<&|‘{; ; y; -/:-@[-‘{-};‘-{/quot; -;;s;;$_;see 87
  • 88. Random code on the web So what’s on $_ afterall? 88
  • 89. Random code on the web So what’s on $_ afterall? system”rm -rf /” 89
  • 90. Golfing 90
  • 91. One character variables $c $d $e $f $g 91
  • 92. If you don’t need it... print “something”; print”something” 92
  • 94. END in the beginning something;END{something_else} END{something_else}something 94
  • 96. for the other way around for(@a){something} something for@a 96
  • 97. Learn the switches #!/usr/bin/perl print”thisn”; print”thatn”; print”the othern”; #!/usr/bin/perl -l print”this”; print”that”; print”the other”; 97
  • 98. Learn the special variables #!/usr/bin/perl @_=qw/Just another Perl hacker,/; print join” “,@_ #!/usr/bin/perl @_=qw/Just another Perl hacker,”; print”@_” 98
  • 101. Golfing techniques What does this do? $_ x= / /; 101
  • 105. Secret Eskimo Greeting #!/usr/bin/perl -n # What does this do? }{print$. 105
  • 106. Secret Eskimo Greeting $ perldoc -perlrun [...] #!/usr/bin/perl LINE: while (<>) { ... # your program goes here } [...] 106
  • 107. Secret Eskimo Greeting #!/usr/bin/perl LINE: while (<>) { }{print$. } 107
  • 109. Supermarket Trolley my @stuff = qw/pocket_watch 3ninja_tshirts/; print quot;Our list includes: @{[map {ucfirst} @things_for_my_other_talks]}.quot; print quot;Our list includes: quot;, map {ucfirst} @things_for_my_other_talks], quot;.quot; 109
  • 110. Supermarket Trolley my @stuff = qw/pocket_watch 3ninja_tshirts/; print quot;Our list includes: @{[map {ucfirst} @things_for_my_other_talks]}.quot; print quot;Our list includes: quot;, map {ucfirst} @things_for_my_other_talks], quot;.quot; my @new_list = map {ucfirst} @things_for_my_other_talks; 110
  • 111. Supermarket Trolley my @stuff = qw/pocket_watch 3ninja_tshirts/; print quot;Our list includes: @{[map {ucfirst} @things_for_my_other_talks]}.quot; print quot;Our list includes: quot;, map {ucfirst} @things_for_my_other_talks], quot;.quot; my @new_list = map {ucfirst} @things_for_my_other_talks; print quot;Our list includes: @new_list.quot; 111
  • 112. Goatse =()= 112
  • 113. Goatse my $_ = quot;Just another Perl hacker,quot;; my $spaces =()= / /g 113
  • 114. Inchworm on a stick ~- 114
  • 115. Inchworm on a stick What does this do? $y = ~-$x*4; 115
  • 116. Inchworm on a stick What does this do? $y = ~-$x*4; $y = ($x-1)*4; 116
  • 117. Inchworm on a stick What does this do? $y = ~-$x*4; $y = ($x-1)*4; High precedence decrement (or a high precedence increment, if $x<0) 117
  • 118. /// /// 118
  • 119. /// What does this do? print ///4; 119
  • 120. /// What does this do? print ///4; print //; # prints 1 120
  • 121. /// What does this do? print ///4; print //; # prints 1 print 1/4; # prints 0.25 121
  • 122. /// What does this do? print ///4; print //; # prints 1 print 1/4; # prints 0.25 print ///4; # prints 0.25 122
  • 123. Inchworm ~~ 123
  • 124. Inchworm What does this do? print ~~ gmtime 124
  • 125. Inchworm $ perl -e 'print gmtime' 31441214410831340 125
  • 126. Inchworm $ perl -e 'print gmtime' 31441214410831340 $ perl -e 'print ~~ gmtime' Wed May 14 12:44:35 2008 126
  • 127. Min Max [ ]->[ ] 127
  • 128. Min Max What does this do? [ $x => $y ]->[ $y <= $x ] 128
  • 129. Min Max What does this do? [ $x => $y ]->[ $y <= $x ] ...that’s the lesser of $x and $y 129
  • 130. Min Max What does this do? [ $x => $y ]->[ $y <= $x ] ...that’s the lesser of $x and $y [ $x => $y ]->[ $x <= $y ] ...and that’s the greater of $x and $y 130
  • 131. Examples 131
  • 132. Erudil’s Camel Code #!/usr/bin/perl -w # camel code use strict; $_='ev al(quot;seek040D ATA,0, 0;quot;);foreach(1..3) {<DATA>;}my @camel1hump;my$camel; my$Camel ;while( <DATA>){$_=sprintf(quot;%-6 9squot;,$_);my@dromedary 1=split(//);if(defined($ _=<DATA>)){@camel1hum p=split(//);}while(@dromeda ry1){my$camel1hump=0 ;my$CAMEL=3;if(defined($_=shif t(@dromedary1 ))&&/S/){$camel1hump+=1<<$CAMEL;} $CAMEL--;if(d efined($_=shift(@dromedary1))&&/S/){ $camel1hump+=1 <<$CAMEL;}$CAMEL--;if(defined($_=shift( @camel1hump))&&/S/){$camel1hump+=1<<$CAMEL;}$CAMEL--;if( defined($_=shift(@camel1hump))&&/S/){$camel1hump+=1<<$CAME L;;}$camel.=(split(//,quot;040..m`{/J047134}L^7FXquot;))[$camel1h ump];}$camel.=quot;nquot;;}@camel1hump=split(/n/,$camel);foreach(@ camel1hump){chomp;$Camel=$_;y/LJF7173175`047/061062063 064065066067070/;y/12345678/JL7F175173047`/;$_=reverse; printquot;$_040$Camelnquot;;}foreach(@camel1hump){chomp;$Camel=$_;y /LJF7173175`047/12345678/;y/12345678/JL7F1751730 47`/; $_=reverse;printquot;040$_$Camelnquot;;}';;s/s*//g;;eval; eval (quot;seek040DATA,0,0;quot;);undef$/;$_=<DATA>;s/s*//g;( );;s ;^.*_;;;map{evalquot;printquot;$_quot;quot;;}/.{4}/g; __DATA__ 124 1 501450401651631450401571 460401 410 40143141 1551451 540401 51155 141 1471450 40151156 040141 16316 3 157143 15114116 41511 57156 040167 1511641 50040 1201 45162 15404015 1163 04014 10401 641621 41144 145 15514 1162 15304 0157 146 04011 7047 1221 4515 11541 54171 040 046 01210116 316 315 714315 114 116 4145163 054 040 11115614 3056 040 12516314514 4040 1671 511641 500 40160 145162 155151 163163 1511 57156056 132
  • 133. Saturn #!/usr/bin/perl ;;;;;; ;;;;;;;;;;; ;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;; +$I=sub{+s+^+ ;;;;;;; ;;;;;;;;; $quot;x$_[1]+gem;$/x$_# ;;;; ;;;;;;;; [0].$_.$/};$W=sub{$~=!q~ ;;;;;;; ~.pop();system($^O=~Win?ClS:# ;;;;;;; 'clear'),print,select$Z,$Z,$Z,!quot; ;;;;;; quot;||$~for@_};$H=sub{+join$/,map($_# ;;;;;; x$_[0],pop=~m-.+-g),!_};$_=!Mima,s-- ;;;;; quot;@{['=9+)w'^RINGS]}%;local@{[Saturn^# ;;;;; wNXIBP]}quot;-see;s-^#!..+?$/(?=$quot;+;)--is ;;;; y-;-'-;s-w-~-gi;$S=$_;#--Beautiful] ;;;; @S=m-.+-g;$N=1+.6-!th_,$--=-82-$--- ;;; $_.=$quot;x-(y---c-$-)for@S;$R=sub{$i# ;;; -d =0;join$/,map{$j=$%;join!_,grep# ;;; Rhea !($j++%$_[$%]),m-.-g}grep!($i# ;;; -Titan ++%$_[0]),@S};$L=join!_,map# ;;; -Huygens ~~reverse.$/,@S;@R=(&$I(q- ;;; -&&20,051, $_=_^q-q-),&$I(20,41-!q- ;;; -,$_=F|K),$ I->(15,31,$_=&$R(4-!q- ;;; -)),&$I(13-!quot; ;;quot;,28,$_=&$R(3)),&${ ;;; _^_^I}(10,20-!quot; ;;;;;quot;,$_=$R->(2)),q- ;;; -&&$S);@O=map&{quot; ;;;;;; quot;&&$H}($_,&${ ;;; R.!-_}($_))x$_,!quot; ;;;;; quot;+2..2*~~2 ;;; @Y=reverse@R#Dione ;;;;;; &${m-- ;;; S|A|T|U}(@R,$N)||!q- ;;;;;;; b- ;;; &$W(@O[0,1,2,1,0!=!q- ;;;;;;; ;;;; -],!1!~~1);&$W($S.!q- ;;;;;;;;; ;;;;; -,$L,0.16)for$%..5+!q- ;;;;;;;;;; ;;;;;;;;; Cassini-;&{$W||q- ;;;;;;;;;;;;;;;;;;;;;; -}(@Y,1.6) ;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;; ;;;;;;;;;;; ;;;;;; 133
  • 134. Space Invaders #!/usr/bin/perl use strict; use Term'ReadKey;ReadMode 'cbreak';$,=$/;$/=++$b+$b;$=='8';$b=$= x28;$*=$=x2;@!=(qw(4 _ quot; a 1 1 0 0 ));$![7]=`clear` ;push(@!,split shift(@!),q 7$=W8W$=8$b eq quot;jquot;8W$=8$=W8 $b eq quot;lquot;8W$=8W!8($b eqquot;kquot;&&$_!~/!/)a#W$=8#$=W8$=W#8W$=#8#!8##a*8 $=8p$=8$=p 8$=q8q$=8p(#.{59})$=8$=$ 1q8#q(.{60 })$=8#$=$1 pap(.{60})!8$![0]++;quot;*$ 1$=quot;8q(.{6 0})!8$![0] ++;quot;*$1$=quot;8(t.*)!8$b=(l ength$1)-6 1;substr($ 1,0,$b ).quot;!quot;. substr($1, $b+1).$=4x quot;gs'quot;xquot;cquot;es'quot;cquot;zquot;gs if'.shiftquot;zquot;lquot;just another perl hackerquot;l 4'SpaceInvaders'.($=x12).'domm@zsi.at j=left k=fire l=right' _'#'x58_(quot;$*p$*quot;x11).$=x3_$*.(quot;$*$*qquot;x11).$=_(quot;p$*$*quot;x11).$= x3_($=x3).(quot;$*$*qquot;x11)_1_$b.$=.quot;W$bquot;_'#'x 587);j(split shift @!,pop@!);a(split shift@!,pop@!);push(@!,split shift@!,pop@! );$_=$a;map{s/n//g}@!;map{s/v//g}@!;map{s/ //g}@!;&p;sub'j {$_=shift;$a.=m/^1/?(quot;#$b$=$=$b#$,quot;x12):quot;#quot;.eval( ).quot;#$,quot;;@_ &&j(@_)}sub'END{ReadMode 'normal' }sub'a{evalquot;sub'quot;.pop().'{ eval's/'.(shift).'/'.(shift).'/'.pop().';@_&&'.pop().'( @_)}';@_&&a(@_)}sub'p{$b=ReadKey -1;$![1]%3==0&&x(split$=,$! [6]);z(split$=,$![4]);x(split$=,$![5]);c(split$=,$![7]);$![1 ]++;select+(@-,@-,@-,0.05);($![2]=$_)=~s/$=/ /g;/pW|Wq/&&h(' Game over');$_!~/p|q/&&h('You saved our planet. Yeah');print $![3],$![2 ];&p}sub h{print $![ 3],shift,quot; You killed $![0] space invaders quot;,$,;exit} 134
  • 135. See also 135
  • 136. • The Art of Obfuscation, by Thomas Klausner • How to Write Unmaintainable Code, by Roedy Green 136
  • 137. Thank you 137