该楼层疑似违规已被系统折叠 隐藏此楼查看此楼
public static byte[] Decode(string strFilePath)
{
List list = new List();
using (FileStream stream = new FileStream(strFilePath, FileMode.Open, FileAccess.Read, FileShare.ReadWrite))
{
byte[] buffer = new byte[0x10];
stream.Seek(0L, SeekOrigin.Begin);
stream.Read(buffer, 0, buffer.Length);
byte[] buffer2 = new byte[0x100];
stream.Read(buffer2, 0, buffer2.Length);
byte[] buffer3 = new byte[4];
stream.Read(buffer3, 0, buffer3.Length);
Array.Reverse(buffer3);
int num = BitConverter.ToInt32(buffer3, 0);
byte[] buffer4 = new byte[4];
stream.Read(buffer4, 0, buffer4.Length);
Array.Reverse(buffer4);
int num2 = BitConverter.ToInt32(buffer4, 0);
byte[] buffer5 = new byte[4];
stream.Read(buffer5, 0, buffer5.Length);
Array.Reverse(buffer5);
int num3 = BitConverter.ToInt32(buffer5, 0);
byte[] buffer6 = new byte[4];
stream.Read(buffer5, 0, buffer5.Length);
byte[] buffer7 = new byte[num];
stream.Read(buffer7, 0, buffer7.Length);
stream.Close();
uint num4 = 0;
uint num5 = 0;
int num6 = 0;
int num7 = 0;
int num8 = 1;
int num9 = 0;
foreach (byte num10 in buffer7)
{
if (list.Count >= num2)
{
goto Label_029E;
}
for (byte i = 0x80; i > 0; i = (byte) (i >> 1))
{
uint num12 = ((num10 & i) > 0) ? 1 : 0;
if (num8 == 1)
{
num4 = num4 << 1;
num6++;
num4 |= num12;
if (num12 == 0)
{
num8 = 2;
}
}
else
{
num5 = num5 << 1;
num7++;
num5 |= num12;
if (num6 == num7)
{
if (list.Count >= num2)
{
break;
}
int index = (int) (num4 + num5);
if (num9 > 0)
{
int num14 = num9 - 0x100;
int num15 = index + 3;
for (int j = 0; j < num15; j++)
{
byte item = list[list.Count - num14];
list.Add(item);
}
num9 = 0;
}
else if (index < 0x100)
{
list.Add(buffer2[index]);
}
else
{
num9 = index;
}
num4 = 0;
num5 = 0;
num6 = 0;
num7 = 0;
num8 = 1;
}
}
}
}
}
Label_029E:
return list.ToArray();
}