211 lines
8.3 KiB
C#
211 lines
8.3 KiB
C#
using System;
|
|
using System.IO;
|
|
using Cpp2IlInjected;
|
|
|
|
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls
|
|
{
|
|
// Token: 0x02001BDF RID: 7135
|
|
[Token(Token = "0x2001BDF")]
|
|
public class ByteQueue
|
|
{
|
|
// Token: 0x0600AFB1 RID: 44977 RVA: 0x0025F8C4 File Offset: 0x0025DAC4
|
|
[Token(Token = "0x600AFB1")]
|
|
[Address(RVA = "0x232ED80", Offset = "0x232DD80", VA = "0x18232ED80")]
|
|
public static int NextTwoPow(int i)
|
|
{
|
|
return i;
|
|
}
|
|
|
|
// Token: 0x0600AFB2 RID: 44978 RVA: 0x0025F8D4 File Offset: 0x0025DAD4
|
|
[Token(Token = "0x600AFB2")]
|
|
[Address(RVA = "0x232F580", Offset = "0x232E580", VA = "0x18232F580")]
|
|
public ByteQueue()
|
|
{
|
|
byte[] array = new byte[1024];
|
|
this.databuf = array;
|
|
}
|
|
|
|
// Token: 0x0600AFB3 RID: 44979 RVA: 0x0025F900 File Offset: 0x0025DB00
|
|
[Token(Token = "0x600AFB3")]
|
|
[Address(RVA = "0x232F4E0", Offset = "0x232E4E0", VA = "0x18232F4E0")]
|
|
public ByteQueue(int capacity)
|
|
{
|
|
if (capacity == 0)
|
|
{
|
|
}
|
|
byte[] array = new byte[capacity];
|
|
this.databuf = array;
|
|
}
|
|
|
|
// Token: 0x0600AFB4 RID: 44980 RVA: 0x0025F92C File Offset: 0x0025DB2C
|
|
[Token(Token = "0x600AFB4")]
|
|
[Address(RVA = "0x232F5E0", Offset = "0x232E5E0", VA = "0x18232F5E0")]
|
|
public ByteQueue(byte[] buf, int off, int len)
|
|
{
|
|
this.databuf = buf;
|
|
this.available = len;
|
|
this.skipped = off;
|
|
this.readOnlyBuf = true;
|
|
}
|
|
|
|
// Token: 0x0600AFB5 RID: 44981 RVA: 0x0025F95C File Offset: 0x0025DB5C
|
|
[Token(Token = "0x600AFB5")]
|
|
[Address(RVA = "0x232EA70", Offset = "0x232DA70", VA = "0x18232EA70")]
|
|
public void AddData(byte[] data, int offset, int len)
|
|
{
|
|
/*
|
|
An exception occurred when decompiling this method (0600AFB5)
|
|
|
|
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls.ByteQueue::AddData(System.Byte[],System.Int32,System.Int32)
|
|
|
|
---> System.Exception: Basic block has to end with unconditional control flow.
|
|
{
|
|
IL_85:
|
|
stloc:InvalidOperationException(var_11_8F, newobj:InvalidOperationException(InvalidOperationException::.ctor, ldstr:string("Cannot add data to read-only buffer")))
|
|
}
|
|
|
|
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: 0x17001BE2 RID: 7138
|
|
// (get) Token: 0x0600AFB6 RID: 44982 RVA: 0x0025F9FC File Offset: 0x0025DBFC
|
|
[Token(Token = "0x17001BE2")]
|
|
public int Available
|
|
{
|
|
[Token(Token = "0x600AFB6")]
|
|
[Address(RVA = "0x497590", Offset = "0x496590", VA = "0x180497590")]
|
|
get
|
|
{
|
|
return this.available;
|
|
}
|
|
}
|
|
|
|
// Token: 0x0600AFB7 RID: 44983 RVA: 0x0025FA10 File Offset: 0x0025DC10
|
|
[Token(Token = "0x600AFB7")]
|
|
[Address(RVA = "0x232EBE0", Offset = "0x232DBE0", VA = "0x18232EBE0")]
|
|
public void CopyTo(Stream output, int length)
|
|
{
|
|
int num = output.ReadByte();
|
|
}
|
|
|
|
// Token: 0x0600AFB8 RID: 44984 RVA: 0x0025FA88 File Offset: 0x0025DC88
|
|
[Token(Token = "0x600AFB8")]
|
|
[Address(RVA = "0x232EF70", Offset = "0x232DF70", VA = "0x18232EF70")]
|
|
public void Read(byte[] buf, int offset, int len, int skip)
|
|
{
|
|
int num = buf.Length;
|
|
num -= offset;
|
|
int num2 = this.available;
|
|
int num3 = this.skipped;
|
|
byte[] array = this.databuf;
|
|
}
|
|
|
|
// Token: 0x0600AFB9 RID: 44985 RVA: 0x0025FABC File Offset: 0x0025DCBC
|
|
[Token(Token = "0x600AFB9")]
|
|
[Address(RVA = "0x232EDB0", Offset = "0x232DDB0", VA = "0x18232EDB0")]
|
|
public MemoryStream ReadFrom(int length)
|
|
{
|
|
int num = this.available;
|
|
int num2 = this.skipped;
|
|
num -= length;
|
|
byte[] array = this.databuf;
|
|
this.available = num;
|
|
this.skipped = num;
|
|
ulong num3;
|
|
return new MemoryStream(array, num2, length, num3 != 0UL);
|
|
}
|
|
|
|
// Token: 0x0600AFBA RID: 44986 RVA: 0x0025FB58 File Offset: 0x0025DD58
|
|
[Token(Token = "0x600AFBA")]
|
|
[Address(RVA = "0x232F1D0", Offset = "0x232E1D0", VA = "0x18232F1D0")]
|
|
public void RemoveData(int i)
|
|
{
|
|
int num = this.available;
|
|
num -= i;
|
|
this.available = num;
|
|
}
|
|
|
|
// Token: 0x0600AFBB RID: 44987 RVA: 0x0025FBD4 File Offset: 0x0025DDD4
|
|
[Token(Token = "0x600AFBB")]
|
|
[Address(RVA = "0x232F180", Offset = "0x232E180", VA = "0x18232F180")]
|
|
public void RemoveData(byte[] buf, int off, int len, int skip)
|
|
{
|
|
}
|
|
|
|
// Token: 0x0600AFBC RID: 44988 RVA: 0x0025FBE4 File Offset: 0x0025DDE4
|
|
[Token(Token = "0x600AFBC")]
|
|
[Address(RVA = "0x232F340", Offset = "0x232E340", VA = "0x18232F340")]
|
|
public byte[] RemoveData(int len, int skip)
|
|
{
|
|
byte[] array = new byte[len];
|
|
int num = 0;
|
|
this.Read(array, num, len, skip);
|
|
return array;
|
|
}
|
|
|
|
// Token: 0x0600AFBD RID: 44989 RVA: 0x0025FC08 File Offset: 0x0025DE08
|
|
[Token(Token = "0x600AFBD")]
|
|
[Address(RVA = "0x232F3D0", Offset = "0x232E3D0", VA = "0x18232F3D0")]
|
|
public void Shrink()
|
|
{
|
|
int num = this.available;
|
|
if (num != 0)
|
|
{
|
|
byte[] array = this.databuf;
|
|
num++;
|
|
if (num < array.Length)
|
|
{
|
|
byte[] array2 = new byte[num];
|
|
int num2 = this.available;
|
|
int num3 = 0;
|
|
int num4 = this.skipped;
|
|
Array.Copy(this.databuf, num4, array2, num3, num2);
|
|
this.databuf = array2;
|
|
this.skipped = (int)((ulong)0L);
|
|
return;
|
|
}
|
|
}
|
|
else
|
|
{
|
|
byte[] emptyBytes = TlsUtilities.EmptyBytes;
|
|
this.databuf = emptyBytes;
|
|
this.skipped = (int)((ulong)0L);
|
|
}
|
|
}
|
|
|
|
// Token: 0x04006EB9 RID: 28345
|
|
[Token(Token = "0x4006EB9")]
|
|
private const int DefaultCapacity = 1024;
|
|
|
|
// Token: 0x04006EBA RID: 28346
|
|
[FieldOffset(Offset = "0x10")]
|
|
[Token(Token = "0x4006EBA")]
|
|
private byte[] databuf;
|
|
|
|
// Token: 0x04006EBB RID: 28347
|
|
[FieldOffset(Offset = "0x18")]
|
|
[Token(Token = "0x4006EBB")]
|
|
private int skipped;
|
|
|
|
// Token: 0x04006EBC RID: 28348
|
|
[FieldOffset(Offset = "0x1C")]
|
|
[Token(Token = "0x4006EBC")]
|
|
private int available;
|
|
|
|
// Token: 0x04006EBD RID: 28349
|
|
[FieldOffset(Offset = "0x20")]
|
|
[Token(Token = "0x4006EBD")]
|
|
private bool readOnlyBuf;
|
|
}
|
|
}
|