Files
Jan2021-Cpp2Il-Dump/Assembly-CSharp/BestHTTP/SecureProtocol/Org/BouncyCastle/Asn1/DerBitString.cs
T
2026-04-08 23:40:05 +02:00

341 lines
14 KiB
C#

using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Text;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Math;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1
{
// Token: 0x020017C6 RID: 6086
[Token(Token = "0x20017C6")]
[StructLayout(3)]
public class DerBitString : DerStringBase
{
// Token: 0x0600A41D RID: 42013 RVA: 0x0026300C File Offset: 0x0026120C
[Token(Token = "0x600A41D")]
[Address(RVA = "0x1ECF310", Offset = "0x1ECDD10", VA = "0x181ECF310")]
public static DerBitString GetInstance(object obj)
{
if (obj != 0 && obj == 0)
{
if (obj == 0)
{
goto IL_1C;
}
if (obj == 0)
{
goto IL_35;
}
}
if (obj == 0 || obj != 0)
{
}
IL_1C:
string typeName = Platform.GetTypeName(obj);
ArgumentException ex = new ArgumentException("illegal object in GetInstance: " + typeName);
IL_35:
throw new NullReferenceException();
}
// Token: 0x0600A41E RID: 42014 RVA: 0x0000220F File Offset: 0x0000040F
[Token(Token = "0x600A41E")]
[Address(RVA = "0x1ECF520", Offset = "0x1ECDF20", VA = "0x181ECF520")]
public static DerBitString GetInstance(Asn1TaggedObject obj, bool isExplicit)
{
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
}
// Token: 0x0600A41F RID: 42015 RVA: 0x0026305C File Offset: 0x0026125C
[Token(Token = "0x600A41F")]
[Address(RVA = "0x1ECF950", Offset = "0x1ECE350", VA = "0x181ECF950")]
public DerBitString(byte[] data, int padBits)
{
/*
An exception occurred when decompiling this method (0600A41F)
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.DerBitString::.ctor(System.Byte[],System.Int32)
---> System.Exception: Basic block has to end with unconditional control flow.
{
IL_3C:
stloc:ArgumentException(var_2_4B, newobj:ArgumentException(ArgumentException::.ctor, ldstr:string("must be in the range 0 to 7"), ldstr:string("padBits")))
}
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: 0x0600A420 RID: 42016 RVA: 0x002630B4 File Offset: 0x002612B4
[Token(Token = "0x600A420")]
[Address(RVA = "0x1ECFA80", Offset = "0x1ECE480", VA = "0x181ECFA80")]
public DerBitString(byte[] data)
{
}
// Token: 0x0600A421 RID: 42017 RVA: 0x002630C4 File Offset: 0x002612C4
[Token(Token = "0x600A421")]
[Address(RVA = "0x1ECFAD0", Offset = "0x1ECE4D0", VA = "0x181ECFAD0")]
public DerBitString(int namedBits)
{
if (namedBits != 0)
{
int num = 0;
int num2 = BigInteger.BitLen(namedBits);
num2 += 7;
num2 += num;
byte[] array = new byte[num2];
int num3 = 0;
if (num2 - 1 > 0)
{
num3++;
}
int num4 = num2 - 1;
if (namedBits == 1)
{
num3++;
uint num5;
while (namedBits == (int)num5)
{
}
}
this.mData = array;
this.mPadBits = num3;
return;
}
byte[] array2 = new byte[0];
int num6 = 0;
this.mPadBits = num6;
this.mData = array2;
}
// Token: 0x0600A422 RID: 42018 RVA: 0x00263144 File Offset: 0x00261344
[Token(Token = "0x600A422")]
[Address(RVA = "0x1ECFA90", Offset = "0x1ECE490", VA = "0x181ECFA90")]
public DerBitString(Asn1Encodable obj)
{
byte[] derEncoded = obj.GetDerEncoded();
}
// Token: 0x0600A423 RID: 42019 RVA: 0x00263160 File Offset: 0x00261360
[Token(Token = "0x600A423")]
[Address(RVA = "0x1ECF6B0", Offset = "0x1ECE0B0", VA = "0x181ECF6B0", Slot = "11")]
public virtual byte[] GetOctets()
{
/*
An exception occurred when decompiling this method (0600A423)
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Byte[] BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.DerBitString::GetOctets()
---> System.Exception: Basic block has to end with unconditional control flow.
{
IL_15:
stloc:InvalidOperationException(var_0_1F, newobj:InvalidOperationException(InvalidOperationException::.ctor, ldstr:string("attempt to get non-octet aligned data from BIT STRING")))
}
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.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1878
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1878
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1846
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: 0x0600A424 RID: 42020 RVA: 0x0026318C File Offset: 0x0026138C
[Token(Token = "0x600A424")]
[Address(RVA = "0x1ECF260", Offset = "0x1ECDC60", VA = "0x181ECF260", Slot = "12")]
public virtual byte[] GetBytes()
{
byte[] array = Arrays.Clone(this.mData);
int num = this.mPadBits;
if (num > 0)
{
int length = array.Length;
int num2 = length - 1;
}
return array;
}
// Token: 0x170019AB RID: 6571
// (get) Token: 0x0600A425 RID: 42021 RVA: 0x002631C4 File Offset: 0x002613C4
[Token(Token = "0x170019AB")]
public virtual int PadBits
{
[Token(Token = "0x600A425")]
[Address(RVA = "0x3EE8D0", Offset = "0x3ED2D0", VA = "0x1803EE8D0", Slot = "13")]
get
{
return this.mPadBits;
}
}
// Token: 0x170019AC RID: 6572
// (get) Token: 0x0600A426 RID: 42022 RVA: 0x002631D8 File Offset: 0x002613D8
[Token(Token = "0x170019AC")]
public virtual int IntValue
{
[Token(Token = "0x600A426")]
[Address(RVA = "0x1ECFC30", Offset = "0x1ECE630", VA = "0x181ECFC30", Slot = "14")]
get
{
byte[] array = this.mData;
int num = 0;
int length = array.Length;
int num2 = Math.Min(4, length);
if (num2 > 0)
{
byte[] array2 = this.mData;
num++;
num += 8;
}
if (this.mPadBits > 0)
{
byte[] array3 = this.mData;
if (num2 == array3.Length)
{
}
}
return num;
}
}
// Token: 0x0600A427 RID: 42023 RVA: 0x00263234 File Offset: 0x00261434
[Token(Token = "0x600A427")]
[Address(RVA = "0x1ECEE90", Offset = "0x1ECD890", VA = "0x181ECEE90", Slot = "6")]
internal override void Encode(DerOutputStream derOut)
{
int num = this.mPadBits;
if (num > 0)
{
byte[] array = this.mData;
int length = array.Length;
int num2 = length - 1;
num2 = num;
if (num2 != length)
{
byte[] array2 = Arrays.Prepend(array, (byte)num);
int num3 = array2.Length - 1;
int length2 = array2.Length;
derOut.WriteLength(length2);
int num4 = derOut.ReadByte();
return;
}
}
int num5 = this.mData.Length;
num5++;
if (num5 != 0)
{
uint num6;
num6 += (uint)1;
while (num5 != 0)
{
}
}
throw new NullReferenceException();
}
// Token: 0x0600A428 RID: 42024 RVA: 0x002632C0 File Offset: 0x002614C0
[Token(Token = "0x600A428")]
[Address(RVA = "0x1ECEE10", Offset = "0x1ECD810", VA = "0x181ECEE10", Slot = "8")]
protected override int Asn1GetHashCode()
{
int num = this.mPadBits;
return Arrays.GetHashCode(this.mData);
}
// Token: 0x0600A429 RID: 42025 RVA: 0x002632E0 File Offset: 0x002614E0
[Token(Token = "0x600A429")]
[Address(RVA = "0x1ECED40", Offset = "0x1ECD740", VA = "0x181ECED40", Slot = "7")]
protected override bool Asn1Equals(Asn1Object asn1Object)
{
if (asn1Object == 0)
{
return;
}
int num = 0;
if (asn1Object != 0 && this.mPadBits == num)
{
byte[] array = this.mData;
bool flag;
return flag;
}
}
// Token: 0x0600A42A RID: 42026 RVA: 0x0026330C File Offset: 0x0026150C
[Token(Token = "0x600A42A")]
[Address(RVA = "0x1ECF740", Offset = "0x1ECE140", VA = "0x181ECF740", Slot = "10")]
public override string GetString()
{
StringBuilder stringBuilder = new StringBuilder("#");
byte[] derEncoded = base.GetDerEncoded();
int num = 0;
int length = derEncoded.Length;
if (num != length)
{
byte b;
char c = DerBitString.table[(int)b];
StringBuilder stringBuilder2 = stringBuilder.Append(c);
char[] array = DerBitString.table;
char c2;
StringBuilder stringBuilder3 = stringBuilder.Append(c2);
num++;
}
throw new NullReferenceException();
}
// Token: 0x0600A42B RID: 42027 RVA: 0x0026336C File Offset: 0x0026156C
[Token(Token = "0x600A42B")]
[Address(RVA = "0x1ECF0E0", Offset = "0x1ECDAE0", VA = "0x181ECF0E0")]
internal static DerBitString FromAsn1Octets(byte[] octets)
{
int length = octets.Length;
byte b = octets[0];
int length2 = octets.Length;
byte[] array = Arrays.CopyOfRange(octets, 1, length2);
if (array.Length != 0)
{
BerBitString berBitString = new BerBitString(array, (int)b);
}
DerBitString derBitString = new DerBitString(array, (int)b);
throw new NullReferenceException();
}
// Token: 0x0600A42C RID: 42028 RVA: 0x002633B8 File Offset: 0x002615B8
// Note: this type is marked as 'beforefieldinit'.
[Token(Token = "0x600A42C")]
[Address(RVA = "0x1ECF8F0", Offset = "0x1ECE2F0", VA = "0x181ECF8F0")]
static DerBitString()
{
char[] array = new char[16];
RuntimeHelpers.InitializeArray(array, fieldof(<PrivateImplementationDetails>.59F5BD34B6C013DEACC784F69C67E95150033A84).FieldHandle);
DerBitString.table = array;
}
// Token: 0x04006B6D RID: 27501
[Token(Token = "0x4006B6D")]
private static readonly char[] table;
// Token: 0x04006B6E RID: 27502
[global::Cpp2IlInjected.FieldOffset(Offset = "0x10")]
[Token(Token = "0x4006B6E")]
protected readonly byte[] mData;
// Token: 0x04006B6F RID: 27503
[global::Cpp2IlInjected.FieldOffset(Offset = "0x18")]
[Token(Token = "0x4006B6F")]
protected readonly int mPadBits;
}
}