示例#1
0
 private void Form1_Load(object sender, EventArgs e)
 {
     byte[] pEncrypted = File.ReadAllBytes(@"LocalData\UserClass\CLIENT_DATA.json");
     p1 = HpCrypt.DecryptString(pEncrypted, p1).Replace("{\"password\":\"", "").Replace("\"}", "");
     if (Environment.GetCommandLineArgs().Contains("-diff"))
     {
         string[] old  = File.ReadAllLines(Environment.GetCommandLineArgs()[2]);
         string[] new1 = File.ReadAllLines(Environment.GetCommandLineArgs()[3]);
         foreach (string s in new1)
         {
             bool   exists = false;
             string temp   = s.Split('/').Last();
             foreach (string s2 in old)
             {
                 string temp2 = s2.Split('/').Last();
                 if (temp2 == temp)
                 {
                     exists = true;
                 }
             }
             if (!exists)
             {
                 File.AppendAllText("diff.txt", s + "\r\n");
             }
         }
         Environment.Exit(0);
     }
     if (Environment.GetCommandLineArgs().Contains("-diffmydesk"))
     {
         string[] old  = File.ReadAllLines(Environment.GetCommandLineArgs()[2]);
         string[] new1 = File.ReadAllLines(Environment.GetCommandLineArgs()[3]);
         foreach (string s in new1)
         {
             bool   exists = false;
             string temp   = s.Split('/').Last();
             foreach (string s2 in old)
             {
                 string temp2 = s2.Split('/').Last();
                 if (temp2 == temp)
                 {
                     exists = true;
                 }
             }
             if (!exists && s.Contains("mydesk"))
             {
                 File.AppendAllText("diffmydesk.txt", s + "\r\n");
             }
         }
         Environment.Exit(0);
     }
     //CSTtoCSV(Directory.GetCurrentDirectory());
     CSTtoAssetURLs(Directory.GetCurrentDirectory());
     //CSTtoMasterURLs(Directory.GetCurrentDirectory());
     Environment.Exit(0);
 }
示例#2
0
        private HpClientAssetInfo[] CSTtoClientAssetInfoArray(string file)
        {
            byte[] CstIn        = File.ReadAllBytes(file);
            byte[] CstDecrypted = HpCrypt.DecryptBytes(CstIn, p1);
            Dictionary <long, byte[]> dictionary = HpMasterCluster.Decode_ToMasterBins(CstDecrypted, false);
            List <HpClientAssetInfo>  list       = new List <HpClientAssetInfo>();

            foreach (KeyValuePair <long, byte[]> current in dictionary)
            {
                list.Add(HpMasterBin.Decode <HpClientAssetInfo>(current.Value, false));
            }
            return(list.ToArray());
        }