我如何逆向工程已经用perlcc编译的Perl程序? [英] How can I reverse-engineer a Perl program that has been compiled with perlcc?
问题描述
我继承了一个在Unix上有一个编译的perl脚本的环境。是否可以反编译,反向工程(无论什么术语),并从编译的目标代码获取源代码?
I inherited an environment that has a "compiled" perl script on Unix. Is it possible to de-compile, reverse engineer (whatever the term is) it, and obtain the source code from the compiled object code ?
可能不可能,但是认为我会问,而不是假设。
Might not be possible, but thought I'd ask rather than assume.
谢谢,
-凯文。
Thanks, -Kevin.
推荐答案
哦我的!
如果且只有它通过 perlcc -B
,您可以 然后以与B :: Deparse相同的方式重新编译。你会得到所有的源没有优化的方式。它可能看起来有点有趣,但它将是一个等价的程序。
If and only if it was compiled into executable byte code via perlcc -B
, you could then uncompile it the same way B::Deparse does. You'd get back all of the source that wasn't optimized away that way. It might look a bit funny, but it would be an equivalent program.
但是,如果它完全编译成C代码,然后汇编到汇编语言和机器语言,并运行 ld
一个合适的 a.out
文件,你不能做任何类似的事情。这就像试图反汇编 / bin / cat
。
However, if it was fully compiled into C code and thence to assembler and machine language and run through ld
for a proper a.out
file, you aren't going to be able to do anything like that. It'd be like trying to disassemble /bin/cat
.
好吧,你可以拆开它,但是没有什么喜乐。即使您可以取出原始的生成的C代码 - 您不能 - 它几乎不可用。
So ok, you could disassemble it, but there's no joy to be had there. Even if you could get out the original, generated C code — which you cannot — it would be virtually unusable.
我想你可能会运行
对不起。
这篇关于我如何逆向工程已经用perlcc编译的Perl程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!