Programmatically determine DLL dependencies

  • Thread starter Thread starter Mike C#
  • Start date Start date
M

Mike C#

Hi all,

What's the "best" way to determine an EXE file's DLL dependencies from
within a program? I basically need to figure out which DLL's are required
by an EXE like Dependency Walker, from within a C++ application.

Thanks
 
Mike said:
Hi all,

What's the "best" way to determine an EXE file's DLL dependencies from
within a program? I basically need to figure out which DLL's are required
by an EXE like Dependency Walker, from within a C++ application.

Thanks

Hi Mark,

You could load the DLL and check it your Modules via EnumProcessModules
on your process. Or something like that.

Or you can check the Import Address Table of the DLL but you wouldn't
get any DLLs that are loaded via LoadLibrary from this DLL

That are just suggestions for ways, but I'm not sure how to do it
correctly :/
 
Vinzenz Feenstra said:
Hi Mark,

You could load the DLL and check it your Modules via EnumProcessModules on
your process. Or something like that.

Or you can check the Import Address Table of the DLL but you wouldn't get
any DLLs that are loaded via LoadLibrary from this DLL

That are just suggestions for ways, but I'm not sure how to do it
correctly :/

Thanks Vincenz,

Those sound like reasonable suggestions, I'll check them out. Basically
what I'm trying to do is write a small program that determines which DLL's
an EXE needs and then determine if those DLL's are installed in the system
path. Doesn't seem like it should be too difficult - just grab all the
required DLL names and then try to load them one by one; if a DLL fails to
load, then it's not on the system path. Does that sound like a reasonable
plan?

Thanks,
Mike C#
 
Back
Top