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
AuthenticodeDeformatter.cs
Go to the documentation of this file.
1using System;
5
7{
8 // Token: 0x02000060 RID: 96
10 {
11 // Token: 0x0600029F RID: 671 RVA: 0x0000AB04 File Offset: 0x00008D04
13 {
14 this.reason = 1;
15 }
16
17 // Token: 0x060002A0 RID: 672 RVA: 0x0000AB20 File Offset: 0x00008D20
19 {
21 }
22
23 // Token: 0x170000BD RID: 189
24 // (set) Token: 0x060002A1 RID: 673 RVA: 0x0000AB34 File Offset: 0x00008D34
25 public byte[] RawData
26 {
27 set
28 {
29 this.Reset();
31 bool flag = this.CheckSignature();
32 }
33 }
34
35 // Token: 0x170000BE RID: 190
36 // (get) Token: 0x060002A2 RID: 674 RVA: 0x0000AB68 File Offset: 0x00008D68
38 {
39 get
40 {
41 return this.signingCertificate;
42 }
43 }
44
45 // Token: 0x060002A3 RID: 675 RVA: 0x0000AB7C File Offset: 0x00008D7C
46 private bool CheckSignature()
47 {
48 /*
49An exception occurred when decompiling this method (060002A3)
50
51ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Boolean Mono.Security.Authenticode.AuthenticodeDeformatter::CheckSignature()
52
53 ---> System.Exception: Basic block has to end with unconditional control flow.
54{
55 IL_005E:
56 stfld:int32(AuthenticodeDeformatter::reason, ldloc:AuthenticodeDeformatter(this), ldc.i4:int32(1))
57 call:void(AuthenticodeBase::Close, ldloc:AuthenticodeDeformatter[exp:AuthenticodeBase](this))
58 stloc:SHA1(var_13_76, call:SHA1(SHA1::Create))
59 stloc:MD5(var_15_80, call:MD5(MD5::Create))
60 stloc:SHA256(var_17_8A, call:SHA256(SHA256::Create))
61 stloc:SHA384(var_19_94, call:SHA384(SHA384::Create))
62 stloc:uint8[](var_20_9E, call:uint8[](AuthenticodeBase::GetHash, ldloc:AuthenticodeDeformatter[exp:AuthenticodeBase](this), ldloc:SHA384[exp:HashAlgorithm](var_19_94)))
63 stfld:uint8[](AuthenticodeDeformatter::hash, ldloc:AuthenticodeDeformatter(this), ldloc:uint8[](var_20_9E))
64 call:void(AuthenticodeBase::Close, ldloc:AuthenticodeDeformatter[exp:AuthenticodeBase](this))
65 stloc:ASN1(var_21_B4, ldfld:ASN1(AuthenticodeDeformatter::signedHash, ldloc:AuthenticodeDeformatter(this)))
66 stloc:uint8[](var_22_BC, ldfld:uint8[](AuthenticodeDeformatter::hash, ldloc:AuthenticodeDeformatter(this)))
67 stloc:bool(var_23_C7, call:bool(ASN1::CompareValue, ldloc:ASN1(var_21_B4), ldloc:uint8[](var_22_BC)))
68 stfld:int32(AuthenticodeDeformatter::reason, ldloc:AuthenticodeDeformatter(this), ldc.i4:int32(2))
69 stloc:uint8[](var_26_DA, callgetter:uint8[](ASN1::get_Value, ldloc:ASN1(var_25)))
70 stloc:uint8[](var_27_E5, call:uint8[](HashAlgorithm::ComputeHash, ldloc:SHA384[exp:HashAlgorithm](var_19_94), ldloc:uint8[](var_26_DA)))
71 stloc:int32(var_30_F0, ldfld:int32(AuthenticodeDeformatter::reason, ldloc:AuthenticodeDeformatter(this)))
72}
73
74 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
75 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
76 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
77 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
78 --- End of inner exception stack trace ---
79 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
80 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
81*/;
82 }
83
84 // Token: 0x060002A4 RID: 676 RVA: 0x0000AC7C File Offset: 0x00008E7C
85 private bool CompareIssuerSerial(string issuer, byte[] serial, X509Certificate x509)
86 {
87 /*
88An exception occurred when decompiling this method (060002A4)
89
90ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Boolean Mono.Security.Authenticode.AuthenticodeDeformatter::CompareIssuerSerial(System.String,System.Byte[],Mono.Security.X509.X509Certificate)
91
92 ---> System.Exception: Basic block has to end with unconditional control flow.
93{
94 Block_0:
95 stloc:uint8[](var_1_06, ldfld:uint8[](X509Certificate::m_encodedcert, ldloc:X509Certificate(x509)))
96}
97
98 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
99 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
100 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
101 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
102 --- End of inner exception stack trace ---
103 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
104 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
105*/;
106 }
107
108 // Token: 0x060002A5 RID: 677 RVA: 0x0000AC98 File Offset: 0x00008E98
110 {
111 ArrayList authenticatedAttributes = sd.signerInfo.authenticatedAttributes;
112 if (sd.signerInfo.authenticatedAttributes != null)
113 {
114 }
115 ASN1 asn;
116 string text = ASN1Convert.ToOid(asn);
117 bool flag = text == "1.2.840.113549.1.9.3";
118 long num = 0L;
119 ASN1 asn2;
120 string text2 = ASN1Convert.ToOid(asn2[(int)num]);
121 bool flag2 = text == "1.2.840.113549.1.9.4";
122 long num2 = 0L;
123 ASN1 asn4;
124 ASN1 asn3 = asn4[(int)num2];
125 bool flag3 = text == "1.3.6.1.4.1.311.2.1.11";
126 bool flag4 = text == "1.3.6.1.4.1.311.2.1.12";
127 ArrayList authenticatedAttributes2 = sd.signerInfo.authenticatedAttributes;
128 long num3 = 0L;
129 if (num3 != 0L)
130 {
131 ArrayList authenticatedAttributes3 = sd.signerInfo.authenticatedAttributes;
132 if (authenticatedAttributes3 != null)
133 {
134 }
135 long num4 = 0L;
136 int num5 = 12;
137 if (authenticatedAttributes3 != null)
138 {
139 }
140 if (num4 != 0L)
141 {
142 throw new OutOfMemoryException();
143 }
144 if (num5 == 0)
145 {
146 byte[] signature = sd.signerInfo.Signature;
147 PKCS7.SignerInfo signerInfo = sd.signerInfo;
148 string issuer = signerInfo.issuer;
149 byte[] serialNumber = signerInfo.SerialNumber;
152 X509Certificate x509Certificate = x509CertificateEnumerator.Current;
153 byte[] encodedcert = x509Certificate.m_encodedcert;
154 if (x509Certificate != null)
155 {
156 }
157 bool flag6;
158 return flag6;
159 }
160 }
161 throw new InvalidCastException();
162 }
163
164 // Token: 0x060002A6 RID: 678 RVA: 0x0000AE60 File Offset: 0x00009060
165 private bool VerifyCounterSignature(PKCS7.SignerInfo cs, byte[] signature)
166 {
167 byte version = cs.version;
168 ArrayList authenticatedAttributes = cs.authenticatedAttributes;
169 if (cs.authenticatedAttributes != null)
170 {
171 }
172 ASN1 asn;
173 string text = ASN1Convert.ToOid(asn);
174 bool flag = text == "1.2.840.113549.1.9.3";
175 long num = 0L;
176 ASN1 asn2;
177 string text2 = ASN1Convert.ToOid(asn2[(int)num]);
178 bool flag2 = text == "1.2.840.113549.1.9.4";
179 long num2 = 0L;
180 ASN1 asn4;
181 ASN1 asn3 = asn4[(int)num2];
182 bool flag3 = text == "1.2.840.113549.1.9.5";
183 long num3 = 0L;
184 ASN1 asn5;
185 DateTime dateTime = ASN1Convert.ToDateTime(asn5[(int)num3]);
186 ArrayList authenticatedAttributes2 = cs.authenticatedAttributes;
187 long num4 = 0L;
189 if (num4 != 0L)
190 {
191 byte[] array = HashAlgorithm.Create("SHA256").ComputeHash(signature);
192 byte[] signature2 = cs.Signature;
193 authenticatedAttributes3 = cs.authenticatedAttributes;
194 if (authenticatedAttributes3 != null)
195 {
196 }
197 }
198 long num5 = 0L;
199 int num6 = 21;
200 if (authenticatedAttributes3 != null)
201 {
202 }
203 if (num5 == 0L)
204 {
205 while (num6 != 0)
206 {
207 }
208 string issuer = cs.issuer;
209 byte[] serialNumber = cs.SerialNumber;
212 X509Certificate x509Certificate = x509CertificateEnumerator.Current;
213 if (num5 != 0L)
214 {
215 }
216 bool flag5;
217 return flag5;
218 }
219 throw new OutOfMemoryException();
220 }
221
222 // Token: 0x060002A7 RID: 679 RVA: 0x0000AFCC File Offset: 0x000091CC
223 private void Reset()
224 {
226 this.reason = 1;
227 x509Chain.Reset();
228 this.timestampChain.Reset();
229 if (!true)
230 {
231 }
232 this.timestamp = 1;
233 }
234
235 // Token: 0x04000283 RID: 643
236 private string filename;
237
238 // Token: 0x04000284 RID: 644
239 private byte[] rawdata;
240
241 // Token: 0x04000285 RID: 645
242 private byte[] hash;
243
244 // Token: 0x04000286 RID: 646
246
247 // Token: 0x04000287 RID: 647
249
250 // Token: 0x04000288 RID: 648
252
253 // Token: 0x04000289 RID: 649
255
256 // Token: 0x0400028A RID: 650
257 private int reason;
258
259 // Token: 0x0400028B RID: 651
260 private bool trustedRoot;
261
262 // Token: 0x0400028C RID: 652
264
265 // Token: 0x0400028D RID: 653
266 private byte[] entry;
267
268 // Token: 0x0400028E RID: 654
270
271 // Token: 0x0400028F RID: 655
273 }
274}
class f__AnonymousType0<< Count > j__TPar
static DateTime ToDateTime(ASN1 time)
static string ToOid(ASN1 asn1)
bool VerifySignature(PKCS7.SignedData sd, byte[] calculatedMessageDigest, HashAlgorithm ha)
bool CompareIssuerSerial(string issuer, byte[] serial, X509Certificate x509)
bool VerifyCounterSignature(PKCS7.SignerInfo cs, byte[] signature)