extracting code objects from .pyc

Phil Frost indigo at bitglue.com
Sat May 29 14:27:39 EDT 2004


clarification: I'm looking for something that will give me a PyObject
of the code flavor that can be passed to something like
PyImport_ExecCodeModule, not a reconstruction of the source code.

On Fri, May 28, 2004 at 11:48:59PM -0700, Dmitry Borisov wrote:
> Did you try this ?
> http://www.crazy-compilers.com/decompyle/
>  
> ----- Original Message ----- 
> Subject: extracting code objects from .pyc
> 
> 
> > Could someone please tell me what should be done to extract a code
> > object from a .pyc? Poking through the source I find examples of using
> > PyMarshal_ReadLastObjectFromFile to get it, but when I tryed this myself
> > it wouldn't work, so I'm wondering what I might be doing wrong. One
> > difference is that the files have already been loaded to ram (by my
> > bootloader), so I was using PyMarshall_ReadObjectFromString instead.




More information about the Python-list mailing list