Skip to main content

Hook functions on Windows using MinHook

Project description

PyPI Docs

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.5.tar.gz (46.8 kB view details)

Uploaded Source

Built Distributions

cyminhook-0.1.5-cp313-cp313-win_amd64.whl (67.0 kB view details)

Uploaded CPython 3.13 Windows x86-64

cyminhook-0.1.5-cp313-cp313-win32.whl (56.5 kB view details)

Uploaded CPython 3.13 Windows x86

cyminhook-0.1.5-cp312-cp312-win_amd64.whl (67.7 kB view details)

Uploaded CPython 3.12 Windows x86-64

cyminhook-0.1.5-cp312-cp312-win32.whl (57.2 kB view details)

Uploaded CPython 3.12 Windows x86

cyminhook-0.1.5-cp311-cp311-win_amd64.whl (68.9 kB view details)

Uploaded CPython 3.11 Windows x86-64

cyminhook-0.1.5-cp311-cp311-win32.whl (58.2 kB view details)

Uploaded CPython 3.11 Windows x86

cyminhook-0.1.5-cp310-cp310-win_amd64.whl (68.8 kB view details)

Uploaded CPython 3.10 Windows x86-64

cyminhook-0.1.5-cp310-cp310-win32.whl (58.3 kB view details)

Uploaded CPython 3.10 Windows x86

cyminhook-0.1.5-cp39-cp39-win_amd64.whl (69.4 kB view details)

Uploaded CPython 3.9 Windows x86-64

cyminhook-0.1.5-cp39-cp39-win32.whl (58.8 kB view details)

Uploaded CPython 3.9 Windows x86

cyminhook-0.1.5-cp38-cp38-win_amd64.whl (69.6 kB view details)

Uploaded CPython 3.8 Windows x86-64

cyminhook-0.1.5-cp38-cp38-win32.whl (58.7 kB view details)

Uploaded CPython 3.8 Windows x86

cyminhook-0.1.5-cp37-cp37m-win_amd64.whl (70.4 kB view details)

Uploaded CPython 3.7m Windows x86-64

cyminhook-0.1.5-cp37-cp37m-win32.whl (59.0 kB view details)

Uploaded CPython 3.7m Windows x86

cyminhook-0.1.5-cp36-cp36m-win_amd64.whl (69.1 kB view details)

Uploaded CPython 3.6m Windows x86-64

cyminhook-0.1.5-cp36-cp36m-win32.whl (57.7 kB view details)

Uploaded CPython 3.6m Windows x86

File details

Details for the file cyminhook-0.1.5.tar.gz.

File metadata

  • Download URL: cyminhook-0.1.5.tar.gz
  • Upload date:
  • Size: 46.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for cyminhook-0.1.5.tar.gz
Algorithm Hash digest
SHA256 3764af8a1a256d0359d175324099c239b7783a75b8ec40da3264f26a7b59167f
MD5 8a106cb6f2965a86d446c449f024465b
BLAKE2b-256 3d783d8f1505964f448c19bf0fc238a536d04e7dbcd28c050f464fb4d0e8f7db

See more details on using hashes here.

File details

Details for the file cyminhook-0.1.5-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for cyminhook-0.1.5-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 e270ee9fa94f35da6232bca625762b7ce3c9c18a431af8519f5fa151bdf29e52
MD5 11e964e3bf43840057865591fd37ade2
BLAKE2b-256 28f39ef7f482a31f7eb6cba83f5e1c91165edb1f10ef229b13b79bbdfddc6e01

See more details on using hashes here.

File details

Details for the file cyminhook-0.1.5-cp313-cp313-win32.whl.

File metadata

  • Download URL: cyminhook-0.1.5-cp313-cp313-win32.whl
  • Upload date:
  • Size: 56.5 kB
  • Tags: CPython 3.13, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for cyminhook-0.1.5-cp313-cp313-win32.whl
Algorithm Hash digest
SHA256 a3fea767936e162d670b7068f76a339304b6a22c6e1e1776176defa427af0c31
MD5 7458508c664788cafb87d1c866233617
BLAKE2b-256 7f94614701eff1cfdad106aa1ce6ce21aebb18dba1b486088ee5cbc1162b5254

