Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mar0ls/py_dll_injector
python script to dll inject
https://github.com/mar0ls/py_dll_injector
dll-injection education hacking hook python script windows
Last synced: 9 days ago
JSON representation
python script to dll inject
- Host: GitHub
- URL: https://github.com/mar0ls/py_dll_injector
- Owner: mar0ls
- Created: 2024-01-23T10:43:59.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2024-01-24T15:16:11.000Z (10 months ago)
- Last Synced: 2024-01-29T00:10:09.335Z (10 months ago)
- Topics: dll-injection, education, hacking, hook, python, script, windows
- Language: Python
- Homepage:
- Size: 4.88 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Py_Dll_Injector
# DLL Injection Script for Windows
## Overview
This repository contains a Python script for DLL injection into a target process on the Windows operating system. DLL injection is a technique used to insert code into the address space of a running process, allowing the injected code to run within the context of that process.
## Description
### Script Details
- **Target Process:** The process into which the DLL will be injected. In this example, the target process is set to 'notepad.exe'. You can customize it to your specific use case.
- **DLL to Inject:** The name of the DLL file to be injected. In this example, it's 'injected_dll.dll'. Make sure the DLL you want to inject is present and matches the specified name.
- **Hook Function:** The function to be hooked in the target process. It is defined as 'HookFunction' in the script.
- **Hook Address:** The address of the function to be hooked in the target process. Modify the 'hook_address' variable with the appropriate address.
### Error Handling
The script includes robust error handling to catch potential failures during process opening, DLL loading, or thread creation. If any step encounters an issue, the script will raise an exception and provide a meaningful error message.
## Usage
To use the script:
1. Clone the repository: `git clone https://github.com/mar0ls/py_dll_injector.git`
2. Modify the script variables (`target_process`, `dll_name`, `hook_function`, `hook_address`) according to your requirements.
3. Run the script: `python py_dll_injector.py`## Important Notes
- Ensure you have the necessary permissions before attempting DLL injection.
- Understand the legal and ethical implications of modifying the behavior of other processes.## Disclaimer
This script is provided for educational and research purposes only. Use it responsibly and in accordance with applicable laws.