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
MonoChunkParser.cs
Go to the documentation of this file.
1using System;
3using System.Text;
5
6namespace System.Net
7{
8 // Token: 0x02000263 RID: 611
9 internal class MonoChunkParser
10 {
11 // Token: 0x06001079 RID: 4217 RVA: 0x00034204 File Offset: 0x00032404
17
18 // Token: 0x0600107A RID: 4218 RVA: 0x00034228 File Offset: 0x00032428
19 public void WriteAndReadBack(byte[] buffer, int offset, int size, int read)
20 {
21 this.InternalWrite(buffer, offset, size);
22 int num = this.ReadFromChunks(buffer, offset, size);
23 read.m_value = num;
24 }
25
26 // Token: 0x0600107B RID: 4219 RVA: 0x00034250 File Offset: 0x00032450
27 public int Read(byte[] buffer, int offset, int size)
28 {
29 return this.ReadFromChunks(buffer, offset, size);
30 }
31
32 // Token: 0x0600107C RID: 4220 RVA: 0x00034268 File Offset: 0x00032468
33 private int ReadFromChunks(byte[] buffer, int offset, int size)
34 {
37 if (arrayList2 != null)
38 {
39 }
40 object[] items = arrayList2._items;
41 int size2 = arrayList2._size;
42 int size3 = arrayList2._size;
45 return size;
46 }
47
48 // Token: 0x0600107D RID: 4221 RVA: 0x000342C8 File Offset: 0x000324C8
49 public void Write(byte[] buffer, int offset, int size)
50 {
51 this.InternalWrite(buffer, offset, size);
52 }
53
54 // Token: 0x0600107E RID: 4222 RVA: 0x000342E0 File Offset: 0x000324E0
55 private void InternalWrite(byte[] buffer, int offset, int size)
56 {
58 MonoChunkParser.State state2 = this.GetChunkSize(buffer, offset, size);
59 this.state = state2;
60 StringBuilder stringBuilder = this.saved;
61 long num = 0L;
62 stringBuilder.Length = (int)num;
64 MonoChunkParser.State state4 = this.ReadBody(buffer, offset, size);
66 MonoChunkParser.State state5 = this.ReadCRLF(buffer, offset, size);
68 MonoChunkParser.State state6 = this.ReadTrailer(buffer, offset, size);
71 long num2 = 0L;
73 }
74
75 // Token: 0x170003B1 RID: 945
76 // (get) Token: 0x0600107F RID: 4223 RVA: 0x0003436C File Offset: 0x0003256C
77 public bool WantMore
78 {
79 get
80 {
81 int num = this.chunkSize;
82 int num2 = this.totalWritten;
83 if (num == 0)
84 {
86 }
87 return true;
88 }
89 }
90
91 // Token: 0x170003B2 RID: 946
92 // (get) Token: 0x06001080 RID: 4224 RVA: 0x00034394 File Offset: 0x00032594
93 public bool DataAvailable
94 {
95 get
96 {
99 if (arrayList2 != null)
100 {
101 object[] items = arrayList2._items;
102 if (items != null && items != null)
103 {
104 int size = arrayList2._size;
105 }
106 }
108 throw new InvalidCastException();
109 }
110 }
111
112 // Token: 0x170003B3 RID: 947
113 // (get) Token: 0x06001081 RID: 4225 RVA: 0x000343DC File Offset: 0x000325DC
114 public int TotalDataSize
115 {
116 get
117 {
118 return this.totalWritten;
119 }
120 }
121
122 // Token: 0x170003B4 RID: 948
123 // (get) Token: 0x06001082 RID: 4226 RVA: 0x000343F0 File Offset: 0x000325F0
124 public int ChunkLeft
125 {
126 get
127 {
128 /*
129An exception occurred when decompiling this method (06001082)
130
131ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Int32 System.Net.MonoChunkParser::get_ChunkLeft()
132
133 ---> System.Exception: Basic block has to end with unconditional control flow.
134{
135 Block_0:
136 stloc:int32(var_0_06, ldfld:int32(MonoChunkParser::chunkSize, ldloc:MonoChunkParser(this)))
137 stloc:int32(var_1_0D, ldfld:int32(MonoChunkParser::totalWritten, ldloc:MonoChunkParser(this)))
138}
139
140 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
141 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
142 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
143 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
144 --- End of inner exception stack trace ---
145 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
146 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
147*/;
148 }
149 }
150
151 // Token: 0x06001083 RID: 4227 RVA: 0x0003440C File Offset: 0x0003260C
152 private MonoChunkParser.State ReadBody(byte[] buffer, int offset, int size)
153 {
154 if (this.chunkSize != 0)
155 {
156 int num = this.chunkRead;
158 int num2 = this.chunkSize;
159 return;
160 }
161 }
162
163 // Token: 0x06001084 RID: 4228 RVA: 0x00034438 File Offset: 0x00032638
164 private MonoChunkParser.State GetChunkSize(byte[] buffer, int offset, int size)
165 {
166 int num = 1;
167 int num2 = 1;
168 offset.m_value = num;
169 if (!this.sawCR)
170 {
171 this.sawCR = num2 != 0;
172 return "Missing \\n";
173 }
176 return "Missing \\n";
177 }
178
179 // Token: 0x06001085 RID: 4229 RVA: 0x00034528 File Offset: 0x00032728
180 private static string RemoveChunkExtension(string input)
181 {
182 string text;
183 return text;
184 }
185
186 // Token: 0x06001086 RID: 4230 RVA: 0x0003453C File Offset: 0x0003273C
187 private MonoChunkParser.State ReadCRLF(byte[] buffer, int offset, int size)
188 {
189 /*
190An exception occurred when decompiling this method (06001086)
191
192ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Net.MonoChunkParser/State System.Net.MonoChunkParser::ReadCRLF(System.Byte[],System.Int32,System.Int32)
193
194 ---> System.Exception: Basic block has to end with unconditional control flow.
195{
196 IL_001C:
197 stfld:int32(int32::m_value, ldloc:int32[exp:int32&](offset), ldloc:int32(var_1))
198 call:void(MonoChunkParser::ThrowProtocolViolation, ldstr:string("Expecting \\r"))
199}
200
201 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
202 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
203 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
204 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
205 --- End of inner exception stack trace ---
206 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
207 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
208*/;
209 }
210
211 // Token: 0x06001087 RID: 4231 RVA: 0x00034578 File Offset: 0x00032778
212 private MonoChunkParser.State ReadTrailer(byte[] buffer, int offset, int size)
213 {
214 /*
215An exception occurred when decompiling this method (06001087)
216
217ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Net.MonoChunkParser/State System.Net.MonoChunkParser::ReadTrailer(System.Byte[],System.Int32,System.Int32)
218
219 ---> System.Exception: Basic block has to end with unconditional control flow.
220{
221 IL_001A:
222 stloc:int32(var_4_20, ldfld:int32(MonoChunkParser::trailerState, ldloc:MonoChunkParser(this)))
223 stloc:StringBuilder(var_6_35, call:StringBuilder(StringBuilder::Append, ldfld:StringBuilder(MonoChunkParser::saved, ldloc:MonoChunkParser(this)), ldloc:int64[exp:char](var_2_0F)))
224 stloc:int32(var_7_42, callgetter:int32(StringBuilder::get_Length, ldfld:StringBuilder(MonoChunkParser::saved, ldloc:MonoChunkParser(this))))
225 call:void(MonoChunkParser::ThrowProtocolViolation, ldstr:string("Error reading trailer (too long)."))
226 stloc:StringBuilder(var_9_57, ldfld:StringBuilder(MonoChunkParser::saved, ldloc:MonoChunkParser(this)))
227 stloc:WebHeaderCollection(var_11_5F, ldfld:WebHeaderCollection(MonoChunkParser::headers, ldloc:MonoChunkParser(this)))
228 call:void(MonoChunkParser::ThrowProtocolViolation, ldstr:string("Error reading trailer."))
229}
230
231 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
232 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
233 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
234 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
235 --- End of inner exception stack trace ---
236 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
237 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
238*/;
239 }
240
241 // Token: 0x06001088 RID: 4232 RVA: 0x00002050 File Offset: 0x00000250
242 private static void ThrowProtocolViolation(string message)
243 {
244 throw new global::Cpp2IlInjected.AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
245 }
246
247 // Token: 0x04000CF5 RID: 3317
249
250 // Token: 0x04000CF6 RID: 3318
251 private int chunkSize;
252
253 // Token: 0x04000CF7 RID: 3319
254 private int chunkRead;
255
256 // Token: 0x04000CF8 RID: 3320
257 private int totalWritten;
258
259 // Token: 0x04000CF9 RID: 3321
261
262 // Token: 0x04000CFA RID: 3322
264
265 // Token: 0x04000CFB RID: 3323
266 private bool sawCR;
267
268 // Token: 0x04000CFC RID: 3324
269 private bool gotit;
270
271 // Token: 0x04000CFD RID: 3325
272 private int trailerState;
273
274 // Token: 0x04000CFE RID: 3326
276
277 // Token: 0x02000264 RID: 612
278 private enum State
279 {
280 // Token: 0x04000D00 RID: 3328
281 None,
282 // Token: 0x04000D01 RID: 3329
284 // Token: 0x04000D02 RID: 3330
285 Body,
286 // Token: 0x04000D03 RID: 3331
288 // Token: 0x04000D04 RID: 3332
289 Trailer
290 }
291
292 // Token: 0x02000265 RID: 613
293 private class Chunk
294 {
295 // Token: 0x06001089 RID: 4233 RVA: 0x000345F8 File Offset: 0x000327F8
296 public Chunk(byte[] chunk)
297 {
299 }
300
301 // Token: 0x0600108A RID: 4234 RVA: 0x00034614 File Offset: 0x00032814
302 public int Read(byte[] buffer, int offset, int size)
303 {
304 /*
305An exception occurred when decompiling this method (0600108A)
306
307ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Int32 System.Net.MonoChunkParser/Chunk::Read(System.Byte[],System.Int32,System.Int32)
308
309 ---> System.Exception: Basic block has to end with unconditional control flow.
310{
311 Block_0:
312 stloc:uint8[](var_0_06, ldfld:uint8[](Chunk::Bytes, ldloc:Chunk(this)))
313 stloc:int32(var_1_0D, ldfld:int32(Chunk::Offset, ldloc:Chunk(this)))
314 stloc:int32(var_2_14, ldfld:int32(Chunk::Offset, ldloc:Chunk(this)))
315 stfld:int32(Chunk::Offset, ldloc:Chunk(this), ldloc:int32(var_2_14))
316}
317
318 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
319 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
320 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
321 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
322 --- End of inner exception stack trace ---
323 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
324 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
325*/;
326 }
327
328 // Token: 0x04000D05 RID: 3333
329 public byte[] Bytes;
330
331 // Token: 0x04000D06 RID: 3334
332 public int Offset;
333 }
334 }
335}
class f__AnonymousType0<< Count > j__TPar
int Read(byte[] buffer, int offset, int size)
MonoChunkParser.State ReadBody(byte[] buffer, int offset, int size)
WebHeaderCollection headers
int Read(byte[] buffer, int offset, int size)
MonoChunkParser.State ReadCRLF(byte[] buffer, int offset, int size)
MonoChunkParser(WebHeaderCollection headers)
int ReadFromChunks(byte[] buffer, int offset, int size)
static string RemoveChunkExtension(string input)
MonoChunkParser.State GetChunkSize(byte[] buffer, int offset, int size)
MonoChunkParser.State state
MonoChunkParser.State ReadTrailer(byte[] buffer, int offset, int size)
void InternalWrite(byte[] buffer, int offset, int size)
void Write(byte[] buffer, int offset, int size)
static void ThrowProtocolViolation(string message)
void WriteAndReadBack(byte[] buffer, int offset, int size, int read)