Class RichHeader

  • All Implemented Interfaces:
    Writeable, StructConverter

    public class RichHeader
    extends java.lang.Object
    implements StructConverter, Writeable
    The "Rich" header contains encoded metadata about the tool chain used to generate the binary. This class decodes and writes the Rich header (if it exists).
    • Method Detail

      • createRichHeader

        public static RichHeader createRichHeader​(FactoryBundledWithBinaryReader reader)
        Create and returns the Rich header found from the given reader. The reader should be positioned directly after the DOS header.
        reader - The reader to read the PE with.
        The Rich header associated with the given reader.
      • getOffset

        public int getOffset()
        Gets the offset of the Rich header.
        the offset of the Rich header, or -1 if a Rich header was not found.
      • getSize

        public int getSize()
        Gets the size of the Rich header.
        the size of the Rich header. Will be 0 if a Rich header was not found.
      • getMask

        public int getMask()
        Gets the Rich header mask.
        the Rich header mask, or -1 if a Rich header was not found.
      • getRecords

        public RichHeaderRecord[] getRecords()
        Gets the Rich header records.
        the Rich header records. Could be empty if a Rich header was not found.
      • toDataType

        public DataType toDataType()
        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 a structure datatype representing the implementor of this interface
        See Also:
      • write

        public void write​( raf,
                          DataConverter dc)
        Description copied from interface: Writeable
        Writes this object to the specified random access file using the data converter to handle endianness.
        Specified by:
        write in interface Writeable
        raf - the random access file
        dc - the data converter
        Throws: - if an I/O error occurs