Class EPatternMatcher
java.lang.Object
com.pnfsoftware.jeb.core.units.code.asm.decompiler.ir.compiler.EPatternMatcher
IR pattern search and replace.
Current limitation: matching is limited by basic block boundaries.
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionEPatternMatcher
(EPatternCompiler.EPattern pattern, CFG<IEStatement> cfg, IERoutineContext ctx) EPatternMatcher
(EPatternCompiler.EPattern pattern, IEGeneric exp, IERoutineContext ctx) -
Method Summary
Modifier and TypeMethodDescriptionlong
getMatchAddress
(EPatternMatcher.Result result, int index) boolean
boolean
replace
(EPatternMatcher.Result r, boolean preferBuiltinReplacer) search()
search
(EPatternMatcher.Result lastResult) searchAndReplace
(EPatternMatcher.Result lastResult) int
int
searchAndReplaceAll
(EPatternMatcher.Result[] aresult) void
setAllowDeepAssociativity
(boolean allowDeepAssociativity) Allow to modify inner expression to check alternative associativity.void
setIRDepthsMap
(Map<IEGeneric, Integer> iRDepthsMap) toString()
-
Constructor Details
-
EPatternMatcher
public EPatternMatcher(EPatternCompiler.EPattern pattern, CFG<IEStatement> cfg, IERoutineContext ctx) -
EPatternMatcher
-
-
Method Details
-
getPattern
-
getContext
-
getInputCfg
-
getInputExpression
-
isAllowDeepAssociativity
public boolean isAllowDeepAssociativity() -
setAllowDeepAssociativity
public void setAllowDeepAssociativity(boolean allowDeepAssociativity) Allow to modify inner expression to check alternative associativity. For example, matchingV0 * (#1 + $2)
onr0 * ((r1 + 4) + r2)
will attempt any associativity, matching onV0 = r0 #1 = 4 $2 = (r1 + r2)
even if (r1 + r2) does not exists in inner expression.- Parameters:
allowDeepAssociativity
-
-
setIRDepthsMap
-
getIRDepthsMap
-
toString
-
search
-
search
-
searchAndReplace
-
searchAndReplace
-
replace
-
searchAndReplaceAll
public int searchAndReplaceAll()- Returns:
-
searchAndReplaceAll
- Parameters:
aresult
- (optional) last successful search-and-replace- Returns:
-
getMatchAddress
- Parameters:
result
-index
-- Returns:
-