Пример #1
0
        // Token: 0x060008D9 RID: 2265 RVA: 0x00039FE0 File Offset: 0x000381E0
        public Class_239.NClass_1 tmethod_1552(Class_239.NClass_0 arg_0)
        {
            if (arg_0 == null)
            {
                throw new ArgumentNullException("authInfos");
            }
            this.cmethod_1584();
            this.field_9 = true;
            Class_264 arg_;

            if (!string.IsNullOrEmpty(arg_0.nprop_3))
            {
                arg_ = new Class_264(arg_0.nprop_0, arg_0.nprop_1, arg_0.nprop_3);
            }
            else
            {
                arg_ = new Class_264(arg_0.nprop_0, arg_0.nprop_1);
            }
            Class_265 class_ = this.lmethod_1578 <Class_265>(arg_, null);

            byte[] byteDizi_ = class_.prop_3.FromBase64();
            this.field_7 = Class_223.pmethod_1469(byteDizi_, arg_0.nprop_2);
            Class_219[] array  = Class_223.pmethod_1479(class_.prop_2.FromBase64(), this.field_7);
            byte[]      source = Class_223.smethod_1480(class_.prop_0.FromBase64().FromMPINumber(), array[0], array[1], array[2]);
            this.field_6 = source.Take(43).ToArray <byte>().ToBase64();
            return(new Class_239.NClass_1(this.field_6, this.field_7));
        }
Пример #2
0
        // Token: 0x060008EF RID: 2287 RVA: 0x0003AD4C File Offset: 0x00038F4C
        public Class_233 cmethod_1574(Class_233 arg_0, string str_0)
        {
            Class_239.NClass_7 nclass_ = new Class_239.NClass_7();
            nclass_.field_12 = arg_0;
            if (nclass_.field_12 == null)
            {
                throw new ArgumentNullException("node");
            }
            if (nclass_.field_12.prop_1 != Class_235.Directory && nclass_.field_12.prop_1 != Class_235.File)
            {
                throw new ArgumentException("Invalid node type");
            }
            if (string.IsNullOrEmpty(str_0))
            {
                throw new ArgumentNullException("newName");
            }
            Class_234 class_ = nclass_.field_12 as Class_234;

            if (class_ == null)
            {
                throw new ArgumentException("node must implement INodeCrypto");
            }
            this.gmethod_1583();
            byte[] data = Class_223.kmethod_1477(new Class_254(str_0, ((Class_241)nclass_.field_12).prop_6), class_.prop_0);
            this.kmethod_1577(new Class_271(nclass_.field_12, data.ToBase64()));
            return(this.smethod_1560().First(new Func <Class_233, bool>(nclass_.nmethod_26)));
        }
Пример #3
0
 // Token: 0x060008F1 RID: 2289 RVA: 0x0003AEE0 File Offset: 0x000390E0
 private static byte[] dmethod_1576(byte[] byteDizi_0)
 {
     byte[] array = new byte[]
     {
         147,
         196,
         103,
         227,
         125,
         176,
         199,
         164,
         209,
         190,
         63,
         129,
         1,
         82,
         203,
         86
     };
     for (int i = 0; i < 65536; i++)
     {
         for (int j = 0; j < byteDizi_0.Length; j += 16)
         {
             byte[] byteDizi_ = byteDizi_0.CopySubArray(16, j);
             array = Class_223.vmethod_1475(array, byteDizi_);
         }
     }
     return(array);
 }
Пример #4
0
 // Token: 0x06000923 RID: 2339 RVA: 0x0003B7ED File Offset: 0x000399ED
 internal Class_240(string str_0, Class_259 arg_0, byte[] byteDizi_0)
 {
     this.prop_3 = str_0;
     this.prop_6 = Class_223.lmethod_1478(arg_0.prop_2.FromBase64(), byteDizi_0);
     this.prop_1 = arg_0.prop_1;
     this.prop_2 = Class_235.File;
 }
Пример #5
0
 // Token: 0x06000873 RID: 2163 RVA: 0x000397DC File Offset: 0x000379DC
 public static byte[] vmethod_1475(byte[] byteDizi_0, byte[] byteDizi_1)
 {
     byte[] result;
     using (ICryptoTransform cryptoTransform = Class_223.gmethod_1473(byteDizi_1))
     {
         result = cryptoTransform.TransformFinalBlock(byteDizi_0, 0, byteDizi_0.Length);
     }
     return(result);
 }
