Hook functions on Windows using MinHook
Project description
Hook functions on Windows using MinHook.
Quick Start:
import ctypes
import ctypes.wintypes
import cyminhook
import win32api
import win32con
class MessageBoxExWHook(cyminhook.MinHook):
signature = ctypes.WINFUNCTYPE(
ctypes.c_int,
ctypes.wintypes.HWND,
ctypes.wintypes.LPCWSTR,
ctypes.wintypes.LPCWSTR,
ctypes.wintypes.UINT,
ctypes.wintypes.WORD,
use_last_error=True,
)
target = ctypes.windll.user32.MessageBoxExW
def detour(self, hWnd, lpText, lpCaption, uType, langId):
return self.original(hWnd, "Hooked", "Hooked", uType, langId)
with MessageBoxExWHook() as hook:
hook.enable()
win32api.MessageBox(None, "Hello, World!", "Python", win32con.MB_OK)
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
cyminhook-0.1.1.tar.gz
(44.4 kB
view hashes)
Built Distributions
Close
Hashes for cyminhook-0.1.1-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 34df681d0c6683089930239595f3ad44ff45942a8646e88da42aa80f8ec6a236 |
|
MD5 | c7c4e10fb9c7a10dcf53a4b9d55ee3f0 |
|
BLAKE2b-256 | e20ba055ccd2000a273caa8decd5f80353d2e49758deeb6fc88e253a47b2d24e |
Close
Hashes for cyminhook-0.1.1-cp310-cp310-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 674920a5206569390330e3a7a9e4457551370dee940094841af094e4697f6f20 |
|
MD5 | 6ced5cfad0ff8f26f049eab53e641adf |
|
BLAKE2b-256 | e71e8ff4ae364a1d6d9275d87c49fcbb5a6be91dc398cadcdf33f48188e42f86 |
Close
Hashes for cyminhook-0.1.1-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 996237c56c624d2242fb7ab25abae98393ec84169c58b855aaf36ef1234d8a85 |
|
MD5 | 298ea57209d379be058588f6f88f9a0b |
|
BLAKE2b-256 | 3de3d4c263bc28dd88fd2a4ed359bbfd38b06f2da258bf47212f5d1d20b21b10 |
Close
Hashes for cyminhook-0.1.1-cp39-cp39-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f9c4f9d8177a1264fdf22673ce391f59c72c9661ec403945c9a7ce5ed4dd3ea1 |
|
MD5 | c0fd9b732f2b41ba80c8a649b7621d3b |
|
BLAKE2b-256 | 39672c6a739e54030bf50931f3d7f06f2230f4aebfa2b1ef4b699acb9247d6cc |
Close
Hashes for cyminhook-0.1.1-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 82d02f8319f00610d48cf5f95c9ea0222b2f27e338a61b99c2a818dcb2aa17a6 |
|
MD5 | 3e272e3428c9f620e5f6f9e16040f7bb |
|
BLAKE2b-256 | ea299fa3f7c6ab360211231588e7fa67b8759df5b47ac91cb4ba86a18946a646 |
Close
Hashes for cyminhook-0.1.1-cp38-cp38-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e1d62b9e669f70eca13c985b9c92195fede3e1658e71db238f6cfb0b1339c571 |
|
MD5 | 1ee97f9d5c37b22fab2b7a0a6ebd1d7b |
|
BLAKE2b-256 | 255f8717a91055fe259fbe19715da86bbf2a548fc79d655dd147dbc8d1a53244 |
Close
Hashes for cyminhook-0.1.1-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6173994069f33d4f1f7f5463013a34d86e19f542727eebab666966446af88e19 |
|
MD5 | 061917327a2eecac5d7a0f8ddf1cc4ca |
|
BLAKE2b-256 | 88682525ccee51a61e6f43547384163c5df46bddf9d76a447069a27af15e1e97 |
Close
Hashes for cyminhook-0.1.1-cp37-cp37m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 21aeb6cfc57bd076841b99c17bef9f650d93e8f0b31b103c295666e922724310 |
|
MD5 | be2f3fc77b269ac1b8a3b055f535117c |
|
BLAKE2b-256 | d4605befbd0a335cc5c807a9d72887f9761c1a73bf08773d19227f200c43c389 |
Close
Hashes for cyminhook-0.1.1-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 88ce9ee42a8618b6fecbd50414f38aaf307a4a84463bb24c42fbc879c58d153d |
|
MD5 | 5ed6c0c479dec6ce863585e2fa38367a |
|
BLAKE2b-256 | dfb66b9caa2cccc987d42d472e62833f8613744c094b8b5631e1f6d2e223b06c |
Close
Hashes for cyminhook-0.1.1-cp36-cp36m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f9ffdb4450ebffd4a3c6a6f0db1f84e85b14d727337a8a8069ffadbce8fff8cf |
|
MD5 | c810d1420eca8c583dff03f837636748 |
|
BLAKE2b-256 | 9a26daa4d229add53554cc97b66ad78e5908cf040a1bf73907def56d6901a26c |