Mysterie / uncompyle2

uncompyle2
642 stars 148 forks source link

unknown magic number 62161 #34

Open gaoruojie opened 6 years ago

gaoruojie commented 6 years ago

Can't uncompyle routers2.pyc

Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/uncompyle2/init.py", line 203, in main uncompyle_file(infile, outstream, showasm, showast) File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/uncompyle2/init.py", line 135, in uncompyle_file version, co = _load_module(filename) File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/uncompyle2/init.py", line 71, in _load_module raise ImportError, "Unknown magic number %s in %s" % (ord(magic[0])+256*ord(magic[1]), filename) ImportError: Unknown magic number 62161 in routers2.pyc

decompiled 0 files: 0 okay, 1 failed, 0 verify failed

rocky commented 6 years ago

Magic number 62161 is the magic number for the Python 2.6 release. See https://github.com/rocky/python-xdis/blob/master/xdis/magics.py#L84 and this code works for Python 2.7

gaoruojie commented 6 years ago

Thanks rocky, I found that too. I don't know why this error occurs. Am I using this wrong? Have you tested to decompile a file with this magic number? Does it work?