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
HashAlgorithm.cs
Go to the documentation of this file.
1using System;
2using System.IO;
4
6{
7 // Token: 0x020002BD RID: 701
8 public abstract class HashAlgorithm : IDisposable, ICryptoTransform
9 {
10 // Token: 0x060017B1 RID: 6065 RVA: 0x000332C0 File Offset: 0x000314C0
11 protected HashAlgorithm()
12 {
13 }
14
15 // Token: 0x060017B2 RID: 6066 RVA: 0x000332D4 File Offset: 0x000314D4
20
21 // Token: 0x060017B3 RID: 6067 RVA: 0x000332E8 File Offset: 0x000314E8
22 public static HashAlgorithm Create(string hashName)
23 {
24 object obj;
25 if (obj != null)
26 {
27 }
28 throw new InvalidCastException();
29 }
30
31 // Token: 0x1700026D RID: 621
32 // (get) Token: 0x060017B4 RID: 6068 RVA: 0x00033300 File Offset: 0x00031500
33 public virtual int HashSize
34 {
35 get
36 {
37 return this.HashSizeValue;
38 }
39 }
40
41 // Token: 0x1700026E RID: 622
42 // (get) Token: 0x060017B5 RID: 6069 RVA: 0x00033314 File Offset: 0x00031514
43 public virtual byte[] Hash
44 {
45 get
46 {
47 object obj;
48 if (this._disposed || this.State != 0 || this.HashValue == null || obj == null || obj != null)
49 {
50 }
51 throw new InvalidCastException();
52 }
53 }
54
55 // Token: 0x060017B6 RID: 6070 RVA: 0x00033344 File Offset: 0x00031544
56 public byte[] ComputeHash(byte[] buffer)
57 {
58 while (this._disposed || buffer == null)
59 {
60 }
62 }
63
64 // Token: 0x060017B7 RID: 6071 RVA: 0x00033364 File Offset: 0x00031564
66 {
67 /*
68An exception occurred when decompiling this method (060017B7)
69
70ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Boolean System.Security.Cryptography.HashAlgorithm::TryComputeHash(System.ReadOnlySpan`1<System.Byte>,System.Span`1<System.Byte>,System.Int32)
71
72 ---> System.Exception: Basic block has to end with unconditional control flow.
73{
74 Block_0:
75 stloc:int32(var_0_0E, ldfld:int32(HashAlgorithm::HashSizeValue, ldloc:HashAlgorithm(this)))
76}
77
78 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
79 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
80 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
81 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
82 --- End of inner exception stack trace ---
83 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
84 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
85*/;
86 }
87
88 // Token: 0x060017B8 RID: 6072 RVA: 0x00033384 File Offset: 0x00031584
89 public byte[] ComputeHash(byte[] buffer, int offset, int count)
90 {
91 while (buffer == null || this._disposed)
92 {
93 }
95 }
96
97 // Token: 0x060017B9 RID: 6073 RVA: 0x000333A8 File Offset: 0x000315A8
98 public byte[] ComputeHash(Stream inputStream)
99 {
100 while (this._disposed)
101 {
102 }
103 return this.CaptureHashCodeAndReinitialize();
104 }
105
106 // Token: 0x060017BA RID: 6074 RVA: 0x000333C4 File Offset: 0x000315C4
108 {
109 object obj;
110 while (obj != null)
111 {
112 if (obj == null)
113 {
114 throw new InvalidCastException();
115 }
116 }
117 }
118
119 // Token: 0x060017BB RID: 6075 RVA: 0x000333E0 File Offset: 0x000315E0
120 public void Dispose()
121 {
122 GC.SuppressFinalize(this);
123 }
124
125 // Token: 0x060017BC RID: 6076 RVA: 0x000333F4 File Offset: 0x000315F4
126 public void Clear()
127 {
128 }
129
130 // Token: 0x060017BD RID: 6077 RVA: 0x00033404 File Offset: 0x00031604
131 protected virtual void Dispose(bool disposing)
132 {
133 this._disposed = true;
134 }
135
136 // Token: 0x1700026F RID: 623
137 // (get) Token: 0x060017BE RID: 6078 RVA: 0x00033418 File Offset: 0x00031618
138 public virtual int InputBlockSize
139 {
140 get
141 {
142 return 1;
143 }
144 }
145
146 // Token: 0x17000270 RID: 624
147 // (get) Token: 0x060017BF RID: 6079 RVA: 0x00033428 File Offset: 0x00031628
148 public virtual int OutputBlockSize
149 {
150 get
151 {
152 return 1;
153 }
154 }
155
156 // Token: 0x17000271 RID: 625
157 // (get) Token: 0x060017C0 RID: 6080 RVA: 0x00033438 File Offset: 0x00031638
158 public virtual bool CanTransformMultipleBlocks
159 {
160 get
161 {
162 return true;
163 }
164 }
165
166 // Token: 0x17000272 RID: 626
167 // (get) Token: 0x060017C1 RID: 6081 RVA: 0x00033448 File Offset: 0x00031648
168 public virtual bool CanReuseTransform
169 {
170 get
171 {
172 return true;
173 }
174 }
175
176 // Token: 0x060017C2 RID: 6082 RVA: 0x00033458 File Offset: 0x00031658
177 public int TransformBlock(byte[] inputBuffer, int inputOffset, int inputCount, byte[] outputBuffer, int outputOffset)
178 {
179 this.ValidateTransformBlock(inputBuffer, inputOffset, inputCount);
180 this.State = 1;
181 if (outputBuffer != null)
182 {
184 }
185 return inputCount;
186 }
187
188 // Token: 0x060017C3 RID: 6083 RVA: 0x00033488 File Offset: 0x00031688
189 public byte[] TransformFinalBlock(byte[] inputBuffer, int inputOffset, int inputCount)
190 {
191 do
192 {
193 this.ValidateTransformBlock(inputBuffer, inputOffset, inputCount);
196 }
197 while (inputCount == 0);
198 return inputBuffer;
199 }
200
201 // Token: 0x060017C4 RID: 6084 RVA: 0x000334B0 File Offset: 0x000316B0
202 private void ValidateTransformBlock(byte[] inputBuffer, int inputOffset, int inputCount)
203 {
204 while (inputBuffer != null)
205 {
206 if (!this._disposed)
207 {
208 return;
209 }
210 }
211 }
212
213 // Token: 0x060017C5 RID: 6085
214 protected abstract void HashCore(byte[] array, int ibStart, int cbSize);
215
216 // Token: 0x060017C6 RID: 6086
217 protected abstract byte[] HashFinal();
218
219 // Token: 0x060017C7 RID: 6087
220 public abstract void Initialize();
221
222 // Token: 0x060017C8 RID: 6088 RVA: 0x000334CC File Offset: 0x000316CC
223 protected virtual void HashCore(ReadOnlySpan<byte> source)
224 {
225 if (!true)
226 {
227 }
228 if (!true)
229 {
230 }
231 }
232
233 // Token: 0x060017C9 RID: 6089 RVA: 0x000334E4 File Offset: 0x000316E4
234 protected virtual bool TryHashFinal(Span<byte> destination, [Out] int bytesWritten)
235 {
236 /*
237An exception occurred when decompiling this method (060017C9)
238
239ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Boolean System.Security.Cryptography.HashAlgorithm::TryHashFinal(System.Span`1<System.Byte>,System.Int32)
240
241 ---> System.Exception: Basic block has to end with unconditional control flow.
242{
243 Block_0:
244 stloc:int32(var_0_06, ldfld:int32(HashAlgorithm::HashSizeValue, ldloc:HashAlgorithm(this)))
245 stloc:uint8[](var_2_0F, ldfld:uint8[](HashAlgorithm::HashValue, ldloc:HashAlgorithm(this)))
246}
247
248 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
249 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
250 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
251 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
252 --- End of inner exception stack trace ---
253 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
254 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
255*/;
256 }
257
258 // Token: 0x04000C60 RID: 3168
259 private bool _disposed;
260
261 // Token: 0x04000C61 RID: 3169
262 protected int HashSizeValue;
263
264 // Token: 0x04000C62 RID: 3170
265 protected internal byte[] HashValue;
266
267 // Token: 0x04000C63 RID: 3171
268 protected int State;
269 }
270}
class f__AnonymousType0<< Count > j__TPar
static void BlockCopy(Array src, int srcOffset, Array dst, int dstOffset, int count)
Definition Buffer.cs:60
static void SuppressFinalize(object obj)
Definition GC.cs:116
void HashCore(byte[] array, int ibStart, int cbSize)
static HashAlgorithm Create(string hashName)
virtual void Dispose(bool disposing)
virtual bool TryHashFinal(Span< byte > destination, [Out] int bytesWritten)
byte[] TransformFinalBlock(byte[] inputBuffer, int inputOffset, int inputCount)
int TransformBlock(byte[] inputBuffer, int inputOffset, int inputCount, byte[] outputBuffer, int outputOffset)
byte[] ComputeHash(byte[] buffer, int offset, int count)
virtual void HashCore(ReadOnlySpan< byte > source)
bool TryComputeHash(ReadOnlySpan< byte > source, Span< byte > destination, [Out] int bytesWritten)
void ValidateTransformBlock(byte[] inputBuffer, int inputOffset, int inputCount)
byte[] ComputeHash(Stream inputStream)