I have to create a software that will scan several directories and extracts information about the executables found.
I need to do two things:
- Determine if a given file is an executable (
.exe,.dll, and so on) – Checking the extension is probably not good enough. - Get the information about this executable (the company name, the product name, and so on).
I never did this before and thus am not aware if there is a Windows API (or lightweight C/C++ library) to do that or if it is even possible. I guess it is, because explorer.exe does it.
Do you guys know anything that could point me in the right direction ?
Thank you very much for your help.
You can verify as much of the PE File Format as you want. If you want to, you can also check for a PE file signature. You can then use the File Version API to retrieve the company name, product name, version numbers, etc.