internal NETTableReconstructor(TablesHeap tablesHeap) { this.tablesHeap = tablesHeap; this.netHeader = tablesHeap.netheader; stream = new MemoryStream(); writer = new BinaryWriter(stream); stream.Seek(0, SeekOrigin.Begin); }
private void AppendMetaDataRow(TablesHeap tablesHeap, MetaDataRow row) { foreach (var part in row.Parts) { if (Marshal.SizeOf(part) == sizeof(uint)) tablesHeap._binWriter.Write((uint)part); else if (Marshal.SizeOf(part) == sizeof(ushort)) tablesHeap._binWriter.Write((ushort)part); else if (Marshal.SizeOf(part) == sizeof(byte)) tablesHeap._binWriter.Write((byte)part); else throw new ArgumentException("Invalid MetaData Row"); } }
internal NETTableReader(TablesHeap tablesheap) { reader = new BinaryReader(new MemoryStream(tablesheap.Contents)); tablesheap.header = ASMGlobals.ReadStructureFromReader<Structures.METADATA_TABLE_HEADER>(reader); this.tableheap = tablesheap; for (int i = 0; i < 45; i++) if (tableheap.HasTable((MetaDataTableType)i)) { tableheap.tablecount++; } ReadTableHeaders(); tableheap.tablereader = this; // ReadTables(); }
public TablesDlg(MetaDataStream stream) { InitializeComponent(); tableheap = (TablesHeap)stream.ToHeap(); hexBox1.ByteProvider = new DynamicByteProvider(stream.Contents); // foreach (MetaDataMember member in tableheap.Tables.First(t => t.Type == MetaDataTableType.ManifestResource).Members) // treeView1.Nodes.Add(CreateTreeNode(member)); foreach (MetaDataTable table in tableheap.Tables) { if (table != null) { TreeNode node = new TreeNode(table.Type.ToString() + " (" + table.AmountOfRows.ToString() + ")"); treeView1.Nodes.Add(node); index = 1; foreach (MetaDataMember member in table.Members) node.Nodes.Add(CreateTreeNode(member)); } } }
internal NETTableReader(MetaDataStream stream) { this.stream = stream; reader = new BinaryReader(new MemoryStream(stream.Contents)); tableheap = new TablesHeap(); tableheap.header = ASMGlobals.ReadStructureFromReader<Structures.METADATA_TABLE_HEADER>(reader); tableheap.reader = stream.reader; tableheap.offset = stream.offset; tableheap.size = stream.size; tableheap.stream = stream; tableheap.streamoffset = stream.streamoffset; tableheap.headeroffset = stream.headeroffset; tableheap.netheader = stream.netheader; for (int i = 0; i < 45; i++) if (tableheap.HasTable((MetaDataTableType)i)) { tableheap.tablecount++; } ReadTableHeaders(); tableheap.tablereader = this; // ReadTables(); }
internal NETTableReader(TablesHeap tablesheap) { using (BinaryReader reader = new BinaryReader(new MemoryStream(tablesheap.Contents))) { tablesheap._header = ASMGlobals.ReadStructureFromReader<Structures.METADATA_TABLE_HEADER>(reader); this.tablesHeap = tablesheap; for (int i = 0; i < 45; i++) if (tablesHeap.HasTable((MetaDataTableType)i)) { tablesHeap._tablecount++; } tablesHeap._tablereader = this; if ((tablesHeap.HeapOffsetSizes & 1) == 1) tablesHeap._netheader.StringsHeap._indexsize = 4; if ((tablesHeap.HeapOffsetSizes & 2) == 2) tablesHeap._netheader.GuidHeap._indexsize = 4; if ((tablesHeap.HeapOffsetSizes & 4) == 4) tablesHeap._netheader.BlobHeap._indexsize = 4; ReadTableHeaders(reader); } }
internal MetaDataTable(TablesHeap tableHeap) { TablesHeap = tableHeap; members = new List<MetaDataMember>(); }
public void SetTablesHeap(TablesHeap tablesHeap) { this.currentTablesHeap = tablesHeap; tablesTree.Nodes.Clear(); foreach (MetaDataTable table in tablesHeap.Tables) { if (table != null) { TreeNode node = new TreeNode(table.Type.ToString() + " (" + table.AmountOfRows.ToString() + ")"); node.Tag = table; if (table.AmountOfRows > 0) { node.Nodes.Add(new TreeNode("Loading...")); } tablesTree.Nodes.Add(node); } } }
public void SetTablesHeap(TablesHeap tablesHeap) { tablesTree.Nodes.Clear(); foreach (MetaDataTable table in tablesHeap.Tables) { if (table != null) { TreeNode node = new TreeNode(table.Type.ToString() + " (" + table.AmountOfRows.ToString() + ")"); tablesTree.Nodes.Add(node); index = 1; foreach (MetaDataMember member in table.Members) node.Nodes.Add(CreateTreeNode(member)); } } }
public void LoadCache() { _tableheap = TablesHeap; _stringsheap = StringsHeap; _usheap = UserStringsHeap; _blobheap = BlobHeap; _guidheap = GuidHeap; }
public void ClearCache() { _tableheap = null; _stringsheap = null; _usheap = null; _blobheap = null; _guidheap = null; }
internal MetaDataTable(TablesHeap tableHeap, bool createNew) { TablesHeap = tableHeap; _tablesize = -1; }