lucasg / Dependencies

A rewrite of the old legacy software "depends.exe" in C# for Windows devs to troubleshoot dll load dependencies issues.
MIT License
9.12k stars 749 forks source link

Crash in undecorator #108

Closed MarekKnapek closed 4 years ago

MarekKnapek commented 4 years ago

Steps to reproduce:

I tried to attach an debugger after program startup and before crash and I observed a few things:

So, I think you brought in modern dbghelp.dll (version 10) but not all its dependencies.

I think you should load x86 DLL into x86 process from Windows SDK first. If it fails you should use system version of dbghelp.dll (version 6.1 on Windows 7) and not distribute your own, I don't think it is worth the hassle. If you want to distribute your own version, test if it works correctly first please.

Also, I think you should not dereference NULL object in demangle.cpp file on line 228.

Best Regards, Marek

MarekKnapek commented 4 years ago

dependencies-dbghelp

MarekKnapek commented 4 years ago

I think this issue will not manifest itself on Windows 10, because Windows 7 doesn't have api-ms-win-crt-private-l1-1-0.dll in its API-Set, but Win10 does. So Win10 will load this dependency from Api-Set and not form this file from Dependencies installation.

lucasg commented 4 years ago

Your analysis is spot on. I've fixed it with 446e201cfd6f7fd0d2a67c499dd2ff74aaa2a913

MarekKnapek commented 4 years ago

Hi Lucas, I saw your commit and I think it would not work on 32bit Windows because there is no Program Files (x86) folder there. You need to GetProcAddress IsWoW and test if you run 32bit EXE on 64bit OS. I did not test this because I'm on mobile only right now.

lucasg commented 4 years ago

Yep, fixed it 826fda88b1513a4a3ccdca421fe62075323eb28b