Changing Opcode Numbers

Skip Montanaro skip at pobox.com
Wed Jan 30 16:04:19 EST 2002


    Emmanuel> Is changing the Opcode order (that means creating my own
    Emmanuel> python lib ) in opcode.h enougth to make a good protection
    Emmanuel> from python decompiler ?

Probably not worth it.  Note that opcodes with and without arguments will
have to remain separated by HAVE_ARGUMENT and you are limited to one byte
per opcode.  That cuts the search space down pretty well (59 opcodes <
HAVE_ARGUMENT and 46 above).  Consider that many opcodes just aren't used
that frequently (e.g., INPLACE_RSHIFT) and that stepping through eval_frame
isn't all that mysterious, so a determined person probably won't have a
terribly difficult time decompiling your byte code.  Also, you will have to
go through the same rigamarole with each new Python release because the byte
code is not part of the defined external interface and is thus subject to
change.

-- 
Skip Montanaro (skip at pobox.com - http://www.mojam.com/)




More information about the Python-list mailing list