public class

EPatternMatcher

extends Object
java.lang.Object
   ↳ com.pnfsoftware.jeb.core.units.code.asm.decompiler.ir.compiler.EPatternMatcher

Class Overview

IR pattern search and replace.

Current limitation: matching is limited by basic block boundaries.

Summary

Nested Classes
class EPatternMatcher.Result Result object provided by a EPatternMatcher
Public Constructors
EPatternMatcher(EPatternCompiler.EPattern pattern, CFG<IEStatement> cfg, IERoutineContext ctx)
EPatternMatcher(EPatternCompiler.EPattern pattern, IEGeneric exp, IERoutineContext ctx)
Public Methods
IERoutineContext getContext()
Map<IEGeneric, Integer> getIRDepthsMap()
CFG<IEStatement> getInputCfg()
IEGeneric getInputExpression()
long getMatchAddress(EPatternMatcher.Result result, int index)
EPatternCompiler.EPattern getPattern()
boolean isAllowDeepAssociativity()
boolean replace(EPatternMatcher.Result r, boolean preferBuiltinReplacer)
EPatternMatcher.Result search(EPatternMatcher.Result lastResult)
EPatternMatcher.Result search()
EPatternMatcher.Result searchAndReplace()
EPatternMatcher.Result searchAndReplace(EPatternMatcher.Result lastResult)
int searchAndReplaceAll(Result[] aresult)
int searchAndReplaceAll()
void setAllowDeepAssociativity(boolean allowDeepAssociativity)
Allow to modify inner expression to check alternative associativity.
void setIRDepthsMap(Map<IEGeneric, Integer> iRDepthsMap)
String toString()
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public EPatternMatcher (EPatternCompiler.EPattern pattern, CFG<IEStatement> cfg, IERoutineContext ctx)

public EPatternMatcher (EPatternCompiler.EPattern pattern, IEGeneric exp, IERoutineContext ctx)

Public Methods

public IERoutineContext getContext ()

public Map<IEGeneric, Integer> getIRDepthsMap ()

public CFG<IEStatement> getInputCfg ()

public IEGeneric getInputExpression ()

public long getMatchAddress (EPatternMatcher.Result result, int index)

public EPatternCompiler.EPattern getPattern ()

public boolean isAllowDeepAssociativity ()

public boolean replace (EPatternMatcher.Result r, boolean preferBuiltinReplacer)

public EPatternMatcher.Result search (EPatternMatcher.Result lastResult)

public EPatternMatcher.Result search ()

public EPatternMatcher.Result searchAndReplace ()

public EPatternMatcher.Result searchAndReplace (EPatternMatcher.Result lastResult)

public int searchAndReplaceAll (Result[] aresult)

Parameters
aresult (optional) last successful search-and-replace

public int searchAndReplaceAll ()

public void setAllowDeepAssociativity (boolean allowDeepAssociativity)

Allow to modify inner expression to check alternative associativity. For example, matching V0 * (#1 + $2) on r0 * ((r1 + 4) + r2) will attempt any associativity, matching on

 V0 = r0
 #1 = 4
 $2 = (r1 + r2)
 
even if (r1 + r2) does not exists in inner expression.

public void setIRDepthsMap (Map<IEGeneric, Integer> iRDepthsMap)

public String toString ()