Class TaintSet

java.lang.Object
ghidra.taint.model.TaintSet

public class TaintSet extends Object
An immutable set of multiple taint marks

A variable in an emulator could be tainted by multiple marks, so we must use vectors of sets, not vectors of marks. Please see TaintMark.equals(Object) regarding the equality of tagged marks.

  • Field Details

    • EMPTY

      public static final TaintSet EMPTY
      The empty set, the default for all state variables
  • Method Details

    • parse

      public static TaintSet parse(String string)
      Parse a set of taint marks

      The form is a semicolon-separated list of taint marks, e.g., "myVar:tag1,tag2;anotherVar;yetAnother".

      Parameters:
      string - the string to parse
      Returns:
      the resulting set
    • of

      public static TaintSet of(TaintMark... marks)
      Create a taint set of the given marks
      Parameters:
      marks - the marks
      Returns:
      the set
    • toString

      public String toString()
      Convert the set to a string
      Overrides:
      toString in class Object
      See Also:
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • getMarks

      public Set<TaintMark> getMarks()
      Get the marks in this set
      Returns:
      the marks
    • isEmpty

      public boolean isEmpty()
      Check if this set is empty
      Returns:
      the marks
    • union

      public TaintSet union(TaintSet that)
      Construct the taint set from the union of marks of this and the given taint set
      Parameters:
      that - another taint set
      Returns:
      the union
    • tagged

      public TaintSet tagged(String string)
      Construct the taint set formed by tagging each mark in this set
      Parameters:
      string - the tag to add to each mark
      Returns:
      the new set