Skip to main content

PEInjecter is a Python library that allows you to inject any executable file into the call lifecycle of an exe. This can be useful for a variety of purposes, such as adding custom functionality to an existing program or modifying its behavior.

Project description

向可执行文件中注入python代码或者任意可执行文件

使用python解释器直接注入

import tkinter.messagebox

import peinjecter


def hello():
    tkinter.messagebox.showinfo('Hello peinjecter!')


if __name__ == '__main__':
    peinjecter.inject('target.exe', before=hello)

打包后再进行注入

import sys
import tkinter.messagebox

import peinjecter


def hello():
    tkinter.messagebox.showinfo('Hello peinjecter!')


if __name__ == '__main__':
    if getattr(sys, 'frozen', False):
        peinjecter.inject('target.exe', before=hello)
    else:
        peinjecter.build()

注入其他可执行文件

import peinjecter

if __name__ == '__main__':
    peinjecter.inject('target.exe', before='test.exe')

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

peinjecter-1.0.0.tar.gz (8.7 MB view details)

Uploaded Source

Built Distribution

peinjecter-1.0.0-py3-none-any.whl (9.1 MB view details)

Uploaded Python 3

File details

Details for the file peinjecter-1.0.0.tar.gz.

File metadata

  • Download URL: peinjecter-1.0.0.tar.gz
  • Upload date:
  • Size: 8.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.3.1 CPython/3.10.8 Windows/10

File hashes

Hashes for peinjecter-1.0.0.tar.gz
Algorithm Hash digest
SHA256 33b7b77d5b0262b4032d958629dace9d98d8ecbf9788f7fd0cdcaa8570fe5280
MD5 fe85066455ae740ee60d9340db68233c
BLAKE2b-256 df00a4128f7849a268deb3d1e4d264593d3b71eb76ff0c6952bab3ed1b3cc3b7

See more details on using hashes here.

File details

Details for the file peinjecter-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: peinjecter-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 9.1 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.3.1 CPython/3.10.8 Windows/10

File hashes

Hashes for peinjecter-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 997f56ed845302bd6cb9d2b6a5ecb9d2d99d2636b4291107b924b284d5769ac5
MD5 d50bc9ab57e4ec3eb408d3deff4e2d22
BLAKE2b-256 177011241836c92353b1a3f2a962a9472e548dac2f2c72947e632991275ec74c

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page