AnyHook 1.0.0.4

There is a newer version of this package available.
See the version list below for details.
The owner has unlisted this package. This could mean that the package is deprecated, has security vulnerabilities or shouldn't be used anymore.
dotnet add package AnyHook --version 1.0.0.4
NuGet\Install-Package AnyHook -Version 1.0.0.4
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="AnyHook" Version="1.0.0.4" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add AnyHook --version 1.0.0.4
#r "nuget: AnyHook, 1.0.0.4"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install AnyHook as a Cake Addin
#addin nuget:?package=AnyHook&version=1.0.0.4

// Install AnyHook as a Cake Tool
#tool nuget:?package=AnyHook&version=1.0.0.4

This library gives you a possibility to hook any Windows x64 functions from any code: native C++, managed .NET Framework and managed .NET Core (.NET 6.0). You can set local hooks (hooking functions calls of local process), remote hooks (hooking functions calls of remote process by process ID) and global hooks (hooking functions calls of any process which uses Windows GetMessage call). Callback functions could be set by their addresses, names (module name plus function name) and as delegate instances (managed code).

C# example (.NET 6.0)

using System.Diagnostics; AnyHook.AnyHook.SetLocalHook("kernel32.dll", "TerminateProcess", new ShadowTerminateProcessDelegate(ShadowTerminateProcess)); Process.GetCurrentProcess().Kill(); Console.ReadKey(); public delegate bool ShadowTerminateProcessDelegate(IntPtr handle, int exitCode); partial class Program { public static bool ShadowTerminateProcess(IntPtr handle, int exitCode) { Console.WriteLine(handle.ToString()); return true; } }

C++ example (native)

__declspec(dllimport) extern BOOL SetRemoteHook(LPCWSTR, LPCWSTR, LPCWSTR, LPCWSTR, DWORD); int wmain() { SetRemoteHook(L"kernel32.dll", L"TerminateProcess", "C:\Users\kacha\source\repos\AnyHook\ManagedShadow\bin\Debug\ManagedShadow.dll", L"ShadowTerminateProcess", 8780); WaitForSingleObject(GetCurrentProcess(), INFINITE); return 0; }

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Framework net472 is compatible.  net48 is compatible.  net481 was computed. 
native native is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.1 251 2/28/2023