Package ghidra.app.util.datatype.microsoft

# Class GUID

java.lang.Object
ghidra.app.util.datatype.microsoft.GUID

public class GUID extends Object
GUIDs identify objects such as interfaces, manager entry-point vectors (EPVs), and class objects. A GUID is a 128-bit value consisting of one group of 8 hexadecimal digits, followed by three groups of 4 hexadecimal digits each, followed by one group of 12 hexadecimal digits. The following example shows the groupings of hexadecimal digits in a GUID.
`6B29FC40-CA47-1067-B31D-00DD010662DA`

     typedef struct _GUID {
                    DWORD Data1;
                    WORD Data2;
                    WORD Data3;
                    BYTE Data4[8];
     } GUID;

Data1 - Specifies the first 8 hexadecimal digits of the GUID.
Data2 - Specifies the first group of 4 hexadecimal digits.
Data3 - Specifies the second group of 4 hexadecimal digits.
Data4 - Array of 8 bytes. The first 2 bytes contain the third group of 4 hexadecimal digits. The remaining 6 bytes contain the final 12 hexadecimal digits.

- ## Field Summary

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

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `GUID(int data1, short data2, short data3, byte[] data4)`
  Constructs a GUID using the constitute pieces.
  `GUID(BinaryReader reader)`
  Reads a GUID from the given binary reader.
  `GUID(MemBuffer buf)`
  Reads a GUID from the given memory buffer.
  `GUID(String guidString)`
  Creates a GUID object using the GUID string form.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `boolean`
  `equals(Object obj)`
  `int`
  `getData1()`
  Specifies the first 8 hexadecimal digits of the GUID.
  `short`
  `getData2()`
  Specifies the first group of 4 hexadecimal digits.
  `short`
  `getData3()`
  Specifies the second group of 4 hexadecimal digits.
  `byte[]`
  `getData4()`
  Array of 8 bytes.
  `int`
  `hashCode()`
  `String`
  `toString()`

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

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

- ## Field Details

  - ### SIZEOF

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

- ## Constructor Details

  - ### GUID

    public GUID(String guidString) throws IllegalArgumentException
    Creates a GUID object using the GUID string form.
    Parameters:
      `guidString` - - either with or without dashes between parts - "6B29FC40-CA47-1067-B31D-00DD010662DA", or "6B29FC40CA471067B31D00DD010662DA", and with or without leading and trailing "{" "}" characters
    Throws:
      `IllegalArgumentException` - if string does not represent a valid GUID

  - ### GUID

    public GUID(int data1, short data2, short data3, byte[] data4)
    Constructs a GUID using the constitute pieces.

  - ### GUID

    public GUID(BinaryReader reader) throws IOException
    Reads a GUID from the given binary reader.
    Parameters:
      `reader` - the binary reader to read the GUID
    Throws:
      `IOException` - if an I/O error occurs while reading the GUID

  - ### GUID

    public GUID(MemBuffer buf) throws MemoryAccessException
    Reads a GUID from the given memory buffer.
    Parameters:
      `buf` - the memory buffer to read the GUID
    Throws:
      `MemoryAccessException` - if an error occurs while reading the GUID

- ## Method Details

  - ### toString

    public String toString()
    Overrides:
      `toString` in class `Object`

  - ### getData1

    public int getData1()
    Specifies the first 8 hexadecimal digits of the GUID.
    Returns:

  - ### getData2

    public short getData2()
    Specifies the first group of 4 hexadecimal digits.
    Returns:

  - ### getData3

    public short getData3()
    Specifies the second group of 4 hexadecimal digits.
    Returns:

  - ### getData4

    public byte[] getData4()
    Array of 8 bytes. The first 2 bytes contain the third group of 4 hexadecimal digits. The remaining 6 bytes contain the final 12 hexadecimal digits.
    Returns:

  - ### hashCode

    public int hashCode()
    Overrides:
      `hashCode` in class `Object`

  - ### equals

    public boolean equals(Object obj)
    Overrides:
      `equals` in class `Object`