forked from Vector35/workflow_objc
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathGlobalState.h
75 lines (60 loc) · 1.68 KB
/
GlobalState.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
/*
* Copyright (c) 2022-2023 Jon Palmisciano. All rights reserved.
*
* Use of this source code is governed by the BSD 3-Clause license; the full
* terms of the license can be found in the LICENSE.txt file.
*/
#pragma once
#include "BinaryNinja.h"
#include "Core/AnalysisInfo.h"
#include "MessageHandler.h"
using SharedAnalysisInfo = std::shared_ptr<ObjectiveNinja::AnalysisInfo>;
/**
* Namespace to hold metadata flag key constants.
*/
namespace Flag {
constexpr auto DidRunWorkflow = "objectiveNinja.didRunWorkflow";
constexpr auto DidRunStructureAnalysis = "objectiveNinja.didRunStructureAnalysis";
}
/**
* Global state/storage interface.
*/
class GlobalState {
/**
* Get the ID for a view.
*/
static BinaryViewID id(BinaryViewRef);
public:
/**
* Get the analysis info for a view.
*/
static SharedAnalysisInfo analysisInfo(BinaryViewRef);
/**
* Get ObjC Message Handler for a view
*/
static MessageHandler* messageHandler(BinaryViewRef);
/**
* Store analysis info for a view.
*/
static void storeAnalysisInfo(BinaryViewRef, SharedAnalysisInfo);
/**
* Check if analysis info exists for a view.
*/
static bool hasAnalysisInfo(BinaryViewRef);
/**
* Add a view to the list of ignored views.
*/
static void addIgnoredView(BinaryViewRef);
/**
* Check if a view is ignored.
*/
static bool viewIsIgnored(BinaryViewRef);
/**
* Check if the a metadata flag is present for a view.
*/
static bool hasFlag(BinaryViewRef, const std::string&);
/**
* Set a metadata flag for a view.
*/
static void setFlag(BinaryViewRef, const std::string&);
};