719 lines
33 KiB
C#
719 lines
33 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.IO;
|
|
using BestHTTP.Decompression.Crc;
|
|
using BestHTTP.Extensions;
|
|
using Cpp2IlInjected;
|
|
|
|
namespace BestHTTP.Decompression.Zlib
|
|
{
|
|
// Token: 0x02002099 RID: 8345
|
|
[Token(Token = "0x2002099")]
|
|
internal class ZlibBaseStream : Stream
|
|
{
|
|
// Token: 0x17002155 RID: 8533
|
|
// (get) Token: 0x0600D18D RID: 53645 RVA: 0x002FD3E8 File Offset: 0x002FB5E8
|
|
[Token(Token = "0x17002155")]
|
|
internal int Crc32
|
|
{
|
|
[Token(Token = "0x600D18D")]
|
|
[Address(RVA = "0x2A85580", Offset = "0x2A84580", VA = "0x182A85580")]
|
|
get
|
|
{
|
|
CRC32 crc = this.crc;
|
|
if (crc != 0)
|
|
{
|
|
return crc.Crc32Result;
|
|
}
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
// Token: 0x0600D18E RID: 53646 RVA: 0x002FD408 File Offset: 0x002FB608
|
|
[Token(Token = "0x600D18E")]
|
|
[Address(RVA = "0x2A849C0", Offset = "0x2A839C0", VA = "0x182A849C0")]
|
|
public ZlibBaseStream(Stream stream, CompressionMode compressionMode, CompressionLevel level, ZlibStreamFlavor flavor, bool leaveOpen)
|
|
{
|
|
byte[] array = new byte[1];
|
|
this._buf1 = array;
|
|
base..ctor();
|
|
this._leaveOpen = false;
|
|
this._flushMode = (FlushType)((ulong)0L);
|
|
this._stream = stream;
|
|
this._compressionMode = compressionMode;
|
|
this._flavor = (ZlibStreamFlavor)0;
|
|
this._level = level;
|
|
this.windowBitsMax = (int)((ulong)15L);
|
|
CRC32 crc = new CRC32();
|
|
this.crc = crc;
|
|
}
|
|
|
|
// Token: 0x0600D18F RID: 53647 RVA: 0x002FD488 File Offset: 0x002FB688
|
|
[Token(Token = "0x600D18F")]
|
|
[Address(RVA = "0x2A84AB0", Offset = "0x2A83AB0", VA = "0x182A84AB0")]
|
|
public ZlibBaseStream(Stream stream, CompressionMode compressionMode, CompressionLevel level, ZlibStreamFlavor flavor, bool leaveOpen, int windowBits)
|
|
{
|
|
byte[] array = new byte[1];
|
|
this._buf1 = array;
|
|
base..ctor();
|
|
this._leaveOpen = false;
|
|
this.windowBitsMax = 0;
|
|
this._flushMode = (FlushType)((ulong)0L);
|
|
this._stream = stream;
|
|
this._compressionMode = compressionMode;
|
|
this._flavor = (ZlibStreamFlavor)0;
|
|
this._level = level;
|
|
CRC32 crc = new CRC32();
|
|
this.crc = crc;
|
|
}
|
|
|
|
// Token: 0x17002156 RID: 8534
|
|
// (get) Token: 0x0600D190 RID: 53648 RVA: 0x002FD504 File Offset: 0x002FB704
|
|
[Token(Token = "0x17002156")]
|
|
protected internal bool _wantCompress
|
|
{
|
|
[Token(Token = "0x600D190")]
|
|
[Address(RVA = "0x10B5ED0", Offset = "0x10B4ED0", VA = "0x1810B5ED0")]
|
|
get
|
|
{
|
|
return this._compressionMode == CompressionMode.Compress;
|
|
}
|
|
}
|
|
|
|
// Token: 0x17002157 RID: 8535
|
|
// (get) Token: 0x0600D191 RID: 53649 RVA: 0x002FD51C File Offset: 0x002FB71C
|
|
[Token(Token = "0x17002157")]
|
|
private ZlibCodec z
|
|
{
|
|
[Token(Token = "0x600D191")]
|
|
[Address(RVA = "0x2A85670", Offset = "0x2A84670", VA = "0x182A85670")]
|
|
get
|
|
{
|
|
if (this._z == (ulong)0L)
|
|
{
|
|
bool flag = this._flavor == ZlibStreamFlavor.ZLIB;
|
|
ZlibCodec zlibCodec = new ZlibCodec();
|
|
zlibCodec.CompressLevel = (CompressionLevel)((ulong)6L);
|
|
zlibCodec.WindowBits = (int)((ulong)15L);
|
|
this._z = zlibCodec;
|
|
if (this._compressionMode != CompressionMode.Decompress)
|
|
{
|
|
CompressionStrategy strategy = this.Strategy;
|
|
zlibCodec.Strategy = strategy;
|
|
ZlibCodec z = this._z;
|
|
int num = this.windowBitsMax;
|
|
CompressionLevel level = this._level;
|
|
z.WindowBits = num;
|
|
z.CompressLevel = level;
|
|
int num2 = z._InternalInitializeDeflate(flag);
|
|
}
|
|
int num3 = this.windowBitsMax;
|
|
int num4 = zlibCodec.InitializeInflate(num3, flag);
|
|
}
|
|
return this._z;
|
|
}
|
|
}
|
|
|
|
// Token: 0x17002158 RID: 8536
|
|
// (get) Token: 0x0600D192 RID: 53650 RVA: 0x002FD5CC File Offset: 0x002FB7CC
|
|
[Token(Token = "0x17002158")]
|
|
private byte[] workingBuffer
|
|
{
|
|
[Token(Token = "0x600D192")]
|
|
[Address(RVA = "0x2A855F0", Offset = "0x2A845F0", VA = "0x182A855F0")]
|
|
get
|
|
{
|
|
if (this._workingBuffer == (ulong)0L)
|
|
{
|
|
byte[] array = VariableSizedBufferPool.Get((long)this._bufferSize, true);
|
|
this._workingBuffer = array;
|
|
}
|
|
return this._workingBuffer;
|
|
}
|
|
}
|
|
|
|
// Token: 0x0600D193 RID: 53651 RVA: 0x002FD600 File Offset: 0x002FB800
|
|
[Token(Token = "0x600D193")]
|
|
[Address(RVA = "0x2A84140", Offset = "0x2A83140", VA = "0x182A84140", Slot = "29")]
|
|
public override void Write(byte[] buffer, int offset, int count)
|
|
{
|
|
int num;
|
|
ZlibCodec z3;
|
|
do
|
|
{
|
|
CRC32 crc = this.crc;
|
|
num = 0;
|
|
if (crc != 0)
|
|
{
|
|
crc.SlurpBlock(buffer, offset, count);
|
|
}
|
|
ZlibBaseStream.StreamMode streamMode = this._streamMode;
|
|
if (streamMode != ZlibBaseStream.StreamMode.Undefined && streamMode != ZlibBaseStream.StreamMode.Writer)
|
|
{
|
|
goto IL_14C;
|
|
}
|
|
this._streamMode = (ZlibBaseStream.StreamMode)num;
|
|
if (count == 0)
|
|
{
|
|
return;
|
|
}
|
|
this.z.InputBuffer = buffer;
|
|
this._z.NextIn = offset;
|
|
this._z.AvailableBytesIn = count;
|
|
ZlibCodec z = this._z;
|
|
if (this._workingBuffer == num)
|
|
{
|
|
ulong num2;
|
|
byte[] array = VariableSizedBufferPool.Get((long)this._bufferSize, num2 != 0UL);
|
|
this._workingBuffer = array;
|
|
}
|
|
byte[] workingBuffer = this._workingBuffer;
|
|
z.OutputBuffer = workingBuffer;
|
|
this._z.NextOut = num;
|
|
byte[] workingBuffer2 = this._workingBuffer;
|
|
ZlibCodec z2 = this._z;
|
|
int length = workingBuffer2.Length;
|
|
z2.AvailableBytesOut = length;
|
|
z3 = this._z;
|
|
FlushType flushMode = this._flushMode;
|
|
if (this._compressionMode == (CompressionMode)num && z3.dstate == 0)
|
|
{
|
|
goto IL_158;
|
|
}
|
|
}
|
|
while (z3.istate == 0);
|
|
int num3;
|
|
if (num3 > 1)
|
|
{
|
|
goto IL_164;
|
|
}
|
|
byte[] workingBuffer3 = this._workingBuffer;
|
|
ZlibCodec z4 = this._z;
|
|
int num4 = this._stream.ReadByte();
|
|
int availableBytesIn = this._z.AvailableBytesIn;
|
|
if (availableBytesIn != 0)
|
|
{
|
|
}
|
|
if (this._flavor != ZlibStreamFlavor.GZIP || this._compressionMode == (CompressionMode)num || availableBytesIn == 8)
|
|
{
|
|
}
|
|
while (num == 0)
|
|
{
|
|
}
|
|
return;
|
|
IL_14C:
|
|
ZlibException ex = new ZlibException("Cannot Write after Reading.");
|
|
IL_158:
|
|
ZlibException ex2 = new ZlibException("No Deflate State!");
|
|
IL_164:
|
|
throw new NullReferenceException();
|
|
}
|
|
|
|
// Token: 0x0600D194 RID: 53652 RVA: 0x002FD780 File Offset: 0x002FB980
|
|
[Token(Token = "0x600D194")]
|
|
[Address(RVA = "0x2A84D10", Offset = "0x2A83D10", VA = "0x182A84D10")]
|
|
private void finish()
|
|
{
|
|
/*
|
|
An exception occurred when decompiling this method (0600D194)
|
|
|
|
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void BestHTTP.Decompression.Zlib.ZlibBaseStream::finish()
|
|
|
|
---> System.Exception: Basic block has to end with unconditional control flow.
|
|
{
|
|
IL_297:
|
|
stloc:ZlibException(var_47_2AA, newobj:ZlibException(ZlibException::.ctor, call:string(string::Format, ldstr:string("Bad size in GZIP trailer. (actual({0})!=expected({1}))"), ldloc:ZlibException[exp:object](var_46), ldloc:ZlibException[exp:object](var_46))))
|
|
}
|
|
|
|
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: 0x0600D195 RID: 53653 RVA: 0x002FDA38 File Offset: 0x002FBC38
|
|
[Token(Token = "0x600D195")]
|
|
[Address(RVA = "0x2A84BA0", Offset = "0x2A83BA0", VA = "0x182A84BA0")]
|
|
private void end()
|
|
{
|
|
/*
|
|
An exception occurred when decompiling this method (0600D195)
|
|
|
|
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void BestHTTP.Decompression.Zlib.ZlibBaseStream::end()
|
|
|
|
---> System.Exception: Basic block has to end with unconditional control flow.
|
|
{
|
|
IL_7A:
|
|
stloc:ZlibException(var_5_84, newobj:ZlibException(ZlibException::.ctor, ldstr:string("No Deflate State!")))
|
|
}
|
|
|
|
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: 0x0600D196 RID: 53654 RVA: 0x002FDACC File Offset: 0x002FBCCC
|
|
[Token(Token = "0x600D196")]
|
|
[Address(RVA = "0x2A83800", Offset = "0x2A82800", VA = "0x182A83800", Slot = "15")]
|
|
public override void Close()
|
|
{
|
|
/*
|
|
An exception occurred when decompiling this method (0600D196)
|
|
|
|
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void BestHTTP.Decompression.Zlib.ZlibBaseStream::Close()
|
|
|
|
---> System.Exception: Basic block has to end with unconditional control flow.
|
|
{
|
|
IL_A0:
|
|
stloc:ZlibException(var_6_AA, newobj:ZlibException(ZlibException::.ctor, ldstr:string("No Deflate State!")))
|
|
}
|
|
|
|
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: 0x0600D197 RID: 53655 RVA: 0x002FDB84 File Offset: 0x002FBD84
|
|
[Token(Token = "0x600D197")]
|
|
[Address(RVA = "0x10B3330", Offset = "0x10B2330", VA = "0x1810B3330", Slot = "17")]
|
|
public override void Flush()
|
|
{
|
|
bool canRead = this._stream.CanRead;
|
|
}
|
|
|
|
// Token: 0x0600D198 RID: 53656 RVA: 0x002FDBA4 File Offset: 0x002FBDA4
|
|
[Token(Token = "0x600D198")]
|
|
[Address(RVA = "0x2A840B0", Offset = "0x2A830B0", VA = "0x182A840B0", Slot = "25")]
|
|
public override long Seek(long offset, SeekOrigin origin)
|
|
{
|
|
/*
|
|
An exception occurred when decompiling this method (0600D198)
|
|
|
|
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Int64 BestHTTP.Decompression.Zlib.ZlibBaseStream::Seek(System.Int64,System.IO.SeekOrigin)
|
|
|
|
---> System.Exception: Basic block has to end with unconditional control flow.
|
|
{
|
|
Block_0:
|
|
stloc:NotImplementedException(var_0_05, newobj:NotImplementedException(NotImplementedException::.ctor))
|
|
}
|
|
|
|
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: 0x0600D199 RID: 53657 RVA: 0x002FDBB8 File Offset: 0x002FBDB8
|
|
[Token(Token = "0x600D199")]
|
|
[Address(RVA = "0x2A84100", Offset = "0x2A83100", VA = "0x182A84100", Slot = "26")]
|
|
public override void SetLength(long value)
|
|
{
|
|
Stream stream = this._stream;
|
|
this.nomoreinput = false;
|
|
}
|
|
|
|
// Token: 0x0600D19A RID: 53658 RVA: 0x002FDBDC File Offset: 0x002FBDDC
|
|
[Token(Token = "0x600D19A")]
|
|
[Address(RVA = "0x2A839F0", Offset = "0x2A829F0", VA = "0x182A839F0")]
|
|
private string ReadZeroTerminatedString()
|
|
{
|
|
List<byte> list = new List();
|
|
Stream stream = this._stream;
|
|
byte b = this._buf1[0];
|
|
list.Add(b);
|
|
byte[] array = list.ToArray();
|
|
return GZipStream.iso8859dash1.GetString(array);
|
|
}
|
|
|
|
// Token: 0x0600D19B RID: 53659 RVA: 0x002FDC24 File Offset: 0x002FBE24
|
|
[Token(Token = "0x600D19B")]
|
|
[Address(RVA = "0x2A844E0", Offset = "0x2A834E0", VA = "0x182A844E0")]
|
|
private int _ReadAndValidateGzipHeader()
|
|
{
|
|
byte[] array;
|
|
do
|
|
{
|
|
uint num;
|
|
ulong num2;
|
|
array = VariableSizedBufferPool.Get((long)num, num2 != 0UL);
|
|
Stream stream = this._stream;
|
|
int length = array.Length;
|
|
}
|
|
while ("{il2cpp array field local5->}" != (ulong)31L || "{il2cpp array field local5->}" != (ulong)139L || "{il2cpp array field local5->}" != (ulong)8L);
|
|
int num3 = BitConverter.ToInt32(array, (int)8.487983164E-314);
|
|
DateTime unixEpoch = GZipStream._unixEpoch;
|
|
DateTime dateTime;
|
|
this._GzipMtime = dateTime;
|
|
int length2 = array.Length;
|
|
if ("{il2cpp array field local5->}" != (ulong)4L)
|
|
{
|
|
Stream stream2 = this._stream;
|
|
int length3 = array.Length;
|
|
byte b = array[0];
|
|
byte b2 = array[0];
|
|
uint num4;
|
|
byte b3 = (byte)((uint)b * num4);
|
|
b3 += b2;
|
|
Stream stream3 = this._stream;
|
|
}
|
|
if ("{il2cpp array field local5->}" != (ulong)8L)
|
|
{
|
|
string text = this.ReadZeroTerminatedString();
|
|
this._GzipFileName = text;
|
|
int length4 = array.Length;
|
|
}
|
|
if ("{il2cpp array field local5->}" != (ulong)16L)
|
|
{
|
|
string text2 = this.ReadZeroTerminatedString();
|
|
this._GzipComment = text2;
|
|
int length5 = array.Length;
|
|
}
|
|
if ("{il2cpp array field local5->}" != (ulong)2L)
|
|
{
|
|
}
|
|
VariableSizedBufferPool.Release(array);
|
|
VariableSizedBufferPool.Release(array);
|
|
throw new NullReferenceException();
|
|
}
|
|
|
|
// Token: 0x0600D19C RID: 53660 RVA: 0x002FDD38 File Offset: 0x002FBF38
|
|
[Token(Token = "0x600D19C")]
|
|
[Address(RVA = "0x2A83B80", Offset = "0x2A82B80", VA = "0x182A83B80", Slot = "27")]
|
|
public override int Read(byte[] buffer, int offset, int count)
|
|
{
|
|
int num;
|
|
int num4;
|
|
bool flag;
|
|
for (;;)
|
|
{
|
|
num = 0;
|
|
if (this._streamMode == ZlibBaseStream.StreamMode.Undefined)
|
|
{
|
|
this._stream.Dispose();
|
|
this._streamMode = (ZlibBaseStream.StreamMode)((ulong)1L);
|
|
this.z.AvailableBytesIn = num;
|
|
if (this._flavor == ZlibStreamFlavor.GZIP)
|
|
{
|
|
int num2 = this._ReadAndValidateGzipHeader();
|
|
this._gzipHeaderByteCount = num2;
|
|
if (num2 == 0)
|
|
{
|
|
goto IL_1D9;
|
|
}
|
|
}
|
|
}
|
|
if (this._streamMode != ZlibBaseStream.StreamMode.Reader || count == 0 || ((this.nomoreinput ? 1 : 0) != num && this._compressionMode == (CompressionMode)num))
|
|
{
|
|
goto IL_1D9;
|
|
}
|
|
if (buffer != 0)
|
|
{
|
|
this._z.OutputBuffer = buffer;
|
|
this._z.NextOut = offset;
|
|
this._z.AvailableBytesOut = count;
|
|
ZlibCodec z = this._z;
|
|
byte[] workingBuffer = this.workingBuffer;
|
|
z.InputBuffer = workingBuffer;
|
|
ZlibCodec z2 = this._z;
|
|
ZlibCodec z4;
|
|
if (z2.AvailableBytesIn == num && (this.nomoreinput ? 1 : 0) == num)
|
|
{
|
|
z2.NextIn = num;
|
|
byte[] workingBuffer2 = this._workingBuffer;
|
|
ZlibCodec z3 = this._z;
|
|
Stream stream = this._stream;
|
|
int length = workingBuffer2.Length;
|
|
z4 = this._z;
|
|
if (z4.AvailableBytesIn == num)
|
|
{
|
|
this.nomoreinput = true;
|
|
}
|
|
}
|
|
FlushType flushMode = this._flushMode;
|
|
if (this._compressionMode == (CompressionMode)num)
|
|
{
|
|
int num3 = z4.Deflate(flushMode);
|
|
}
|
|
num4 = z4.Inflate(flushMode);
|
|
flag = this.nomoreinput;
|
|
if (flag && num4 == -5)
|
|
{
|
|
goto IL_1D9;
|
|
}
|
|
if (num4 <= 1)
|
|
{
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
ZlibCodec z5;
|
|
if ((!flag && num4 != 1) || this._z.AvailableBytesOut != count)
|
|
{
|
|
z5 = this._z;
|
|
if (z5.AvailableBytesOut <= num || flag || num4 == 0)
|
|
{
|
|
}
|
|
}
|
|
if (z5.AvailableBytesOut <= num || !flag || this._compressionMode != (CompressionMode)num || z5.Deflate(FlushType.Finish) <= 1)
|
|
{
|
|
ZlibCodec z6 = this._z;
|
|
CRC32 crc = this.crc;
|
|
if (crc != 0)
|
|
{
|
|
crc.SlurpBlock(buffer, offset, count);
|
|
}
|
|
return count;
|
|
}
|
|
goto IL_1F1;
|
|
IL_1D9:
|
|
ZlibException ex = new ZlibException("Cannot Read after Writing.");
|
|
ZlibException ex2 = new ZlibException("The stream is not readable.");
|
|
IL_1F1:
|
|
throw new NullReferenceException();
|
|
}
|
|
|
|
// Token: 0x17002159 RID: 8537
|
|
// (get) Token: 0x0600D19D RID: 53661 RVA: 0x002FDF50 File Offset: 0x002FC150
|
|
[Token(Token = "0x17002159")]
|
|
public override bool CanRead
|
|
{
|
|
[Token(Token = "0x600D19D")]
|
|
[Address(RVA = "0x10B5DF0", Offset = "0x10B4DF0", VA = "0x1810B5DF0", Slot = "7")]
|
|
get
|
|
{
|
|
return this._stream.CanRead;
|
|
}
|
|
}
|
|
|
|
// Token: 0x1700215A RID: 8538
|
|
// (get) Token: 0x0600D19E RID: 53662 RVA: 0x002FDF70 File Offset: 0x002FC170
|
|
[Token(Token = "0x1700215A")]
|
|
public override bool CanSeek
|
|
{
|
|
[Token(Token = "0x600D19E")]
|
|
[Address(RVA = "0x10B5E20", Offset = "0x10B4E20", VA = "0x1810B5E20", Slot = "8")]
|
|
get
|
|
{
|
|
return this._stream.CanRead;
|
|
}
|
|
}
|
|
|
|
// Token: 0x1700215B RID: 8539
|
|
// (get) Token: 0x0600D19F RID: 53663 RVA: 0x002FDF90 File Offset: 0x002FC190
|
|
[Token(Token = "0x1700215B")]
|
|
public override bool CanWrite
|
|
{
|
|
[Token(Token = "0x600D19F")]
|
|
[Address(RVA = "0x10B5E50", Offset = "0x10B4E50", VA = "0x1810B5E50", Slot = "9")]
|
|
get
|
|
{
|
|
return this._stream.CanRead;
|
|
}
|
|
}
|
|
|
|
// Token: 0x1700215C RID: 8540
|
|
// (get) Token: 0x0600D1A0 RID: 53664 RVA: 0x002FDFB0 File Offset: 0x002FC1B0
|
|
[Token(Token = "0x1700215C")]
|
|
public override long Length
|
|
{
|
|
[Token(Token = "0x600D1A0")]
|
|
[Address(RVA = "0x10B4400", Offset = "0x10B3400", VA = "0x1810B4400", Slot = "10")]
|
|
get
|
|
{
|
|
bool canRead = this._stream.CanRead;
|
|
throw new NullReferenceException();
|
|
}
|
|
}
|
|
|
|
// Token: 0x1700215D RID: 8541
|
|
// (get) Token: 0x0600D1A1 RID: 53665 RVA: 0x002FDFD0 File Offset: 0x002FC1D0
|
|
// (set) Token: 0x0600D1A2 RID: 53666 RVA: 0x002FDFE4 File Offset: 0x002FC1E4
|
|
[Token(Token = "0x1700215D")]
|
|
public override long Position
|
|
{
|
|
[Token(Token = "0x600D1A1")]
|
|
[Address(RVA = "0x2A855A0", Offset = "0x2A845A0", VA = "0x182A855A0", Slot = "11")]
|
|
get
|
|
{
|
|
/*
|
|
An exception occurred when decompiling this method (0600D1A1)
|
|
|
|
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Int64 BestHTTP.Decompression.Zlib.ZlibBaseStream::get_Position()
|
|
|
|
---> System.Exception: Basic block has to end with unconditional control flow.
|
|
{
|
|
Block_0:
|
|
stloc:NotImplementedException(var_0_05, newobj:NotImplementedException(NotImplementedException::.ctor))
|
|
}
|
|
|
|
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 = "0x600D1A2")]
|
|
[Address(RVA = "0x2A85740", Offset = "0x2A84740", VA = "0x182A85740", Slot = "12")]
|
|
set
|
|
{
|
|
/*
|
|
An exception occurred when decompiling this method (0600D1A2)
|
|
|
|
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void BestHTTP.Decompression.Zlib.ZlibBaseStream::set_Position(System.Int64)
|
|
|
|
---> System.Exception: Basic block has to end with unconditional control flow.
|
|
{
|
|
Block_0:
|
|
stloc:NotImplementedException(var_0_05, newobj:NotImplementedException(NotImplementedException::.ctor))
|
|
}
|
|
|
|
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: 0x0400855D RID: 34141
|
|
[FieldOffset(Offset = "0x28")]
|
|
[Token(Token = "0x400855D")]
|
|
protected internal ZlibCodec _z;
|
|
|
|
// Token: 0x0400855E RID: 34142
|
|
[FieldOffset(Offset = "0x30")]
|
|
[Token(Token = "0x400855E")]
|
|
protected internal ZlibBaseStream.StreamMode _streamMode = (ZlibBaseStream.StreamMode)((ulong)2L);
|
|
|
|
// Token: 0x0400855F RID: 34143
|
|
[FieldOffset(Offset = "0x34")]
|
|
[Token(Token = "0x400855F")]
|
|
protected internal FlushType _flushMode;
|
|
|
|
// Token: 0x04008560 RID: 34144
|
|
[FieldOffset(Offset = "0x38")]
|
|
[Token(Token = "0x4008560")]
|
|
protected internal ZlibStreamFlavor _flavor;
|
|
|
|
// Token: 0x04008561 RID: 34145
|
|
[FieldOffset(Offset = "0x3C")]
|
|
[Token(Token = "0x4008561")]
|
|
protected internal CompressionMode _compressionMode;
|
|
|
|
// Token: 0x04008562 RID: 34146
|
|
[FieldOffset(Offset = "0x40")]
|
|
[Token(Token = "0x4008562")]
|
|
protected internal CompressionLevel _level;
|
|
|
|
// Token: 0x04008563 RID: 34147
|
|
[FieldOffset(Offset = "0x44")]
|
|
[Token(Token = "0x4008563")]
|
|
protected internal bool _leaveOpen;
|
|
|
|
// Token: 0x04008564 RID: 34148
|
|
[FieldOffset(Offset = "0x48")]
|
|
[Token(Token = "0x4008564")]
|
|
protected internal byte[] _workingBuffer;
|
|
|
|
// Token: 0x04008565 RID: 34149
|
|
[FieldOffset(Offset = "0x50")]
|
|
[Token(Token = "0x4008565")]
|
|
protected internal int _bufferSize = (int)((ulong)16384L);
|
|
|
|
// Token: 0x04008566 RID: 34150
|
|
[FieldOffset(Offset = "0x54")]
|
|
[Token(Token = "0x4008566")]
|
|
protected internal int windowBitsMax;
|
|
|
|
// Token: 0x04008567 RID: 34151
|
|
[FieldOffset(Offset = "0x58")]
|
|
[Token(Token = "0x4008567")]
|
|
protected internal byte[] _buf1;
|
|
|
|
// Token: 0x04008568 RID: 34152
|
|
[FieldOffset(Offset = "0x60")]
|
|
[Token(Token = "0x4008568")]
|
|
protected internal Stream _stream;
|
|
|
|
// Token: 0x04008569 RID: 34153
|
|
[FieldOffset(Offset = "0x68")]
|
|
[Token(Token = "0x4008569")]
|
|
protected internal CompressionStrategy Strategy;
|
|
|
|
// Token: 0x0400856A RID: 34154
|
|
[FieldOffset(Offset = "0x70")]
|
|
[Token(Token = "0x400856A")]
|
|
private CRC32 crc;
|
|
|
|
// Token: 0x0400856B RID: 34155
|
|
[FieldOffset(Offset = "0x78")]
|
|
[Token(Token = "0x400856B")]
|
|
protected internal string _GzipFileName;
|
|
|
|
// Token: 0x0400856C RID: 34156
|
|
[FieldOffset(Offset = "0x80")]
|
|
[Token(Token = "0x400856C")]
|
|
protected internal string _GzipComment;
|
|
|
|
// Token: 0x0400856D RID: 34157
|
|
[FieldOffset(Offset = "0x88")]
|
|
[Token(Token = "0x400856D")]
|
|
protected internal DateTime _GzipMtime;
|
|
|
|
// Token: 0x0400856E RID: 34158
|
|
[FieldOffset(Offset = "0x90")]
|
|
[Token(Token = "0x400856E")]
|
|
protected internal int _gzipHeaderByteCount;
|
|
|
|
// Token: 0x0400856F RID: 34159
|
|
[FieldOffset(Offset = "0x94")]
|
|
[Token(Token = "0x400856F")]
|
|
private bool nomoreinput;
|
|
|
|
// Token: 0x0200209A RID: 8346
|
|
[Token(Token = "0x200209A")]
|
|
internal enum StreamMode
|
|
{
|
|
// Token: 0x04008571 RID: 34161
|
|
[Token(Token = "0x4008571")]
|
|
Writer,
|
|
// Token: 0x04008572 RID: 34162
|
|
[Token(Token = "0x4008572")]
|
|
Reader,
|
|
// Token: 0x04008573 RID: 34163
|
|
[Token(Token = "0x4008573")]
|
|
Undefined
|
|
}
|
|
}
|
|
}
|