This is a technique for extracting all imported modules from a packaged Python application as
.pyc files, then decompiling them. The target program needs to be run from scratch, but no debugging symbols are necessary (assuming an unmodified build of Python is being used).
This was performed on 64-bit Linux with a Python 3.6 target.
In Python we can leverage the fact that any module import involving a
.py* file will eventually arrive as ready-to-execute Python code object at this function:
PyObject* PyEval_EvalCode(PyObject *co, PyObject *globals, PyObject *locals);