Skip to content

Inject arbitrary code into any running python interpreter

License

Notifications You must be signed in to change notification settings

saucesteals/pypatch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

logo

PyPatch

Inject arbitrary code into any running python interpreter

Supports all configurations of PyInstaller and PyArmor


Overview

pypatch includes:

Usage

  • Write the payload you want to inject in inject.py
  • Compile a DLL with the payload with make dll
  • Compile an injector (in cmd/injector) with your program and dll paths

Example

program.py obfuscated with pyarmor 8.4.2 and packed with pyinstaller 6.1.0

import time

def main():
  while True:
    print("Working")
    time.sleep(1)

if __name__ == "__main__":
  main()

logo

Injecting inject.py with pypatch executor before startup

import os
print("Hello from inject.py!")
print = lambda *args, **kwargs: os.write(1, b"Boo!\n")

logo


Contributing

Contributions are welcome!

License

Distributed under the GNU GPL v3.0 License. See LICENSE for more information.

About

Inject arbitrary code into any running python interpreter

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published