Extracting bytecode out of frozen programs

Gabriel Genellina gagsl-py2 at yahoo.com.ar
Sun Feb 8 16:43:56 EST 2009

En Sun, 08 Feb 2009 18:38:22 -0200, David Kraeutmann  
<python-list at davidkra.net> escribió:

> Hello,
> I need to extract the modules/packages out of a frozen script. It was
> compiled using Python 2.2.3 and the standard freeze.py.
> I managed to get a shell after execution using PYTHONINSPECT=y and find
> the start of a module/package using a hex editor (I got the sta, but
> these modules don't seem to be importable.
> Is there a way of extracting them so they are importable in a python  
> shell?

Those modules are exposed via the PyImport_FrozenModules array.
The ctypes documentation has an example for accessing this array, see

Gabriel Genellina

More information about the Python-list mailing list