tags:

views:

445

answers:

9

I have a compiled GUI application. I need to learn whether it is programmed using MFC libraries. Depends.exe does not return any dependency to MFC42*.dll. Is there any tool to get additional information about executables? (If possible not just the libraries, but the compiler being used, etc..)

+1  A: 

If the application you are concerned with was dynamically linked to MFC it will have a dependancy on MFCXX.dll where XX is the version number. For instance, our application is dependant on MFC80.dll.

However, if the application was statically linked, all the source for MFC will be compiled straight into the app.

Mark Ingram
I already said in the question, that it does not return any dependency. And I think it is possible that MFC applications can be statically build.
Not if MFC was statically linked to the application.
Ferruccio
A: 

You could try running the dumpbin utility on the file (part of the SDK or a VS install).

If you run "dumpbin /exports" you could look for any telltale MFC-isms. I'm not sure if there would be any though, so the test would only confirm MFC is statically linked, not refute it.

Rob Walker
+1  A: 

If you can run the application, get it running and then use the Sysinternals tool ProcessExplorer to view the loaded DLL's.

Or do you need a programatic way of determining if the app is using MFC? Also, I'm a bit suprised that Depends is not showing what you expect. Compare the Depends output with ProcessExplorer and see what you can learn.

John Dyer
+2  A: 

Also beware that the MFC application could have been statically linked to the MFC libraries rather than using a Shared Library - A statically linked MFC application won't show a dependency on MFCXXX.dll as an immediate dependency in Depends.

RobS
+1  A: 

You might check to see if any of the Standard MFC Resources are in the executable.

Mark Ransom
A: 

dumpbin is the tool you want, if it's statically linked. MFC symbols tend to be named '...Afx...' or '...MFC...', so if you see those, it's probably using MFC. This utility can also tell you the linker version, OS it's compiled for, etc.

Nick
A: 

Babak Farrokhi once wrote a very handy little program named "Language 2000" that scans exes looking for libraries and frameworks binary signatures. It used to detect statically linked MFC programs two fingers up the nose. The program was already old when I used it a few years ago though. You'd have to check the web is a newer version is available or if the signature still work. Who knows!

Serge - appTranslator
+1  A: 

If the applicartion is written using MFC it will generally be made up of windows that have class names that are prefixed with the Afx: string.

And if you have access to the Spy++ utility it is very easy to query the class names details of any executable.

jussij
A: 

SysInternals (recently purchased by Microsoft) published depends. Regardless of whether it's dynamically linking to DLLs or statically linked, you'll see the import/export symbols referenced (might be mangled for C++ entry point signatures).

This tool is also extremely beneficial for detecting circular references (using dependency tree). And in those rare instances when you're absolutely certain you exported the entry point but the linker still fails, you can examine the DLL for the "missing" entry point.

Also aids in discovering hidden secrets of a DLL.

SAMills