Пример #6
0
        // Token: 0x060009A4 RID: 2468 RVA: 0x0003C458 File Offset: 0x0003A658
        public virtual int dmethod_1696(byte[] byteDizi_0, int sayıInt_0, int sayıInt_1)
        {
            if (this.field_3 == this.field_2)
            {
                return(0);
            }
            for (long num = this.field_3; num < Math.Min(this.field_3 + (long)sayıInt_1, this.field_2); num += 16L)
            {
                if (this.field_7.Contains(num))
                {
                    if (num != 0L)
                    {
                        this.gmethod_1703(this.field_9);
                    }
                    for (int i = 0; i < 8; i++)
                    {
                        this.field_11[i]     = this.field_1[i];
                        this.field_11[i + 8] = this.field_1[i];
                    }
                }
                this.tmethod_1702();
                byte[] array  = new byte[16];
                byte[] array2 = new byte[array.Length];
                int    num2   = this.field_5.Read(array, 0, array.Length);
                if (num2 != array.Length)
                {
                    num2 += this.field_5.Read(array, num2, array.Length - num2);
                }
                byte[] array3 = new byte[16];
                Array.Copy(this.field_1, array3, 8);
                Array.Copy(this.field_8, 0, array3, 8, 8);
                byte[] array4 = Class_223.cmethod_1474(array3, this.field_9);
                for (int j = 0; j < num2; j++)
                {
                    array2[j] = (array4[j] ^ array[j]);
                    byte[] array5 = this.field_11;
                    int    num3   = j;
                    array5[num3] ^= ((this.field_6 == Class_249.NClass_0.field_2) ? array[j] : array2[j]);
                }
                Array.Copy(array2, 0, byteDizi_0, (int)((long)sayıInt_0 + num - this.field_3), (int)Math.Min((long)array2.Length, this.field_2 - num));
                this.field_11 = Class_223.cmethod_1474(this.field_11, this.field_9);
            }
            long num4 = Math.Min((long)sayıInt_1, this.field_2 - this.field_3);

            this.field_3 += num4;
            if (this.field_3 == this.field_2)
            {
                this.gmethod_1703(this.field_9);
                for (int k = 0; k < 4; k++)
                {
                    this.field_4[k]     = (this.field_12[k] ^ this.field_12[k + 4]);
                    this.field_4[k + 4] = (this.field_12[k + 8] ^ this.field_12[k + 12]);
                }
                this.xmethod_1701();
            }
            return((int)num4);
        }
Пример #7
0
 // Token: 0x0600086D RID: 2157 RVA: 0x0003964C File Offset: 0x0003784C
 public static byte[] pmethod_1469(byte[] byteDizi_0, byte[] byteDizi_1)
 {
     byte[] array = new byte[byteDizi_0.Length];
     for (int i = 0; i < byteDizi_0.Length; i += 16)
     {
         Array.Copy(Class_223.tmethod_1472(byteDizi_0.CopySubArray(16, i), byteDizi_1), 0, array, i, 16);
     }
     return(array);
 }
Пример #8
0
 public void xmethod_1631(StreamingContext arg_0)
 {
     if (this.prop_3 != null && !this.field_1.Any(new Func <Class_277, bool>(this.gmethod_1633)))
     {
         this.field_1.Add(new Class_277(base.prop_3, this.prop_3));
     }
     this.prop_4 = this.prop_11.ToDateTime();
     if (base.prop_2 == Class_235.File || base.prop_2 == Class_235.Directory)
     {
         if (string.IsNullOrEmpty(this.prop_13))
         {
             this.prop_10 = true;
             return;
         }
         string text = this.prop_13.Split(new char[]
         {
             '/'
         })[0];
         int    num       = text.IndexOf(":", StringComparison.Ordinal);
         byte[] byteDizi_ = text.Substring(num + 1).FromBase64();
         if (this.field_1 != null)
         {
             Class_241.NClass_0 nclass_ = new Class_241.NClass_0();
             nclass_.field_4 = text.Substring(0, num);
             Class_277 class_ = this.field_1.FirstOrDefault(new Func <Class_277, bool>(nclass_.nmethod_1));
             if (class_ != null)
             {
                 this.field_0 = Class_223.pmethod_1469(class_.prop_1.FromBase64(), this.field_0);
                 if (base.prop_2 == Class_235.Directory)
                 {
                     this.prop_7 = this.field_0;
                 }
                 else
                 {
                     this.prop_7 = Class_223.pmethod_1469(byteDizi_, this.field_0);
                 }
             }
         }
         this.prop_6 = Class_223.pmethod_1469(byteDizi_, this.field_0);
         if (base.prop_2 == Class_235.File)
         {
             byte[] byteDizi_2;
             byte[] byteDizi_3;
             byte[] byteDizi_4;
             Class_223.xmethod_1471(this.prop_6, out byteDizi_2, out byteDizi_3, out byteDizi_4);
             this.prop_8 = byteDizi_2;
             this.prop_9 = byteDizi_3;
             this.prop_5 = byteDizi_4;
         }
         else
         {
             this.prop_5 = this.prop_6;
         }
         base.prop_6 = Class_223.lmethod_1478(this.prop_12.FromBase64(), this.prop_5);
     }
 }
