m
This commit is contained in:
@@ -0,0 +1,481 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Text;
|
||||
using Cpp2IlInjected;
|
||||
|
||||
namespace BestHTTP.JSON
|
||||
{
|
||||
// Token: 0x0200205E RID: 8286
|
||||
[Token(Token = "0x200205E")]
|
||||
public class Json
|
||||
{
|
||||
// Token: 0x0600CFE6 RID: 53222 RVA: 0x002F44A0 File Offset: 0x002F26A0
|
||||
[Token(Token = "0x600CFE6")]
|
||||
[Address(RVA = "0x22A0A00", Offset = "0x229FA00", VA = "0x1822A0A00")]
|
||||
public static object Decode(string json)
|
||||
{
|
||||
if (json == 0)
|
||||
{
|
||||
}
|
||||
char[] array = json.ToCharArray();
|
||||
object obj;
|
||||
return obj;
|
||||
}
|
||||
|
||||
// Token: 0x0600CFE7 RID: 53223 RVA: 0x002F44BC File Offset: 0x002F26BC
|
||||
[Token(Token = "0x600CFE7")]
|
||||
[Address(RVA = "0x22A0A50", Offset = "0x229FA50", VA = "0x1822A0A50")]
|
||||
public static object Decode(string json, ref bool success)
|
||||
{
|
||||
if (json == 0)
|
||||
{
|
||||
}
|
||||
char[] array = json.ToCharArray();
|
||||
object obj;
|
||||
return obj;
|
||||
}
|
||||
|
||||
// Token: 0x0600CFE8 RID: 53224 RVA: 0x002F44D8 File Offset: 0x002F26D8
|
||||
[Token(Token = "0x600CFE8")]
|
||||
[Address(RVA = "0x22A0B30", Offset = "0x229FB30", VA = "0x1822A0B30")]
|
||||
public static string Encode(object json)
|
||||
{
|
||||
StringBuilder stringBuilder = new StringBuilder(2000);
|
||||
if (Json.SerializeValue(json, stringBuilder))
|
||||
{
|
||||
}
|
||||
throw new NullReferenceException();
|
||||
}
|
||||
|
||||
// Token: 0x0600CFE9 RID: 53225 RVA: 0x002F4504 File Offset: 0x002F2704
|
||||
[Token(Token = "0x600CFE9")]
|
||||
[Address(RVA = "0x22A1260", Offset = "0x22A0260", VA = "0x1822A1260")]
|
||||
protected static Dictionary<string, object> ParseObject(char[] json, ref int index, ref bool success)
|
||||
{
|
||||
Dictionary<string, object> dictionary = new Dictionary();
|
||||
int num = Json.NextToken(json, ref index);
|
||||
int num2;
|
||||
if (num2 != 0)
|
||||
{
|
||||
if (num2 != 6)
|
||||
{
|
||||
if (num2 == 2)
|
||||
{
|
||||
goto IL_49;
|
||||
}
|
||||
string text = Json.ParseString(json, ref index, ref success);
|
||||
if (Json.NextToken(json, ref index) != 5)
|
||||
{
|
||||
goto IL_52;
|
||||
}
|
||||
object obj = Json.ParseValue(json, ref index, ref success);
|
||||
dictionary[text] = obj;
|
||||
}
|
||||
int num3 = Json.NextToken(json, ref index);
|
||||
IL_49:
|
||||
int num4 = Json.NextToken(json, ref index);
|
||||
}
|
||||
IL_52:
|
||||
throw new NullReferenceException();
|
||||
}
|
||||
|
||||
// Token: 0x0600CFEA RID: 53226 RVA: 0x002F456C File Offset: 0x002F276C
|
||||
[Token(Token = "0x600CFEA")]
|
||||
[Address(RVA = "0x22A0FF0", Offset = "0x229FFF0", VA = "0x1822A0FF0")]
|
||||
protected static List<object> ParseArray(char[] json, ref int index, ref bool success)
|
||||
{
|
||||
List<object> list = new List();
|
||||
int num = Json.NextToken(json, ref index);
|
||||
int num2;
|
||||
if (num2 != 0)
|
||||
{
|
||||
while (num2 == 6)
|
||||
{
|
||||
}
|
||||
if (num2 != 4)
|
||||
{
|
||||
object obj = Json.ParseValue(json, ref index, ref success);
|
||||
list.Add(obj);
|
||||
}
|
||||
}
|
||||
throw new NullReferenceException();
|
||||
}
|
||||
|
||||
// Token: 0x0600CFEB RID: 53227 RVA: 0x002F45AC File Offset: 0x002F27AC
|
||||
[Token(Token = "0x600CFEB")]
|
||||
[Address(RVA = "0x22A16B0", Offset = "0x22A06B0", VA = "0x1822A16B0")]
|
||||
protected static object ParseValue(char[] json, ref int index, ref bool success)
|
||||
{
|
||||
int num;
|
||||
if (num <= 11)
|
||||
{
|
||||
Dictionary<string, object> dictionary = new Dictionary();
|
||||
int num2 = Json.NextToken(json, ref index);
|
||||
int num3;
|
||||
if (num3 != 0)
|
||||
{
|
||||
while (num3 == 6)
|
||||
{
|
||||
}
|
||||
if (num3 != 2)
|
||||
{
|
||||
string text = Json.ParseString(json, ref index, ref success);
|
||||
if (Json.NextToken(json, ref index) == 5)
|
||||
{
|
||||
object obj = Json.ParseValue(json, ref index, ref success);
|
||||
dictionary[text] = obj;
|
||||
}
|
||||
}
|
||||
}
|
||||
int num4 = 0;
|
||||
success.m_value = num4 != 0;
|
||||
List<object> list = new List();
|
||||
int num5 = Json.NextToken(json, ref index);
|
||||
int num6;
|
||||
if (num6 != 0)
|
||||
{
|
||||
while (num6 == 6)
|
||||
{
|
||||
}
|
||||
if (num6 != 4)
|
||||
{
|
||||
object obj2 = Json.ParseValue(json, ref index, ref success);
|
||||
list.Add(obj2);
|
||||
}
|
||||
}
|
||||
string text2 = Json.ParseString(json, ref index, ref success);
|
||||
Json.EatWhitespace(json, ref index);
|
||||
int length = json.Length;
|
||||
int num7;
|
||||
if (num7 != -1)
|
||||
{
|
||||
}
|
||||
CultureInfo invariantCulture = CultureInfo.InvariantCulture;
|
||||
bool flag;
|
||||
success.m_value = flag;
|
||||
}
|
||||
throw new NullReferenceException();
|
||||
}
|
||||
|
||||
// Token: 0x0600CFEC RID: 53228 RVA: 0x002F4680 File Offset: 0x002F2880
|
||||
[Token(Token = "0x600CFEC")]
|
||||
[Address(RVA = "0x22A1390", Offset = "0x22A0390", VA = "0x1822A1390")]
|
||||
protected static string ParseString(char[] json, ref int index, ref bool success)
|
||||
{
|
||||
int num = 0;
|
||||
uint num2;
|
||||
StringBuilder stringBuilder = new StringBuilder((int)num2);
|
||||
Json.EatWhitespace(json, ref index);
|
||||
index.m_value = stringBuilder;
|
||||
index.m_value = stringBuilder;
|
||||
int length = json.Length;
|
||||
if (stringBuilder != length)
|
||||
{
|
||||
index.m_value = length;
|
||||
int num3 = json.Length;
|
||||
num3 -= length;
|
||||
CultureInfo invariantCulture = CultureInfo.InvariantCulture;
|
||||
bool flag;
|
||||
success.m_value = flag;
|
||||
if (flag)
|
||||
{
|
||||
string text = char.ConvertFromUtf32(num);
|
||||
StringBuilder stringBuilder2 = stringBuilder.Append(text);
|
||||
}
|
||||
return "";
|
||||
}
|
||||
success.m_value = num != 0;
|
||||
throw new IndexOutOfRangeException();
|
||||
}
|
||||
|
||||
// Token: 0x0600CFED RID: 53229 RVA: 0x002F4718 File Offset: 0x002F2918
|
||||
[Token(Token = "0x600CFED")]
|
||||
[Address(RVA = "0x22A10F0", Offset = "0x22A00F0", VA = "0x1822A10F0")]
|
||||
protected static double ParseNumber(char[] json, ref int index, ref bool success)
|
||||
{
|
||||
Json.EatWhitespace(json, ref index);
|
||||
int length = json.Length;
|
||||
int num;
|
||||
if (num != -1)
|
||||
{
|
||||
}
|
||||
CultureInfo invariantCulture = CultureInfo.InvariantCulture;
|
||||
bool flag;
|
||||
success.m_value = flag;
|
||||
throw new NullReferenceException();
|
||||
}
|
||||
|
||||
// Token: 0x0600CFEE RID: 53230 RVA: 0x002F4754 File Offset: 0x002F2954
|
||||
[Token(Token = "0x600CFEE")]
|
||||
[Address(RVA = "0x22A0BC0", Offset = "0x229FBC0", VA = "0x1822A0BC0")]
|
||||
protected static int GetLastIndexOfNumber(char[] json, int index)
|
||||
{
|
||||
int length = json.Length;
|
||||
if (index < length)
|
||||
{
|
||||
char c = json[index];
|
||||
int num;
|
||||
if (num != -1)
|
||||
{
|
||||
}
|
||||
}
|
||||
return index - 1;
|
||||
}
|
||||
|
||||
// Token: 0x0600CFEF RID: 53231 RVA: 0x002F4784 File Offset: 0x002F2984
|
||||
[Token(Token = "0x600CFEF")]
|
||||
[Address(RVA = "0x22A0AA0", Offset = "0x229FAA0", VA = "0x1822A0AA0")]
|
||||
protected static void EatWhitespace(char[] json, ref int index)
|
||||
{
|
||||
int length = json.Length;
|
||||
int num;
|
||||
if (num != -1)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x0600CFF0 RID: 53232 RVA: 0x002F47A4 File Offset: 0x002F29A4
|
||||
[Token(Token = "0x600CFF0")]
|
||||
[Address(RVA = "0x22A0C50", Offset = "0x229FC50", VA = "0x1822A0C50")]
|
||||
protected static int LookAhead(char[] json, int index)
|
||||
{
|
||||
return Json.NextToken(json, index);
|
||||
}
|
||||
|
||||
// Token: 0x0600CFF1 RID: 53233 RVA: 0x002F47B8 File Offset: 0x002F29B8
|
||||
[Token(Token = "0x600CFF1")]
|
||||
[Address(RVA = "0x22A0C70", Offset = "0x229FC70", VA = "0x1822A0C70")]
|
||||
protected static int NextToken(char[] json, ref int index)
|
||||
{
|
||||
Json.EatWhitespace(json, ref index);
|
||||
char c;
|
||||
index.m_value = (int)c;
|
||||
uint num;
|
||||
index.m_value = (int)num;
|
||||
uint num2;
|
||||
index.m_value = (int)num2;
|
||||
uint num3;
|
||||
index.m_value = (int)num3;
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Token: 0x0600CFF2 RID: 53234 RVA: 0x002F47F4 File Offset: 0x002F29F4
|
||||
[Token(Token = "0x600CFF2")]
|
||||
[Address(RVA = "0x22A20B0", Offset = "0x22A10B0", VA = "0x1822A20B0")]
|
||||
protected static bool SerializeValue(object value, StringBuilder builder)
|
||||
{
|
||||
for (;;)
|
||||
{
|
||||
int num = 0;
|
||||
if (value == 0 || value == 0 || value != 0)
|
||||
{
|
||||
if (value != 0)
|
||||
{
|
||||
if (value != 0)
|
||||
{
|
||||
StringBuilder stringBuilder = builder.Append("true");
|
||||
}
|
||||
if (value != 0)
|
||||
{
|
||||
StringBuilder stringBuilder2 = builder.Append("false");
|
||||
}
|
||||
}
|
||||
if (value != 0)
|
||||
{
|
||||
}
|
||||
StringBuilder stringBuilder3 = builder.Append("null");
|
||||
double num2 = Convert.ToDouble(value);
|
||||
CultureInfo invariantCulture = CultureInfo.InvariantCulture;
|
||||
string text = Convert.ToString(num2, invariantCulture);
|
||||
StringBuilder stringBuilder4 = builder.Append("[");
|
||||
if (num < stringBuilder4)
|
||||
{
|
||||
if ((ulong)1L == 0UL)
|
||||
{
|
||||
StringBuilder stringBuilder5 = builder.Append(", ");
|
||||
}
|
||||
if (!Json.SerializeValue(stringBuilder4, builder))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
num++;
|
||||
}
|
||||
if (value != 0)
|
||||
{
|
||||
}
|
||||
StringBuilder stringBuilder6 = builder.Append("{");
|
||||
if (stringBuilder6 == 0)
|
||||
{
|
||||
break;
|
||||
}
|
||||
int hashCode = stringBuilder6.GetHashCode();
|
||||
if ((ulong)1L == 0UL)
|
||||
{
|
||||
StringBuilder stringBuilder7 = builder.Append(", ");
|
||||
}
|
||||
StringBuilder stringBuilder8 = builder.Append(":");
|
||||
if (Json.SerializeValue(hashCode, builder))
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
StringBuilder stringBuilder9 = builder.Append("}");
|
||||
return true;
|
||||
}
|
||||
|
||||
// Token: 0x0600CFF3 RID: 53235 RVA: 0x002F48F0 File Offset: 0x002F2AF0
|
||||
[Token(Token = "0x600CFF3")]
|
||||
[Address(RVA = "0x22A1CA0", Offset = "0x22A0CA0", VA = "0x1822A1CA0")]
|
||||
protected static bool SerializeObject(IDictionary anObject, StringBuilder builder)
|
||||
{
|
||||
StringBuilder stringBuilder = builder.Append("{");
|
||||
if (stringBuilder != 0)
|
||||
{
|
||||
int hashCode = stringBuilder.GetHashCode();
|
||||
if ((ulong)1L == 0UL)
|
||||
{
|
||||
StringBuilder stringBuilder2 = builder.Append(", ");
|
||||
}
|
||||
StringBuilder stringBuilder3 = builder.Append(":");
|
||||
if (Json.SerializeValue(hashCode, builder))
|
||||
{
|
||||
}
|
||||
}
|
||||
StringBuilder stringBuilder4 = builder.Append("}");
|
||||
throw new NullReferenceException();
|
||||
}
|
||||
|
||||
// Token: 0x0600CFF4 RID: 53236 RVA: 0x002F4954 File Offset: 0x002F2B54
|
||||
[Token(Token = "0x600CFF4")]
|
||||
[Address(RVA = "0x22A1AE0", Offset = "0x22A0AE0", VA = "0x1822A1AE0")]
|
||||
protected static bool SerializeArray(IList anArray, StringBuilder builder)
|
||||
{
|
||||
StringBuilder stringBuilder = builder.Append("[");
|
||||
int num = 0;
|
||||
if (num < stringBuilder)
|
||||
{
|
||||
if ((ulong)1L == 0UL)
|
||||
{
|
||||
StringBuilder stringBuilder2 = builder.Append(", ");
|
||||
}
|
||||
if (Json.SerializeValue(stringBuilder, builder))
|
||||
{
|
||||
num++;
|
||||
}
|
||||
}
|
||||
StringBuilder stringBuilder3 = builder.Append("]");
|
||||
throw new NullReferenceException();
|
||||
}
|
||||
|
||||
// Token: 0x0600CFF5 RID: 53237 RVA: 0x002F49A8 File Offset: 0x002F2BA8
|
||||
[Token(Token = "0x600CFF5")]
|
||||
[Address(RVA = "0x22A1E10", Offset = "0x22A0E10", VA = "0x1822A1E10")]
|
||||
protected static bool SerializeString(string aString, StringBuilder builder)
|
||||
{
|
||||
StringBuilder stringBuilder = builder.Append("\"");
|
||||
char[] array = aString.ToCharArray();
|
||||
int num = 0;
|
||||
int length = array.Length;
|
||||
if (num < length)
|
||||
{
|
||||
char c = array[num];
|
||||
string text = Convert.ToString((int)Convert.ToChar((ushort)c), 16);
|
||||
string text3;
|
||||
string text2 = "\\u" + text3;
|
||||
StringBuilder stringBuilder2 = builder.Append(text2);
|
||||
num++;
|
||||
StringBuilder stringBuilder3 = builder.Append(c);
|
||||
num++;
|
||||
StringBuilder stringBuilder4 = builder.Append("\\t");
|
||||
num++;
|
||||
StringBuilder stringBuilder5 = builder.Append("\\r");
|
||||
num++;
|
||||
StringBuilder stringBuilder6 = builder.Append("\\n");
|
||||
num++;
|
||||
StringBuilder stringBuilder7 = builder.Append("\\f");
|
||||
num++;
|
||||
StringBuilder stringBuilder8 = builder.Append("\\b");
|
||||
num++;
|
||||
StringBuilder stringBuilder9 = builder.Append("\\\\");
|
||||
num++;
|
||||
StringBuilder stringBuilder10 = builder.Append("\\\"");
|
||||
num++;
|
||||
}
|
||||
StringBuilder stringBuilder11 = builder.Append("\"");
|
||||
return true;
|
||||
}
|
||||
|
||||
// Token: 0x0600CFF6 RID: 53238 RVA: 0x002F4AA8 File Offset: 0x002F2CA8
|
||||
[Token(Token = "0x600CFF6")]
|
||||
[Address(RVA = "0x22A1BF0", Offset = "0x22A0BF0", VA = "0x1822A1BF0")]
|
||||
protected static bool SerializeNumber(double number, StringBuilder builder)
|
||||
{
|
||||
CultureInfo invariantCulture = CultureInfo.InvariantCulture;
|
||||
string text = Convert.ToString(number, invariantCulture);
|
||||
StringBuilder stringBuilder = builder.Append(text);
|
||||
return true;
|
||||
}
|
||||
|
||||
// Token: 0x0600CFF7 RID: 53239 RVA: 0x002F4AD4 File Offset: 0x002F2CD4
|
||||
[Token(Token = "0x600CFF7")]
|
||||
[Address(RVA = "0x412370", Offset = "0x411370", VA = "0x180412370")]
|
||||
public Json()
|
||||
{
|
||||
}
|
||||
|
||||
// Token: 0x040083D6 RID: 33750
|
||||
[Token(Token = "0x40083D6")]
|
||||
private const int TOKEN_NONE = 0;
|
||||
|
||||
// Token: 0x040083D7 RID: 33751
|
||||
[Token(Token = "0x40083D7")]
|
||||
private const int TOKEN_CURLY_OPEN = 1;
|
||||
|
||||
// Token: 0x040083D8 RID: 33752
|
||||
[Token(Token = "0x40083D8")]
|
||||
private const int TOKEN_CURLY_CLOSE = 2;
|
||||
|
||||
// Token: 0x040083D9 RID: 33753
|
||||
[Token(Token = "0x40083D9")]
|
||||
private const int TOKEN_SQUARED_OPEN = 3;
|
||||
|
||||
// Token: 0x040083DA RID: 33754
|
||||
[Token(Token = "0x40083DA")]
|
||||
private const int TOKEN_SQUARED_CLOSE = 4;
|
||||
|
||||
// Token: 0x040083DB RID: 33755
|
||||
[Token(Token = "0x40083DB")]
|
||||
private const int TOKEN_COLON = 5;
|
||||
|
||||
// Token: 0x040083DC RID: 33756
|
||||
[Token(Token = "0x40083DC")]
|
||||
private const int TOKEN_COMMA = 6;
|
||||
|
||||
// Token: 0x040083DD RID: 33757
|
||||
[Token(Token = "0x40083DD")]
|
||||
private const int TOKEN_STRING = 7;
|
||||
|
||||
// Token: 0x040083DE RID: 33758
|
||||
[Token(Token = "0x40083DE")]
|
||||
private const int TOKEN_NUMBER = 8;
|
||||
|
||||
// Token: 0x040083DF RID: 33759
|
||||
[Token(Token = "0x40083DF")]
|
||||
private const int TOKEN_TRUE = 9;
|
||||
|
||||
// Token: 0x040083E0 RID: 33760
|
||||
[Token(Token = "0x40083E0")]
|
||||
private const int TOKEN_FALSE = 10;
|
||||
|
||||
// Token: 0x040083E1 RID: 33761
|
||||
[Token(Token = "0x40083E1")]
|
||||
private const int TOKEN_NULL = 11;
|
||||
|
||||
// Token: 0x040083E2 RID: 33762
|
||||
[Token(Token = "0x40083E2")]
|
||||
private const int BUILDER_CAPACITY = 2000;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user