Пример #1
0
 public void Init(PCCPackage pcc, int index)
 {
     comboBox1.Items.Clear();
     comboBox2.Items.Clear();
     for (int i = 0; i < pcc.Header.ExportCount; i++)
     {
         comboBox1.Items.Add(i.ToString("d6") + " : " + pcc.GetObjectPath(i + 1) + pcc.getObjectName(i + 1));
     }
     for (int i = 0; i < pcc.Header.ImportCount; i++)
     {
         comboBox2.Items.Add(i.ToString("d6") + " : " + pcc.GetObjectPath(-i - 1) + pcc.getObjectName(-i - 1));
     }
     comboBox1.SelectedIndex = comboBox2.SelectedIndex = 0;
     if (index == 0)
     {
         r1.Checked = true;
     }
     if (index > 0)
     {
         comboBox1.SelectedIndex = index - 1;
         r2.Checked = true;
     }
     if (index < 0)
     {
         comboBox2.SelectedIndex = -index - 1;
         r3.Checked = true;
     }
 }
Пример #2
0
 public void FreshList()
 {
     splitContainer1.BringToFront();
     listBox1.Items.Clear();
     foreach (int idx in Indexes)
     {
         listBox1.Items.Add(idx + " : " + pcc.GetObjectPath(idx + 1) + pcc.GetObject(idx + 1) + "(" + pcc.Exports[idx].Index + ")");
     }
 }
Пример #3
0
        private void listBox2_SelectedIndexChanged(object sender, EventArgs e)
        {
            int n = listBox2.SelectedIndex;

            if (n == -1)
            {
                return;
            }
            PCCPackage p = new PCCPackage(OverView[n].filepath, false, false, true);

            listBox3.Items.Clear();
            foreach (int i in OverView[n].Indexes)
            {
                listBox3.Items.Add(i + " : " + p.GetObjectPath(i + 1) + p.GetObject(i + 1) + "(" + p.Exports[i].Index + ")");
            }
        }