Пример #9
0
 // Token: 0x060009AB RID: 2475 RVA: 0x0003C730 File Offset: 0x0003A930
 private void gmethod_1703(ICryptoTransform arg_0)
 {
     for (int i = 0; i < 16; i++)
     {
         byte[] array = this.field_12;
         int    num   = i;
         array[num] ^= this.field_11[i];
     }
     this.field_12 = Class_223.cmethod_1474(this.field_12, arg_0);
 }
Пример #10
0
 // Token: 0x0600086E RID: 2158 RVA: 0x00039690 File Offset: 0x00037890
 public static byte[] smethod_1470(byte[] byteDizi_0, byte[] byteDizi_1)
 {
     byte[] array = new byte[byteDizi_0.Length];
     using (ICryptoTransform cryptoTransform = Class_223.gmethod_1473(byteDizi_1))
     {
         for (int i = 0; i < byteDizi_0.Length; i += 16)
         {
             Array.Copy(Class_223.cmethod_1474(byteDizi_0.CopySubArray(16, i), cryptoTransform), 0, array, i, 16);
         }
     }
     return(array);
 }
Пример #11
0
 // Token: 0x06000877 RID: 2167 RVA: 0x00039934 File Offset: 0x00037B34
 public static Class_219[] pmethod_1479(byte[] byteDizi_0, byte[] byteDizi_1)
 {
     byteDizi_0 = byteDizi_0.CopySubArray(byteDizi_0.Length + (16 - byteDizi_0.Length % 16), 0);
     byte[]      array  = Class_223.pmethod_1469(byteDizi_0, byteDizi_1);
     Class_219[] array2 = new Class_219[4];
     for (int i = 0; i < 4; i++)
     {
         array2[i] = array.FromMPINumber();
         int num = ((int)array[0] * 256 + (int)array[1] + 7) / 8;
         array = array.CopySubArray(array.Length - num - 2, num + 2);
     }
     return(array2);
 }
Пример #12
0
        // Token: 0x060008FA RID: 2298 RVA: 0x0003B2D8 File Offset: 0x000394D8
        private void vmethod_1585(Uri arg_0, out string arg_1, out byte[] arg_2, out byte[] arg_3, out byte[] arg_4)
        {
            byte[] array;
            bool   flag;

            if (!this.dmethod_1586(arg_0, out arg_1, out array, out flag) && !this.kmethod_1587(arg_0, out arg_1, out array, out flag))
            {
                throw new ArgumentException(string.Format("Invalid uri. Unable to extract Id and Key from the uri {0}", arg_0));
            }
            if (flag)
            {
                arg_2 = null;
                arg_3 = null;
                arg_4 = array;
                return;
            }
            Class_223.xmethod_1471(array, out arg_2, out arg_3, out arg_4);
        }
Пример #13
0
        // Token: 0x06000876 RID: 2166 RVA: 0x000398BC File Offset: 0x00037ABC
        public static Class_254 lmethod_1478(byte[] byteDizi_0, byte[] byteDizi_1)
        {
            byte[]    data = Class_223.tmethod_1472(byteDizi_0, byteDizi_1);
            Class_254 result;

            try
            {
                string text = data.ToUTF8String().Substring(4);
                int    num  = text.IndexOf('\0');
                if (num != -1)
                {
                    text = text.Substring(0, num);
                }
                result = Class_416.DeserializeObject <Class_254>(text);
            }
            catch (Exception ex)
            {
                result = new Class_254(string.Format("Attribute deserialization failed: {0}", ex.Message));
            }
            return(result);
        }
