Class UnixAoutHeader

java.lang.Object
ghidra.app.util.bin.format.unixaout.UnixAoutHeader
All Implemented Interfaces:
StructConverter

public class UnixAoutHeader extends Object implements StructConverter
  • Constructor Details

    • UnixAoutHeader

      public UnixAoutHeader(ByteProvider provider, boolean isLittleEndian) throws IOException
      Interprets binary data as an exec header from a UNIX-style a.out executable, and validates the contained fields.
      Parameters:
      provider - Source of header binary data
      isLittleEndian - Flag indicating whether to interpret the data as little-endian.
      Throws:
      IOException - if an IO-related error occurred
  • Method Details

    • getReader

      public BinaryReader getReader()
    • getLanguageSpec

      public String getLanguageSpec()
      Returns the processor/language specified by this header..
      Returns:
      the processor/language specified by this header.
    • getCompilerSpec

      public String getCompilerSpec()
      Returns the compiler used by this executable. This is left as 'default' for all machine types other than i386, where it is assumed to be gcc..
      Returns:
      the compiler used by this executable. This is left as 'default' for all machine types other than i386, where it is assumed to be gcc.
    • getExecutableType

      public UnixAoutHeader.AoutType getExecutableType()
      Returns the enumerated type of executable contained in this A.out file..
      Returns:
      the enumerated type of executable contained in this A.out file.
    • isValid

      public boolean isValid()
      Returns an indication of whether this header's fields are all valid; this includes the machine type, executable type, and section offsets..
      Returns:
      an indication of whether this header's fields are all valid; this includes the machine type, executable type, and section offsets.
    • getTextSize

      public long getTextSize()
    • getDataSize

      public long getDataSize()
    • getBssSize

      public long getBssSize()
    • getSymSize

      public long getSymSize()
    • getStrSize

      public long getStrSize()
    • getEntryPoint

      public long getEntryPoint()
    • getTextRelocSize

      public long getTextRelocSize()
    • getDataRelocSize

      public long getDataRelocSize()
    • getTextOffset

      public long getTextOffset()
    • getDataOffset

      public long getDataOffset()
    • getTextRelocOffset

      public long getTextRelocOffset()
    • getDataRelocOffset

      public long getDataRelocOffset()
    • getSymOffset

      public long getSymOffset()
    • getStrOffset

      public long getStrOffset()
    • getTextAddr

      public long getTextAddr()
    • getDataAddr

      public long getDataAddr()
    • getBssAddr

      public long getBssAddr()
    • toDataType

      public DataType toDataType() throws DuplicateNameException, 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
      IOException - if an IO-related error occurs
      See Also:
    • markup

      public void markup(Program program, Address headerAddress) throws CodeUnitInsertionException, DuplicateNameException, IOException
      Throws:
      CodeUnitInsertionException
      DuplicateNameException
      IOException