void SelectObject(CMExpLib.MetadataObject obj) { while ((history.Count - 1) > hx_id) { history.RemoveAt(hx_id + 1); } history.Add(obj); hx_id++; }
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; } }
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); } }
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)); } }
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); } }
private void button4_Click(object sender, EventArgs e) { CMExpLib.MetadataObject syms = Program.ehdr.GetSymbols(); SelectObject(syms); DisplayObject(syms); }
private void button3_Click(object sender, EventArgs e) { CMExpLib.MetadataObject root = Program.ehdr.GetRoot(); SelectObject(root); DisplayObject(root); }