Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Usage Note of Microsoft Dependency Walker

933 views

Published on

Note of using Microsoft "Dependency Walker" tool, depends.exe

Published in: Software
  • Be the first to comment

  • Be the first to like this

Usage Note of Microsoft Dependency Walker

  1. 1. Usage Note of Microsoft Dependency Walker (depends.exe) William.L wiliwe@gmail.com 2012-02-07
  2. 2. Index Introduction..................................................................................................................................................... 3 Usage ................................................................................................................................................................ 4 Dependency Walker program................................................................................................................ 4 Manual ..................................................................................................................................................... 4 Reference ......................................................................................................................................................... 6
  3. 3. Introduction Dependency Walker is a free utility that scans any 32-bit or 64-bit Windows module (exe, dll, ocx, sys, etc.) and builds a hierarchical tree diagram of all dependent modules. For each module found, it lists all the functions that are exported by that module, and which of those functions are actually being called by other modules. Another view displays the minimum set of required files, along with detailed information about each file including a full path to the file, base address, version numbers, machine type, debug information, and more. Dependency Walker is also very useful for troubleshooting system errors related to loading and executing modules. Dependency Walker detects many common application problems such as missing modules, invalid modules, import/export mismatches, circular dependency errors, mismatched machine types of modules, and module initialization failures. Dependency Walker runs on Windows 95, 98, Me, NT, 2000, XP, 2003, Vista, and 7. It can process any 32-bit or 64-bit Windows module, including ones designed for Windows CE. It can be run as graphical application or as a console application. Dependency Walker handles all types of module dependencies, including implicit, explicit (dynamic / runtime), forwarded, delay-loaded, and injected. A detailed help is included. Dependency Walker is completely free to use. However, you may not profit from the distribution of it, nor may you bundle it with another product. This tool is similar to “ldd” (List Dynamic Dependencies) and “nm” (list symbol) under Unix-like systems (ex: Linux). Dependency Walker official site : http://www.dependencywalker.com/
  4. 4. Usage Before using depends.exe, it needs to install SDK/WDK. Dependency Walker’s current version is v2.2 and Visual Studio version is 2012. Dependency Walker program Drive:Program FilesWindows Kits8.0Toolsx86depends.exe Manual Drive:Program FilesWindows Kits8.0Toolsx86Depends.chm Steps : 1. Run depends.exe 2. Select an executable by clicking menu item “File > Open” 3. Then it will show dependent module tree diagram as below. Here showing the selected executable, test4.exe, depends on Kernel32.dll and MSVCR1110.dll DLLs or said it uses APIs exported from these libraries. We can use Dependency Walker to see an executable or module depends on which library BEFORE running it and then check if the running environment lacks those dependent modules or libraries. When building an executable, to configure static link for the running environment has no MSVCR1110.dll. Followings are API dependent DLL trace examples (the selected executable functions showing system information, O.S version). GetVersionEx() This is defined in “Drive:Program FilesWindows Kits8.0Includeumsysinfoapi.h”. For wide character(Unicode,UTF-16) it represents GetVersionExW() and GetVersionExA() for ANSI version. See http://msdn.microsoft.com/en-us/library/windows/desktop/ms724451(v=vs.85).aspx. This API is exported from DLL “Kernel32.dll”.
  5. 5. GetSystemInfo() See http://msdn.microsoft.com/en-us/library/windows/desktop/ms724381(v=vs.85).aspx. This API is exported from DLL “Kernel32.dll”. These error messages are the case that it can find modules for current CPU architecture. An alternative tool is Microsoft DumpBin, it is included in Visual Studio. To achieve similar function as Dependency Walker, please run the below command: dumpbin.exe /DEPENDENTS See below links for more information. * DUMPBIN Command Line https://msdn.microsoft.com/en-us/library/20y05bd5.aspx * Description of the DUMPBIN utility https://support.microsoft.com/en-us/kb/177429
  6. 6. Reference * Escape from DLL Hell with Custom Debugging and Instrumentation Tools and Utilities https://msdn.microsoft.com/en-us/magazine/bb985842.aspx * How to use Dependency Walker? http://wiki.imacros.net/Dependency_Walker http://www-archive.mozilla.org/quality/help/dependency-walker.html

×