Ejemplo n.º 1
0
        private void _TopApply()
        {
            if (_TopDetour != null)
            {
                return;
            }

            // GetNativeStart to prevent managed backups.
            _TopDetour = new NativeDetour(Method.GetNativeStart(), Target.GetNativeStart());
        }
Ejemplo n.º 2
0
        private void _TopUndo()
        {
            if (_TopDetour == null)
            {
                return;
            }

            _TopDetour.Undo();
            _TopDetour.Free();
            _TopDetour = null;
        }
Ejemplo n.º 3
0
        internal bool RegisterNativeDetour(NativeDetour _detour, MethodBase method, IntPtr from, IntPtr to)
        {
            Assembly owner = GetHookOwner();

            if (owner == null)
            {
                return(true); // continue with default detour creation, we just don't track it
            }
            OnNativeDetour?.Invoke(owner, method, from, to);
            TrackDetour(owner, _detour);
            return(true);
        }