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

# Class DebugDirectory

java.lang.Object
ghidra.app.util.bin.format.pe.debug.DebugDirectory

All Implemented Interfaces:
  `ByteArrayConverter`, `StructConverter`

public class DebugDirectory extends Object implements StructConverter, ByteArrayConverter
A class to represent the Debug Directory data structure.

     typedef struct _IMAGE_DEBUG_DIRECTORY {
         DWORD   Characteristics;
         DWORD   TimeDateStamp;
         WORD    MajorVersion;
         WORD    MinorVersion;
         DWORD   Type;
         DWORD   SizeOfData;
         DWORD   AddressOfRawData;
         DWORD   PointerToRawData;
     } IMAGE_DEBUG_DIRECTORY, *PIMAGE_DEBUG_DIRECTORY;

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final int`
  `IMAGE_SIZEOF_DEBUG_DIRECTORY`
  The size of the `IMAGE_DEBUG_DIRECTORY`, 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`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `int`
  `getAddressOfRawData()`
  Returns the address of the debugging information when the image is loaded, relative to the image base.
  `int`
  `getCharacteristics()`
  Reserved.
  `String`
  `getDescription()`
  Returns a description of this debug directory.
  `int`
  `getMajorVersion()`
  Returns the major version number of the debugging information format.
  `int`
  `getMinorVersion()`
  Returns the minor version number of the debugging information format.
  `int`
  `getPointerToRawData()`
  Returns the file pointer to the debugging information.
  `int`
  `getSizeOfData()`
  Returns the size of the debugging information, in bytes.
  `int`
  `getTimeDateStamp()`
  Returns the time and date the debugging information was created.
  `int`
  `getType()`
  Returns the format of the debugging information.
  `void`
  `setDescription(String desc)`
  Sets the description of this debug directory.
  `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.
  `void`
  `updatePointers(int offset, int postOffset)`
  `void`
  `writeHeader(RandomAccessFile raf, DataConverter dc)`

  ### 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
    The name to use when converting into a structure data type.
    See Also:
      - Constant Field Values

  - ### IMAGE_SIZEOF_DEBUG_DIRECTORY

    public static final int IMAGE_SIZEOF_DEBUG_DIRECTORY
    The size of the `IMAGE_DEBUG_DIRECTORY`, in bytes.
    See Also:
      - Constant Field Values

- ## Method Details

  - ### getCharacteristics

    public int getCharacteristics()
    Reserved.
    Returns:
      reserved value

  - ### getTimeDateStamp

    public int getTimeDateStamp()
    Returns the time and date the debugging information was created.
    Returns:
      the time and date the debugging information was created

  - ### getMajorVersion

    public int getMajorVersion()
    Returns the major version number of the debugging information format.
    Returns:
      the major version number of the debugging information format

  - ### getMinorVersion

    public int getMinorVersion()
    Returns the minor version number of the debugging information format.
    Returns:
      the minor version number of the debugging information format

  - ### getType

    public int getType()
    Returns the format of the debugging information.
    Returns:
      the format of the debugging information

  - ### getSizeOfData

    public int getSizeOfData()
    Returns the size of the debugging information, in bytes. This value does not include the debug directory itself.
    Returns:
      the size of the debugging information, in bytes

  - ### getAddressOfRawData

    public int getAddressOfRawData()
    Returns the address of the debugging information when the image is loaded, relative to the image base.
    Returns:
      the address of the debugging information when the image is loaded, relative to the image base

  - ### getPointerToRawData

    public int getPointerToRawData()
    Returns the file pointer to the debugging information.
    Returns:
      the file pointer to the debugging information

  - ### getDescription

    public String getDescription()
    Returns a description of this debug directory.
    Returns:
      a description of this debug directory

  - ### setDescription

    public void setDescription(String desc)
    Sets the description of this debug directory.
    Parameters:
      `desc` - the description of this debug directory

  - ### 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()`

  - ### writeHeader

    public void writeHeader(RandomAccessFile raf, DataConverter dc) throws IOException
    Throws:
      `IOException`

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

  - ### updatePointers

    public void updatePointers(int offset, int postOffset)