Package ghidra.app.plugin.match
Class Match
java.lang.Object
ghidra.app.plugin.match.Match
- All Implemented Interfaces:
Comparable<Match>
Match maintains information about a single match between two programs.
The match can consist of either bytes or code units.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
void
continueMatch
(byte b) void
continueMatch
(CodeUnit cu, CodeUnit otherUnit) expectedAddressForNextMatch
(int baseLength) Object[]
getBytes()
Object[]
int
length()
toString()
int
-
Constructor Details
-
Match
- Parameters:
thisBeginning
- The start Address of the match in the program from which the matches are being found.otherBeginning
- The start Address of the match in the program to which the matches are being found.bytes
- the bytes which make up this match.length
- the length of the bytes array.
-
Match
public Match(Address thisBeginning, Address otherBeginning, CodeUnit[] codeUnits, CodeUnit[] otherUnits, int length) - Parameters:
thisBeginning
- The start Address of the match in the program from which the matches are being found.otherBeginning
- The start Address of the match in the program to which the matches are being found.codeUnits
- The CodeUnits which make up the match in this Program.otherUnits
- The CodeUnits which make up this match in the other program. Note, the code units need no match up byte for byte.length
- The length of the CodeUnit arrays.
-
-
Method Details
-
continueMatch
public void continueMatch(byte b) - Parameters:
b
- Continue the match by adding the additional byte b.
-
continueMatch
- Parameters:
cu
- The CodeUnit which extends the match in 'this' program.otherUnit
- The CodeUnit which extends the match in 'the other' program.
-
length
public int length()- Returns:
- The number of items that make up this match.
-
totalLength
public int totalLength()- Returns:
- The total number of bytes that make up this match.
-
toString
-
getOtherBeginning
- Returns:
- The Address that starts the match in the other program.
-
getThisBeginning
- Returns:
- The Address that starts the match in this program.
-
getBytes
- Returns:
- array containing the objects that make up the match in this program.
-
getOtherBytes
- Returns:
- array containing the objects that make up the match in the other program.
-
printMatch
-
compareTo
- Specified by:
compareTo
in interfaceComparable<Match>
-
expectedAddressForNextMatch
- Parameters:
baseLength
- the minimum number of items which make up a match. There are different values for instruction and byte matches. This value should either be NaiveMatchPlugin.MATCH_LENGTH_FOR_INSTRUCTIONS or NaiveMatchPlugin.MATCH_LENGTH_FOR_BYTES which can be found by calling getMatchLengthForInstructions() or getMatchLengthForBytes().- Returns:
- The Address at which a continuing byte or code unit would be expected to be found in the other program.
-