Exemplo n.º 1
0
 private static byte[] m0002c0(List<struct01c6> p0, struct01c7 p1, ref struct01de p2)
 {
     int num = 0;
     using (List<struct01c6>.Enumerator enumerator = p0.GetEnumerator())
     {
     Label_000B:
         if (!enumerator.MoveNext())
         {
             goto Label_01D6;
         }
         struct01c6 current = enumerator.Current;
         enum01c5 enumc = current.f000001;
         if (enumc <= enum01c5.f000085)
         {
             if (enumc != enum01c5.f000001)
             {
                 if (enumc == enum01c5.f000045)
                 {
                     goto Label_011A;
                 }
                 if (enumc == enum01c5.f000085)
                 {
                     goto Label_012C;
                 }
             }
             goto Label_000B;
         }
         if (enumc != enum01c5.f000043)
         {
             if (enumc == enum01c5.f000044)
             {
                 goto Label_00AF;
             }
             if (enumc == enum01c5.f000086)
             {
                 goto Label_017C;
             }
             goto Label_000B;
         }
         throw new Exception(string.Format("List<Chunk> chunks still contains IHDR chunk info.", new object[0]));
     Label_00AF:
         if ((p1.f00001d == 0) || (p1.f00001d == 4))
         {
             throw new Exception(string.Format("The given ColorType, {0}, does not support the use of a Palette.", p1.f00001d));
         }
         p2.f000018 = new struct01df[(((int) 1) << (p1.f000008 + 1)) - 1];
         m0002bf(current, ref p2);
         goto Label_000B;
     Label_011A:
         m0002c2(current, ref f000025, ref num);
         goto Label_000B;
     Label_012C:
         if (p0.IndexOf(current) != (p0.Count - 1))
         {
             throw new Exception(string.Format("IEND chunk does not appear to be the last chunk in the image.", new object[0]));
         }
         MemoryStream stream = new MemoryStream(f000025, 0, num);
         c0000cf ccf = new c0000cf(stream);
         m000140(ref ccf);
         goto Label_000B;
     Label_017C:
         f000010 = ((int) current.f00001b) - 1;
         for (int i = 0; i < current.f00001b; i++)
         {
             f00001d[i] = (byte) current.f0001f4.ReadByte();
         }
         goto Label_000B;
     }
     Label_01D6:
     return f000008;
 }
Exemplo n.º 2
0
 private static void m000140(ref c0000cf p0)
 {
     int num2;
     int offset = 0;
     while ((num2 = p0.Read(f000008, offset, f000008.Length - offset)) > 0)
     {
         offset += num2;
         if (offset == f000008.Length)
         {
             byte[] destinationArray = new byte[f000008.Length * 2];
             Array.Copy(f000008, destinationArray, f000008.Length);
             f000008 = destinationArray;
         }
     }
 }