public ReflectionDetourNotifier(HookFactory hookFactory, Delegate targetDelegate) { _targetDelegate = targetDelegate; _hookDelegate = GenerateInterceptor(targetDelegate); Hook = hookFactory(Marshal.GetFunctionPointerForDelegate(_targetDelegate), Marshal.GetFunctionPointerForDelegate(_hookDelegate)); _detour = Hook.CreateDetour(_targetDelegate.GetType()); }