GetObjectPath() public method

public GetObjectPath ( int uindex ) : string
uindex int
return string
 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;
     }
 }
Beispiel #2
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 + ")");
 }
Beispiel #3
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 = KFreonLib.MEDirectories.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"))
                    {
                        BitConverter.IsLittleEndian = true;
                        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");
        }
Beispiel #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();
 }
Beispiel #5
0
 private void button3_Click(object sender, EventArgs e)
 {
     OpenFileDialog d = new OpenFileDialog();
     d.Filter = "*.pcc|*.pcc";
     if (d.ShowDialog() == System.Windows.Forms.DialogResult.OK)
     {
         if (importpcc != null && importpcc.Source != null)
             importpcc.Source.Close();
         importpcc = new PCCPackage(d.FileName, true);
         listBox6.Items.Clear();
         listBox6.Visible = false;
         for (int i = 0; i < importpcc.Imports.Count; i++)
             listBox6.Items.Add(i.ToString("d6") + " : " + importpcc.GetObjectPath(-i - 1) + importpcc.GetObject(-i - 1));
         listBox6.Visible = true;
     }
 }