Skip to content

PyInjector - Inject python-code into any python process or spawn interactive python-shell inside the target process.

License

Notifications You must be signed in to change notification settings

Stanislav-Povolotsky/PyInjector

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PyInjector

PyInjector - Inject python-code into any python process or spawn interactive python-shell inside the target process. Based on PyInjector by @call-042PE

How to use it ?

Injecting own code

  1. Write the code you want to inject into a file called code.py and place it in the same folder of the software you want to inject it (in the current folder of this software).
  2. Inject the PyInjector_x64.dll / PyInjector_x86.dll into the target process using Process Hacker or any other DLL injection tool.

You can also write the code directly in the DLL and recompile it or modify python code inside PyInjector_x??.dll in your favorite binary editor.

Why injecting python code into python script ?

This project is made for reverse-engineer and malware analyst, the main aspect of this project is to reverse-engineer any python script/executable easily.
I put some usefull script in the py-code-examples/ folder that can be used to reverse-engineer any script (even with pyarmor).

Demo: injecting code.py

injecting-code py

Spawning python-shell

Spawning interactive python shell in the any python process is easy - just inject PyInjector_x64_shell.dll / PyInjector_x86_shell.dll DLL in the target process. It should be enough to see interactive console window with python shell.
You can spawn interactive python shell even in GUI applications.

Demo: spawning python-shell

spawning-pyshell py

Compatibilities

Requirements:

  • OS: Windows XP or later.
  • Target process must use Python x86/x64 3.7, 3.8, 3.9, 3.10, 3.11.

Example

In this video @call-042PE is unpacking a function in a pyarmor protected script with PyInjector.

About

PyInjector - Inject python-code into any python process or spawn interactive python-shell inside the target process.

Topics

Resources

License

Stars

Watchers

Forks