예제 #1
0
        private void Run()
        {
            try
            {
                if (!process.CoreFunctions.AttachDebuggerToProcess(process.UnderlayingProcess.Id))
                {
                    return;
                }

                isAttached = true;

                var evt = new DebugEvent();

                running = true;
                while (running)
                {
                    if (process.CoreFunctions.AwaitDebugEvent(ref evt, 100))
                    {
                        evt.ContinueStatus = DebugContinueStatus.Handled;

                        HandleExceptionEvent(ref evt);

                        process.CoreFunctions.HandleDebugEvent(ref evt);
                    }
                    else
                    {
                        if (!process.IsValid)
                        {
                            Terminate(false);
                        }
                    }
                }

                process.CoreFunctions.DetachDebuggerFromProcess(process.UnderlayingProcess.Id);
            }
            finally
            {
                isAttached = false;
            }
        }
예제 #2
0
 public void Handler(ref DebugEvent evt)
 {
     throw new NotImplementedException();
 }
예제 #3
0
 public void Handler(ref DebugEvent evt)
 {
     handler?.Invoke(this, ref evt);
 }