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()
241
241
Ref<Settings> programSettings = Settings::Instance ();
242
242
auto previousWorkflow = programSettings->Get <std::string>(" analysis.workflows.functionWorkflow" , this );
243
243
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 );
249
249
}
250
250
251
251
if (m_parseOnly)
Original file line number Diff line number Diff line change @@ -7,8 +7,21 @@ using namespace BinaryNinja;
7
7
8
8
void ObjCActivity::Register (Workflow &workflow)
9
9
{
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" );
12
25
}
13
26
14
27
std::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)
365
365
366
366
void SharedCacheWorkflow::Register ()
367
367
{
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 " );
369
369
370
370
// Register and insert activities here.
371
371
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));
373
386
std::vector<std::string> inserted = { " core.analysis.sharedCache.analysis" };
374
387
workflow->Insert (" core.function.analyzeTailCalls" , inserted);
375
388
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);
383
390
}
384
391
385
392
extern " C"
You can’t perform that action at this time.
0 commit comments