Files
niko c12fbe3fc6 m
2026-04-12 16:51:38 +02:00

345 lines
12 KiB
C#

using System;
using System.Globalization;
using System.Text;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1
{
// Token: 0x02001E87 RID: 7815
[Token(Token = "0x2001E87")]
public class DerGeneralizedTime : Asn1Object
{
// Token: 0x0600C3F4 RID: 50164 RVA: 0x002C46C8 File Offset: 0x002C28C8
[Token(Token = "0x600C3F4")]
[Address(RVA = "0x23AA360", Offset = "0x23A9360", VA = "0x1823AA360")]
public static DerGeneralizedTime GetInstance(object obj)
{
/*
An exception occurred when decompiling this method (0600C3F4)
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: 0x0600C3F5 RID: 50165 RVA: 0x0000220F File Offset: 0x0000040F
[Token(Token = "0x600C3F5")]
[Address(RVA = "0x23AA4A0", Offset = "0x23A94A0", VA = "0x1823AA4A0")]
public static DerGeneralizedTime GetInstance(Asn1TaggedObject obj, bool isExplicit)
{
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
}
// Token: 0x0600C3F6 RID: 50166 RVA: 0x002C4708 File Offset: 0x002C2908
[Token(Token = "0x600C3F6")]
[Address(RVA = "0x23AAED0", Offset = "0x23A9ED0", VA = "0x1823AAED0")]
public DerGeneralizedTime(string time)
{
this.time = time;
DateTime dateTime = this.ToDateTime();
}
// Token: 0x0600C3F7 RID: 50167 RVA: 0x002C4738 File Offset: 0x002C2938
[Token(Token = "0x600C3F7")]
[Address(RVA = "0x23AAFD0", Offset = "0x23A9FD0", VA = "0x1823AAFD0")]
public DerGeneralizedTime(DateTime time)
{
string text;
this.time = text;
}
// Token: 0x0600C3F8 RID: 50168 RVA: 0x002C4754 File Offset: 0x002C2954
[Token(Token = "0x600C3F8")]
[Address(RVA = "0x23AAFA0", Offset = "0x23A9FA0", VA = "0x1823AAFA0")]
internal DerGeneralizedTime(byte[] bytes)
{
string text = Strings.FromAsciiByteArray(bytes);
this.time = text;
}
// Token: 0x17001E4D RID: 7757
// (get) Token: 0x0600C3F9 RID: 50169 RVA: 0x002C4778 File Offset: 0x002C2978
[Token(Token = "0x17001E4D")]
public string TimeString
{
[Token(Token = "0x600C3F9")]
[Address(RVA = "0x411530", Offset = "0x410530", VA = "0x180411530")]
get
{
return this.time;
}
}
// Token: 0x0600C3FA RID: 50170 RVA: 0x002C478C File Offset: 0x002C298C
[Token(Token = "0x600C3FA")]
[Address(RVA = "0x23AA730", Offset = "0x23A9730", VA = "0x1823AA730")]
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: 0x0600C3FB RID: 50171 RVA: 0x002C4900 File Offset: 0x002C2B00
[Token(Token = "0x600C3FB")]
[Address(RVA = "0x23A9E10", Offset = "0x23A8E10", VA = "0x1823A9E10")]
private string CalculateGmtOffset()
{
DateTime dateTime = this.ToDateTime();
string text = TimeZone.CurrentTimeZone.ToString();
TimeSpan zero = TimeSpan.Zero;
string[] array = new string[5];
if ("GMT" != 0)
{
}
array[0] = "GMT";
string text2;
if (text2 != 0)
{
}
array[1] = text2;
string text4;
string text3 = "0" + text4;
if (text3 != 0)
{
}
array[2] = text3;
if (":" != 0)
{
}
array[3] = ":";
string text6;
string text5 = "0" + text6;
if (text5 != 0)
{
}
array[4] = text5;
return string.Concat(array);
}
// Token: 0x0600C3FC RID: 50172 RVA: 0x002C49B4 File Offset: 0x002C2BB4
[Token(Token = "0x600C3FC")]
[Address(RVA = "0x23AA1D0", Offset = "0x23A91D0", VA = "0x1823AA1D0")]
private static string Convert(int time)
{
string text;
return text;
}
// Token: 0x0600C3FD RID: 50173 RVA: 0x002C49D0 File Offset: 0x002C2BD0
[Token(Token = "0x600C3FD")]
[Address(RVA = "0x23AAC70", Offset = "0x23A9C70", VA = "0x1823AAC70")]
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: 0x0600C3FE RID: 50174 RVA: 0x002C4AFC File Offset: 0x002C2CFC
[Token(Token = "0x600C3FE")]
[Address(RVA = "0x23AA2C0", Offset = "0x23A92C0", VA = "0x1823AA2C0")]
private string FString(int count)
{
StringBuilder stringBuilder = new StringBuilder();
int num = 0;
if (count > 0)
{
num++;
}
throw new NullReferenceException();
}
// Token: 0x0600C3FF RID: 50175 RVA: 0x002C4B20 File Offset: 0x002C2D20
[Token(Token = "0x600C3FF")]
[Address(RVA = "0x23AAAB0", Offset = "0x23A9AB0", VA = "0x1823AAAB0")]
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)
{
}
DateTime dateTime2;
return dateTime2;
}
// Token: 0x17001E4E RID: 7758
// (get) Token: 0x0600C400 RID: 50176 RVA: 0x002C4B74 File Offset: 0x002C2D74
[Token(Token = "0x17001E4E")]
private bool HasFractionalSeconds
{
[Token(Token = "0x600C400")]
[Address(RVA = "0x23AB020", Offset = "0x23AA020", VA = "0x1823AB020")]
get
{
string text = this.time;
int num;
return num == 14;
}
}
// Token: 0x0600C401 RID: 50177 RVA: 0x002C4B94 File Offset: 0x002C2D94
[Token(Token = "0x600C401")]
[Address(RVA = "0x23A9C50", Offset = "0x23A8C50", VA = "0x1823A9C50")]
private byte[] GetOctets()
{
return Strings.ToAsciiByteArray(this.time);
}
// Token: 0x0600C402 RID: 50178 RVA: 0x002C4BAC File Offset: 0x002C2DAC
[Token(Token = "0x600C402")]
[Address(RVA = "0x23AA240", Offset = "0x23A9240", VA = "0x1823AA240", Slot = "6")]
internal override void Encode(DerOutputStream derOut)
{
int length = Strings.ToAsciiByteArray(this.time).Length;
derOut.WriteLength(length);
int num = derOut.ReadByte();
}
// Token: 0x0600C403 RID: 50179 RVA: 0x002C4BE0 File Offset: 0x002C2DE0
[Token(Token = "0x600C403")]
[Address(RVA = "0x23A9D70", Offset = "0x23A8D70", VA = "0x1823A9D70", 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: 0x0600C404 RID: 50180 RVA: 0x002C4C08 File Offset: 0x002C2E08
[Token(Token = "0x600C404")]
[Address(RVA = "0x40F2B0", Offset = "0x40E2B0", VA = "0x18040F2B0", Slot = "8")]
protected override int Asn1GetHashCode()
{
object obj = ((ICloneable)this.time).Clone();
throw new NullReferenceException();
}
// Token: 0x04007B72 RID: 31602
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x4007B72")]
private readonly string time;
}
}