227 lines
10 KiB
C#
227 lines
10 KiB
C#
using System;
|
|
using System.IO;
|
|
using System.Runtime.InteropServices;
|
|
using BestHTTP.Logger;
|
|
using Cpp2IlInjected;
|
|
|
|
namespace BestHTTP.Extensions
|
|
{
|
|
// Token: 0x020019C2 RID: 6594
|
|
[Token(Token = "0x20019C2")]
|
|
[StructLayout(3)]
|
|
public sealed class WriteOnlyBufferedStream : Stream
|
|
{
|
|
// Token: 0x17001C9A RID: 7322
|
|
// (get) Token: 0x0600B13E RID: 45374 RVA: 0x00296784 File Offset: 0x00294984
|
|
[Token(Token = "0x17001C9A")]
|
|
public override bool CanRead
|
|
{
|
|
[Token(Token = "0x600B13E")]
|
|
[Address(RVA = "0x413970", Offset = "0x412370", VA = "0x180413970", Slot = "7")]
|
|
get
|
|
{
|
|
}
|
|
}
|
|
|
|
// Token: 0x17001C9B RID: 7323
|
|
// (get) Token: 0x0600B13F RID: 45375 RVA: 0x00296794 File Offset: 0x00294994
|
|
[Token(Token = "0x17001C9B")]
|
|
public override bool CanSeek
|
|
{
|
|
[Token(Token = "0x600B13F")]
|
|
[Address(RVA = "0x413970", Offset = "0x412370", VA = "0x180413970", Slot = "8")]
|
|
get
|
|
{
|
|
}
|
|
}
|
|
|
|
// Token: 0x17001C9C RID: 7324
|
|
// (get) Token: 0x0600B140 RID: 45376 RVA: 0x002967A4 File Offset: 0x002949A4
|
|
[Token(Token = "0x17001C9C")]
|
|
public override bool CanWrite
|
|
{
|
|
[Token(Token = "0x600B140")]
|
|
[Address(RVA = "0x4405A0", Offset = "0x43EFA0", VA = "0x1804405A0", Slot = "9")]
|
|
get
|
|
{
|
|
return true;
|
|
}
|
|
}
|
|
|
|
// Token: 0x17001C9D RID: 7325
|
|
// (get) Token: 0x0600B141 RID: 45377 RVA: 0x002967B4 File Offset: 0x002949B4
|
|
[Token(Token = "0x17001C9D")]
|
|
public override long Length
|
|
{
|
|
[Token(Token = "0x600B141")]
|
|
[Address(RVA = "0x1CA18C0", Offset = "0x1CA02C0", VA = "0x181CA18C0", Slot = "10")]
|
|
get
|
|
{
|
|
int length = this.buffer.Length;
|
|
throw new NullReferenceException();
|
|
}
|
|
}
|
|
|
|
// Token: 0x17001C9E RID: 7326
|
|
// (get) Token: 0x0600B142 RID: 45378 RVA: 0x002967D4 File Offset: 0x002949D4
|
|
// (set) Token: 0x0600B143 RID: 45379 RVA: 0x002967E8 File Offset: 0x002949E8
|
|
[Token(Token = "0x17001C9E")]
|
|
public override long Position
|
|
{
|
|
[Token(Token = "0x600B142")]
|
|
[Address(RVA = "0x1CA18E0", Offset = "0x1CA02E0", VA = "0x181CA18E0", Slot = "11")]
|
|
get
|
|
{
|
|
/*
|
|
An exception occurred when decompiling this method (0600B142)
|
|
|
|
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Int64 BestHTTP.Extensions.WriteOnlyBufferedStream::get_Position()
|
|
|
|
---> System.Exception: Basic block has to end with unconditional control flow.
|
|
{
|
|
Block_0:
|
|
stloc:int32(var_0_06, ldfld:int32(WriteOnlyBufferedStream::_position, ldloc:WriteOnlyBufferedStream(this)))
|
|
}
|
|
|
|
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 = "0x600B143")]
|
|
[Address(RVA = "0x1CA18F0", Offset = "0x1CA02F0", VA = "0x181CA18F0", Slot = "12")]
|
|
set
|
|
{
|
|
/*
|
|
An exception occurred when decompiling this method (0600B143)
|
|
|
|
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void BestHTTP.Extensions.WriteOnlyBufferedStream::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: 0x0600B144 RID: 45380 RVA: 0x00296800 File Offset: 0x00294A00
|
|
[Token(Token = "0x600B144")]
|
|
[Address(RVA = "0x1CA1810", Offset = "0x1CA0210", VA = "0x181CA1810")]
|
|
public WriteOnlyBufferedStream(Stream stream, int bufferSize)
|
|
{
|
|
this.stream = stream;
|
|
byte[] array = VariableSizedBufferPool.Get((long)bufferSize, true);
|
|
this.buffer = array;
|
|
this._position = (int)((ulong)0L);
|
|
}
|
|
|
|
// Token: 0x0600B145 RID: 45381 RVA: 0x00296834 File Offset: 0x00294A34
|
|
[Token(Token = "0x600B145")]
|
|
[Address(RVA = "0x1CA15C0", Offset = "0x1C9FFC0", VA = "0x181CA15C0", Slot = "17")]
|
|
public override void Flush()
|
|
{
|
|
if (this._position > 0)
|
|
{
|
|
if (HTTPManager.Logger == 0)
|
|
{
|
|
ILogger logger = HTTPManager.Logger;
|
|
int position = this._position;
|
|
}
|
|
int num = this.stream.ReadByte();
|
|
this._position = (int)((ulong)0L);
|
|
}
|
|
}
|
|
|
|
// Token: 0x0600B146 RID: 45382 RVA: 0x00296880 File Offset: 0x00294A80
|
|
[Token(Token = "0x600B146")]
|
|
[Address(RVA = "0x1CA1700", Offset = "0x1CA0100", VA = "0x181CA1700", Slot = "29")]
|
|
public override void Write(byte[] bufferFrom, int offset, int count)
|
|
{
|
|
if (count > 0)
|
|
{
|
|
byte[] array = this.buffer;
|
|
int position = this._position;
|
|
int num = array.Length;
|
|
num -= position;
|
|
int num2 = Math.Min(count, num);
|
|
int position2 = this._position;
|
|
byte[] array2 = this.buffer;
|
|
Array.Copy(bufferFrom, offset, array2, position2, num2);
|
|
int num3 = this._position;
|
|
byte[] array3 = this.buffer;
|
|
num3 += num2;
|
|
this._position = num3;
|
|
if (num3 == array3.Length)
|
|
{
|
|
}
|
|
}
|
|
}
|
|
|
|
// Token: 0x0600B147 RID: 45383 RVA: 0x00296904 File Offset: 0x00294B04
|
|
[Token(Token = "0x600B147")]
|
|
[Address(RVA = "0x3F8880", Offset = "0x3F7280", VA = "0x1803F8880", Slot = "27")]
|
|
public override int Read(byte[] buffer, int offset, int count)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
// Token: 0x0600B148 RID: 45384 RVA: 0x00296914 File Offset: 0x00294B14
|
|
[Token(Token = "0x600B148")]
|
|
[Address(RVA = "0x3F8880", Offset = "0x3F7280", VA = "0x1803F8880", Slot = "25")]
|
|
public override long Seek(long offset, SeekOrigin origin)
|
|
{
|
|
}
|
|
|
|
// Token: 0x0600B149 RID: 45385 RVA: 0x0000220F File Offset: 0x0000040F
|
|
[Token(Token = "0x600B149")]
|
|
[Address(RVA = "0x3C9F60", Offset = "0x3C8960", VA = "0x1803C9F60", Slot = "26")]
|
|
public override void SetLength(long value)
|
|
{
|
|
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
|
|
}
|
|
|
|
// Token: 0x0600B14A RID: 45386 RVA: 0x00296924 File Offset: 0x00294B24
|
|
[Token(Token = "0x600B14A")]
|
|
[Address(RVA = "0x1CA1540", Offset = "0x1C9FF40", VA = "0x181CA1540", Slot = "16")]
|
|
protected override void Dispose(bool disposing)
|
|
{
|
|
this.SetLength(disposing ? 1L : 0L);
|
|
byte[] array = this.buffer;
|
|
if (array != 0)
|
|
{
|
|
VariableSizedBufferPool.Release(array);
|
|
}
|
|
this.buffer = (ulong)0L;
|
|
}
|
|
|
|
// Token: 0x04007447 RID: 29767
|
|
[global::Cpp2IlInjected.FieldOffset(Offset = "0x28")]
|
|
[Token(Token = "0x4007447")]
|
|
private int _position;
|
|
|
|
// Token: 0x04007448 RID: 29768
|
|
[global::Cpp2IlInjected.FieldOffset(Offset = "0x30")]
|
|
[Token(Token = "0x4007448")]
|
|
private byte[] buffer;
|
|
|
|
// Token: 0x04007449 RID: 29769
|
|
[global::Cpp2IlInjected.FieldOffset(Offset = "0x38")]
|
|
[Token(Token = "0x4007449")]
|
|
private Stream stream;
|
|
}
|
|
}
|