private void compressBtn_Click(object sender, EventArgs e) { if (openZIPDialog.ShowDialog() == DialogResult.OK) { YAZ0 y = new YAZ0(); NARC SzsArch = new NARC(); SFSDirectory dir = new SFSDirectory("", true); using (ZipFile z = ZipFile.Read(openZIPDialog.FileName)) { for (int i = 0; i < z.Entries.Count; i++) { ZipEntry ze = z.Entries.ToArray()[i]; SFSFile file = new SFSFile(i, ze.FileName, dir); MemoryStream data = new MemoryStream(); ze.Extract(data); file.Data = data.ToArray(); data.Dispose(); dir.Files.Add(file); } foreach (ZipEntry ze in z) { Console.WriteLine(ze); } } SzsArch.FromFileSystem(dir); if (saveSZSDialog.ShowDialog() == DialogResult.OK) { File.WriteAllBytes(saveSZSDialog.FileName, y.Compress(SzsArch.Write())); MessageBox.Show("Done!"); } } }
public void Save() { NARC.FromFileSystem(Fs); var dec_data = NARC.Write(); var data = NSMBeROM.LZ77_Compress(dec_data); ROMUtils.ROM.WriteFile(Name, data); }