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
Bootstring.cs
Go to the documentation of this file.
1using System;
3
5{
6 // Token: 0x020005C4 RID: 1476
7 internal class Bootstring
8 {
9 // Token: 0x06002D2E RID: 11566 RVA: 0x0006403C File Offset: 0x0006223C
10 public Bootstring(char delimiter, int baseNum, int tmin, int tmax, int skew, int damp, int initialBias, int initialN)
11 {
19 }
20
21 // Token: 0x06002D2F RID: 11567 RVA: 0x00064084 File Offset: 0x00062284
22 public string Encode(string s, int offset)
23 {
24 int num = this.initial_bias;
25 int stringLength = s._stringLength;
26 long num2 = 0L;
27 char c = s[(int)num2];
28 char c2 = s[(int)num2];
29 int stringLength2 = s._stringLength;
30 char c3 = this.delimiter;
31 int stringLength3 = s._stringLength;
32 long num3 = 0L;
33 char c4 = s[(int)num3];
34 char c5 = s[(int)num3];
35 char c6 = s[(int)num3];
36 int stringLength4 = s._stringLength;
37 long num4 = 0L;
38 char c7 = s[(int)num4];
39 int num5 = this.base_num;
40 int num6 = this.tmin;
41 int num7 = this.tmax;
42 int num8 = this.base_num;
43 int stringLength5 = s._stringLength;
44 throw new OverflowException();
45 }
46
47 // Token: 0x06002D30 RID: 11568 RVA: 0x0000207A File Offset: 0x0000027A
48 private char EncodeDigit(int d)
49 {
50 throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
51 }
52
53 // Token: 0x06002D31 RID: 11569 RVA: 0x00064134 File Offset: 0x00062334
54 private int DecodeDigit(char c)
55 {
56 return this.base_num;
57 }
58
59 // Token: 0x06002D32 RID: 11570 RVA: 0x0006414C File Offset: 0x0006234C
60 private int Adapt(int delta, int numPoints, bool firstTime)
61 {
62 /*
63An exception occurred when decompiling this method (06002D32)
64
65ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Int32 System.Globalization.Bootstring::Adapt(System.Int32,System.Int32,System.Boolean)
66
67 ---> System.Exception: Basic block has to end with unconditional control flow.
68{
69 Block_0:
70 stloc:int32(var_0_06, ldfld:int32(Bootstring::damp, ldloc:Bootstring(this)))
71 stloc:int32(var_2_0F, ldfld:int32(Bootstring::base_num, ldloc:Bootstring(this)))
72 stloc:int32(var_3_16, ldfld:int32(Bootstring::tmax, ldloc:Bootstring(this)))
73 stloc:int32(var_4_1D, ldfld:int32(Bootstring::tmax, ldloc:Bootstring(this)))
74 stloc:int32(var_5_25, ldfld:int32(Bootstring::skew, ldloc:Bootstring(this)))
75}
76
77 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
78 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
79 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
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 88
81 --- End of inner exception stack trace ---
82 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
83 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
84*/;
85 }
86
87 // Token: 0x06002D33 RID: 11571 RVA: 0x00064180 File Offset: 0x00062380
88 public string Decode(string s, int offset)
89 {
90 int num = this.initial_bias;
91 int stringLength = s._stringLength;
92 long num2 = 0L;
93 long num3 = 0L;
94 char c = s[(int)num3];
95 char c2 = this.delimiter;
96 int stringLength2 = s._stringLength;
97 long num4;
98 if (num2 != 0L)
99 {
100 num4 = 0L;
101 }
102 int stringLength3 = s._stringLength;
103 int num5 = this.base_num;
104 long num6 = 0L;
105 int num7 = this.base_num;
106 int num8 = this.tmin;
107 int num9 = this.tmax;
108 int num10 = this.base_num;
109 long num11 = 0L;
110 int num12 = this.Adapt((int)num11, (int)num6, num4 != 0L);
111 int stringLength4 = s._stringLength;
112 return s;
113 }
114
115 // Token: 0x0400193B RID: 6459
116 private readonly char delimiter;
117
118 // Token: 0x0400193C RID: 6460
119 private readonly int base_num;
120
121 // Token: 0x0400193D RID: 6461
122 private readonly int tmin;
123
124 // Token: 0x0400193E RID: 6462
125 private readonly int tmax;
126
127 // Token: 0x0400193F RID: 6463
128 private readonly int skew;
129
130 // Token: 0x04001940 RID: 6464
131 private readonly int damp;
132
133 // Token: 0x04001941 RID: 6465
135
136 // Token: 0x04001942 RID: 6466
137 private readonly int initial_n;
138 }
139}
class f__AnonymousType0<< Count > j__TPar
Bootstring(char delimiter, int baseNum, int tmin, int tmax, int skew, int damp, int initialBias, int initialN)
Definition Bootstring.cs:10
string Decode(string s, int offset)
Definition Bootstring.cs:88
string Encode(string s, int offset)
Definition Bootstring.cs:22
int Adapt(int delta, int numPoints, bool firstTime)
Definition Bootstring.cs:60