static SetWindowTextAHook() { var funcAddr = DetourEngine.GetFunctionAddress("User32.dll", "SetWindowTextA"); HookedInstance = HSetWindowTextA; OriginalInstance = Marshal.GetDelegateForFunctionPointer <SetWindowstextADelegate>(funcAddr); DEngine = new DetourEngine(funcAddr, Marshal.GetFunctionPointerForDelegate(HookedInstance)); }
static LoadLibraryAHook() { var funcAddr = DetourEngine.GetFunctionAddress("Kernel32.dll", "LoadLibraryA"); HookedInstance = HLoadLibraryA; OriginalInstance = Marshal.GetDelegateForFunctionPointer <LoadLibraryADelegate>(funcAddr); DEngine = new DetourEngine(funcAddr, Marshal.GetFunctionPointerForDelegate(HookedInstance)); }
internal static void InstallGetModuleHandleHook() { var funcAddr = HookUtils.GetFunctionAddress("Kernel32.dll", "GetModuleHandleA"); hookedInstance = HGetModuleHandle; originalInstance = Marshal.GetDelegateForFunctionPointer <GetModuleHandleDelegate>(funcAddr); dEngine = new DetourEngine(funcAddr, Marshal.GetFunctionPointerForDelegate(hookedInstance)); dEngine.Install(); Logger.Log("Installed GetModuleHandle hook"); }
internal static void InstallLoadLibraryHook() { var funcAddr = HookUtils.GetFunctionAddress("Kernel32.dll", "LoadLibraryA"); hookedInstance = HLoadLibrary; originalInstance = Marshal.GetDelegateForFunctionPointer <LoadLibraryDelegate>(funcAddr); dEngine = new DetourEngine(funcAddr, Marshal.GetFunctionPointerForDelegate(hookedInstance)); dEngine.Install(); Logger.Log("Installed LoadLibrary hook"); }