Dear Coders,
We need a simple application (let's call it "[login to view URL]") that launches? an external application and gets the number of times that each API (in the Import Table of the target application) is called.
Basically:
1)? ApiProfiler launches a target? application with debug attributes (CreateProcess with DEBUG_PROCESS flag)
2)? ApiProfiler writes (WriteProcessMemory) an INT 3 instruction (breakpoint) in each entry in the import table of the target application in memory
3) The target application starts running
4) When the INT 3 occurs, ApiProfiler receives the debug event and increments the counter for that API and continues execution of the target application (returning control to the addess of the API, so the targets runs normally)
5) When the target application exits,? ApiProfiler will write in a text file the number of times that each API was called. Example of output:
[[login to view URL], LoadLibraryA] = 30 times
[[login to view URL], GetModuleHandleA] = 5 times
[[login to view URL], BeginPaint] = 1560 times
....
Requeriments
-----------------
1) Application is written in C/C++ under Visual Studio 2005
2) Application can launch either x32 or x64 Windows applications. So, you might need to compile? [login to view URL] in x32 and x64 mode.
3) Application is called via command line with following arguments:
[login to view URL] [login to view URL] [/d [login to view URL]] /f outputfile
Where:
**/d [login to view URL]**:? ? ? The file [login to view URL] contains a list of DLL names that are going to be profiled. Example of file "[login to view URL]":
---
[[login to view URL]]
[[login to view URL]]
[[login to view URL]]
---
In the above example, all functions imported in Kernel32, User32 and [login to view URL] will be profiles in the target application.
If /d parameter is not passed as argument, then "[login to view URL]" will profile all functions in all DLLs in the target application.
**/f [login to view URL]**: File name to store the final log with profile for each API
If you have any questions, feel free to ask.
Thanks!
## Deliverables
Windows application