11

Is there anyway to monitor API calls on your system in C?

JaredPar
  • 733,204
  • 149
  • 1,241
  • 1,454
dax
  • 203
  • 1
  • 2
  • 5

5 Answers5

3

API Monitoring Tools has an extensive list of API Monitoring Tools. I used PIX for monitoring DirectX calls. You should give a try to Rohitab's Api Monitor.

SMUsamaShah
  • 7,677
  • 22
  • 88
  • 131
3

On a function-by-function base, you can use Microsoft Detours. It intercepts API calls by rewriting the function entry points to point to your code.

MSalters
  • 173,980
  • 10
  • 155
  • 350
2

Another tool to look at is ProcessMonitor from Mark Russinovich. It doesn't monitor all api calls, however.

RBerteig
  • 41,948
  • 7
  • 88
  • 128
  • And it uses a custom device driver. – aib Apr 06 '09 at 21:44
  • Right, it does that rather than inject a DLL into the process because it introduces fewer quirky issues and is less invasive of the process being inspected. It does mean that you need more than normal user privileges to run it, however. – RBerteig Apr 06 '09 at 23:07
2

The Debugging Tools for Windows package includes a debugger extension called logexts.dll which can log Win32 API function calls. It also has a separate front-end program called logger.exe for when you don't want to attach the debugger.

bk1e
  • 23,871
  • 6
  • 54
  • 65
1

Although it isn't free, you may want to look into API Monitor. It has the ability to log to XML files, so you could determine the APIs that have been called by reading this file in your application of choice.

John T
  • 23,735
  • 11
  • 56
  • 82