All Projects → cosine0 → dllhook

cosine0 / dllhook

Licence: GPL-3.0 License
A tool for hooking Windows applications and jumping to your Python code with the injected Python interpreter

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to dllhook

RenHook
An open-source x86 / x86-64 hooking library for Windows.
Stars: ✭ 80 (+300%)
Mutual labels:  hooking
winsafe
Windows API and GUI in safe, idiomatic Rust.
Stars: ✭ 110 (+450%)
Mutual labels:  win32
Hello-GLUT
A very simple "Hello World!" GLUT application demonstrating how to write OpenGL applications in C with MinGW and MSVC.
Stars: ✭ 27 (+35%)
Mutual labels:  win32
Api-Break-for-x64dbg
x64dbg plugin to set breakpoints automatically to Win32/64 APIs
Stars: ✭ 136 (+580%)
Mutual labels:  win32
RainbowTaskbar
Customizable Windows taskbar effects.
Stars: ✭ 39 (+95%)
Mutual labels:  win32
cute
An event-centric publisher/subscribe model for objects inspired by the Qt framework
Stars: ✭ 37 (+85%)
Mutual labels:  hooking
singlefile
featured cs:go internal hack, one file and less than 1000 lines.
Stars: ✭ 47 (+135%)
Mutual labels:  hooking
SoftwareHelper
This is a windows app shortcut widget 🔨
Stars: ✭ 122 (+510%)
Mutual labels:  win32
whoof
Web Browser Hooking Framework. Manage, execute and assess web browser vulnerabilities
Stars: ✭ 24 (+20%)
Mutual labels:  hooking
small-gd-mods
small collection of mods for geometry dash
Stars: ✭ 39 (+95%)
Mutual labels:  hooking
eseed-window
A minimal cross-platform C++17 window management library for rendering (deprecated)
Stars: ✭ 18 (-10%)
Mutual labels:  win32
SnifferIH
DLL Hooking Packet Sniffer
Stars: ✭ 15 (-25%)
Mutual labels:  hooking
Vutils
Vutils or Vic Utilities is an utility library written in Modern C++ and for Modern C++. It helps your programming go easier, faster, and simpler.
Stars: ✭ 16 (-20%)
Mutual labels:  hooking
windows taskbar
Flutter plugin serving utilities related to Windows taskbar. 💙
Stars: ✭ 84 (+320%)
Mutual labels:  win32
DLL-Injector
Inject and detour DLLs and program functions both managed and unmanaged in other programs, written (almost) purely in C#. [Not maintained].
Stars: ✭ 29 (+45%)
Mutual labels:  win32
Simplified-JNA
Multi-threaded JNA hooks and simplified library access to window/key/mouse functions.
Stars: ✭ 30 (+50%)
Mutual labels:  hooking
hookwin10calc
Reverse engineered Windows 10 Calculator.exe (UWP application) hacker. 한글/漢文을 배운 윈도우 계산기 패치.
Stars: ✭ 19 (-5%)
Mutual labels:  hooking
XScreenSaverWin
XScreenSaver for Windows
Stars: ✭ 76 (+280%)
Mutual labels:  win32
CherryLib
Win32/MFC UI Control, Live Update, Utility Library
Stars: ✭ 19 (-5%)
Mutual labels:  win32
wae
An async executor based on the Win32 thread pool API
Stars: ✭ 10 (-50%)
Mutual labels:  win32

dllhook

dllhook is a tool for hooking Windows x86 applications. This tools injects embedded Python interpreter (Python DLL) to the application and executes your script. And also this provides a convenient hooking library to use in your script.
This tool uses mayhem python_injector as injector.
See https://github.com/zeroSteiner/mayhem/blob/master/tools/python_injector.py
When you clone this repository, you must also clone submodule mayhem.
This tool is tested on Python 3.6-3.9.

Installation

Make sure you use 32-bit version of Python.
This package requires capstone. To install capstone, in Visual Studio Developer Command Prompt:

python -mpip install capstone

To install dllhook:

python -mpip install dllhook

Usage

  • Write your python script to inject.
import ctypes
import dllhook

# @dllhook.hook_dll('Kernel32.dll', 0x00014510) also works
@dllhook.hook_dll('Kernel32.dll', b'CreateProcessW')
def see_process(arg1):
    if arg1 != 0:
        print("<hooked> ", ctypes.wstring_at(arg1))
  • Save it as a file. (e.g. C:\Users\example\Desktop\see_process.py)

  • Execute module dllhook with the target program and your script as the arguments.

python -mdllhook "C:\Program Files (x86)\Adobe\Acrobat Reader DC\Reader\AcroRd32.exe" C:\Users\example\Desktop\see_process.py

Console output:

[+] Opened a handle to pid: 24308
[*] Found Python library at: C:\Users\example\AppData\Local\Programs\Python\Python36-32\python36.dll
[*] Injecting Python into the process...
[+] Loaded C:\Users\example\AppData\Local\Programs\Python\Python36-32\python36.dll with handle 0x69ee0000
[*] Resolved addresses:
  - Py_InitializeEx:    0x6a061cc0
  - PyRun_SimpleString: 0x6a07b1c0
[*] Initialized Python in the host process
[*] Waiting for client to connect on \\.\pipe\mayhem
[*] Client connected on named pipe
target: 0x75ae4510
invoke: 0x6c401df0
callbacker: 0x6620fdc
<hooked> C:/Program Files (x86)/Adobe/Acrobat Reader DC/Reader/ARH.exe
<hooked> C:\Program Files (x86)\Common Files\Adobe\ARM\1.0\AdobeARM.exe

Author

cosine0 @github

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].