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
ChallengeResponse.cs
Go to the documentation of this file.
1using System;
4using System.Text;
5
7{
8 // Token: 0x02000039 RID: 57
9 [Obsolete("Use of this API is highly discouraged, it selects legacy-mode LM/NTLM authentication, which sends your password in very weak encryption over the wire even if the server supports the more secure NTLMv2 / NTLMv2 Session. You need to use the new `Type3Message (Type2Message)' constructor to use the more secure NTLMv2 / NTLMv2 Session authentication modes. These require the Type 2 message from the server to compute the response.")]
11 {
12 // Token: 0x060001B0 RID: 432 RVA: 0x00007DE8 File Offset: 0x00005FE8
14 {
15 }
16
17 // Token: 0x060001B1 RID: 433 RVA: 0x00007DFC File Offset: 0x00005FFC
18 public ChallengeResponse(string password, byte[] challenge)
19 {
20 this.Password = password;
22 }
23
24 // Token: 0x060001B2 RID: 434 RVA: 0x00007E18 File Offset: 0x00006018
25 protected override void Finalize()
26 {
27 if (!this._disposed)
28 {
29 this.Dispose();
30 }
31 base.Finalize();
32 }
33
34 // Token: 0x1700007F RID: 127
35 // (set) Token: 0x060001B3 RID: 435 RVA: 0x00007E5C File Offset: 0x0000605C
36 public string Password
37 {
38 set
39 {
40 while (this._disposed)
41 {
42 }
43 DES des = DES.Create();
44 if (value != null)
45 {
46 int stringLength = value._stringLength;
47 long num = 0L;
48 byte[] array = this.PasswordToKey(value, (int)num);
49 byte[] lmpwd = this._lmpwd;
50 return;
51 }
52 byte[] lmpwd2 = this._lmpwd;
53 if (value == null)
54 {
55 return;
56 }
57 int stringLength2 = value._stringLength;
58 int num2 = 7;
59 byte[] array2 = this.PasswordToKey(value, num2);
60 byte[] lmpwd3 = this._lmpwd;
61 }
62 }
63
64 // Token: 0x17000080 RID: 128
65 // (set) Token: 0x060001B4 RID: 436 RVA: 0x00007F10 File Offset: 0x00006110
66 public byte[] Challenge
67 {
68 set
69 {
70 if (value != null)
71 {
72 if (!this._disposed)
73 {
74 object obj;
75 if (obj == null)
76 {
77 return;
78 }
79 if (obj != null)
80 {
82 throw new InvalidCastException();
83 }
84 }
85 throw new InvalidCastException();
86 }
87 }
88 }
89
90 // Token: 0x17000081 RID: 129
91 // (get) Token: 0x060001B5 RID: 437 RVA: 0x00007F44 File Offset: 0x00006144
92 public byte[] LM
93 {
94 get
95 {
96 while (this._disposed)
97 {
98 }
99 byte[] lmpwd = this._lmpwd;
100 return this.GetResponse(lmpwd);
101 }
102 }
103
104 // Token: 0x17000082 RID: 130
105 // (get) Token: 0x060001B6 RID: 438 RVA: 0x00007F68 File Offset: 0x00006168
106 public byte[] NT
107 {
108 get
109 {
110 while (this._disposed)
111 {
112 }
113 byte[] ntpwd = this._ntpwd;
114 return this.GetResponse(ntpwd);
115 }
116 }
117
118 // Token: 0x060001B7 RID: 439 RVA: 0x00007F8C File Offset: 0x0000618C
119 public void Dispose()
120 {
121 long num = 0L;
122 this.Dispose(num != 0L);
123 if (!true)
124 {
125 }
126 GC.SuppressFinalize(this);
127 }
128
129 // Token: 0x060001B8 RID: 440 RVA: 0x00007FAC File Offset: 0x000061AC
130 private void Dispose(bool disposing)
131 {
132 if (!this._disposed)
133 {
134 byte[] lmpwd = this._lmpwd;
135 byte[] ntpwd = this._ntpwd;
136 if (this._challenge != null)
137 {
138 }
139 this._disposed = true;
140 }
141 }
142
143 // Token: 0x060001B9 RID: 441 RVA: 0x00007FE0 File Offset: 0x000061E0
144 private byte[] GetResponse(byte[] pwd)
145 {
146 /*
147An exception occurred when decompiling this method (060001B9)
148
149ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Byte[] Mono.Security.Protocol.Ntlm.ChallengeResponse::GetResponse(System.Byte[])
150
151 ---> System.Exception: Basic block has to end with unconditional control flow.
152{
153 Block_0:
154 stloc:DES(var_2_0A, call:DES(DES::Create))
155 stloc:uint8[](var_5_13, ldfld:uint8[](ChallengeResponse::_challenge, ldloc:ChallengeResponse(this)))
156 stloc:uint8[](var_8_1E, ldfld:uint8[](ChallengeResponse::_challenge, ldloc:ChallengeResponse(this)))
157 stloc:uint8[](var_11_2A, ldfld:uint8[](ChallengeResponse::_challenge, ldloc:ChallengeResponse(this)))
158}
159
160 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
161 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
162 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
163 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
164 --- End of inner exception stack trace ---
165 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
166 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
167*/;
168 }
169
170 // Token: 0x060001BA RID: 442 RVA: 0x00008018 File Offset: 0x00006218
171 private byte[] PrepareDESKey(byte[] key56bits, int position)
172 {
173 }
174
175 // Token: 0x060001BB RID: 443 RVA: 0x00008028 File Offset: 0x00006228
176 private byte[] PasswordToKey(string password, int position)
177 {
178 int stringLength = password._stringLength;
179 int num = 7;
180 int num2 = Math.Min(0, num);
183 string text = password.ToUpper(currentCulture);
184 byte[] array;
185 return array;
186 }
187
188 // Token: 0x060001BC RID: 444 RVA: 0x00008068 File Offset: 0x00006268
189 // Note: this type is marked as 'beforefieldinit'.
191 {
192 }
193
194 // Token: 0x040000CD RID: 205
195 private static byte[] magic;
196
197 // Token: 0x040000CE RID: 206
198 private static byte[] nullEncMagic;
199
200 // Token: 0x040000CF RID: 207
201 private bool _disposed;
202
203 // Token: 0x040000D0 RID: 208
204 private byte[] _challenge;
205
206 // Token: 0x040000D1 RID: 209
207 private byte[] _lmpwd;
208
209 // Token: 0x040000D2 RID: 210
210 private byte[] _ntpwd;
211 }
212}
class f__AnonymousType0<< Count > j__TPar
byte[] PrepareDESKey(byte[] key56bits, int position)
byte[] PasswordToKey(string password, int position)
ChallengeResponse(string password, byte[] challenge)
static void SuppressFinalize(object obj)
Definition GC.cs:116
static CultureInfo CurrentCulture
static byte Min(byte val1, byte val2)
Definition Math.cs:152
static new DES Create()
Definition DES.cs:73
static Encoding ASCII
Definition Encoding.cs:348