MCPcopy Create free account
hub / github.com/Vector35/binaryninja-api / loadImagesWithAddr

Method loadImagesWithAddr

view/kernelcache/ui/kctriage.cpp:69–107  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

67
68
69void KCTriageView::loadImagesWithAddr(const std::vector<uint64_t>& addresses) {
70 if (!m_cache)
71 return;
72
73 std::map<uint64_t, std::string> images;
74 for (const uint64_t& addr : addresses)
75 {
76 auto imageName = m_cache->GetImageNameForAddress(addr);
77 if (!imageName.empty() && !m_cache->IsImageLoaded(addr))
78 {
79 images.insert({addr, imageName});
80 }
81 }
82
83 // Don't create a worker action if we don't have any images.
84 if (images.empty())
85 return;
86
87 WorkerPriorityEnqueue([this, images]() {
88 size_t loadedImages = 0;
89 const std::string initialLoad = fmt::format("Loading images... (0/{})", images.size());
90 auto imageLoadTask = BackgroundTask(initialLoad, true);
91
92 for (const auto& [addr, imageName] : images)
93 {
94 if (imageLoadTask.IsCancelled())
95 break;
96 std::string newLoad = fmt::format("Loading images... ({}/{})", loadedImages++, images.size());
97 imageLoadTask.SetProgressText(newLoad);
98 if (m_cache->LoadImageWithInstallName(imageName))
99 setImageLoaded(addr);
100 }
101 imageLoadTask.Finish();
102
103 // We have loaded images, lets make sure to update analysis!
104 this->m_data->AddAnalysisOption("linearsweep");
105 this->m_data->UpdateAnalysis();
106 });
107}
108
109
110void KCTriageView::setImageLoaded(const uint64_t imageHeaderAddr)

Callers

nothing calls this directly

Calls 12

IsCancelledMethod · 0.80
SetProgressTextMethod · 0.80
FinishMethod · 0.80
AddAnalysisOptionMethod · 0.80
UpdateAnalysisMethod · 0.80
BackgroundTaskClass · 0.50
emptyMethod · 0.45
IsImageLoadedMethod · 0.45
insertMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected