Ejemplo n.º 1
0
        private void btn_Decloak_Click(object sender, EventArgs e)
        {
            if (File.Exists(txt_Input.Text))
            {
                stealth = new StealthArchive(txt_Input.Text);

                try
                {
                    foreach (Ionic.Zip.ZipEntry entry in stealth.GetCloakedEntries(StealthArchive.ArchiveType.Zip))
                    {
                        ListViewItem item = new ListViewItem();
                        item.Name = entry.FileName;
                        item.Text = item.Name;

                        if (entry.UsesEncryption)
                        {
                            item.Text += "*";
                            isEncrypted = true;
                        }

                        item.SubItems.Add((MainForm.formatFileSize(entry.UncompressedSize, Settings.Default.UNITS)));
                        item.SubItems.Add((entry.CompressionRatio * .01).ToString("0%"));
                        item.SubItems.Add(entry.Encryption.ToString());

                        lst_Files.Items.Add(item);
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show(String.Format("Error de-cloaking file: {0}", ex.Message), "De-Cloak",
                        MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    return;
                }

                if (lst_Files.Items.Count > 0)
                {
                    canExtract(true);
                    lbl_Status.Text = "Select files to extract...";
                }
                else
                {
                    MessageBox.Show("This file contains no cloaked data.","De-CLoak", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    txt_Input.Clear();
                    statusCheck();
                    return;
                }
            }
        }