-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathSettings.cs
175 lines (148 loc) · 5.05 KB
/
Settings.cs
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
/*
dnDeflow - Control flow deobfuscation using Z3 and ILAst
Copyright (C) 2016 [email protected]
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
using System;
using System.Collections.Generic;
using System.ComponentModel.Composition;
using dnSpy.Contracts.Images;
using dnSpy.Contracts.Menus;
using dnSpy.Contracts.MVVM;
namespace DeFlow
{
public class DeFlowSettings
{
public class MySettings : ViewModelBase
{
protected virtual void OnModified()
{
}
bool flag = true;
internal bool Remove
{
get { return flag; }
set
{
if (flag == value)
return;
flag = value;
OnPropertyChanged("BoolEnable");
OnPropertyChanged("BoolDisable");
DeadInstructions.DeadInstrsList.Clear();
}
}
public bool BoolEnable
{
get { return Remove == true; }
set { Remove = value ? true : Remove; }
}
public bool BoolDisable
{
get { return Remove == false; }
set { Remove = value ? false : Remove; }
}
bool flag2 = true;
internal bool Repartition
{
get { return flag2; }
set
{
if (flag2 == value)
return;
flag2 = value;
OnPropertyChanged("BoolEnable2");
OnPropertyChanged("BoolDisable2");
}
}
public bool BoolEnable2
{
get { return Repartition == true; }
set { Repartition = value ? true : Repartition; }
}
public bool BoolDisable2
{
get { return Repartition == false; }
set { Repartition = value ? false : Repartition; }
}
bool flag3 = true;
internal bool Nops
{
get { return flag3; }
set
{
if (flag3 == value)
return;
flag3 = value;
OnPropertyChanged("BoolEnable3");
OnPropertyChanged("BoolDisable3");
}
}
public bool BoolEnable3
{
get { return Nops == true; }
set { Nops = value ? true : Nops; }
}
public bool BoolDisable3
{
get { return Nops == false; }
set { Nops = value ? false : Nops; }
}
bool flag4 = false;
internal bool Logs
{
get { return flag4; }
set
{
if (flag4 == value)
return;
flag4 = value;
OnPropertyChanged("BoolEnable4");
OnPropertyChanged("BoolDisable4");
}
}
public bool BoolEnable4
{
get { return Logs == true; }
set { Logs = value ? true : Logs; }
}
public bool BoolDisable4
{
get { return Logs == false; }
set { Logs = value ? false : Logs; }
}
}
public static MySettings Settings = new MySettings();
[ExportMenuItem(OwnerGuid = AppMenuConstants.APP_MENU_EXTENSION, Header = "Options", Icon = DsImagesAttribute.Settings, Group = AppMenuConstants.GROUP_EXTENSION_MENU4, Order = 0)]
sealed class SettingsCommand : AppMenuHandler
{
readonly IAppService appService;
[ImportingConstructor]
SettingsCommand(IAppService appService)
: base(appService.DocumentTreeView)
{
this.appService = appService;
}
public override bool IsEnabled(DeFlowContext context)
{
return true;
}
public override void Execute(DeFlowContext context)
{
var win = new SettingsControl();
win.DataContext = Settings;
win.Owner = this.appService.MainWindow;
win.ShowDialog();
}
}
}
}