예제 #1
0
 private static DirectoryEntry ReadDirectoryEntry(MemoryCursor/*!*/ c)
 {
     DirectoryEntry entry = new DirectoryEntry();
     entry.virtualAddress = c.Int32(0);
     entry.size = c.Int32(1); c.SkipInt32(2);
     return entry;
 }
예제 #2
0
 internal static SectionHeader ReadSectionHeader(MemoryCursor/*!*/ c)
 {
     SectionHeader header = new SectionHeader();
     header.name = c.ReadASCII(8);
     header.virtualSize = c.Int32(0);
     header.virtualAddress = c.Int32(1);
     header.sizeOfRawData = c.Int32(2);
     header.pointerToRawData = c.Int32(3);
     header.pointerToRelocations = c.Int32(4);
     header.pointerToLinenumbers = c.Int32(5); c.SkipInt32(6);
     header.numberOfRelocations = c.UInt16(0);
     header.numberOfLinenumbers = c.UInt16(1); c.SkipInt16(2);
     header.characteristics = c.Int32(0); c.SkipInt32(1);
     return header;
 }
예제 #3
0
 private static CLIHeader/*!*/ ReadCLIHeader(MemoryCursor/*!*/ c)
 {
     CLIHeader header = new CLIHeader();
     header.cb = c.Int32(0); c.SkipInt32(1);
     header.majorRuntimeVersion = c.UInt16(0);
     header.minorRuntimeVersion = c.UInt16(1); c.SkipUInt16(2);
     header.metaData = ReadDirectoryEntry(c);
     header.flags = c.Int32(0);
     header.entryPointToken = c.Int32(1); c.SkipInt32(2);
     header.resources = ReadDirectoryEntry(c);
     header.strongNameSignature = ReadDirectoryEntry(c);
     header.codeManagerTable = ReadDirectoryEntry(c);
     header.vtableFixups = ReadDirectoryEntry(c);
     header.exportAddressTableJumps = ReadDirectoryEntry(c);
     if (header.majorRuntimeVersion < 2)
         throw new InvalidMetadataException(ExceptionStrings.BadCLIHeader);
     return header;
 }