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
ReadObjectInfo.cs
Go to the documentation of this file.
1using System;
5
7{
8 // Token: 0x0200041A RID: 1050
9 internal sealed class ReadObjectInfo
10 {
11 // Token: 0x06002090 RID: 8336 RVA: 0x000480A0 File Offset: 0x000462A0
12 internal ReadObjectInfo()
13 {
14 }
15
16 // Token: 0x06002091 RID: 8337 RVA: 0x000480B4 File Offset: 0x000462B4
17 internal void ObjectEnd()
18 {
19 }
20
21 // Token: 0x06002092 RID: 8338 RVA: 0x000480C4 File Offset: 0x000462C4
22 internal void PrepareForReuse()
23 {
24 }
25
26 // Token: 0x06002093 RID: 8339 RVA: 0x000480D4 File Offset: 0x000462D4
37
38 // Token: 0x06002094 RID: 8340 RVA: 0x0004810C File Offset: 0x0004630C
49
50 // Token: 0x06002095 RID: 8341 RVA: 0x00048158 File Offset: 0x00046358
56
57 // Token: 0x06002096 RID: 8342 RVA: 0x00048168 File Offset: 0x00046368
59 {
62 this.wireMemberNames = memberNames;
63 this.wireMemberTypes = memberTypes;
66 if (memberNames != null)
67 {
68 this.isNamed = true;
69 }
70 if (memberTypes != null)
71 {
72 this.isTyped = true;
73 }
74 if (objectType != null)
75 {
77 return;
78 }
79 }
80
81 // Token: 0x06002097 RID: 8343 RVA: 0x000481CC File Offset: 0x000463CC
87
88 // Token: 0x06002098 RID: 8344 RVA: 0x0004821C File Offset: 0x0004641C
89 private void InitSiRead()
90 {
91 if (this.memberTypesList != null)
92 {
93 }
94 }
95
96 // Token: 0x06002099 RID: 8345 RVA: 0x00048234 File Offset: 0x00046434
97 private void InitNoMembers()
98 {
99 Type type = this.objectType;
100 }
101
102 // Token: 0x0600209A RID: 8346 RVA: 0x00048248 File Offset: 0x00046448
103 private void InitMemberInfo()
104 {
105 int num = 1;
106 Type type = this.objectType;
107 Type type2 = this.objectType;
110 if (num == 0)
111 {
112 }
114 MemberInfo[] memberInfos = this.cache.memberInfos;
116 int num2 = this.count;
118 int num3 = this.count;
121 string[] memberNames = serObjectInfoCache2.memberNames;
124 Type[] memberTypes = serObjectInfoCache3.memberTypes;
125 Type type3;
126 if (type3 == null || type3 != null)
127 {
128 return;
129 }
130 throw new ArrayTypeMismatchException();
131 }
132
133 // Token: 0x0600209B RID: 8347 RVA: 0x000482F4 File Offset: 0x000464F4
135 {
137 Type type;
138 if (serObjectInfoCache != null)
139 {
140 if (!this.isSi)
141 {
142 if (serObjectInfoCache.memberInfos != null)
143 {
144 int num = this.Position(name);
146 MemberInfo[] memberInfos = serObjectInfoCache2.memberInfos;
147 int num2 = this.Position(name);
148 bool hasTypeForwardedFrom = serObjectInfoCache2.hasTypeForwardedFrom;
149 }
150 else
151 {
152 if (type == null)
153 {
154 goto IL_0060;
155 }
156 throw new ArrayTypeMismatchException();
157 }
158 }
159 }
160 type = this.objectType;
161 if (type != null)
162 {
163 return "MemberInfo cannot be obtained for ISerialized Object '{0}'.";
164 }
165 IL_0060:
166 return "No MemberInfo for Object {0}.";
167 }
168
169 // Token: 0x0600209C RID: 8348 RVA: 0x0004836C File Offset: 0x0004656C
170 internal Type GetType(string name)
171 {
172 int num = this.Position(name);
173 if (this.isTyped)
174 {
175 Type[] memberTypes = this.cache.memberTypes;
176 if (num != 0)
177 {
178 goto IL_0029;
179 }
180 }
181 if (this.memberTypesList != null)
182 {
183 }
184 IL_0029:
185 if (this.objectType == null)
186 {
187 return "Types not available for ISerializable object '{0}'.";
188 }
189 throw new ArrayTypeMismatchException();
190 }
191
192 // Token: 0x0600209D RID: 8349 RVA: 0x000483B8 File Offset: 0x000465B8
193 internal void AddValue(string name, object value, SerializationInfo si, object[] memberData)
194 {
195 if (this.isSi)
196 {
197 return;
198 }
199 if (value == null || value != null)
200 {
201 return;
202 }
203 throw new ArrayTypeMismatchException();
204 }
205
206 // Token: 0x0600209E RID: 8350 RVA: 0x000483DC File Offset: 0x000465DC
207 internal void InitDataStore(SerializationInfo si, object[] memberData)
208 {
209 if (this.isSi)
210 {
211 Type type = this.objectType;
213 return;
214 }
215 }
216
217 // Token: 0x0600209F RID: 8351 RVA: 0x00048404 File Offset: 0x00046604
218 internal void RecordFixup(long objectId, string name, long idRef)
219 {
220 if (this.isSi)
221 {
223 return;
224 }
225 int num = this.Position(name);
228 MemberInfo[] memberInfos = serObjectInfoCache.memberInfos;
229 }
230
231 // Token: 0x060020A0 RID: 8352 RVA: 0x00048440 File Offset: 0x00046640
232 internal void PopulateObjectMembers(object obj, object[] memberData)
233 {
234 if (memberData != null && !this.isSi)
235 {
236 MemberInfo[] memberInfos = this.cache.memberInfos;
237 object obj2 = FormatterServices.PopulateObjectMembers(obj, memberInfos, memberData);
238 return;
239 }
240 }
241
242 // Token: 0x060020A1 RID: 8353 RVA: 0x00048474 File Offset: 0x00046674
243 private int Position(string name)
244 {
245 /*
246An exception occurred when decompiling this method (060020A1)
247
248ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Int32 System.Runtime.Serialization.Formatters.Binary.ReadObjectInfo::Position(System.String)
249
250 ---> System.Exception: Basic block has to end with unconditional control flow.
251{
252 IL_0052:
253 stfld:int32(ReadObjectInfo::lastPosition, ldloc:ReadObjectInfo(this), ldloc:int64[exp:int32](var_8))
254}
255
256 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
257 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
258 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
259 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
260 --- End of inner exception stack trace ---
261 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
262 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
263*/;
264 }
265
266 // Token: 0x060020A2 RID: 8354 RVA: 0x000484DC File Offset: 0x000466DC
268 {
269 bool flag = this.isSi;
270 if (flag)
271 {
272 throw new ArrayTypeMismatchException();
273 }
274 Type[] memberTypes;
275 if (!flag)
276 {
277 int num = this.count;
279 MemberInfo[] memberInfos = serObjectInfoCache.memberInfos;
280 memberTypes = serObjectInfoCache.memberTypes;
281 Type type;
282 if (type != null && type == null)
283 {
284 throw new ArrayTypeMismatchException();
285 }
286 }
290 bool hasTypeForwardedFrom = serObjectInfoCache2.hasTypeForwardedFrom;
292 if (this.cache.memberInfos == null)
293 {
294 }
295 if (memberTypes != null)
296 {
297 }
298 if (!this.bSimpleAssembly)
299 {
300 return memberTypes;
301 }
303 return memberTypes;
304 }
305
306 // Token: 0x060020A3 RID: 8355 RVA: 0x000485D8 File Offset: 0x000467D8
308 {
309 if (objMember != null)
310 {
311 }
312 Type type = objMember.GetType();
313 throw new ArrayTypeMismatchException();
314 }
315
316 // Token: 0x060020A4 RID: 8356 RVA: 0x000485F8 File Offset: 0x000467F8
318 {
319 int num = Interlocked.Increment(-1073741824);
320 return -1073741824;
321 }
322
323 // Token: 0x0400111D RID: 4381
324 internal int objectInfoId;
325
326 // Token: 0x0400111E RID: 4382
327 internal static int readObjectInfoCounter;
328
329 // Token: 0x0400111F RID: 4383
330 internal Type objectType;
331
332 // Token: 0x04001120 RID: 4384
334
335 // Token: 0x04001121 RID: 4385
336 internal int count;
337
338 // Token: 0x04001122 RID: 4386
339 internal bool isSi;
340
341 // Token: 0x04001123 RID: 4387
342 internal bool isNamed;
343
344 // Token: 0x04001124 RID: 4388
345 internal bool isTyped;
346
347 // Token: 0x04001125 RID: 4389
348 internal bool bSimpleAssembly;
349
350 // Token: 0x04001126 RID: 4390
352
353 // Token: 0x04001127 RID: 4391
354 internal string[] wireMemberNames;
355
356 // Token: 0x04001128 RID: 4392
358
359 // Token: 0x04001129 RID: 4393
360 private int lastPosition;
361
362 // Token: 0x0400112A RID: 4394
364
365 // Token: 0x0400112B RID: 4395
367
368 // Token: 0x0400112C RID: 4396
370
371 // Token: 0x0400112D RID: 4397
373
374 // Token: 0x0400112E RID: 4398
376 }
377}
class f__AnonymousType0<< Count > j__TPar
static object PopulateObjectMembers(object obj, MemberInfo[] members, object[] data)
static MemberInfo[] GetSerializableMembers(RuntimeType type)
void RecordFixup(long objectId, string name, long idRef)
void PopulateObjectMembers(object obj, object[] memberData)
static ReadObjectInfo Create(Type objectType, ISurrogateSelector surrogateSelector, StreamingContext context, ObjectManager objectManager, SerObjectInfoInit serObjectInfoInit, IFormatterConverter converter, bool bSimpleAssembly)
void AddValue(string name, object value, SerializationInfo si, object[] memberData)
Type[] GetMemberTypes(string[] inMemberNames, Type objectType)
void Init(Type objectType, string[] memberNames, Type[] memberTypes, ISurrogateSelector surrogateSelector, StreamingContext context, ObjectManager objectManager, SerObjectInfoInit serObjectInfoInit, IFormatterConverter converter, bool bSimpleAssembly)
static ReadObjectInfo GetObjectInfo(SerObjectInfoInit serObjectInfoInit)
void Init(Type objectType, ISurrogateSelector surrogateSelector, StreamingContext context, ObjectManager objectManager, SerObjectInfoInit serObjectInfoInit, IFormatterConverter converter, bool bSimpleAssembly)
static ReadObjectInfo Create(Type objectType, string[] memberNames, Type[] memberTypes, ISurrogateSelector surrogateSelector, StreamingContext context, ObjectManager objectManager, SerObjectInfoInit serObjectInfoInit, IFormatterConverter converter, bool bSimpleAssembly)
void InitReadConstructor(Type objectType, ISurrogateSelector surrogateSelector, StreamingContext context)
void InitDataStore(SerializationInfo si, object[] memberData)
static int Increment(int location)
bool IsArray
Definition Type.cs:356
new Type GetType()
Definition Type.cs:287
readonly StreamingContextStates m_state