Python使用对其他文件的引用对PYC文件进行反编译



我的一个文件已经损坏,我唯一的备份在pychache文件夹中。我尝试过使用uncomply6,它给出了一个错误,如下所示。我不确定这是什么原因,但我认为这是因为它引用了其他文件中的变量或函数。如何使用对其他文件的引用对文件进行反编译?

Parse error at or near `POP_EXCEPT' instruction at offset 1476
@osutracker.before_loop
async def before_printer(self):
print('waiting...')
await self.bot.wait_until_ready()
# file osu.cpython-38.pyc
# Deparsing stopped due to parse error

文件:https://cdn.discordapp.com/attachments/437091189792047125/782360883861913640/osu.cpython-38.pyc

我现在通过使用带有cpython-37而不是-38的uncompyle6解决了这个问题。我不知道为什么这样做有效,因为uncomply6应该支持3.9之前的所有版本的python,但它确实有效。

最新更新