Esempio n. 1
0
        // Token: 0x060003AB RID: 939 RVA: 0x00018678 File Offset: 0x00016878
        internal static int ReadEntrySignature(Stream s)
        {
            int num = 0;

            try
            {
                num = Class_155._ReadFourBytes(s, "n/a");
                if (num == 134695760)
                {
                    s.Seek(12L, SeekOrigin.Current);
                    num = Class_155._ReadFourBytes(s, "n/a");
                    if (num != 67324752)
                    {
                        s.Seek(8L, SeekOrigin.Current);
                        num = Class_155._ReadFourBytes(s, "n/a");
                        if (num != 67324752)
                        {
                            s.Seek(-24L, SeekOrigin.Current);
                            num = Class_155._ReadFourBytes(s, "n/a");
                        }
                    }
                }
            }
            catch (Class_137)
            {
            }
            return(num);
        }
Esempio n. 2
0
 // Token: 0x060003F0 RID: 1008 RVA: 0x00019C2C File Offset: 0x00017E2C
 public void cmethod_574(string str_0)
 {
     byte[] array = Class_155.StringToByteArray(str_0);
     for (int i = 0; i < str_0.Length; i++)
     {
         this.vmethod_575(array[i]);
     }
 }
Esempio n. 3
0
        // Token: 0x060003AA RID: 938 RVA: 0x00018640 File Offset: 0x00016840
        internal static int ReadSignature(Stream s)
        {
            int result = 0;

            try
            {
                result = Class_155._ReadFourBytes(s, "n/a");
            }
            catch (Class_137)
            {
            }
            return(result);
        }
Esempio n. 4
0
 // Token: 0x0600062E RID: 1582 RVA: 0x00026E28 File Offset: 0x00025028
 public long tmethod_1102(uint arg_0, long sayıUınt_0)
 {
     if (arg_0 >= 99U)
     {
         throw new ArgumentOutOfRangeException("diskNumber");
     }
     if (this.field_0 != Class_179.NClass_0.field_6)
     {
         this.field_1 = true;
         throw new Class_135("bad state.");
     }
     if (arg_0 == this.prop_1)
     {
         return(this.field_9.Seek(sayıUınt_0, SeekOrigin.Begin));
     }
     if (this.field_9 != null)
     {
         this.field_9.Dispose();
         if (File.Exists(this.field_5))
         {
             File.Delete(this.field_5);
         }
     }
     for (uint num = this.prop_1 - 1U; num > arg_0; num -= 1U)
     {
         string path = this.vmethod_1095(num);
         if (File.Exists(path))
         {
             File.Delete(path);
         }
     }
     this.prop_1 = arg_0;
     for (int i = 0; i < 3; i++)
     {
         try
         {
             this.field_5 = Class_155.InternalGetTempFileName();
             File.Move(this.prop_2, this.field_5);
             break;
         }
         catch (IOException)
         {
             if (i == 2)
             {
                 throw;
             }
         }
     }
     this.field_9 = new FileStream(this.field_5, FileMode.Open);
     return(this.field_9.Seek(sayıUınt_0, SeekOrigin.Begin));
 }
Esempio n. 5
0
 // Token: 0x060003A5 RID: 933 RVA: 0x0001857C File Offset: 0x0001677C
 public static string NormalizePathForUseInZipFile(string pathName)
 {
     if (string.IsNullOrEmpty(pathName))
     {
         return(pathName);
     }
     if (pathName.Length >= 2 && pathName[1] == ':' && pathName[2] == '\\')
     {
         pathName = pathName.Substring(3);
     }
     pathName = pathName.Replace('\\', '/');
     while (pathName.StartsWith("/"))
     {
         pathName = pathName.Substring(1);
     }
     return(Class_155.SimplifyFwdSlashPath(pathName));
 }
