Files
niko 8fc35183db a
2026-04-11 22:19:20 +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: 0x02001DA7 RID: 7591
[Token(Token = "0x2001DA7")]
public class DerGeneralizedTime : Asn1Object
{
// Token: 0x0600C026 RID: 49190 RVA: 0x002BBDD0 File Offset: 0x002B9FD0
[Token(Token = "0x600C026")]
[Address(RVA = "0x187BEC0", Offset = "0x187ACC0", VA = "0x18187BEC0")]
public static DerGeneralizedTime GetInstance(object obj)
{
/*
An exception occurred when decompiling this method (0600C026)
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 1660
*/;
}
// Token: 0x0600C027 RID: 49191 RVA: 0x0000220F File Offset: 0x0000040F
[Token(Token = "0x600C027")]
[Address(RVA = "0x187C000", Offset = "0x187AE00", VA = "0x18187C000")]
public static DerGeneralizedTime GetInstance(Asn1TaggedObject obj, bool isExplicit)
{
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
}
// Token: 0x0600C028 RID: 49192 RVA: 0x002BBE10 File Offset: 0x002BA010
[Token(Token = "0x600C028")]
[Address(RVA = "0x187CA30", Offset = "0x187B830", VA = "0x18187CA30")]
public DerGeneralizedTime(string time)
{
this.time = time;
DateTime dateTime = this.ToDateTime();
}
// Token: 0x0600C029 RID: 49193 RVA: 0x002BBE40 File Offset: 0x002BA040
[Token(Token = "0x600C029")]
[Address(RVA = "0x187CB30", Offset = "0x187B930", VA = "0x18187CB30")]
public DerGeneralizedTime(DateTime time)
{
string text;
this.time = text;
}
// Token: 0x0600C02A RID: 49194 RVA: 0x002BBE5C File Offset: 0x002BA05C
[Token(Token = "0x600C02A")]
[Address(RVA = "0x187CB00", Offset = "0x187B900", VA = "0x18187CB00")]
internal DerGeneralizedTime(byte[] bytes)
{
string text = Strings.FromAsciiByteArray(bytes);
this.time = text;
}
// Token: 0x17001DB0 RID: 7600
// (get) Token: 0x0600C02B RID: 49195 RVA: 0x002BBE80 File Offset: 0x002BA080
[Token(Token = "0x17001DB0")]
public string TimeString
{
[Token(Token = "0x600C02B")]
[Address(RVA = "0x3F6E20", Offset = "0x3F5C20", VA = "0x1803F6E20")]
get
{
return this.time;
}
}
// Token: 0x0600C02C RID: 49196 RVA: 0x002BBE94 File Offset: 0x002BA094
[Token(Token = "0x600C02C")]
[Address(RVA = "0x187C290", Offset = "0x187B090", VA = "0x18187C290")]
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: 0x0600C02D RID: 49197 RVA: 0x002BC008 File Offset: 0x002BA208
[Token(Token = "0x600C02D")]
[Address(RVA = "0x187B970", Offset = "0x187A770", VA = "0x18187B970")]
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: 0x0600C02E RID: 49198 RVA: 0x002BC0BC File Offset: 0x002BA2BC
[Token(Token = "0x600C02E")]
[Address(RVA = "0x187BD30", Offset = "0x187AB30", VA = "0x18187BD30")]
private static string Convert(int time)
{
string text;
return text;
}
// Token: 0x0600C02F RID: 49199 RVA: 0x002BC0D8 File Offset: 0x002BA2D8
[Token(Token = "0x600C02F")]
[Address(RVA = "0x187C7D0", Offset = "0x187B5D0", VA = "0x18187C7D0")]
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: 0x0600C030 RID: 49200 RVA: 0x002BC204 File Offset: 0x002BA404
[Token(Token = "0x600C030")]
[Address(RVA = "0x187BE20", Offset = "0x187AC20", VA = "0x18187BE20")]
private string FString(int count)
{
StringBuilder stringBuilder = new StringBuilder();
int num = 0;
if (count > 0)
{
num++;
}
throw new NullReferenceException();
}
// Token: 0x0600C031 RID: 49201 RVA: 0x002BC228 File Offset: 0x002BA428
[Token(Token = "0x600C031")]
[Address(RVA = "0x187C610", Offset = "0x187B410", VA = "0x18187C610")]
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: 0x17001DB1 RID: 7601
// (get) Token: 0x0600C032 RID: 49202 RVA: 0x002BC27C File Offset: 0x002BA47C
[Token(Token = "0x17001DB1")]
private bool HasFractionalSeconds
{
[Token(Token = "0x600C032")]
[Address(RVA = "0x187CB80", Offset = "0x187B980", VA = "0x18187CB80")]
get
{
string text = this.time;
int num;
return num == 14;
}
}
// Token: 0x0600C033 RID: 49203 RVA: 0x002BC29C File Offset: 0x002BA49C
[Token(Token = "0x600C033")]
[Address(RVA = "0x187B7B0", Offset = "0x187A5B0", VA = "0x18187B7B0")]
private byte[] GetOctets()
{
return Strings.ToAsciiByteArray(this.time);
}
// Token: 0x0600C034 RID: 49204 RVA: 0x002BC2B4 File Offset: 0x002BA4B4
[Token(Token = "0x600C034")]
[Address(RVA = "0x187BDA0", Offset = "0x187ABA0", VA = "0x18187BDA0", Slot = "6")]
internal override void Encode(DerOutputStream derOut)
{
int length = Strings.ToAsciiByteArray(this.time).Length;
derOut.WriteLength(length);
int num = derOut.ReadByte();
}
// Token: 0x0600C035 RID: 49205 RVA: 0x002BC2E8 File Offset: 0x002BA4E8
[Token(Token = "0x600C035")]
[Address(RVA = "0x187B8D0", Offset = "0x187A6D0", VA = "0x18187B8D0", 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: 0x0600C036 RID: 49206 RVA: 0x002BC310 File Offset: 0x002BA510
[Token(Token = "0x600C036")]
[Address(RVA = "0x4DA700", Offset = "0x4D9500", VA = "0x1804DA700", Slot = "8")]
protected override int Asn1GetHashCode()
{
object obj = ((ICloneable)this.time).Clone();
throw new NullReferenceException();
}
// Token: 0x040079B9 RID: 31161
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x40079B9")]
private readonly string time;
}
}