summaryrefslogtreecommitdiff
path: root/view/sharedcache/workflow
diff options
context:
space:
mode:
Diffstat (limited to 'view/sharedcache/workflow')
-rw-r--r--view/sharedcache/workflow/ObjCActivity.cpp17
-rw-r--r--view/sharedcache/workflow/SharedCacheWorkflow.cpp25
2 files changed, 31 insertions, 11 deletions
diff --git a/view/sharedcache/workflow/ObjCActivity.cpp b/view/sharedcache/workflow/ObjCActivity.cpp
index cc1b2256..f3efbccd 100644
--- a/view/sharedcache/workflow/ObjCActivity.cpp
+++ b/view/sharedcache/workflow/ObjCActivity.cpp
@@ -7,8 +7,21 @@ using namespace BinaryNinja;
void ObjCActivity::Register(Workflow &workflow)
{
- workflow.RegisterActivity(new Activity("core.analysis.objc.adjustCallType", &AdjustCallType));
- workflow.Insert("core.function.analyzeTailCalls", "core.analysis.objc.adjustCallType");
+ workflow.RegisterActivity(new Activity(R"({
+ "name": "core.analysis.sharedCache.objc.adjustCallType",
+ "eligibility": {
+ "predicates": [
+ {
+ "type": "viewType",
+ "operator": "in",
+ "value": [
+ "DSCView"
+ ]
+ }
+ ]
+ }
+ })", &AdjustCallType));
+ workflow.Insert("core.function.analyzeTailCalls", "core.analysis.sharedCache.objc.adjustCallType");
}
std::vector<std::string> splitSelector(const std::string& selector) {
diff --git a/view/sharedcache/workflow/SharedCacheWorkflow.cpp b/view/sharedcache/workflow/SharedCacheWorkflow.cpp
index dcccfe74..71160e44 100644
--- a/view/sharedcache/workflow/SharedCacheWorkflow.cpp
+++ b/view/sharedcache/workflow/SharedCacheWorkflow.cpp
@@ -365,21 +365,28 @@ void AnalyzeFunction(Ref<AnalysisContext> ctx)
void SharedCacheWorkflow::Register()
{
- Ref<Workflow> workflow = Workflow::Instance("core.function.baseAnalysis")->Clone("core.function.sharedCache");
+ Ref<Workflow> workflow = Workflow::Instance("core.function.metaAnalysis")->Clone("core.function.metaAnalysis");
// Register and insert activities here.
ObjCActivity::Register(*workflow);
- workflow->RegisterActivity(new Activity("core.analysis.sharedCache.analysis", &AnalyzeFunction));
+ workflow->RegisterActivity(new Activity(R"({
+ "name": "core.analysis.sharedCache.analysis",
+ "eligibility": {
+ "predicates": [
+ {
+ "type": "viewType",
+ "operator": "in",
+ "value": [
+ "DSCView"
+ ]
+ }
+ ]
+ }
+ })", &AnalyzeFunction));
std::vector<std::string> inserted = { "core.analysis.sharedCache.analysis" };
workflow->Insert("core.function.analyzeTailCalls", inserted);
- static constexpr auto WORKFLOW_DESCRIPTION = R"({
- "title": "Shared Cache Workflow",
- "description": "Shared Cache Workflow",
- "capabilities": []
- })";
-
- Workflow::RegisterWorkflow(workflow, WORKFLOW_DESCRIPTION);
+ Workflow::RegisterWorkflow(workflow);
}
extern "C"