I have found another (better ) way to stop application on entry point:
{------cut------------ ------------- ------------- -------------- }
begin
fNeedsToSetEntryPointBreakpoint:=false; //just be sure
if not DebugActiveProcess(processid) then
exit;
end;
{------cut------------ ------------- ------------- -------------- }fNeedsToSetEntryPointBreakpoint := TRUE; helps
But I need help with another problem. How programmicaly know that debugged process was stopped on Toggle Breakpoint. For example in my program I write:
uses
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
ComCtrls, ActnList, ExtCtrls, FileCtrl,
windows,ServiceManager,jwawintype, jwapsapi,
mainunit, ProcessWindowUnit,
dos,
MemoryBrowserFormUnit, frmFillMemoryUnit,
DebugHelper,CEDebugger;
{...}
procedure TForm1.Button1Click(Sender: TObject);
begin
if startdebuggerifneeded(true) then
begin
DebuggerThread.ToggleOnExecuteBreakpoint($004A098D);
memorybrowser.disassemblerview.Update;
end;
application.ProcessMessages;
memorybrowser.Run1.Click;
{here I need some loop which will get control when debugged process will stop on address $004A098D}
end;