예제 #1
0
        private void generateFromBasefolderToolStripMenuItem_Click(object sender, EventArgs e)
        {
            string basepath = KFreonLib.MEDirectories.ME3Directory.cookedPath;

            if (String.IsNullOrEmpty(basepath))
            {
                MessageBox.Show("This functionality requires ME3 to be installed. Set its path at:\n Options > Set Custom Path > Mass Effect 3");
                return;
            }
            KFreonLib.Debugging.DebugOutput.StartDebugger("Main ME3Explorer Form");
            string[] files = Directory.GetFiles(basepath, "*.pcc");
            OverView = new List <OverViewStruct>();
            for (int f = 0; f < files.Length; f++)
            {
                string file = files[f];
                KFreonLib.Debugging.DebugOutput.PrintLn((f + 1) + " / " + files.Length + " : " + file + " :", true);
                PCCPackage     p = new PCCPackage(file, false, false, true);
                OverViewStruct o = new OverViewStruct();
                o.filepath = file;
                o.Indexes  = new List <int>();
                int count = 0;
                for (int i = 0; i < p.Exports.Count; i++)
                {
                    if (p.GetObject(p.Exports[i].idxClass) == "InterpData")
                    {
                        o.Indexes.Add(i);
                        string s = "";
                        if (count++ == 0)
                        {
                            s = "\n";
                        }
                        KFreonLib.Debugging.DebugOutput.PrintLn(s + "found " + i + " : " + p.GetObjectPath(i + 1) + p.GetObject(i + 1), false);
                    }
                }
                if (o.Indexes.Count != 0)
                {
                    OverView.Add(o);
                }
                Application.DoEvents();
            }
            FreshOverView();
        }
예제 #2
0
        private void loadFromFileToolStripMenuItem_Click(object sender, EventArgs e)
        {
            OpenFileDialog d = new OpenFileDialog();

            d.Filter = "*.db|*.db";
            if (d.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                FileStream fs = new FileStream(d.FileName, FileMode.Open, FileAccess.Read);
                OverView = new List <OverViewStruct>();
                byte[] buff = new byte[4];
                fs.Read(buff, 0, 4);
                int count = BitConverter.ToInt32(buff, 0);
                for (int i = 0; i < count; i++)
                {
                    OverViewStruct o = new OverViewStruct();
                    fs.Read(buff, 0, 4);
                    int len = BitConverter.ToInt32(buff, 0);
                    o.filepath = "";
                    for (int j = 0; j < len; j++)
                    {
                        o.filepath += (char)fs.ReadByte();
                    }
                    fs.Read(buff, 0, 4);
                    int count2 = BitConverter.ToInt32(buff, 0);
                    o.Indexes = new List <int>();
                    for (int j = 0; j < count2; j++)
                    {
                        fs.Read(buff, 0, 4);
                        o.Indexes.Add(BitConverter.ToInt32(buff, 0));
                    }
                    OverView.Add(o);
                }
                fs.Close();
                FreshOverView();
                MessageBox.Show("Done.");
            }
        }
예제 #3
0
 private void loadFromFileToolStripMenuItem_Click(object sender, EventArgs e)
 {
     OpenFileDialog d = new OpenFileDialog();
     d.Filter = "*.db|*.db";
     if (d.ShowDialog() == System.Windows.Forms.DialogResult.OK)
     {
         FileStream fs = new FileStream(d.FileName, FileMode.Open, FileAccess.Read);
         OverView = new List<OverViewStruct>();
         byte[] buff = new byte[4];
         fs.Read(buff, 0, 4);
         int count = BitConverter.ToInt32(buff, 0);
         for (int i = 0; i < count; i++)
         {
             OverViewStruct o = new OverViewStruct();
             fs.Read(buff, 0, 4);
             int len = BitConverter.ToInt32(buff, 0);
             o.filepath = "";
             for (int j = 0; j < len; j++)
                 o.filepath += (char)fs.ReadByte();
             fs.Read(buff, 0, 4);
             int count2 = BitConverter.ToInt32(buff, 0);
             o.Indexes = new List<int>();
             for (int j = 0; j < count2; j++)
             {
                 fs.Read(buff, 0, 4);
                 o.Indexes.Add(BitConverter.ToInt32(buff, 0));
             }
             OverView.Add(o);
         }
         fs.Close();
         FreshOverView();
         MessageBox.Show("Done.");
     }
 }
예제 #4
0
 private void generateFromBasefolderToolStripMenuItem_Click(object sender, EventArgs e)
 {
     string basepath = KFreonLib.MEDirectories.ME3Directory.cookedPath;
     if (String.IsNullOrEmpty(basepath))
     {
         MessageBox.Show("This functionality requires ME3 to be installed. Set its path at:\n Options > Set Custom Path > Mass Effect 3");
         return;
     }
     KFreonLib.Debugging.DebugOutput.StartDebugger("Main ME3Explorer Form");
     string[] files = Directory.GetFiles(basepath, "*.pcc");
     OverView = new List<OverViewStruct>();
     for (int f = 0; f < files.Length; f++)
     {
         string file = files[f];
         KFreonLib.Debugging.DebugOutput.PrintLn((f + 1) + " / " + files.Length + " : " + file + " :", true);
         PCCPackage p = new PCCPackage(file, false, false, true);
         OverViewStruct o = new OverViewStruct();
         o.filepath = file;
         o.Indexes = new List<int>();
         int count = 0;
         for (int i = 0; i < p.Exports.Count; i++)
         {
             if (p.GetObject(p.Exports[i].idxClass) == "InterpData")
             {
                 o.Indexes.Add(i);
                 string s = "";
                 if (count++ == 0)
                     s = "\n";
                 KFreonLib.Debugging.DebugOutput.PrintLn(s + "found " + i + " : " + p.GetObjectPath(i + 1) + p.GetObject(i + 1), false);
             }
         }
         if (o.Indexes.Count != 0)
             OverView.Add(o);
         Application.DoEvents();
     }
     FreshOverView();
 }