Class PrimitiveExtractor

java.lang.Object
ghidra.program.model.lang.protorules.PrimitiveExtractor

public class PrimitiveExtractor extends Object
  • Constructor Details

    • PrimitiveExtractor

      public PrimitiveExtractor(DataType dt, boolean unionIllegal, int offset, int max)
      Parameters:
      dt - is data-type extract from
      unionIllegal - is true if unions encountered during extraction are considered illegal
      offset - is the starting offset to associate with the data-type
      max - is the maximum number of primitives to extract before giving up
  • Method Details

    • isValid

      public boolean isValid()
      Returns:
      true if all primitive elements were extracted
    • containsUnknown

      public boolean containsUnknown()
      Returns:
      true if any extracted element was unknown/undefined
    • isAligned

      public boolean isAligned()
      Returns:
      true if all extracted elements are aligned
    • containsHoles

      public boolean containsHoles()
      Returns:
      true if there is extra space in the data-type that is not alignment padding
    • size

      public int size()
      Returns:
      the number of primitives extracted
    • get

      public PrimitiveExtractor.Primitive get(int i)
      Get the i-th extracted primitive and its offset
      Parameters:
      i - is the index
      Returns:
      the primitive and offset