lucasg / dependencies Goto Github PK
View Code? Open in Web Editor NEWA rewrite of the old legacy software "depends.exe" in C# for Windows devs to troubleshoot dll load dependencies issues.
License: MIT License
A rewrite of the old legacy software "depends.exe" in C# for Windows devs to troubleshoot dll load dependencies issues.
License: MIT License
Those should be shown with a 'missing' icon, like native DLLs.
Not sure if this is the intended use for Dependencies, but it almost fills our need, so posting this for feedback.
We're running Dependencies as part of our build scripts in a Jenkins environment to build source packages for installers. In situations where Dependencies is being run simultaneously by many different jobs, we are seeing the following error:
Unhandled Exception: System.IO.IOException: The process cannot access the file 'C:\Users<username>\AppData\Local\Dependencies\BinaryCache\x64\D936A81CA7A7AC5320448171D35891444F53BB6192E7298B3FD7F503BE4D77AA' because it is being used by another process.
Are there any suggestions for a work-around for this issue? Would it be possible to have Dependencies handle this situation more gracefully? Besides this error, Dependencies is working as a replacement for Dependency Walker in our system.
(c28.510): CLR exception - code e0434352 (!!! second chance !!!)
KERNELBASE!RaiseException+0x39:
000007fe`fcfda49d 4881c4c8000000 add rsp,0C8h
0:000> !clrstack
OS Thread Id: 0x510 (0)
Child SP IP Call Site
00000000004ebfb8 000007fefcfda49d [HelperMethodFrame: 00000000004ebfb8]
00000000004ec0a0 000007fe92222341 System.Windows.Markup.XamlReader.RewrapException(System.Exception, System.Xaml.IXamlLineInfo, System.Uri)
00000000004ec0d0 000007fe91e355ac System.Windows.FrameworkTemplate.LoadTemplateXaml(System.Xaml.XamlReader, System.Xaml.XamlObjectWriter)
00000000004f2968 000007fef0cc2fbd [PrestubMethodFrame: 00000000004f2968] Dependencies.ExtractIcon.GetIcon(System.String, Boolean)
00000000004f29d0 000007fe922220ec Dependencies.ImageToHeaderConverter.Convert(System.Object, System.Type, System.Object, System.Globalization.CultureInfo)
Dependencies.ImageToHeaderConverter.Convert
is JITTED :
0:000> !Name2EE Dependencies.exe Dependencies.ImageToHeaderConverter.Convert
Module: 000007fe913b2f90
Assembly: Dependencies.exe
Token: 00000000060000b8
MethodDesc: 000007fe921df8c8
Name: Dependencies.ImageToHeaderConverter.Convert(System.Object, System.Type, System.Object, System.Globalization.CultureInfo)
JITTED Code Address: 000007f
but Dependencies.ExtractIcon.GetIcon
is NOT :
0:000> !Name2EE Dependencies.exe Dependencies.ExtractIcon.GetIcon
Module: 000007fe913b2f90
Assembly: Dependencies.exe
Token: 00000000060000b7
MethodDesc: 000007fe922070f0
Name: Dependencies.ExtractIcon.GetIcon(System.String, Boolean)
Not JITTED yet. Use !bpmd -md 000007fe922070f0 to break on run.
BUGCHECK_STR: CLR_EXCEPTION_System.MissingMethodException
DEFAULT_BUCKET_ID: CLR_EXCEPTION_System.MissingMethodException
PRIMARY_PROBLEM_CLASS: CLR_EXCEPTION
STACK_TEXT:
00000000`004f2900 00000000`00000000 Dependencies!Dependencies.ExtractIcon.GetIcon+0x1
00000000`004f29d0 000007fe`922220ec Dependencies!Dependencies.ImageToHeaderConverter.Convert+0x3c
00000000`004f2a40 000007fe`91be3f33 PresentationFramework!System.Windows.Data.BindingExpression.TransferValue+0x183
00000000`004f2ad0 000007fe`91bde787 PresentationFramework!System.Windows.Data.BindingExpression.Activate+0x2b7
00000000`004f2b40 000007fe`91b1ca6b PresentationFramework!System.Windows.Data.BindingExpression.AttachToContext+0x7eb
00000000`004f2bc0 000007fe`91b19c35 PresentationFramework!System.Windows.Data.BindingExpression.AttachOverride+0x1e5
00000000`004f2c10 000007fe`91b199bb PresentationFramework!System.Windows.Data.BindingExpressionBase.Attach+0x5b
00000000`004f2c60 000007fe`91b1706d PresentationFramework!System.Windows.StyleHelper.GetInstanceValue+0x2cd
00000000`004f2d00 000007fe`91e37496 PresentationFramework!System.Windows.FrameworkTemplate.ReceivePropertySet+0x496
00000000`004f2e00 000007fe`91e36fd5 PresentationFramework!System.Windows.FrameworkTemplate+__c__DisplayClass6._LoadOptimizedTemplateContent_b__4+0x25
00000000`004f2e40 000007fe`9182597b System_Xaml!System.Xaml.XamlObjectWriter.OnSetValue+0x5b
00000000`004f2e90 000007fe`9180af2e System_Xaml!System.Xaml.XamlObjectWriter.SetValue+0x3e
00000000`004f2ee0 000007fe`9180aba1 System_Xaml!System.Xaml.XamlObjectWriter.Logic_ApplyPropertyValue+0xc1
00000000`004f2f50 000007fe`9180a549 System_Xaml!System.Xaml.XamlObjectWriter.Logic_DoAssignmentToParentProperty+0x2d9
00000000`004f2fb0 000007fe`9181d075 System_Xaml!System.Xaml.XamlObjectWriter.WriteEndObject+0x1c5
00000000`004f3010 000007fe`91e35211 PresentationFramework!System.Windows.FrameworkTemplate.LoadTemplateXaml+0x41
BUCKET_ID: X64_CLR_EXCEPTION_System.MissingMethodException_Dependencies!Dependencies.ImageToHeaderConverter.Convert+3c
I have all the DLLs of my dependencies in a single folder, which is part of the user PATH. This way, they are available everywhere and I can run all my applications during development from anywhere, without needing to copy the DLLs to the correct path.
Sadly, Dependencies can't find those DLLs.
Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object.
at Dependencies.PeDependencyItem.ResolveDependencies() in C:\projects\dependencies\Dependencies\Program.cs:line 294
at Dependencies.PeDependencyItem.ResolveDependencies() in C:\projects\dependencies\Dependencies\Program.cs:line 309
at Dependencies.PeDependencyItem.ResolveDependencies() in C:\projects\dependencies\Dependencies\Program.cs:line 309
at Dependencies.PeDependencyItem.ResolveDependencies() in C:\projects\dependencies\Dependencies\Program.cs:line 309
at Dependencies.PeDependencyItem.ResolveDependencies() in C:\projects\dependencies\Dependencies\Program.cs:line 309
at Dependencies.PeDependencyItem.ResolveDependencies() in C:\projects\dependencies\Dependencies\Program.cs:line 309
at Dependencies.PeDependencyItem.ResolveDependencies() in C:\projects\dependencies\Dependencies\Program.cs:line 309
at Dependencies.PeDependencyItem.ResolveDependencies() in C:\projects\dependencies\Dependencies\Program.cs:line 309
at Dependencies.PeDependencyItem.ResolveDependencies() in C:\projects\dependencies\Dependencies\Program.cs:line 309
at Dependencies.PeDependencyItem.ResolveDependencies() in C:\projects\dependencies\Dependencies\Program.cs:line 309
at Dependencies.Program.DumpModules(PE Pe, Action`1 Printer) in C:\projects\dependencies\Dependencies\Program.cs:line 503
at Dependencies.Program.Main(String[] args) in C:\projects\dependencies\Dependencies\Program.cs:line 591
Essentially, this happens because LookupApiSetLibrary
can return an empty string instead of null (seems like PhLib issue).
Something that initially threw me off when I tried this utility out was that the import list (top right) behaves differently than the original Depends utility.
In the original Depends, when you select a module from the tree view (left), the import list shows those functions that are imported from the selected module by its parent in the tree. Modules would also be shaded red if any of the functions expected to be imported from them were missing.
In this Dependencies utility, when you select a module from the tree view or from the module list, the import list shows those functions that are imported by (i.e. exported to) the selected module from its child dependencies in the tree.
I actually prefer the old Depends behavior. From the tree view I can easily see the module dependencies of a particular parent. And from the import list I can easily see the parent's function dependencies from a particular module. In this Dependencies utility I have to select a parent, sort its imports by module, and search through the list to find out what it imports from a particular module.
I'd like to see a user setting to enable the old Depends behavior. In this mode, the Module and Delayed columns of the Import list might be removed, and selecting a module from the module list (bottom) would have no effect on the import/export lists.
I see in the import/export grids it is possible to select all or multiple lines - which is very nice -but copying the selection and pasting it gives only a concatenation of the 'Function' column contents.
Ideally all the selected line contents would be copyable, with tabs between consecutive fields in a line and newlines between lines.
I get a crash loading any file, it seems to be something systemic. I'm on Windows 7 x64 SP1 which I would guess is important.
I was able to build and debug a bit, here's what I found so far:
It crashes with System.ArgumentOutOfRangeException: 'Length cannot be less than zero.'
here. The reason being that ApiSetEntryName
is empty and so the LastIndexOf
is returning -1
.
ApiSetEntryName
is empty because ApiSetEntryIterator->NameLength
is 0. The rest of ApiSetEntryIterator
doesn't look quite right, I think the struct is different in memory because ValueCount
seems too high. Likewise ApiSetEntryNameBuffer
contains the API set but not at the right offset - it has the filename before:
- ApiSetEntryIterator
Flags 1 unsigned long
NameOffset 500 unsigned long
NameLength 0 unsigned long
HashedLength 500 unsigned long
ValueOffset 24 unsigned long
ValueCount 6619243 unsigned long
+ ApiSetEntryNameBuffer 0x000007feff6c01f4 L"kernel32.dllMS-Win-Core-DateTime-L1-1-0" wchar_t *
Even fixing that up though, after that point things quickly go off the rails - the value entries seem to be pointing nonsense, and the subsequent ApiSetEntryIterator
after 0 are all wrong.
It looks like maybe the struct size is different and contains different elements, but I wouldn't know where to begin figuring out the difference.
btw, I ran into some issues building. When I tried to build out of a plain checkout I was missing ntstatus.h
. It seems for some reason that has been removed in the 10.0.15063.0
SDK, so I switched the C++ projects to 10.0.14393.0
. I was then missing atlstr.h
and I'm not sure where that should come from - some MFC thing and I don't know whether I didn't install that or it's something with my configuration or what.
In case you're interested, I applied this patch below to remove the use of CString
and eliminate that dependency based on this page. If you don't care then just ignore this π.
diff --git a/ClrPhlib/src/managed/PE.cpp b/ClrPhlib/src/managed/PE.cpp
index 26c5c7f..775d663 100644
--- a/ClrPhlib/src/managed/PE.cpp
+++ b/ClrPhlib/src/managed/PE.cpp
@@ -1,6 +1,5 @@
#include <ClrPhlib.h>
#include <UnmanagedPh.h>
-#include <atlstr.h>
using namespace System;
using namespace System::Text;
@@ -10,12 +9,16 @@ PE::PE(
_In_ String ^ Filepath
)
{
- CString PvFilePath(Filepath);
m_Impl = new UnmanagedPE();
- this->LoadSuccessful = m_Impl->LoadPE(PvFilePath.GetBuffer());
+ using namespace Runtime::InteropServices;
+ wchar_t* PvFilepath = (wchar_t*)(Marshal::StringToHGlobalUni(Filepath)).ToPointer();
+
+ this->LoadSuccessful = m_Impl->LoadPE(PvFilepath);
this->Filepath = gcnew String(Filepath);
+ Marshal::FreeHGlobal(IntPtr((void*)PvFilepath));
+
if (LoadSuccessful)
InitProperties();
@@ -135,7 +138,7 @@ String^ PE::GetManifest()
// Converting to wchar* and passing it to a C#-recognized String object
UTF8Encoding Utf8Decoder;
- array<byte> ^buffer = gcnew array<byte>(rawManifestLen + 1);
+ array<unsigned char> ^buffer = gcnew array<unsigned char>(rawManifestLen + 1);
for (int i = 0; i < rawManifestLen; i++)
{
buffer[i] = rawManifest[i];
diff --git a/ClrPhlib/src/managed/PhSymbolProvider.cpp b/ClrPhlib/src/managed/PhSymbolProvider.cpp
index a05c549..2c5b5e3 100644
--- a/ClrPhlib/src/managed/PhSymbolProvider.cpp
+++ b/ClrPhlib/src/managed/PhSymbolProvider.cpp
@@ -1,6 +1,5 @@
#include <ClrPhlib.h>
#include <UnmanagedPh.h>
-#include <atlstr.h>
using namespace System;
using namespace ClrPh;
@@ -32,19 +31,22 @@ String^ PhSymbolProvider::UndecorateName(
{
String ^ManagedUndName;
PPH_STRING UndecoratedName = NULL;
- CString PvDecoratedName(DecoratedName);
if (!m_Impl) {
return gcnew String("");
}
+ using namespace Runtime::InteropServices;
+ wchar_t* PvDecoratedName = (wchar_t*)(Marshal::StringToHGlobalUni(DecoratedName)).ToPointer();
UndecoratedName = PhUndecorateNameW(
m_Impl->m_SymbolProvider->ProcessHandle,
- PvDecoratedName.GetBuffer()
+ PvDecoratedName
);
+ Marshal::FreeHGlobal(IntPtr((void*)PvDecoratedName));
+
if (!UndecoratedName) {
return gcnew String("");
}
diff --git a/ClrPhlib/src/managed/Phlib.cpp b/ClrPhlib/src/managed/Phlib.cpp
index 3b96e0a..3d0797a 100644
--- a/ClrPhlib/src/managed/Phlib.cpp
+++ b/ClrPhlib/src/managed/Phlib.cpp
@@ -1,6 +1,5 @@
#include <ClrPhlib.h>
#include <UnmanagedPh.h>
-#include <atlstr.h>
#include <ApiSet.h>
Rebuilding all from VS2017 I receive:
Certificate file 'DependenciesAppx_TemporaryKey.pfx' not found. DependenciesAppx C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\Microsoft\VisualStudio\v15.0\AppxPackage\Microsoft.AppXPackage.Targets
Hello,
Windows 10 14393, x64
DependenciesGui.exe crash on start. Version 1.8 from latest Release section.
Local user account without administrative privileges - permanent crash on startup.
Running as admin (with elevation) everything work as expected.
Running as admin (without elevation) everything work as expected.
Related Event Log entries
Application Error
Faulting application name: DependenciesGui.exe, version: 1.7.0.0, time stamp: 0x5b2ac677
Faulting module name: KERNELBASE.dll, version: 10.0.14393.2457, time stamp: 0x5b7e2a65
Exception code: 0xe0434352
Fault offset: 0x000dad12
Faulting process id: 0x17a0
Faulting application start time: 0x01d460a7e4531888
.NET Runtime
Application: DependenciesGui.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.OverflowException
at System.ClrPh.PE.InitProperties()
at System.ClrPh.PE.Load()
at Dependencies.BinaryCache.GetBinary(System.String)
at Dependencies.BinaryCache.Load()
at Dependencies.App.App_Startup(System.Object, System.Windows.StartupEventArgs)
at System.Windows.Application.OnStartup(System.Windows.StartupEventArgs)
at System.Windows.Application.<.ctor>b__1_0(System.Object)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate)
at System.Windows.Threading.DispatcherOperation.InvokeImpl()
at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(System.Object)
at MS.Internal.CulturePreservingExecutionContext.CallbackWrapper(System.Object)
at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
at MS.Internal.CulturePreservingExecutionContext.Run(MS.Internal.CulturePreservingExecutionContext, System.Threading.ContextCallback, System.Object)
at System.Windows.Threading.DispatcherOperation.Invoke()
at System.Windows.Threading.Dispatcher.ProcessQueue()
at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)
at MS.Win32.HwndWrapper.WndProc(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(System.Object)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate)
at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(System.Windows.Threading.DispatcherPriority, System.TimeSpan, System.Delegate, System.Object, Int32)
at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr, Int32, IntPtr, IntPtr)
at MS.Win32.UnsafeNativeMethods.DispatchMessage(System.Windows.Interop.MSG ByRef)
at System.Windows.Threading.Dispatcher.PushFrameImpl(System.Windows.Threading.DispatcherFrame)
at System.Windows.Threading.Dispatcher.PushFrame(System.Windows.Threading.DispatcherFrame)
at System.Windows.Application.RunDispatcher(System.Object)
at System.Windows.Application.RunInternal(System.Windows.Window)
at System.Windows.Application.Run(System.Windows.Window)
at Dependencies.App.Main()
Other executables such as Dependencies.exe and Pview.exe run well.
p.s.
Forgot to add, exact faulting exe is from Dependencies_x86_Release.
Dependencies_x64_Release - problem not reproducible.
I built Pymol on a W7 system using mingw32 (msys2) where it worked OK. Transferred it to a W10 64 bit system where it didn't work correctly (it is not drawing the molecule, everything else seems OK). Tried to see if there were dlls missing with "dependencies" starting with __cmd.pyd and it shows all of those transferred with the package as missing, including libpython2.7.dll. Demonstrated that that was not missing by starting the application with that renamed to hide_libpython2.7.dll, where it failed immediately, versus with the regular name, where it ran more or less normally.
Tried to run dependencies on the W7 32 bit system where it was built but the dependencies downloads were all 64 bit, so the binary wouldn't run.
Ran dependencies on python2.7.exe on the W10 system, which is used by __cmd.pyd, and that did find libpython2.7.dll and traced into it. (no question mark).
Ran dependencies on libpython2.7.dll on the W10 system, and that showed links to some of the other dll's not found originally (no question mark).
So, the issue seems to be that dependencies is missing or ignoring some path variable. Tried adding a path to where these dll's live before starting dependencies:
set PATH=%PATH%C:\temp\blah\bin;
then starting dependencies, but it didn't help.
On the W10 system tried running dependencies on .../Numpy/core/_umath_tests.pyd and it was just like pymol - it couldn't find libpython2.7.dll.
It may be that the same thing would happen with 64 bit dlls built on the W10 system which were also referred to from *.pyd files. That has not yet been tested.
The blank screen is confusing.
Besides, great tool! Thanks for sharing it
I'm attaching the call stack.
Hi
Would it be possible to publish the windows binaries as i am finding i cant build them ?
Maybe relates to expected SDK, not sure.
THanks
Help/About of v1.8 still displays version number 1.7.
This is because Dependencies resolves vcruntime140.dll in its own directory. Please link with static runtime or avoid resolving Dlls in the directory of Dependencies(Gui).exe.
Awesome tool!
But when we open and close a file in the program, the corresponding file can not be deleted in the Windows Explorer without exiting Dependencies.
Thanks!
I tried Dependencies.exe --help
and Dependencies.exe /?
, then just about gave up. Tried with a single hyphen as a last-ditch effort, and was surprised to find that that was what I was looking for.
(Great tool, btw.)
Thank you for the excellent tool; it has been very useful.
I just wanted to share that I ran into some trouble following this part of the directions in the README.md file:
download and uncompress the archive and click on it.
Since there are many executables, and since Dependencies.exe is not the right choice for most people, I think it would be clearer to say:
download and uncompress the archive and run DependenciesGui.exe.
can you please support 32-bit OS? I'm using windows 10 32-bit and i'd like to use your program.
Steps to reproduce:
- Download either one of the released versions
- Extract all the files from the zip
- Double click Dependencies.exe
Expected behaviour: main windows show up.
Actual behaviour: nothing happens, as if I never tried to open it in the first place.
Environment details: recently reinstalled Windows 1709, build 16299.19
Need to ensure that private lib directories are searched BEFORE finding the same lib in the user's windows PATH.
When loading ntoskrnl.exe on Windows 10 in system32, the ext-ms-win API contracts donβt seem to be resolved correctly. However this works for kernel32.dll.
Iβd like to use this in my training class but this is a blocker ;-)
The old DependencyWalker also support listing information about loaded executables (dll's) loaded at runtime by an executable (.exe) through its Profile feature.
This issue is about adding the same Profile feature so it is also possible to track which .dll's are loaded after the .exe has started. Different user actions may cause different .dll's loaded at runtime.
System.ArgumentException occurred
HResult=0x80070057
Message=Win32 handle that was passed to Icon is not valid or is the wrong type.
Source=
StackTrace:
at System.Drawing.Icon..ctor(IntPtr handle, Boolean takeOwnership)
at System.Drawing.Icon.FromHandle(IntPtr handle)
at Dependencies.ShellIcon.GetIcon(String fileName, UInt32 flags) in C:\Users\RemkoW\source\repos\Dependencies-master\Dependencies\Shell32IconExtractor.cs:line 63
at Dependencies.ShellIcon.GetSmallIcon(String fileName) in C:\Users\RemkoW\source\repos\Dependencies-master\Dependencies\Shell32IconExtractor.cs:line 50
at Dependencies.ImageToHeaderConverter.Convert(Object value, Type targetType, Object parameter, CultureInfo culture) in C:\Users\RemkoW\source\repos\Dependencies-master\Dependencies\Shell32IconExtractor.cs:line 74
at System.Windows.Data.BindingExpression.TransferValue(Object newValue, Boolean isASubPropertyChange)
at System.Windows.Data.BindingExpression.Activate(Object item)
at System.Windows.Data.BindingExpression.AttachToContext(AttachAttempt attempt)
at System.Windows.Data.BindingExpression.MS.Internal.Data.IDataBindEngineClient.AttachToContext(Boolean lastChance)
at MS.Internal.Data.DataBindEngine.Task.Run(Boolean lastChance)
at MS.Internal.Data.DataBindEngine.Run(Object arg)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
at System.Windows.Threading.DispatcherOperation.InvokeImpl()
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) in f:\dd\ndp\clr\src\BCL\system\threading\executioncontext.cs:line 954
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) in f:\dd\ndp\clr\src\BCL\system\threading\executioncontext.cs:line 902
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) in f:\dd\ndp\clr\src\BCL\system\threading\executioncontext.cs:line 891
at MS.Internal.CulturePreservingExecutionContext.Run(CulturePreservingExecutionContext executionContext, ContextCallback callback, Object state)
at System.Windows.Threading.DispatcherOperation.Invoke()
at System.Windows.Threading.Dispatcher.ProcessQueue()
at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
at System.Windows.Application.RunDispatcher(Object ignore)
at System.Windows.Application.RunInternal(Window window)
at Dependencies.App.Main()
private static Icon GetIcon(string fileName, uint flags)
{
SHFILEINFO shinfo = new SHFILEINFO();
IntPtr hImgSmall = Win32.SHGetFileInfo(fileName, 0, ref shinfo, (uint)Marshal.SizeOf(shinfo), Win32.SHGFI_ICON | flags);
Icon icon = (Icon)System.Drawing.Icon.FromHandle(shinfo.hIcon).Clone();
Win32.DestroyIcon(shinfo.hIcon);
return icon;
}
Problem is that both return value for SHGetFileInfo is not checked so if it fails hImgSmall and/or shinfo.hIcon can be null thus failing the call to System.Drawing.Icon.FromHandle.
I found that DependenciesGUI.exe crashes with a particular DLL.
First, I opened the target DLL, then one line, which shows a name of the target DLL, was shown. There were no dependencies shown.
After that I clicked the line and then it crashed.
Here it is a screenshot of a dependency tree on DependencyWalker with the target DLL.
I built this DLL on my environment with some special building option. The original source is here.
I confirmed that DependenciesGUI.exe could open tbb,dll, cudart64_80.dll, zlib1.dll without crash.
On my PATH I have a program (TortoiseSVN) that has its own API-set DLLs.
Here is a screenshot of Dependencies analysis of some program (windbg.exe), that shows the PATH copies of the actual DLLs, but any inspection (eg with ProcessExplorer) shows they're not actually used:
I suspect it is an issue with the order of simulated resolution - maybe DLLs in the executable folder are considered before the ApiSet mechanism, and the ApiSet mechanism is considered before the PATH search.
I have several DLL's which come up in a different capitalization than they are on the actual drive. For example GdiPlus.dll is reported as gdiplus.dll. It results in such an output:
| | | | Γ sppc.dll (WindowsFolder) : C:\Windows\SysWOW64\sppc.dll --
| | | | | | Γ GPSVC.dll (NOT_FOUND) :
(You can notice the additional "|"'es, all the files which have this problem produce those additional |es - as well as the "NOT_FOUND").
Usually it's files from C:\Windows\System32 (though not all of them are).
Functions and methods with && as the parameter modifier are not being unmangled
August.11.2018, Version 1.7.0.0: When submitting the current Dependencies release-zips to virustotal.com there are several hits for peview.exe. There were more hits a few days ago.
Needless to say these hits are problematic for us when we try to recommend Dependencies.exe. All the hits are related to peview.exe - a file which I assume comes from this project: https://github.com/processhacker/processhacker?
Is this tool really necessary for the operation of Dependencies? We run into credibility issues when recommending tools that have a lot of security suite issues and false positives. It can lead to problematic accusations as well. Security software also aggressively quarantine such files - often without warning - and can leave Dependencies.exe with operational issues.
What exactly - in technical terms - does peview.exe do? If we know this we might be able to explain to people what the malware-hits are about.
Thanks for a very promising tool.
Just imagine being able to drag a DLL file from Explorer and drop it on Dependencies.exe. Mmmmmmmm
Is there a way to modify the module search order when running the gui after selecting a dll? I see that there is a shortcut for viewing the search order (Maj + m), but was not seeing a clear way to add a directory to the list that appears in the dialog window. This looks more informational than something I would be able to modify.
Would it be possible to create a Chocolatey package for Dependencies?
I extracted the zip and ran DependenciesGui.exe on a Windows 7 64 bit OS. It worked after I installed .NET 4.6.1. However, the same thing on a Window 10 IOT LTSB 2016 Enterprise edition fails to load.
The DependenciesGui.exe simply doesn't load (no prompts, dialogs or anything). Dependencies.exe however gets "Dependencies has stopped working" error and pops command line window with this error:
"System.IO.FileNotFoundException: Could not load file or assembly 'ClrPhlib.dll' or one of its dependencies. The specified module could not be found. at Dependecnies.Program.Main(String[] args)"
.NET 4.6.1 is already installed on this laptop.
Hello, I am using v1.9 of Dependencies and launching DependenciesGui. I seem to be having 2 issues:
I have an assembly depending on MSVCRT 8.0 from Visual Studio 2005 ! This tool (v 1.5) cannot find it although it is located in C:\Windows\WinSxS\x86_microsoft.vc80.crt_1fc8b3b9a1e18e3b_8.0.50727.9185_none_d0905a48442809b8
I have found that when using DependenciesGui.exe, the Refresh menu option and also reopening a dll does not refresh the display.
Expected result: I expected to see the different dependencies no showing
Actual result: The previous dependencies still show
Further more closing the tab for that dll (not closing the app)
Then dragging the dll back to the DependenciesGui.exe window, also still shows the old dependencies.
However, closing the DependenciesGui.exe application completely, and then opening the dll does then show the new expected dependencies.
It would be very useful to be able to search the tree for DLLs and Entrypoints (names). E.g. I am trying to figure out why a specific DLL is loaded and by what.
Hello,
in a search for CLR based DLL's dependency walker your tool showed. A nice feature is not to crash on a compiled C# DLL - just showing the mscoree.dll dependency.
A nice addition would be to walk through the CLR dependency tree when encountering such a DLL.
Hi,
thank you for your wonderful program
unfortunately I can't read the results very well
pls, I propose you would like to add a font selection font
Kind regards,
dan
I start DependenciesGui.exe with blank content, the action Refresh
in menu View
is disabled, but shortcut F5
is still enabled.
I pressed F5
, the GUI blocked, and then crashed.
When trying to load v1.8 on Windows 8.1.
like Dependency Walker, I would like to have an command line interface to use "Dependencies".
Hi,
Can you change the icon (add an overlay or something) in the tree view, so when an imported function is missing from a module, the module and/or dependent module will appear differently in the tree (in red or something) ? As I can see know (building from the latest source), the tree is the same and overlays are added when it's delay load or else, but no specific overlay is added for missing imported function in a module).
The grid that shows the missing exported function is fine, if I select a module the missing function is in red in that view, but the tree remains unaffected like if everything was fine.
Regards,
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.