Class RepeatInstructionByteTracker

java.lang.Object
ghidra.app.util.RepeatInstructionByteTracker

public class RepeatInstructionByteTracker extends Object
RepeatInstructionByteTracker provides pseudo-disassemblers the ability to track repeated bytes during disassembly of a block of instructions.
  • Constructor Details

    • RepeatInstructionByteTracker

      public RepeatInstructionByteTracker(int repeatPatternLimit, AddressSetView repeatPatternLimitIgnoredRegion)
      Constructor.
      Parameters:
      repeatPatternLimit - maximum number of instructions containing the same repeated byte values. A value less than or equal to 0 will disable counting.
      repeatPatternLimitIgnoredRegion - optional set of addresses where check is not performed or null for check to be performed everywhere.
  • Method Details

    • reset

      public void reset()
      Reset internal counter. This should be performed before disassembling a new block of instructions.
    • exceedsRepeatBytePattern

      public boolean exceedsRepeatBytePattern(PseudoInstruction inst)
      Check the next instruction within a block of instructions.
      Parameters:
      inst - next instruction
      Returns:
      true if repeat limit has been exceeded, else false. If the repeat limit has been set <= 0 false will be returned.
    • setRepeatPatternLimit

      public void setRepeatPatternLimit(int maxInstructions)
      Set the maximum number of instructions in a single run which contain the same byte values.
      Parameters:
      maxInstructions - limit on the number of consecutive instructions with the same byte values. A non-positive value (<= 0) will disable the exceedsRepeatBytePattern(PseudoInstruction) checking.
    • setRepeatPatternLimitIgnored

      public void setRepeatPatternLimitIgnored(AddressSetView set)
      Set the region over which the repeat pattern limit will be ignored.
      Parameters:
      set - region over which the repeat pattern limit will be ignored