Class CliMetadataRoot

    • Constructor Detail

      • CliMetadataRoot

        public CliMetadataRoot​(BinaryReader reader,
                               int rva)
                        throws java.io.IOException
        Constructs a new CLI Metadata Root datatype. Matches ISO 23271 II.24.2.
        Parameters:
        reader - A binary reader set to start reading at the start of this header.
        rva - The RVA of this header.
        Throws:
        java.io.IOException - if there is a problem reading the header.
    • Method Detail

      • parse

        public boolean parse()
                      throws java.io.IOException
        Throws:
        java.io.IOException
      • toDataType

        public DataType toDataType()
                            throws DuplicateNameException,
                                   java.io.IOException
        Description copied from interface: StructConverter
        Returns a structure datatype representing the contents of the implementor of this interface.

        For example, given:

         class A {
             int foo;
             double bar;
         }
         

        The return value should be a structure data type with two data type components; an INT and a DOUBLE. The structure should contain field names and, if possible, field comments.

        Specified by:
        toDataType in interface StructConverter
        Returns:
        returns a structure datatype representing the implementor of this interface
        Throws:
        DuplicateNameException - when a datatype of the same name already exists
        java.io.IOException
        See Also:
        StructureDataType
      • getFileOffset

        public long getFileOffset()
        Gets the file offset of this header.
        Returns:
        The file offset of this header.
      • getRva

        public int getRva()
        Gets the relative virtual address of this header.
        Returns:
        The relative virtual address of this header.
      • getSignature

        public int getSignature()
        Gets the signature.

        Should always be 0x424a5342.

        Returns:
        The signature.
      • getMajorVersion

        public short getMajorVersion()
        Gets the major version.
        Returns:
        The major version.
      • getMinorVersion

        public short getMinorVersion()
        Gets the minor version.
        Returns:
        The minor version.
      • getReserved

        public int getReserved()
        Gets the reserved field.

        Should always be 0.

        Returns:
        The reserved field.
      • getVersionLength

        public int getVersionLength()
        Gets the length of the version string that follows the length field.
        Returns:
        The length of the version string that follows the length field.
      • getVersion

        public java.lang.String getVersion()
        Gets the version string.
        Returns:
        The version string. Could be null if the version length appeared too long during parsing of the header.
      • getFlags

        public short getFlags()
        Gets the flags.

        Should always be 0.

        Returns:
        The flags.
      • getStreamsCount

        public short getStreamsCount()
        Gets the number of streams present in the metadata.
        Returns:
        The number of streams present in the metadata.
      • getGuidStream

        public CliStreamGuid getGuidStream()
        Gets the GUID stream.
        Returns:
        The GUID stream. Could be null if it did not parse correctly.
      • getUserStringsStream

        public CliStreamUserStrings getUserStringsStream()
        Gets the user strings stream.
        Returns:
        The user strings stream. Could be null if it did not parse correctly.
      • getStringsStream

        public CliStreamStrings getStringsStream()
        Gets the strings stream.
        Returns:
        The strings stream. Could be null if it did not parse correctly.
      • getBlobStream

        public CliStreamBlob getBlobStream()
        Gets the blob stream.
        Returns:
        The blob stream. Could be null if it did not parse correctly.
      • getMetadataStream

        public CliStreamMetadata getMetadataStream()
        Gets the Metadata stream.
        Returns:
        The Metadata stream. Could be null if it did not parse correctly.
      • getStreamHeaders

        public java.util.Collection<CliStreamHeader> getStreamHeaders()
        Gets the stream headers.
        Returns:
        A collection of stream headers.
      • getStreamHeader

        public CliStreamHeader getStreamHeader​(java.lang.String name)
        Gets the stream header with the given name.
        Parameters:
        name - The name of the stream header to get.
        Returns:
        The stream header that matches the given name, or null if it wasn't found.
      • getBlobOffsetAtIndex

        public int getBlobOffsetAtIndex​(int index)