Record Class BpsTransformation

java.lang.Object
java.lang.Record
ghidra.util.bytesearch.bytepatternsearch.BpsTransformation
Record Components:
endianness - of the pattern
extensionSize - word size the pattern was padded to (can be null)
splitToSize - word size the pattern was split to (can be null)
splitPartIndex - index of the split that this pattern represents (eg. index=1 indicates the first part of a split) (can be null)
totalSplitParts - total count of all parts of a split pattern (can be null)

public record BpsTransformation(Endian endianness, Integer extensionSize, Integer splitToSize, Integer splitPartIndex, Integer totalSplitParts) extends Record
This class records a byte pattern's transformation in support of Ghidra's Byte Pattern Search capability.

The design of the Byte pattern Searcher and its supporting sub-capabilities and classes can be found in the "Search For Byte Patterns" page in the help viewer.

Indicates the structural state mutations which have been applied to a BpsPattern.

NOTE: Once patterns are generated, they do not change (instead, when transforming a pattern, a new pattern is generated and has its own transformation record) so pattern transformation records are not modifiable.

  • Constructor Details

    • BpsTransformation

      public BpsTransformation(Endian endianness, Integer extensionSize, Integer splitToSize, Integer splitPartIndex, Integer totalSplitParts)
      Creates an instance of a BpsTransformation record class.
      Parameters:
      endianness - the value for the endianness record component
      extensionSize - the value for the extensionSize record component
      splitToSize - the value for the splitToSize record component
      splitPartIndex - the value for the splitPartIndex record component
      totalSplitParts - the value for the totalSplitParts record component
  • Method Details

    • empty

      public static BpsTransformation empty()
      Factory method for an unmodified baseline pattern.

      NOTE: All patterns prior to any transformations are safely assumed to be big endian.

      Returns:
      the transformation
    • asLittleEndian

      public BpsTransformation asLittleEndian()
      Returns Creates a copy of this record that uses the Little Endian setting.
      Returns:
      Creates a copy of this record that uses the Little Endian setting
    • toString

      public String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • getDescription

      public String getDescription()
      Returns the description of the pattern's transformation history.
      Returns:
      the description of the pattern's transformation history
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • endianness

      public Endian endianness()
      Returns the value of the endianness record component.
      Returns:
      the value of the endianness record component
    • extensionSize

      public Integer extensionSize()
      Returns the value of the extensionSize record component.
      Returns:
      the value of the extensionSize record component
    • splitToSize

      public Integer splitToSize()
      Returns the value of the splitToSize record component.
      Returns:
      the value of the splitToSize record component
    • splitPartIndex

      public Integer splitPartIndex()
      Returns the value of the splitPartIndex record component.
      Returns:
      the value of the splitPartIndex record component
    • totalSplitParts

      public Integer totalSplitParts()
      Returns the value of the totalSplitParts record component.
      Returns:
      the value of the totalSplitParts record component