Esempio n. 6
0
        // Token: 0x060003AE RID: 942 RVA: 0x0001878C File Offset: 0x0001698C
        internal static long FindSignature(Stream stream, int SignatureToFind)
        {
            long position = stream.Position;
            int  num      = 65536;

            byte[] array = new byte[]
            {
                (byte)(SignatureToFind >> 24),
                (byte)((SignatureToFind & 16711680) >> 16),
                (byte)((SignatureToFind & 65280) >> 8),
                (byte)(SignatureToFind & 255)
            };
            byte[] array2 = new byte[num];
            bool   flag   = false;

            do
            {
                int num2 = stream.Read(array2, 0, array2.Length);
                if (num2 == 0)
                {
                    break;
                }
                for (int i = 0; i < num2; i++)
                {
                    if (array2[i] == array[3])
                    {
                        long position2 = stream.Position;
                        stream.Seek((long)(i - num2), SeekOrigin.Current);
                        int num3 = Class_155.ReadSignature(stream);
                        flag = (num3 == SignatureToFind);
                        if (flag)
                        {
                            break;
                        }
                        stream.Seek(position2, SeekOrigin.Begin);
                    }
                }
            }while (!flag);
            if (!flag)
            {
                stream.Seek(position, SeekOrigin.Begin);
                return(-1L);
            }
            return(stream.Position - position - 4L);
        }
Esempio n. 7
0
 // Token: 0x060003B2 RID: 946 RVA: 0x00018C58 File Offset: 0x00016E58
 public static void CreateAndOpenUniqueTempFile(string dir, out Stream fs, out string filename)
 {
     for (int i = 0; i < 3; i++)
     {
         try
         {
             filename = Path.Combine(dir, Class_155.InternalGetTempFileName());
             fs       = new FileStream(filename, FileMode.CreateNew);
             return;
         }
         catch (IOException)
         {
             if (i == 2)
             {
                 throw;
             }
         }
     }
     throw new IOException();
 }
Esempio n. 8
0
 // Token: 0x0600062C RID: 1580 RVA: 0x00026CD4 File Offset: 0x00024ED4
 private void smethod_1100(uint arg_0)
 {
     if (this.field_9 != null)
     {
         this.field_9.Dispose();
         if (File.Exists(this.prop_2))
         {
             File.Delete(this.prop_2);
         }
         File.Move(this.field_5, this.prop_2);
     }
     if (arg_0 > 0U)
     {
         this.prop_1 += arg_0;
     }
     Class_155.CreateAndOpenUniqueTempFile(this.field_3, out this.field_9, out this.field_5);
     if (this.prop_1 == 0U)
     {
         this.field_9.Write(BitConverter.GetBytes(134695760), 0, 4);
     }
 }
Esempio n. 9
0
 // Token: 0x060005C6 RID: 1478 RVA: 0x00025CCC File Offset: 0x00023ECC
 public Class_163 gmethod_1003()
 {
     if (this.field_13)
     {
         long num = Class_155.FindSignature(this.field_0, 67324752);
         if (num == -1L)
         {
             return(null);
         }
         this.field_0.Seek(-4L, SeekOrigin.Current);
     }
     else if (this.field_3)
     {
         this.field_0.Seek(this.field_9, SeekOrigin.Begin);
     }
     this.field_2  = Class_163.kmethod_707(this.field_5, !this.field_3);
     this.field_9  = this.field_0.Position;
     this.field_3  = true;
     this.field_4  = true;
     this.field_13 = false;
     return(this.field_2);
 }
Esempio n. 10
0
 // Token: 0x060005FB RID: 1531 RVA: 0x00026212 File Offset: 0x00024412
 public bool gmethod_1053(string str_0)
 {
     return(this.field_7.ContainsKey(Class_155.NormalizePathForUseInZipFile(str_0)));
 }
Esempio n. 11
0
 // Token: 0x060003A8 RID: 936 RVA: 0x00018617 File Offset: 0x00016817
 internal static string Utf8StringFromBuffer(byte[] buf)
 {
     return(Class_155.StringFromBuffer(buf, Class_155.utf8));
 }
Esempio n. 12
0
 // Token: 0x060003A7 RID: 935 RVA: 0x0001860A File Offset: 0x0001680A
 internal static byte[] StringToByteArray(string value)
 {
     return(Class_155.StringToByteArray(value, Class_155.ibm437));
 }
Esempio n. 13
0
 // Token: 0x060003AC RID: 940 RVA: 0x00018714 File Offset: 0x00016914
 internal static int ReadInt(Stream s)
 {
     return(Class_155._ReadFourBytes(s, "Could not read block - no data!  (position 0x{0:X8})"));
 }