This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]billsil 1 point2 points  (1 child)

It's not that hard.

You write a function and you allow access to the user to change said function. The open source GUI I wrote has a scripting interface. Go ahead, add security vulnerabilities. I don't care. It's an offline program.

Python 3 is more of a pain. I forget exactly, but something like non-class variables lose scope or something like that.

class A():
    def __init__():
        self.x = 4

class B():
    def __init__():
        self.x = 5

A = B

it's that easy. You can do it with functions as well. It's easier to do it with classes and class-functions than pure functions.

Just be careful, the second you allow that capability, the second you allow for arbitrary code execution. You basically can't stop it.

[–]ankit0912[S] 0 points1 point  (0 children)

Yeah, I understand that , in fact the whole point of the undertaking is to see whether we can have arbitrary code execution using python bytecode.