File tree Expand file tree Collapse file tree 3 files changed +36
-16
lines changed Expand file tree Collapse file tree 3 files changed +36
-16
lines changed Original file line number Diff line number Diff line change @@ -241,11 +241,11 @@ bool SharedCacheView::Init()
241241 Ref<Settings> programSettings = Settings::Instance ();
242242 auto previousWorkflow = programSettings->Get <std::string>(" analysis.workflows.functionWorkflow" , this );
243243
244- // If we are a new file (not a database) lets go ahead and set the function workflow.
245- // We do not set the workflow on database as the user might have changed it in load options prior.
246- // We also need to update usages of `core.function.dsc` to `core.function.sharedCache`
247- if (! GetFile ()-> IsBackedByDatabase () || previousWorkflow == " core.function.dsc " )
248- programSettings->Set (" analysis.workflows.functionWorkflow" , " core.function.sharedCache " , this );
244+ // Earlier versions of the shared cache plug-in used a named workflow rather than
245+ // modifying `core.function.metaAnalysis`. Update reference to those older workflow
246+ // names to `core.function.metaAnalysis`.
247+ if (previousWorkflow == " core.function.dsc " || previousWorkflow == " core.function.sharedCache " )
248+ programSettings->Set (" analysis.workflows.functionWorkflow" , " core.function.metaAnalysis " , this );
249249 }
250250
251251 if (m_parseOnly)
Original file line number Diff line number Diff line change @@ -7,8 +7,21 @@ using namespace BinaryNinja;
77
88void ObjCActivity::Register (Workflow &workflow)
99{
10- workflow.RegisterActivity (new Activity (" core.analysis.objc.adjustCallType" , &AdjustCallType));
11- workflow.Insert (" core.function.analyzeTailCalls" , " core.analysis.objc.adjustCallType" );
10+ workflow.RegisterActivity (new Activity (R"( {
11+ "name": "core.analysis.sharedCache.objc.adjustCallType",
12+ "eligibility": {
13+ "predicates": [
14+ {
15+ "type": "viewType",
16+ "operator": "in",
17+ "value": [
18+ "DSCView"
19+ ]
20+ }
21+ ]
22+ }
23+ })" , &AdjustCallType));
24+ workflow.Insert (" core.function.analyzeTailCalls" , " core.analysis.sharedCache.objc.adjustCallType" );
1225}
1326
1427std::vector<std::string> splitSelector (const std::string& selector) {
Original file line number Diff line number Diff line change @@ -365,21 +365,28 @@ void AnalyzeFunction(Ref<AnalysisContext> ctx)
365365
366366void SharedCacheWorkflow::Register ()
367367{
368- Ref<Workflow> workflow = Workflow::Instance (" core.function.baseAnalysis " )->Clone (" core.function.sharedCache " );
368+ Ref<Workflow> workflow = Workflow::Instance (" core.function.metaAnalysis " )->Clone (" core.function.metaAnalysis " );
369369
370370 // Register and insert activities here.
371371 ObjCActivity::Register (*workflow);
372- workflow->RegisterActivity (new Activity (" core.analysis.sharedCache.analysis" , &AnalyzeFunction));
372+ workflow->RegisterActivity (new Activity (R"( {
373+ "name": "core.analysis.sharedCache.analysis",
374+ "eligibility": {
375+ "predicates": [
376+ {
377+ "type": "viewType",
378+ "operator": "in",
379+ "value": [
380+ "DSCView"
381+ ]
382+ }
383+ ]
384+ }
385+ })" , &AnalyzeFunction));
373386 std::vector<std::string> inserted = { " core.analysis.sharedCache.analysis" };
374387 workflow->Insert (" core.function.analyzeTailCalls" , inserted);
375388
376- static constexpr auto WORKFLOW_DESCRIPTION = R"( {
377- "title": "Shared Cache Workflow",
378- "description": "Shared Cache Workflow",
379- "capabilities": []
380- })" ;
381-
382- Workflow::RegisterWorkflow (workflow, WORKFLOW_DESCRIPTION);
389+ Workflow::RegisterWorkflow (workflow);
383390}
384391
385392extern " C"
You can’t perform that action at this time.
0 commit comments