290 lines
14 KiB
C#
290 lines
14 KiB
C#
using System;
|
|
using System.IO;
|
|
using BestHTTP.Extensions;
|
|
using BestHTTP.Logger;
|
|
using Cpp2IlInjected;
|
|
|
|
namespace BestHTTP
|
|
{
|
|
// Token: 0x0200196C RID: 6508
|
|
[Token(Token = "0x200196C")]
|
|
public sealed class StreamList : Stream
|
|
{
|
|
// Token: 0x060096D5 RID: 38613 RVA: 0x001EACCC File Offset: 0x001E8ECC
|
|
[Token(Token = "0x60096D5")]
|
|
[Address(RVA = "0x62FF80", Offset = "0x62EF80", VA = "0x18062FF80")]
|
|
public StreamList(params Stream[] streams)
|
|
{
|
|
this.Streams = streams;
|
|
this.CurrentIdx = (int)((ulong)0L);
|
|
}
|
|
|
|
// Token: 0x170017D7 RID: 6103
|
|
// (get) Token: 0x060096D6 RID: 38614 RVA: 0x001EACF0 File Offset: 0x001E8EF0
|
|
[Token(Token = "0x170017D7")]
|
|
public override bool CanRead
|
|
{
|
|
[Token(Token = "0x60096D6")]
|
|
[Address(RVA = "0x62FFF0", Offset = "0x62EFF0", VA = "0x18062FFF0", Slot = "7")]
|
|
get
|
|
{
|
|
Stream[] streams = this.Streams;
|
|
int currentIdx = this.CurrentIdx;
|
|
int length = streams.Length;
|
|
if (currentIdx < length)
|
|
{
|
|
return streams[currentIdx].CanRead;
|
|
}
|
|
throw new NullReferenceException();
|
|
}
|
|
}
|
|
|
|
// Token: 0x170017D8 RID: 6104
|
|
// (get) Token: 0x060096D7 RID: 38615 RVA: 0x001EAD2C File Offset: 0x001E8F2C
|
|
[Token(Token = "0x170017D8")]
|
|
public override bool CanSeek
|
|
{
|
|
[Token(Token = "0x60096D7")]
|
|
[Address(RVA = "0x424690", Offset = "0x423690", VA = "0x180424690", Slot = "8")]
|
|
get
|
|
{
|
|
}
|
|
}
|
|
|
|
// Token: 0x170017D9 RID: 6105
|
|
// (get) Token: 0x060096D8 RID: 38616 RVA: 0x001EAD3C File Offset: 0x001E8F3C
|
|
[Token(Token = "0x170017D9")]
|
|
public override bool CanWrite
|
|
{
|
|
[Token(Token = "0x60096D8")]
|
|
[Address(RVA = "0x630050", Offset = "0x62F050", VA = "0x180630050", Slot = "9")]
|
|
get
|
|
{
|
|
Stream[] streams = this.Streams;
|
|
int currentIdx = this.CurrentIdx;
|
|
int length = streams.Length;
|
|
if (currentIdx < length)
|
|
{
|
|
return streams[currentIdx].CanRead;
|
|
}
|
|
throw new NullReferenceException();
|
|
}
|
|
}
|
|
|
|
// Token: 0x060096D9 RID: 38617 RVA: 0x001EAD78 File Offset: 0x001E8F78
|
|
[Token(Token = "0x60096D9")]
|
|
[Address(RVA = "0x62FBE0", Offset = "0x62EBE0", VA = "0x18062FBE0", Slot = "17")]
|
|
public override void Flush()
|
|
{
|
|
Stream[] streams = this.Streams;
|
|
if (this.CurrentIdx < streams.Length)
|
|
{
|
|
int i = 0;
|
|
Stream stream = this.Streams[i];
|
|
i++;
|
|
while (i <= this.CurrentIdx)
|
|
{
|
|
}
|
|
}
|
|
}
|
|
|
|
// Token: 0x170017DA RID: 6106
|
|
// (get) Token: 0x060096DA RID: 38618 RVA: 0x001EADBC File Offset: 0x001E8FBC
|
|
[Token(Token = "0x170017DA")]
|
|
public override long Length
|
|
{
|
|
[Token(Token = "0x60096DA")]
|
|
[Address(RVA = "0x6300B0", Offset = "0x62F0B0", VA = "0x1806300B0", Slot = "10")]
|
|
get
|
|
{
|
|
Stream[] streams = this.Streams;
|
|
int length = streams.Length;
|
|
if (this.CurrentIdx < length)
|
|
{
|
|
int num = 0;
|
|
if (num < streams.Length)
|
|
{
|
|
bool canWrite = streams[num].CanWrite;
|
|
Stream[] streams2 = this.Streams;
|
|
num++;
|
|
num += (canWrite ? 1 : 0);
|
|
}
|
|
}
|
|
throw new NullReferenceException();
|
|
}
|
|
}
|
|
|
|
// Token: 0x060096DB RID: 38619 RVA: 0x001EAE10 File Offset: 0x001E9010
|
|
[Token(Token = "0x60096DB")]
|
|
[Address(RVA = "0x62FC60", Offset = "0x62EC60", VA = "0x18062FC60", Slot = "27")]
|
|
public override int Read(byte[] buffer, int offset, int count)
|
|
{
|
|
Stream[] streams = this.Streams;
|
|
int currentIdx = this.CurrentIdx;
|
|
int length = streams.Length;
|
|
if (currentIdx < length)
|
|
{
|
|
Stream stream = streams[currentIdx];
|
|
int currentIdx2 = this.CurrentIdx;
|
|
int num = currentIdx2 + 1;
|
|
this.CurrentIdx = num;
|
|
Stream[] streams2 = this.Streams;
|
|
int length2 = streams2.Length;
|
|
if (currentIdx2 < length2)
|
|
{
|
|
int num2 = currentIdx2 + 1;
|
|
Stream stream2 = streams2[num2];
|
|
}
|
|
}
|
|
throw new NullReferenceException();
|
|
}
|
|
|
|
// Token: 0x060096DC RID: 38620 RVA: 0x001EAE84 File Offset: 0x001E9084
|
|
[Token(Token = "0x60096DC")]
|
|
[Address(RVA = "0x62FF10", Offset = "0x62EF10", VA = "0x18062FF10", Slot = "29")]
|
|
public override void Write(byte[] buffer, int offset, int count)
|
|
{
|
|
Stream[] streams = this.Streams;
|
|
int currentIdx = this.CurrentIdx;
|
|
int length = streams.Length;
|
|
if (currentIdx < length)
|
|
{
|
|
bool canRead = streams[currentIdx].CanRead;
|
|
return;
|
|
}
|
|
}
|
|
|
|
// Token: 0x060096DD RID: 38621 RVA: 0x001EAEC0 File Offset: 0x001E90C0
|
|
[Token(Token = "0x60096DD")]
|
|
[Address(RVA = "0x62FE50", Offset = "0x62EE50", VA = "0x18062FE50")]
|
|
public void Write(string str)
|
|
{
|
|
byte[] asciibytes = str.GetASCIIBytes();
|
|
int num = this.ReadByte();
|
|
VariableSizedBufferPool.Release(asciibytes);
|
|
}
|
|
|
|
// Token: 0x060096DE RID: 38622 RVA: 0x001EAEE8 File Offset: 0x001E90E8
|
|
[Token(Token = "0x60096DE")]
|
|
[Address(RVA = "0x62FAA0", Offset = "0x62EAA0", VA = "0x18062FAA0", Slot = "16")]
|
|
protected override void Dispose(bool disposing)
|
|
{
|
|
int num = 0;
|
|
Stream[] streams = this.Streams;
|
|
if (num < streams.Length)
|
|
{
|
|
this.Streams[num].Dispose();
|
|
ILogger logger = HTTPManager.Logger;
|
|
num++;
|
|
}
|
|
}
|
|
|
|
// Token: 0x170017DB RID: 6107
|
|
// (get) Token: 0x060096DF RID: 38623 RVA: 0x001EAF3C File Offset: 0x001E913C
|
|
// (set) Token: 0x060096E0 RID: 38624 RVA: 0x001EAF54 File Offset: 0x001E9154
|
|
[Token(Token = "0x170017DB")]
|
|
public override long Position
|
|
{
|
|
[Token(Token = "0x60096DF")]
|
|
[Address(RVA = "0x630160", Offset = "0x62F160", VA = "0x180630160", Slot = "11")]
|
|
get
|
|
{
|
|
/*
|
|
An exception occurred when decompiling this method (060096DF)
|
|
|
|
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Int64 BestHTTP.StreamList::get_Position()
|
|
|
|
---> System.Exception: Basic block has to end with unconditional control flow.
|
|
{
|
|
Block_0:
|
|
stloc:NotImplementedException(var_0_0A, newobj:NotImplementedException(NotImplementedException::.ctor, ldstr:string("Position get")))
|
|
}
|
|
|
|
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(Token = "0x60096E0")]
|
|
[Address(RVA = "0x6301C0", Offset = "0x62F1C0", VA = "0x1806301C0", Slot = "12")]
|
|
set
|
|
{
|
|
/*
|
|
An exception occurred when decompiling this method (060096E0)
|
|
|
|
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void BestHTTP.StreamList::set_Position(System.Int64)
|
|
|
|
---> System.Exception: Basic block has to end with unconditional control flow.
|
|
{
|
|
Block_0:
|
|
stloc:NotImplementedException(var_0_0A, newobj:NotImplementedException(NotImplementedException::.ctor, ldstr:string("Position set")))
|
|
}
|
|
|
|
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: 0x060096E1 RID: 38625 RVA: 0x001EAF6C File Offset: 0x001E916C
|
|
[Token(Token = "0x60096E1")]
|
|
[Address(RVA = "0x62FD90", Offset = "0x62ED90", VA = "0x18062FD90", Slot = "25")]
|
|
public override long Seek(long offset, SeekOrigin origin)
|
|
{
|
|
Stream[] streams = this.Streams;
|
|
int currentIdx = this.CurrentIdx;
|
|
int length = streams.Length;
|
|
if (currentIdx < length)
|
|
{
|
|
bool canRead = streams[currentIdx].CanRead;
|
|
}
|
|
throw new NullReferenceException();
|
|
}
|
|
|
|
// Token: 0x060096E2 RID: 38626 RVA: 0x001EAFA8 File Offset: 0x001E91A8
|
|
[Token(Token = "0x60096E2")]
|
|
[Address(RVA = "0x62FDF0", Offset = "0x62EDF0", VA = "0x18062FDF0", Slot = "26")]
|
|
public override void SetLength(long value)
|
|
{
|
|
/*
|
|
An exception occurred when decompiling this method (060096E2)
|
|
|
|
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void BestHTTP.StreamList::SetLength(System.Int64)
|
|
|
|
---> System.Exception: Basic block has to end with unconditional control flow.
|
|
{
|
|
Block_0:
|
|
stloc:NotImplementedException(var_0_0A, newobj:NotImplementedException(NotImplementedException::.ctor, ldstr:string("SetLength")))
|
|
}
|
|
|
|
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: 0x04006631 RID: 26161
|
|
[FieldOffset(Offset = "0x28")]
|
|
[Token(Token = "0x4006631")]
|
|
private Stream[] Streams;
|
|
|
|
// Token: 0x04006632 RID: 26162
|
|
[FieldOffset(Offset = "0x30")]
|
|
[Token(Token = "0x4006632")]
|
|
private int CurrentIdx;
|
|
}
|
|
}
|