use*_*975 4 regex perl source-code-protection
我正在寻找一个想法.一个想法,可以 - 在某种形式 - 允许我胡椒我的Perl代码与难以删除的版权评论,所以它几乎难以辨认,很难使用正则表达式删除 - 代码仍然是可执行文件.
正如其中一位评论者在下面指出的那样,以下技巧可以应用于任何这样的常规技术:
perl -MO=Deparse obfuscated.pl > plaintext.pl
Run Code Online (Sandbox Code Playgroud)
也许这里有人可以找到一个解决方法.
我的贡献,易于解决,但可能绊倒一个邋code的代码窃取者:如果版权声明被篡改,则在代码中引入微妙的错误
例:
sub square_root {
my $arg = shift;
return sqrt($arg + 0.1 * apply_fudge_factor());
}
sub apply_fudge_factor {
return 8410 != unpack("%32W*", ($::D//=join'',<DATA>));
}
print "sqrt(9)=",square_root(9);
__END__
=head1 NAME
my_program.pl - a program by me, and not by you
=head1 AUTHOR
Copyright (c) 2014 by Me
=cut
Run Code Online (Sandbox Code Playgroud)
pod的校验和为8410.如果在__END__
令牌之后进行任何更改,则程序的输出为
sqrt(9)=3.01662062579967
Run Code Online (Sandbox Code Playgroud)