English 中文(简体)
How does a Dependency Walker work? [closed]
原标题:

Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn t work, and the expected results. See also: Stack Overflow question checklist

Closed 10 years ago.

I would like to be able to write my own version of a dependency walker tool (I think this is a good way to learn things). However, I don t have the necessery knowledge to be able to know, given a PE file (dll/exe) - what are it s depenencies.

I would appreciate a reference to a place that can supply me this knowledge (tutorial / article / literature / etc..).

Thanks!

问题回答

It s straight forward in principle (pseudo-code off the top of my head):

Create empty dependency list (list 1)
Create empty list of references yet to be looked at (list 2)
Add main module to list 2
repeat
  Select first module in list 2
  Open the PE file
  Parse header to find import section
  Enumerate import modules
  for each module imported
    if not already in list 1, Add it
    if not already in list 2, Add it
  Remove from list 2
until list 2 is empty.
Result in list 1.

To figure out how to actually parse the relevant parts of a PE, you can get the Portable Executable specification off of msdn.microsoft.com.





相关问题
How does a Dependency Walker work? [closed]

I would like to be able to write my own version of a dependency walker tool (I think this is a good way to learn things). However, I don t have the necessery knowledge to be able to know, given a PE ...

Dependency Walker equivalent for Linux? [duplicate]

I need a tool to show all the shared library dependencies in some graphical way, not just with ldd on each .so. For MS Windows Dependency Walker works. Is there anything for Linux? .

Using dependency Walker to find missing file

I have a dll that is working well on my computer but doesn t work on another computer. Apperently there is a missing dependency. I tried to use the dependency walker to find the missing file. It says: ...

Catching DLL dependencies in Win32 application

How can I catch a missing DLL in a dependent DLL? For example: Application is loading a DLL A. DLL A is loading DLL B. So if DLL B is not available, application just shows me: DLL A not found. Any ...

Dependency Walker Not Showing All the Depended Dll

I have a fortran dll, and I want to know the assemblies that it depends on for redistribution purpose. One thing I found out is that the dependency walker doesn t show all of the dependencies, i.e, ...

热门标签