How do I find out which dlls an executable will load?

前端 未结 9 1388
后悔当初
后悔当初 2020-11-27 03:10

If I have a Windows executable, how can I find out which dlls it will load?

I\'m just talking about which ones that will be loaded statically, not ones it might load

相关标签:
9条回答
  • 2020-11-27 03:27

    There are utilities that will do this for you.

    In the past I've used the MS tool (depends.exe) that came with (I think) VB.:
    https://msdn.microsoft.com/en-us/library/8kche8ah.aspx

    and there's this as well:
    http://dependencywalker.com/

    and probably others as well.

    0 讨论(0)
  • 2020-11-27 03:30

    There is a handy tool called NDepend that will give you all DLL dependencies.

    0 讨论(0)
  • 2020-11-27 03:36

    Solution for Microsoft .Net:

    foreach (AssemblyName a in Assembly.ReflectionOnlyLoadFrom("SAMPLE.EXE").GetReferencedAssemblies()) 
    {
        MessageBox.Show(a.Name); 
    }
    
    0 讨论(0)
提交回复
热议问题