Dependency Checker









Dependency Checker

Anyone who has spent some time developing Windows software or packaging applications for Windows distribution will have come across Dependency Walker. This utility from Steve Miller allows you to identify which other PE files (exe files, dlls or ocxs) are required for an application to run successfully. Most users will have seen the dialog telling them that a file required to run this application or one of its dependencies is missing. The problem with this error message is that it only tells you that something is missing, not which file you need to fix the problem. This is where dependency walker comes in. Run dependency walker on the machine in question and point it to the exe file you are trying to run. It will then open the file and read the imports table in the PE header.

PE Header

Any executable file in Windows uses the Portable Executable (PE) file format. This contains different sections such as imports, exports, resources and executable code. For the purposes of dependency walking we are only interested in the imports table. This table details the functions being imported from other external PE files.


By reading the imports section we can identify which external files are required to provide the imported functions for our executable. This is a simple dependency check. If the DLL exists in the application folder or in its system wide registered location then the application should be able to function.


But what if one of the imports for a dependent executable is missing. This is the walking part of dependency walker. It walks down each chain of dependencies until it finds no more to check that all import requirements have been met. This is great as it highlights any missing files down the chain that may be causing your application to fail. And this is why we needed this tool in the first place.


In theory this should allow us to solve all of our problems, but there are some issues. Firstly, dependency walker always seems to highlight a problem with IEFRAME.DLL and SHLWAPI.DLL. Although these are never (in my experience) the culprits. Secondly, while the interface is very detailed and tells you everything you need to know and then a little more about the dependencies this can be a little overwhelming for the first time user. Interpreting the data is a task in itself. Thirdly, there is always the issue of late binding executables which donít make function calls until runtime. There is no way for dependency walker to identify these as they are not listed in the imports table.


This is why I created Dependency Checker. It is a simpler smaller utility aimed primarily at application packagers and focused on solving the missing file problem rather than delving into details on individual functions. It runs in 2 modes; Imports Scan or Deep Scan. The imports scan works like dependency walker and reads the imports table to determine which exes, dlls or ocxs are required by the application. It does not however walk down the dependency chain. It will only provide the first level of dependencies. If you want to manually walk down a chain you can double click one of the dependent files and a new copy of dependency checker will be started which will automatically perform a dependency check for this file.

The second mode is the deep scan. This attempts to identify any late bound executables that may be called by the application. It does this using a heuristic approach to identifying possible external files required by the application. It is worth noting that this can occasionally produce some false positives. In deep scan mode dependency checker allows you to filter on specific file types using the panel on the left. This can help to fine tune the utility for dlls or sys files for instance.

Finally, dependency checker allows you to scan the system for missing dependencies. It does this by checking the folder where the application resides and also the registered system folder to determine if the files in question are present on the system. Those which are required but do not appear to be present are listed in a dialog. If you double click a file in this list it will open your default browser and google the dll for you.

© Copyright Jonty Lovell 2010. All Rights Reserved.