SlideShare uma empresa Scribd logo
1 de 137
Baixar para ler offline
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

Mais conteúdo relacionado

Mais procurados

Maze solving app listing
Maze solving app listingMaze solving app listing
Maze solving app listingChris Worledge
 
Code obfuscation, php shells & more
Code obfuscation, php shells & moreCode obfuscation, php shells & more
Code obfuscation, php shells & moreMattias 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 OmekaArden Kirkland
 
Php web backdoor obfuscation
Php web backdoor obfuscationPhp web backdoor obfuscation
Php web backdoor obfuscationSandro Zaccarini
 
Interface de Voz con Rails
Interface de Voz con RailsInterface de Voz con Rails
Interface de Voz con RailsSvet 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 vulnSandro 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 KhokhlovElixir Club
 
Zoo management adri jovin
Zoo management  adri jovinZoo management  adri jovin
Zoo management adri jovinAdri Jovin
 

Mais procurados (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
 

Destaque

Introduction to Perl Best Practices
Introduction to Perl Best PracticesIntroduction to Perl Best Practices
Introduction to Perl Best PracticesJosé 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 VariablesJosé Castro
 
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.9Ricardo 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 CodeTeodoro Cipresso
 
Intrusion detection and prevention
Intrusion detection and preventionIntrusion detection and prevention
Intrusion detection and preventionNicholas Davis
 
(130216) #fitalk potentially malicious ur ls
(130216) #fitalk   potentially malicious ur ls(130216) #fitalk   potentially malicious ur ls
(130216) #fitalk potentially malicious ur lsINSIGHT FORENSIC
 
Generic attack detection engine
Generic attack detection engineGeneric attack detection engine
Generic attack detection engineVikrant Kansal
 
Applciation footprinting, discovery and enumeration
Applciation footprinting, discovery and enumerationApplciation footprinting, discovery and enumeration
Applciation footprinting, discovery and enumerationBlueinfy Solutions
 
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 CrenshawEC-Council
 
Endpoint Security Evasion
Endpoint Security EvasionEndpoint Security Evasion
Endpoint Security EvasionInvincea, 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 SecurityBen 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 AttackTechSecIT
 

Destaque (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
 

Semelhante a 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 PresentationAttila 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.16Ricardo Signes
 
Good Evils In Perl
Good Evils In PerlGood Evils In Perl
Good Evils In PerlKang-min Liu
 
Random. Kinda.
Random. Kinda.Random. Kinda.
Random. Kinda.awwaiid
 
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 it2shortplanks
 
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? :PLuciano Rocha
 
Introduction to Perl
Introduction to PerlIntroduction to Perl
Introduction to Perlworr1244
 
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 Overlordsheumann
 
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 6risou
 
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 unpackDavid Lowe
 

Semelhante a 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
 

Último

DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...Wes McKinney
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...panagenda
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI AgeCprime
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demoHarshalMandlekar2
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Scott Andery
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch TuesdayIvanti
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfIngrid Airi González
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationKnoldus Inc.
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentPim van der Noll
 

Último (20)

DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI Age
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demo
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch Tuesday
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdf
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog Presentation
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
 

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