Skip to content

Latest commit

 

History

History
37 lines (26 loc) · 765 Bytes

README.md

File metadata and controls

37 lines (26 loc) · 765 Bytes

Unethical python hacks

A collection of script with proofs of crazy concepts. Use at your own risk!

Edit arbitrary memory of your python process!

Provides a memory view Mem. Modifies a bytes object b'xyz' -> b'abc' in-place as an example. As a side effect, poisons object collection and causes print(b'xyz') to print b'abc'.

Patching opcodes during runtime!

from flow_control import return_, permajump

def f():
    return_("hacked")
    return 42

print(f())  # prints 'hacked'

def g():
    x = "hacked"
    jump(8, "current")
    x = 42
    return x
print(f())  # prints 'hacked'