private void openGeneratedFileButton_Click(object sender, EventArgs e) { var splashScreen = new SplashScreen(); splashScreen.Show(); splashScreen.Update(); if (openGeneratedFileDialog.ShowDialog() == DialogResult.OK) { var filename = openGeneratedFileDialog.FileName; if (_generatedFile == null) { _generatedFile = new GeneratedFile(true); } _generatedFile.OpenFile(filename); if (_generatedFile.IsGenerated) { showStructureButton.Enabled = true; hashAnaliseButton.Enabled = true; searchAnaliseButton.Enabled = false; KeySearchButton.Enabled = true; openDopArrayButton.Enabled = true; generateDopArrayButton.Enabled = true; } } splashScreen.Close(); }
// ============= Хеширование ================ private void generateFileButton_Click(object sender, EventArgs e) { var splashScreen = new SplashScreen(); splashScreen.Show(); splashScreen.Update(); _generatedFile = new GeneratedFile(); if (_generatedFile.IsGenerated) { showStructureButton.Enabled = true; hashAnaliseButton.Enabled = true; searchAnaliseButton.Enabled = false; KeySearchButton.Enabled = true; openDopArrayButton.Enabled = true; generateDopArrayButton.Enabled = true; } splashScreen.Close(); //for (int i = 0; i < Data.generatedArray.Length; i++) //{ // Console.WriteLine("{0} - {1}", Data.generatedArray[i].key, Hasher.NewNotation(Data.generatedArray[i].key)); //} }
private void generateDopArrayButton_Click(object sender, EventArgs e) { var splashScreen = new SplashScreen(); splashScreen.Show(); splashScreen.Update(); _dopFile = new DopFile(); if (_dopFile.IsGenerated) { showDopArrayButton.Enabled = true; searchAnaliseButton.Enabled = true; KeySearchButton.Enabled = true; } splashScreen.Close(); }
private void hashAnaliseButton_Click(object sender, EventArgs e) { var splashScreen = new SplashScreen(); splashScreen.Show(); splashScreen.Update(); HashWorker hashWorker; _g1 = new Graphic(tempBitmapHash1, graphHash1, hash1box); _g2 = new Graphic(tempBitmapHash2, graphHash2, hash2box); for (var i = 0; i < Data.PacketCountArray.Length; i++) { hashWorker = new HashWorker(Data.PacketCountArray[i] , Data.FullItemCount / Data.PacketCountArray[i] + (Data.FullItemCount % Data.PacketCountArray[i] > 0 ? 1 : 0) , Data.GeneratedArray , Data.KoefArray[i]); hashWorker.RepresentMiddle(); hashWorker.SaveMiddle(); //Console.WriteLine("{0} => {1}", Data.packetCountArray[i], hashWorker.GetStat()); _g1.DrawNewStat(i, hashWorker.GetStatMid()); hash1box.Update(); Refresh(); } for (var i = 0; i < Data.PacketCountArray.Length; i++) { hashWorker = new HashWorker(Data.PacketCountArray[i] , Data.FullItemCount / Data.PacketCountArray[i] + (Data.FullItemCount % Data.PacketCountArray[i] > 0 ? 1 : 0) , Data.GeneratedArray , Data.KoefArray[i]); hashWorker.RepresentNotation(); hashWorker.SaveNotation(); //Console.WriteLine("{0} => {1}", Data.packetCountArray[i], hashWorker.GetStat()); _g2.DrawNewStat(i, hashWorker.GetStatNot()); hash2box.Update(); Refresh(); } MessageBox.Show(@"Анализ хеширования успешно завершен", @"Успех", MessageBoxButtons.OK, MessageBoxIcon.Information); splashScreen.Close(); }