Example #1
0
        public void AddHook()
        {
            if (!_selectedProcesses.Any() || SelectedModule == null || !_selectedFunctions.Any())
            {
                throw new InvalidOperationException();
            }

            if (AtLeastOneSelectedFunctionIsAlreadyHooked())
            {
                if (!_view.ConfirmIfFunctionsShouldBeHookedAgain())
                {
                    return;
                }
            }

            _hooksAreBeingAdded = true;

            _selectedFunctions.ForEach(AddHook);

            _hooksAreBeingAdded = false;
        }