Lists dependencies of a PE (exe/dll) file
Project description
mingw-ldd
Lists dependencies of a PE (exe/dll) file.
Features
- Mimics ldd output
- Allows to specify dll lookup paths
- Has no hardcoded dll lookup paths
- Makes sure the dependencies are of the same CPU architecture
- Sorts the output by dll name
- Can also print per-dep or tree outputs
Note that the arguments do not mimic ldd arguments.
Usage
The script can be installed from PyPi:
pip install mingw_ldd
mingw-ldd --help
The script can be used stanalone, given you have pefile
installed:
sudo apt-get install python3-pefile
./mingw_ldd.py --help
or:
sudo apt-get install virtualenv
virtualenv -p /usr/bin/python3 env
./env/bin/pip install -r requirements.txt
./env/bin/python3 mingw_ldd.py --help
Example
$ mingw-ldd.py -h
usage: mingw-ldd.py [-h] [--output-format {ldd-like,per-dep-list,tree}] --dll-lookup-dirs DLL_LOOKUP_DIR [DLL_LOOKUP_DIR ...] PE_FILE
Ldd-like output:
$ ./mingw-ldd.py /home/nurupo/qtox/workspace/i686/qtox/release/libtoxcore.dll \
--dll-lookup-dirs /usr/lib/gcc/i686-w64-mingw32/*-posix \
/usr/i686-w64-mingw32/lib \
/home/nurupo/qtox/workspace/i686/qtox/release
advapi32.dll => not found
iphlpapi.dll => not found
kernel32.dll => not found
libgcc_s_sjlj-1.dll => /usr/lib/gcc/i686-w64-mingw32/9.3-posix/libgcc_s_sjlj-1.dll
libopus-0.dll => /home/nurupo/qtox/workspace/i686/qtox/release/libopus-0.dll
libsodium-23.dll => /home/nurupo/qtox/workspace/i686/qtox/release/libsodium-23.dll
libvpx.dll => /home/nurupo/qtox/workspace/i686/qtox/release/libvpx.dll
libwinpthread-1.dll => /usr/i686-w64-mingw32/lib/libwinpthread-1.dll
msvcrt.dll => not found
user32.dll => not found
ws2_32.dll => not found
Per-dep-list output:
$ ./mingw-ldd.py /home/nurupo/qtox/workspace/i686/qtox/release/libtoxcore.dll \
--output-format per-dep-list \
--dll-lookup-dirs /usr/lib/gcc/i686-w64-mingw32/*-posix \
/usr/i686-w64-mingw32/lib \
/home/nurupo/qtox/workspace/i686/qtox/release
/home/nurupo/qtox/workspace/i686/qtox/release/libopus-0.dll
KERNEL32.dll => not found
libgcc_s_sjlj-1.dll => /usr/lib/gcc/i686-w64-mingw32/9.3-posix/libgcc_s_sjlj-1.dll
msvcrt.dll => not found
/home/nurupo/qtox/workspace/i686/qtox/release/libsodium-23.dll
ADVAPI32.dll => not found
KERNEL32.dll => not found
libgcc_s_sjlj-1.dll => /usr/lib/gcc/i686-w64-mingw32/9.3-posix/libgcc_s_sjlj-1.dll
msvcrt.dll => not found
USER32.dll => not found
/home/nurupo/qtox/workspace/i686/qtox/release/libtoxcore.dll
IPHLPAPI.DLL => not found
KERNEL32.dll => not found
libgcc_s_sjlj-1.dll => /usr/lib/gcc/i686-w64-mingw32/9.3-posix/libgcc_s_sjlj-1.dll
libopus-0.dll => /home/nurupo/qtox/workspace/i686/qtox/release/libopus-0.dll
libsodium-23.dll => /home/nurupo/qtox/workspace/i686/qtox/release/libsodium-23.dll
libvpx.dll => /home/nurupo/qtox/workspace/i686/qtox/release/libvpx.dll
libwinpthread-1.dll => /usr/i686-w64-mingw32/lib/libwinpthread-1.dll
msvcrt.dll => not found
WS2_32.dll => not found
/home/nurupo/qtox/workspace/i686/qtox/release/libvpx.dll
KERNEL32.dll => not found
libgcc_s_sjlj-1.dll => /usr/lib/gcc/i686-w64-mingw32/9.3-posix/libgcc_s_sjlj-1.dll
libwinpthread-1.dll => /usr/i686-w64-mingw32/lib/libwinpthread-1.dll
msvcrt.dll => not found
/usr/i686-w64-mingw32/lib/libwinpthread-1.dll
KERNEL32.dll => not found
msvcrt.dll => not found
/usr/lib/gcc/i686-w64-mingw32/9.3-posix/libgcc_s_sjlj-1.dll
KERNEL32.dll => not found
libwinpthread-1.dll => /usr/i686-w64-mingw32/lib/libwinpthread-1.dll
msvcrt.dll => not found
Tree output:
$ ./mingw-ldd.py /home/nurupo/qtox/workspace/i686/qtox/release/libtoxcore.dll \
--output-format tree \
--dll-lookup-dirs /usr/lib/gcc/i686-w64-mingw32/*-posix \
/usr/i686-w64-mingw32/lib \
/home/nurupo/qtox/workspace/i686/qtox/release
/home/nurupo/qtox/workspace/i686/qtox/release/libtoxcore.dll
├── IPHLPAPI.DLL => not found
├── KERNEL32.dll => not found
├── libgcc_s_sjlj-1.dll => /usr/lib/gcc/i686-w64-mingw32/9.3-posix/libgcc_s_sjlj-1.dll
│ ├── KERNEL32.dll => not found
│ ├── libwinpthread-1.dll => /usr/i686-w64-mingw32/lib/libwinpthread-1.dll
│ │ ├── KERNEL32.dll => not found
│ │ └── msvcrt.dll => not found
│ └── msvcrt.dll => not found
├── libopus-0.dll => /home/nurupo/qtox/workspace/i686/qtox/release/libopus-0.dll
│ ├── KERNEL32.dll => not found
│ ├── libgcc_s_sjlj-1.dll => /usr/lib/gcc/i686-w64-mingw32/9.3-posix/libgcc_s_sjlj-1.dll
│ │ ├── KERNEL32.dll => not found
│ │ ├── libwinpthread-1.dll => /usr/i686-w64-mingw32/lib/libwinpthread-1.dll
│ │ │ ├── KERNEL32.dll => not found
│ │ │ └── msvcrt.dll => not found
│ │ └── msvcrt.dll => not found
│ └── msvcrt.dll => not found
├── libsodium-23.dll => /home/nurupo/qtox/workspace/i686/qtox/release/libsodium-23.dll
│ ├── ADVAPI32.dll => not found
│ ├── KERNEL32.dll => not found
│ ├── libgcc_s_sjlj-1.dll => /usr/lib/gcc/i686-w64-mingw32/9.3-posix/libgcc_s_sjlj-1.dll
│ │ ├── KERNEL32.dll => not found
│ │ ├── libwinpthread-1.dll => /usr/i686-w64-mingw32/lib/libwinpthread-1.dll
│ │ │ ├── KERNEL32.dll => not found
│ │ │ └── msvcrt.dll => not found
│ │ └── msvcrt.dll => not found
│ ├── msvcrt.dll => not found
│ └── USER32.dll => not found
├── libvpx.dll => /home/nurupo/qtox/workspace/i686/qtox/release/libvpx.dll
│ ├── KERNEL32.dll => not found
│ ├── libgcc_s_sjlj-1.dll => /usr/lib/gcc/i686-w64-mingw32/9.3-posix/libgcc_s_sjlj-1.dll
│ │ ├── KERNEL32.dll => not found
│ │ ├── libwinpthread-1.dll => /usr/i686-w64-mingw32/lib/libwinpthread-1.dll
│ │ │ ├── KERNEL32.dll => not found
│ │ │ └── msvcrt.dll => not found
│ │ └── msvcrt.dll => not found
│ ├── libwinpthread-1.dll => /usr/i686-w64-mingw32/lib/libwinpthread-1.dll
│ │ ├── KERNEL32.dll => not found
│ │ └── msvcrt.dll => not found
│ └── msvcrt.dll => not found
├── libwinpthread-1.dll => /usr/i686-w64-mingw32/lib/libwinpthread-1.dll
│ ├── KERNEL32.dll => not found
│ └── msvcrt.dll => not found
├── msvcrt.dll => not found
└── WS2_32.dll => not found
Disclaimer
This project is not affiliated with MinGW, the name "mingw-ldd" is used primarely to facilitate online search discoverability as MinGW suit is missing ldd.
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
mingw_ldd-0.1.0.tar.gz
(6.6 kB
view hashes)
Built Distribution
Close
Hashes for mingw_ldd-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9f8f67c9883eae75807d4ad72ca335afe19d4eafdddc83c26a3324d71fe6942d |
|
MD5 | 4ec701a24fbef385a9b09678e9be3e43 |
|
BLAKE2b-256 | 926566995f0bac5c55feb1af5385a462a4e853a335e679b7b65438046f986d2e |