How to get list of all Windows APIs used/called from my C++ codebase [duplicate]

  analysis, c++, winapi, windows

How to get a list of all Windows function Names, called from my C/C++ codebase. (From IO CreateFile to GDI+) Nice to also get functions called dynamically from GetProcAddress.

For example –

void main() {
  myClass obj;
  obj.method();
  HANDLE file = CreateFile(L"hello_there.txt", GENERIC_WRITE, 0, NULL, CREATE_NEW, FILE_ATTRIBUTE_NORMAL, NULL);
  MyFuncProcess(file);
  WriteFile(file, L"general kenobi", 15, &written, NULL);
}

processing the above file should give CreateFile and WriteFile as output. As they are windows functions. (all files put together will have definitions for all my classes and functions)

I did not find any tools that does this.
Possible approaches –

  1. using Doxygen to generate call graphs and analyze it.
  2. generating object files and looking at unresolved symbols.
  3. running grep on codebase for each windows function name.

Note : I do not want complex call graphs or representation modals. Since the codebase is huge, it will take long time look for symbols or grep entire codebase multiple times.
Looking for tools or optimal approach to get simple list of win function names in a text file.

Thanks in advance.

Source: Windows Questions

LEAVE A COMMENT