Re: [GD-General] Is it possible to detect debugging?
Brought to you by:
vexxed72
From: brian s. <pud...@po...> - 2003-10-09 17:40:20
|
You could call IsDebuggerPresent(). Of course they can easily detour your calls to that function so it's really only useful for you - for instance, if you're trying to figure out whether to display your fancy assert box or drop straight into the debugger. Ultimately, if the person running the debugger didn't want you to know you were being debugged, I don't think you could tell. You could try to play games, like tracking frame times to guess if you'd been sitting at a breakpoint, but that wouldn't stop anyone serious. --brian Colin Fahey wrote: >Can a Windows application determine if it is being debugged? >Naturally it can't do anything if it has been suspended at a breakpoint, >but I'm wondering if there is a way, during execution, to check for debugging. > >Sorry, it has been a while since I was in to Windows process information >stuff, so I forget all the cool things a process can do. > >Anyhow, let's say the application is started. Meanwhile, something like >Visual C++ has already been started, or is now started. Some time >during the execution of the application, the user of Visual C++ uses >the "Attach to Process..." option, and selects the application. >Is there any way for the application to detect that it is being debugged, >assuming it has not been immediately paused? > >The method cannot depend on any particular debugger (like checking for >certain states of, say, Visual Studio). But I assume that many debuggers >work the same way -- although the 1337 haX0r might run the whole app in >an 80x86 emulator... > >I don't really have any particular objective, like popping up a dialog >to embarrass the first haX0r who attempts to crack my application. >I'm just making conversation. Relax! Talk amongst yourselves! > >--- Colin > >cp...@ea... > > |