Esempio n. 1
0
 void SelectObject(CMExpLib.MetadataObject obj)
 {
     while ((history.Count - 1) > hx_id)
     {
         history.RemoveAt(hx_id + 1);
     }
     history.Add(obj);
     hx_id++;
 }
Esempio n. 2
0
 private void load_root()
 {
     if (Program.ehdr != null)
     {
         CMExpLib.MetadataObject root = Program.ehdr.GetRoot();
         history.Clear();
         SelectObject(root);
         DisplayObject(root);
         fname_tb.Text = Program.ehdr.FileName;
     }
 }
Esempio n. 3
0
        static void Main(string[] args)
        {
            CMExpLib.Elf64Reader r = new CMExpLib.Elf64Reader();
            search_dirs.Add("../../../../../tysila2/bin/Release");
            search_dirs.Add("../../../../../mono/corlib");
            CMExpLib.Elf64Reader.ElfHeader ehdr = r.Read("../../../../../tysos/tysos.bin", new FileSystemFileLoader());



            foreach (CMExpLib.SymbolTable.Symbol s in ehdr.stab.AssemblySymbols.Values)
            {
                CMExpLib.MetadataObject mo = CMExpLib.MetadataObject.Read(s);
            }
        }
Esempio n. 4
0
        private void DisplayObject(CMExpLib.MetadataObject obj)
        {
            cur_obj = obj;

            label1.Text = obj.LayoutName + "@ 0x" + obj.Address.ToString("X16");
            listView1.Items.Clear();
            listBox1.Items.Clear();

            foreach (KeyValuePair <string, object> kvp in obj.Fields)
            {
                string val = kvp.Value.ToString();
                if (kvp.Value.GetType().IsArray)
                {
                    val = "->";
                }
                listView1.Items.Add(new MyListViewItem(new string[] { kvp.Key, val }, kvp.Value));
            }
        }
Esempio n. 5
0
 private void SelectItem(object o)
 {
     if (o.GetType() == typeof(ulong))
     {
         try
         {
             CMExpLib.MetadataObject mo = CMExpLib.MetadataObject.ReadVaddr((ulong)o, Program.ehdr);
             SelectObject(mo);
             DisplayObject(mo);
         }
         catch (Exception)
         { }
     }
     else if (o.GetType() == typeof(CMExpLib.MetadataObject.Reference))
     {
         CMExpLib.MetadataObject mo = CMExpLib.MetadataObject.ReadVaddr(((CMExpLib.MetadataObject.Reference)o).Address, Program.ehdr);
         SelectObject(mo);
         DisplayObject(mo);
     }
 }
Esempio n. 6
0
 private void button4_Click(object sender, EventArgs e)
 {
     CMExpLib.MetadataObject syms = Program.ehdr.GetSymbols();
     SelectObject(syms);
     DisplayObject(syms);
 }
Esempio n. 7
0
 private void button3_Click(object sender, EventArgs e)
 {
     CMExpLib.MetadataObject root = Program.ehdr.GetRoot();
     SelectObject(root);
     DisplayObject(root);
 }