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
Tokenizer.cs
Go to the documentation of this file.
1using System;
2using System.IO;
3using System.Text;
4
6{
7 // Token: 0x0200029F RID: 671
8 internal sealed class Tokenizer
9 {
10 // Token: 0x06001728 RID: 5928 RVA: 0x00031534 File Offset: 0x0002F734
16
17 // Token: 0x06001729 RID: 5929 RVA: 0x00031550 File Offset: 0x0002F750
18 public void Recycle()
19 {
20 if (!true)
21 {
22 }
23 }
24
25 // Token: 0x0600172A RID: 5930 RVA: 0x00031560 File Offset: 0x0002F760
26 internal Tokenizer(string input)
27 {
30 int stringLength = input._stringLength;
33 }
34
35 // Token: 0x0600172B RID: 5931 RVA: 0x00031598 File Offset: 0x0002F798
36 internal void ChangeFormat(Encoding encoding)
37 {
38 if (encoding != null)
39 {
41 if (this._inTokenReader != null)
42 {
43 return;
44 }
45 }
46 }
47
48 // Token: 0x0600172C RID: 5932 RVA: 0x00031600 File Offset: 0x0002F800
49 internal void GetTokens(TokenizerStream stream, int maxNum, bool endAfterKet)
50 {
51 int countTokens = stream.m_countTokens;
54 }
55
56 // Token: 0x0600172D RID: 5933 RVA: 0x000318D4 File Offset: 0x0002FAD4
57 private string GetStringToken()
58 {
59 return this._maker.MakeString();
60 }
61
62 // Token: 0x04000BB4 RID: 2996
63 public int LineNo;
64
65 // Token: 0x04000BB5 RID: 2997
66 private int _inProcessingTag;
67
68 // Token: 0x04000BB6 RID: 2998
69 private byte[] _inBytes;
70
71 // Token: 0x04000BB7 RID: 2999
72 private char[] _inChars;
73
74 // Token: 0x04000BB8 RID: 3000
75 private string _inString;
76
77 // Token: 0x04000BB9 RID: 3001
78 private int _inIndex;
79
80 // Token: 0x04000BBA RID: 3002
81 private int _inSize;
82
83 // Token: 0x04000BBB RID: 3003
84 private int _inSavedCharacter;
85
86 // Token: 0x04000BBC RID: 3004
88
89 // Token: 0x04000BBD RID: 3005
91
92 // Token: 0x04000BBE RID: 3006
94
95 // Token: 0x04000BBF RID: 3007
96 private string[] _searchStrings;
97
98 // Token: 0x04000BC0 RID: 3008
99 private string[] _replaceStrings;
100
101 // Token: 0x04000BC1 RID: 3009
102 private int _inNestedIndex;
103
104 // Token: 0x04000BC2 RID: 3010
105 private int _inNestedSize;
106
107 // Token: 0x04000BC3 RID: 3011
108 private string _inNestedString;
109
110 // Token: 0x020002A0 RID: 672
111 private enum TokenSource
112 {
113 // Token: 0x04000BC5 RID: 3013
115 // Token: 0x04000BC6 RID: 3014
117 // Token: 0x04000BC7 RID: 3015
119 // Token: 0x04000BC8 RID: 3016
120 CharArray,
121 // Token: 0x04000BC9 RID: 3017
122 String,
123 // Token: 0x04000BCA RID: 3018
125 // Token: 0x04000BCB RID: 3019
126 Other
127 }
128
129 // Token: 0x020002A1 RID: 673
130 [Serializable]
131 internal sealed class StringMaker
132 {
133 // Token: 0x0600172E RID: 5934 RVA: 0x000318EC File Offset: 0x0002FAEC
134 private static uint HashString(string str)
135 {
136 }
137
138 // Token: 0x0600172F RID: 5935 RVA: 0x000318FC File Offset: 0x0002FAFC
139 private static uint HashCharArray(char[] a, int l)
140 {
141 }
142
143 // Token: 0x06001730 RID: 5936 RVA: 0x0003190C File Offset: 0x0002FB0C
144 public StringMaker()
145 {
146 }
147
148 // Token: 0x06001731 RID: 5937 RVA: 0x00031920 File Offset: 0x0002FB20
149 private bool CompareStringAndChars(string str, char[] a, int l)
150 {
151 /*
152An exception occurred when decompiling this method (06001731)
153
154ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Boolean System.Security.Util.Tokenizer/StringMaker::CompareStringAndChars(System.String,System.Char[],System.Int32)
155
156 ---> System.Exception: Basic block has to end with unconditional control flow.
157{
158 Block_0:
159 stloc:int32(var_0_06, ldfld:int32(string::_stringLength, ldloc:string(str)))
160 stloc:int64(var_1_08, ldc.i4:int64(0))
161 stloc:char(var_2_10, callgetter:char(string::get_Chars, ldloc:string(str), ldloc:int64[exp:int32](var_1_08)))
162}
163
164 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
165 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
166 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
167 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
168 --- End of inner exception stack trace ---
169 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
170 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
171*/;
172 }
173
174 // Token: 0x06001732 RID: 5938 RVA: 0x00031944 File Offset: 0x0002FB44
175 public string MakeString()
176 {
178 char[] outChars = this._outChars;
179 int outIndex = this._outIndex;
180 if (outStringBuilder != null)
181 {
183 }
184 uint num = this.cStringsMax;
186 if (this.cStringsMax != 0U)
187 {
188 if (this.aStrings != null)
189 {
190 }
191 string[] array = this.aStrings;
192 uint num2;
193 if (num2 == 0U)
194 {
195 goto IL_00A8;
196 }
197 uint num3 = this.cStringsMax;
198 }
199 this.cStringsMax = num;
200 string[] array2 = this.aStrings;
201 if (num != 0U)
202 {
203 uint num4 = this.cStringsMax;
204 string[] array3 = this.aStrings;
205 while (num != 0U)
206 {
207 }
208 }
209 string[] array4 = this.aStrings;
210 string text;
211 if (text == null || text != null)
212 {
213 uint num5 = this.cStringsUsed;
215 return text;
216 }
217 IL_00A8:
218 throw new ArrayTypeMismatchException();
219 }
220
221 // Token: 0x04000BCC RID: 3020
222 private string[] aStrings;
223
224 // Token: 0x04000BCD RID: 3021
225 private uint cStringsMax;
226
227 // Token: 0x04000BCE RID: 3022
228 private uint cStringsUsed;
229
230 // Token: 0x04000BCF RID: 3023
232
233 // Token: 0x04000BD0 RID: 3024
234 public char[] _outChars;
235
236 // Token: 0x04000BD1 RID: 3025
237 public int _outIndex;
238 }
239
240 // Token: 0x020002A2 RID: 674
241 internal interface ITokenReader
242 {
243 // Token: 0x06001733 RID: 5939
244 int Read();
245 }
246
247 // Token: 0x020002A3 RID: 675
249 {
250 // Token: 0x06001734 RID: 5940 RVA: 0x00031A00 File Offset: 0x0002FC00
252 {
253 this._in = input;
254 }
255
256 // Token: 0x06001735 RID: 5941 RVA: 0x00031A1C File Offset: 0x0002FC1C
257 public virtual int Read()
258 {
259 /*
260An exception occurred when decompiling this method (06001735)
261
262ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Int32 System.Security.Util.Tokenizer/StreamTokenReader::Read()
263
264 ---> System.Exception: Basic block has to end with unconditional control flow.
265{
266 Block_0:
267 stloc:StreamReader(var_0_06, ldfld:StreamReader(StreamTokenReader::_in, ldloc:StreamTokenReader(this)))
268 stloc:int32(var_1_0D, ldfld:int32(StreamTokenReader::_numCharRead, ldloc:StreamTokenReader(this)))
269 stfld:int32(StreamTokenReader::_numCharRead, ldloc:StreamTokenReader(this), ldloc:int32(var_1_0D))
270}
271
272 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
273 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
274 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
275 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
276 --- End of inner exception stack trace ---
277 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
278 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
279*/;
280 }
281
282 // Token: 0x17000259 RID: 601
283 // (get) Token: 0x06001736 RID: 5942 RVA: 0x00031A40 File Offset: 0x0002FC40
285 {
286 get
287 {
288 return this._numCharRead;
289 }
290 }
291
292 // Token: 0x04000BD2 RID: 3026
294
295 // Token: 0x04000BD3 RID: 3027
296 internal int _numCharRead;
297 }
298 }
299}
class f__AnonymousType0<< Count > j__TPar
bool CompareStringAndChars(string str, char[] a, int l)
Definition Tokenizer.cs:149
static uint HashCharArray(char[] a, int l)
Definition Tokenizer.cs:139
Tokenizer.TokenSource _inTokenSource
Definition Tokenizer.cs:87
void GetTokens(TokenizerStream stream, int maxNum, bool endAfterKet)
Definition Tokenizer.cs:49
void ChangeFormat(Encoding encoding)
Definition Tokenizer.cs:36
Tokenizer.ITokenReader _inTokenReader
Definition Tokenizer.cs:90
Tokenizer.StringMaker _maker
Definition Tokenizer.cs:93
static Tokenizer.StringMaker GetSharedStringMaker()