Esempio n. 1
0
        public static Enum3 smethod_0(byte[] byte_1, byte[] byte_2, int int_5, byte[] byte_3, byte byte_4)
        {
            byte[] numArray1 = new byte[16];
            numArray1[1] = byte_4;
            byte[] byte_3_1 = numArray1;
            SHA1   shA1     = SHA1.Create();

            byte[] byte_1_1 = new byte[1024];
            Buffer.BlockCopy((Array)byte_1, 0, (Array)byte_1_1, 0, 1024);
            byte[] numArray2 = Class85.smethod_5(byte_1_1, byte_3, byte_3_1);
            numArray2[1] ^= byte_4;
            int srcOffset1 = int_5 % 16 * 20;
            int srcOffset2 = (16 + int_5 / 16 % 16) * 20;
            int srcOffset3 = (32 + int_5 / 256 % 16) * 20;
            int srcOffset4 = int_5 / 4096 % 16 * 20;

            byte[] byte_0_1 = new byte[20];
            byte[] byte_1_2 = new byte[20];
            byte[] byte_0_2 = new byte[20];
            byte[] byte_1_3 = new byte[20];
            Buffer.BlockCopy((Array)numArray2, srcOffset1, (Array)byte_0_1, 0, 20);
            Buffer.BlockCopy((Array)numArray2, srcOffset1, (Array)byte_3_1, 0, 16);
            byte[] byte_1_4 = new byte[64512];
            Buffer.BlockCopy((Array)byte_1, 1024, (Array)byte_1_4, 0, 64512);
            byte[] buffer1 = Class85.smethod_5(byte_1_4, byte_3, byte_3_1);
            byte[] hash1   = shA1.ComputeHash(buffer1);
            if (!GClass27.smethod_1(byte_0_1, hash1))
            {
                return(Enum3.const_1);
            }
            if (int_5 % 16 == 0)
            {
                byte[] buffer2 = new byte[320];
                Buffer.BlockCopy((Array)numArray2, srcOffset1, (Array)buffer2, 0, 320);
                Buffer.BlockCopy((Array)numArray2, srcOffset2, (Array)byte_1_2, 0, 20);
                if (!GClass27.smethod_1(shA1.ComputeHash(buffer2), byte_1_2))
                {
                    return(Enum3.const_1);
                }
            }
            if (int_5 % 256 == 0)
            {
                byte[] buffer2 = new byte[320];
                Buffer.BlockCopy((Array)numArray2, srcOffset2, (Array)buffer2, 0, 320);
                Buffer.BlockCopy((Array)numArray2, srcOffset3, (Array)byte_0_2, 0, 20);
                byte[] hash2 = shA1.ComputeHash(buffer2);
                if (!GClass27.smethod_1(byte_0_2, hash2))
                {
                    return(Enum3.const_1);
                }
            }
            if (int_5 % 4096 != 0)
            {
                return(Enum3.const_0);
            }
            byte[] buffer3 = new byte[320];
            Buffer.BlockCopy((Array)numArray2, srcOffset3, (Array)buffer3, 0, 320);
            Buffer.BlockCopy((Array)byte_2, srcOffset4, (Array)byte_1_3, 0, 20);
            return(!GClass27.smethod_1(shA1.ComputeHash(buffer3), byte_1_3) ? Enum3.const_1 : Enum3.const_0);
        }
Esempio n. 2
0
 private bool method_16(byte[] byte_1, int int_1 = 0)
 {
     using (SHA1 shA1 = SHA1.Create())
     {
         shA1.TransformFinalBlock(byte_1, int_1, byte_1.Length - int_1);
         return(GClass27.smethod_1(this.Byte_0, shA1.Hash));
     }
 }
