Skip to content

pulkin/unethical-python-hacks

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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'

About

A collection of python hacks that you should avoid

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages