Skip to content

kmaork/pyinjector

Repository files navigation

Pyinjector

Tests (GitHub Actions) PyPI Supported Python Versions PyPI version Downloads GitHub license

A cross-platform tool/library allowing dynamic library injection into running processes. If you are looking for a way to inject python code into a running process, try the hypno library.

Pyinjector has no external python dependencies. It is implemented as a python wrapper for kubo/injector.

Installation

pip install pyinjector

Both source distributions, manylinux2010 wheels and windows wheels are uploaded to Pypi for every release.

Usage

CLI

inject <pid> <path/to/shared/library>

API

from pyinjector import inject

inject(pid, path_to_so_file)

How it works

We build kubo/injector as a C-extension and use its interface using ctypes. kubo/injector is an awesome repo allowing to inject shared libraries into running processes both on Windows (CreateRemoteThread), Linux (ptrace), and Mac (task_for_pid).