是否可以反编译.dll / .pyd文件来提取Python源代码? [英] Is it possible to decompile a .dll/.pyd file to extract Python Source Code?

查看:12325
本文介绍了是否可以反编译.dll / .pyd文件来提取Python源代码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法反编译一个dll和/或一个.pyd文件,以提取用Python编写的源代码?

Are there any ways to decompile a dll and/or a .pyd file in order to extract source code written in Python?

提前感谢

推荐答案

我假设.pyd /。 dll文件是在Cython中创建的,而不是Python?

I assume the .pyd/.dll files were created in Cython, not Python?

无论如何,通常这是不可能的,除非有一个专门针对文件最初编译的语言设计的反编译器。虽然我知道C,C ++,Delphi,.NET和其他反编译器,但我还没有听说过Cython反编译器。

Anyway, generally it's not possible, unless there's a decompiler designed specifically for the language the file was originally compiled from. And while I know about C, C++, Delp .NET and some other decompilers, I've yet to hear about Cython decompiler.

当然,Cython做的是将您的Python [esque]代码首先转换为C代码,这意味着您可能会更多运气找到C反编译器,然后根据反编译的C代码来划分原始的Python代码。至少这种方式你会处理一种(相对)高级语言到另一种语言的翻译。

Of course, what Cython does is convert your Python[esque] code into C code first, which means you might have more luck finding a C decompiler and then divining the original Python code based on the decompiled C code. At the very least, this way you'll be dealing with translation from one (relatively) high-level language to another.

最坏的情况,你会有使用反汇编程序。然而,从反汇编器的输出中重新创建Python代码并不容易(非常类似于将大脑的生物学功能与构成其细胞的蛋白质的化学式划分)。

Worst-case scenario, you'll have to use a disassembler. However, recreating Python code from disassembler's output isn't going to be easy (pretty similar to divining the biological functions of a brain from chemical formulas of proteins that make up it's cells).

您可以查看这个问题关于各种反编译器和拆卸器的想法和建议,并从那里进行调查。

You might look at this question on ideas and suggestions regarding various decompilers and disassemblers, and proceed your investigation from there.

这篇关于是否可以反编译.dll / .pyd文件来提取Python源代码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