如何从 Python 3.10 反编译 .pyc 文件?

发布于 2025-01-10 09:09:18 字数 106 浏览 4 评论 0原文

我确实尝试了 uncompyle6decompyle3 等,但它们都不适用于 Python 3.10。

现在是否有可能做到这一点?

I did try uncompyle6, decompyle3, and others, but none of them worked with Python 3.10.

Is it even possible to do this right now?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

2025-01-17 09:09:18

使用pycdc。
Github:https://github.com/zrax/pycdc

git clone https://github.com/zrax/pycdc
cd pycdc
cmake .
make
make check
pycdc C:\Users\Bobby\example.pyc

Use pycdc.
Github: https://github.com/zrax/pycdc

git clone https://github.com/zrax/pycdc
cd pycdc
cmake .
make
make check
pycdc C:\Users\Bobby\example.pyc
眼眸 2025-01-17 09:09:18

在 Windows 上(假设您有 Cmake 和 MSBuild.exe)

git clone https://github.com/zrax/pycdc
cd pycdc
cmake .
MSBuild.exe pycdc.vcxproj
cd pycdc/Debug
pycdc.exe yourfile.pyc

on Windows (presume you have both Cmake and MSBuild.exe)

git clone https://github.com/zrax/pycdc
cd pycdc
cmake .
MSBuild.exe pycdc.vcxproj
cd pycdc/Debug
pycdc.exe yourfile.pyc
染柒℉ 2025-01-17 09:09:18

请尝试https://pylingual.io,它支持最新的Python版本(3.6 ~ 3.12)。该服务实现了一个开放服务,运行基于NLP的翻译模型+控制流分析。

Please try https://pylingual.io, which supports the latest Python versions (3.6 ~ 3.12). The service implements an open service that runs an NLP-based translation model + control flow analysis.

懒的傷心 2025-01-17 09:09:18

如果我们使用 ubuntu,打开终端:

sudo snap install pycdc #this helps to avoid the error: Command 'pycdc' not found when following MDKawsar's answer

然后告诉终端 python *.pyc 脚本在哪里:

pycdc /home/jbsidis/Downloads/scripts/assets/main.pyc

您将看到结果

If we use ubuntu, open the Terminal:

sudo snap install pycdc #this helps to avoid the error: Command 'pycdc' not found when following MDKawsar's answer

Then tell the terminal where that python *.pyc script is:

pycdc /home/jbsidis/Downloads/scripts/assets/main.pyc

You will see the result

风追烟花雨 2025-01-17 09:09:18

随着时间的推移和更多的 Python 版本的出现,它似乎变得越来越不可靠。从安全角度来看,反编译是不可取的,并且期望 Python 开发人员将继续尝试阻止。最后我尝试给出了部分结果,但缺少代码(windows/cmake/msbuild 方法 w/v3.10)。我还没有尝试过 pylingual.io 选项。它需要将您的代码提交到他们的云服务。

It seems to get less reliable with time and additional Python releases. Decompiling is undesirable from a security standpoint, and expect Python devs will continue to try to prevent. Last I tried gave partial results with code missing (windows/cmake/msbuild method w/v3.10). I have not tried the pylingual.io option. It requires submitting your code up to their cloud service.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文