Class ImportByName

java.lang.Object
ghidra.app.util.bin.format.pe.ImportByName
All Implemented Interfaces:
ByteArrayConverter, StructConverter

public class ImportByName extends Object implements StructConverter, ByteArrayConverter
A class to represent the IMAGE_IMPORT_BY_NAME data structure defined in winnt.h.
 typedef struct _IMAGE_IMPORT_BY_NAME {
     WORD    Hint;
     BYTE    Name[1];
 };
 
  • Field Details

  • Constructor Details

    • ImportByName

      public ImportByName(short hint, String name)
      Parameters:
      hint - the import hint (ordinal)
      name - the name of the imported function.
  • Method Details

    • getHint

      public short getHint()
      Returns:
      the export ordinal for the imported function
    • getName

      public String getName()
      Returns an ASCIIZ string with the name of the imported function.
      Returns:
      an ASCIIZ string with the name of the imported function
    • toDataType

      public DataType toDataType() throws DuplicateNameException
      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
      See Also:
    • toBytes

      public byte[] toBytes(DataConverter dc)
      Description copied from interface: ByteArrayConverter
      Returns a byte array representing this implementor of this interface.
      Specified by:
      toBytes in interface ByteArrayConverter
      Parameters:
      dc - the data converter to use
      Returns:
      a byte array representing this object
      See Also:
    • getSizeOf

      public int getSizeOf()
      Returns the actual number of bytes consumed by this structure in memory.
      Returns:
      the actual number of bytes consumed by this structure in memory