Programmatically determine DLL dependencies

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
 
V

Vinzenz Feenstra

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 :/
 
M

Mike C#

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#
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top