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)); }