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

# Class BoundImportDescriptor

java.lang.Object
ghidra.app.util.bin.format.pe.BoundImportDescriptor

All Implemented Interfaces:
  `ByteArrayConverter`, `StructConverter`

public class BoundImportDescriptor extends Object implements StructConverter, ByteArrayConverter
A class to represent the `IMAGE_BOUND_IMPORT_DESCRIPTOR` data structure defined in `winnt.h`.

     typedef struct _IMAGE_BOUND_IMPORT_DESCRIPTOR {
         DWORD   TimeDateStamp;
         WORD    OffsetModuleName;
         WORD    NumberOfModuleForwarderRefs;
         // Array of zero or more IMAGE_BOUND_FORWARDER_REF follows
     } IMAGE_BOUND_IMPORT_DESCRIPTOR,  *PIMAGE_BOUND_IMPORT_DESCRIPTOR;

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final int`
  `IMAGE_SIZEOF_BOUND_IMPORT_DESCRIPTOR`
  The size of the `IMAGE_BOUND_IMPORT_DESCRIPTOR` in bytes.
  `static final String`
  `NAME`
  The name to use when converting into a structure data type.

  ### 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
  `BoundImportDescriptor(String name, int timeDateStamp)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `BoundImportForwarderRef`
  `getBoundImportForwarderRef(int index)`
  Returns the forwarder ref at the specified index
  `String`
  `getModuleName()`
  Returns the module name of the imported DLL.
  `short`
  `getNumberOfModuleForwarderRefs()`
  Returns the number of IMAGE_BOUND_FORWARDER_REF structures that immediately follow this structure.
  `short`
  `getOffsetModuleName()`
  Returns an offset to a string with the name of the imported DLL.
  `int`
  `getTimeDateStamp()`
  Returns the time/data stamp of the imported DLL.
  `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.
  `String`
  `toString()`

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

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

- ## Field Details

  - ### NAME

    public static final String NAME
    The name to use when converting into a structure data type.
    See Also:
      - Constant Field Values

  - ### IMAGE_SIZEOF_BOUND_IMPORT_DESCRIPTOR

    public static final int IMAGE_SIZEOF_BOUND_IMPORT_DESCRIPTOR
    The size of the `IMAGE_BOUND_IMPORT_DESCRIPTOR` in bytes.
    See Also:
      - Constant Field Values

- ## Constructor Details

  - ### BoundImportDescriptor

    public BoundImportDescriptor(String name, int timeDateStamp)

- ## Method Details

  - ### getTimeDateStamp

    public int getTimeDateStamp()
    Returns the time/data stamp of the imported DLL.
    Returns:
      the time/data stamp of the imported DLL

  - ### getOffsetModuleName

    public short getOffsetModuleName()
    Returns an offset to a string with the name of the imported DLL.
    Returns:
      an offset to a string with the name

  - ### getNumberOfModuleForwarderRefs

    public short getNumberOfModuleForwarderRefs()
    Returns the number of IMAGE_BOUND_FORWARDER_REF structures that immediately follow this structure.
    Returns:
      the number of IMAGE_BOUND_FORWARDER_REF structures that immediately follow this structure

  - ### getModuleName

    public String getModuleName()
    Returns the module name of the imported DLL.
    Returns:
      the module name of the imported DLL

  - ### getBoundImportForwarderRef

    public BoundImportForwarderRef getBoundImportForwarderRef(int index)
    Returns the forwarder ref at the specified index
    Parameters:
      `index` - the index of the forwarder ref
    Returns:
      the forwarder ref at the specified index

  - ### toString

    public String toString()
    Overrides:
      `toString` in class `Object`
    See Also:
      - `Object.toString()`

  - ### 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:
      - `StructConverter.toDataType()`

  - ### 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:
      - `ByteArrayConverter.toBytes(ghidra.util.DataConverter)`