398 lines
10 KiB
C#
398 lines
10 KiB
C#
using System;
|
|
using System.Runtime.CompilerServices;
|
|
using Cpp2IlInjected;
|
|
|
|
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Zlib
|
|
{
|
|
// Token: 0x02001A17 RID: 6679
|
|
[Token(Token = "0x2001A17")]
|
|
internal sealed class ZTree
|
|
{
|
|
// Token: 0x06009CFA RID: 40186 RVA: 0x0020566C File Offset: 0x0020386C
|
|
[Token(Token = "0x6009CFA")]
|
|
[Address(RVA = "0x427940", Offset = "0x426940", VA = "0x180427940")]
|
|
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: 0x06009CFB RID: 40187 RVA: 0x00205694 File Offset: 0x00203894
|
|
[Token(Token = "0x6009CFB")]
|
|
[Address(RVA = "0x427A30", Offset = "0x426A30", VA = "0x180427A30")]
|
|
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: 0x06009CFC RID: 40188 RVA: 0x0020584C File Offset: 0x00203A4C
|
|
[Token(Token = "0x6009CFC")]
|
|
[Address(RVA = "0x427280", Offset = "0x426280", VA = "0x180427280")]
|
|
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: 0x06009CFD RID: 40189 RVA: 0x00205AEC File Offset: 0x00203CEC
|
|
[Token(Token = "0x6009CFD")]
|
|
[Address(RVA = "0x427EE0", Offset = "0x426EE0", VA = "0x180427EE0")]
|
|
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: 0x06009CFE RID: 40190 RVA: 0x00205B54 File Offset: 0x00203D54
|
|
[Token(Token = "0x6009CFE")]
|
|
[Address(RVA = "0x427250", Offset = "0x426250", VA = "0x180427250")]
|
|
internal static int bi_reverse(int code, int len)
|
|
{
|
|
int num = 0;
|
|
int num2 = len - 1;
|
|
return num + num;
|
|
}
|
|
|
|
// Token: 0x06009CFF RID: 40191 RVA: 0x00205B6C File Offset: 0x00203D6C
|
|
[Token(Token = "0x6009CFF")]
|
|
[Address(RVA = "0x412370", Offset = "0x411370", VA = "0x180412370")]
|
|
public ZTree()
|
|
{
|
|
}
|
|
|
|
// Token: 0x06009D00 RID: 40192 RVA: 0x00205B80 File Offset: 0x00203D80
|
|
// Note: this type is marked as 'beforefieldinit'.
|
|
[Token(Token = "0x6009D00")]
|
|
[Address(RVA = "0x427060", Offset = "0x426060", VA = "0x180427060")]
|
|
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: 0x04006A0B RID: 27147
|
|
[Token(Token = "0x4006A0B")]
|
|
private const int MAX_BITS = 15;
|
|
|
|
// Token: 0x04006A0C RID: 27148
|
|
[Token(Token = "0x4006A0C")]
|
|
private const int BL_CODES = 19;
|
|
|
|
// Token: 0x04006A0D RID: 27149
|
|
[Token(Token = "0x4006A0D")]
|
|
private const int D_CODES = 30;
|
|
|
|
// Token: 0x04006A0E RID: 27150
|
|
[Token(Token = "0x4006A0E")]
|
|
private const int LITERALS = 256;
|
|
|
|
// Token: 0x04006A0F RID: 27151
|
|
[Token(Token = "0x4006A0F")]
|
|
private const int LENGTH_CODES = 29;
|
|
|
|
// Token: 0x04006A10 RID: 27152
|
|
[Token(Token = "0x4006A10")]
|
|
private const int L_CODES = 286;
|
|
|
|
// Token: 0x04006A11 RID: 27153
|
|
[Token(Token = "0x4006A11")]
|
|
private const int HEAP_SIZE = 573;
|
|
|
|
// Token: 0x04006A12 RID: 27154
|
|
[Token(Token = "0x4006A12")]
|
|
internal const int MAX_BL_BITS = 7;
|
|
|
|
// Token: 0x04006A13 RID: 27155
|
|
[Token(Token = "0x4006A13")]
|
|
internal const int END_BLOCK = 256;
|
|
|
|
// Token: 0x04006A14 RID: 27156
|
|
[Token(Token = "0x4006A14")]
|
|
internal const int REP_3_6 = 16;
|
|
|
|
// Token: 0x04006A15 RID: 27157
|
|
[Token(Token = "0x4006A15")]
|
|
internal const int REPZ_3_10 = 17;
|
|
|
|
// Token: 0x04006A16 RID: 27158
|
|
[Token(Token = "0x4006A16")]
|
|
internal const int REPZ_11_138 = 18;
|
|
|
|
// Token: 0x04006A17 RID: 27159
|
|
[Token(Token = "0x4006A17")]
|
|
internal static readonly int[] extra_lbits;
|
|
|
|
// Token: 0x04006A18 RID: 27160
|
|
[Token(Token = "0x4006A18")]
|
|
internal static readonly int[] extra_dbits;
|
|
|
|
// Token: 0x04006A19 RID: 27161
|
|
[Token(Token = "0x4006A19")]
|
|
internal static readonly int[] extra_blbits;
|
|
|
|
// Token: 0x04006A1A RID: 27162
|
|
[Token(Token = "0x4006A1A")]
|
|
internal static readonly byte[] bl_order;
|
|
|
|
// Token: 0x04006A1B RID: 27163
|
|
[Token(Token = "0x4006A1B")]
|
|
internal const int Buf_size = 16;
|
|
|
|
// Token: 0x04006A1C RID: 27164
|
|
[Token(Token = "0x4006A1C")]
|
|
internal const int DIST_CODE_LEN = 512;
|
|
|
|
// Token: 0x04006A1D RID: 27165
|
|
[Token(Token = "0x4006A1D")]
|
|
internal static readonly byte[] _dist_code;
|
|
|
|
// Token: 0x04006A1E RID: 27166
|
|
[Token(Token = "0x4006A1E")]
|
|
internal static readonly byte[] _length_code;
|
|
|
|
// Token: 0x04006A1F RID: 27167
|
|
[Token(Token = "0x4006A1F")]
|
|
internal static readonly int[] base_length;
|
|
|
|
// Token: 0x04006A20 RID: 27168
|
|
[Token(Token = "0x4006A20")]
|
|
internal static readonly int[] base_dist;
|
|
|
|
// Token: 0x04006A21 RID: 27169
|
|
[FieldOffset(Offset = "0x10")]
|
|
[Token(Token = "0x4006A21")]
|
|
internal short[] dyn_tree;
|
|
|
|
// Token: 0x04006A22 RID: 27170
|
|
[FieldOffset(Offset = "0x18")]
|
|
[Token(Token = "0x4006A22")]
|
|
internal int max_code;
|
|
|
|
// Token: 0x04006A23 RID: 27171
|
|
[FieldOffset(Offset = "0x20")]
|
|
[Token(Token = "0x4006A23")]
|
|
internal StaticTree stat_desc;
|
|
}
|
|
}
|