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
FileUtilities.cs
Go to the documentation of this file.
1using System;
2using System.IO;
3using System.Text;
6
7namespace Terraria.Utilities
8{
9 // Token: 0x020004F9 RID: 1273
10 public static class FileUtilities
11 {
12 // Token: 0x060030CF RID: 12495 RVA: 0x001F6FAC File Offset: 0x001F51AC
13 public static string WildcardToRegex(string pattern)
14 {
15 if (!true)
16 {
17 }
18 string text2;
19 string text = text2.Replace("\\*", ".*").Replace("\\?", ".");
20 return "^" + text + "$";
21 }
22
23 // Token: 0x060030D0 RID: 12496 RVA: 0x001F6FEC File Offset: 0x001F51EC
24 public static string CleanSwitchPath(string path)
25 {
26 string text;
27 return text.Replace("//", "/").Replace("/", "//");
28 }
29
30 // Token: 0x060030D1 RID: 12497 RVA: 0x001F7018 File Offset: 0x001F5218
31 public static string[] GetFiles(string path, string searchPattern)
32 {
33 string[] array;
34 return array;
35 }
36
37 // Token: 0x060030D2 RID: 12498 RVA: 0x001F7028 File Offset: 0x001F5228
38 public static void SetAttributes(string path, FileAttributes fileAttributes)
39 {
40 FileManager.SetAttributes(path, fileAttributes);
41 }
42
43 // Token: 0x060030D3 RID: 12499 RVA: 0x001F703C File Offset: 0x001F523C
44 public static void CreateDirectory(string path)
45 {
47 }
48
49 // Token: 0x060030D4 RID: 12500 RVA: 0x001F7050 File Offset: 0x001F5250
50 public static bool Exists(string path, bool cloud = false)
51 {
52 bool flag;
53 return flag;
54 }
55
56 // Token: 0x060030D5 RID: 12501 RVA: 0x001F7060 File Offset: 0x001F5260
57 public static void Delete(string path, bool cloud = false)
58 {
59 if (path != null)
60 {
61 return;
62 }
63 }
64
65 // Token: 0x060030D6 RID: 12502 RVA: 0x000021DB File Offset: 0x000003DB
66 public static string GetFullPath(string path, bool cloud)
67 {
68 throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
69 }
70
71 // Token: 0x060030D7 RID: 12503 RVA: 0x001F7078 File Offset: 0x001F5278
72 public static void Copy(string source, string destination, bool cloud = false, bool overwrite = true)
73 {
74 if (cloud)
75 {
76 return;
77 }
78 }
79
80 // Token: 0x060030D8 RID: 12504 RVA: 0x001F70A8 File Offset: 0x001F52A8
81 public static void Move(string source, string destination, bool cloud, bool overwrite = true)
82 {
83 if (!true)
84 {
85 }
88 }
89
90 // Token: 0x060030D9 RID: 12505 RVA: 0x001F70C8 File Offset: 0x001F52C8
91 public static void WriteAllText(string path, string data)
92 {
94 }
95
96 // Token: 0x060030DA RID: 12506 RVA: 0x001F70E0 File Offset: 0x001F52E0
97 public static string ReadAllText(string path)
98 {
99 /*
100An exception occurred when decompiling this method (060030DA)
101
102ICSharpCode.Decompiler.DecompilerException: Error decompiling System.String Terraria.Utilities.FileUtilities::ReadAllText(System.String)
103
104 ---> System.Exception: Basic block has to end with unconditional control flow.
105{
106 Block_0:
107 stloc:Encoding(var_1_07, callgetter:Encoding(Encoding::get_Default))
108}
109
110 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
111 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
112 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
113 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
114 --- End of inner exception stack trace ---
115 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
116 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
117*/;
118 }
119
120 // Token: 0x060030DB RID: 12507 RVA: 0x001F70F4 File Offset: 0x001F52F4
121 public static byte[] ReadAllBytes(string path, bool cloud = false)
122 {
123 byte[] array;
124 return array;
125 }
126
127 // Token: 0x060030DC RID: 12508 RVA: 0x001F7108 File Offset: 0x001F5308
128 public static void WriteAllBytes(string path, byte[] data, bool cloud = false)
129 {
130 if (!true)
131 {
132 }
133 }
134
135 // Token: 0x060030DD RID: 12509 RVA: 0x001F7118 File Offset: 0x001F5318
136 public static void Write(string path, byte[] data, int length, bool cloud)
137 {
138 if ("" != null)
139 {
140 return;
141 }
142 }
143
144 // Token: 0x060030DE RID: 12510 RVA: 0x001F7170 File Offset: 0x001F5370
145 public static bool MoveToCloud(string localPath, string cloudPath)
146 {
147 byte[] array;
149 return true;
150 }
151
152 // Token: 0x060030DF RID: 12511 RVA: 0x001F7188 File Offset: 0x001F5388
153 public static bool MoveToLocal(string cloudPath, string localPath)
154 {
155 /*
156An exception occurred when decompiling this method (060030DF)
157
158ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Boolean Terraria.Utilities.FileUtilities::MoveToLocal(System.String,System.String)
159
160 ---> System.Exception: Basic block has to end with unconditional control flow.
161{
162 Block_0:
163 stloc:int64(var_1_01, ldc.i4:int64(0))
164 call:void(FileUtilities::WriteAllBytes, ldloc:string(cloudPath), ldloc:uint8[](var_0), ldloc:int64[exp:bool](var_1_01))
165 call:void(FileUtilities::Delete, ldloc:string(cloudPath), ldc.i4:bool(1))
166}
167
168 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
169 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
170 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
171 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
172 --- End of inner exception stack trace ---
173 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
174 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
175*/;
176 }
177
178 // Token: 0x060030E0 RID: 12512 RVA: 0x001F71A8 File Offset: 0x001F53A8
179 public static string GetFileName(string path, bool includeExtension = true)
180 {
181 if (!true)
182 {
183 }
184 Match match;
185 Group group;
186 if (match == null || group == null)
187 {
188 return "";
189 }
191 string value = group2.Value;
193 if (group3 != null)
194 {
196 return group4.Value;
197 }
198 return value + "";
199 }
200
201 // Token: 0x060030E1 RID: 12513 RVA: 0x001F71E4 File Offset: 0x001F53E4
202 public static string GetParentFolderPath(string path, bool includeExtension = true)
203 {
204 if (!true)
205 {
206 }
207 Match match;
208 Group group;
209 if (match != null && group != null)
210 {
212 return group2.Value;
213 }
214 return "";
215 }
216
217 // Token: 0x060030E2 RID: 12514 RVA: 0x001F7208 File Offset: 0x001F5408
218 // Note: this type is marked as 'beforefieldinit'.
220 {
221 }
222
223 // Token: 0x04003ACC RID: 15052
224 private static Regex FileNameRegex;
225 }
226}
class f__AnonymousType0<< Count > j__TPar
static void CreateDirectory(string path)
static void SetAttributes(string path, FileAttributes fileAttributes)
static Encoding ASCII
Definition Encoding.cs:348
static void Copy(string source, string destination, bool cloud=false, bool overwrite=true)
static bool MoveToCloud(string localPath, string cloudPath)
static string WildcardToRegex(string pattern)
static string[] GetFiles(string path, string searchPattern)
static string GetFileName(string path, bool includeExtension=true)
static string ReadAllText(string path)
static void Write(string path, byte[] data, int length, bool cloud)
static void Delete(string path, bool cloud=false)
static byte[] ReadAllBytes(string path, bool cloud=false)
static string GetParentFolderPath(string path, bool includeExtension=true)
static string CleanSwitchPath(string path)
static void WriteAllBytes(string path, byte[] data, bool cloud=false)
static void SetAttributes(string path, FileAttributes fileAttributes)
static void CreateDirectory(string path)
static string GetFullPath(string path, bool cloud)
static void WriteAllText(string path, string data)
static void Move(string source, string destination, bool cloud, bool overwrite=true)
static bool MoveToLocal(string cloudPath, string localPath)
static bool Exists(string path, bool cloud=false)