Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kmaork/pyinjector
Inject shared libraries into running processes
https://github.com/kmaork/pyinjector
dll-injector linux python shared-library windows
Last synced: 2 days ago
JSON representation
Inject shared libraries into running processes
- Host: GitHub
- URL: https://github.com/kmaork/pyinjector
- Owner: kmaork
- License: mit
- Created: 2020-07-10T22:17:41.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2024-09-04T19:05:14.000Z (4 months ago)
- Last Synced: 2024-12-24T19:08:40.081Z (9 days ago)
- Topics: dll-injector, linux, python, shared-library, windows
- Language: Python
- Homepage:
- Size: 55.7 KB
- Stars: 92
- Watchers: 5
- Forks: 18
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# Pyinjector
[![Tests (GitHub Actions)](https://github.com/kmaork/pyinjector/workflows/Tests/badge.svg)](https://github.com/kmaork/pyinjector)
[![PyPI Supported Python Versions](https://img.shields.io/pypi/pyversions/pyinjector.svg)](https://pypi.python.org/pypi/pyinjector/)
[![PyPI version](https://badge.fury.io/py/pyinjector.svg)](https://badge.fury.io/py/pyinjector)
[![Downloads](https://pepy.tech/badge/pyinjector)](https://pepy.tech/project/pyinjector)
[![GitHub license](https://img.shields.io/github/license/kmaork/pyinjector)](https://github.com/kmaork/pyinjector/blob/master/LICENSE.txt)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](https://github.com/kmaork/hypno) library.Pyinjector has no external python dependencies.
It is implemented as a python wrapper for [kubo/injector](https://github.com/kubo/injector).### Installation
```shell script
pip install pyinjector
```
Both source distributions, `manylinux2010` wheels and windows wheels are uploaded to Pypi for every release.### Usage
#### CLI
```shell script
inject
```#### API
```python
from pyinjector import injectinject(pid, path_to_so_file)
```### How it works
We build [kubo/injector](https://github.com/kubo/injector) as a C-extension and use its interface using `ctypes`.
[kubo/injector](https://github.com/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`).