Esempio n. 3
0
            private void method_2(Stream stream_0)
            {
                stream_0.Seek(0L, SeekOrigin.Begin);
                byte[] buffer1 = new byte[4];
                if (!this.bool_1)
                {
                    stream_0.Read(this.byte_0, 0, this.byte_0.Length);
                }
                stream_0.Read(this.byte_9, 0, this.byte_9.Length);
                stream_0.Read(buffer1, 0, 4);
                if ((int)GClass27.smethod_5(BitConverter.ToUInt32(buffer1, 0)) != (int)this.uint_3)
                {
                    throw new Exception("Invalid Magic!");
                }
                stream_0.Read(buffer1, 0, 4);
                if ((int)GClass27.smethod_5(BitConverter.ToUInt32(buffer1, 0)) != (int)this.uint_4)
                {
                    throw new Exception("Invalid Header Size!");
                }
                stream_0.Read(buffer1, 0, 4);
                this.uint_6 = GClass27.smethod_5(BitConverter.ToUInt32(buffer1, 0));
                stream_0.Read(buffer1, 0, 4);
                this.uint_2 = GClass27.smethod_5(BitConverter.ToUInt32(buffer1, 0));
                stream_0.Read(buffer1, 0, 4);
                this.uint_0 = GClass27.smethod_5(BitConverter.ToUInt32(buffer1, 0));
                stream_0.Read(buffer1, 0, 4);
                this.uint_5 = GClass27.smethod_5(BitConverter.ToUInt32(buffer1, 0));
                stream_0.Read(buffer1, 0, 4);
                this.uint_1 = GClass27.smethod_5(BitConverter.ToUInt32(buffer1, 0));
                stream_0.Read(this.byte_7, 0, this.byte_7.Length);
                stream_0.Read(this.byte_2, 0, this.byte_2.Length);
                stream_0.Read(this.byte_4, 0, this.byte_4.Length);
                stream_0.Read(this.byte_3, 0, this.byte_3.Length);
                stream_0.Read(this.byte_11, 0, this.byte_11.Length);
                stream_0.Read(this.byte_6, 0, this.byte_6.Length);
                stream_0.Read(this.byte_1, 0, this.byte_1.Length);
                stream_0.Read(this.byte_12, 0, this.byte_12.Length);
                stream_0.Read(this.byte_13, 0, this.byte_13.Length);
                stream_0.Read(this.byte_8, 0, this.byte_8.Length);
                stream_0.Read(this.byte_10, 0, this.byte_10.Length);
                stream_0.Read(this.byte_5, 0, this.byte_5.Length);
                stream_0.Seek(-16L, SeekOrigin.Current);
                stream_0.Write(new byte[16], 0, 16);
                byte[] buffer2 = new byte[stream_0.Length];
                stream_0.Seek(0L, SeekOrigin.Begin);
                stream_0.Read(buffer2, 0, buffer2.Length);
                MD5 md5 = MD5.Create();

                byte[] hash = md5.ComputeHash(buffer2, this.bool_1 ? 0 : 64, 1536);
                md5.Clear();
                this.bool_0 = GClass27.smethod_1(hash, this.byte_5);
            }
Esempio n. 4
0
        private static bool smethod_10(GClass30 gclass30_0, GClass101 gclass101_0, byte[] byte_1)
        {
            string str = Path.Combine(gclass30_0.OutputPath, gclass101_0.ContentId.ToString("x8") + ".app");

            byte[] numArray = Class85.smethod_9(gclass101_0.Index);
            byte[] byte_0;
            if (gclass30_0.System != SystemType.SystemWiiU && gclass30_0.System != SystemType.SystemWii)
            {
                if (gclass30_0.System != SystemType.System3DS)
                {
                    throw new NotImplementedException();
                }
                byte_0 = Class85.smethod_3(str, byte_1, numArray);
            }
            else
            {
                byte[] array = File.ReadAllBytes(str);
                Array.Resize <byte>(ref array, GClass27.smethod_0(array.Length, 16));
                byte_0 = SHA1.Create().ComputeHash(Class85.smethod_5(array, byte_1, numArray), 0, (int)gclass101_0.ContentSize.TotalBytes);
            }
            return(GClass27.smethod_1(byte_0, gclass101_0.Hash));
        }
Esempio n. 5
0
        public byte[] method_4(string string_0, int int_1)
        {
            string string_1 = GClass88.smethod_8(string_0);

            if (GClass88.smethod_1(string_1))
            {
                if ((DateTime.Now - GClass88.smethod_6(string_1)).TotalHours <= (double)int_1)
                {
                    return(GClass88.smethod_4(string_1));
                }
                byte[] byte_1 = new WebClient().UploadValues(string.Format("{0}/requestZipHash.php", (object)Class67.String_0), new NameValueCollection()
                {
                    {
                        "url",
                        Convert.ToBase64String(Encoding.UTF8.GetBytes(string_0))
                    }
                });
                using (MD5 md5 = MD5.Create())
                {
                    byte[] buffer = GClass88.smethod_4(string_1);
                    if (GClass27.smethod_1(md5.ComputeHash(buffer), byte_1))
                    {
                        return(buffer);
                    }
                }
            }
            using (MemoryStream memoryStream = new MemoryStream(this.method_2(string.Format("{0}/zipProxy.php?url=", (object)Class67.String_0) + Convert.ToBase64String(Encoding.UTF8.GetBytes(string_0)))))
            {
                using (ZipArchive zipArchive = new ZipArchive((Stream)memoryStream))
                {
                    ZipArchiveEntry entry    = zipArchive.GetEntry("content");
                    byte[]          numArray = new byte[entry.Length];
                    using (Stream stream = entry.Open())
                        stream.Read(numArray, 0, numArray.Length);
                    GClass88.smethod_9(new Uri(string_0), numArray);
                    return(numArray);
                }
            }
        }