See more details on using hashes here.

File details

Details for the file cyminhook-0.1.5-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for cyminhook-0.1.5-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 e5a1ec2a3c4455416f46b1e691e01d17b986c8c2ebc8ded3f24fd7abe5ae0ca4
MD5 fd21a65cd24ae425eb3d3124f5c133e7
BLAKE2b-256 b179362fdf90ad968fd6d7c79c19160996d47f06741f44e8dcb9ac8887fcab0c

See more details on using hashes here.

File details

Details for the file cyminhook-0.1.5-cp312-cp312-win32.whl.

File metadata

  • Download URL: cyminhook-0.1.5-cp312-cp312-win32.whl
  • Upload date:
  • Size: 57.2 kB
  • Tags: CPython 3.12, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for cyminhook-0.1.5-cp312-cp312-win32.whl
Algorithm Hash digest
SHA256 a1fd7e30e072a2501ca5837f301ab7c0c1a9b176dd067c7c02c7883b676f5899
MD5 846524bd242da342d8f27e4b5f107ad9
BLAKE2b-256 1c5c6ca47c22aa5853c60f71c7b3f9b389732646d7aea853fb3dc46fa40b4056

See more details on using hashes here.

File details

Details for the file cyminhook-0.1.5-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for cyminhook-0.1.5-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 f82a7e4a36071ea09967ccec7a8f37a30aa709fee19e3c5bb6f0dd66be2ea06d
MD5 9faf2ef6543fd7fab415ed4377aa3199
BLAKE2b-256 9117808a0f1fc446a0f2f4d158e54cf6c8a725492b49eb409e77680f3f91d795

See more details on using hashes here.

File details

Details for the file cyminhook-0.1.5-cp311-cp311-win32.whl.

File metadata

  • Download URL: cyminhook-0.1.5-cp311-cp311-win32.whl
  • Upload date:
  • Size: 58.2 kB
  • Tags: CPython 3.11, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for cyminhook-0.1.5-cp311-cp311-win32.whl
Algorithm Hash digest
SHA256 681888e3266374b19ad4fb5ffcd86d904035dfa827fd689c423b5c72b7c05ad8
MD5 058da609c1845f9cb6da5708c7eb7858
BLAKE2b-256 f4c692fe41988faff66cca437cd13a2efc2de318653ea2ec1cbbc02a2f2221bb

See more details on using hashes here.

File details

Details for the file cyminhook-0.1.5-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for cyminhook-0.1.5-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 8e70a29b0d7ad896c1b3443c99a8c5f6f3d6e4f56af42f3a509c931c106dd6b1
MD5 2c9111aeae447260fa41770fd774d20f
BLAKE2b-256 e8de5f94d21cae2273d403ab511bbe14335adedae632aeff49a9fbdeba9bdb59

See more details on using hashes here.

File details

Details for the file cyminhook-0.1.5-cp310-cp310-win32.whl.

File metadata

  • Download URL: cyminhook-0.1.5-cp310-cp310-win32.whl
  • Upload date:
  • Size: 58.3 kB
  • Tags: CPython 3.10, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for cyminhook-0.1.5-cp310-cp310-win32.whl
Algorithm Hash digest
SHA256 6f17444ecd5e5890af0a29ded6b4fa27e51b725564e22df59e2d21efdbd2f069
MD5 f685a3539eb05d9f30bb169add675ea9
BLAKE2b-256 696bfab4e01bf1f5423977f7a894dd5af652e77f04dd302474c788c6b9169df4

See more details on using hashes here.

File details

Details for the file cyminhook-0.1.5-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: cyminhook-0.1.5-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 69.4 kB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for cyminhook-0.1.5-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 52799fbd020e60b53444c098c79682d779f2f8e473daba5e8e08b06bd42be33a
MD5 f73791e30bdbe75289f3d1e820899121
BLAKE2b-256 0c68636540403f4ef340df74edd1b5457c82a7fa227f531b67388661d1116589

See more details on using hashes here.

File details

Details for the file cyminhook-0.1.5-cp39-cp39-win32.whl.

File metadata

  • Download URL: cyminhook-0.1.5-cp39-cp39-win32.whl
  • Upload date:
  • Size: 58.8 kB
  • Tags: CPython 3.9, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for cyminhook-0.1.5-cp39-cp39-win32.whl
