ramensoftware / windhawk

The customization marketplace for Windows programs: https://windhawk.net/
https://windhawk.net
GNU General Public License v3.0
1.06k stars 28 forks source link

Loading symbols does not properly fail when msdl.microsoft.com is unavailable #147

Open aubymori opened 5 months ago

aubymori commented 5 months ago

I was having issues with shell32.dll symbols on a globally hooking mod, so I deleted the symbols. I then realized that msdl.microsoft.com was completely unavailable for me. I figured it was down, so I shut off my PC and went and did some things while waiting for it to come back on. Alas, it was not actually down, so when I came back and logged in, I was greeted with this:

image

I later realized it was an issue with the DNS server I had set.

TL;DR: Loading symbols doesn't properly fail when msdl.microsoft.com is unavailable, and in the right circumstances it can totally wreck your system.

m417z commented 5 months ago

Windhawk is using the standard Microsoft MSDIA/SymSrv libraries to download and parse the symbols: https://github.com/ramensoftware/windhawk/blob/7a483b458d63ce256201ccfc50dc6d5cbffbc03e/src/windhawk/engine/symbol_enum.cpp#L200-L210

In your case, it looks like the download got stuck for some reason. So it would be nice to have some kind of a connection timeout. Unfortunately, I don't see a way to configure it. Here are some of the options that can be set for SymSrv: https://learn.microsoft.com/en-us/previous-versions/ff797954(v=vs.85)

There are options like a proxy server, but nothing about a timeout.

So as I see it, the options are either re-implementing symbol downloading, which is a lot of work, or hacking it around with some hook to add a timeout. If anything, I'll probably go with the latter, but it requires some research, and it's also tricky to verify without a way to reproduce the issue. Do you have a way to reproduce it?