Jump to content
  • Advertisement
Sign in to follow this  
dxp

determine EXE dependencies

This topic is 4841 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, I have an executeble "app.exe" and I would like to determine its dependencies from a c++ code. How can I do that? I like to pass the path of the EXE to my program and the program reads the dependencies (such as DLLs) and spit out the info to a console. Any advice would be great. regards, dxp

Share this post


Link to post
Share on other sites
Advertisement
As far as I know, depends will only give you statically linked dlls. If you really want to you can search the exe for .dll

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
http://msdn.microsoft.com/msdnmag/issues/02/02/PE/default.aspx

Share this post


Link to post
Share on other sites
This might not help so much, but on unix machines, the command ldd does this. Searching for 'windows ldd' or something similar might produce what you're looking for.

Share this post


Link to post
Share on other sites
As mentioned previously, you need to search the import table. Also as mentioned previously, this only works for DLLs that are linked at compile time to your application. It's pretty much impossible to locate every DLL an app links at run time (with LoadLibrary).

Share this post


Link to post
Share on other sites
Yes I want to do this only for DLLs linked at compiled time. I want to know how to do this from my own code, that's why am asking. If you have link to article on this I would love that too.

regards,
dxp

Share this post


Link to post
Share on other sites
Quote:
Original post by Anonymous Poster
http://msdn.microsoft.com/msdnmag/issues/02/02/PE/default.aspx


Oh sweet, I didn't notice this until now. This is exactly what I was looking for. Thank you.

regards,
dxp

Share this post


Link to post
Share on other sites
Quote:
Original post by dyerseve
As far as I know, depends will only give you statically linked dlls. If you really want to you can search the exe for .dll


Depends has a profiling feature that will launch the target exe and track calls to LoadLibrary and GetProcAddress as well as a whole bunch of other things. Try digging a little deeper into it the next time you run it.

Share this post


Link to post
Share on other sites
Quote:
Original post by LessBread
Depends has a profiling feature that will launch the target exe and track calls to LoadLibrary and GetProcAddress as well as a whole bunch of other things. Try digging a little deeper into it the next time you run it.

That's of limited usefulness, though. It only logs calls actually made. If there are other calls to LoadLibrary in branches that don't get taken, you still won't know about them.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!