我想用deparse反编译字节码,然后我失败了.我做了以下测试:( perl 5.8.9)
1)用单行创建一个名为t.pl的文件
print 1;
Run Code Online (Sandbox Code Playgroud)
2)编译获取plc文件
$ perl -MO=Bytecode,-H,-ot.plc t.pl
Run Code Online (Sandbox Code Playgroud)
3)尝试反编译
$ perl -MO=Deparse t.plc
use ByteLoader 0.06;
t.plc syntax OK
Run Code Online (Sandbox Code Playgroud)
4)使用简明模块$ perl -MO = Concise,-exec t.plc
1 <0> enter
2 <;> nextstate(main 174 y.pl:1) v
3 <0> pushmark s
4 <$> const(IV 1) s
5 <@> print vK
6 <@> leave[1 ref] vKP/REFC
y.plc syntax OK
with this method, we can got some valuable info, but it is hard to read.
Run Code Online (Sandbox Code Playgroud)
我无法获得源代码.我在网上搜索过,似乎 Deparse模块可以解析perlcc -B
生成的文件.
任何的想法?谢谢
是指:
http://ask.slashdot.org/story/05/11/11/0129250/protecting-perl-code
这不能以明显的方式工作的原因是字节码的存储方式。Deparse 需要有一棵 OP 树,但B::Bytecode
只是按执行顺序存储操作而不构建树。在 Bytecode.pm 构造操作树之后,可以通过使用PL_main_root
和PL_main_start
指针然后调用newPROG
它们来对操作树进行线程化。
简而言之,这是可以做到的,但不能使用标准工具。您必须编写一些东西才能做到这一点,这需要对 Perl 内部有一些了解。
归档时间: |
|
查看次数: |
2659 次 |
最近记录: |