x2b13dab2573bcd5e.cs
上传用户:xlxx0122
上传日期:2015-04-24
资源大小:3904k
文件大小:38k
源码类别:

.net编程

开发平台:

C#

  1. namespace Sunisoft.IrisSkin
  2. {
  3.     using System;
  4.     using System.IO;
  5.     using System.Runtime.InteropServices;
  6.     using System.Text;
  7.     internal class x2b13dab2573bcd5e
  8.     {
  9.         private static xb0f0f2071b49b1cb x05f724456b7f79d1;
  10.         private static xb0f0f2071b49b1cb x36ab34a1d2fe3af6 = new xb0f0f2071b49b1cb(15);
  11.         private const int x9b3c370aac2bcae3 = 12;
  12.         static x2b13dab2573bcd5e()
  13.         {
  14.             x36ab34a1d2fe3af6.Build(x71589e3f55261426.CodeLens, 0, 0x120, x71589e3f55261426.LitExtraBits, 0x101);
  15.             for (int i = 0; i < 0x20; i++)
  16.             {
  17.                 x71589e3f55261426.CodeLens[i] = 5;
  18.             }
  19.             x05f724456b7f79d1 = new xb0f0f2071b49b1cb(15);
  20.             x05f724456b7f79d1.Build(x71589e3f55261426.CodeLens, 0, 0x20, x71589e3f55261426.DistExtraBits, 0);
  21.         }
  22.         public static xfba9214ce91902fb Unzip(Stream readStream, string extractFile, Stream writeStream, string password)
  23.         {
  24.             xfba9214ce91902fb success = xfba9214ce91902fb.Success;
  25.             BinaryReader reader = null;
  26.             long num = 0L;
  27.             x181df638a52dfd1a xdfadfda = new x181df638a52dfd1a();
  28.             bool flag = false;
  29.             int index = 0;
  30.             try
  31.             {
  32.                 Stream stream2;
  33.                 int num15;
  34.                 int num16;
  35.                 int num17;
  36.                 int num18;
  37.                 reader = new BinaryReader(readStream);
  38.                 readStream.Seek(0L, SeekOrigin.Begin);
  39.                 if ((reader.ReadUInt32() & 0xffff) != 0x4b53)
  40.                 {
  41.                     throw new Exception("not a zip file");
  42.                 }
  43.                 num = xd54e92c965f241a7(readStream);
  44.                 if (num < 0L)
  45.                 {
  46.                     throw new Exception("invalid zip file");
  47.                 }
  48.                 xf85cd48011a0ce1f xfcdacef = (xf85cd48011a0ce1f) x49cceb88e1b6126e(reader, typeof(xf85cd48011a0ce1f), Marshal.SizeOf(typeof(xf85cd48011a0ce1f)));
  49.                 if (xfcdacef.ZipfileCommentLength > 0)
  50.                 {
  51.                     readStream.Seek((long) xfcdacef.ZipfileCommentLength, SeekOrigin.Begin);
  52.                 }
  53.                 readStream.Seek((long) xfcdacef.DirectoryOffset, SeekOrigin.Begin);
  54.                 while (readStream.Position < num)
  55.                 {
  56.                     xdfadfda = (x181df638a52dfd1a) x49cceb88e1b6126e(reader, typeof(x181df638a52dfd1a), Marshal.SizeOf(typeof(x181df638a52dfd1a)));
  57.                     byte[] bytes = reader.ReadBytes(xdfadfda.FileNameLength);
  58.                     if (Encoding.Default.GetString(bytes).ToUpper() == extractFile.ToUpper())
  59.                     {
  60.                         flag = true;
  61.                         break;
  62.                     }
  63.                 }
  64.                 if (!flag)
  65.                 {
  66.                     throw new FileNotFoundException(extractFile);
  67.                 }
  68.                 readStream.Seek((long) xdfadfda.RelativeOffset, SeekOrigin.Begin);
  69.                 x895eb13ee3f5b8cc xebeefbcc = (x895eb13ee3f5b8cc) x49cceb88e1b6126e(reader, typeof(x895eb13ee3f5b8cc), Marshal.SizeOf(typeof(x895eb13ee3f5b8cc)));
  70.                 readStream.Seek((long) xebeefbcc.FileNameLength, SeekOrigin.Current);
  71.                 if (xebeefbcc.ExtraFieldLength > 0)
  72.                 {
  73.                     readStream.Seek((long) xebeefbcc.ExtraFieldLength, SeekOrigin.Current);
  74.                 }
  75.                 int num4 = 0;
  76.                 if (((xdfadfda.GeneralPurposeBitFlag & 1) != 0) && ((password == null) || (password == "")))
  77.                 {
  78.                     throw new ArgumentException("Password");
  79.                 }
  80.                 if ((password != null) && (password != ""))
  81.                 {
  82.                     int num5 = 0x12345678;
  83.                     int num6 = 0x23456789;
  84.                     int num7 = 0x34567890;
  85.                     int num8 = 0x8088405;
  86.                     byte[] buffer2 = reader.ReadBytes(12);
  87.                     for (index = 1; index <= password.Length; index++)
  88.                     {
  89.                         int num9 = Convert.ToInt32(password[index - 1]);
  90.                         num5 = x19339fe0ba40cd55((long) (x71589e3f55261426.CRC32Table[(num5 ^ num9) & 0xff] ^ (xa52147d0d9c2c73c(num5, 8) & 0xffffff)));
  91.                         num6 += num5 & 0xff;
  92.                         num6 = (num6 * num8) + 1;
  93.                         num7 = x19339fe0ba40cd55((long) (x71589e3f55261426.CRC32Table[(num7 ^ xa52147d0d9c2c73c(num6, 0x18)) & 0xff] ^ (xa52147d0d9c2c73c(num7, 8) & 0xffffff)));
  94.                     }
  95.                     byte[] buffer3 = new byte[12];
  96.                     index = 0;
  97.                     while (index < 12)
  98.                     {
  99.                         num4 = (num7 & 0xffff) | 2;
  100.                         buffer3[index] = x8885d1fc1e00dd5c(buffer2[index] ^ ((num4 * (num4 ^ 1)) >> 8));
  101.                         num5 = x19339fe0ba40cd55((long) (x71589e3f55261426.CRC32Table[(num5 ^ buffer3[index]) & 0xff] ^ (xa52147d0d9c2c73c(num5, 8) & 0xffffff)));
  102.                         num6 += num5 & 0xff;
  103.                         num6 = (num6 * num8) + 1;
  104.                         num7 = x19339fe0ba40cd55((long) (x71589e3f55261426.CRC32Table[(num7 ^ xa52147d0d9c2c73c(num6, 0x18)) & 0xff] ^ (xa52147d0d9c2c73c(num7, 8) & 0xffffff)));
  105.                         index++;
  106.                     }
  107.                     int val = 0;
  108.                     if ((xdfadfda.GeneralPurposeBitFlag & 8) == 8)
  109.                     {
  110.                         val = xdfadfda.LastModFileTime << 0x10;
  111.                     }
  112.                     else
  113.                     {
  114.                         val = xdfadfda.CRC32;
  115.                     }
  116.                     if (xe24cbd369cdd075a.FromInt32(val).L4 != buffer3[11])
  117.                     {
  118.                         throw new ArgumentException("Password");
  119.                     }
  120.                     Stream stream = new MemoryStream();
  121.                     byte[] buffer = new byte[0x400];
  122.                     int num11 = readStream.Read(buffer, 0, 0x400);
  123.                     while (num11 == 0x400)
  124.                     {
  125.                         xe12a5d7e190699b3(buffer, 0x400, ref num5, ref num6, ref num7, num8);
  126.                         stream.Write(buffer, 0, 0x400);
  127.                         num11 = readStream.Read(buffer, 0, 0x400);
  128.                     }
  129.                     xe12a5d7e190699b3(buffer, num11, ref num5, ref num6, ref num7, num8);
  130.                     stream.Write(buffer, 0, num11);
  131.                     stream.Position = 0L;
  132.                     stream2 = stream;
  133.                 }
  134.                 else
  135.                 {
  136.                     stream2 = readStream;
  137.                 }
  138.                 byte[] buffer5 = new byte[0x4000];
  139.                 byte[] buffer6 = new byte[0x10102];
  140.                 int num12 = 0x10000;
  141.                 int num13 = 0;
  142.                 int num22 = 0;
  143.                 int num23 = 0;
  144.                 int num24 = 0;
  145.                 int num25 = 0;
  146.                 int num26 = 0;
  147.                 int num27 = 0;
  148.                 int num28 = 0;
  149.                 int num29 = 0;
  150.                 int lookupBits = 0;
  151.                 int num31 = 0;
  152.                 int num32 = 0;
  153.                 int num33 = 0;
  154.                 int num34 = 0;
  155.                 int num35 = 0;
  156.                 int num36 = 0;
  157.                 int num37 = 0;
  158.                 int num38 = 0;
  159.                 int num39 = 0;
  160.                 int count = 0;
  161.                 int num41 = 0;
  162.                 int num42 = 0;
  163.                 int[] codeLenths = new int[0x13d];
  164.                 int num14 = num17 = num16 = num15 = 0;
  165.                 do
  166.                 {
  167.                     if (num14 == 0)
  168.                     {
  169.                         if ((num17 - num16) < 4)
  170.                         {
  171.                             x573284c529e7b3c9(stream2, buffer5, ref num16, ref num17);
  172.                         }
  173.                         num15 = ((buffer5[num16] + (buffer5[num16 + 1] << 8)) + (buffer5[num16 + 2] << 0x10)) + (buffer5[num16 + 3] << 0x18);
  174.                         num16 += 4;
  175.                         num14 = 0x20;
  176.                     }
  177.                     num18 = num15 & 1;
  178.                     num15 = xa52147d0d9c2c73c(num15, 1);
  179.                     num14--;
  180.                     switch (x02995f229cff83b4(2, ref num14, ref num15, ref num16, buffer5))
  181.                     {
  182.                         case 0:
  183.                         {
  184.                             num15 = xa52147d0d9c2c73c(num15, num14 % 8);
  185.                             num14 -= num14 % 8;
  186.                             xabeeb97aae3dd1a9(stream2, num22, 4, num14, num15, num16, num17, buffer5);
  187.                             int num19 = num22 & 0xffff;
  188.                             byte[] buffer7 = new byte[0x4000];
  189.                             while (num19 != 0)
  190.                             {
  191.                                 int num20;
  192.                                 if (num19 > 0x4000)
  193.                                 {
  194.                                     num20 = 0x4000;
  195.                                 }
  196.                                 else
  197.                                 {
  198.                                     num20 = num19;
  199.                                 }
  200.                                 xabeeb97aae3dd1a9(stream2, num23, num20, num14, num15, num16, num17, buffer5);
  201.                                 num24 = num20;
  202.                                 if (num13 >= num12)
  203.                                 {
  204.                                     writeStream.Write(buffer6, 0, 0x8000);
  205.                                     num25 = 0x8000;
  206.                                     index = 0;
  207.                                     while (index < (num13 - num25))
  208.                                     {
  209.                                         buffer7[index] = buffer6[index];
  210.                                         index++;
  211.                                     }
  212.                                     byte[] buffer8 = buffer7;
  213.                                     int num21 = num12 - num13;
  214.                                     if (num21 > num24)
  215.                                     {
  216.                                         num21 = num24;
  217.                                     }
  218.                                     index = 0;
  219.                                     while (index < num21)
  220.                                     {
  221.                                         buffer8[index] = buffer6[num13];
  222.                                         index++;
  223.                                     }
  224.                                     num13 += num21;
  225.                                     num21 -= num24;
  226.                                     num26 = 0;
  227.                                     while (num24 > 0)
  228.                                     {
  229.                                         num26 += num21;
  230.                                         writeStream.Write(buffer6, 0, 0x8000);
  231.                                         num25 = 0x8000;
  232.                                         index = 0;
  233.                                         while (index < (num13 - num25))
  234.                                         {
  235.                                             buffer6[index] = buffer6[num25 + index];
  236.                                             index++;
  237.                                         }
  238.                                         num13 -= 0x8000;
  239.                                         num21 = num12 - num13;
  240.                                         if (num21 > num24)
  241.                                         {
  242.                                             num21 = num24;
  243.                                         }
  244.                                         for (index = 0; index < num21; index++)
  245.                                         {
  246.                                             buffer6[num13 + index] = buffer8[num26 + index];
  247.                                         }
  248.                                         num13 += num21;
  249.                                         num21 -= num24;
  250.                                     }
  251.                                     num19 -= num20;
  252.                                 }
  253.                             }
  254.                             break;
  255.                         }
  256.                         case 2:
  257.                         {
  258.                             count = x02995f229cff83b4(5, ref num14, ref num15, ref num16, buffer5) + 0x101;
  259.                             num41 = x02995f229cff83b4(5, ref num14, ref num15, ref num16, buffer5) + 1;
  260.                             num42 = x02995f229cff83b4(4, ref num14, ref num15, ref num16, buffer5) + 4;
  261.                             if ((count > 0x11e) || (num41 > 30))
  262.                             {
  263.                                 throw new Exception("Unknown error");
  264.                             }
  265.                             index = 0;
  266.                             while (index < 0x13)
  267.                             {
  268.                                 codeLenths[index] = 0;
  269.                                 index++;
  270.                             }
  271.                             for (index = 0; index < num42; index++)
  272.                             {
  273.                                 codeLenths[x71589e3f55261426.CodeLengthIndex[index]] = x02995f229cff83b4(3, ref num14, ref num15, ref num16, buffer5);
  274.                             }
  275.                             xb0f0f2071b49b1cb xbffbbcb = new xb0f0f2071b49b1cb(7);
  276.                             xbffbbcb.Build(codeLenths, 0, 0x13, new byte[0], 0xffff);
  277.                             index = 0;
  278.                             while (index < codeLenths.Length)
  279.                             {
  280.                                 codeLenths[index] = 0;
  281.                                 index++;
  282.                             }
  283.                             num27 = 0;
  284.                             while (num27 < (count + num41))
  285.                             {
  286.                                 num28 = xbffbbcb.MaxCodeLen + 7;
  287.                                 num29 = xa13f94e29dbd5d94(stream2, ref num28, ref num14, ref num15, ref num16, ref num17, buffer5);
  288.                                 lookupBits = num29 & x71589e3f55261426.ExtractMaskArray[xbffbbcb.MaxCodeLen - 1];
  289.                                 num31 = xbffbbcb.Decode(lookupBits);
  290.                                 num39 = num31 & 0xffff;
  291.                                 num34 = xa52147d0d9c2c73c(num31, 0x10) & 0xff;
  292.                                 if (num39 <= 15)
  293.                                 {
  294.                                     codeLenths[num27] = num39;
  295.                                     num27++;
  296.                                     xa4bb90c5f325d0af(num34, ref num14, ref num15, ref num16, buffer5);
  297.                                 }
  298.                                 else
  299.                                 {
  300.                                     switch (num39)
  301.                                     {
  302.                                         case 0x11:
  303.                                         {
  304.                                             num35 = 3 + (xa52147d0d9c2c73c(num29, num34) & 7);
  305.                                             num27 += num35;
  306.                                             num28 = num34 + 3;
  307.                                             xa4bb90c5f325d0af(num28, ref num14, ref num15, ref num16, buffer5);
  308.                                             continue;
  309.                                         }
  310.                                         case 0x12:
  311.                                             num35 = 11 + (xa52147d0d9c2c73c(num29, num34) & 0x7f);
  312.                                             num27 += num35;
  313.                                             num28 = num34 + 7;
  314.                                             xa4bb90c5f325d0af(num28, ref num14, ref num15, ref num16, buffer5);
  315.                                             break;
  316.                                         case 0x10:
  317.                                         {
  318.                                             num35 = 3 + (xa52147d0d9c2c73c(num29, num34) & 3);
  319.                                             num39 = codeLenths[num27 - 1];
  320.                                             for (index = 0; index < num35; index++)
  321.                                             {
  322.                                                 codeLenths[num27 + index] = num39;
  323.                                             }
  324.                                             num27 += num35;
  325.                                             num28 = num34 + 2;
  326.                                             xa4bb90c5f325d0af(num28, ref num14, ref num15, ref num16, buffer5);
  327.                                             continue;
  328.                                         }
  329.                                     }
  330.                                 }
  331.                             }
  332.                             xb0f0f2071b49b1cb xbffbbcb2 = new xb0f0f2071b49b1cb(15);
  333.                             xbffbbcb2.Build(codeLenths, 0, count, x71589e3f55261426.LitExtraBits, 0x101);
  334.                             xb0f0f2071b49b1cb xbffbbcb3 = new xb0f0f2071b49b1cb(15);
  335.                             xbffbbcb3.Build(codeLenths, count, num41, x71589e3f55261426.DistExtraBits, 0);
  336.                             xf76803be5e9ee2aa(xbffbbcb2, xbffbbcb3, stream2, writeStream, ref num28, ref num14, ref num15, ref num29, ref lookupBits, ref num31, ref num39, ref num34, ref num32, ref num33, ref num36, ref num16, ref num17, buffer5, ref num13, ref num12, buffer6, ref num25, ref num37, ref num38);
  337.                             break;
  338.                         }
  339.                         case 1:
  340.                             xf76803be5e9ee2aa(x36ab34a1d2fe3af6, x05f724456b7f79d1, stream2, writeStream, ref num28, ref num14, ref num15, ref num29, ref lookupBits, ref num31, ref num39, ref num34, ref num32, ref num33, ref num36, ref num16, ref num17, buffer5, ref num13, ref num12, buffer6, ref num25, ref num37, ref num38);
  341.                             break;
  342.                     }
  343.                 }
  344.                 while (num18 == 0);
  345.                 if (num13 != 0)
  346.                 {
  347.                     writeStream.Write(buffer6, 0, num13);
  348.                 }
  349.             }
  350.             catch (ArgumentException exception)
  351.             {
  352.                 if (exception.Message == "Password")
  353.                 {
  354.                     success = xfba9214ce91902fb.WorngPassword;
  355.                 }
  356.                 else
  357.                 {
  358.                     success = xfba9214ce91902fb.Failed;
  359.                 }
  360.             }
  361.             catch
  362.             {
  363.                 success = xfba9214ce91902fb.Failed;
  364.             }
  365.             if ((writeStream != null) && (success == xfba9214ce91902fb.Success))
  366.             {
  367.                 if (writeStream.Length == 0L)
  368.                 {
  369.                     return xfba9214ce91902fb.Failed;
  370.                 }
  371.                 if (writeStream.Length != xdfadfda.UncompressedSize)
  372.                 {
  373.                     success = xfba9214ce91902fb.WorngPassword;
  374.                 }
  375.             }
  376.             return success;
  377.         }
  378.         public static xfba9214ce91902fb Unzip(string ZipFileName, string ExtractFile, string OutputFile, string Password)
  379.         {
  380.             if (!File.Exists(ZipFileName))
  381.             {
  382.                 return xfba9214ce91902fb.Failed;
  383.             }
  384.             xfba9214ce91902fb success = xfba9214ce91902fb.Success;
  385.             Stream readStream = null;
  386.             Stream writeStream = null;
  387.             try
  388.             {
  389.                 readStream = File.Open(ZipFileName, FileMode.Open, FileAccess.Read, FileShare.Read);
  390.                 writeStream = File.Open(OutputFile, FileMode.Create, FileAccess.Write, FileShare.None);
  391.                 success = Unzip(readStream, ExtractFile, writeStream, Password);
  392.             }
  393.             catch
  394.             {
  395.                 success = xfba9214ce91902fb.Failed;
  396.             }
  397.             finally
  398.             {
  399.                 if (readStream != null)
  400.                 {
  401.                     readStream.Close();
  402.                 }
  403.                 if (writeStream != null)
  404.                 {
  405.                     writeStream.Close();
  406.                 }
  407.             }
  408.             return success;
  409.         }
  410.         private static int x02995f229cff83b4(int x10f4d88af727adbc, ref int x67d7b14657e9f9cd, ref int xff1f79a9916b9886, ref int x89682117b5f7515d, byte[] x11e8eb31c2edb458)
  411.         {
  412.             int num = 0;
  413.             if (x10f4d88af727adbc <= x67d7b14657e9f9cd)
  414.             {
  415.                 num = xff1f79a9916b9886 & x71589e3f55261426.ExtractMaskArray[x10f4d88af727adbc - 1];
  416.                 xff1f79a9916b9886 = xa52147d0d9c2c73c(xff1f79a9916b9886, x10f4d88af727adbc);
  417.                 x67d7b14657e9f9cd -= x10f4d88af727adbc;
  418.                 return num;
  419.             }
  420.             int num2 = x10f4d88af727adbc - x67d7b14657e9f9cd;
  421.             num = xff1f79a9916b9886;
  422.             xff1f79a9916b9886 = ((x11e8eb31c2edb458[x89682117b5f7515d] + (x11e8eb31c2edb458[x89682117b5f7515d + 1] << 8)) + (x11e8eb31c2edb458[x89682117b5f7515d + 2] << 0x10)) + (x11e8eb31c2edb458[x89682117b5f7515d + 3] << 0x18);
  423.             x89682117b5f7515d += 4;
  424.             num += (xff1f79a9916b9886 & x71589e3f55261426.ExtractMaskArray[num2 - 1]) << (x67d7b14657e9f9cd & 0x1f);
  425.             xff1f79a9916b9886 = xa52147d0d9c2c73c(xff1f79a9916b9886, num2);
  426.             x67d7b14657e9f9cd = 0x20 - num2;
  427.             return num;
  428.         }
  429.         private static int x19339fe0ba40cd55(long x50a18ad2656e7181)
  430.         {
  431.             if (x50a18ad2656e7181 < 0x7fffffffL)
  432.             {
  433.                 return (int) x50a18ad2656e7181;
  434.             }
  435.             return x19339fe0ba40cd55(Convert.ToUInt32(x50a18ad2656e7181));
  436.         }
  437.         private static int x19339fe0ba40cd55(uint x50a18ad2656e7181)
  438.         {
  439.             if (x50a18ad2656e7181 < 0x7fffffff)
  440.             {
  441.                 return (int) x50a18ad2656e7181;
  442.             }
  443.             return (int) (-((ulong) (uint.MaxValue - x50a18ad2656e7181)) - ((ulong) 1L));
  444.         }
  445.         private static unsafe object x49cceb88e1b6126e(BinaryReader xe134235b3526fa75, Type x43163d22e8cd5a71, int x0ceec69a97f73617)
  446.         {
  447.             object obj2;
  448.             fixed (byte* numRef = xe134235b3526fa75.ReadBytes(x0ceec69a97f73617))
  449.             {
  450.                 obj2 = Marshal.PtrToStructure((IntPtr) numRef, x43163d22e8cd5a71);
  451.             }
  452.             return obj2;
  453.         }
  454.         private static bool x573284c529e7b3c9(Stream xcf18e5243f8d5fd3, byte[] x11e8eb31c2edb458, ref int x89682117b5f7515d, ref int xdda8a75b25a2876d)
  455.         {
  456.             int index = 0;
  457.             while (x89682117b5f7515d != xdda8a75b25a2876d)
  458.             {
  459.                 x11e8eb31c2edb458[index] = x11e8eb31c2edb458[x89682117b5f7515d];
  460.                 x89682117b5f7515d++;
  461.                 index++;
  462.             }
  463.             int num2 = 0;
  464.             int num3 = 0;
  465.             int count = 0x4000 - index;
  466.             int num5 = xcf18e5243f8d5fd3.Read(x11e8eb31c2edb458, index, count);
  467.             x89682117b5f7515d = 0;
  468.             xdda8a75b25a2876d = index + num5;
  469.             num2 = xdda8a75b25a2876d;
  470.             if (num2 == 0)
  471.             {
  472.                 return false;
  473.             }
  474.             if ((num5 == 0) && ((num2 % 4) != 0))
  475.             {
  476.                 num3 = 4 - (num2 % 4);
  477.                 for (int i = 0; i < num3; i++)
  478.                 {
  479.                     x11e8eb31c2edb458[xdda8a75b25a2876d] = 0;
  480.                     xdda8a75b25a2876d++;
  481.                 }
  482.             }
  483.             return true;
  484.         }
  485.         private static byte x8885d1fc1e00dd5c(int x50a18ad2656e7181)
  486.         {
  487.             return (byte) (x50a18ad2656e7181 & 0xff);
  488.         }
  489.         private static int xa13f94e29dbd5d94(Stream xcf18e5243f8d5fd3, ref int xd44988f225497f3a, ref int x4f0818a28ce2934b, ref int x880e0239b007e4f9, ref int xf8894778b712e96d, ref int xfcbc8d697ad1a389, byte[] x5614faf5d2637115)
  490.         {
  491.             int num2;
  492.             if (xd44988f225497f3a <= x4f0818a28ce2934b)
  493.             {
  494.                 return (x880e0239b007e4f9 & x71589e3f55261426.ExtractMaskArray[xd44988f225497f3a - 1]);
  495.             }
  496.             int num = xd44988f225497f3a - x4f0818a28ce2934b;
  497.             int num3 = x880e0239b007e4f9;
  498.             if ((xfcbc8d697ad1a389 - xf8894778b712e96d) < 4)
  499.             {
  500.                 if (!x573284c529e7b3c9(xcf18e5243f8d5fd3, x5614faf5d2637115, ref xf8894778b712e96d, ref xfcbc8d697ad1a389))
  501.                 {
  502.                     num2 = 0;
  503.                 }
  504.                 else
  505.                 {
  506.                     num2 = ((x5614faf5d2637115[xf8894778b712e96d] + (x5614faf5d2637115[xf8894778b712e96d + 1] << 8)) + (x5614faf5d2637115[xf8894778b712e96d + 2] << 0x10)) + (x5614faf5d2637115[xf8894778b712e96d + 3] << 0x18);
  507.                 }
  508.             }
  509.             else
  510.             {
  511.                 num2 = ((x5614faf5d2637115[xf8894778b712e96d] + (x5614faf5d2637115[xf8894778b712e96d + 1] << 8)) + (x5614faf5d2637115[xf8894778b712e96d + 2] << 0x10)) + (x5614faf5d2637115[xf8894778b712e96d + 3] << 0x18);
  512.             }
  513.             return (num3 + ((num2 & x71589e3f55261426.ExtractMaskArray[num - 1]) << x4f0818a28ce2934b));
  514.         }
  515.         private static void xa4bb90c5f325d0af(int xd44988f225497f3a, ref int x4f0818a28ce2934b, ref int x880e0239b007e4f9, ref int xf8894778b712e96d, byte[] x5614faf5d2637115)
  516.         {
  517.             if (xd44988f225497f3a <= x4f0818a28ce2934b)
  518.             {
  519.                 x880e0239b007e4f9 = xa52147d0d9c2c73c(x880e0239b007e4f9, xd44988f225497f3a);
  520.                 x4f0818a28ce2934b -= xd44988f225497f3a;
  521.             }
  522.             else
  523.             {
  524.                 int num = xd44988f225497f3a - x4f0818a28ce2934b;
  525.                 x880e0239b007e4f9 = ((x5614faf5d2637115[xf8894778b712e96d] + (x5614faf5d2637115[xf8894778b712e96d + 1] << 8)) + (x5614faf5d2637115[xf8894778b712e96d + 2] << 0x10)) + (x5614faf5d2637115[xf8894778b712e96d + 3] << 0x18);
  526.                 xf8894778b712e96d += 4;
  527.                 x880e0239b007e4f9 = xa52147d0d9c2c73c(x880e0239b007e4f9, num);
  528.                 x4f0818a28ce2934b = 0x20 - num;
  529.             }
  530.         }
  531.         private static int xa52147d0d9c2c73c(int x7b28e8a789372508, int x1148d0e8cc982c04)
  532.         {
  533.             if (x7b28e8a789372508 > 0)
  534.             {
  535.                 return (x7b28e8a789372508 >> x1148d0e8cc982c04);
  536.             }
  537.             return (x7b28e8a789372508 >> x1148d0e8cc982c04);
  538.         }
  539.         private static unsafe void xabeeb97aae3dd1a9(Stream xcf18e5243f8d5fd3, int x1ef26dbdd5d13d24, int x10f4d88af727adbc, int x475641bf9383557d, int xff1f79a9916b9886, int x89682117b5f7515d, int xdda8a75b25a2876d, byte[] x11e8eb31c2edb458)
  540.         {
  541.             int num;
  542.             byte* numPtr = (byte*) &x1ef26dbdd5d13d24;
  543.             if (x475641bf9383557d > 0)
  544.             {
  545.                 num = x475641bf9383557d / 8;
  546.                 for (int j = 0; j < num; j++)
  547.                 {
  548.                     numPtr[0] = Convert.ToByte((int) (xff1f79a9916b9886 & 0xff));
  549.                     numPtr++;
  550.                     xff1f79a9916b9886 = xa52147d0d9c2c73c(xff1f79a9916b9886, 8);
  551.                 }
  552.                 num -= x10f4d88af727adbc;
  553.             }
  554.             int num2 = xdda8a75b25a2876d - x89682117b5f7515d;
  555.             if (x10f4d88af727adbc <= num2)
  556.             {
  557.                 num = x10f4d88af727adbc;
  558.             }
  559.             else
  560.             {
  561.                 num = num2;
  562.             }
  563.             for (int i = 0; i < num; i++)
  564.             {
  565.                 numPtr[i] = x11e8eb31c2edb458[x89682117b5f7515d + i];
  566.             }
  567.             x10f4d88af727adbc -= num;
  568.             x89682117b5f7515d += num;
  569.             while (x10f4d88af727adbc != 0)
  570.             {
  571.                 numPtr += num;
  572.                 if (!x573284c529e7b3c9(xcf18e5243f8d5fd3, x11e8eb31c2edb458, ref x89682117b5f7515d, ref xdda8a75b25a2876d))
  573.                 {
  574.                     return;
  575.                 }
  576.                 num2 = xdda8a75b25a2876d - x89682117b5f7515d;
  577.                 if (x10f4d88af727adbc <= num2)
  578.                 {
  579.                     num = x10f4d88af727adbc;
  580.                 }
  581.                 else
  582.                 {
  583.                     num = num2;
  584.                 }
  585.                 for (int k = 0; k < num; k++)
  586.                 {
  587.                     numPtr[k] = x11e8eb31c2edb458[x89682117b5f7515d + k];
  588.                 }
  589.                 x10f4d88af727adbc -= num;
  590.                 x89682117b5f7515d += num;
  591.             }
  592.             xff1f79a9916b9886 = 0;
  593.             x475641bf9383557d = 0;
  594.         }
  595.         private static long xd54e92c965f241a7(Stream xcf18e5243f8d5fd3)
  596.         {
  597.             long offset = xcf18e5243f8d5fd3.Seek((long) -Marshal.SizeOf(typeof(x311a6dc8e19b6c24)), SeekOrigin.End);
  598.             if (offset > 0L)
  599.             {
  600.                 BinaryReader reader = new BinaryReader(xcf18e5243f8d5fd3);
  601.                 x311a6dc8e19b6c24 xadcebc = (x311a6dc8e19b6c24) x49cceb88e1b6126e(reader, typeof(x311a6dc8e19b6c24), Marshal.SizeOf(typeof(x311a6dc8e19b6c24)));
  602.                 if ((xadcebc.trSig == 0x6054b50) && (xadcebc.trLen == 0))
  603.                 {
  604.                     xcf18e5243f8d5fd3.Seek(offset, SeekOrigin.Begin);
  605.                 }
  606.             }
  607.             return offset;
  608.         }
  609.         private static void xe12a5d7e190699b3(byte[] x1ef26dbdd5d13d24, int x10f4d88af727adbc, ref int xf0b4c3c679d18c3c, ref int x3713ef252be01cf5, ref int xd56b578b5e9b09c0, int xccb1eeef6a33e9aa)
  610.         {
  611.             for (int i = 0; i < x10f4d88af727adbc; i++)
  612.             {
  613.                 int num = (xd56b578b5e9b09c0 & 0xffff) | 2;
  614.                 x1ef26dbdd5d13d24[i] = x8885d1fc1e00dd5c(x1ef26dbdd5d13d24[i] ^ xa52147d0d9c2c73c(num * (num ^ 1), 8));
  615.                 xf0b4c3c679d18c3c = x19339fe0ba40cd55((long) (x71589e3f55261426.CRC32Table[(xf0b4c3c679d18c3c ^ x1ef26dbdd5d13d24[i]) & 0xff] ^ ((long) ((xf0b4c3c679d18c3c >> 8) & 0xffffff))));
  616.                 x3713ef252be01cf5 += xf0b4c3c679d18c3c & 0xff;
  617.                 x3713ef252be01cf5 = (x3713ef252be01cf5 * xccb1eeef6a33e9aa) + 1;
  618.                 xd56b578b5e9b09c0 = x19339fe0ba40cd55((long) (x71589e3f55261426.CRC32Table[(xd56b578b5e9b09c0 ^ (x3713ef252be01cf5 >> 0x18)) & 0xff] ^ ((long) ((xd56b578b5e9b09c0 >> 8) & 0xffffff))));
  619.             }
  620.         }
  621.         private static void xf76803be5e9ee2aa(xb0f0f2071b49b1cb xc82e2be11855266c, xb0f0f2071b49b1cb xd8260a8082223426, Stream x160656af282c4d7b, Stream x5ab6ed99b3041647, ref int xce53a4f2835cab70, ref int x4f0818a28ce2934b, ref int x880e0239b007e4f9, ref int xea2a21438bfbe03d, ref int xa60661b5d01cbcbc, ref int x42f081a275d72d2c, ref int xe59d6d35c76d70aa, ref int x57922afe7d4d09e0, ref int x5c34e2900c6b80d0, ref int x9b229eba46fd51f3, ref int x58316dde3396e982, ref int xf8894778b712e96d, ref int xfcbc8d697ad1a389, byte[] x5614faf5d2637115, ref int xe2b07c285d73cc12, ref int x971144bb4ad7e504, byte[] x7585f73a99663fd2, ref int x81dfe2898a2fdde1, ref int x4996da61da7808c8, ref int x4cc2dc507646ce1a)
  622.         {
  623.             int index = 0;
  624.             xce53a4f2835cab70 = xc82e2be11855266c.MaxCodeLen + 5;
  625.             xea2a21438bfbe03d = xa13f94e29dbd5d94(x160656af282c4d7b, ref xce53a4f2835cab70, ref x4f0818a28ce2934b, ref x880e0239b007e4f9, ref xf8894778b712e96d, ref xfcbc8d697ad1a389, x5614faf5d2637115);
  626.             xa60661b5d01cbcbc = xea2a21438bfbe03d & x71589e3f55261426.ExtractMaskArray[xc82e2be11855266c.MaxCodeLen - 1];
  627.             x42f081a275d72d2c = xc82e2be11855266c.Decode(xa60661b5d01cbcbc);
  628.             xe59d6d35c76d70aa = x42f081a275d72d2c & 0xffff;
  629.             x57922afe7d4d09e0 = xa52147d0d9c2c73c(x42f081a275d72d2c, 0x10) & 0xff;
  630.             while (xe59d6d35c76d70aa != 0x100)
  631.             {
  632.                 if (xe59d6d35c76d70aa < 0x100)
  633.                 {
  634.                     x7585f73a99663fd2[xe2b07c285d73cc12] = (byte) xe59d6d35c76d70aa;
  635.                     xe2b07c285d73cc12++;
  636.                     if (xe2b07c285d73cc12 >= x971144bb4ad7e504)
  637.                     {
  638.                         x5ab6ed99b3041647.Write(x7585f73a99663fd2, 0, 0x8000);
  639.                         x81dfe2898a2fdde1 = 0x8000;
  640.                         index = 0;
  641.                         while (index < (xe2b07c285d73cc12 - x81dfe2898a2fdde1))
  642.                         {
  643.                             x7585f73a99663fd2[index] = x7585f73a99663fd2[x81dfe2898a2fdde1 + index];
  644.                             index++;
  645.                         }
  646.                         xe2b07c285d73cc12 -= 0x8000;
  647.                     }
  648.                     xa4bb90c5f325d0af(x57922afe7d4d09e0, ref x4f0818a28ce2934b, ref x880e0239b007e4f9, ref xf8894778b712e96d, x5614faf5d2637115);
  649.                 }
  650.                 else
  651.                 {
  652.                     if (xe59d6d35c76d70aa == 0x11d)
  653.                     {
  654.                         x5c34e2900c6b80d0 = 0x102;
  655.                         xa4bb90c5f325d0af(x57922afe7d4d09e0, ref x4f0818a28ce2934b, ref x880e0239b007e4f9, ref xf8894778b712e96d, x5614faf5d2637115);
  656.                     }
  657.                     else
  658.                     {
  659.                         x9b229eba46fd51f3 = xa52147d0d9c2c73c(x42f081a275d72d2c, 0x18);
  660.                         if (x9b229eba46fd51f3 == 0)
  661.                         {
  662.                             x5c34e2900c6b80d0 = x71589e3f55261426.LengthBase[xe59d6d35c76d70aa - 0x101];
  663.                             xa4bb90c5f325d0af(x57922afe7d4d09e0, ref x4f0818a28ce2934b, ref x880e0239b007e4f9, ref xf8894778b712e96d, x5614faf5d2637115);
  664.                         }
  665.                         else
  666.                         {
  667.                             x5c34e2900c6b80d0 = x71589e3f55261426.LengthBase[xe59d6d35c76d70aa - 0x101] + (xa52147d0d9c2c73c(xea2a21438bfbe03d, x57922afe7d4d09e0) & x71589e3f55261426.ExtractMaskArray[x9b229eba46fd51f3 - 1]);
  668.                             xce53a4f2835cab70 = x57922afe7d4d09e0 + x9b229eba46fd51f3;
  669.                             xa4bb90c5f325d0af(xce53a4f2835cab70, ref x4f0818a28ce2934b, ref x880e0239b007e4f9, ref xf8894778b712e96d, x5614faf5d2637115);
  670.                         }
  671.                     }
  672.                     xce53a4f2835cab70 = xd8260a8082223426.MaxCodeLen + 14;
  673.                     xea2a21438bfbe03d = xa13f94e29dbd5d94(x160656af282c4d7b, ref xce53a4f2835cab70, ref x4f0818a28ce2934b, ref x880e0239b007e4f9, ref xf8894778b712e96d, ref xfcbc8d697ad1a389, x5614faf5d2637115);
  674.                     xa60661b5d01cbcbc = xea2a21438bfbe03d & x71589e3f55261426.ExtractMaskArray[xd8260a8082223426.MaxCodeLen - 1];
  675.                     x42f081a275d72d2c = xd8260a8082223426.Decode(xa60661b5d01cbcbc);
  676.                     xe59d6d35c76d70aa = x42f081a275d72d2c & 0xffff;
  677.                     x57922afe7d4d09e0 = xa52147d0d9c2c73c(x42f081a275d72d2c, 0x10) & 0xff;
  678.                     x9b229eba46fd51f3 = xa52147d0d9c2c73c(x42f081a275d72d2c, 0x18);
  679.                     if (x9b229eba46fd51f3 == 0)
  680.                     {
  681.                         x58316dde3396e982 = x71589e3f55261426.DistanceBase[xe59d6d35c76d70aa];
  682.                         xa4bb90c5f325d0af(x57922afe7d4d09e0, ref x4f0818a28ce2934b, ref x880e0239b007e4f9, ref xf8894778b712e96d, x5614faf5d2637115);
  683.                     }
  684.                     else
  685.                     {
  686.                         x58316dde3396e982 = x71589e3f55261426.DistanceBase[xe59d6d35c76d70aa] + (xa52147d0d9c2c73c(xea2a21438bfbe03d, x57922afe7d4d09e0) & x71589e3f55261426.ExtractMaskArray[x9b229eba46fd51f3 - 1]);
  687.                         xce53a4f2835cab70 = x57922afe7d4d09e0 + x9b229eba46fd51f3;
  688.                         xa4bb90c5f325d0af(xce53a4f2835cab70, ref x4f0818a28ce2934b, ref x880e0239b007e4f9, ref xf8894778b712e96d, x5614faf5d2637115);
  689.                     }
  690.                     if (x5c34e2900c6b80d0 <= x58316dde3396e982)
  691.                     {
  692.                         index = 0;
  693.                         while (index < x5c34e2900c6b80d0)
  694.                         {
  695.                             x7585f73a99663fd2[xe2b07c285d73cc12 + index] = x7585f73a99663fd2[(xe2b07c285d73cc12 - x58316dde3396e982) + index];
  696.                             index++;
  697.                         }
  698.                     }
  699.                     else
  700.                     {
  701.                         x4996da61da7808c8 = xe2b07c285d73cc12 - x58316dde3396e982;
  702.                         x4cc2dc507646ce1a = xe2b07c285d73cc12;
  703.                         index = 1;
  704.                         while (index <= x5c34e2900c6b80d0)
  705.                         {
  706.                             x7585f73a99663fd2[x4cc2dc507646ce1a] = x7585f73a99663fd2[x4996da61da7808c8];
  707.                             x4996da61da7808c8++;
  708.                             x4cc2dc507646ce1a++;
  709.                             index++;
  710.                         }
  711.                     }
  712.                     xe2b07c285d73cc12 += x5c34e2900c6b80d0;
  713.                     if (xe2b07c285d73cc12 >= x971144bb4ad7e504)
  714.                     {
  715.                         x5ab6ed99b3041647.Write(x7585f73a99663fd2, 0, 0x8000);
  716.                         x81dfe2898a2fdde1 = 0x8000;
  717.                         for (index = 0; index < (xe2b07c285d73cc12 - x81dfe2898a2fdde1); index++)
  718.                         {
  719.                             x7585f73a99663fd2[index] = x7585f73a99663fd2[x81dfe2898a2fdde1 + index];
  720.                         }
  721.                         xe2b07c285d73cc12 -= 0x8000;
  722.                     }
  723.                 }
  724.                 xce53a4f2835cab70 = xc82e2be11855266c.MaxCodeLen + 5;
  725.                 xea2a21438bfbe03d = xa13f94e29dbd5d94(x160656af282c4d7b, ref xce53a4f2835cab70, ref x4f0818a28ce2934b, ref x880e0239b007e4f9, ref xf8894778b712e96d, ref xfcbc8d697ad1a389, x5614faf5d2637115);
  726.                 xa60661b5d01cbcbc = xea2a21438bfbe03d & x71589e3f55261426.ExtractMaskArray[xc82e2be11855266c.MaxCodeLen - 1];
  727.                 x42f081a275d72d2c = xc82e2be11855266c.Decode(xa60661b5d01cbcbc);
  728.                 xe59d6d35c76d70aa = x42f081a275d72d2c & 0xffff;
  729.                 x57922afe7d4d09e0 = xa52147d0d9c2c73c(x42f081a275d72d2c, 0x10) & 0xff;
  730.             }
  731.             xa4bb90c5f325d0af(x57922afe7d4d09e0, ref x4f0818a28ce2934b, ref x880e0239b007e4f9, ref xf8894778b712e96d, x5614faf5d2637115);
  732.         }
  733.     }
  734. }