Beispiel #1
0
        private void button3_Click(object sender, EventArgs e) //Dump GSCs
        {
            richTextBox1.Text = "";
            FolderBrowserDialog fb = new FolderBrowserDialog();

            if (fb.ShowDialog() == DialogResult.OK)
            {
                RawPool pool = new RawPool(xassetpool);

                pool.ReadPoolData();
                pool.ReadFree();
                pool.ReadRawfiles();

                for (int i = 0; i < pool.rawfiles.Count - 1; i++)
                {
                    string name = PS3.ReadCString(pool.rawfiles[i].name_ptr);
                    if (!String.IsNullOrEmpty(name))
                    {
                        byte[] buffer = PS3.GetMemory(pool.rawfiles[i].buffer_ptr, (int)pool.rawfiles[i].length);

                        if (name.Contains("/"))
                        {
                            name = name.Replace("/", @"\");
                            String[] lel       = name.Replace(@"\", "|").Split('|');
                            String   directory = fb.SelectedPath + @"\" + name.Replace(lel[lel.Length - 1], "");
                            if (!Directory.Exists(directory))
                            {
                                Directory.CreateDirectory(directory);
                            }
                        }
                        String path = name.Replace("//", @"\").Replace("/", @"\");
                        File.WriteAllBytes(fb.SelectedPath + @"\" + path, buffer);
                        richTextBox1.Text += "Dump " + name + "\n";
                        Goto(richTextBox1, richTextBox1.Lines.Count() - 1);
                    }
                }
            }
        }
 public void ReadPoolData()
 {
     PoolBuffer = PS3.GetMemory(XAssetPool, (PoolMax * RawfileSize) + 4);   //get the entire table.
 }