MCPcopy Create free account
hub / github.com/beefytech/Beef / SearchForImage

Method SearchForImage

IDEHelper/DbgSymSrv.cpp:367–517  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

365}
366
367String DbgSymRequest::SearchForImage(const String& filePath, uint32 fileTime, int size)
368{
369 if ((gDebugManager->mSymSrvOptions.mFlags & BfSymSrvFlag_Disable) != 0)
370 return "";
371
372 if (FileExists(filePath))
373 {
374 if (CheckPEFile(filePath, fileTime, size))
375 return filePath;
376 }
377
378 /*if (filePath.Contains("IDEHelper"))
379 Sleep(3000);*/
380
381 if (mOptions.mCacheDir.IsEmpty())
382 {
383 mFailed = true;
384 return "";
385 }
386
387 NetResult* chainNetResult = NULL;
388
389 String fileName = GetFileName(filePath);
390 String imageStoreDir = "/";
391 imageStoreDir += fileName;
392 imageStoreDir += "/";
393 imageStoreDir += StrFormat("%08X%x/", fileTime, size);
394
395 SetAndRestoreValue<bool> prevSearchingSymSrv(mSearchingSymSrv, true);
396
397 String cacheDir = mOptions.mCacheDir;
398 cacheDir += imageStoreDir;
399
400 /*for (int i = 0; i < 8; i++)
401 {
402 mDbgSymSrv->mDebugger->OutputMessage(StrFormat("Image Sleep %d\n", i));
403 if (mCancelling)
404 break;
405 Sleep(1000);
406 }*/
407
408 String cacheFilePath = cacheDir + "/" + GetFileName(filePath);
409
410 // Check cache
411 if (CheckPEFile(cacheFilePath, fileTime, size))
412 {
413 return cacheFilePath;
414 }
415
416 for (auto& symServAddr : mOptions.mSymbolServers)
417 {
418 if (mCancelling)
419 break;
420
421 int colonPos = symServAddr.IndexOf(':');
422 if (colonPos > 1)
423 {
424 // HTTP

Callers 2

PreCacheImageMethod · 0.80
RequestImageMethod · 0.80

Calls 10

GetFunction · 0.85
FailFunction · 0.85
DecompressAllMethod · 0.80
IsEmptyMethod · 0.45
IndexOfMethod · 0.45
lengthMethod · 0.45
push_backMethod · 0.45
c_strMethod · 0.45
LoadMethod · 0.45
OutputMessageMethod · 0.45

Tested by

no test coverage detected