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.
Comments
Post a Comment