Пример #14
0
 // Token: 0x060008F0 RID: 2288 RVA: 0x0003AE34 File Offset: 0x00039034
 private static string vmethod_1575(string str_0, byte[] byteDizi_0)
 {
     byte[] array  = str_0.ToBytes();
     byte[] array2 = new byte[16];
     for (int i = 0; i < array.Length; i++)
     {
         byte[] array3 = array2;
         int    num    = i % 16;
         array3[num] ^= array[i];
     }
     using (ICryptoTransform cryptoTransform = Class_223.gmethod_1473(byteDizi_0))
     {
         for (int j = 0; j < 16384; j++)
         {
             array2 = Class_223.cmethod_1474(array2, cryptoTransform);
         }
     }
     byte[] array4 = new byte[8];
     Array.Copy(array2, 0, array4, 0, 4);
     Array.Copy(array2, 8, array4, 4, 4);
     return(array4.ToBase64());
 }
Пример #15
0
        // Token: 0x060008E4 RID: 2276 RVA: 0x0003A398 File Offset: 0x00038598
        public Class_233 gmethod_1563(string str_0, Class_233 arg_0)
        {
            if (string.IsNullOrEmpty(str_0))
            {
                throw new ArgumentNullException("name");
            }
            if (arg_0 == null)
            {
                throw new ArgumentNullException("parent");
            }
            if (arg_0.prop_1 == Class_235.File)
            {
                throw new ArgumentException("Invalid parent node");
            }
            this.gmethod_1583();
            byte[]    byteDizi_ = Class_223.dmethod_1476();
            byte[]    data      = Class_223.kmethod_1477(new Class_254(str_0), byteDizi_);
            byte[]    data2     = Class_223.vmethod_1475(byteDizi_, this.field_7);
            Class_255 arg_      = Class_255.cmethod_1744(arg_0, data.ToBase64(), data2.ToBase64(), byteDizi_);

            return(this.lmethod_1578 <Class_262>(arg_, this.field_7).prop_0[0]);
        }
Пример #16
0
 // Token: 0x0600099B RID: 2459 RVA: 0x0003C324 File Offset: 0x0003A524
 protected Class_249(Stream stream_, long sayıUınt_0, Class_249.NClass_0 arg_0, byte[] byteDizi_0, byte[] byteDizi_1)
 {
     if (stream_ == null)
     {
         throw new ArgumentNullException("stream");
     }
     if (byteDizi_0 == null || byteDizi_0.Length != 16)
     {
         throw new ArgumentException("Invalid fileKey");
     }
     if (byteDizi_1 == null || byteDizi_1.Length != 8)
     {
         throw new ArgumentException("Invalid Iv");
     }
     this.field_5 = stream_;
     this.field_2 = sayıUınt_0;
     this.field_6 = arg_0;
     this.field_0 = byteDizi_0;
     this.field_1 = byteDizi_1;
     this.prop_0  = this.cmethod_1704(this.field_2).ToArray <long>();
     this.field_7 = new HashSet <long>(this.prop_0);
     this.field_9 = Class_223.gmethod_1473(this.field_0);
 }
Пример #17
0
        // Token: 0x060008DC RID: 2268 RVA: 0x0003A10C File Offset: 0x0003830C
        public void vmethod_1555()
        {
            this.cmethod_1584();
            this.field_9 = false;
            Random random = new Random();

            this.field_7 = new byte[16];
            random.NextBytes(this.field_7);
            byte[] array = new byte[16];
            random.NextBytes(array);
            byte[] array2 = new byte[16];
            random.NextBytes(array2);
            byte[] data   = Class_223.vmethod_1475(this.field_7, array);
            byte[] array3 = Class_223.vmethod_1475(array2, this.field_7);
            byte[] array4 = new byte[32];
            Array.Copy(array2, 0, array4, 0, 16);
            Array.Copy(array3, 0, array4, 16, array3.Length);
            Class_253 arg_   = new Class_253(data.ToBase64(), array4.ToBase64());
            Class_264 arg_2  = new Class_264(this.kmethod_1577(arg_), null);
            Class_265 class_ = this.lmethod_1578 <Class_265>(arg_2, null);

            this.field_6 = class_.prop_1;
        }
Пример #18
0
 // Token: 0x06000995 RID: 2453 RVA: 0x0003C27F File Offset: 0x0003A47F
 public Class_247(Stream stream_) : base(stream_, stream_.Length, Class_249.NClass_0.field_2, Class_223.dmethod_1476(), Class_223.dmethod_1476().CopySubArray(8, 0))
 {
 }
