Ejemplo 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);
        }
Ejemplo n.º 2
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));
        }