Class EExpressionMatcher
java.lang.Object
com.pnfsoftware.jeb.core.units.code.asm.decompiler.ir.compiler.EExpressionMatcher
Match an IR expression against an IR template.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionEExpressionMatcher
(INode template) Create an IRE matcher.EExpressionMatcher
(INode template, Map<Integer, Object> initmap) Create an IRE matcher. -
Method Summary
Modifier and TypeMethodDescriptionRetrieve the match map:
- Key= leaf id
- Value= matched IRE (IEgeneric) for leaves or operator (OperationType) for operator groups.boolean
boolean
void
reset()
void
reset
(boolean keepMatches) void
setAllowDeepAssociativity
(boolean allowDeepAssociativity) Use an operator's associativity to achieve better matching.void
setIRDepthsMap
(Map<IEGeneric, Integer> IRDepthsMap) toString()
-
Field Details
-
verbose
public static boolean verbose
-
-
Constructor Details
-
EExpressionMatcher
Create an IRE matcher.- Parameters:
template
- the template to match an expression againstinitmap
- an optional, initial match map
-
EExpressionMatcher
Create an IRE matcher.- Parameters:
template
- the template to match an expression against
-
-
Method Details
-
setAllowDeepAssociativity
public void setAllowDeepAssociativity(boolean allowDeepAssociativity) Use an operator's associativity to achieve better matching. For example, matchingV0 * (#1 + $2)
onr0 * ((r1 + 4) + r2)
could match on:V0 = r0 #1 = 4 $2 = (r1 + r2)
even if (r1 + r2) does not exists in inner expression.- Parameters:
allowDeepAssociativity
-
-
isAllowDeepAssociativity
public boolean isAllowDeepAssociativity() -
setIRDepthsMap
-
getIRDepthsMap
-
getMatchMap
Retrieve the match map:
- Key= leaf id
- Value= matched IRE (IEgeneric) for leaves or operator (OperationType) for operator groups.- Returns:
-
reset
public void reset(boolean keepMatches) -
reset
public void reset() -
isMatch
-
toString
-