Ejemplo n.º 1
0
        private void openYetibigToolStripMenuItem_Click(object sender, EventArgs e)
        {
            OpenFileDialog d = new OpenFileDialog();

            d.Filter = "yeti.big|yeti.big";
            if (d.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                yeti = new YETIFile(d.FileName, progressBar1);
                RefreshTree();
            }
        }
Ejemplo n.º 2
0
        private void tv1_AfterSelect(object sender, TreeViewEventArgs e)
        {
            TreeNode t = tv1.SelectedNode;

            if (t == null)
            {
                return;
            }
            string fname = t.Text;
            string path  = "";

            while (t.Parent != null && t.Parent.Text != "/")
            {
                t    = t.Parent;
                path = "/" + t.Text + path;
            }
            foreach (YETIFile.YETIFileEntry file in yeti.files)
            {
                if (file.name == fname && file.path == path)
                {
                    if (file.offset == 0xFFFFFFFF)
                    {
                        return;
                    }
                    uint       address = yeti.dataOffset + file.offset * 8;
                    FileStream fs      = new FileStream(yeti.myPath, FileMode.Open, FileAccess.Read);
                    fs.Seek(address, 0);
                    if (file.zip == 0)
                    {
                        uint   size = YETIFile.ReadU32(fs);
                        byte[] buff = new byte[size];
                        fs.Read(buff, 0, (int)size);
                        hb1.ByteProvider = new DynamicByteProvider(buff);
                    }
                    else
                    {
                        uint   csize  = YETIFile.ReadU32(fs);
                        uint   ucsize = YETIFile.ReadU32(fs);
                        byte[] buff   = new byte[csize];
                        fs.Read(buff, 0, (int)csize);
                        hb1.ByteProvider = new DynamicByteProvider(Decompress(buff));
                    }
                    fs.Close();
                }
            }
        }