/// <summary> /// Continues the program execution until the next breakpoint, exception or step interrupt. /// </summary> public void ContinueUntilBreakpoint(uint maxTimeOut = Constants.INFINITE) { do { if (lastUnhandledBreakpoint != null) { SkipAndRestoreLastBreakpoint(); } if (!Debuggee.IsAlive) { return; } Debuggee.MainProcess.ResumeExecution(); API.ContinueDebugEvent(Debuggee.MainProcess.Id, Debuggee.MainProcess.Threads[0].Id, ContinueStatus.DBG_CONTINUE); Debuggee.WaitForDebugEvent(maxTimeOut); }while (lastDebugEvent.dwDebugEventCode != DebugEventCode.EXCEPTION_DEBUG_EVENT); }
private void button1_Click(object sender, EventArgs e) { var exe = input_executable.Text; if (!Path.IsPathRooted(exe)) { exe = Environment.CurrentDirectory + "\\" + exe; } if (!File.Exists(exe)) { MessageBox.Show(exe + " doesn't exist!", "Execute program", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } DDebugger.DDebugger.EventListeners.Clear(); DDebugger.DDebugger.EventListeners.Add(new EventLogger(this, dbg)); dbg = DDebugger.DDebugger.Launch(exe); dbg.WaitForDebugEvent(); //dbg.Breakpoints.SetProgramEntryBreakpoint(); //dbg.Breakpoints.CreateBreakpoint(new IntPtr(0x004020c8u)); }