PYC Format Package

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)

Leave a Reply

Your email address will not be published. Required fields are marked *