Package ghidra.app.util.bin.format.pe

# 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 Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final String`
  `NAME`

  ### Fields inherited from interface ghidra.app.util.bin.StructConverter

  `ASCII, BYTE, DWORD, IBO32, IBO64, POINTER, QWORD, SLEB128, STRING, ULEB128, UTF16, UTF8, VOID, WORD`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ImportByName(short hint, String name)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `short`
  `getHint()`
  `String`
  `getName()`
  Returns an ASCIIZ string with the name of the imported function.
  `int`
  `getSizeOf()`
  Returns the actual number of bytes consumed by this structure in memory.
  `byte[]`
  `toBytes(DataConverter dc)`
  Returns a byte array representing this implementor of this interface.
  `DataType`
  `toDataType()`
  Returns a structure datatype representing the contents of the implementor of this interface.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### NAME

    public static final String NAME
    See Also:
      - Constant Field Values

- ## 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:
      - `StructureDataType`

  - ### 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

  - ### 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