Package ghidra.util.bytesearch
Class PatternPairSet
- java.lang.Object
-
- ghidra.util.bytesearch.PatternPairSet
-
public class PatternPairSet extends java.lang.Object
A set of "pre" DittedBitSequences and a set of "post" Patterns are paired to form a larger pattern. To match, a sequence from the "pre" sequence set must first match, then one of the "post" patterns is matched relative to the matching "pre" pattern. This class is really a storage object for the patterns and provides a mechanism to read the pre/post patterns from an XML file. The larger pattern has the idea of bits of check, which means the number of bits that are fixed to a value when matching (not don't care). There is a pre pattern bits of check and post pattern bits of check. The bits of check are used to statistically gauge the accuracy of the pattern. An example of the XML format follows:0xe12fff1. 0xe12fff1e 0x46c0 0xe12fff1e 0xe1a00000 0xe24dd... 11101001 00101101 .1...... ....0000 11101001 00101101 .1...... ....0000 0xe24dd... 11101001 00101101 .1...... ....0000 0x........ 0xe24dd...
-
-
Constructor Summary
Constructors Constructor Description PatternPairSet()
Construct an empty PatternPairSet.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
createFinalPatterns(java.util.ArrayList<Pattern> finalpats)
void
extractPostPatterns(java.util.ArrayList<Pattern> postpats)
Add this PatternPairSets post patterns to an existing arraylist of patterns.int
getPostBitsOfCheck()
Get the required number of fixed bits after the prepatternjava.util.ArrayList<Pattern>
getPostPatterns()
Get the "post" parts of the patternsjava.util.ArrayList<DittedBitSequence>
getPreSequences()
Get the "pre" parts of the patternsint
getTotalBitsOfCheck()
Get the required number of fixed bits in the whole patternvoid
restoreXml(XmlPullParser parser, PatternFactory pfactory)
Restore PatternPairSet from XML pull parser
-
-
-
Method Detail
-
createFinalPatterns
public void createFinalPatterns(java.util.ArrayList<Pattern> finalpats)
-
extractPostPatterns
public void extractPostPatterns(java.util.ArrayList<Pattern> postpats)
Add this PatternPairSets post patterns to an existing arraylist of patterns.- Parameters:
postpats
- array to add this PatternPairSets post patterns into
-
restoreXml
public void restoreXml(XmlPullParser parser, PatternFactory pfactory) throws java.io.IOException
Restore PatternPairSet from XML pull parser- Parameters:
parser
- XML pull parserpfactory
- pattern factory user to construct patterns- Throws:
java.io.IOException
- if pull parsing fails
-
getPreSequences
public java.util.ArrayList<DittedBitSequence> getPreSequences()
Get the "pre" parts of the patterns- Returns:
- pre sequences
-
getPostPatterns
public java.util.ArrayList<Pattern> getPostPatterns()
Get the "post" parts of the patterns- Returns:
- post patterns
-
getPostBitsOfCheck
public int getPostBitsOfCheck()
Get the required number of fixed bits after the prepattern- Returns:
- number of post bits
-
getTotalBitsOfCheck
public int getTotalBitsOfCheck()
Get the required number of fixed bits in the whole pattern- Returns:
- number of total fixed bits
-
-