Changing Python Opcodes

Sreejith K sreejithemk at gmail.com
Tue Aug 18 02:46:28 EDT 2009


Hi,

I know this is not the best way to do it. But I have to do it at least
to make it *hard* to decompile the python bytecode.

I want to distribute a software written in Python without the source.
So I compiled Python from source changing some opcode values (Taking
care of HAVE_ARGUMENT value) and distributed with the .pyc files. It
did compile but when I'm installing additional python modules using
easy_install, the import fails with a segmentation fault. It worked in
a 32 bit Centos 5.2 but not on 64bit Centos 5.2. I am using python
2.5.4 source.

I changed only the Include/opcode.py source with my jumbled opcode
values. Was I correct here ? I would like to know what all changes to
be made as to successfully compile a custom python with different
opcode values ?



More information about the Python-list mailing list