PYC Format Package
2023-12-1 23:34:49 Author: blog.cerbero.io(查看原文) 阅读量:3 收藏

Skip to content

We have released the PYC Format package for all licenses of Cerbero Suite.

PYC files are compiled bytecode versions of Python source code. These compiled files can be deployed in place of the original source code, serving as a bytecode format for execution by the Python interpreter. PYC files are tied to the specific version of Python they were compiled with, necessitating recompilation when different Python versions are used.

The support is designed to be fully compatible with all Python versions, enabling users to delve into the intricacies of the complete PYC file format and its instructions.

The package also allows the integration of an external decompiler such as Decompyle++ through the settings.

Once the external decompiler is set up, accessing the decompiled source code is achievable with just a single click.

The package is exposed to the SDK:

from Pro.Core import *
from Pkg.PYC import *

def disassemblePYC(fname):
    c = createContainerFromFile(fname)
    if c.isNull():
        return
    obj = PYCObject()
    if not obj.Load(c) or not obj.Parse():
        return
    out = NTTextBuffer()
    obj.Disassemble(out)
    print(out.buffer)

文章来源: https://blog.cerbero.io/pyc-format-package/
如有侵权请联系:admin#unsafe.sh