Skip to content

Uncompyle6 decompile function #7

@yaroslavvvpy

Description

@yaroslavvvpy

So originally you pass arguments in this order

def Decompilepy2exe(data, pythonversion):
    data = data[0x010:]
    offset = data.find(b"\x00")
    if offset == -1:
        return
    pythoncode = marshal.loads(data[offset + 1:])

    oStringIO = StringIO()
    decompile(pythonversion, pythoncode[-1], oStringIO)
    print(oStringIO.getvalue())

However, it seems to be outdated now and you need to swap pythonversion and pythoncode

def Decompilepy2exe(data, pythonversion):
    data = data[0x010:]
    offset = data.find(b"\x00")
    if offset == -1:
        return
    pythoncode = marshal.loads(data[offset + 1:])

    oStringIO = StringIO()
    decompile(pythoncode[-1], pythonversion, oStringIO)
    print(oStringIO.getvalue())

And pythonversion needs to be a tuple as well.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions