Package ghidra.app.util
Class RepeatInstructionByteTracker
java.lang.Object
ghidra.app.util.RepeatInstructionByteTracker
RepeatInstructionByteTracker
provides pseudo-disassemblers the ability to track
repeated bytes during disassembly of a block of instructions.-
Constructor Summary
ConstructorDescriptionRepeatInstructionByteTracker
(int repeatPatternLimit, AddressSetView repeatPatternLimitIgnoredRegion) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Check the next instruction within a block of instructions.void
reset()
Reset internal counter.void
setRepeatPatternLimit
(int maxInstructions) Set the maximum number of instructions in a single run which contain the same byte values.void
Set the region over which the repeat pattern limit will be ignored.
-
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
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 theexceedsRepeatBytePattern(PseudoInstruction)
checking.
-
setRepeatPatternLimitIgnored
Set the region over which the repeat pattern limit will be ignored.- Parameters:
set
- region over which the repeat pattern limit will be ignored
-