Class BSimFilter
java.lang.Object
ghidra.features.bsim.query.protocol.BSimFilter
Suitable for client side filtering by calling isFiltered with an ExecutableRecord
or evaluate with a FunctionDescription. Contains information for passing filter to
server side. Each 'atom' of the filter (FilterAtom) is expressed as an operator and
a value string. The operator (FilterType) indicates what part of the ExecutableRecord
or FunctionDescription must match (or not match) the value string.
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addAtom
(BSimFilterType type, String val) void
clear()
clone()
boolean
evaluate
(FunctionDescription func) Returns true if all filters resolve correctly for the given function description.getAtom
(int i) boolean
isEmpty()
int
numAtoms()
void
replaceWith
(BSimFilter other) void
restoreXml
(XmlPullParser parser) void
-
Constructor Details
-
BSimFilter
public BSimFilter()
-
-
Method Details
-
numAtoms
public int numAtoms() -
getAtom
-
addAtom
-
clone
-
clear
public void clear() -
isEmpty
public boolean isEmpty() -
saveXml
- Throws:
IOException
-
restoreXml
-
evaluate
Returns true if all filters resolve correctly for the given function description. There are 4 main types of filters, each of which must be evaluated differently:1) Positive Filter:
"<filter name> matches <filter value>"
. For these, filter out any result that does not contain all elements (at a minimum) of the filter value. ie: FILTER = "SetA", RESULT = "SetA" => keep it FILTER = "SetA, SetB", RESULT = "SetA" => filter out 2) Negative Filter:"<filter name> does not match <filter value>"
For these, filter out any result that does not contain EXACTLY the filter value. ie: FILTER = "SetA", RESULT = "SetA, SetB" => keep it FILTER = "SetA, SetB", RESULT = "SetA, SetB" => filter out 3) Positive Exe Filter: Same as #1, but custom exe filters are stored differently than 'normal' categories and must be processed separately. 4) Negative Exe Filter: Same as #2, but custom exe filters are stored differently than 'normal' categories and must be processed separately.- Parameters:
func
- the function description- Returns:
- true if all filters resolve to true
-
replaceWith
-
getFilterEntries
-