How to validate Python bytecode? -


I'm thinking of manipulating some bytecokes in Python (think genetic programming).

In the case of a test of the Python source tree that came out, which states:

The broken bytecode objects can easily crash the interpreter. is.

The question is, how to validate the given tweed byte code that it will not crash the interpreter? Is this also possible?

Test source,

  cc = (lambda fc = (lambda n: [c for c] .__ class __.__bas____ [0] .__ subclasses__ () If c .___name__ == n] [0]): FC ("function") (fc ("code") (0, 0, 0, 0, "kaboom", (), (), () , Defines this module as  cc , that if it is called,   

code> mymod.cc () crash interpreter One very difficult example is creating a new code object with custom bytecode "KABOOM" and then runs it.

I accept something Confirms the predefined bytecode, e.g.,

Comments

Popular posts from this blog

How can I add a seperate action listener to all 14 of my buttons at once that can determine player turn?(java) -

php - Sorting an multidimension array using usort fails -

Simple file compression in C -