private void CheckArchive(FileSystem.TOCEntry toc) { listBox3.Items.Clear(); if (hb1.ByteProvider.Length > 2 && (char)hb1.ByteProvider.ReadByte(0) == 'P' && (char)hb1.ByteProvider.ReadByte(1) == 'K') { File.WriteAllBytes(myPath + "temp.zip", FileSystem.getDataByTOC(toc)); ar = new Archive(myPath + "temp.zip"); listBox3.Items.AddRange(ar.getFiles()); } }
private void listBox2_SelectedIndexChanged(object sender, EventArgs e) { int n = listBox2.SelectedIndex; if (n == -1) { return; } string path = currentPath + listBox2.Items[n].ToString(); FileSystem.TOCEntry toc = FileSystem.findTOCbyPath(path); hb1.ByteProvider = new Be.Windows.Forms.DynamicByteProvider(FileSystem.getDataByTOC(toc)); rtb2.Text = ""; rtb2.AppendText("Path = " + path + "\n"); rtb2.AppendText("Size = 0x" + toc.Size.ToString("X") + " bytes\n"); rtb2.AppendText("Offset = 0x" + toc.RealOffset.ToString("X") + "\n"); rtb2.AppendText("Container = " + toc.Container + "\n"); CheckArchive(toc); }