Skip to main content

向可执行文件中注入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')

Release files for peinjecter 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for peinjecter 1.0.0
File Size Uploaded
peinjecter-1.0.0.tar.gz 8.7 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for peinjecter 1.0.0
File Interpreter ABI Platform
peinjecter-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 17.8 MB

Release files / peinjecter-1.0.0.tar.gz

Download URL peinjecter-1.0.0.tar.gz
Size 8.7 MB
Tags Source
SHA-256 checksum
How to use checksums
33b7b77d5b0262b4032d958629dace9d98d8ecbf9788f7fd0cdcaa8570fe5280
BLAKE2b-256 checksum
How to use checksums
df00a4128f7849a268deb3d1e4d264593d3b71eb76ff0c6952bab3ed1b3cc3b7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.3.1 CPython/3.10.8 Windows/10

Release files / peinjecter-1.0.0-py3-none-any.whl

Download URL peinjecter-1.0.0-py3-none-any.whl
Size 9.1 MB
Tags Python 3
SHA-256 checksum
How to use checksums
997f56ed845302bd6cb9d2b6a5ecb9d2d99d2636b4291107b924b284d5769ac5
BLAKE2b-256 checksum
How to use checksums
177011241836c92353b1a3f2a962a9472e548dac2f2c72947e632991275ec74c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.3.1 CPython/3.10.8 Windows/10

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page