python compiled code ofuscation

Jesus Cea Avion jcea at argo.es
Tue Aug 1 19:28:39 EDT 2000


> >>> f=open("/usr/lib/python1.5/string.pyc")
> >>> f.seek(8,0)
> >>> exec marshal.load(f) in d
> >>> d={}
> >>> d.keys()
> ['_idmap', 'rfind', '_apply', 'capitalize', 'atoi_error', 'octdigits',
> 'expandtabs', '_long', 'digits', 'join', 'lower', 'count', 'atof',
[...]

Wonderful!!.

My last question (I hope):

How can I "inject" that code as a module?

That is: now I have an object code taht I can run easily but, How can I
override "import" in order to resolve the import using that object
code?.

I'm interested in a solution valor for the current scope and for any
other module "imported", including other object code that I could
invoque in the same way.

Thanks in advance!. :-)

-- 
Jesus Cea Avion                         _/_/      _/_/_/        _/_/_/
jcea at argo.es http://www.argo.es/~jcea/ _/_/    _/_/  _/_/    _/_/  _/_/
                                      _/_/    _/_/          _/_/_/_/_/
PGP Key Available at KeyServ   _/_/  _/_/    _/_/          _/_/  _/_/
"Things are not so easy"      _/_/  _/_/    _/_/  _/_/    _/_/  _/_/
"My name is Dump, Core Dump"   _/_/_/        _/_/_/      _/_/  _/_/
"El amor es poner tu felicidad en la felicidad de otro" - Leibniz



More information about the Python-list mailing list