Reputation: 87
I am working on a school project, I wanted to know if it is possible to detect if the program is loaded into the Visual Studio debugger, and if it is possible, I want to close the debugger and the app.
Is there a way to do that ? Thanks !
Upvotes: 1
Views: 2336
Reputation: 59303
The simple way is calling IsDebuggerPresent() and then exit the application if it returned true
. This may be enough for a first try.
However, it mainly depends on how good someone is with debugging. A good developer / malware analyst may easily work around such a trick.
You may want to look at What is your favourite anti-debugging trick? here on SO for other ideas.
Upvotes: 1