Пример #4
0
        //for debugging purposes. not exposed to user
        private void InterpTrackScan_Click(object sender, EventArgs e)
        {
            KFreonLib.Debugging.DebugOutput.StartDebugger("Main ME3Explorer Form");
            string basepath = ME3Directory.cookedPath;

            string[]      files  = Directory.GetFiles(basepath, "*.pcc");
            List <string> conds  = new List <string>();
            List <string> conds1 = new List <string>();

            //string property = Microsoft.VisualBasic.Interaction.InputBox("Please enter property name", "ME3 Explorer");
            string name;

            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, true, false, true);
                for (int i = 0; i < p.Exports.Count; i++)
                {
                    if (p.GetObjectClass(i).StartsWith("InterpTrackVisibility")) //GetObject(p.Exports[i].idxLink).StartsWith("InterpGroup"))
                    {
                        List <ME3LibWV.PropertyReader.Property> props = ME3LibWV.PropertyReader.getPropList(p, p.Exports[i].Data);
                        foreach (ME3LibWV.PropertyReader.Property prop in props)
                        {
                            //KFreonLib.Debugging.DebugOutput.PrintLn(p.GetName(prop.Name));
                            if (p.GetName(prop.Name) == "VisibilityTrack")
                            {
                                int pos   = 28;
                                int count = BitConverter.ToInt32(prop.raw, 24);
                                for (int j = 0; j < count; j++)
                                {
                                    List <ME3LibWV.PropertyReader.Property> p2 = ME3LibWV.PropertyReader.ReadProp(p, prop.raw, pos);
                                    for (int k = 0; k < p2.Count; k++)
                                    {
                                        name = p.GetName(p2[k].Name);
                                        if (name == "Action")
                                        {
                                            if (!conds.Contains(p.GetName(BitConverter.ToInt32(p2[k].raw, 32))))
                                            {
                                                conds.Add(p.GetName(BitConverter.ToInt32(p2[k].raw, 32)));
                                                KFreonLib.Debugging.DebugOutput.PrintLn("Action " + p.GetName(BitConverter.ToInt32(p2[k].raw, 24)) + ", " + p.GetName(BitConverter.ToInt32(p2[k].raw, 32)) + "               at: #" + i + " " + p.GetObjectPath(i + 1) + p.GetObjectClass(i + 1) + "        in: " + file.Substring(file.LastIndexOf(@"\") + 1), false);
                                            }
                                        }
                                        else if (name == "ActiveCondition")
                                        {
                                            if (!conds1.Contains(p.GetName(BitConverter.ToInt32(p2[k].raw, 32))))
                                            {
                                                conds1.Add(p.GetName(BitConverter.ToInt32(p2[k].raw, 32)));
                                                KFreonLib.Debugging.DebugOutput.PrintLn("ActiveCondition " + p.GetName(BitConverter.ToInt32(p2[k].raw, 24)) + ", " + p.GetName(BitConverter.ToInt32(p2[k].raw, 32)) + "               at: #" + i + " " + p.GetObjectPath(i + 1) + p.GetObjectClass(i + 1) + "        in: " + file.Substring(file.LastIndexOf(@"\") + 1), false);
                                            }
                                        }
                                        pos += p2[k].raw.Length;
                                    }
                                }
                            }
                            //if (p.GetName(prop.Name) == property)
                            //{
                            //    if(!conds.Contains(p.GetName(BitConverter.ToInt32(prop.raw, 32))))
                            //    {
                            //        conds.Add(p.GetName(BitConverter.ToInt32(prop.raw, 32)));
                            //        KFreonLib.Debugging.DebugOutput.PrintLn(p.GetName(BitConverter.ToInt32(prop.raw, 24)) + ", " + p.GetName(BitConverter.ToInt32(prop.raw, 32)) + "               at: #" + i + " " + p.GetObjectPath(i + 1) + p.GetObjectClass(i + 1) + "        in: " + file.Substring(file.LastIndexOf(@"\") + 1), false);
                            //    }
                            //}
                        }
                        //KFreonLib.Debugging.DebugOutput.PrintLn(i + " : " + p.GetObjectClass(i + 1) + "               at: " + p.GetObjectPath(i + 1) + "        in: " + file.Substring(file.LastIndexOf(@"\") + 1), false);
                    }
                }
                Application.DoEvents();
            }
            KFreonLib.Debugging.DebugOutput.PrintLn();
            KFreonLib.Debugging.DebugOutput.PrintLn("*****************");
            KFreonLib.Debugging.DebugOutput.PrintLn("Done");
        }
Пример #5
0
        public TreeNode MakeSubObj(TreeNode t, int index)
        {
            byte[] buff = pcc.GetObjectData(index);
            List <PropertyReader.Property> Pr = PropertyReader.getPropList(pcc, buff);
            int      count, pos, count2, pos2;
            TreeNode t2, t3, t4;
            List <PropertyReader.Property> Pr2, Pr3;

            foreach (PropertyReader.Property p in Pr)
            {
                string s = pcc.GetName(p.Name);
                switch (s)
                {
                    #region InputLinks
                case "InputLinks":
                    t2    = new TreeNode("Input Links");
                    count = BitConverter.ToInt32(p.raw, 24);
                    pos   = 28;
                    for (int i = 0; i < count; i++)
                    {
                        t3  = new TreeNode(i.ToString());
                        Pr2 = PropertyReader.ReadProp(pcc, p.raw, pos);
                        foreach (PropertyReader.Property pp in Pr2)
                        {
                            string s2 = pcc.GetName(pp.Name);
                            switch (s2)
                            {
                            case "LinkDesc":
                                t3.Nodes.Add("Link Description : " + pp.Value.StringValue);
                                break;

                            case "LinkAction":
                                t3.Nodes.Add("Link Action : " + pcc.GetName(pp.Value.IntValue));
                                break;

                            case "LinkedOp":
                                t3.Nodes.Add("Linked Operation : #" + pp.Value.IntValue + " " + pcc.GetObjectPath(pp.Value.IntValue) + pcc.GetObject(pp.Value.IntValue));
                                break;
                            }
                        }
                        t2.Nodes.Add(t3);
                        pos = Pr2[Pr2.Count - 1].offend;
                    }
                    t.Nodes.Add(t2);
                    break;

                    #endregion
                    #region Output Links
                case "OutputLinks":
                    t2    = new TreeNode("Output Links");
                    count = BitConverter.ToInt32(p.raw, 24);
                    pos   = 28;
                    for (int i = 0; i < count; i++)
                    {
                        t3  = new TreeNode(i.ToString());
                        Pr2 = PropertyReader.ReadProp(pcc, p.raw, pos);
                        foreach (PropertyReader.Property pp in Pr2)
                        {
                            string s2 = pcc.GetName(pp.Name);
                            switch (s2)
                            {
                            case "LinkDesc":
                                t3.Nodes.Add("Link Description : " + pp.Value.StringValue);
                                break;

                            case "LinkAction":
                                t3.Nodes.Add("Link Action : " + pcc.GetName(pp.Value.IntValue));
                                break;

                            case "LinkedOp":
                                t3.Nodes.Add("Linked Operation : #" + pp.Value.IntValue + " " + pcc.GetObjectPath(pp.Value.IntValue) + pcc.GetObject(pp.Value.IntValue));
                                break;

                            case "Links":
                                t4     = new TreeNode("Links");
                                count2 = BitConverter.ToInt32(pp.raw, 24);
                                pos2   = 28;
                                for (int i2 = 0; i2 < count2; i2++)
                                {
                                    Pr3 = PropertyReader.ReadProp(pcc, pp.raw, pos2);
                                    string res = "#" + i2.ToString() + " : ";
                                    foreach (PropertyReader.Property ppp in Pr3)
                                    {
                                        string s3 = pcc.GetName(ppp.Name);
                                        switch (s3)
                                        {
                                        case "LinkedOp":
                                            res += "Linked Operation (" + ppp.Value.IntValue + " " + pcc.GetObjectPath(ppp.Value.IntValue) + pcc.GetObject(ppp.Value.IntValue) + ") ";
                                            break;

                                        case "InputLinkIdx":
                                            res += "Input Link Index(" + ppp.Value.IntValue + ")";
                                            break;
                                        }
                                    }
                                    t4.Nodes.Add(res);
                                    pos2 = Pr3[Pr3.Count - 1].offend;
                                }
                                t3.Nodes.Add(t4);
                                break;
                            }
                        }
                        t2.Nodes.Add(t3);
                        pos = Pr2[Pr2.Count - 1].offend;
                    }
                    t.Nodes.Add(t2);
                    break;

                    #endregion
                    #region Variable Links
                case "VariableLinks":
                    t2    = new TreeNode("Variable Links");
                    count = BitConverter.ToInt32(p.raw, 24);
                    pos   = 28;
                    for (int i = 0; i < count; i++)
                    {
                        t3  = new TreeNode(i.ToString());
                        Pr2 = PropertyReader.ReadProp(pcc, p.raw, pos);
                        foreach (PropertyReader.Property pp in Pr2)
                        {
                            string s2 = pcc.GetName(pp.Name);
                            switch (s2)
                            {
                            case "LinkDesc":
                                t3.Nodes.Add("Link Description : " + pp.Value.StringValue);
                                break;

                            case "LinkVar":
                                t3.Nodes.Add("Link Variable : " + pcc.GetName(pp.Value.IntValue));
                                break;

                            case "PropertyName":
                                t3.Nodes.Add("Property Name : " + pcc.GetName(pp.Value.IntValue));
                                break;

                            case "ExpectedType":
                                t3.Nodes.Add("Expected Type : #" + pp.Value.IntValue + " " + pcc.GetObjectPath(pp.Value.IntValue) + pcc.GetObject(pp.Value.IntValue));
                                break;

                            case "LinkedVariables":
                                t4     = new TreeNode("Linked Variables");
                                count2 = BitConverter.ToInt32(pp.raw, 24);
                                for (int i2 = 0; i2 < count2; i2++)
                                {
                                    int idx = BitConverter.ToInt32(pp.raw, 28 + i2 * 4);
                                    t4.Nodes.Add("#" + i2.ToString() + " : #" + idx + " " + pcc.GetObjectPath(idx) + pcc.GetObject(idx));
                                }
                                t3.Nodes.Add(t4);
                                break;
                            }
                        }
                        t2.Nodes.Add(t3);
                        pos = Pr2[Pr2.Count - 1].offend;
                    }
                    t.Nodes.Add(t2);
                    break;
                    #endregion
                }
            }
            return(t);
        }
Пример #6
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();
        }