Algorithm Hash digest
SHA256 331e95b6e630d79d66ef6cac36c30165806e6b084657fa4646336b53b0a5eb27
MD5 215faedac6cd192d5c56c1adeafd1915
BLAKE2b-256 8a4741d3b6c7fa97cf36ae9f6a560b321cc4787b39e393d031179840f79eca34

See more details on using hashes here.

File details

Details for the file cyminhook-0.1.5-cp38-cp38-win_amd64.whl.

File metadata

  • Download URL: cyminhook-0.1.5-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 69.6 kB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for cyminhook-0.1.5-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 4ce7d3bbb66101f9cca22c6f33b10d9abe58e38bf2339406207741cfd924c54a
MD5 c3fc0b89b2067c642537155f93ef1ef2
BLAKE2b-256 7e0f3d6e6c5876178288dad535208cf90b17bb101e7ce50f9e214c44e21dd1a9

See more details on using hashes here.

File details

Details for the file cyminhook-0.1.5-cp38-cp38-win32.whl.

File metadata

  • Download URL: cyminhook-0.1.5-cp38-cp38-win32.whl
  • Upload date:
  • Size: 58.7 kB
  • Tags: CPython 3.8, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for cyminhook-0.1.5-cp38-cp38-win32.whl
Algorithm Hash digest
SHA256 16008e09eeb311a0518ae01ededd7671be26ce8fbf4c7f66ec09ee7b727450fd
MD5 4c7f73bc84d875eba27fed89f87f5395
BLAKE2b-256 a7049f02924b503c92bb19fb064b88d5a903bf3f6a241dd46b84e49c772f8377

See more details on using hashes here.

File details

Details for the file cyminhook-0.1.5-cp37-cp37m-win_amd64.whl.

File metadata

File hashes

Hashes for cyminhook-0.1.5-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 105cb0ae8d2b51c888529ee590d1e86f7bdb013aa87844d8f60a3c9221e21929
MD5 02fc8b67898b4fb22e1cc82571662888
BLAKE2b-256 d9a5b014d78e2619e47d4761f643f80b57260dbf2b793f40e05ae3bccde19cbb

See more details on using hashes here.

File details

Details for the file cyminhook-0.1.5-cp37-cp37m-win32.whl.

File metadata

  • Download URL: cyminhook-0.1.5-cp37-cp37m-win32.whl
  • Upload date:
  • Size: 59.0 kB
  • Tags: CPython 3.7m, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for cyminhook-0.1.5-cp37-cp37m-win32.whl
Algorithm Hash digest
SHA256 4a19452fd2a22ac0631534bf7815a114b34e302e003084ce64be7ba1b569b49a
MD5 2e737ea29065d5f2addadbfcf60a6f0d
BLAKE2b-256 ce0e77cb4bc35adf0b0161c8d2c691726fb3c626d40c55919098dbf5d586b18f

See more details on using hashes here.

File details

Details for the file cyminhook-0.1.5-cp36-cp36m-win_amd64.whl.

File metadata

File hashes

Hashes for cyminhook-0.1.5-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 08c9f8027cb73257c8730a85aae6fef98fed689e9497842ace2f1d8df340a94d
MD5 c5aa6ac8a3d94b6296a76b7946565a4f
BLAKE2b-256 7d44b6def63f0ba95d3d8133a609438e17795e6e39d3602f13899530f7fd1d7e

See more details on using hashes here.

File details

Details for the file cyminhook-0.1.5-cp36-cp36m-win32.whl.

File metadata

  • Download URL: cyminhook-0.1.5-cp36-cp36m-win32.whl
  • Upload date:
  • Size: 57.7 kB
  • Tags: CPython 3.6m, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for cyminhook-0.1.5-cp36-cp36m-win32.whl
Algorithm Hash digest
SHA256 e6bfc9b009912bfee5bee20cd2fcc7fb4a3d659151a60f93f7405df3e55995b5
MD5 61f1ef66d05881fc32ae3afedce76213
BLAKE2b-256 2e06694d0c9233e642e1d6337a04ce559addd347c91eb15095b2718e3deabc70

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 Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page