using System; using System.IO; using Cpp2IlInjected; namespace BestHTTP.Decompression.Crc { // Token: 0x0200209D RID: 8349 [Token(Token = "0x200209D")] internal class CRC32 { // Token: 0x1700215F RID: 8543 // (get) Token: 0x0600D1BA RID: 53690 RVA: 0x002FE4F0 File Offset: 0x002FC6F0 [Token(Token = "0x1700215F")] public long TotalBytesRead { [Token(Token = "0x600D1BA")] [Address(RVA = "0x4157B0", Offset = "0x4147B0", VA = "0x1804157B0")] get { return this._TotalBytesRead; } } // Token: 0x17002160 RID: 8544 // (get) Token: 0x0600D1BB RID: 53691 RVA: 0x002FE504 File Offset: 0x002FC704 [Token(Token = "0x17002160")] public int Crc32Result { [Token(Token = "0x600D1BB")] [Address(RVA = "0xF9F390", Offset = "0xF9E390", VA = "0x180F9F390")] get { /* An exception occurred when decompiling this method (0600D1BB) ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Int32 BestHTTP.Decompression.Crc.CRC32::get_Crc32Result() ---> System.Exception: Basic block has to end with unconditional control flow. { Block_0: stloc:uint32(var_0_06, ldfld:uint32(CRC32::_register, ldloc:CRC32(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: 0x0600D1BC RID: 53692 RVA: 0x002FE518 File Offset: 0x002FC718 [Token(Token = "0x600D1BC")] [Address(RVA = "0x2404810", Offset = "0x2403810", VA = "0x182404810")] public int GetCrc32(Stream input) { int num = 0; return this.GetCrc32AndCopy(input, num); } // Token: 0x0600D1BD RID: 53693 RVA: 0x002FE530 File Offset: 0x002FC730 [Token(Token = "0x600D1BD")] [Address(RVA = "0x2404580", Offset = "0x2403580", VA = "0x182404580")] public int GetCrc32AndCopy(Stream input, Stream output) { /* An exception occurred when decompiling this method (0600D1BD) ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Int32 BestHTTP.Decompression.Crc.CRC32::GetCrc32AndCopy(System.IO.Stream,System.IO.Stream) ---> System.Exception: Basic block has to end with unconditional control flow. { IL_80: stloc:Exception(var_10_8A, newobj:Exception(Exception::.ctor, ldstr:string("The input stream must not be null."))) } 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: 0x0600D1BE RID: 53694 RVA: 0x002FE5C8 File Offset: 0x002FC7C8 [Token(Token = "0x600D1BE")] [Address(RVA = "0xF9EBB0", Offset = "0xF9DBB0", VA = "0x180F9EBB0")] public int ComputeCrc32(int W, byte B) { uint num = this.crc32Table[W]; throw new NullReferenceException(); } // Token: 0x0600D1BF RID: 53695 RVA: 0x002FE5E8 File Offset: 0x002FC7E8 [Token(Token = "0x600D1BF")] [Address(RVA = "0xF9EBB0", Offset = "0xF9DBB0", VA = "0x180F9EBB0")] internal int _InternalComputeCrc32(uint W, byte B) { uint num = this.crc32Table[(int)W]; throw new NullReferenceException(); } // Token: 0x0600D1C0 RID: 53696 RVA: 0x002FE608 File Offset: 0x002FC808 [Token(Token = "0x600D1C0")] [Address(RVA = "0x2404830", Offset = "0x2403830", VA = "0x182404830")] public void SlurpBlock(byte[] block, int offset, int count) { /* An exception occurred when decompiling this method (0600D1C0) ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void BestHTTP.Decompression.Crc.CRC32::SlurpBlock(System.Byte[],System.Int32,System.Int32) ---> System.Exception: Basic block has to end with unconditional control flow. { IL_36: stloc:Exception(var_4_40, newobj:Exception(Exception::.ctor, ldstr:string("The data buffer must not be null."))) } 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: 0x0600D1C1 RID: 53697 RVA: 0x002FE658 File Offset: 0x002FC858 [Token(Token = "0x600D1C1")] [Address(RVA = "0x2404A60", Offset = "0x2403A60", VA = "0x182404A60")] public void UpdateCRC(byte b) { uint register = this._register; uint[] array = this.crc32Table; if (!this.reverseBits) { uint num = array[(int)register]; this._register = num; return; } uint num2 = array[(int)register]; this._register = num2; } // Token: 0x0600D1C2 RID: 53698 RVA: 0x002FE6A4 File Offset: 0x002FC8A4 [Token(Token = "0x600D1C2")] [Address(RVA = "0x2404990", Offset = "0x2403990", VA = "0x182404990")] public void UpdateCRC(byte b, int n) { if (n > 0) { int num = n - 1; uint[] array = this.crc32Table; if (!this.reverseBits) { } uint register = this._register; uint num2 = array[(int)register]; this._register = num2; } } // Token: 0x0600D1C3 RID: 53699 RVA: 0x0000220F File Offset: 0x0000040F [Token(Token = "0x600D1C3")] [Address(RVA = "0xF9F000", Offset = "0xF9E000", VA = "0x180F9F000")] private static uint ReverseBits(uint data) { throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method."); } // Token: 0x0600D1C4 RID: 53700 RVA: 0x002FE6E8 File Offset: 0x002FC8E8 [Token(Token = "0x600D1C4")] [Address(RVA = "0xF9F060", Offset = "0xF9E060", VA = "0x180F9F060")] private static byte ReverseBits(byte data) { /* An exception occurred when decompiling this method (0600D1C4) ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Byte BestHTTP.Decompression.Crc.CRC32::ReverseBits(System.Byte) ---> System.Exception: Basic block has to end with unconditional control flow. { Block_0: stloc:int64(var_0_0F, mul:uint32[exp:int64](mul:uint32(ldloc:uint8[exp:uint32](data), conv.u4:uint32(ldc.i4:int32[exp:uint32](131586))), conv.u4:uint32(ldc.i4:int32[exp:uint32](16781313)))) } 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: 0x0600D1C5 RID: 53701 RVA: 0x002FE704 File Offset: 0x002FC904 [Token(Token = "0x600D1C5")] [Address(RVA = "0x2404430", Offset = "0x2403430", VA = "0x182404430")] private void GenerateLookupTable() { uint[] array = new uint[256]; this.crc32Table = array; int num = 0; if (num == 1) { } uint num2 = this.dwPolynomial; while (num != 1) { } uint[] array2 = this.crc32Table; ulong num3; if ((this.reverseBits ? 1UL : 0UL) == num3) { array2[0] = num2; } long num4 = (long)(num * (int)((uint)131586)); num2 += num2; long num5 = num4 * (long)((uint)16781313); array2[0] = (uint)num; num++; while (num5 != (long)array2.Length) { } } // Token: 0x0600D1C6 RID: 53702 RVA: 0x002FE78C File Offset: 0x002FC98C [Token(Token = "0x600D1C6")] [Address(RVA = "0xF9F460", Offset = "0xF9E460", VA = "0x180F9F460")] private uint gf2_matrix_times(uint[] matrix, uint vec) { int num = 0; if (vec != (uint)0) { if (vec != (uint)1) { } num++; while (vec >= (uint)2) { } } throw new NullReferenceException(); } // Token: 0x0600D1C7 RID: 53703 RVA: 0x002FE7B4 File Offset: 0x002FC9B4 [Token(Token = "0x600D1C7")] [Address(RVA = "0xF9F3A0", Offset = "0xF9E3A0", VA = "0x180F9F3A0")] private void gf2_matrix_square(uint[] square, uint[] mat) { int num = 0; int length = mat.Length; int num2 = 0; uint num3; if (num3 != (uint)0) { if (num3 != (uint)1) { } num2++; while (num3 >= (uint)2) { } } num++; } // Token: 0x0600D1C8 RID: 53704 RVA: 0x002FE7EC File Offset: 0x002FC9EC [Token(Token = "0x600D1C8")] [Address(RVA = "0x2404010", Offset = "0x2403010", VA = "0x182404010")] public void Combine(int crc, int length) { uint[] array = new uint[32]; uint[] array2 = new uint[32]; if (length != 0) { uint register = this._register; uint num = this.dwPolynomial; array2[0] = num; uint num2; num2 += (uint)1; array2[0] = num2; num2 += num2; int num3 = 0; int length2 = array2.Length; int num4 = 0; uint num5; if (num5 != (uint)0) { if (num5 != (uint)1) { } num4++; while (num5 >= (uint)2) { } } num3++; int num6 = 0; int length3 = array.Length; int num7 = 0; uint num8; if (num8 != (uint)0) { if (num8 != (uint)1) { } num7++; while (num8 >= (uint)2) { } } num6++; int num9 = 0; int length4 = array2.Length; int num10 = 0; uint num11; if (num11 != (uint)0) { if (num11 != (uint)1) { } num10++; while (num11 >= (uint)2) { } } num9++; int i; if (length != 1) { i = 0; int num12 = 0; if (register != (uint)0) { if (register != (uint)1) { } num12++; while (register >= (uint)2) { } } } int num16; if (register != (uint)2) { int num13 = 0; int length5 = array.Length; int num14 = 0; uint num15; if (num15 != (uint)0) { num11 = num15; if (num15 != (uint)1) { } num14++; while (num11 >= (uint)2) { } } num13++; if (length != 1) { num16 = 0; int num17 = 0; if (i != 0) { if (i != 1) { } num17++; while (i >= 2) { } } } while (i != 2) { } } this._register = (uint)num16; } } // Token: 0x0600D1C9 RID: 53705 RVA: 0x002FE950 File Offset: 0x002FCB50 [Token(Token = "0x600D1C9")] [Address(RVA = "0x2404C70", Offset = "0x2403C70", VA = "0x182404C70")] public CRC32() { } // Token: 0x0600D1CA RID: 53706 RVA: 0x002FE960 File Offset: 0x002FCB60 [Token(Token = "0x600D1CA")] [Address(RVA = "0x2404C80", Offset = "0x2403C80", VA = "0x182404C80")] public CRC32(bool reverseBits) { } // Token: 0x0600D1CB RID: 53707 RVA: 0x002FE970 File Offset: 0x002FCB70 [Token(Token = "0x600D1CB")] [Address(RVA = "0x2404B00", Offset = "0x2403B00", VA = "0x182404B00")] public CRC32(int polynomial, bool reverseBits) { this._register = (uint)((ulong)4294967295L); base..ctor(); this.reverseBits = reverseBits; this.dwPolynomial = (uint)polynomial; uint[] array = new uint[256]; this.crc32Table = array; int num = 0; if (num != 1) { } while (num != 1) { } uint[] array2 = this.crc32Table; ulong num2; if ((this.reverseBits ? 1UL : 0UL) == num2) { array2[0] = (uint)num; } long num3 = (long)(num * (int)((uint)131586)); num += num; long num4 = num3 * (long)((uint)16781313); array2[0] = (uint)num; num++; while (num4 != (long)array2.Length) { } } // Token: 0x0600D1CC RID: 53708 RVA: 0x002FEA10 File Offset: 0x002FCC10 [Token(Token = "0x600D1CC")] [Address(RVA = "0x2404820", Offset = "0x2403820", VA = "0x182404820")] public void Reset() { this._register = (uint)((ulong)4294967295L); } // Token: 0x0400858D RID: 34189 [FieldOffset(Offset = "0x10")] [Token(Token = "0x400858D")] private uint dwPolynomial; // Token: 0x0400858E RID: 34190 [FieldOffset(Offset = "0x18")] [Token(Token = "0x400858E")] private long _TotalBytesRead; // Token: 0x0400858F RID: 34191 [FieldOffset(Offset = "0x20")] [Token(Token = "0x400858F")] private bool reverseBits; // Token: 0x04008590 RID: 34192 [FieldOffset(Offset = "0x28")] [Token(Token = "0x4008590")] private uint[] crc32Table; // Token: 0x04008591 RID: 34193 [Token(Token = "0x4008591")] private const int BUFFER_SIZE = 8192; // Token: 0x04008592 RID: 34194 [FieldOffset(Offset = "0x30")] [Token(Token = "0x4008592")] private uint _register; } }