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

164 lines
4.1 KiB
C#

using System;
using System.IO;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Encoders
{
// Token: 0x02001371 RID: 4977
[Token(Token = "0x2001371")]
[StructLayout(3)]
public class HexEncoder : IEncoder
{
// Token: 0x06007DEB RID: 32235 RVA: 0x001A7018 File Offset: 0x001A5218
[Token(Token = "0x6007DEB")]
[Address(RVA = "0x202B4E0", Offset = "0x2029EE0", VA = "0x18202B4E0")]
protected void InitialiseDecodingTable()
{
byte[] array = this.decodingTable;
byte[] array2 = this.encodingTable;
int num = 0;
if (num < array2.Length)
{
byte[] array3 = this.decodingTable;
num++;
byte[] array4 = this.encodingTable;
}
byte[] array5 = this.decodingTable;
byte b = array5[12];
array5[8] = b;
byte[] array6 = this.decodingTable;
byte b2 = array6[12];
array6[8] = b2;
byte[] array7 = this.decodingTable;
byte b3 = array7[12];
array7[8] = b3;
byte[] array8 = this.decodingTable;
byte b4 = array8[12];
array8[8] = b4;
byte[] array9 = this.decodingTable;
byte b5 = array9[12];
array9[8] = b5;
byte[] array10 = this.decodingTable;
byte b6 = array10[12];
array10[8] = b6;
}
// Token: 0x06007DEC RID: 32236 RVA: 0x001A7108 File Offset: 0x001A5308
[Token(Token = "0x6007DEC")]
[Address(RVA = "0x202B720", Offset = "0x202A120", VA = "0x18202B720")]
public HexEncoder()
{
byte[] array = new byte[16];
RuntimeHelpers.InitializeArray(array, fieldof(<PrivateImplementationDetails>.FE5567E8D769550852182CDF69D74BB16DFF8E29).FieldHandle);
this.encodingTable = array;
byte[] array2 = new byte[128];
this.decodingTable = array2;
base..ctor();
this.InitialiseDecodingTable();
}
// Token: 0x06007DED RID: 32237 RVA: 0x001A7150 File Offset: 0x001A5350
[Token(Token = "0x6007DED")]
[Address(RVA = "0x202B3A0", Offset = "0x2029DA0", VA = "0x18202B3A0", Slot = "4")]
public int Encode(byte[] data, int off, int length, Stream outStream)
{
byte[] array = this.encodingTable;
byte[] array2 = this.encodingTable;
return off;
}
// Token: 0x06007DEE RID: 32238 RVA: 0x001A7174 File Offset: 0x001A5374
[Token(Token = "0x6007DEE")]
[Address(RVA = "0x202B4C0", Offset = "0x2029EC0", VA = "0x18202B4C0")]
private static bool Ignore(char c)
{
return true;
}
// Token: 0x06007DEF RID: 32239 RVA: 0x001A7184 File Offset: 0x001A5384
[Token(Token = "0x6007DEF")]
[Address(RVA = "0x202B150", Offset = "0x2029B50", VA = "0x18202B150", Slot = "5")]
public int Decode(byte[] data, int off, int length, Stream outStream)
{
int num = 0;
if (off < length)
{
if (length == 250)
{
}
if (off < length)
{
if (length == 250)
{
}
byte[] array = this.decodingTable;
int length2 = data.Length;
int length3 = array.Length;
if (off >= length || length == 250)
{
}
num++;
}
}
return num;
}
// Token: 0x06007DF0 RID: 32240 RVA: 0x001A71E8 File Offset: 0x001A53E8
[Token(Token = "0x6007DF0")]
[Address(RVA = "0x202AF40", Offset = "0x2029940", VA = "0x18202AF40", Slot = "6")]
public int DecodeString(string data, Stream outStream)
{
int num = 0;
int num2 = data.m_stringLength;
if (num2 > 0)
{
int num3 = num2 - 1;
char c = data[num3];
if ((uint)65530 == (uint)c)
{
}
num2 = num3;
}
if (num2 > 0)
{
if (num < num2)
{
char c2 = data[num];
if ((uint)65530 == (uint)c2)
{
}
num++;
}
byte[] array = this.decodingTable;
num++;
char c3 = data[num];
if (num < num2)
{
char c4 = data[num];
if ((uint)65530 == (uint)c4)
{
}
num++;
}
byte[] array2 = this.decodingTable;
num++;
char c5 = data[num];
num++;
}
return num;
}
// Token: 0x04005A47 RID: 23111
[global::Cpp2IlInjected.FieldOffset(Offset = "0x10")]
[Token(Token = "0x4005A47")]
protected readonly byte[] encodingTable;
// Token: 0x04005A48 RID: 23112
[global::Cpp2IlInjected.FieldOffset(Offset = "0x18")]
[Token(Token = "0x4005A48")]
protected readonly byte[] decodingTable;
}
}