m
This commit is contained in:
@@ -0,0 +1,358 @@
|
||||
using System;
|
||||
using BestHTTP.Extensions;
|
||||
using Cpp2IlInjected;
|
||||
|
||||
namespace BestHTTP.Decompression.Zlib
|
||||
{
|
||||
// Token: 0x0200208C RID: 8332
|
||||
[Token(Token = "0x200208C")]
|
||||
internal sealed class InflateManager
|
||||
{
|
||||
// Token: 0x17002154 RID: 8532
|
||||
// (get) Token: 0x0600D16D RID: 53613 RVA: 0x002FC0E0 File Offset: 0x002FA2E0
|
||||
// (set) Token: 0x0600D16E RID: 53614 RVA: 0x002FC0F4 File Offset: 0x002FA2F4
|
||||
[Token(Token = "0x17002154")]
|
||||
internal bool HandleRfc1950HeaderBytes
|
||||
{
|
||||
[Token(Token = "0x600D16D")]
|
||||
[Address(RVA = "0x5AB2E0", Offset = "0x5AA2E0", VA = "0x1805AB2E0")]
|
||||
get
|
||||
{
|
||||
return this._handleRfc1950HeaderBytes;
|
||||
}
|
||||
[Token(Token = "0x600D16E")]
|
||||
[Address(RVA = "0x5AB400", Offset = "0x5AA400", VA = "0x1805AB400")]
|
||||
set
|
||||
{
|
||||
this._handleRfc1950HeaderBytes = value;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x0600D16F RID: 53615 RVA: 0x002FC108 File Offset: 0x002FA308
|
||||
[Token(Token = "0x600D16F")]
|
||||
[Address(RVA = "0x1BCA0F0", Offset = "0x1BC90F0", VA = "0x181BCA0F0")]
|
||||
public InflateManager()
|
||||
{
|
||||
}
|
||||
|
||||
// Token: 0x0600D170 RID: 53616 RVA: 0x002FC124 File Offset: 0x002FA324
|
||||
[Token(Token = "0x600D170")]
|
||||
[Address(RVA = "0x10AFB40", Offset = "0x10AEB40", VA = "0x1810AFB40")]
|
||||
public InflateManager(bool expectRfc1950HeaderBytes)
|
||||
{
|
||||
this._handleRfc1950HeaderBytes = expectRfc1950HeaderBytes;
|
||||
}
|
||||
|
||||
// Token: 0x0600D171 RID: 53617 RVA: 0x002FC148 File Offset: 0x002FA348
|
||||
[Token(Token = "0x600D171")]
|
||||
[Address(RVA = "0x241B980", Offset = "0x241A980", VA = "0x18241B980")]
|
||||
internal int Reset()
|
||||
{
|
||||
ZlibCodec codec = this._codec;
|
||||
int num = 0;
|
||||
codec.TotalBytesOut = (long)num;
|
||||
codec.TotalBytesIn = (long)num;
|
||||
this._codec.Message = num;
|
||||
this.mode = (InflateManager.InflateManagerMode)((uint)7);
|
||||
uint num2 = this.blocks.Reset();
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Token: 0x0600D172 RID: 53618 RVA: 0x002FC194 File Offset: 0x002FA394
|
||||
[Token(Token = "0x600D172")]
|
||||
[Address(RVA = "0x241AD90", Offset = "0x2419D90", VA = "0x18241AD90")]
|
||||
internal int End()
|
||||
{
|
||||
InflateBlocks inflateBlocks = this.blocks;
|
||||
if (inflateBlocks != 0)
|
||||
{
|
||||
uint num = inflateBlocks.Reset();
|
||||
VariableSizedBufferPool.Release(inflateBlocks.window);
|
||||
int num2 = 0;
|
||||
inflateBlocks.window = num2;
|
||||
inflateBlocks.hufts = num2;
|
||||
this.blocks = num2;
|
||||
return num2;
|
||||
}
|
||||
int num3 = 0;
|
||||
this.blocks = num3;
|
||||
return num3;
|
||||
}
|
||||
|
||||
// Token: 0x0600D173 RID: 53619 RVA: 0x002FC1E4 File Offset: 0x002FA3E4
|
||||
[Token(Token = "0x600D173")]
|
||||
[Address(RVA = "0x241B760", Offset = "0x241A760", VA = "0x18241B760")]
|
||||
internal int Initialize(ZlibCodec codec, int w)
|
||||
{
|
||||
this._codec = codec;
|
||||
int num = 0;
|
||||
codec.Message = num;
|
||||
this.blocks = num;
|
||||
this.wbits = w;
|
||||
int[] array = new int[1];
|
||||
InflateBlocks inflateBlocks;
|
||||
inflateBlocks.bb = array;
|
||||
int[] array2 = new int[1];
|
||||
inflateBlocks.tb = array2;
|
||||
InflateCodes inflateCodes = new InflateCodes();
|
||||
inflateBlocks.codes = inflateCodes;
|
||||
InfTree infTree = new InfTree();
|
||||
inflateBlocks.inftree = infTree;
|
||||
inflateBlocks._codec = codec;
|
||||
int[] array3 = new int[4320];
|
||||
inflateBlocks.hufts = array3;
|
||||
byte[] array4;
|
||||
inflateBlocks.window = array4;
|
||||
inflateBlocks.checkfn = num;
|
||||
inflateBlocks.mode = (InflateBlocks.InflateBlockMode)num;
|
||||
uint num2 = inflateBlocks.Reset();
|
||||
this.blocks = inflateBlocks;
|
||||
ZlibCodec codec2 = this._codec;
|
||||
codec2.TotalBytesOut = (long)num;
|
||||
codec2.TotalBytesIn = (long)num;
|
||||
this._codec.Message = num;
|
||||
this.mode = (InflateManager.InflateManagerMode)((uint)7);
|
||||
uint num3 = this.blocks.Reset();
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Token: 0x0600D174 RID: 53620 RVA: 0x002FC2E0 File Offset: 0x002FA4E0
|
||||
[Token(Token = "0x600D174")]
|
||||
[Address(RVA = "0x241AE30", Offset = "0x2419E30", VA = "0x18241AE30")]
|
||||
internal int Inflate(FlushType flush)
|
||||
{
|
||||
/*
|
||||
An exception occurred when decompiling this method (0600D174)
|
||||
|
||||
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Int32 BestHTTP.Decompression.Zlib.InflateManager::Inflate(BestHTTP.Decompression.Zlib.FlushType)
|
||||
|
||||
---> System.Exception: Basic block has to end with unconditional control flow.
|
||||
{
|
||||
IL_5BD:
|
||||
stloc:ZlibException(var_104_5C7, newobj:ZlibException(ZlibException::.ctor, ldstr:string("Stream error.")))
|
||||
}
|
||||
|
||||
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: 0x0600D175 RID: 53621 RVA: 0x002FC8B8 File Offset: 0x002FAAB8
|
||||
[Token(Token = "0x600D175")]
|
||||
[Address(RVA = "0x241B9D0", Offset = "0x241A9D0", VA = "0x18241B9D0")]
|
||||
internal int SetDictionary(byte[] dictionary)
|
||||
{
|
||||
/*
|
||||
An exception occurred when decompiling this method (0600D175)
|
||||
|
||||
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Int32 BestHTTP.Decompression.Zlib.InflateManager::SetDictionary(System.Byte[])
|
||||
|
||||
---> System.Exception: Basic block has to end with unconditional control flow.
|
||||
{
|
||||
IL_9A:
|
||||
stloc:ZlibException(var_14_A4, newobj:ZlibException(ZlibException::.ctor, ldstr:string("Stream error.")))
|
||||
}
|
||||
|
||||
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: 0x0600D176 RID: 53622 RVA: 0x002FC96C File Offset: 0x002FAB6C
|
||||
[Token(Token = "0x600D176")]
|
||||
[Address(RVA = "0x241BB90", Offset = "0x241AB90", VA = "0x18241BB90")]
|
||||
internal int Sync()
|
||||
{
|
||||
int num = 0;
|
||||
if (this.mode != InflateManager.InflateManagerMode.BAD)
|
||||
{
|
||||
this.mode = (InflateManager.InflateManagerMode)((ulong)13L);
|
||||
this.marker = num;
|
||||
}
|
||||
ZlibCodec codec = this._codec;
|
||||
int availableBytesIn = codec.AvailableBytesIn;
|
||||
if (availableBytesIn != 0)
|
||||
{
|
||||
int num2 = codec.NextIn;
|
||||
int num3 = this.marker;
|
||||
if (num3 < 4)
|
||||
{
|
||||
byte b = this._codec.InputBuffer[num2];
|
||||
byte[] array = InflateManager.mark;
|
||||
byte[] inputBuffer = this._codec.InputBuffer;
|
||||
if ("{il2cpp array field local11->}" == num)
|
||||
{
|
||||
uint num4;
|
||||
num4 -= (uint)num3;
|
||||
}
|
||||
num++;
|
||||
num2++;
|
||||
while ("{il2cpp array field local11->}" != num)
|
||||
{
|
||||
}
|
||||
}
|
||||
ZlibCodec codec2 = this._codec;
|
||||
this._codec.NextIn = num2;
|
||||
this._codec.AvailableBytesIn = availableBytesIn;
|
||||
this.marker = num;
|
||||
if (num == 4)
|
||||
{
|
||||
ZlibCodec codec3 = this._codec;
|
||||
long totalBytesIn = codec3.TotalBytesIn;
|
||||
long totalBytesOut = codec3.TotalBytesOut;
|
||||
codec3.TotalBytesOut = (long)num;
|
||||
codec3.TotalBytesIn = (long)num;
|
||||
this._codec.Message = num;
|
||||
uint num5;
|
||||
this.mode = (InflateManager.InflateManagerMode)num5;
|
||||
uint num6 = this.blocks.Reset();
|
||||
this._codec.TotalBytesIn = totalBytesIn;
|
||||
this._codec.TotalBytesOut = totalBytesOut;
|
||||
int num7 = 0;
|
||||
this.mode = (InflateManager.InflateManagerMode)num5;
|
||||
return num7;
|
||||
}
|
||||
}
|
||||
throw new NullReferenceException();
|
||||
}
|
||||
|
||||
// Token: 0x0600D177 RID: 53623 RVA: 0x002FCAA8 File Offset: 0x002FACA8
|
||||
[Token(Token = "0x600D177")]
|
||||
[Address(RVA = "0x241BB60", Offset = "0x241AB60", VA = "0x18241BB60")]
|
||||
internal int SyncPoint(ZlibCodec z)
|
||||
{
|
||||
bool flag = this.blocks.mode == InflateBlocks.InflateBlockMode.LENS;
|
||||
throw new NullReferenceException();
|
||||
}
|
||||
|
||||
// Token: 0x0600D178 RID: 53624 RVA: 0x002FCACC File Offset: 0x002FACCC
|
||||
// Note: this type is marked as 'beforefieldinit'.
|
||||
[Token(Token = "0x600D178")]
|
||||
[Address(RVA = "0x241BE00", Offset = "0x241AE00", VA = "0x18241BE00")]
|
||||
static InflateManager()
|
||||
{
|
||||
byte[] array = new byte[4];
|
||||
array[0] = (byte)((ulong)255L);
|
||||
array[0] = (byte)((ulong)255L);
|
||||
InflateManager.mark = array;
|
||||
}
|
||||
|
||||
// Token: 0x040084FF RID: 34047
|
||||
[Token(Token = "0x40084FF")]
|
||||
private const int PRESET_DICT = 32;
|
||||
|
||||
// Token: 0x04008500 RID: 34048
|
||||
[Token(Token = "0x4008500")]
|
||||
private const int Z_DEFLATED = 8;
|
||||
|
||||
// Token: 0x04008501 RID: 34049
|
||||
[FieldOffset(Offset = "0x10")]
|
||||
[Token(Token = "0x4008501")]
|
||||
private InflateManager.InflateManagerMode mode;
|
||||
|
||||
// Token: 0x04008502 RID: 34050
|
||||
[FieldOffset(Offset = "0x18")]
|
||||
[Token(Token = "0x4008502")]
|
||||
internal ZlibCodec _codec;
|
||||
|
||||
// Token: 0x04008503 RID: 34051
|
||||
[FieldOffset(Offset = "0x20")]
|
||||
[Token(Token = "0x4008503")]
|
||||
internal int method;
|
||||
|
||||
// Token: 0x04008504 RID: 34052
|
||||
[FieldOffset(Offset = "0x24")]
|
||||
[Token(Token = "0x4008504")]
|
||||
internal uint computedCheck;
|
||||
|
||||
// Token: 0x04008505 RID: 34053
|
||||
[FieldOffset(Offset = "0x28")]
|
||||
[Token(Token = "0x4008505")]
|
||||
internal uint expectedCheck;
|
||||
|
||||
// Token: 0x04008506 RID: 34054
|
||||
[FieldOffset(Offset = "0x2C")]
|
||||
[Token(Token = "0x4008506")]
|
||||
internal int marker;
|
||||
|
||||
// Token: 0x04008507 RID: 34055
|
||||
[FieldOffset(Offset = "0x30")]
|
||||
[Token(Token = "0x4008507")]
|
||||
private bool _handleRfc1950HeaderBytes = true;
|
||||
|
||||
// Token: 0x04008508 RID: 34056
|
||||
[FieldOffset(Offset = "0x34")]
|
||||
[Token(Token = "0x4008508")]
|
||||
internal int wbits;
|
||||
|
||||
// Token: 0x04008509 RID: 34057
|
||||
[FieldOffset(Offset = "0x38")]
|
||||
[Token(Token = "0x4008509")]
|
||||
internal InflateBlocks blocks;
|
||||
|
||||
// Token: 0x0400850A RID: 34058
|
||||
[Token(Token = "0x400850A")]
|
||||
private static readonly byte[] mark;
|
||||
|
||||
// Token: 0x0200208D RID: 8333
|
||||
[Token(Token = "0x200208D")]
|
||||
private enum InflateManagerMode
|
||||
{
|
||||
// Token: 0x0400850C RID: 34060
|
||||
[Token(Token = "0x400850C")]
|
||||
METHOD,
|
||||
// Token: 0x0400850D RID: 34061
|
||||
[Token(Token = "0x400850D")]
|
||||
FLAG,
|
||||
// Token: 0x0400850E RID: 34062
|
||||
[Token(Token = "0x400850E")]
|
||||
DICT4,
|
||||
// Token: 0x0400850F RID: 34063
|
||||
[Token(Token = "0x400850F")]
|
||||
DICT3,
|
||||
// Token: 0x04008510 RID: 34064
|
||||
[Token(Token = "0x4008510")]
|
||||
DICT2,
|
||||
// Token: 0x04008511 RID: 34065
|
||||
[Token(Token = "0x4008511")]
|
||||
DICT1,
|
||||
// Token: 0x04008512 RID: 34066
|
||||
[Token(Token = "0x4008512")]
|
||||
DICT0,
|
||||
// Token: 0x04008513 RID: 34067
|
||||
[Token(Token = "0x4008513")]
|
||||
BLOCKS,
|
||||
// Token: 0x04008514 RID: 34068
|
||||
[Token(Token = "0x4008514")]
|
||||
CHECK4,
|
||||
// Token: 0x04008515 RID: 34069
|
||||
[Token(Token = "0x4008515")]
|
||||
CHECK3,
|
||||
// Token: 0x04008516 RID: 34070
|
||||
[Token(Token = "0x4008516")]
|
||||
CHECK2,
|
||||
// Token: 0x04008517 RID: 34071
|
||||
[Token(Token = "0x4008517")]
|
||||
CHECK1,
|
||||
// Token: 0x04008518 RID: 34072
|
||||
[Token(Token = "0x4008518")]
|
||||
DONE,
|
||||
// Token: 0x04008519 RID: 34073
|
||||
[Token(Token = "0x4008519")]
|
||||
BAD
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user