342 lines
12 KiB
C#
342 lines
12 KiB
C#
using System;
|
|
using System.Globalization;
|
|
using System.Runtime.InteropServices;
|
|
using System.Text;
|
|
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities;
|
|
using Cpp2IlInjected;
|
|
|
|
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1
|
|
{
|
|
// Token: 0x020017CA RID: 6090
|
|
[Token(Token = "0x20017CA")]
|
|
[StructLayout(3)]
|
|
public class DerGeneralizedTime : Asn1Object
|
|
{
|
|
// Token: 0x0600A44C RID: 42060 RVA: 0x002638D0 File Offset: 0x00261AD0
|
|
[Token(Token = "0x600A44C")]
|
|
[Address(RVA = "0x1ED3180", Offset = "0x1ED1B80", VA = "0x181ED3180")]
|
|
public static DerGeneralizedTime GetInstance(object obj)
|
|
{
|
|
/*
|
|
An exception occurred when decompiling this method (0600A44C)
|
|
|
|
ICSharpCode.Decompiler.DecompilerException: Error decompiling BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.DerGeneralizedTime BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.DerGeneralizedTime::GetInstance(System.Object)
|
|
|
|
---> System.Exception: Basic block has to end with unconditional control flow.
|
|
{
|
|
IL_16:
|
|
stloc:string(var_3_1C, call:string(Platform::GetTypeName, ldloc:object(obj)))
|
|
stloc:ArgumentException(var_4_32, newobj:ArgumentException(ArgumentException::.ctor, call:string(string::Concat, ldstr:string("illegal object in GetInstance: "), ldloc:string(var_3_1C)), ldstr:string("obj")))
|
|
}
|
|
|
|
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
|
|
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
|
|
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
|
|
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
|
|
--- End of inner exception stack trace ---
|
|
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
|
|
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 1663
|
|
*/;
|
|
}
|
|
|
|
// Token: 0x0600A44D RID: 42061 RVA: 0x0000220F File Offset: 0x0000040F
|
|
[Token(Token = "0x600A44D")]
|
|
[Address(RVA = "0x1ED32C0", Offset = "0x1ED1CC0", VA = "0x181ED32C0")]
|
|
public static DerGeneralizedTime GetInstance(Asn1TaggedObject obj, bool isExplicit)
|
|
{
|
|
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
|
|
}
|
|
|
|
// Token: 0x0600A44E RID: 42062 RVA: 0x00263910 File Offset: 0x00261B10
|
|
[Token(Token = "0x600A44E")]
|
|
[Address(RVA = "0x1ED3CF0", Offset = "0x1ED26F0", VA = "0x181ED3CF0")]
|
|
public DerGeneralizedTime(string time)
|
|
{
|
|
this.time = time;
|
|
DateTime dateTime = this.ToDateTime();
|
|
}
|
|
|
|
// Token: 0x0600A44F RID: 42063 RVA: 0x00263940 File Offset: 0x00261B40
|
|
[Token(Token = "0x600A44F")]
|
|
[Address(RVA = "0x1ED3DC0", Offset = "0x1ED27C0", VA = "0x181ED3DC0")]
|
|
public DerGeneralizedTime(DateTime time)
|
|
{
|
|
}
|
|
|
|
// Token: 0x0600A450 RID: 42064 RVA: 0x00263954 File Offset: 0x00261B54
|
|
[Token(Token = "0x600A450")]
|
|
[Address(RVA = "0x1DEB470", Offset = "0x1DE9E70", VA = "0x181DEB470")]
|
|
internal DerGeneralizedTime(byte[] bytes)
|
|
{
|
|
string text = Strings.FromAsciiByteArray(bytes);
|
|
this.time = text;
|
|
}
|
|
|
|
// Token: 0x170019AF RID: 6575
|
|
// (get) Token: 0x0600A451 RID: 42065 RVA: 0x00263978 File Offset: 0x00261B78
|
|
[Token(Token = "0x170019AF")]
|
|
public string TimeString
|
|
{
|
|
[Token(Token = "0x600A451")]
|
|
[Address(RVA = "0x3C39A0", Offset = "0x3C23A0", VA = "0x1803C39A0")]
|
|
get
|
|
{
|
|
return this.time;
|
|
}
|
|
}
|
|
|
|
// Token: 0x0600A452 RID: 42066 RVA: 0x0026398C File Offset: 0x00261B8C
|
|
[Token(Token = "0x600A452")]
|
|
[Address(RVA = "0x1ED3550", Offset = "0x1ED1F50", VA = "0x181ED3550")]
|
|
public string GetTime()
|
|
{
|
|
string text = this.time;
|
|
int num = text.m_stringLength;
|
|
char c = text[num];
|
|
string text2 = this.time;
|
|
int stringLength = text2.m_stringLength;
|
|
num = stringLength;
|
|
char c2 = text2[num];
|
|
uint num2;
|
|
if (num2 != (uint)c2)
|
|
{
|
|
string text3 = this.time;
|
|
int stringLength2 = text3.m_stringLength;
|
|
num = stringLength2;
|
|
char c3 = text3[num];
|
|
if (num2 != (uint)c3)
|
|
{
|
|
string text4 = this.time;
|
|
string text5 = this.CalculateGmtOffset();
|
|
return text4 + text5;
|
|
}
|
|
string text6 = this.time;
|
|
int num3 = 0;
|
|
string text7 = text6.Substring(num3, stringLength2);
|
|
string text8 = this.time.Substring(stringLength2);
|
|
string text9 = text7 + "GMT" + text8 + ":00";
|
|
}
|
|
string[] array = new string[5];
|
|
string text10 = this.time;
|
|
int num4 = 0;
|
|
string text11 = text10.Substring(num4, stringLength);
|
|
if (text11 != 0)
|
|
{
|
|
}
|
|
array[0] = text11;
|
|
if ("GMT" != 0)
|
|
{
|
|
}
|
|
array[1] = "GMT";
|
|
string text12 = this.time.Substring(stringLength, 3);
|
|
if (text12 != 0)
|
|
{
|
|
}
|
|
array[2] = text12;
|
|
if (":" != 0)
|
|
{
|
|
}
|
|
array[3] = ":";
|
|
string text13 = this.time;
|
|
string text14;
|
|
if (text14 != 0)
|
|
{
|
|
}
|
|
array[4] = text14;
|
|
string text15 = string.Concat(array);
|
|
int stringLength3 = text2.m_stringLength;
|
|
int num5 = 0;
|
|
string text16 = text2.Substring(num5, stringLength3);
|
|
throw new NullReferenceException();
|
|
}
|
|
|
|
// Token: 0x0600A453 RID: 42067 RVA: 0x00263B00 File Offset: 0x00261D00
|
|
[Token(Token = "0x600A453")]
|
|
[Address(RVA = "0x1ED2C30", Offset = "0x1ED1630", VA = "0x181ED2C30")]
|
|
private string CalculateGmtOffset()
|
|
{
|
|
DateTime dateTime = this.ToDateTime();
|
|
string standardName = TimeZone.CurrentTimeZone.StandardName;
|
|
string[] array = new string[5];
|
|
if ("GMT" != 0)
|
|
{
|
|
}
|
|
array[0] = "GMT";
|
|
if (array != 0)
|
|
{
|
|
}
|
|
array[1] = array;
|
|
int num;
|
|
string text = "0" + num;
|
|
if (text != 0)
|
|
{
|
|
}
|
|
array[2] = text;
|
|
if (":" != 0)
|
|
{
|
|
}
|
|
array[3] = ":";
|
|
int num2;
|
|
string text2 = "0" + num2;
|
|
if (text2 != 0)
|
|
{
|
|
}
|
|
array[4] = text2;
|
|
return string.Concat(array);
|
|
}
|
|
|
|
// Token: 0x0600A454 RID: 42068 RVA: 0x00263BAC File Offset: 0x00261DAC
|
|
[Token(Token = "0x600A454")]
|
|
[Address(RVA = "0x1ED2FF0", Offset = "0x1ED19F0", VA = "0x181ED2FF0")]
|
|
private static string Convert(int time)
|
|
{
|
|
string text;
|
|
return text;
|
|
}
|
|
|
|
// Token: 0x0600A455 RID: 42069 RVA: 0x00263BBC File Offset: 0x00261DBC
|
|
[Token(Token = "0x600A455")]
|
|
[Address(RVA = "0x1ED3A90", Offset = "0x1ED2490", VA = "0x181ED3A90")]
|
|
public DateTime ToDateTime()
|
|
{
|
|
int num = 0;
|
|
string text = this.time;
|
|
bool flag = Platform.EndsWith(text, "Z");
|
|
string text2 = this.time;
|
|
if (!flag)
|
|
{
|
|
uint num3;
|
|
int num2 = text2.IndexOf((char)num3);
|
|
uint num5;
|
|
int num4 = this.time.IndexOf((char)num5);
|
|
uint num6;
|
|
if (this.time.IndexOf((char)num6) != 14)
|
|
{
|
|
}
|
|
int num7 = text.m_stringLength;
|
|
uint num9;
|
|
int num8 = text.IndexOf((char)num9);
|
|
num7 -= num8;
|
|
int num10 = num7 - 1;
|
|
string text3 = this.FString(num10);
|
|
string text4 = "yyyyMMddHHmmss." + text3;
|
|
string text5 = this.GetTime();
|
|
uint num11;
|
|
if (this.time.IndexOf((char)num11) != 14)
|
|
{
|
|
}
|
|
num7 = Platform.IndexOf(text5, "GMT");
|
|
uint num13;
|
|
int num12 = text5.IndexOf((char)num13);
|
|
num7 -= num12;
|
|
int num14 = num7 - 1;
|
|
string text6 = this.FString(num14);
|
|
}
|
|
uint num15;
|
|
if (text2.IndexOf((char)num15) != 14)
|
|
{
|
|
}
|
|
int num16 = text.m_stringLength;
|
|
uint num18;
|
|
int num17 = text.IndexOf((char)num18);
|
|
num16 -= num17;
|
|
string text7 = this.FString((int)num18);
|
|
string text8 = "yyyyMMddHHmmss." + text7 + "\\Z";
|
|
return this.ParseDateString(text, text8, num != 0);
|
|
}
|
|
|
|
// Token: 0x0600A456 RID: 42070 RVA: 0x00263CE8 File Offset: 0x00261EE8
|
|
[Token(Token = "0x600A456")]
|
|
[Address(RVA = "0x1ED30E0", Offset = "0x1ED1AE0", VA = "0x181ED30E0")]
|
|
private string FString(int count)
|
|
{
|
|
StringBuilder stringBuilder = new StringBuilder();
|
|
int num = 0;
|
|
if (count > 0)
|
|
{
|
|
num++;
|
|
}
|
|
throw new NullReferenceException();
|
|
}
|
|
|
|
// Token: 0x0600A457 RID: 42071 RVA: 0x00263D0C File Offset: 0x00261F0C
|
|
[Token(Token = "0x600A457")]
|
|
[Address(RVA = "0x1ED38D0", Offset = "0x1ED22D0", VA = "0x181ED38D0")]
|
|
private DateTime ParseDateString(string s, string format, bool makeUniversal)
|
|
{
|
|
int num = 0;
|
|
if (Platform.EndsWith(format, "Z"))
|
|
{
|
|
Enum enumValue = Enums.GetEnumValue(typeof(DateTimeStyles), "AssumeUniversal");
|
|
}
|
|
DateTimeFormatInfo invariantInfo = DateTimeFormatInfo.InvariantInfo;
|
|
DateTime dateTime = DateTime.ParseExact(s, format, invariantInfo, (DateTimeStyles)num);
|
|
if (makeUniversal)
|
|
{
|
|
}
|
|
return dateTime;
|
|
}
|
|
|
|
// Token: 0x170019B0 RID: 6576
|
|
// (get) Token: 0x0600A458 RID: 42072 RVA: 0x00263D60 File Offset: 0x00261F60
|
|
[Token(Token = "0x170019B0")]
|
|
private bool HasFractionalSeconds
|
|
{
|
|
[Token(Token = "0x600A458")]
|
|
[Address(RVA = "0x1ED3E10", Offset = "0x1ED2810", VA = "0x181ED3E10")]
|
|
get
|
|
{
|
|
string text = this.time;
|
|
int num;
|
|
return num == 14;
|
|
}
|
|
}
|
|
|
|
// Token: 0x0600A459 RID: 42073 RVA: 0x00263D80 File Offset: 0x00261F80
|
|
[Token(Token = "0x600A459")]
|
|
[Address(RVA = "0x1DEB0E0", Offset = "0x1DE9AE0", VA = "0x181DEB0E0")]
|
|
private byte[] GetOctets()
|
|
{
|
|
return Strings.ToAsciiByteArray(this.time);
|
|
}
|
|
|
|
// Token: 0x0600A45A RID: 42074 RVA: 0x00263D98 File Offset: 0x00261F98
|
|
[Token(Token = "0x600A45A")]
|
|
[Address(RVA = "0x1ED3060", Offset = "0x1ED1A60", VA = "0x181ED3060", Slot = "6")]
|
|
internal override void Encode(DerOutputStream derOut)
|
|
{
|
|
int length = Strings.ToAsciiByteArray(this.time).Length;
|
|
derOut.WriteLength(length);
|
|
int num = derOut.ReadByte();
|
|
}
|
|
|
|
// Token: 0x0600A45B RID: 42075 RVA: 0x00263DCC File Offset: 0x00261FCC
|
|
[Token(Token = "0x600A45B")]
|
|
[Address(RVA = "0x1ED2B90", Offset = "0x1ED1590", VA = "0x181ED2B90", Slot = "7")]
|
|
protected override bool Asn1Equals(Asn1Object asn1Object)
|
|
{
|
|
if (asn1Object != 0 && asn1Object != 0)
|
|
{
|
|
string text = this.time;
|
|
bool flag;
|
|
return flag;
|
|
}
|
|
throw new NullReferenceException();
|
|
}
|
|
|
|
// Token: 0x0600A45C RID: 42076 RVA: 0x00263DF4 File Offset: 0x00261FF4
|
|
[Token(Token = "0x600A45C")]
|
|
[Address(RVA = "0x528AC0", Offset = "0x5274C0", VA = "0x180528AC0", Slot = "8")]
|
|
protected override int Asn1GetHashCode()
|
|
{
|
|
object obj = ((ICloneable)this.time).Clone();
|
|
throw new NullReferenceException();
|
|
}
|
|
|
|
// Token: 0x04006B76 RID: 27510
|
|
[global::Cpp2IlInjected.FieldOffset(Offset = "0x10")]
|
|
[Token(Token = "0x4006B76")]
|
|
private readonly string time;
|
|
}
|
|
}
|