Click here to Skip to main content
15,904,156 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to create a system similar to Api Monitoring. I showed all the running processes, modules and threads of the running processes to the user.The user would be enable to select the running process and the monitoring of that process is started which shows the list of all the API's related to the modules of running processes. Now' i am stuck on a point that how i will show the list of API's that is being used in the running process. Can anybody tell me the right way to do this.

Any link to related web page will be appreciated. Thanks in advance.

What I have tried:

I have done showing the Dll's and threads of running processes.What i want is to show the API's of the DLL's used in the running processes.
Posted
Updated 21-Jun-18 23:02pm
v2

 
Share this answer
 
You have to process the IMAGE_IMPORT_DESCRIPTORs of the PE Format (Windows)[^].

Note that this (and probably also your actual code detecting the used DLLs) will not work for DLLs loaded with late binding (using LoadLibrary() and GetProcAddress()) and DLLs linked statically.
 
Share this answer
 
Comments
Member 13881816 22-Jun-18 9:57am    
I am using load library function also.
So what i have to done for this if late binding is done ??
Jochen Arndt 22-Jun-18 10:27am    
If you know that a specific DLL is used, you can get the exported symbols from that DLL and search for them in the EXE file. Because they are NULL terminated ASCII strings, this should not give not too much false positives; especially with Unicode applications which contain mainly Unicode string literals.

One option to identify such DLLs is enumerating the DLL files in the directory of the executable and exclude those which has been found in the import table.

You can also search the EXE for DLL names which might be arguments for LoadLibrary(). But this will probably only work when the programmer has used the ".dll" extension. But when LoadLibrary() is called with a file name without extension, ".dll" is appended by default so that many programmers don't include the extension.
Member 13881816 22-Jun-18 16:29pm    
It would be more helpful for me if all this one is describe through coding because i found myself stuck especially in this concept.
Jochen Arndt 22-Jun-18 18:14pm    
Which concept?

Code for parsing PE headers would be too much for "Quick Answers". But existing code and articles can be found in the web.

Similar for geting the exported symbols from a DLL.

Loading an EXE file into memory and searching for strings is a quite simple task.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900