289 lines
13 KiB
C#
289 lines
13 KiB
C#
using System;
|
|
using System.Collections;
|
|
using System.IO;
|
|
using System.Runtime.InteropServices;
|
|
using Cpp2IlInjected;
|
|
|
|
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1
|
|
{
|
|
// Token: 0x02001796 RID: 6038
|
|
[Token(Token = "0x2001796")]
|
|
[StructLayout(3)]
|
|
public class Asn1StreamParser
|
|
{
|
|
// Token: 0x0600A300 RID: 41728 RVA: 0x0025F740 File Offset: 0x0025D940
|
|
[Token(Token = "0x600A300")]
|
|
[Address(RVA = "0x267AC40", Offset = "0x2679640", VA = "0x18267AC40")]
|
|
public Asn1StreamParser(Stream inStream)
|
|
{
|
|
int num = Asn1InputStream.FindLimit(inStream);
|
|
}
|
|
|
|
// Token: 0x0600A301 RID: 41729 RVA: 0x0025F754 File Offset: 0x0025D954
|
|
[Token(Token = "0x600A301")]
|
|
[Address(RVA = "0x267AAF0", Offset = "0x26794F0", VA = "0x18267AAF0")]
|
|
public Asn1StreamParser(Stream inStream, int limit)
|
|
{
|
|
inStream.Dispose();
|
|
this._in = inStream;
|
|
this._limit = limit;
|
|
byte[][] array = new byte[16][];
|
|
this.tmpBuffers = array;
|
|
}
|
|
|
|
// Token: 0x0600A302 RID: 41730 RVA: 0x0025F7A0 File Offset: 0x0025D9A0
|
|
[Token(Token = "0x600A302")]
|
|
[Address(RVA = "0x267ABC0", Offset = "0x26795C0", VA = "0x18267ABC0")]
|
|
public Asn1StreamParser(byte[] encoding)
|
|
{
|
|
int num;
|
|
MemoryStream memoryStream = new MemoryStream(encoding, num != 0);
|
|
num = 0;
|
|
int length = encoding.Length;
|
|
}
|
|
|
|
// Token: 0x0600A303 RID: 41731 RVA: 0x0025F7C4 File Offset: 0x0025D9C4
|
|
[Token(Token = "0x600A303")]
|
|
[Address(RVA = "0x2679D80", Offset = "0x2678780", VA = "0x182679D80")]
|
|
internal IAsn1Convertible ReadIndef(int tagValue)
|
|
{
|
|
/*
|
|
An exception occurred when decompiling this method (0600A303)
|
|
|
|
ICSharpCode.Decompiler.DecompilerException: Error decompiling BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.IAsn1Convertible BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Asn1StreamParser::ReadIndef(System.Int32)
|
|
|
|
---> System.Exception: Basic block has to end with unconditional control flow.
|
|
{
|
|
Block_0:
|
|
stfld:Asn1StreamParser(BerOctetStringParser::_parser, ldloc:BerOctetStringParser(var_0), ldloc:Asn1StreamParser(this))
|
|
stloc:DerExternalParser(var_1_0D, newobj:DerExternalParser(DerExternalParser::.ctor, ldloc:Asn1StreamParser(this)))
|
|
stloc:Asn1Exception(var_2_22, newobj:Asn1Exception(Asn1Exception::.ctor, call:string(string::Concat, ldstr:string("unknown BER object encountered: 0x"), ldstr:string("X"))))
|
|
}
|
|
|
|
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: 0x0600A304 RID: 41732 RVA: 0x0025F7F4 File Offset: 0x0025D9F4
|
|
[Token(Token = "0x600A304")]
|
|
[Address(RVA = "0x2679B40", Offset = "0x2678540", VA = "0x182679B40")]
|
|
internal IAsn1Convertible ReadImplicit(bool constructed, int tag)
|
|
{
|
|
/*
|
|
An exception occurred when decompiling this method (0600A304)
|
|
|
|
ICSharpCode.Decompiler.DecompilerException: Error decompiling BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.IAsn1Convertible BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Asn1StreamParser::ReadImplicit(System.Boolean,System.Int32)
|
|
|
|
---> System.Exception: Basic block has to end with unconditional control flow.
|
|
{
|
|
IL_79:
|
|
stloc:Asn1Exception(var_10_83, newobj:Asn1Exception(Asn1Exception::.ctor, ldstr:string("implicit tagging not implemented")))
|
|
}
|
|
|
|
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: 0x0600A305 RID: 41733 RVA: 0x0025F888 File Offset: 0x0025DA88
|
|
[Token(Token = "0x600A305")]
|
|
[Address(RVA = "0x267A460", Offset = "0x2678E60", VA = "0x18267A460")]
|
|
internal Asn1Object ReadTaggedObject(bool constructed, int tag)
|
|
{
|
|
Stream in2;
|
|
do
|
|
{
|
|
if (constructed)
|
|
{
|
|
Asn1EncodableVector asn1EncodableVector = this.ReadVector();
|
|
Stream @in = this._in;
|
|
if (@in != 0 && @in != 0)
|
|
{
|
|
IList v = asn1EncodableVector.v;
|
|
if (@in == (ulong)1L)
|
|
{
|
|
int num = 0;
|
|
Asn1Encodable asn1Encodable = asn1EncodableVector[num];
|
|
BerTaggedObject berTaggedObject = new BerTaggedObject(true, tag, asn1Encodable);
|
|
}
|
|
IList v2 = asn1EncodableVector.v;
|
|
if (@in < (ulong)1L)
|
|
{
|
|
}
|
|
BerSequence berSequence = new BerSequence(asn1EncodableVector);
|
|
}
|
|
IList v3 = asn1EncodableVector.v;
|
|
if (asn1EncodableVector == (ulong)1L)
|
|
{
|
|
int num2 = 0;
|
|
Asn1Encodable asn1Encodable2 = asn1EncodableVector[num2];
|
|
}
|
|
DerSequence derSequence = DerSequence.FromVector(asn1EncodableVector);
|
|
}
|
|
in2 = this._in;
|
|
}
|
|
while (in2 == 0);
|
|
byte[] array;
|
|
DerOctetString derOctetString = new DerOctetString(array);
|
|
int num3;
|
|
DerTaggedObject derTaggedObject = new DerTaggedObject(num3 != 0, tag, derOctetString);
|
|
num3 = 0;
|
|
throw new NullReferenceException();
|
|
}
|
|
|
|
// Token: 0x0600A306 RID: 41734 RVA: 0x0025F94C File Offset: 0x0025DB4C
|
|
[Token(Token = "0x600A306")]
|
|
[Address(RVA = "0x2679E90", Offset = "0x2678890", VA = "0x182679E90", Slot = "4")]
|
|
public virtual IAsn1Convertible ReadObject()
|
|
{
|
|
int num;
|
|
int num2;
|
|
int num8;
|
|
for (;;)
|
|
{
|
|
Stream @in = this._in;
|
|
if (num == -1)
|
|
{
|
|
goto IL_164;
|
|
}
|
|
Stream in2 = this._in;
|
|
if (in2 == 0 || in2 == 0 || (in2 != 0 && in2 != 0))
|
|
{
|
|
num2 = Asn1InputStream.ReadTagNumber(in2, num);
|
|
int num3 = 0;
|
|
int limit = this._limit;
|
|
int num4 = Asn1InputStream.ReadLength(this._in, limit);
|
|
DefiniteLengthInputStream definiteLengthInputStream = new DefiniteLengthInputStream(this._in, num3);
|
|
if (num == 64)
|
|
{
|
|
if (num == 0)
|
|
{
|
|
if (num2 != 4)
|
|
{
|
|
byte[][] array = this.tmpBuffers;
|
|
Asn1Object asn1Object = Asn1InputStream.CreatePrimitiveDerObject(num2, definiteLengthInputStream, array);
|
|
}
|
|
DerOctetStringParser derOctetStringParser = new DerOctetStringParser(definiteLengthInputStream);
|
|
}
|
|
if (num2 > 8)
|
|
{
|
|
if (num2 == 16)
|
|
{
|
|
int num5 = Asn1InputStream.FindLimit(definiteLengthInputStream);
|
|
Asn1StreamParser asn1StreamParser;
|
|
DerSequenceParser derSequenceParser = new DerSequenceParser(asn1StreamParser);
|
|
}
|
|
if (num2 != 17)
|
|
{
|
|
continue;
|
|
}
|
|
int num6 = Asn1InputStream.FindLimit(definiteLengthInputStream);
|
|
Asn1StreamParser asn1StreamParser2;
|
|
DerSetParser derSetParser = new DerSetParser(asn1StreamParser2);
|
|
}
|
|
int num7;
|
|
if (num2 == 4)
|
|
{
|
|
num7 = Asn1InputStream.FindLimit(definiteLengthInputStream);
|
|
BerOctetStringParser berOctetStringParser;
|
|
Asn1StreamParser asn1StreamParser3;
|
|
berOctetStringParser._parser = asn1StreamParser3;
|
|
}
|
|
if (num2 != 8)
|
|
{
|
|
continue;
|
|
}
|
|
num7 = Asn1InputStream.FindLimit(definiteLengthInputStream);
|
|
Asn1StreamParser asn1StreamParser4;
|
|
DerExternalParser derExternalParser = new DerExternalParser(asn1StreamParser4);
|
|
num8 = Asn1InputStream.FindLimit(definiteLengthInputStream);
|
|
num8 = num2;
|
|
}
|
|
int num9 = 0;
|
|
byte[] array2 = definiteLengthInputStream.ToArray();
|
|
DerApplicationSpecific derApplicationSpecific = new DerApplicationSpecific(num9 != 0, num8, array2);
|
|
num8 = num2;
|
|
if (derApplicationSpecific != 0)
|
|
{
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
Asn1StreamParser asn1StreamParser5 = new Asn1StreamParser(new IndefiniteLengthInputStream(this._in, num8), num8);
|
|
if (num == 64)
|
|
{
|
|
IAsn1Convertible asn1Convertible = asn1StreamParser5.ReadIndef(num2);
|
|
}
|
|
BerApplicationSpecificParser berApplicationSpecificParser;
|
|
berApplicationSpecificParser.tag = num2;
|
|
berApplicationSpecificParser.parser = asn1StreamParser5;
|
|
IL_164:
|
|
throw new NullReferenceException();
|
|
}
|
|
|
|
// Token: 0x0600A307 RID: 41735 RVA: 0x0025FAC4 File Offset: 0x0025DCC4
|
|
[Token(Token = "0x600A307")]
|
|
[Address(RVA = "0x267A9D0", Offset = "0x26793D0", VA = "0x18267A9D0")]
|
|
private void Set00Check(bool enabled)
|
|
{
|
|
Stream @in;
|
|
do
|
|
{
|
|
@in = this._in;
|
|
}
|
|
while (@in != 0 && @in != 0 && (@in == 0 || @in == 0));
|
|
}
|
|
|
|
// Token: 0x0600A308 RID: 41736 RVA: 0x0025FAF4 File Offset: 0x0025DCF4
|
|
[Token(Token = "0x600A308")]
|
|
[Address(RVA = "0x267A800", Offset = "0x2679200", VA = "0x18267A800")]
|
|
internal Asn1EncodableVector ReadVector()
|
|
{
|
|
Asn1EncodableVector asn1EncodableVector;
|
|
while (asn1EncodableVector != 0)
|
|
{
|
|
int num = 0;
|
|
Asn1Encodable[] array = new Asn1Encodable[1];
|
|
num += num;
|
|
num++;
|
|
if (array != 0)
|
|
{
|
|
}
|
|
array[0] = array;
|
|
asn1EncodableVector.Add(array);
|
|
if (this.ToString() == 0)
|
|
{
|
|
break;
|
|
}
|
|
}
|
|
return asn1EncodableVector;
|
|
}
|
|
|
|
// Token: 0x04006B11 RID: 27409
|
|
[global::Cpp2IlInjected.FieldOffset(Offset = "0x10")]
|
|
[Token(Token = "0x4006B11")]
|
|
private readonly Stream _in;
|
|
|
|
// Token: 0x04006B12 RID: 27410
|
|
[global::Cpp2IlInjected.FieldOffset(Offset = "0x18")]
|
|
[Token(Token = "0x4006B12")]
|
|
private readonly int _limit;
|
|
|
|
// Token: 0x04006B13 RID: 27411
|
|
[global::Cpp2IlInjected.FieldOffset(Offset = "0x20")]
|
|
[Token(Token = "0x4006B13")]
|
|
private readonly byte[][] tmpBuffers;
|
|
}
|
|
}
|