terraria-cpp2il-methodrecon v1.4.4.9
Terraria mobile dump, with reconstructed method body. Dump with CallAnalysis: https://infinitynichto.github.io/terraria-cpp2il
Loading...
Searching...
No Matches
X509Store.cs
Go to the documentation of this file.
1using System;
3using System.IO;
6
7namespace Mono.Security.X509
8{
9 // Token: 0x0200001D RID: 29
10 public class X509Store
11 {
12 // Token: 0x0600014D RID: 333 RVA: 0x00006BD4 File Offset: 0x00004DD4
13 internal X509Store(string path, bool crl, bool newFormat)
14 {
15 this._storePath = path;
16 }
17
18 // Token: 0x17000061 RID: 97
19 // (get) Token: 0x0600014E RID: 334 RVA: 0x00006BF0 File Offset: 0x00004DF0
21 {
22 get
23 {
25 if (this._certificates == null)
26 {
27 string storePath = this._storePath;
28 x509CertificateCollection = this.BuildCertificatesCollection(storePath);
30 }
32 }
33 }
34
35 // Token: 0x17000062 RID: 98
36 // (get) Token: 0x0600014F RID: 335 RVA: 0x00006C1C File Offset: 0x00004E1C
38 {
39 get
40 {
41 while (!this._crl)
42 {
43 }
45 if (this._crls == null)
46 {
47 string storePath = this._storePath;
48 arrayList = this.BuildCrlsCollection(storePath);
50 }
51 return arrayList;
52 }
53 }
54
55 // Token: 0x17000063 RID: 99
56 // (get) Token: 0x06000150 RID: 336 RVA: 0x00006C50 File Offset: 0x00004E50
57 public string Name
58 {
59 get
60 {
61 int num = 1;
62 string text;
63 if (this._name == null)
64 {
65 string storePath = this._storePath;
66 if (num == 0)
67 {
68 }
69 string storePath2 = this._storePath;
71 }
72 return text;
73 }
74 }
75
76 // Token: 0x06000151 RID: 337 RVA: 0x00006C84 File Offset: 0x00004E84
77 public void Clear()
78 {
79 X509CertificateCollection certificates = this._certificates;
80 if (certificates != null)
81 {
82 certificates.Clear();
83 }
84 if (this._crls != null)
85 {
86 }
87 }
88
89 // Token: 0x06000152 RID: 338 RVA: 0x00006CAC File Offset: 0x00004EAC
90 private void ClearCertificates()
91 {
92 X509CertificateCollection certificates = this._certificates;
93 if (certificates != null)
94 {
95 certificates.Clear();
96 }
97 }
98
99 // Token: 0x06000153 RID: 339 RVA: 0x00006CCC File Offset: 0x00004ECC
100 private void ClearCrls()
101 {
102 if (this._crls != null)
103 {
104 }
105 }
106
107 // Token: 0x06000154 RID: 340 RVA: 0x00006CE4 File Offset: 0x00004EE4
108 public void Import(X509Certificate certificate)
109 {
110 string storePath = this._storePath;
111 if (this._newFormat)
112 {
113 this.ImportNewFormat(certificate);
114 return;
115 }
116 string text2;
117 string text = Path.Combine(this._storePath, text2);
118 bool flag = File.Exists(text);
119 string text4;
120 string text3 = Path.Combine(this._storePath, text4);
121 X509Certificate x509Certificate = this.LoadCertificate(text);
122 string text5;
123 string text6;
124 bool flag2 = text5 != text6;
126 byte[] encodedcert = certificate.m_encodedcert;
127 }
128
129 // Token: 0x06000155 RID: 341 RVA: 0x00006DD4 File Offset: 0x00004FD4
130 public void Import(X509Crl crl)
131 {
132 string storePath = this._storePath;
133 if (!this._newFormat)
134 {
135 string storePath2 = this._storePath;
136 string uniqueName = this.GetUniqueName(crl);
138 bool flag = File.Exists(text);
140 byte[] rawData = crl.RawData;
141 return;
142 }
143 throw new OutOfMemoryException();
144 }
145
146 // Token: 0x06000156 RID: 342 RVA: 0x00006E68 File Offset: 0x00005068
147 public void Remove(X509Certificate certificate)
148 {
149 if (this._newFormat)
150 {
151 this.RemoveNewFormat(certificate);
152 return;
153 }
154 string text;
155 bool flag = File.Exists(Path.Combine(this._storePath, text));
156 }
157
158 // Token: 0x06000157 RID: 343 RVA: 0x00006EC8 File Offset: 0x000050C8
159 public void Remove(X509Crl crl)
160 {
161 while (this._newFormat)
162 {
163 }
164 string storePath = this._storePath;
165 string uniqueName = this.GetUniqueName(crl);
167 bool flag = File.Exists(text);
169 if (this._crls != null)
170 {
171 }
172 }
173
174 // Token: 0x06000158 RID: 344 RVA: 0x00006F0C File Offset: 0x0000510C
175 private void ImportNewFormat(X509Certificate certificate)
176 {
177 string text2;
178 string text = Path.Combine(this._storePath, text2);
179 bool flag = File.Exists(text);
181 long num = 0L;
182 int num2 = 3;
183 if (fileStream != null)
184 {
185 return;
186 }
187 if (num != 0L)
188 {
189 throw new OutOfMemoryException();
190 }
191 if (num2 == 0)
192 {
193 X509CertificateCollection certificates = this._certificates;
194 if (certificates != null)
195 {
196 certificates.Clear();
197 }
198 return;
199 }
200 }
201
202 // Token: 0x06000159 RID: 345 RVA: 0x00006FB4 File Offset: 0x000051B4
203 private void RemoveNewFormat(X509Certificate certificate)
204 {
205 string text2;
206 string text = Path.Combine(this._storePath, text2);
207 bool flag = File.Exists(text);
209 X509CertificateCollection certificates = this._certificates;
210 if (certificates != null)
211 {
212 certificates.Clear();
213 }
214 }
215
216 // Token: 0x0600015A RID: 346 RVA: 0x00007018 File Offset: 0x00005218
217 private string GetUniqueNameWithSerial(X509Certificate certificate)
218 {
219 string text;
220 return text;
221 }
222
223 // Token: 0x0600015B RID: 347 RVA: 0x00007028 File Offset: 0x00005228
224 private string GetUniqueName(X509Certificate certificate, [Optional] byte[] serial)
225 {
226 X509ExtensionCollection extensions = certificate.extensions;
227 byte[] array;
228 if (array != null)
229 {
230 }
231 byte[] hash = certificate.Hash;
232 string text;
233 return text;
234 }
235
236 // Token: 0x0600015C RID: 348 RVA: 0x00007048 File Offset: 0x00005248
237 private string GetUniqueName(X509Crl crl)
238 {
239 X509ExtensionCollection extensions = crl.extensions;
240 byte[] array;
241 if (array != null)
242 {
243 }
244 byte[] hash = crl.Hash;
245 string text;
246 return text;
247 }
248
249 // Token: 0x0600015D RID: 349 RVA: 0x00007068 File Offset: 0x00005268
250 private byte[] GetUniqueName(X509ExtensionCollection extensions, [Optional] byte[] serial)
251 {
252 /*
253An exception occurred when decompiling this method (0600015D)
254
255ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Byte[] Mono.Security.X509.X509Store::GetUniqueName(Mono.Security.X509.X509ExtensionCollection,System.Byte[])
256
257 ---> System.Exception: Basic block has to end with unconditional control flow.
258{
259 Block_0:
260 brtrue(IL_0000, logicnot:bool(ldloc:uint8[][exp:bool](serial)))
261}
262
263 at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1852
264 at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1878
265 at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1878
266 at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1846
267 at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1878
268 at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1878
269 at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1846
270 at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.Optimize(DecompilerContext context, ILBlock method, AutoPropertyProvider autoPropertyProvider, StateMachineKind& stateMachineKind, MethodDef& inlinedMethod, AsyncMethodDebugInfo& asyncInfo, ILAstOptimizationStep abortBeforeStep) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 355
271 at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(IEnumerable`1 parameters, MethodDebugInfoBuilder& builder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 123
272 at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 88
273 --- End of inner exception stack trace ---
274 at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 92
275 at ICSharpCode.Decompiler.Ast.AstBuilder.AddMethodBody(EntityDeclaration methodNode, EntityDeclaration& updatedNode, MethodDef method, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, MethodKind methodKind) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstBuilder.cs:line 1683
276*/;
277 }
278
279 // Token: 0x0600015E RID: 350 RVA: 0x00007084 File Offset: 0x00005284
280 private string GetUniqueName(string method, byte[] name, string fileExtension)
281 {
282 /*
283An exception occurred when decompiling this method (0600015E)
284
285ICSharpCode.Decompiler.DecompilerException: Error decompiling System.String Mono.Security.X509.X509Store::GetUniqueName(System.String,System.Byte[],System.String)
286
287 ---> System.Exception: Basic block has to end with unconditional control flow.
288{
289 IL_0007:
290 stloc:CultureInfo(var_4_0E, callgetter:CultureInfo(CultureInfo::get_InvariantCulture))
291}
292
293 at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1852
294 at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.Optimize(DecompilerContext context, ILBlock method, AutoPropertyProvider autoPropertyProvider, StateMachineKind& stateMachineKind, MethodDef& inlinedMethod, AsyncMethodDebugInfo& asyncInfo, ILAstOptimizationStep abortBeforeStep) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 355
295 at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(IEnumerable`1 parameters, MethodDebugInfoBuilder& builder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 123
296 at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 88
297 --- End of inner exception stack trace ---
298 at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 92
299 at ICSharpCode.Decompiler.Ast.AstBuilder.AddMethodBody(EntityDeclaration methodNode, EntityDeclaration& updatedNode, MethodDef method, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, MethodKind methodKind) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstBuilder.cs:line 1683
300*/;
301 }
302
303 // Token: 0x0600015F RID: 351 RVA: 0x000070A0 File Offset: 0x000052A0
304 private byte[] Load(string filename)
305 {
307 if (!false)
308 {
309 }
310 throw new OutOfMemoryException();
311 }
312
313 // Token: 0x06000160 RID: 352 RVA: 0x00002050 File Offset: 0x00000250
314 private X509Certificate LoadCertificate(string filename)
315 {
316 throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
317 }
318
319 // Token: 0x06000161 RID: 353 RVA: 0x00002050 File Offset: 0x00000250
320 private X509Crl LoadCrl(string filename)
321 {
322 throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
323 }
324
325 // Token: 0x06000162 RID: 354 RVA: 0x000070DC File Offset: 0x000052DC
326 private bool CheckStore(string path, bool throwException)
327 {
328 bool flag = Directory.Exists(path);
330 return Directory.Exists(path);
331 }
332
333 // Token: 0x06000163 RID: 355 RVA: 0x00007118 File Offset: 0x00005318
335 {
336 int num = 1;
337 string storePath = this._storePath;
338 if (num == 0)
339 {
340 }
342 bool newFormat = this._newFormat;
343 string[] array;
344 if (array == null || newFormat)
345 {
346 return;
347 }
348 }
349
350 // Token: 0x06000164 RID: 356 RVA: 0x00007150 File Offset: 0x00005350
352 {
353 int num = 1;
354 string storePath = this._storePath;
355 if (num == 0)
356 {
357 }
359 if (Directory.GetFiles(text, "*.crl") == null || "*.crl" != null)
360 {
361 return;
362 }
363 }
364
365 // Token: 0x0400009F RID: 159
366 private string _storePath;
367
368 // Token: 0x040000A0 RID: 160
370
371 // Token: 0x040000A1 RID: 161
373
374 // Token: 0x040000A2 RID: 162
375 private bool _crl;
376
377 // Token: 0x040000A3 RID: 163
378 private bool _newFormat;
379
380 // Token: 0x040000A4 RID: 164
381 private string _name;
382 }
383}
class f__AnonymousType0<< Count > j__TPar
X509ExtensionCollection extensions
string GetUniqueName(X509Crl crl)
Definition X509Store.cs:237
void Import(X509Certificate certificate)
Definition X509Store.cs:108
X509CertificateCollection Certificates
Definition X509Store.cs:21
bool CheckStore(string path, bool throwException)
Definition X509Store.cs:326
void Import(X509Crl crl)
Definition X509Store.cs:130
string GetUniqueName(string method, byte[] name, string fileExtension)
Definition X509Store.cs:280
void ImportNewFormat(X509Certificate certificate)
Definition X509Store.cs:175
X509CertificateCollection _certificates
Definition X509Store.cs:369
ArrayList BuildCrlsCollection(string storeName)
Definition X509Store.cs:351
X509CertificateCollection BuildCertificatesCollection(string storeName)
Definition X509Store.cs:334
void RemoveNewFormat(X509Certificate certificate)
Definition X509Store.cs:203
X509Certificate LoadCertificate(string filename)
Definition X509Store.cs:314
string GetUniqueName(X509Certificate certificate, [Optional] byte[] serial)
Definition X509Store.cs:224
string GetUniqueNameWithSerial(X509Certificate certificate)
Definition X509Store.cs:217
byte[] GetUniqueName(X509ExtensionCollection extensions, [Optional] byte[] serial)
Definition X509Store.cs:250
void Remove(X509Crl crl)
Definition X509Store.cs:159
byte[] Load(string filename)
Definition X509Store.cs:304
X509Crl LoadCrl(string filename)
Definition X509Store.cs:320
void Remove(X509Certificate certificate)
Definition X509Store.cs:147
X509Store(string path, bool crl, bool newFormat)
Definition X509Store.cs:13
static bool Exists(string path)
Definition Directory.cs:64
static DirectoryInfo CreateDirectory(string path)
Definition Directory.cs:40
static string[] GetFiles(string path)
Definition Directory.cs:83
static FileStream Create(string path)
Definition File.cs:64
static FileStream OpenRead(string path)
Definition File.cs:159
static bool Exists(string path)
Definition File.cs:86
static void Delete(string path)
Definition File.cs:77
static string Combine(string path1, string path2)
Definition Path.cs:41