Hello Peter,

> Is there any general way for any Windows program to determine whether it is
> running under the control of a debugger?

In Delphi you can code: inIDE := DebugHook <> 0;
In general interrupt 3 is used for debuggers, so in Delphi or any othre
language you can use this.

in Delphi something like:

var
  InDebugger: boolean;
begin
  InDebugger := False;
  asm
     int 3;
     mov InDebugger, 1;
  end;

  if InDebugger then
     ...

Not tested :) And there will be some other issues, because the debugger
will stop on the 'int 3' code line.

You can also prevent code from being debugged by insertnig NOP's after
an int 3 or by jumping to other parts of code. I dont know what is your
intention.

---
Rgds, Wilfried
http://www.mestdagh.biz

__________________________________________________
Delphi-Talk mailing list -> [email protected]
http://www.elists.org/mailman/listinfo/delphi-talk

Reply via email to