Answers:
@ H = @ h =(176,138,140,17,87,54,126,182,217,223,136,130,136,117,73,52,154, 134,161,36,33,92,60,51); for(; $ j <24; $ j ++){$ x = 0; for($ k = 0; $ k <24; $ k ++){$ x + = @ h [$ k] <<($ j * $ k%24); $ x%= 241;} @ H [$ j] = $ x;}打印包('c *',@ H)
我不确定最后是否需要换行符:如果是这样,添加的."\n"
仍然不能使我达到3行* 70个字符/行的限制。
如果不是因为编码问题,则初始化可能会小得多,并且可以通过解压缩提取出来,因此我希望有人可以对此进行改进。我正在考虑制作一个更有效的版本-这是O(n ^ 2),并且可能进行O(n lg n)解码。
eval eval '"'.
('['^"\+").(
('[')^ ')').('`'|')').
('`'|'.'). ('['^'/').('{'^'['
).'\\'.'"' .('`'^ '*').('['^'.').('['^
'(').('['^'/').('{'^ '[').('`'|'!').(('`')|
'.').('`'|'/').("\["^ '/').('`'|'(').('`'|'%'
).('['^')').(('{')^ '[').('{'^'+').('`'|'%').(
'['^')').('`'| ',').('{'^'[').('`'|'(').('`'
|'!').('`'|'#' ).('`'|'+').('`'|'%').('['^')').
'\\'.'"'.("\!"^ '+').'"';$:='.'^'~';$~='@'|"\(";$^=
')'^'[';$/='`'| '.';$,='('^'}';$\='`'|'!';$:=')'^"\}";
$~='*'|"\`";$^= '+'^'_';$/='&'|'@';$,='['&'~';$\=','^'|'
;$:='.'^'~';$~ ='@'|'(';$^=')'^'[';$/='`'|'.';$,='('^'}'
;$\='`'|'!';$: =')'^'}';$~='*'|'`';$^='+'^'_';$/='&'|'@';
$,='['&'~';$\=','^'|';$:='.'^'~';$~='@'|'(';$^=')'^'[';$/=
'`'|'.';$,='('^'}';$\='`'|'!';$:=')'^'}';$~='*'|'`';$^='+'^
'_';$/='&'|'@';$,='['&'~';$\=','^'|';$:='.'^'~';$~='@'|'('
;$^=')'^'[';$/='`'|'.';$,='('^'}';$\='`'|'!';$:=')'^'}';$~=
'*'|'`';$^='+'^'_';$/='&'|'@';$,='['&'~';$\=','^'|';$:='.'^
'~';$~='@'|'(';$^=')'^'[';$/='`'|'.';$,='('^'}';$\='`'|'!'
;$:=')'^'}';$~='*'|'`';$^='+'^'_';$/='&'|'@';$,="\["& '~'
;$\=','^'|';$:='.'^'~';$~='@'|'(';$^=')'^'[';$/='`' |((
'.'));$,='('^'}';$\='`'|'!';$:=')'^'}';$~ ='*'|'`' ;$^
='+'^'_';$/='&'|'@';$,='['&'~';$\=','^ '|';$:= '.'
^'~'; $~='@'|'(';$^=')'^'[';$/="\`"| '.';$,= '('
^'}';$\='`'|'!';$:=')'^'}';$~ =('*')| '`'
;$^='+'^ '_';$/='&' |"\@"; $,='[' &+
'~';$\= ','^'|'; $:='.' ^"\~"; $~
=('@')| "\(";$^= "\)"^ "\["; (
($/))= '`'|'.'; ($,) ='('
^"\}"; $\=('`')| '!'; ($:)
=')'^ "\}";$~= '*'| '`';
($^)= '+'^'_' ;$/= '&'|
'@'; $,='[' &'~' ;$\=
','^ '|' ;$:= '.'^
'~'; $~= '@' |((
'(' )); $^= ')'
^(( '[' )); $/=
'`' |(( '.' ))
;( ($,))= ((
(( '(')) ))
^+ "\}";$\= ((
'`' ))|+ "\!"; $:
=(( ')'))^ '}'; $~=
'*'| "\`";$^= '+' ^'_'
;($/)= ('&')|
"\@";$,= '['&'~'
$_=unpack("H21","9Ø
HvÂláµöÂ");s/(.)/" "x(hex$1<3).substr
"AHPJocehtunarslk",hex$1,1/eg;say
保养:这是ISO-8859-1编码。
perl -E '$_=unpack("H21","9Ø
HvÂláµöÂ");s/(.)/" "x(hex$1<3).substr
"AHPJocehtunarslk",hex$1,1/eg;say'
Just Another Perl Hacker
总共超过70个字符,但少于100个!
wc -clL <<< '$_=unpack("H21","9Ø
HvÂláµöÂ");s/(.)/" "x(hex$1<3).substr
"AHPJocehtunarslk",hex$1,1/eg;say'
3 92 37
还有一点 困惑!
有一个 <1'000一个完整的帮助和一些功能perl脚本:
(它也是ISO-8859-1编码的;)
#!/usr/bin/perl -s
$;=$/;$_=q=sub'O{un=."\144e".q[f}sub'l{$#_==-1?leng].q[th:leng].'t'.q[h&a}sub'u{($.=
q;?02:;)=~y+0-@+a-q+;$. =~s/^/&a?"un].q[":""/mxe;$..=' "b';$..=do{$.].q[=~m+^u+?&a:1
}<<3;$..='","';$..=do{$.].q[=~m+^u+?"\44_":&a};eval $.."\42"}s].q[ub'a{pop}sub'b{$.=
"Hauri Félix, ";$v?do{$_=$.;y+?-^+_-~+;].q[s/\s.*/.ch/mgx;$_=do{$0=~m-j\w+-?$&.q.@.:
(q.w.x3).q,.,}.q qf-q].q[.$_;$..$_}:sub].q[str("lockpents ".$.,&a,1)}sub'p{pr]."in".
q<t do{$#_+1?&a."\n":do{/\n/?$_:$_.".\n"}}};sub'x{e>.pack("v",27000).q<t}sub't{sel>.
"ec".q<t O,&O,O,&a};$v&&{p $0." \251".(30*67)." ".b}&&x;$j&&do{$_="Îx¹\26§ÕIÕ\220º".
"2Õ";$_=>.q<u 12,1;s/.{4}/b ord u O,"$&",O/meg;tr+@-[+`-{+;s/./($.=$&)=~y.^-{.?-\\>.
q<\\.;$./xe;p;$c&&do{$c!=1&&do{$_=$c." ";p};fo>."reac".q<h$=(1..2*l){s/.//m;$_.=$&;p
"\33[A\r".$_;t.1}};x};$/=O;o>.chr(0x38*2).q-en$_,$0;$_=<$_>;$k&&p&&x||$p&&do{p;op-.q
len$p,$p;p<$p>;x};$h&&do{$_="Usal.q lge: ".$0." [ -v | -h | -j [-c[=string]] | -k |l
.q+ -p=file.pl ]";p;x};1+;eval||die+No.$;;
有一些功能:
./japh.pl -h
Usage: ./japh.pl [ -v | -h | -j [-c[=string]] | -k | -p=file.pl ].
哪里:
-v
签名-h
帮助字符串-j
提示只是另一个perl黑客。-c
动画japh字符串或提交的字符串(如果有)-k
自己转储脚本-p
污染另一个脚本所以:
./japh.pl -j
Just another perl hacker.
./japh.pl -k | wc -lcL
14 998 84
./japh.pl -p=$(which perldoc) >japhedPerldoc
chmod +x japhedPerldoc
./japhedPerldoc perl | head
PERL(1) User Contributed Perl Documentation PERL(1)
NAME
perl - The Perl 5 language interpreter
SYNOPSIS
perl [ -sTtuUWX ] [ -hv ] [ -V[:configvar] ]
[ -cw ] [ -d[t][:debugger] ] [ -D[number/list] ]
./japhedPerldoc -j -c
Just another perl hacker.
(最后一个字符串是动画的:)
CPAN上有一个不错的B :: Deparse模块:
perl -MO=Deparse japh.pl
$; = $/;
$_ = qq[sub'O{undef}sub'l{\$#_==-1?length:length&a}sub'u{(\$.=\nq;?02:;)=~y+0-\@+a-q+;\$. =~s/^/&a?"un":""/mxe;\$..=' "b';\$..=do{\$.=~m+^u+?&a:1\n}<<3;\$..='","';\$..=do{\$.=~m+^u+?"\\44_":&a};eval\$.."\\42"}sub'a{pop}sub'b{\$.=\n"Hauri F\351lix, ";\$v?do{\$_=\$.;y+?-^+_-~+;s/\\s.*/.ch/mgx;\$_=do{\$0=~m-j\\w+-?\$&.q.\@.:\n(q.w.x3).q,.,}.q qf-q.\$_;\$..\$_}:substr("lockpents ".\$.,&a,1)}sub'p{print do{\$#_+1?&a."\\n":do{/\\n/?\$_:\$_.".\\n"}}};sub'x{e] . pack('v', 27000) . q[t}sub't{sel] . 'ec' . qq[t O,&O,O,&a};\$v&&{p \$0." \\251".(30*67)." ".b}&&x;\$j&&do{\$_="\316x\271\\26\247\325I\325\\220\272".\n"2\325";\$_=] . 'u 12,1;s/.{4}/b ord u O,"$&",O/meg;tr+@-[+`-{+;s/./($.=$&)=~y.^-{.?-\\' . '\\.;$./xe;p;$c&&do{$c!=1&&do{$_=$c." ";p};fo' . 'reac' . qq(h\$=(1..2*l){s/.//m;\$_.=\$&;p\n"\\33[A\\r".\$_;t.1}};x};\$/=O;o) . 'p' . 'en$_,$0;$_=<$_>;$k&&p&&x||$p&&do{p;op' . 'en$p,$p;p<$p>;x};$h&&do{$_="Usa' . 'ge: ".$0." [ -v | -h | -j [-c[=string]] | -k |' . ' -p=file.pl ]";p;x};1';
die 'No' . $; unless eval $_;
japh.pl syntax OK
好吧,这更多可读性,但是...
好的,有一个pack('v', 27000)
含义:
perl -E "say pack('v', 27000)";
xi
嗯 因此我们可以尝试简化deparser的工作:
perl -MO=Deparse <(sed -e <japh.pl 's/pack("v",27000)/"xi"/')
$; = $/;
$_ = qq(sub'O{undef}sub'l{\$#_==-1?length:length&a}sub'u{(\$.=\nq;?02:;)=~y+0-\@+a-q+;\$. =~s/^/&a?"un":""/mxe;\$..=' "b';\$..=do{\$.=~m+^u+?&a:1\n}<<3;\$..='","';\$..=do{\$.=~m+^u+?"\\44_":&a};eval \$.."\\42"}sub'a{pop}sub'b{\$.=\n"Hauri F\351lix, ";\$v?do{\$_=\$.;y+?-^+_-~+;s/\\s.*/.ch/mgx;\$_=do{\$0=~m-j\\w+-?\$&.q.\@.:\n(q.w.x3).q,.,}.q qf-q.\$_;\$..\$_}:substr("lockpents ".\$.,&a,1)}sub'p{print do{\$#_+1?&a."\\n":do{/\\n/?\$_:\$_.".\\n"}}};sub'x{exit}sub't{select O,&O,O,&a};\$v&&{p \$0." \\251".(30*67)." ".b}&&x;\$j&&do{\$_="\316x\271\\26\247\325I\325\\220\272".\n"2\325";\$_=u 12,1;s/.{4}/b ord u O,"\$&",O/meg;tr+\@-[+`-{+;s/./(\$.=\$&)=~y.^-{.?-\\\\.;\$./xe;p;\$c&&do{\$c!=1&&do{\$_=\$c." ";p};foreach\$=(1..2*l){s/.//m;\$_.=\$&;p\n"\\33[A\\r".\$_;t.1}};x};\$/=O;open\$_,\$0;\$_=<\$_>;\$k&&p&&x||\$p&&do{p;open\$p,\$p;p<\$p>;x};\$h&&do{\$_="Usage: ".\$0." [ -v | -h | -j [-c[=string]] | -k | -p=file.pl ]";p;x};1);
die 'No' . $; unless eval $_;
/dev/fd/63 syntax OK
好了,现在很明显,整个脚本包含在qq(...)
第2行中,必须提交给eval
。现在,我们可以:
perl -MO=Deparse <(sed -e <japh.pl 's/pack("v",27000)/"xi"/') |
sed -ne 's/$_ = \(qq(.*)\);/print \1/p' |
perl
/dev/fd/63 syntax OK
sub'O{undef}sub'l{$#_==-1?length:length&a}sub'u{($.=
q;?02:;)=~y+0-@+a-q+;$. =~s/^/&a?"un":""/mxe;$..=' "b';$..=do{$.=~m+^u+?&a:1
}<<3;$..='","';$..=do{$.=~m+^u+?"\44_":&a};eval $.."\42"}sub'a{pop}sub'b{$.=
"Hauri Félix, ";$v?do{$_=$.;y+?-^+_-~+;s/\s.*/.ch/mgx;$_=do{$0=~m-j\w+-?$&.q.@.:
(q.w.x3).q,.,}.q qf-q.$_;$..$_}:substr("lockpents ".$.,&a,1)}sub'p{print do{$#_+1?&a."\n":do{/\n/?$_:$_.".\n"}}};sub'x{exit}sub't{select O,&O,O,&a};$v&&{p $0." \251".(30*67)." ".b}&&x;$j&&do{$_="Îx¹\26§ÕIÕ\220º".
"2Õ";$_=u 12,1;s/.{4}/b ord u O,"$&",O/meg;tr+@-[+`-{+;s/./($.=$&)=~y.^-{.?-\\.;$./xe;p;$c&&do{$c!=1&&do{$_=$c." ";p};foreach$=(1..2*l){s/.//m;$_.=$&;p
"\33[A\r".$_;t.1}};x};$/=O;open$_,$0;$_=<$_>;$k&&p&&x||$p&&do{p;open$p,$p;p<$p>;x};$h&&do{$_="Usage: ".$0." [ -v | -h | -j [-c[=string]] | -k | -p=file.pl ]";p;x};1
希望Deparser现在可以更好地了解:
perl -MO=Deparse <(sed -e <japh.pl 's/pack("v",27000)/"xi"/') |
sed -ne 's/$_ = \(qq(.*)\);/print \1/p' |
perl |
perl -MO=Deparse
/dev/fd/63 syntax OK
sub O {
undef;
}
sub l {
$#_ == -1 ? length $_ : length &a;
}
sub u {
($. = '?02:') =~ tr/0-@/a-q/;
$. =~ s/^/&a ? 'un' : '';/emx;
$. .= ' "b';
$. .= do {
$. =~ /^u/ ? &a : 1
} << 3;
$. .= '","';
$. .= do {
$. =~ /^u/ ? '$_' : &a
};
eval $. . '"';
}
sub a {
pop();
}
sub b {
$. = "Hauri F\351lix, ";
$v ? do {
$_ = $.;
tr/?-^/_-~/;
s/\s.*/.ch/gmx;
$_ = do {
$0 =~ /j\w+/ ? $& . '@' : 'w' x 3 . '.'
} . 'f-' . $_;
$. . $_
} : substr('lockpents ' . $., &a, 1);
}
sub p {
print do {
$#_ + 1 ? &a . "\n" : do {
/\n/ ? $_ : $_ . ".\n"
}
};
}
sub x {
exit;
}
sub t {
select O(), &O, O(), &a;
}
x if $v and {p($0 . " \251" . 2010 . ' ' . b())};
if ($j) {
$_ = "\316x\271\cV\247\325I\325\220\2722\325";
$_ = u(12, 1);
s/.{4}/b ord u(O(), "$&", O());/egm;
tr/@-[/`-{/;
s[.][($. = $&) =~ tr/^-{/?-\\/;
$.;]ex;
p ;
if ($c) {
if ($c != 1) {
$_ = $c . ' ';
p ;
}
foreach $= (1 .. 2 * l()) {
s/.//m;
$_ .= $&;
p "\e[A\r" . $_;
t 0.1;
}
}
x ;
}
$/ = O();
open $_, $0;
$_ = <$_>;
$p and do {
p ;
open $p, $p;
p <$p>;
x
} unless $k and p and x ;
if ($h) {
$_ = 'Usage: ' . $0 . ' [ -v | -h | -j [-c[=string]] | -k | -p=file.pl ]';
p ;
x ;
}
'???';
- syntax OK
好!现在,我们得到了一些几乎可读的东西。总是会得到相同的结果吗?
perl -MO=Deparse <(sed -e <japh.pl 's/pack("v",27000)/"xi"/') |
sed -ne 's/$_ = \(qq(.*)\);/print \1/p' |
perl |
perl -MO=Deparse |
perl -s /dev/stdin -j -c="That's all folks"
/dev/fd/63 syntax OK
- syntax OK
Just another perl hacker.
That's all folks .
(最后一行是动画的:)
use strict;*1=*CORE'die,*!=*=,@=='hacker',s??'&1(@!,$/)'?ee;s;;%ENV=~m
,..$,,$&+10;e,@!=(chr.'ust',~~reverse('rehtona'),'Perl',$@);&1("@{=}")
它与启用的限制一起使用。尽管它不适用于所有机器/ Perl,但是由于CORE'die
和~~%ENV
。
$ perl
use strict;*1=*CORE'die,*!=*=,@=='hacker',s??'&1(@!,$/)'?ee;s;;%ENV=~m
,..$,,$&+10;e,@!=(chr.'ust',~~reverse('rehtona'),'Perl',$@);&1("@{=}")
^Z
Just another Perl hacker