Git Product home page Git Product logo

dll-dependencies-parser's Introduction

DLL Dependencies Parser

A command line application for finding recursive DLL dependencies on an EXE or DLL as well as a way of listing which DLLs cannot be loaded or found.

Why?

When you launch an EXE or load a DLL, it might fail due to some missing DLL. Windows generally does not make debugging DLL loading failures easy. You might only receive an application error code indicating DLL load failure and no detailed report as to why and which DLL was actually missing. There are ways of listing DLL dependencies such as outlined here but the DLL Dependencies Parser can be implemented into any application easily via an external process call and it can accurately report DLL load failures. Furthermore, the application is fully statically compiled (all libraries and CRT) to only depend on KERNEL32.dll to ironically not fall victim to the problem it tries to solve:

>dumpbin /dependents DLL-Dependencies-Parser.exe
Microsoft (R) COFF/PE Dumper Version 14.28.29336.0
Copyright (C) Microsoft Corporation.  All rights reserved.


Dump of file DLL-Dependencies-Parser.exe

File Type: EXECUTABLE IMAGE

  Image has the following dependencies:

    KERNEL32.dll

  Summary

        B000 .data
        8000 .pdata
       31000 .rdata
        2000 .reloc
        1000 .rsrc
       B2000 .text
        1000 _RDATA

Note that dumpbin is only available if you installed Visual Studio's C++ development tools so it is not suitable for distribution or reasonable to assume it is even available on the user's system.

Usage

DLL-Dependencies-Parser.exe [OPTIONS]

Options:
  -h,--help                   Print this help message and exit
  --pe-file-path TEXT:FILE REQUIRED
                              The file path to the executable to analyze
  --skip-parsing-windows-dll-dependencies
                              Whether Windows DLLs will not be parsed to speed up analysis
  --results-output-file-path TEXT
                              The output file to write the results to

Example:

>DLL-Dependencies-Parser.exe --pe-file-path D:\My-Application.exe --results-output-file-path D:\Results.json --skip-parsing-windows-dll-dependencies

Now the DLL loading report of D:\My-Application.exe is written to the D:\Results.json file and can be examined manually or programmatically.

Potential Errors

Failed parsing PE file: This error means that the input file wasn't a valid PE file. This error is returned by the pe-parse library.

Compiling

This project is a Visual Studio solution and therefore the *.sln file has to be loaded in Visual Studio. You also need a C++20 compatible MSVC compiler. Furthermore, this application depends on various libraries which need to be available on the system via a package manager like vcpkg by running the vcpkg install [package-name] command:

Furthermore, don't forget to vcpkg integrate install with Visual Studio.

Tests

The binaries required to run the tests successfully are currently not provided.

Credits

The open source libraries above which greatly simplified the development of this tool and BullyWiiPlaza for the design and implementation.

dll-dependencies-parser's People

Contributors

bullywiiplaza avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

dll-dependencies-parser's Issues

[error] Failed parsing PE file

I get this error without much useful information. What can cause this? Not that I used MinGW to build my app.

[2021-11-14 04:11:14.079] [info] Referenced DLL Parser v1.2 (C) 2021 BullyWiiPlaza Productions
[2021-11-14 04:11:14.080] [info] Executable file path: ./build/src/app.exe
[2021-11-14 04:11:14.080] [info] Skip parsing Windows DLL dependencies: false
[2021-11-14 04:11:14.080] [info] Results output file path:
[2021-11-14 04:11:14.081] [info] Finding dependent DLLs recursively...
[2021-11-14 04:11:14.081] [error] Failed parsing PE file ./build/src/app.exe
[2021-11-14 04:11:14.082] [info] Result JSON:
{
    "dll-load-failures": [],
    "missing-dlls": [
        "./build/src/app.exe"
    ],
    "referenced-dlls": []
}
[2021-11-14 04:11:14.082] [info] DLL references resolver took 0.01 s

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.