private void decompressFileToolStripMenuItem_Click(object sender, EventArgs e) { OpenFileDialog fd = new OpenFileDialog() { Filter = "All Files|*.*" }; if (fd.ShowDialog() != DialogResult.OK) { return; } File.WriteAllBytes(fd.FileName + ".dec", BinPackget.Decompress(new MemoryStream(File.ReadAllBytes(fd.FileName)))); }
private void openToolStripMenuItem1_Click(object sender, EventArgs e) { OpenFileDialog fd = new OpenFileDialog() { Filter = "All Escude Packgets|*.bin" }; if (fd.ShowDialog() != DialogResult.OK) { return; } string OutDir = fd.FileName + "~\\"; if (!Directory.Exists(OutDir)) { Directory.CreateDirectory(OutDir); } var Entries = BinPackget.Open(fd.FileName); foreach (Entry Entry in Entries) { string OutPath = OutDir + Entry.FileName; if (!Directory.Exists(Path.GetDirectoryName(OutPath))) { Directory.CreateDirectory(Path.GetDirectoryName(OutPath)); } if (File.Exists(OutPath)) { File.Delete(OutPath); } File.WriteAllBytes(OutPath, BinPackget.Decompress(Entry.Content)); } File.WriteAllLines(OutDir + "FileList.lst", (from x in Entries select x.FileName).ToArray()); MessageBox.Show("Files Extracted"); }