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

# Class ResourceDirectory

java.lang.Object
ghidra.app.util.bin.format.pe.resource.ResourceDirectory

All Implemented Interfaces:
  `StructConverter`

public class ResourceDirectory extends Object implements StructConverter

     typedef struct _IMAGE_RESOURCE_DIRECTORY {
         DWORD   Characteristics;
         DWORD   TimeDateStamp;
         WORD    MajorVersion;
         WORD    MinorVersion;
         WORD    NumberOfNamedEntries;
         WORD    NumberOfIdEntries;
     };

- ## Field Summary

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

  ### 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
  `ResourceDirectory(BinaryReader reader, int index, int resourceBase, boolean isFirstLevel, NTHeader ntHeader)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `int`
  `getCharacteristics()`
  Theoretically, this field could hold flags for the resource, but appears to always be 0.
  `List<ResourceDirectoryEntry>`
  `getEntries()`
  `short`
  `getMajorVersion()`
  Theoretically these fields would hold a version number for the resource.
  `short`
  `getMinorVersion()`
  Theoretically these fields would hold a version number for the resource.
  `int`
  `getNumberOfIdEntries()`
  Returns the number of array elements that use integer IDs, and which follow this structure.
  `int`
  `getNumberOfNamedEntries()`
  Returns the number of array elements that use names and that follow this structure.
  `int`
  `getTimeDataStamp()`
  Returns the time/date stamp describing the creation time of the resource.
  `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

  - ### SIZEOF

    public static final int SIZEOF
    See Also:
      - Constant Field Values

- ## Constructor Details

  - ### ResourceDirectory

    public ResourceDirectory(BinaryReader reader, int index, int resourceBase, boolean isFirstLevel, NTHeader ntHeader) throws IOException
    Throws:
      `IOException`

- ## Method Details

  - ### getEntries

    public List<ResourceDirectoryEntry> getEntries()

  - ### getCharacteristics

    public int getCharacteristics()
    Theoretically, this field could hold flags for the resource, but appears to always be 0.
    Returns:
      the flags for the resource

  - ### getTimeDataStamp

    public int getTimeDataStamp()
    Returns the time/date stamp describing the creation time of the resource.
    Returns:
      the time/date stamp describing the creation time of the resource

  - ### getNumberOfNamedEntries

    public int getNumberOfNamedEntries()
    Returns the number of array elements that use names and that follow this structure.
    Returns:
      the number of array elements that use names and that follow this structure

  - ### getNumberOfIdEntries

    public int getNumberOfIdEntries()
    Returns the number of array elements that use integer IDs, and which follow this structure.
    Returns:
      the number of array elements that use integer IDs, and which follow this structure

  - ### getMajorVersion

    public short getMajorVersion()
    Theoretically these fields would hold a version number for the resource. These field appear to always be set to 0.
    Returns:
      the major version number

  - ### getMinorVersion

    public short getMinorVersion()
    Theoretically these fields would hold a version number for the resource. These field appear to always be set to 0.
    Returns:
      the minor version number

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