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

查看:69
本文介绍了是否可以反编译 .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天全站免登陆