213 lines
8.4 KiB
C#
213 lines
8.4 KiB
C#
using System;
|
|
using System.IO;
|
|
using System.Runtime.InteropServices;
|
|
using Cpp2IlInjected;
|
|
|
|
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls
|
|
{
|
|
// Token: 0x02001522 RID: 5410
|
|
[Token(Token = "0x2001522")]
|
|
[StructLayout(3)]
|
|
public class ByteQueue
|
|
{
|
|
// Token: 0x06009009 RID: 36873 RVA: 0x001FF174 File Offset: 0x001FD374
|
|
[Token(Token = "0x6009009")]
|
|
[Address(RVA = "0x1E749B0", Offset = "0x1E733B0", VA = "0x181E749B0")]
|
|
public static int NextTwoPow(int i)
|
|
{
|
|
return i;
|
|
}
|
|
|
|
// Token: 0x0600900A RID: 36874 RVA: 0x001FF184 File Offset: 0x001FD384
|
|
[Token(Token = "0x600900A")]
|
|
[Address(RVA = "0x1E751B0", Offset = "0x1E73BB0", VA = "0x181E751B0")]
|
|
public ByteQueue()
|
|
{
|
|
byte[] array = new byte[1024];
|
|
this.databuf = array;
|
|
}
|
|
|
|
// Token: 0x0600900B RID: 36875 RVA: 0x001FF1B0 File Offset: 0x001FD3B0
|
|
[Token(Token = "0x600900B")]
|
|
[Address(RVA = "0x1E75110", Offset = "0x1E73B10", VA = "0x181E75110")]
|
|
public ByteQueue(int capacity)
|
|
{
|
|
if (capacity == 0)
|
|
{
|
|
}
|
|
byte[] array = new byte[capacity];
|
|
this.databuf = array;
|
|
}
|
|
|
|
// Token: 0x0600900C RID: 36876 RVA: 0x001FF1DC File Offset: 0x001FD3DC
|
|
[Token(Token = "0x600900C")]
|
|
[Address(RVA = "0x1E75210", Offset = "0x1E73C10", VA = "0x181E75210")]
|
|
public ByteQueue(byte[] buf, int off, int len)
|
|
{
|
|
this.databuf = buf;
|
|
this.available = len;
|
|
this.skipped = off;
|
|
this.readOnlyBuf = true;
|
|
}
|
|
|
|
// Token: 0x0600900D RID: 36877 RVA: 0x001FF20C File Offset: 0x001FD40C
|
|
[Token(Token = "0x600900D")]
|
|
[Address(RVA = "0x1E746A0", Offset = "0x1E730A0", VA = "0x181E746A0")]
|
|
public void AddData(byte[] data, int offset, int len)
|
|
{
|
|
/*
|
|
An exception occurred when decompiling this method (0600900D)
|
|
|
|
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: 0x17001744 RID: 5956
|
|
// (get) Token: 0x0600900E RID: 36878 RVA: 0x001FF2AC File Offset: 0x001FD4AC
|
|
[Token(Token = "0x17001744")]
|
|
public int Available
|
|
{
|
|
[Token(Token = "0x600900E")]
|
|
[Address(RVA = "0x4F8C10", Offset = "0x4F7610", VA = "0x1804F8C10")]
|
|
get
|
|
{
|
|
return this.available;
|
|
}
|
|
}
|
|
|
|
// Token: 0x0600900F RID: 36879 RVA: 0x001FF2C0 File Offset: 0x001FD4C0
|
|
[Token(Token = "0x600900F")]
|
|
[Address(RVA = "0x1E74810", Offset = "0x1E73210", VA = "0x181E74810")]
|
|
public void CopyTo(Stream output, int length)
|
|
{
|
|
int num = output.ReadByte();
|
|
}
|
|
|
|
// Token: 0x06009010 RID: 36880 RVA: 0x001FF338 File Offset: 0x001FD538
|
|
[Token(Token = "0x6009010")]
|
|
[Address(RVA = "0x1E74BA0", Offset = "0x1E735A0", VA = "0x181E74BA0")]
|
|
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: 0x06009011 RID: 36881 RVA: 0x001FF36C File Offset: 0x001FD56C
|
|
[Token(Token = "0x6009011")]
|
|
[Address(RVA = "0x1E749E0", Offset = "0x1E733E0", VA = "0x181E749E0")]
|
|
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: 0x06009012 RID: 36882 RVA: 0x001FF408 File Offset: 0x001FD608
|
|
[Token(Token = "0x6009012")]
|
|
[Address(RVA = "0x1E74E00", Offset = "0x1E73800", VA = "0x181E74E00")]
|
|
public void RemoveData(int i)
|
|
{
|
|
int num = this.available;
|
|
num -= i;
|
|
this.available = num;
|
|
}
|
|
|
|
// Token: 0x06009013 RID: 36883 RVA: 0x001FF484 File Offset: 0x001FD684
|
|
[Token(Token = "0x6009013")]
|
|
[Address(RVA = "0x1E74DB0", Offset = "0x1E737B0", VA = "0x181E74DB0")]
|
|
public void RemoveData(byte[] buf, int off, int len, int skip)
|
|
{
|
|
}
|
|
|
|
// Token: 0x06009014 RID: 36884 RVA: 0x001FF494 File Offset: 0x001FD694
|
|
[Token(Token = "0x6009014")]
|
|
[Address(RVA = "0x1E74F70", Offset = "0x1E73970", VA = "0x181E74F70")]
|
|
public byte[] RemoveData(int len, int skip)
|
|
{
|
|
byte[] array = new byte[len];
|
|
int num = 0;
|
|
this.Read(array, num, len, skip);
|
|
return array;
|
|
}
|
|
|
|
// Token: 0x06009015 RID: 36885 RVA: 0x001FF4B8 File Offset: 0x001FD6B8
|
|
[Token(Token = "0x6009015")]
|
|
[Address(RVA = "0x1E75000", Offset = "0x1E73A00", VA = "0x181E75000")]
|
|
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: 0x04005EBD RID: 24253
|
|
[Token(Token = "0x4005EBD")]
|
|
private const int DefaultCapacity = 1024;
|
|
|
|
// Token: 0x04005EBE RID: 24254
|
|
[global::Cpp2IlInjected.FieldOffset(Offset = "0x10")]
|
|
[Token(Token = "0x4005EBE")]
|
|
private byte[] databuf;
|
|
|
|
// Token: 0x04005EBF RID: 24255
|
|
[global::Cpp2IlInjected.FieldOffset(Offset = "0x18")]
|
|
[Token(Token = "0x4005EBF")]
|
|
private int skipped;
|
|
|
|
// Token: 0x04005EC0 RID: 24256
|
|
[global::Cpp2IlInjected.FieldOffset(Offset = "0x1C")]
|
|
[Token(Token = "0x4005EC0")]
|
|
private int available;
|
|
|
|
// Token: 0x04005EC1 RID: 24257
|
|
[global::Cpp2IlInjected.FieldOffset(Offset = "0x20")]
|
|
[Token(Token = "0x4005EC1")]
|
|
private bool readOnlyBuf;
|
|
}
|
|
}
|