uncompyle2 icon indicating copy to clipboard operation
uncompyle2 copied to clipboard

unknown magic number 62161

Open gaoruojie opened this issue 7 years ago • 2 comments

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

gaoruojie avatar Dec 08 '17 09:12 gaoruojie

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

rocky avatar Dec 08 '17 12:12 rocky

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?

gaoruojie avatar Dec 08 '17 14:12 gaoruojie