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
SharedUtilities.cs
Go to the documentation of this file.
1using System;
3using System.IO;
5using System.Text;
8
9namespace Ionic.Zip
10{
11 // Token: 0x02000017 RID: 23
12 internal static class SharedUtilities
13 {
14 // Token: 0x06000065 RID: 101 RVA: 0x00002800 File Offset: 0x00000A00
15 public static long GetFileLength(string fileName)
16 {
17 long num = 0L;
19 if (fileStream != null)
20 {
21 }
22 if (num == 0L)
23 {
24 }
25 throw new OutOfMemoryException();
26 }
27
28 // Token: 0x06000066 RID: 102 RVA: 0x00002834 File Offset: 0x00000A34
29 [Conditional("NETCF")]
30 public static void Workaround_Ladybug318918(Stream s)
31 {
32 }
33
34 // Token: 0x06000067 RID: 103 RVA: 0x00002844 File Offset: 0x00000A44
35 private static string SimplifyFwdSlashPath(string path)
36 {
37 string text2;
38 string text = text2.Replace("/./", "/");
39 string text3;
40 return text3;
41 }
42
43 // Token: 0x06000068 RID: 104 RVA: 0x00002864 File Offset: 0x00000A64
44 public static string NormalizePathForUseInZipFile(string pathName)
45 {
46 bool flag = string.IsNullOrEmpty("/");
47 string text;
48 bool flag2 = text.StartsWith("/");
49 return text.Substring(1);
50 }
51
52 // Token: 0x06000069 RID: 105 RVA: 0x00002122 File Offset: 0x00000322
53 internal static byte[] StringToByteArray(string value, Encoding encoding)
54 {
55 throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
56 }
57
58 // Token: 0x0600006A RID: 106 RVA: 0x000028A0 File Offset: 0x00000AA0
59 internal static byte[] StringToByteArray(string value)
60 {
61 /*
62An exception occurred when decompiling this method (0600006A)
63
64ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Byte[] Ionic.Zip.SharedUtilities::StringToByteArray(System.String)
65
66 ---> System.Exception: Basic block has to end with unconditional control flow.
67{
68 IL_0000:
69 brtrue(IL_0000, ldc.i4:bool(1))
70}
71
72 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
73 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
74 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
75 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
76 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
77 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
78 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
79 --- End of inner exception stack trace ---
80 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
81 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
82*/;
83 }
84
85 // Token: 0x0600006B RID: 107 RVA: 0x000028B0 File Offset: 0x00000AB0
86 internal static string Utf8StringFromBuffer(byte[] buf)
87 {
88 /*
89An exception occurred when decompiling this method (0600006B)
90
91ICSharpCode.Decompiler.DecompilerException: Error decompiling System.String Ionic.Zip.SharedUtilities::Utf8StringFromBuffer(System.Byte[])
92
93 ---> System.Exception: Basic block has to end with unconditional control flow.
94{
95 IL_0000:
96 brtrue(IL_0000, ldc.i4:bool(1))
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.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1878
101 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
102 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
103 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
104 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
105 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
106 --- End of inner exception stack trace ---
107 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
108 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
109*/;
110 }
111
112 // Token: 0x0600006C RID: 108 RVA: 0x00002122 File Offset: 0x00000322
113 internal static string StringFromBuffer(byte[] buf, Encoding encoding)
114 {
115 throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
116 }
117
118 // Token: 0x0600006D RID: 109 RVA: 0x000028C0 File Offset: 0x00000AC0
119 internal static int ReadSignature(Stream s)
120 {
121 if (!true)
122 {
123 }
124 int num;
125 return num;
126 }
127
128 // Token: 0x0600006E RID: 110 RVA: 0x000028D8 File Offset: 0x00000AD8
129 internal static int ReadEntrySignature(Stream s)
130 {
131 int num = 1;
132 if (num == 0)
133 {
134 }
135 if (num == 0)
136 {
137 }
138 if (num == 0)
139 {
140 }
141 if (num == 0)
142 {
143 }
144 int num2;
145 return num2;
146 }
147
148 // Token: 0x0600006F RID: 111 RVA: 0x00002924 File Offset: 0x00000B24
149 internal static int ReadInt(Stream s)
150 {
151 if (!true)
152 {
153 }
154 int num;
155 return num;
156 }
157
158 // Token: 0x06000070 RID: 112 RVA: 0x00002938 File Offset: 0x00000B38
159 private static int _ReadFourBytes(Stream s, string message)
160 {
161 }
162
163 // Token: 0x06000071 RID: 113 RVA: 0x0000294C File Offset: 0x00000B4C
164 internal static long FindSignature(Stream stream, int SignatureToFind)
165 {
166 }
167
168 // Token: 0x06000072 RID: 114 RVA: 0x0000295C File Offset: 0x00000B5C
170 {
171 if (!true)
172 {
173 }
174 bool flag = DateTime.Now.IsDaylightSavingTime();
175 if (!true)
176 {
177 }
179 if (!true)
180 {
181 }
182 return 1;
183 }
184
185 // Token: 0x06000073 RID: 115 RVA: 0x000029A0 File Offset: 0x00000BA0
187 {
188 int num = 65535;
189 if (packedDateTime == 0)
190 {
191 }
193 if (num == 0)
194 {
195 }
196 throw new ArrayTypeMismatchException();
197 }
198
199 // Token: 0x06000074 RID: 116 RVA: 0x00002A4C File Offset: 0x00000C4C
200 internal static int DateTimeToPacked(DateTime time)
201 {
202 DateTime dateTime;
203 int day = dateTime.Day;
204 int num;
205 return num;
206 }
207
208 // Token: 0x06000075 RID: 117 RVA: 0x00002A64 File Offset: 0x00000C64
209 public static void CreateAndOpenUniqueTempFile(string dir, [Out] Stream fs, [Out] string filename)
210 {
211 int num = 1;
212 if (num == 0)
213 {
214 }
216 if (num == 0)
217 {
218 }
219 string text2 = Path.Combine(dir, text);
220 }
221
222 // Token: 0x06000076 RID: 118 RVA: 0x00002A94 File Offset: 0x00000C94
223 public static string InternalGetTempFileName()
224 {
225 if (!true)
226 {
227 }
228 long num = 0L;
229 string text = SharedUtilities.GenerateRandomStringImpl(8, (int)num);
230 return "DotNetZip-" + text + ".tmp";
231 }
232
233 // Token: 0x06000077 RID: 119 RVA: 0x00002AC0 File Offset: 0x00000CC0
234 internal static string GenerateRandomStringImpl(int length, int delta)
235 {
236 if (length == 0)
237 {
238 }
239 string text;
240 return text;
241 }
242
243 // Token: 0x06000078 RID: 120 RVA: 0x00002AD8 File Offset: 0x00000CD8
244 internal static int ReadWithRetry(Stream s, byte[] buffer, int offset, int count, string FileName)
245 {
246 throw new OutOfMemoryException();
247 }
248
249 // Token: 0x06000079 RID: 121 RVA: 0x00002AEC File Offset: 0x00000CEC
250 private static uint _HRForException(Exception ex1)
251 {
252 /*
253An exception occurred when decompiling this method (06000079)
254
255ICSharpCode.Decompiler.DecompilerException: Error decompiling System.UInt32 Ionic.Zip.SharedUtilities::_HRForException(System.Exception)
256
257 ---> System.Exception: Basic block has to end with unconditional control flow.
258{
259 IL_0000:
260 brtrue(IL_0000, ldc.i4:bool(1))
261}
262
263 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
264 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
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 1878
266 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
267 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
268 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
269 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
270 --- End of inner exception stack trace ---
271 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
272 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
273*/;
274 }
275
276 // Token: 0x0600007A RID: 122 RVA: 0x00002AFC File Offset: 0x00000CFC
277 // Note: this type is marked as 'beforefieldinit'.
279 {
280 Encoding encoding = Encoding.GetEncoding("IBM437");
282 }
283
284 // Token: 0x04000030 RID: 48
285 private static Regex doubleDotRegex1;
286
287 // Token: 0x04000031 RID: 49
288 private static Encoding ibm437;
289
290 // Token: 0x04000032 RID: 50
291 private static Encoding utf8;
292 }
293}
class f__AnonymousType0<< Count > j__TPar
static int DateTimeToPacked(DateTime time)
static string InternalGetTempFileName()
static long GetFileLength(string fileName)
static int ReadEntrySignature(Stream s)
static long FindSignature(Stream stream, int SignatureToFind)
static int ReadSignature(Stream s)
static DateTime AdjustTime_Reverse(DateTime time)
static string Utf8StringFromBuffer(byte[] buf)
static byte[] StringToByteArray(string value, Encoding encoding)
static void CreateAndOpenUniqueTempFile(string dir, [Out] Stream fs, [Out] string filename)
static string SimplifyFwdSlashPath(string path)
static string StringFromBuffer(byte[] buf, Encoding encoding)
static int ReadInt(Stream s)
static void Workaround_Ladybug318918(Stream s)
static int _ReadFourBytes(Stream s, string message)
static DateTime PackedToDateTime(int packedDateTime)
static byte[] StringToByteArray(string value)
static int ReadWithRetry(Stream s, byte[] buffer, int offset, int count, string FileName)
static uint _HRForException(Exception ex1)
static string GenerateRandomStringImpl(int length, int delta)
static string NormalizePathForUseInZipFile(string pathName)
static string Combine(string path1, string path2)
Definition Path.cs:41
static Encoding GetEncoding(int codepage)
Definition Encoding.cs:130
static DateTime Now
Definition DateTime.cs:530
bool IsDaylightSavingTime()
Definition DateTime.cs:383