示例#1
0
        private void button1_Click(object sender, EventArgs e)
        {
            Object o = listBox1.SelectedItem;

            if (o == null)
            {
                return;
            }

            OAFEntry ent = (OAFEntry)o;

            exportEntry = ent;

            saveFileDialog1.FileName = Path.GetFileName(ent.name);
            saveFileDialog1.ShowDialog();
        }
示例#2
0
        private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
            Object o = listBox1.SelectedItem;

            if (o == null)
            {
                return;
            }

            OAFEntry ent = (OAFEntry)o;


            checkBox1.Checked = ent.compressed;
            textBox2.Text     = ent.uncompressedSize.ToString();
            textBox3.Text     = (ent.compressed)?ent.compressedSize.ToString():"N/A";
            textBox4.Text     = ent.dataOffset.ToString();
        }
示例#3
0
        private void saveFileDialog1_FileOk(object sender, CancelEventArgs e)
        {
            OAFEntry ent = exportEntry;

            oaf.br.BaseStream.Seek(ent.dataOffset, SeekOrigin.Begin);

            int size = (ent.compressed) ? ent.compressedSize : ent.uncompressedSize;

            byte[] payload = oaf.br.ReadBytes(size);

            FileStream fs = new FileStream(saveFileDialog1.FileName, FileMode.Create);

            fs.Write(payload, 0, payload.Length);

            fs.Close();

            Console.WriteLine("The contained file " + ent.name + " has been written to " + saveFileDialog1.FileName + ".");
        }