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
DeflateStreamNative.cs
Go to the documentation of this file.
1using System;
3using Mono.Util;
4
6{
7 // Token: 0x02000440 RID: 1088
8 internal class DeflateStreamNative
9 {
10 // Token: 0x06001DDE RID: 7646 RVA: 0x0004FF20 File Offset: 0x0004E120
12 {
13 }
14
15 // Token: 0x06001DDF RID: 7647 RVA: 0x0004FF34 File Offset: 0x0004E134
19
20 // Token: 0x06001DE0 RID: 7648 RVA: 0x0004FF48 File Offset: 0x0004E148
21 protected override void Finalize()
22 {
23 long num = 0L;
24 this.Dispose(num != 0L);
25 base.Finalize();
26 }
27
28 // Token: 0x06001DE1 RID: 7649 RVA: 0x0004FF88 File Offset: 0x0004E188
29 public void Dispose(bool disposing)
30 {
31 bool flag = this.disposed;
32 if (flag)
33 {
34 if (!flag)
35 {
36 }
37 if (this.z_stream != null)
38 {
39 this.z_stream.Dispose();
40 }
41 return;
42 }
43 int num = 1;
44 this.disposed = num != 0;
45 GC.SuppressFinalize(this);
46 }
47
48 // Token: 0x06001DE2 RID: 7650 RVA: 0x0004FFC8 File Offset: 0x0004E1C8
49 public void Flush()
50 {
51 int num = DeflateStreamNative.Flush(this.z_stream);
52 this.CheckResult(num, "Flush");
53 }
54
55 // Token: 0x06001DE3 RID: 7651 RVA: 0x0004FFF0 File Offset: 0x0004E1F0
56 public int ReadZStream(IntPtr buffer, int length)
57 {
58 int num = DeflateStreamNative.ReadZStream(this.z_stream, buffer, length);
59 this.CheckResult(num, "ReadInternal");
60 return num;
61 }
62
63 // Token: 0x06001DE4 RID: 7652 RVA: 0x00050018 File Offset: 0x0004E218
64 public void WriteZStream(IntPtr buffer, int length)
65 {
66 int num = DeflateStreamNative.WriteZStream(this.z_stream, buffer, length);
67 this.CheckResult(num, "WriteInternal");
68 }
69
70 // Token: 0x06001DE5 RID: 7653 RVA: 0x00050040 File Offset: 0x0004E240
72 private static int UnmanagedRead(IntPtr buffer, int length, IntPtr data)
73 {
75 if (gchandle.Target != null)
76 {
77 }
78 int num;
79 return num;
80 }
81
82 // Token: 0x06001DE6 RID: 7654 RVA: 0x00050060 File Offset: 0x0004E260
83 private int UnmanagedRead(IntPtr buffer, int length)
84 {
85 /*
86An exception occurred when decompiling this method (06001DE6)
87
88ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Int32 System.IO.Compression.DeflateStreamNative::UnmanagedRead(System.IntPtr,System.Int32)
89
90 ---> System.Exception: Basic block has to end with unconditional control flow.
91{
92 IL_000E:
93 stloc:int32(var_1_15, call:int32(Math::Min, ldloc:int32(length), ldloc:int32(var_0)))
94 stloc:Stream(var_2_1C, ldfld:Stream(DeflateStreamNative::base_stream, ldloc:DeflateStreamNative(this)))
95 stloc:uint8[](var_3_23, ldfld:uint8[](DeflateStreamNative::io_buffer, ldloc:DeflateStreamNative(this)))
96 stloc:uint8[](var_4_2A, ldfld:uint8[](DeflateStreamNative::io_buffer, ldloc:DeflateStreamNative(this)))
97}
98
99 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
100 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
101 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
102 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
103 --- End of inner exception stack trace ---
104 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
105 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
106*/;
107 }
108
109 // Token: 0x06001DE7 RID: 7655 RVA: 0x000500A0 File Offset: 0x0004E2A0
111 private static int UnmanagedWrite(IntPtr buffer, int length, IntPtr data)
112 {
114 if (gchandle.Target != null)
115 {
116 }
117 int num;
118 return num;
119 }
120
121 // Token: 0x06001DE8 RID: 7656 RVA: 0x000500C0 File Offset: 0x0004E2C0
122 private int UnmanagedWrite(IntPtr buffer, int length)
123 {
124 /*
125An exception occurred when decompiling this method (06001DE8)
126
127ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Int32 System.IO.Compression.DeflateStreamNative::UnmanagedWrite(System.IntPtr,System.Int32)
128
129 ---> System.Exception: Basic block has to end with unconditional control flow.
130{
131 IL_0013:
132 stloc:int32(var_2_1A, call:int32(Math::Min, ldloc:int32(length), ldloc:int32(var_1)))
133 stloc:uint8[](var_3_21, ldfld:uint8[](DeflateStreamNative::io_buffer, ldloc:DeflateStreamNative(this)))
134 stloc:int64(var_4_23, ldc.i4:int64(0))
135 call:void(Marshal::Copy, ldloc:native int(buffer), ldloc:uint8[](var_3_21), ldloc:int64[exp:int32](var_4_23), ldloc:int32(var_2_1A))
136 stloc:Stream(var_5_35, ldfld:Stream(DeflateStreamNative::base_stream, ldloc:DeflateStreamNative(this)))
137 stloc:uint8[](var_6_3D, ldfld:uint8[](DeflateStreamNative::io_buffer, ldloc:DeflateStreamNative(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 // Token: 0x06001DE9 RID: 7657 RVA: 0x00050114 File Offset: 0x0004E314
151 private void CheckResult(int result, string where)
152 {
153 }
154
155 // Token: 0x06001DEA RID: 7658
157
158 // Token: 0x06001DEB RID: 7659
159 private static extern int CloseZStream(IntPtr stream);
160
161 // Token: 0x06001DEC RID: 7660
162 private static extern int Flush(DeflateStreamNative.SafeDeflateStreamHandle stream);
163
164 // Token: 0x06001DED RID: 7661
165 private static extern int ReadZStream(DeflateStreamNative.SafeDeflateStreamHandle stream, IntPtr buffer, int length);
166
167 // Token: 0x06001DEE RID: 7662
168 private static extern int WriteZStream(DeflateStreamNative.SafeDeflateStreamHandle stream, IntPtr buffer, int length);
169
170 // Token: 0x0400140F RID: 5135
172
173 // Token: 0x04001410 RID: 5136
175
176 // Token: 0x04001411 RID: 5137
178
179 // Token: 0x04001412 RID: 5138
180 private GCHandle data;
181
182 // Token: 0x04001413 RID: 5139
183 private bool disposed;
184
185 // Token: 0x04001414 RID: 5140
186 private byte[] io_buffer;
187
188 // Token: 0x04001415 RID: 5141
190
191 // Token: 0x02000441 RID: 1089
194 {
195 // Token: 0x06001DEF RID: 7663 RVA: 0x0005013C File Offset: 0x0004E33C
196 public UnmanagedReadOrWrite(object @object, IntPtr method)
197 {
199 this.m_target = @object;
201 this.method_code = this;
202 }
203
204 // Token: 0x06001DF0 RID: 7664 RVA: 0x00050190 File Offset: 0x0004E390
205 public int Invoke(IntPtr buffer, int length, IntPtr data)
206 {
207 /*
208An exception occurred when decompiling this method (06001DF0)
209
210ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Int32 System.IO.Compression.DeflateStreamNative/UnmanagedReadOrWrite::Invoke(System.IntPtr,System.Int32,System.IntPtr)
211
212 ---> System.Exception: Basic block has to end with unconditional control flow.
213{
214 Block_0:
215 stloc:native int(var_0_06, ldfld:native int(Delegate::method_code, ldloc:UnmanagedReadOrWrite[exp:Delegate](this)))
216 stloc:native int(var_1_0D, ldfld:native int(Delegate::invoke_impl, ldloc:UnmanagedReadOrWrite[exp:Delegate](this)))
217 stloc:native int(var_2_14, ldfld:native int(Delegate::method, ldloc:UnmanagedReadOrWrite[exp:Delegate](this)))
218}
219
220 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
221 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
222 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
223 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
224 --- End of inner exception stack trace ---
225 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
226 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
227*/;
228 }
229 }
230
231 // Token: 0x02000442 RID: 1090
232 private sealed class SafeDeflateStreamHandle : SafeHandle
233 {
234 // Token: 0x170006BB RID: 1723
235 // (get) Token: 0x06001DF1 RID: 7665 RVA: 0x000501B4 File Offset: 0x0004E3B4
236 public override bool IsInvalid
237 {
238 get
239 {
240 IntPtr handle = this.handle;
241 bool flag;
242 return flag;
243 }
244 }
245
246 // Token: 0x06001DF2 RID: 7666 RVA: 0x000501CC File Offset: 0x0004E3CC
248 {
249 }
250
251 // Token: 0x06001DF3 RID: 7667 RVA: 0x000501DC File Offset: 0x0004E3DC
252 protected override bool ReleaseHandle()
253 {
254 /*
255An exception occurred when decompiling this method (06001DF3)
256
257ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Boolean System.IO.Compression.DeflateStreamNative/SafeDeflateStreamHandle::ReleaseHandle()
258
259 ---> System.Exception: Basic block has to end with unconditional control flow.
260{
261 Block_0:
262 stloc:native int(var_0_06, ldfld:native int(SafeHandle::handle, ldloc:SafeDeflateStreamHandle[exp:SafeHandle](this)))
263}
264
265 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
266 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
267 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
268 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
269 --- End of inner exception stack trace ---
270 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
271 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
272*/;
273 }
274 }
275 }
276}
class f__AnonymousType0<< Count > j__TPar
DelegateData data
Definition Delegate.cs:401
static void SuppressFinalize(object obj)
Definition GC.cs:116
static int UnmanagedRead(IntPtr buffer, int length, IntPtr data)
static int UnmanagedWrite(IntPtr buffer, int length, IntPtr data)
void CheckResult(int result, string where)
static int WriteZStream(DeflateStreamNative.SafeDeflateStreamHandle stream, IntPtr buffer, int length)
DeflateStreamNative.UnmanagedReadOrWrite feeder
static DeflateStreamNative.SafeDeflateStreamHandle CreateZStream(CompressionMode compress, bool gzip, DeflateStreamNative.UnmanagedReadOrWrite feeder, IntPtr data)
static int CloseZStream(IntPtr stream)
int UnmanagedWrite(IntPtr buffer, int length)
int ReadZStream(IntPtr buffer, int length)
static int Flush(DeflateStreamNative.SafeDeflateStreamHandle stream)
int UnmanagedRead(IntPtr buffer, int length)
static int ReadZStream(DeflateStreamNative.SafeDeflateStreamHandle stream, IntPtr buffer, int length)
void WriteZStream(IntPtr buffer, int length)
DeflateStreamNative.SafeDeflateStreamHandle z_stream
static DeflateStreamNative Create(Stream compressedStream, CompressionMode mode, bool gzip)
static GCHandle FromIntPtr(IntPtr value)
Definition GCHandle.cs:179