Read this in other languages: Русский
A command-line tool for analyzing and publishing dependencies of Windows PE files (executables and DLLs).
- Analyzes dependencies of PE files (both native and managed)
- Classifies dependencies into categories:
- System Dependencies (Windows system DLLs)
- Runtime Dependencies (MSVC, MFC, and .NET runtime DLLs)
- Virtual Dependencies (Windows API Sets)
- Other Dependencies (application-specific DLLs)
- Supports recursive dependency analysis
- Can publish the application with its dependencies
- .NET 8.0 or higher
- Windows operating system
- Clone the repository
- Build the project:
The analyzer can be built in several ways depending on your needs:
- Fastest startup time
- Best runtime performance
- Smallest memory footprint
- Platform-specific (needs separate builds for different platforms)
- Limited reflection capabilities
dotnet publish --configuration Release /p:PublishProfile=NativeAotOutput: bin/Release/publish-native/PEDependencyAnalyzer.exe
- Single executable file
- Includes all dependencies
- No installation required
- Larger file size
- Slightly slower startup
dotnet publish --configuration Release /p:PublishProfile=SingleFileOutput: bin/Release/publish-single-file/PEDependencyAnalyzer.exe
- Requires .NET Runtime
- Smallest distribution size
- Full runtime features
- Platform independent
- Best for development
dotnet publish --configuration Release /p:PublishProfile=FrameworkOutput: bin/Release/publish-framework/PEDependencyAnalyzer.exe
Choose the appropriate build based on your requirements:
- Use Native AOT for best performance in production
- Use Single-file for easy distribution to end users
- Use Framework-dependent for development or when .NET Runtime is already installed
Basic analysis:
PEDependencyAnalyzer <file_or_directory_path>Publishing with dependencies:
PEDependencyAnalyzer <file_path> --publish[=directory_name]--publish[=directory_name]- Enable publish mode (default directory: 'publish')--no-runtime- Exclude runtime DLLs from publish--no-virtual- Exclude virtual DLLs from publish
Analyze a single file:
PEDependencyAnalyzer app.exeAnalyze all executables in a directory:
PEDependencyAnalyzer C:\MyAppPublish with all dependencies:
PEDependencyAnalyzer app.exe --publishPublish to a specific directory without runtime DLLs:
PEDependencyAnalyzer app.exe --publish=dist --no-runtimeThe tool classifies dependencies in the following order:
- Virtual Dependencies: DLLs starting with "api-ms-win-" or "ext-ms-win-"
- Runtime Dependencies: MSVC runtime, MFC, and .NET runtime DLLs
- System Dependencies: DLLs located in Windows system directories
- Other Dependencies: All remaining DLLs
System Dependencies:
-------------------
KERNEL32.dll C:\Windows\system32\KERNEL32.dll
USER32.dll C:\Windows\system32\USER32.dll
...
Runtime Dependencies:
--------------------
msvcrt.dll C:\Windows\system32\msvcrt.dll
msvcp_win.dll C:\Windows\system32\msvcp_win.dll
...
Virtual Dependencies (API Sets):
------------------------------
api-ms-win-core-console-l1-1-0.dll ...
api-ms-win-core-debug-l1-1-0.dll ...
...
Other Dependencies:
------------------
MyApp.Core.dll C:\MyApp\MyApp.Core.dll
...
Summary:
--------
System Dependencies: 17
Runtime Dependencies: 2
Virtual Dependencies: 35
Other Dependencies: 1
Total Dependencies: 55
MIT License