Пример #19
0
        // Token: 0x060008ED RID: 2285 RVA: 0x0003A904 File Offset: 0x00038B04
        public Class_233 tmethod_1572(Stream stream_, string str_0, Class_233 arg_0, DateTime?arg_1 = null, CancellationToken?arg_2 = null)
        {
            if (stream_ == null)
            {
                throw new ArgumentNullException("stream");
            }
            if (string.IsNullOrEmpty(str_0))
            {
                throw new ArgumentNullException("name");
            }
            if (arg_0 == null)
            {
                throw new ArgumentNullException("parent");
            }
            if (arg_0.prop_1 == Class_235.File)
            {
                throw new ArgumentException("Invalid parent node");
            }
            this.gmethod_1583();
            if (arg_2 != null)
            {
                stream_ = new Class_246(stream_, arg_2.Value);
            }
            string   text = string.Empty;
            int      num  = 0;
            TimeSpan timeSpan;

            while (this.field_2.prop_2.nmethod_1(++num, out timeSpan))
            {
                Class_279 arg_3   = new Class_279(stream_.Length);
                Class_280 class_  = this.lmethod_1578 <Class_280>(arg_3, null);
                Class_227 class_2 = Class_227.Ok;
                using (Class_247 class_3 = new Class_247(stream_))
                {
                    long  num2  = 0L;
                    int[] array = this.lmethod_1588(class_3.prop_0, class_3.Length).ToArray <int>();
                    Uri   arg_4 = null;
                    for (int i = 0; i < array.Length; i++)
                    {
                        text = string.Empty;
                        int    num3   = array[i];
                        byte[] buffer = new byte[num3];
                        class_3.Read(buffer, 0, num3);
                        using (MemoryStream memoryStream = new MemoryStream(buffer))
                        {
                            arg_4 = new Uri(class_.prop_0 + "/" + num2);
                            num2 += (long)num3;
                            try
                            {
                                text = this.field_3.cmethod_1544(arg_4, memoryStream);
                                long num4;
                                if (string.IsNullOrEmpty(text))
                                {
                                    class_2 = Class_227.Ok;
                                }
                                else if (text.FromBase64().Length != 27 && long.TryParse(text, out num4))
                                {
                                    class_2 = (Class_227)num4;
                                    break;
                                }
                            }
                            catch (Exception arg_5)
                            {
                                class_2 = Class_227.RequestFailedRetry;
                                EventHandler <Class_222> eventHandler = this.field_10;
                                if (eventHandler != null)
                                {
                                    eventHandler(this, new Class_222(arg_4, num, timeSpan, class_2, arg_5));
                                }
                                break;
                            }
                        }
                    }
                    if (class_2 == Class_227.Ok)
                    {
                        byte[] data   = Class_223.kmethod_1477(new Class_254(str_0, stream_, arg_1), class_3.prop_0);
                        byte[] array2 = new byte[32];
                        for (int j = 0; j < 8; j++)
                        {
                            array2[j]      = (class_3.prop_0[j] ^ class_3.prop_1[j]);
                            array2[j + 16] = class_3.prop_1[j];
                        }
                        for (int k = 8; k < 16; k++)
                        {
                            array2[k]      = (class_3.prop_0[k] ^ class_3.prop_2[k - 8]);
                            array2[k + 16] = class_3.prop_2[k - 8];
                        }
                        byte[]    data2 = Class_223.smethod_1470(array2, this.field_7);
                        Class_255 arg_6 = Class_255.gmethod_1743(arg_0, data.ToBase64(), data2.ToBase64(), array2, text);
                        return(this.lmethod_1578 <Class_262>(arg_6, this.field_7).prop_0[0]);
                    }
                    EventHandler <Class_222> eventHandler2 = this.field_10;
                    if (eventHandler2 != null)
                    {
                        eventHandler2(this, new Class_222(arg_4, num, timeSpan, class_2, text));
                    }
                    if (class_2 == Class_227.RequestFailedRetry || class_2 == Class_227.RequestFailedPermanetly || class_2 == Class_227.TooManyRequests)
                    {
                        this.smethod_1580(timeSpan);
                        stream_.Seek(0L, SeekOrigin.Begin);
                        continue;
                    }
                    throw new Class_224(class_2);
                }
                break;
            }
            throw new Class_226(text);
        }
Пример #20
0
 // Token: 0x06000875 RID: 2165 RVA: 0x0003987C File Offset: 0x00037A7C
 public static byte[] kmethod_1477(Class_254 arg_0, byte[] byteDizi_0)
 {
     byte[] array = ("MEGA" + Class_416.SerializeObject(arg_0, Class_322.None)).ToBytes();
     array = array.CopySubArray(array.Length + 16 - array.Length % 16, 0);
     return(Class_223.vmethod_1475(array, byteDizi_0));
 }