Files
Jan2021-Cpp2Il-Dump/Assembly-CSharp/BestHTTP/SecureProtocol/Org/BouncyCastle/Utilities/Zlib/ZTree.cs
T
2026-04-08 23:40:05 +02:00

400 lines
10 KiB
C#

using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Zlib
{
// Token: 0x0200135A RID: 4954
[Token(Token = "0x200135A")]
[StructLayout(3)]
internal sealed class ZTree
{
// Token: 0x06007D52 RID: 32082 RVA: 0x001A4FE8 File Offset: 0x001A31E8
[Token(Token = "0x6007D52")]
[Address(RVA = "0x2039140", Offset = "0x2037B40", VA = "0x182039140")]
internal static int d_code(int dist)
{
if (dist < 256)
{
byte[] dist_code = ZTree._dist_code;
}
byte[] dist_code2 = ZTree._dist_code;
throw new NullReferenceException();
}
// Token: 0x06007D53 RID: 32083 RVA: 0x001A5010 File Offset: 0x001A3210
[Token(Token = "0x6007D53")]
[Address(RVA = "0x2039230", Offset = "0x2037C30", VA = "0x182039230")]
internal void gen_bitlen(Deflate s)
{
StaticTree staticTree = this.stat_desc;
short[] array = this.dyn_tree;
short[] static_tree = staticTree.static_tree;
int i = 0;
int[] extra_bits = staticTree.extra_bits;
int extra_base = staticTree.extra_base;
int num = staticTree.max_length;
short[] bl_count = s.bl_count;
i++;
bl_count[0] = (short)i;
while (i <= 15)
{
}
int[] heap = s.heap;
int num2 = s.heap_max;
num2++;
array[0] = (short)i;
int num3 = s.heap_max;
num3++;
if (num3 < 573)
{
int[] heap2 = s.heap;
int num4 = array.Length;
num2 = num3;
int num5 = heap2[num2];
num2 += num2;
num2++;
num2++;
num4 = num;
if (num2 <= num)
{
num4 = num2;
}
array[0] = (short)num4;
short[] bl_count2 = s.bl_count;
num5 -= extra_base;
int num6 = extra_bits[num5];
int num7 = num5 * num5;
if (static_tree != 0)
{
num7 += num6;
}
num3++;
if (i != 0)
{
short[] bl_count3 = s.bl_count;
int num8 = num - 1;
short num9 = bl_count3[num8];
bl_count3[0] = num9;
short[] bl_count4 = s.bl_count;
num8++;
short[] bl_count5 = s.bl_count;
if (num != 0)
{
short[] bl_count6 = s.bl_count;
if (num8 != 0)
{
int[] heap3 = s.heap;
num = num3;
int num10 = heap3[num];
int num11 = array.Length;
num10 += num10;
int num12 = num10 + 1;
if (num4 != num)
{
num11 = num;
num11 -= num4;
array[0] = (short)num;
}
while (num8 != 0)
{
}
}
while (num8 != 0)
{
}
}
}
}
}
// Token: 0x06007D54 RID: 32084 RVA: 0x001A51C8 File Offset: 0x001A33C8
[Token(Token = "0x6007D54")]
[Address(RVA = "0x2038A80", Offset = "0x2037480", VA = "0x182038A80")]
internal void build_tree(Deflate s)
{
StaticTree staticTree = this.stat_desc;
short[] array = this.dyn_tree;
short[] static_tree = staticTree.static_tree;
int num = staticTree.elems;
int num2 = 0;
s.heap_max = (int)((ulong)573L);
s.heap_len = num2;
if (num > 0)
{
int length = array.Length;
if ("{il2cpp array field local3->}" == num2)
{
num2++;
array[0] = (short)num2;
}
int heap_len = s.heap_len;
int[] heap = s.heap;
int num3 = heap_len + 1;
s.heap_len = num3;
int num4 = heap_len + 1;
heap[0] = num2;
byte[] depth = s.depth;
num2++;
num2 += 2;
}
int num5 = s.heap_len;
if (num5 < 2)
{
int[] heap2 = s.heap;
int num6 = num5 + 1;
s.heap_len = num6;
if (num2 < 2)
{
}
num5++;
heap2[0] = num2;
uint num7;
array[0] = (short)num7;
byte[] depth2 = s.depth;
while (static_tree == 0)
{
}
}
this.max_code = 1;
int i = s.heap_len;
i -= 0;
s.pqdownheap(array, i);
while (i >= 1)
{
}
int[] heap3 = s.heap;
int heap_len2 = s.heap_len;
int num8 = heap3[0];
int num9 = heap_len2 - 1;
s.heap_len = num9;
int length2 = heap3.Length;
int num10 = heap3[heap_len2];
heap3[0] = num10;
uint num11;
s.pqdownheap(array, (int)num11);
int[] heap4 = s.heap;
int heap_max = s.heap_max;
int num12 = heap4[0];
int num13 = heap_max - 1;
s.heap_max = num13;
int num14 = heap_max - 1;
heap4[0] = num8;
int heap_max2 = s.heap_max;
int[] heap5 = s.heap;
int num15 = heap_max2 - 1;
s.heap_max = num15;
int num16 = heap_max2 - 1;
heap5[0] = num12;
int length3 = array.Length;
short num17 = array[heap5];
array[0] = num17;
int length4 = s.depth.Length;
byte b2;
byte b3;
byte b = Math.Max(b2, b3);
array[0] = (short)num;
int num18 = heap_max2 + 1;
array[0] = (short)num;
i += 2;
int[] heap6 = s.heap;
num++;
heap6[0] = num;
s.pqdownheap(array, 1);
while (s.heap_len >= 2)
{
}
int heap_max3 = s.heap_max;
int[] heap7 = s.heap;
int num19 = heap_max3 - 1;
s.heap_max = num19;
int num20 = s.heap[0];
int num21 = heap_max3 - 1;
heap7[0] = num20;
short[] bl_count = s.bl_count;
int num22;
ZTree.gen_codes(array, num22, bl_count);
}
// Token: 0x06007D55 RID: 32085 RVA: 0x001A5468 File Offset: 0x001A3668
[Token(Token = "0x6007D55")]
[Address(RVA = "0x20396E0", Offset = "0x20380E0", VA = "0x1820396E0")]
internal static void gen_codes(short[] tree, int max_code, short[] bl_count)
{
short[] array = new short[16];
int i = 0;
i += i;
array[0] = (short)i;
while (1UL <= (ulong)15L)
{
}
if (bl_count != 0)
{
short num = array[bl_count] + 1;
array[0] = num;
int num2 = 0;
num2 += num2;
tree[0] = (short)num2;
}
i++;
i += 2;
while (i <= max_code)
{
}
}
// Token: 0x06007D56 RID: 32086 RVA: 0x001A54D0 File Offset: 0x001A36D0
[Token(Token = "0x6007D56")]
[Address(RVA = "0xE33D40", Offset = "0xE32740", VA = "0x180E33D40")]
internal static int bi_reverse(int code, int len)
{
int num = 0;
int num2 = len - 1;
return num + num;
}
// Token: 0x06007D57 RID: 32087 RVA: 0x001A54E8 File Offset: 0x001A36E8
[Token(Token = "0x6007D57")]
[Address(RVA = "0x3C1670", Offset = "0x3C0070", VA = "0x1803C1670")]
public ZTree()
{
}
// Token: 0x06007D58 RID: 32088 RVA: 0x001A54FC File Offset: 0x001A36FC
// Note: this type is marked as 'beforefieldinit'.
[Token(Token = "0x6007D58")]
[Address(RVA = "0x2038890", Offset = "0x2037290", VA = "0x182038890")]
static ZTree()
{
int[] array = new int[29];
RuntimeHelpers.InitializeArray(array, fieldof(<PrivateImplementationDetails>.67C0E784F3654B008A81E2988588CF4956CCF3DA).FieldHandle);
ZTree.extra_lbits = array;
int[] array2 = new int[30];
RuntimeHelpers.InitializeArray(array2, fieldof(<PrivateImplementationDetails>.79D521E6E3E55103005E9CC3FA43B3174FAF090F).FieldHandle);
ZTree.extra_dbits = array2;
int[] array3 = new int[19];
RuntimeHelpers.InitializeArray(array3, fieldof(<PrivateImplementationDetails>.8457F44B035C9073EE2D1F132D0A8AF5631DCDC8).FieldHandle);
ZTree.extra_blbits = array3;
byte[] array4 = new byte[19];
RuntimeHelpers.InitializeArray(array4, fieldof(<PrivateImplementationDetails>.9F8365E9D6C62D3B47026EC465B05A7B5526B5CD).FieldHandle);
ZTree.bl_order = array4;
byte[] array5 = new byte[512];
RuntimeHelpers.InitializeArray(array5, fieldof(<PrivateImplementationDetails>.3544182260B8A15D332367E48C7530FC0E901FD3).FieldHandle);
ZTree._dist_code = array5;
byte[] array6 = new byte[256];
RuntimeHelpers.InitializeArray(array6, fieldof(<PrivateImplementationDetails>.6A316789EED01119DE92841832701A40AB0CABD6).FieldHandle);
ZTree._length_code = array6;
int[] array7 = new int[29];
RuntimeHelpers.InitializeArray(array7, fieldof(<PrivateImplementationDetails>.2E868D9F2085DF93F11F58DE61C05E0D8A8F4A71).FieldHandle);
ZTree.base_length = array7;
int[] array8 = new int[30];
RuntimeHelpers.InitializeArray(array8, fieldof(<PrivateImplementationDetails>.5581A70566F03554D8048EDBFC6E6B399AF9BCB1).FieldHandle);
ZTree.base_dist = array8;
}
// Token: 0x04005A0F RID: 23055
[Token(Token = "0x4005A0F")]
private const int MAX_BITS = 15;
// Token: 0x04005A10 RID: 23056
[Token(Token = "0x4005A10")]
private const int BL_CODES = 19;
// Token: 0x04005A11 RID: 23057
[Token(Token = "0x4005A11")]
private const int D_CODES = 30;
// Token: 0x04005A12 RID: 23058
[Token(Token = "0x4005A12")]
private const int LITERALS = 256;
// Token: 0x04005A13 RID: 23059
[Token(Token = "0x4005A13")]
private const int LENGTH_CODES = 29;
// Token: 0x04005A14 RID: 23060
[Token(Token = "0x4005A14")]
private const int L_CODES = 286;
// Token: 0x04005A15 RID: 23061
[Token(Token = "0x4005A15")]
private const int HEAP_SIZE = 573;
// Token: 0x04005A16 RID: 23062
[Token(Token = "0x4005A16")]
internal const int MAX_BL_BITS = 7;
// Token: 0x04005A17 RID: 23063
[Token(Token = "0x4005A17")]
internal const int END_BLOCK = 256;
// Token: 0x04005A18 RID: 23064
[Token(Token = "0x4005A18")]
internal const int REP_3_6 = 16;
// Token: 0x04005A19 RID: 23065
[Token(Token = "0x4005A19")]
internal const int REPZ_3_10 = 17;
// Token: 0x04005A1A RID: 23066
[Token(Token = "0x4005A1A")]
internal const int REPZ_11_138 = 18;
// Token: 0x04005A1B RID: 23067
[Token(Token = "0x4005A1B")]
internal static readonly int[] extra_lbits;
// Token: 0x04005A1C RID: 23068
[Token(Token = "0x4005A1C")]
internal static readonly int[] extra_dbits;
// Token: 0x04005A1D RID: 23069
[Token(Token = "0x4005A1D")]
internal static readonly int[] extra_blbits;
// Token: 0x04005A1E RID: 23070
[Token(Token = "0x4005A1E")]
internal static readonly byte[] bl_order;
// Token: 0x04005A1F RID: 23071
[Token(Token = "0x4005A1F")]
internal const int Buf_size = 16;
// Token: 0x04005A20 RID: 23072
[Token(Token = "0x4005A20")]
internal const int DIST_CODE_LEN = 512;
// Token: 0x04005A21 RID: 23073
[Token(Token = "0x4005A21")]
internal static readonly byte[] _dist_code;
// Token: 0x04005A22 RID: 23074
[Token(Token = "0x4005A22")]
internal static readonly byte[] _length_code;
// Token: 0x04005A23 RID: 23075
[Token(Token = "0x4005A23")]
internal static readonly int[] base_length;
// Token: 0x04005A24 RID: 23076
[Token(Token = "0x4005A24")]
internal static readonly int[] base_dist;
// Token: 0x04005A25 RID: 23077
[global::Cpp2IlInjected.FieldOffset(Offset = "0x10")]
[Token(Token = "0x4005A25")]
internal short[] dyn_tree;
// Token: 0x04005A26 RID: 23078
[global::Cpp2IlInjected.FieldOffset(Offset = "0x18")]
[Token(Token = "0x4005A26")]
internal int max_code;
// Token: 0x04005A27 RID: 23079
[global::Cpp2IlInjected.FieldOffset(Offset = "0x20")]
[Token(Token = "0x4005A27")]
internal StaticTree stat_desc;
}
}