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
ChunkedMemoryStream.cs
Go to the documentation of this file.
1using System;
5
6namespace System.IO
7{
8 // Token: 0x02000439 RID: 1081
9 internal sealed class ChunkedMemoryStream : Stream
10 {
11 // Token: 0x06001D8E RID: 7566 RVA: 0x0004F6EC File Offset: 0x0004D8EC
13 {
14 if (!true)
15 {
16 }
17 base..ctor();
18 }
19
20 // Token: 0x06001D8F RID: 7567 RVA: 0x0004F704 File Offset: 0x0004D904
21 public byte[] ToArray()
22 {
23 /*
24An exception occurred when decompiling this method (06001D8F)
25
26ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Byte[] System.IO.ChunkedMemoryStream::ToArray()
27
28 ---> System.Exception: Basic block has to end with unconditional control flow.
29{
30 Block_0:
31 stloc:uint8[](var_2_17, ldfld:uint8[](MemoryChunk::_buffer, ldloc:MemoryChunk(var_1_0D)))
32 stloc:int32(var_3_1E, ldfld:int32(MemoryChunk::_freeOffset, ldloc:MemoryChunk(var_1_0D)))
33 stloc:int32(var_4_25, ldfld:int32(MemoryChunk::_freeOffset, ldloc:MemoryChunk(var_1_0D)))
34 brtrue(IL_0000, ldfld:MemoryChunk[exp:bool](MemoryChunk::_next, ldloc:MemoryChunk(var_1_0D)))
35}
36
37 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
38 at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1878
39 at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1878
40 at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1846
41 at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1878
42 at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1878
43 at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1846
44 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
45 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
46 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
47 --- End of inner exception stack trace ---
48 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
49 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
50*/;
51 }
52
53 // Token: 0x06001D90 RID: 7568 RVA: 0x0004F740 File Offset: 0x0004D940
54 public override void Write(byte[] buffer, int offset, int count)
55 {
57 if (currentChunk != null)
58 {
59 byte[] buffer2 = currentChunk._buffer;
60 int freeOffset = currentChunk._freeOffset;
61 }
62 this.AppendChunk((long)count);
63 }
64
65 // Token: 0x06001D91 RID: 7569 RVA: 0x0004F7CC File Offset: 0x0004D9CC
66 public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
67 {
68 if (!true)
69 {
70 }
71 Task task;
72 return task;
73 }
74
75 // Token: 0x06001D92 RID: 7570 RVA: 0x0004F7E0 File Offset: 0x0004D9E0
76 private void AppendChunk(long count)
77 {
79 if (currentChunk != null)
80 {
81 byte[] buffer = currentChunk._buffer;
82 return;
83 }
84 int num = 16;
85 long num2 = Math.Min(count, (long)num);
86 }
87
88 // Token: 0x170006AC RID: 1708
89 // (get) Token: 0x06001D93 RID: 7571 RVA: 0x0004F814 File Offset: 0x0004DA14
90 public override bool CanRead
91 {
92 get
93 {
94 }
95 }
96
97 // Token: 0x170006AD RID: 1709
98 // (get) Token: 0x06001D94 RID: 7572 RVA: 0x0004F824 File Offset: 0x0004DA24
99 public override bool CanSeek
100 {
101 get
102 {
103 }
104 }
105
106 // Token: 0x170006AE RID: 1710
107 // (get) Token: 0x06001D95 RID: 7573 RVA: 0x0004F834 File Offset: 0x0004DA34
108 public override bool CanWrite
109 {
110 get
111 {
112 return true;
113 }
114 }
115
116 // Token: 0x170006AF RID: 1711
117 // (get) Token: 0x06001D96 RID: 7574 RVA: 0x00002050 File Offset: 0x00000250
118 public override long Length
119 {
120 get
121 {
122 throw new global::Cpp2IlInjected.AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
123 }
124 }
125
126 // Token: 0x06001D97 RID: 7575 RVA: 0x0004F844 File Offset: 0x0004DA44
127 public override void Flush()
128 {
129 }
130
131 // Token: 0x06001D98 RID: 7576 RVA: 0x0004F854 File Offset: 0x0004DA54
132 public override Task FlushAsync(CancellationToken cancellationToken)
133 {
134 /*
135An exception occurred when decompiling this method (06001D98)
136
137ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Threading.Tasks.Task System.IO.ChunkedMemoryStream::FlushAsync(System.Threading.CancellationToken)
138
139 ---> System.Exception: Basic block has to end with unconditional control flow.
140{
141 IL_0003:
142 brtrue(IL_0000, ldc.i4:bool(1))
143}
144
145 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
146 at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1878
147 at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1878
148 at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1846
149 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
150 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
151 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
152 --- End of inner exception stack trace ---
153 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
154 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
155*/;
156 }
157
158 // Token: 0x170006B0 RID: 1712
159 // (get) Token: 0x06001D99 RID: 7577 RVA: 0x00002050 File Offset: 0x00000250
160 // (set) Token: 0x06001D9A RID: 7578 RVA: 0x00002050 File Offset: 0x00000250
161 public override long Position
162 {
163 get
164 {
165 throw new global::Cpp2IlInjected.AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
166 }
167 set
168 {
169 throw new global::Cpp2IlInjected.AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
170 }
171 }
172
173 // Token: 0x06001D9B RID: 7579 RVA: 0x00002050 File Offset: 0x00000250
174 public override int Read(byte[] buffer, int offset, int count)
175 {
176 throw new global::Cpp2IlInjected.AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
177 }
178
179 // Token: 0x06001D9C RID: 7580 RVA: 0x00002050 File Offset: 0x00000250
180 public override long Seek(long offset, SeekOrigin origin)
181 {
182 throw new global::Cpp2IlInjected.AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
183 }
184
185 // Token: 0x06001D9D RID: 7581 RVA: 0x0004F868 File Offset: 0x0004DA68
186 public override void SetLength(long value)
187 {
188 while (this._currentChunk != null)
189 {
190 }
191 this.AppendChunk(value);
192 }
193
194 // Token: 0x04001400 RID: 5120
196
197 // Token: 0x04001401 RID: 5121
199
200 // Token: 0x04001402 RID: 5122
201 private int _totalLength;
202
203 // Token: 0x0200043A RID: 1082
204 private sealed class MemoryChunk
205 {
206 // Token: 0x06001D9E RID: 7582 RVA: 0x0004F884 File Offset: 0x0004DA84
207 internal MemoryChunk(int bufferSize)
208 {
209 }
210
211 // Token: 0x04001403 RID: 5123
212 internal readonly byte[] _buffer;
213
214 // Token: 0x04001404 RID: 5124
215 internal int _freeOffset;
216
217 // Token: 0x04001405 RID: 5125
219 }
220 }
221}
class f__AnonymousType0<< Count > j__TPar
override void SetLength(long value)
ChunkedMemoryStream.MemoryChunk _currentChunk
override int Read(byte[] buffer, int offset, int count)
override void Write(byte[] buffer, int offset, int count)
override Task FlushAsync(CancellationToken cancellationToken)
override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
ChunkedMemoryStream.MemoryChunk _headChunk
override long Seek(long offset, SeekOrigin origin)
static byte Min(byte val1, byte val2)
Definition Math.cs:152