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 ResourceDirectoryEntry ReadDirectoryEntry(uint offset) { var rawEntry = ASMGlobals.ReadStructureFromReader <Structures.IMAGE_RESOURCE_DIRECTORY_ENTRY>(reader); string customName = string.Empty; ResourceDirectoryEntry resourceEntry = new ResourceDirectoryEntry(image, offset, rawEntry, customName); return(resourceEntry); }
internal ResourceDataEntry ReadDataEntry(uint offset, ResourceDirectoryEntry entry) { if (TrySetOffset(offset)) { var rawDataEntry = ASMGlobals.ReadStructureFromReader <Structures.IMAGE_RESOURCE_DATA_ENTRY>(reader); return(new ResourceDataEntry(image, resourceDirectory.TargetOffset.FileOffset + offset, entry, rawDataEntry)); } return(null); }
internal ResourceDirectory ReadDirectory(uint offset, ResourceDirectoryEntry entry) { if (TrySetOffset(offset)) { var rawDirectory = ASMGlobals.ReadStructureFromReader <Structures.IMAGE_RESOURCE_DIRECTORY>(reader); return(new ResourceDirectory(image, offset, this, entry, rawDirectory)); } return(null); }