All Projects → CCob → MinHook.NET

CCob / MinHook.NET

Licence: BSD-3-Clause license
A C# port of the MinHook API hooking library

Programming Languages

C#
18002 projects
XSLT
1337 projects

Projects that are alternatives of or similar to MinHook.NET

Pine
Dynamic java method hook framework on ART.
Stars: ✭ 171 (+33.59%)
Mutual labels:  hooking
FindTheStupidWindow
Windows API hooking project to log all the windows / UIs with the exact timestamp when they are opened.
Stars: ✭ 13 (-89.84%)
Mutual labels:  hooking
bank mitigations
Anti keylogger, anti screen logger... Strategy to protect with hookings or improve your sandbox with spyware detection... - Demo
Stars: ✭ 17 (-86.72%)
Mutual labels:  hooking
Anticuckoo
A tool to detect and crash Cuckoo Sandbox
Stars: ✭ 233 (+82.03%)
Mutual labels:  hooking
DbgChild
Debug Child Process Tool (auto attach)
Stars: ✭ 221 (+72.66%)
Mutual labels:  hooking
mhook
A Windows API hooking library
Stars: ✭ 167 (+30.47%)
Mutual labels:  hooking
Pwn Mbr
A simple MBR hijack demonstration
Stars: ✭ 153 (+19.53%)
Mutual labels:  hooking
dll injector
A simple commandline injector using classic DLL injection
Stars: ✭ 81 (-36.72%)
Mutual labels:  hooking
Open.WinKeyboardHook
A simple and easy-to-use .NET managed wrapper for Low Level Keyboard hooking.
Stars: ✭ 20 (-84.37%)
Mutual labels:  hooking
js.metaret
lightweight mutual tail recursion optimization without trampoline
Stars: ✭ 16 (-87.5%)
Mutual labels:  trampoline
Advanced Video
Stars: ✭ 240 (+87.5%)
Mutual labels:  hooking
Harmony
A library for patching, replacing and decorating .NET and Mono methods during runtime
Stars: ✭ 2,885 (+2153.91%)
Mutual labels:  detour
hooking-by-example
A series of increasingly complex programs demonstrating function hooking on 64 bit Windows. Culminating in a program that hooks mspaint to make it always paint orange.
Stars: ✭ 144 (+12.5%)
Mutual labels:  hooking
Corehook
A library that simplifies intercepting application function calls using managed code and the .NET Core runtime
Stars: ✭ 191 (+49.22%)
Mutual labels:  hooking
RemoteAssistance-JAVA
RemoteControl like TeamViewer(JAVA)
Stars: ✭ 28 (-78.12%)
Mutual labels:  hooking
Iat patcher
Persistent IAT hooking application - based on bearparser
Stars: ✭ 170 (+32.81%)
Mutual labels:  hooking
jeff
Effects for Java
Stars: ✭ 14 (-89.06%)
Mutual labels:  trampoline
hooking
Resources About Hooking. For All Platforms. Currently 300+ Tools And 600+ Posts.
Stars: ✭ 212 (+65.63%)
Mutual labels:  hooking
hook-any-text
The goal of this project is to provide an alternative to well established text hookers, whose features are restrained to a certain number of game engines and emulators.
Stars: ✭ 51 (-60.16%)
Mutual labels:  hooking
subhook.nim
subhook wrapper for Nim https://github.com/Zeex/subhook
Stars: ✭ 15 (-88.28%)
Mutual labels:  hooking

MinHook.NET

Introduction

MinHook.NET is a pure managed C# port of the brilliant MinHook library by Tsuda Kageyu (https://github.com/TsudaKageyu/minhook). The library has the capability of inline hooking native API calls, utilising .NET delegates for both the detoured and original function that is commonly called with the detour.

The project has attempted to keep within the simplistic spirit of the original MinHook library.

Quick Start

Simple example demonstrating the hooking of the MessageBoxW Windows API

    [DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
    public static extern int MessageBoxW(IntPtr hWnd, String text, String caption, uint type);

    //We need to declare a delegate that matches the prototype of the hooked function
    [UnmanagedFunctionPointer(CallingConvention.StdCall,CharSet=CharSet.Unicode)]
    delegate int MessageBoxWDelegate(IntPtr hWnd, string text, string caption, uint type);

    //A variable to store the original function so that we can call
    //within our detoured MessageBoxW handler
    MessageBoxWDelegate MessageBoxW_orig;

    //Our actual detour handler function
    int MessageBoxW_Detour(IntPtr hWnd, string text, string caption, uint type) {
        return MessageBoxW_orig(hWnd, "HOOKED: " + text, caption, type);
    }

    void ChangeMessageBoxMessage() {

		using (HookEngine engine = new HookEngine()) {

			MessageBoxW_orig = engine.CreateHook("user32.dll", "MessageBoxW", new MessageBoxWDelegate(MessageBoxW_Detour));
			engine.EnableHooks();

			//Call the PInvoke import to test our hook is in place
			MessageBoxW(IntPtr.Zero, "Text", "Caption", 0);
		}
    }

TOOO

  • Figure out how to calculate imm length with ModRM based instructions
  • When enabling hooks, enumerate threads and update thread context if any are running at the hook instructions that are being patched
  • Implement unit tests

Thanks

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].