예제 #1
0
        protected void method_9(bool bool_3)
        {
            string path1 = Path.Combine(GClass88.CachePath, "rpl2elf.exe");

            if (!System.IO.File.Exists(path1))
            {
                System.IO.File.WriteAllBytes(path1, Class123.rpl2elf);
            }
            GClass13 gclass13   = this.gclass30_0.method_15();
            GClass12 gclass12_1 = gclass13.Files.First <GClass12>((Func <GClass12, bool>)(gclass12_0 => gclass12_0.string_1.Contains(".rpx")));
            GClass12 gclass12_2 = gclass13.Files.First <GClass12>((Func <GClass12, bool>)(gclass12_0 =>
            {
                if (gclass12_0.bool_1)
                {
                    return(gclass12_0.string_1 == "code");
                }
                return(false);
            }));

            this.gclass30_0.method_16(this.String_5, true, (bool_3 ? 1 : 0) != 0, (IEnumerable <GClass12>) new GClass12[2]
            {
                gclass12_1,
                gclass12_2
            }, false);
            Process process = new Process();
            string  path2   = this.method_11();
            string  str     = this.method_10();

            process.StartInfo.FileName         = path1;
            process.EnableRaisingEvents        = true;
            process.StartInfo.CreateNoWindow   = true;
            process.StartInfo.Arguments        = string.Format("\"{0}\" \"{1}\"", (object)path2, (object)str);
            process.StartInfo.WorkingDirectory = Path.GetDirectoryName(path2);
            process.StartInfo.UseShellExecute  = false;
            process.Start();
            process.WaitForExit();
        }
예제 #2
0
        private bool method_0(GClass12 gclass12_0)
        {
            string str1 = "\\" + gclass12_0.string_0;

            if (string.IsNullOrEmpty(str1))
            {
                return(false);
            }
            string str2 = str1;

            string[] strArray1 = str1.Split('\\');
            string[] strArray2 = str2.Split('\\');
            for (int index = 0; index < strArray1.Length; ++index)
            {
                // ISSUE: object of a compiler-generated type is created
                // ISSUE: variable of a compiler-generated type
                Class17.Class18 class18 = new Class17.Class18();
                if (!(Path.GetExtension(strArray1[index]) != string.Empty))
                {
                    string str3 = string.Join("\\", strArray1, 0, index + 1);
                    if (index == 0)
                    {
                        str3 = "\\" + str3;
                    }
                    string upper = str3.ToUpper();
                    if (!this.dictionary_1.ContainsKey(upper))
                    {
                        this.dictionary_1.Add(upper, new List <Class16>());
                    }
                    if (index >= 0 && index < strArray1.Length - 1)
                    {
                        bool           flag   = Path.GetExtension(strArray1[index + 1]) == string.Empty;
                        List <Class16> source = this.dictionary_1[upper];
                        // ISSUE: reference to a compiler-generated field
                        class18.fileInformation_0 = new FileInformation()
                        {
                            Attributes     = flag ? FileAttributes.ReadOnly | FileAttributes.Directory : FileAttributes.ReadOnly,
                            CreationTime   = new DateTime?(DateTime.Now),
                            LastAccessTime = new DateTime?(DateTime.Now),
                            LastWriteTime  = new DateTime?(DateTime.Now),
                            Length         = flag ? 0L : (long)gclass12_0.uint_2,
                            FileName       = strArray2[index + 1]
                        };
                        // ISSUE: reference to a compiler-generated method
                        if (source.All <Class16>(new Func <Class16, bool>(class18.method_0)))
                        {
                            // ISSUE: reference to a compiler-generated field
                            source.Add(new Class16()
                            {
                                fileInformation_0 = class18.fileInformation_0,
                                gclass12_0        = gclass12_0
                            });
                        }
                    }
                }
                else
                {
                    break;
                }
            }
            return(true);
        }
