@@ -21,7 +21,6 @@ void UINotifications::init()
2121 UIContext::registerNotification (m_instance);
2222}
2323
24-
2524void UINotifications::OnViewChange (UIContext* context, ViewFrame* frame, const QString& type)
2625{
2726 if (!frame)
@@ -40,31 +39,31 @@ void UINotifications::OnViewChange(UIContext* context, ViewFrame* frame, const Q
4039 if (ah->isBoundAction (" Load Image by Name" ))
4140 return ;
4241
43- static auto loadRegionAtAddr = [view]( uint64_t addr) {
44- auto controller = SharedCacheController::GetController (* view);
42+ static auto loadRegionAtAddr = [](BinaryView& view, uint64_t addr) {
43+ auto controller = SharedCacheController::GetController (view);
4544 if (!controller)
4645 return ;
4746 if (auto foundRegion = controller->GetRegionContaining (addr))
4847 {
4948 // If we did not load the region, then we don't need to run analysis.
50- if (!controller->LoadRegion (* view, *foundRegion))
49+ if (!controller->LoadRegion (view, *foundRegion))
5150 return ;
52- view-> AddAnalysisOption (" linearsweep" );
53- view-> UpdateAnalysis ();
51+ view. AddAnalysisOption (" linearsweep" );
52+ view. UpdateAnalysis ();
5453 }
5554 };
5655
57- static auto loadImageAtAddr = [view]( uint64_t addr) {
58- auto controller = SharedCacheController::GetController (* view);
56+ static auto loadImageAtAddr = [](BinaryView& view, uint64_t addr) {
57+ auto controller = SharedCacheController::GetController (view);
5958 if (!controller)
6059 return ;
6160 if (auto foundImage = controller->GetImageContaining (addr))
6261 {
6362 // If we did not load the image, then we don't need to run analysis.
64- if (!controller->LoadImage (* view, *foundImage))
63+ if (!controller->LoadImage (view, *foundImage))
6564 return ;
66- view-> AddAnalysisOption (" linearsweep" );
67- view-> UpdateAnalysis ();
65+ view. AddAnalysisOption (" linearsweep" );
66+ view. UpdateAnalysis ();
6867 }
6968 };
7069
@@ -77,20 +76,20 @@ void UINotifications::OnViewChange(UIContext* context, ViewFrame* frame, const Q
7776 if (GetAddressInput (addr, " Address" , " Address" ))
7877 {
7978 BackgroundThread::create (ctx.context ->mainWindow ())
80- ->thenBackground ([addr](){ loadRegionAtAddr (addr); })
79+ ->thenBackground ([ctx, addr](){ loadRegionAtAddr (*ctx. binaryView , addr); })
8180 ->start ();
8281 }
8382 };
8483
8584 auto loadRegionTokenAction = [](const UIActionContext& ctx) {
8685 BackgroundThread::create (ctx.context ->mainWindow ())
87- ->thenBackground ([ctx](){ loadRegionAtAddr (ctx.token .token .value ); })
86+ ->thenBackground ([ctx](){ loadRegionAtAddr (*ctx. binaryView , ctx.token .token .value ); })
8887 ->start ();
8988 };
9089
9190 auto loadImageTokenAction = [](const UIActionContext& ctx) {
9291 BackgroundThread::create (ctx.context ->mainWindow ())
93- ->thenBackground ([ctx](){ loadImageAtAddr (ctx.token .token .value ); })
92+ ->thenBackground ([ctx](){ loadImageAtAddr (*ctx. binaryView , ctx.token .token .value ); })
9493 ->start ();
9594 };
9695
0 commit comments