且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Windows下Debug模式的检测和OutputDebugString

更新时间:2022-04-16 17:47:02

对于应用程序是否处于某个用户调试模之下,可以使用如下API进行检测:

   BOOL WINAPI IsDebuggerPresent(void); (使用CheckRemoteDebuggerPresent查看特定进程)

使用它可以使得程序改变Debug模式下的行为。比如Webkit只有在Debug模式下才会输出Debug信息。


扩展:

调试与反调试  http://www.programlife.net/debug-and-anti-debug-isdebuggerpresent.html

关于OutputDebugString的细节讨论可以参考下面的译文:

   http://huanglixuan.blog.163.com/blog/static/92086922007110920183/

原文来自:

    http://www.unixwiz.net/techtips/outputdebugstring.html

 

值得收藏学习!