예제 #3
0
        private void method_4(GClass12 gclass12_0, Stream stream_0, bool bool_0, ulong ulong_2 = 0)
        {
            uint  contentId = this.gclass100_0.GClass101_0[(int)gclass12_0.short_0].ContentId;
            ulong uint1     = (ulong)gclass12_0.uint_1;
            ulong uint2     = (ulong)gclass12_0.uint_2;

            byte[] numArray = new byte[16];
            numArray[1] = (byte)gclass12_0.short_0;
            byte[] rgbIV = numArray;
            Stream responseStream;

            if (bool_0)
            {
                HttpWebRequest httpWebRequest = (HttpWebRequest)WebRequest.Create(this.gclass30_0.CDN_URL_PLUS_TITLEID + contentId.ToString("x8"));
                httpWebRequest.AddRange((long)uint1);
                responseStream = httpWebRequest.GetResponse().GetResponseStream();
            }
            else
            {
                responseStream = this.dictionary_0[contentId];
            }
            using (AesCryptoServiceProvider cryptoServiceProvider = new AesCryptoServiceProvider())
            {
                cryptoServiceProvider.Key     = this.gclass99_0.Byte_0;
                cryptoServiceProvider.Mode    = CipherMode.CBC;
                cryptoServiceProvider.Padding = PaddingMode.None;
                if (!bool_0)
                {
                    responseStream.Seek((long)uint1, SeekOrigin.Begin);
                }
                int num1 = (int)this.method_7((long)uint2, 16L);
                if (ulong_2 > 0UL)
                {
                    long num2 = this.method_7((long)ulong_2, 16L);
                    if (num2 < (long)num1)
                    {
                        num1 = (int)num2;
                    }
                }
                byte[] inputBuffer = responseStream.smethod_3(num1, (Action <int>)(int_2 =>
                {
                    this.ulong_1 += (ulong)int_2;
                    this.method_9();
                }));
                byte[] buffer;
                using (ICryptoTransform decryptor = cryptoServiceProvider.CreateDecryptor(this.gclass99_0.Byte_0, rgbIV))
                    buffer = decryptor.TransformFinalBlock(inputBuffer, 0, num1);
                if (ulong_2 > 0UL)
                {
                    stream_0.Write(buffer, 0, num1);
                }
                else
                {
                    stream_0.Write(buffer, 0, (int)uint2);
                }
            }
            if (!bool_0)
            {
                return;
            }
            responseStream.Close();
        }
예제 #4
0
        private void method_3(GClass12 gclass12_0, Stream stream_0, bool bool_0, ulong ulong_2 = 0)
        {
            uint contentId = this.gclass100_0.GClass101_0[(int)gclass12_0.short_0].ContentId;

            byte[] numArray1 = new byte[65536];
            long   uint1     = (long)gclass12_0.uint_1;
            ulong  uint2     = (ulong)gclass12_0.uint_2;
            ulong  num1      = 0;
            ulong  num2      = 64512;
            ulong  num3      = (ulong)uint1 / 64512UL * 65536UL;
            int    num4      = (int)(num3 / 65536UL);
            ulong  num5      = (ulong)(uint1 - (long)((ulong)uint1 / 64512UL) * 64512L);

            if (num5 + uint2 > num2)
            {
                num2 -= num5;
            }
            Stream responseStream;

            if (bool_0)
            {
                HttpWebRequest httpWebRequest = (HttpWebRequest)WebRequest.Create(this.gclass30_0.CDN_URL_PLUS_TITLEID + contentId.ToString("x8"));
                httpWebRequest.Method = "GET";
                httpWebRequest.AddRange((long)num3);
                responseStream = httpWebRequest.GetResponse().GetResponseStream();
            }
            else
            {
                responseStream = this.dictionary_0[contentId];
            }
            byte[] numArray2 = new byte[16];
            numArray2[1] = (byte)gclass12_0.short_0;
            byte[] numArray3 = numArray2;
            using (AesCryptoServiceProvider cryptoServiceProvider = new AesCryptoServiceProvider())
            {
                cryptoServiceProvider.Key     = this.gclass99_0.Byte_0;
                cryptoServiceProvider.Mode    = CipherMode.CBC;
                cryptoServiceProvider.Padding = PaddingMode.None;
                cryptoServiceProvider.IV      = numArray3;
                if (!bool_0)
                {
                    responseStream.Seek((long)num3, SeekOrigin.Begin);
                }
                while (uint2 > 0UL)
                {
                    if (num2 > uint2)
                    {
                        num2 = uint2;
                    }
                    responseStream.smethod_4(numArray1, 65536);
                    byte[] numArray4 = new byte[16];
                    numArray4[1] = (byte)gclass12_0.short_0;
                    byte[] rgbIV     = numArray4;
                    byte[] numArray5 = new byte[20];
                    byte[] numArray6;
                    using (ICryptoTransform decryptor = cryptoServiceProvider.CreateDecryptor(this.gclass99_0.Byte_0, rgbIV))
                        numArray6 = decryptor.TransformFinalBlock(numArray1, 0, 1024);
                    numArray6[1] ^= (byte)gclass12_0.short_0;
                    Buffer.BlockCopy((Array)numArray6, num4 % 16 * 20, (Array)rgbIV, 0, 16);
                    using (ICryptoTransform decryptor = cryptoServiceProvider.CreateDecryptor(this.gclass99_0.Byte_0, rgbIV))
                        decryptor.TransformBlock(numArray1, 1024, 64512, this.byte_0, 0);
                    uint2 -= num2;
                    stream_0.Write(this.byte_0, (int)num5, (int)num2);
                    this.ulong_1 += num2;
                    if (ulong_2 > 0UL)
                    {
                        if (this.ulong_1 >= ulong_2)
                        {
                            break;
                        }
                    }
                    this.method_9();
                    num1 += num2;
                    ++num4;
                    if (num5 != 0UL)
                    {
                        num2 = 64512UL;
                        num5 = 0UL;
                    }
                }
            }
            if (!bool_0)
            {
                return;
            }
            responseStream.Close();
        }