Esempio n. 6
0
        private static void smethod_7(System.IO.DriveInfo driveInfo_0)
        {
            string    path      = Alphaleonis.Win32.Filesystem.Path.Combine(driveInfo_0.Name, "apps", "nintendont", "boot.dol");
            WebClient webClient = new WebClient();

            webClient.Headers.Add("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; .NET CLR 1.0.3705;)");
            try
            {
                bool flag;
                if (!Alphaleonis.Win32.Filesystem.File.Exists(path))
                {
                    flag = true;
                }
                else
                {
                    byte[] byte_0   = (byte[])null;
                    byte[] numArray = Alphaleonis.Win32.Filesystem.File.ReadAllBytes(path);
                    byte[] bytes    = Encoding.ASCII.GetBytes("blob " + numArray.Length.ToString() + "\0");
                    byte[] buffer   = new byte[numArray.Length + bytes.Length];
                    Buffer.BlockCopy((Array)bytes, 0, (Array)buffer, 0, bytes.Length);
                    Buffer.BlockCopy((Array)numArray, 0, (Array)buffer, bytes.Length, numArray.Length);
                    using (SHA1 shA1 = SHA1.Create())
                        byte_0 = shA1.ComputeHash(buffer);
                    byte[] byte_1 = ((IEnumerable <GClass21>)JsonConvert.DeserializeObject <GClass21[]>(webClient.DownloadString("https://api.github.com/repos/FIX94/Nintendont/contents//loader"))).First <GClass21>((Func <GClass21, bool>)(gclass21_0 => gclass21_0.name == "loader.dol")).sha.smethod_6();
                    flag = !GClass27.smethod_1(byte_0, byte_1);
                }
                if (!flag || RadMessageBox.Show("USB Helper was unable to detect Nintendont, or a new version is available. It is required to be able to play GC games. Would you like USB Helper to install it for you?", "Nintendont", MessageBoxButtons.YesNo) != DialogResult.Yes)
                {
                    return;
                }
                GClass94.smethod_9(driveInfo_0);
            }
            catch
            {
            }
        }
