admin管理员组

文章数量:1660919

经典软件推荐:AppVerifier(应用程序验证器)

先上AppVerifier微软官方最新下载链接:

https://www.microsoft/en-us/download/details.aspx?id=20028

仅适用于Win7及更早版本

THIS VERSION OF APPLICATION VERIFIER IS OUTDATED AND SUPPLIED AS-IS FOR OPERATING SYSTEMS OLDER THAN WINDOWS 7.

 

新版本已发布在Windows SDK中

New releases are distributed in the Windows SDK -

https://developer.microsoft/windows/downloads/windows-10-sdk

For previous versions of Windows, archived SDK releases are available at https://developer.microsoft/windows/downloads/sdk-archive.

 

AppVerifier微软官方介绍

https://docs.microsoft/en-us/windows-hardware/drivers/debugger/application-verifier

Application Verifier (AppVerif.exe) is a dynamic verification tool for user-mode applications. This tool monitors application actions while the application runs, subjects the application to a variety of stresses and tests, and generates a report about potential errors in application execution or design.

Application Verifier can detect errors in any user-mode applications that are not based on managed code, including user-mode drivers. It finds subtle programming errors that might be difficult to detect during standard application testing or driver testing.

You can use Application Verifier alone or in conjunction with a user-mode debugger. The current user must be a member of the Administrators group on the computer.

Application Verifier is not included in Debugging Tools for Windows. Application Verifier is included in the Windows Software Development Kit (SDK). You can find information about downloading and installing the Windows SDK here. After you install the Windows SDK, Appverif.exe and Appverif.chm will be in Windows\System32. To start Application Verifier, open a Command Prompt window and enter appverif.

The Application Verifier tool comes with its own documentation. To read the documentation, start Application Verifier, and from the Help menu, click Help, or press F1.

 

“Bug”中最头痛的是那么一类:野指针、无效句柄,访问冲突,跟Windows内核打交道比较多的那些,它们发现难,调试难,定位难。不过AppVerifier就是解决这些问题的工具,实际上,以微软为首的大的Windows软件开发商都在使用这个软件作辅助测试。我在这里推荐它的原因,除了它善于抓这些比较内核的、底层的Bug之外,是微软出品,可以免费使用和非常简单是另外几个因素。


AppVerifier的客观介绍
AppVerifier 可以免费下载,特别用于检测和帮助调试内存损坏、危险的安全漏洞以及受限的用户帐户特权问题。AppVerifier 有助于创建可靠且安全的应用程序,方法是监视应用程序与 Microsoft? Windows? 操作系统的交互,并配置应用程序使用的对象、注册表、文件系统和 Win32 API(包括堆、句柄和锁)。AppVerifier 还包括检查,以便预测应用程序在非管理员环境中的执行情况。

上面是微软MSDN中对它的介绍原文。MSDN在“C++安全性最佳做法”中推荐使用它来验证软件安全性。MSDN甚至还提倡在整个开发生命周期中使用这个软件:“在整个软件开发生命周期中使用时,AppVerifier可节约开发工作的成本,因为它能方便地在早期就识别出问题,而在早期修复错误是比较容易且成本较低的。”

AppVerifier能识别的问题
AppVerifier 有助于确定: (Copy于MSDN)
> 应用程序正确地使用 API 的时刻: 
> 不安全的 TerminateThread API。 
> 正确使用线程本地存储(Thread Local Storage,TLS)API。 
> 正确使用虚拟空间操作(例如,VirtualAlloc 和 MapViewOfFile)。 
> 应用程序是否使用结构化的异常处理隐藏访问冲突。> 
> 应用程序是否试图使用无效的句柄。> 
> 堆中是否有内存损坏或存在内存问题。> 
> 应用程序是否在资源不足的情况下用尽了内存。> 
> 是否正确使用了临界区。> 
> 运行在管理员环境中的应用程序在具有较低特权的环境中是否能良好运行。> 
> 当应用程序作为受限用户运行时是否会存在潜在的问题。> 
> 在线程的上下文中,是否在将来的函数调用中会存在未初始化的变量。

AppVerifier的使用
下面结合自己的应用介绍一下它的使用方法(非常简单)。
1。下载AppVerifier
在微软网站下载,并安装软件
 

2。运行AppVerifier
在AppVerifier中增加需要验证的应用程序,对于开发人员,直接选择工程中输出的Debug版的可执行文件,可以添加多个文件,也可以添加动态库DLL。

3。配置需要验证的项目
AppVerifier大致可以验证异常、句柄、堆栈、内存、未初始化参数等18个方面(3.3版)的隐患,选择需要进行测试的项目,并保存设置。

4。在IDE中调试程序
这些跟以前是一样的,只是在调试过程中AppVerifier会向你报告它检测到的问题,以异常的方式,或者输出信息到输出框中,一般的情况,程序停在发生问题的地方不远处。

5。取消验证
在AppVerifier中取消要验证的程序,否则,验证代码一直挂在程序中。


好了,先拿手上的软件试试法吧,以前没有任何错误,现在,多出来了不少的异常,赶紧看看。。。。

与它是同一个系列的另一个软件:Driver Verifier,专门来测试驱动的安全。 

本文标签: 微软出品应用程序MonitorAppVerifier