Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Pontifex

 Pontifex

Vadim Pushtaev

May 16, 2015
Tweet

More Decks by Vadim Pushtaev

Other Decks in Programming

Transcript

  1. None
  2. None
  3. None
  4. None
  5. None
  6. None
  7. None
  8. None
  9. None
  10. None
  11. None
  12. None
  13. None
  14. None
  15. None
  16. #!/usr/bin/perl -s $f=$d?-1:1;$D=pack('C*',33..86);$p=shift; $p=~y/a-z/A-Z/;$U='$D=~s/(.*)U$/U$1/; $D=~s/U(.)/$1U/;';($V=$U)=~s/U/V/g; $p=~s/[A-Z]/$k=ord($&)-64,&e/eg;$k=0; while(<>){y/a-z/A-Z/;y/A-Z//dc;$o.=$_}$o.='X' while length ($o)%5&&!$d;

    $o=~s/./chr(($f*&e+ord($&)-13)%26+65)/eg; $o=~s/X*$// if $d;$o=~s/.{5}/$& /g; print"$o\n";sub v{$v=ord(substr($D,$_[0]))-32; $v>53?53:$v} sub w{$D=~s/(.{$_[0]})(.*)(.)/$2$1$3/} sub e{eval"$U$V$V";$D=~s/(.*)([UV].*[UV])(.*)/$3$2$1/; &w(&v(53));$k?(&w($k)):($c=&v(&v(0)),$c>52?&e:$c)}
  17. #!/usr/bin/perl -s print "$x $y $z"; # $ ./test.pl -x=1

    -y=2 -z=3 # 1 2 3
  18. $f=$d?-1:1; $D=pack('C*',33..86); #!"#$%&'()*+,-./0123456789:;<=>@ABCDEFGHIJKLMNOPQRSTUV $p=shift; $p=~y/a-z/A-Z/; $U='$D=~s/(.*)U$/U$1/;$D=~s/U(.)/$1U/;'; ($V=$U)=~s/U/V/g;

  19. sub v { $v=ord(substr($D,$_[0]))-32; $v>53?53:$v } sub w { $D=~s/(.{$_[0]})(.*)(.)/$2$1$3/

    }
  20. sub e { eval"$U$V$V"; $D=~s/(.*)([UV].*[UV])(.*)/$3$2$1/; &w(&v(53)); $k ? (&w($k)) :

    ($c=&v(&v(0)),$c>52?&e:$c) }
  21. $p=~s/[A-Z]/$k=ord($&)-64,&e/eg; $k=0; while (<>) { y/a-z/A-Z/; y/A-Z//dc; $o.=$_ } $o.='X'

    while length ($o)%5&&!$d;
  22. my $ref = \&foo; *bar = \&foo; defined &foo; undef

    &foo; sub foo { print @_; } sub bar { &foo; } bar(1, 2, 3); # prints 123
  23. goto &foo; sub qw { # ... } qw(); #

    LIST &qw(); # sub my $foo = sub { # ... }; &$foo(1, 2, 3); $foo->();
  24. sub foo(&) { shift->(); } foo { ... }; foo(sub

    { ... }); my $bar = sub { ... }; &foo($bar);
  25. $o=~s/./chr(($f*&e+ord($&)-13)%26+65)/eg; $o=~s/X*$// if $d; $o=~s/.{5}/$& /g; print"$o\n";

  26. None
  27. None
  28. None