Esempio n. 7
0
        public static GStruct7 smethod_4(GClass30 gclass30_0, GClass101 gclass101_0, byte[] byte_1)
        {
            // ISSUE: object of a compiler-generated type is created
            // ISSUE: variable of a compiler-generated type
            Class85.Class87 class87 = new Class85.Class87();
            // ISSUE: reference to a compiler-generated field
            class87.byte_1 = byte_1;
            // ISSUE: reference to a compiler-generated field
            class87.gclass101_0 = gclass101_0;
            List <int> list_1 = new List <int>();
            // ISSUE: reference to a compiler-generated field
            string path1 = Path.Combine(gclass30_0.OutputPath, class87.gclass101_0.ContentId.ToString("x8") + ".app");
            // ISSUE: reference to a compiler-generated field
            string path2 = Path.Combine(gclass30_0.OutputPath, class87.gclass101_0.ContentId.ToString("x8") + ".h3");

            // ISSUE: reference to a compiler-generated field
            if (!class87.gclass101_0.Boolean_0)
            {
                // ISSUE: reference to a compiler-generated field
                // ISSUE: reference to a compiler-generated field
                if (!Class85.smethod_10(gclass30_0, class87.gclass101_0, class87.byte_1))
                {
                    // ISSUE: reference to a compiler-generated field
                    return(new GStruct7(class87.gclass101_0, new List <int>(), false, true));
                }
                // ISSUE: reference to a compiler-generated field
                return(new GStruct7(class87.gclass101_0, new List <int>(), false, false));
            }
            if (!File.Exists(path2))
            {
                // ISSUE: reference to a compiler-generated field
                return(new GStruct7(class87.gclass101_0, list_1, true, true));
            }
            // ISSUE: reference to a compiler-generated field
            class87.byte_0 = File.ReadAllBytes(path2);
            // ISSUE: reference to a compiler-generated field
            // ISSUE: reference to a compiler-generated field
            if (!GClass27.smethod_1(SHA1.Create().ComputeHash(class87.byte_0), class87.gclass101_0.Hash))
            {
                // ISSUE: reference to a compiler-generated field
                return(new GStruct7(class87.gclass101_0, list_1, true, true));
            }
            using (FileStream fileStream = File.OpenRead(path1))
            {
                // ISSUE: object of a compiler-generated type is created
                // ISSUE: variable of a compiler-generated type
                Class85.Class88 class88 = new Class85.Class88();
                // ISSUE: reference to a compiler-generated field
                class88.class87_0 = class87;
                // ISSUE: reference to a compiler-generated field
                // ISSUE: reference to a compiler-generated field
                int int_5 = (int)(class88.class87_0.gclass101_0.Size.TotalBytes / 65536UL);
                int num1  = (int)Math.Ceiling((double)int_5 / 768.0);
                int num2  = 0;
                // ISSUE: reference to a compiler-generated field
                class88.bool_0 = Enumerable.Repeat <bool>(false, 3).ToArray <bool>();
                // ISSUE: reference to a compiler-generated field
                class88.list_0 = Enumerable.Repeat <List <int> >(new List <int>(), 3).ToArray <List <int> >();
                Thread[] threadArray = new Thread[3];
                for (int index = 0; index < 3; ++index)
                {
                    if (Class85.byte_0[index] == null)
                    {
                        Class85.byte_0[index] = new byte[16777216];
                    }
                }
                for (int index1 = 0; index1 < num1; ++index1)
                {
                    // ISSUE: object of a compiler-generated type is created
                    // ISSUE: variable of a compiler-generated type
                    Class85.Class89 class89 = new Class85.Class89();
                    // ISSUE: reference to a compiler-generated field
                    class89.class88_0 = class88;
                    // ISSUE: reference to a compiler-generated field
                    class89.tuple_0 = Class85.smethod_11(int_5, 3, 256);
                    // ISSUE: reference to a compiler-generated field
                    int_5 -= class89.tuple_0.Item2;
                    for (int index2 = 0; index2 < 3; ++index2)
                    {
                        // ISSUE: object of a compiler-generated type is created
                        // ISSUE: variable of a compiler-generated type
                        Class85.Class90 class90 = new Class85.Class90();
                        // ISSUE: reference to a compiler-generated field
                        class90.class89_0 = class89;
                        // ISSUE: reference to a compiler-generated field
                        class90.int_0 = index2;
                        // ISSUE: reference to a compiler-generated field
                        class90.int_1 = num2;
                        // ISSUE: reference to a compiler-generated field
                        // ISSUE: reference to a compiler-generated field
                        // ISSUE: reference to a compiler-generated field
                        class90.class89_0.class88_0.bool_0[index2] = false;
                        // ISSUE: reference to a compiler-generated field
                        // ISSUE: reference to a compiler-generated field
                        // ISSUE: reference to a compiler-generated field
                        class90.class89_0.class88_0.list_0[index2] = new List <int>();
                        // ISSUE: reference to a compiler-generated field
                        // ISSUE: reference to a compiler-generated field
                        fileStream.Read(Class85.byte_0[index2], 0, class90.class89_0.tuple_0.Item1[index2] * 65536);
                        if (Class85.byte_0[index2].Length != 0)
                        {
                            // ISSUE: reference to a compiler-generated method
                            threadArray[index2] = new Thread(new ThreadStart(class90.method_0))
                            {
                                IsBackground = true
                            };
                            threadArray[index2].Start();
                        }
                        else
                        {
                            // ISSUE: reference to a compiler-generated field
                            // ISSUE: reference to a compiler-generated field
                            // ISSUE: reference to a compiler-generated field
                            class90.class89_0.class88_0.bool_0[index2] = true;
                            // ISSUE: reference to a compiler-generated field
                            // ISSUE: reference to a compiler-generated field
                            // ISSUE: reference to a compiler-generated field
                            class90.class89_0.class88_0.list_0[index2] = new List <int>();
                        }
                        // ISSUE: reference to a compiler-generated field
                        // ISSUE: reference to a compiler-generated field
                        num2 += class90.class89_0.tuple_0.Item1[index2];
                    }
                    // ISSUE: reference to a compiler-generated field
                    // ISSUE: reference to a compiler-generated field
                    while (!Class85.smethod_7(class89.class88_0.bool_0))
                    {
                        Thread.Sleep(10);
                    }
                    // ISSUE: reference to a compiler-generated field
                    // ISSUE: reference to a compiler-generated field
                    foreach (List <int> intList in class89.class88_0.list_0)
                    {
                        list_1.AddRange((IEnumerable <int>)intList);
                    }
                }
            }
            // ISSUE: reference to a compiler-generated field
            return(new GStruct7(class87.gclass101_0, list_1, false, false));
        }