private void repackToolStripMenuItem_Click(object sender, EventArgs e) { #if DEBUG ld = @"C:\Users\Marcus\Documents\My Games\花嫁と魔王 ~王室のハーレムは下克上~\script.bin~"; #endif FolderBrowserDialog fbd = new FolderBrowserDialog() { SelectedPath = ld }; if (fbd.ShowDialog() != DialogResult.OK) { return; } ld = fbd.SelectedPath; SaveFileDialog sfd = new SaveFileDialog() { Filter = "All Escude Packgets|*.bin" }; if (sfd.ShowDialog() != DialogResult.OK) { return; } if (!ld.EndsWith("\\")) { ld += '\\'; } if (!File.Exists(ld + "FileList.lst")) { MessageBox.Show("You need the FileList.lst to repack"); return; } List <Entry> Entries = new List <Entry>(); foreach (string File in File.ReadLines(ld + "FileList.lst")) { if (File.ToLower() == "filelist.lst") { continue; } Stream Content = new StreamReader(ld + File).BaseStream; Entries.Add(new Entry() { FileName = File, Content = Content }); } BinPackget.Save(Entries.ToArray(), sfd.FileName); MessageBox.Show("Packget Saved"); }
private void fakeCompressFileToolStripMenuItem_Click(object sender, EventArgs e) { OpenFileDialog fd = new OpenFileDialog() { Filter = "All Files|*.*" }; if (fd.ShowDialog() != DialogResult.OK) { return; } File.WriteAllBytes(fd.FileName + ".comp", BinPackget.FakeCompress(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"); }