检查正在运行的进程调用了哪个Windows API

4
我想要检查一个正在运行的程序调用了哪个Windows API。例如,如果该进程调用了timeGetTime()endprocess()或其他API,我想知道这些信息,并最好实时显示或存储。
如果我能选择要了解使用哪个API也可以满足我的需求。我知道可以使用API hooking等技术来实现这一点,但我正在寻找一个现有的程序来完成此任务。是否存在这样的程序?任何帮助将不胜感激。

那你的意思是你不想使用Detours吗? - Roger Rowland
好的,这并不太困难 - 如果你有 MS 符号文件,你可以尝试使用 Glowcode 这样的分析器。但是,在 SO 上询问工具推荐确实是与主题无关的。 - Roger Rowland
@RogerRowland:它显示正在使用哪个Windows API吗?从介绍页面上我看不出来... - Mark
我用它来对我的应用程序进行分析,但如果你有符号文件,你可以追踪任何东西。它有一个免费试用期,为什么不试试呢? - Roger Rowland
1
同时,谷歌刚刚发现了这个链接(http://www.rohitab.com/apimonitor),看起来很有前途。 - Roger Rowland
显示剩余4条评论
3个回答

7
我知道的最好的Windows API嗅探器是API Monitor。尽管它是alpha版本,但它总是对我很好用。

3

嗯,它似乎显示了一些 API 的使用情况,但我知道有些程序正在使用某些 API,比如 timeGetTime,但它并没有显示出来…… - Mark
@Mark,你只需要运行时信息还是静态信息也足够了?如果是静态信息,可以尝试使用Dependency Walker http://www.dependencywalker.com/。 - Lendmann
理想情况下,我希望能实时获取信息,以便查看实际使用的函数。 - Mark
2
@Mark 这不是最理想的情况。你会很难找到只在特定条件下执行的API调用,比如每周检查更新。在这方面,导入表更可靠。然而,它不会包含通过LoadLibrary/GetProcAddress动态解析的导入条目。 - IInspectable

1
我正在使用WinAPIOverride来调试我的Windows应用程序,它是免费的且非常容易使用:
WinAPIOverride is an advanced api monitoring software for 32 and 64 bits processes.
You can monitor and/or override any function of a process. 
This can be done for API functions or executable internal functions.

It tries to fill the gap between classical API monitoring softwares and debuggers.
It can break targeted application before or after a function call, allowing memory or registers changes; and it can directly call functions of the targeted application.

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接