예제 #5
0
 public GClass13(byte[] byte_0)
 {
     using (BinaryReader binaryReader_0 = new BinaryReader((Stream) new MemoryStream(byte_0)))
     {
         if (binaryReader_0.ReadUInt32() != 5526342U)
         {
             throw new Exception("Incorrect FST!");
         }
         binaryReader_0.smethod_2();
         int num1 = binaryReader_0.smethod_2();
         binaryReader_0.BaseStream.Seek(32L, SeekOrigin.Begin);
         for (int index = 0; index < num1; ++index)
         {
             int num2 = (int)binaryReader_0.ReadUInt32();
             int num3 = (int)binaryReader_0.smethod_4();
             int num4 = (int)binaryReader_0.ReadUInt32();
             binaryReader_0.BaseStream.Seek(20L, SeekOrigin.Current);
         }
         binaryReader_0.BaseStream.Seek((long)(32 + num1 * 32 + 8), SeekOrigin.Begin);
         uint num5 = binaryReader_0.smethod_4();
         binaryReader_0.BaseStream.Seek((long)(32 + num1 * 32), SeekOrigin.Begin);
         for (int index = 0; (long)index < (long)num5; ++index)
         {
             GClass12 gclass12 = new GClass12()
             {
                 byte_0 = binaryReader_0.ReadByte()
             };
             gclass12.bool_1 = ((int)gclass12.byte_0 & 1) == 1;
             gclass12.bool_0 = ((uint)gclass12.byte_0 & 128U) > 0U;
             binaryReader_0.smethod_0(3);
             gclass12.uint_1  = binaryReader_0.smethod_4();
             gclass12.uint_2  = binaryReader_0.smethod_4();
             gclass12.short_1 = binaryReader_0.smethod_1();
             gclass12.short_0 = binaryReader_0.smethod_1();
             this.Files.Add(gclass12);
         }
         for (int index = 0; (long)index < (long)num5; ++index)
         {
             string str = "";
             while (true)
             {
                 char ch = binaryReader_0.ReadChar();
                 if (ch != char.MinValue)
                 {
                     str += ch.ToString();
                 }
                 else
                 {
                     break;
                 }
             }
             this.Files[index].string_1 = str;
         }
         foreach (GClass12 gclass12 in this.Files.Where <GClass12>((Func <GClass12, bool>)(gclass12_0 => gclass12_0.bool_1)).ToList <GClass12>())
         {
             gclass12.string_0 = Path.Combine(this.Files[(int)gclass12.uint_1].string_0 ?? "", gclass12.string_1);
         }
         List <int> source = new List <int>()
         {
             (int)this.Files[0].uint_2
         };
         string str1 = "";
         for (int index = 1; (long)index < (long)num5; ++index)
         {
             while (source.Last <int>() <= index)
             {
                 str1 = this.method_0(str1);
                 source.RemoveAt(source.Count - 1);
             }
             if (this.Files[index].bool_1)
             {
                 str1 = Path.Combine(str1, this.Files[index].string_1);
                 source.Add((int)this.Files[index].uint_2);
             }
             else
             {
                 this.Files[index].string_0 = Path.Combine(str1, this.Files[index].string_1);
             }
         }
     }
 }