i am doing the CTF-like challenges. One of these tasks need us to decompiling Python bytecode 3.8 (.pyc file) into py file. However, the py file that generated by pyc file is 0 byte
The original file's name is
flag.py Here are my procedures.
Rename the file:
uncompyle6tool and type command:
uncompyle6 flag.pyc > flag.py
It will generate
flag.pyfile, however it is 0 byte. And after several hours, it is still 0 byte.
If i interrupt the command line tool by keyboard, the
flag.pyfile will have the comment:
uncompyle6 version 3.6.6 Python bytecode 3.8 (3413) Decompiled from: Python 3.8.0 [GCC 4.2.1 Compatible Clang 4.0.1 (tags/RELEASE_401/final)] Embedded file name: flag.o.py Compiled at: 2020-04-24 16:09:51 Size of source mod 2**32: 2476187 bytes
My environment is MacOS, Python 3.8.0.
The .pyc file is small and I've already checked the magic number of the file's header, it is Python 3.8.0.
The unusual thing of this pyc file is that there are several thousands of
ff 00 at the end of the file.
55 0d 0d 0a 00 00 00 00 ... ff 00 ff 00 ff 00 ff 00 ... ff 00 ff 00 ff 00 ff 00 b9 01 0c 06 0a 01 08 01