python compiled code ofuscation

Eric Jacobs none at none
Tue Aug 1 13:58:31 EDT 2000


In article <3986D892.CEFB8DE6 at argo.es>, Jesus Cea Avion <jcea at argo.es>
wrote:
> I have several pyc files, and I'm trying to:
> 
> a) Put all the files in a single file. b) Encypher that file to prevent
> reverse engineering.
> 
> I know how to do that except for the following problem:
> 
> How can I import a module from a compiled version (pyc) loaded into a
> string?.

See ihooks.py in the standard library the built-in module imp.
Basically, if you skip an 8 byte header in a .pyc file, you have a
marshalled code object that you can exec to import the module. The
library will show you how to do it -- you may even want to add into
the framework there.




More information about the Python-list mailing list