question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Freezes program while injecting -> waiting for URL URI response

See original GitHub issue

Hey I am using your Library and trying ot inject a dll doing it the following way:

var process = Process.GetProcessesByName(ProcessName)[0];
var dllFilePath = Path.GetTempPath() + DllName + ".dll";
var flags = MappingFlags.None;
var mapper = new LibraryMapper(process, dllFilePath, flags);
mapper.MapLibrary();

Somehow the injector freezes while injecting, and I traced it down to this function in SymbolHandler.cs:

using var response = await httpClient.GetAsync(new Uri($"https://msdl.microsoft.com/download/symbols/{pdbData.Path}/{pdbData.Guid:N}{pdbData.Age}/{pdbData.Path}"));

I kept waiting for a few minutes but nothing happened, I guess it waits for a response but can’t reach the url?

The first 2 requests worked, then it just freezed the program.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

8reactions
Deweracommented, May 4, 2022

Is this issue still relevant? I still can’t replicate any of these issues (and pipeline doesn’t seem to have issue either.)

0reactions
Baseultcommented, Dec 20, 2021

Hey I changed the download and now this is working:

 // Download the PDB from the Microsoft symbol server

HttpWebRequest request = (HttpWebRequest)WebRequest.Create($"https://msdl.microsoft.com/download/symbols/{pdbData.Path}/{pdbData.Guid:N}{pdbData.Age}/{pdbData.Path}");
request.AutomaticDecompression = DecompressionMethods.GZip | DecompressionMethods.Deflate;

using (HttpWebResponse response = (HttpWebResponse)request.GetResponse())
using (Stream stream = response.GetResponseStream())
using (StreamReader reader = new StreamReader(stream))
{
    using (FileStream strm = File.Create(pdbFilePath))
    using (StreamWriter sw = new StreamWriter(strm))
        sw.Write(reader.ReadToEnd());
}

return pdbFilePath;

Somehow I get another 2 errors now:

"System can not find the specified file" at
return GetModule("ntdll.dll").Address + _symbolHandler.GetSymbol(symbolName).RelativeAddress;
in ProcessContext.cs

because of the check in SymbolHandler.cs:
if (symbolTableAddress == 0)
    {
        throw new Win32Exception();
    }

sx1 sx3

and

"The key already existed in the dictionary" at
_moduleCache.TryAdd(moduleName, new Module(moduleAddress, new PeImage(File.ReadAllBytes(moduleFilePath))));
in ProcessContext.cs
at System.Collections.Concurrent.ConcurrentDictionary<TKey, TValue>.System.Collections.Generic.IDictionary<TKey, TValue>.Add(TKey, TValue)

sx2

Just in case the download code wasn’t working correctly, I downloaded the pdb manually and placed it inside the Dependencies folder -> Same result.

Read more comments on GitHub >

github_iconTop Results From Across the Web

vb.net - How to wait for get request without freezing client
I have a simple button which sends a get request to retrieve a txt file on my website. Problem is it freezes the...
Read more >
net/url: don't parse ';' as a separator in query string [freeze ...
net/url: don't parse ';' as a separator in query string [freeze ... I create a program to detect attack such as SQL Injection,...
Read more >
ExecuteScriptAsync blocking forever after several ...
i want to say around 8 calls and then it can freeze. the JavaScript executes, but the await never returns. when it breaks,...
Read more >
Insert from URL is freezing - Claris Community
The script has been running fine for almost 2 years. Recently it has started to freeze FileMaker when placing the order. I suspected...
Read more >
Web API Fuzz Testing
This section shows you how to configure API fuzzing using an OpenAPI Specification to provide information about the target API to test. OpenAPI...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found