Skip to content

Commit 073afca

Browse files
committed
wip
1 parent 4488576 commit 073afca

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

view/sharedcache/core/SharedCacheController.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ bool SharedCacheController::LoadRegion(BinaryView &view, const CacheRegion &regi
6666
// Loads the given region into the BinaryView and marks it as loaded.
6767
// First check to make sure there isn't already a section at the address in the view.
6868
if (!view.GetSectionsAt(region.start).empty())
69-
return true;
69+
return false;
7070

7171
auto vm = m_cache.GetVirtualMemory();
7272
auto reader = VirtualMemoryReader(vm);

view/sharedcache/ui/SharedCacheUINotifications.cpp

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,27 @@ void UINotifications::OnViewChange(UIContext* context, ViewFrame* frame, const Q
4646
if (!controller)
4747
return;
4848
if (auto foundRegion = controller->GetRegionContaining(addr))
49-
controller->LoadRegion(*view, *foundRegion);
49+
{
50+
// If we did not load the region, then we don't need to run analysis.
51+
if (!controller->LoadRegion(*view, *foundRegion))
52+
return;
53+
view->AddAnalysisOption("linearsweep");
54+
view->UpdateAnalysis();
55+
}
5056
};
5157

5258
static auto loadImageAtAddr = [](Ref<BinaryView> view, uint64_t addr) {
5359
auto controller = SharedCacheController::GetController(*view);
5460
if (!controller)
5561
return;
5662
if (auto foundImage = controller->GetImageContaining(addr))
57-
controller->LoadImage(*view, *foundImage);
63+
{
64+
// If we did not load the image, then we don't need to run analysis.
65+
if (!controller->LoadImage(*view, *foundImage))
66+
return;
67+
view->AddAnalysisOption("linearsweep");
68+
view->UpdateAnalysis();
69+
}
5870
};
5971

6072
auto loadImageNameAction = [](const UIActionContext& ctx) {

0 commit comments

Comments
 (0)