Interface IOptimizer<T extends IOptimizerTarget>
- All Superinterfaces:
IPlugin
- All Known Subinterfaces:
ICOptimizer,IEOptimizer
- All Known Implementing Classes:
AbstractCBlockOptimizer,AbstractCElementOptimizer,AbstractCOptimizer,AbstractCStatementOptimizer,AbstractEBlockOptimizer,AbstractEExpressionOptimizer,AbstractEOptimizer,AbstractEPatternOptimizer,AbstractEStatementOptimizer,AbstractOptimizer
Plugin interface for generic code optimizer. This interface is currently used to define IR and
AST optimizers used by JEB Native Analysis Pipeline components. Optimizers are managed and
invoked by a
master-optimizer.
Refer to the two specialized interfaces, IEOptimizer for IR codes; ICOptimizer
for AST trees.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringA well-known optimizer tag used to indicate that an optimizer is removing code it deems useless or dead.static final StringA well-known optimizer tag used to indicate that an optimizer is categorized as an explicit deobfuscator.static final doubleA priority value well-suited for high-priority optimizers.static final doubleA priority value well-suited for low-priority optimizers.static final doubleA priority value well-suited for normal-priority optimizers. -
Method Summary
Modifier and TypeMethodDescriptionRetrieve the optional master optimizer that manages this optimizer.intThis method is used for on-demand optimizers only.doubleGet the optimizer priority.Specify the minimum bar requested from the orchestrator in order to run.getTags()Get the optimizer tags.getType()Retrieve the type of this optimizer.intperformOnTarget(T target) Perform the optimization pass.voidSet an optional master optimizer that manages this optimizer.Methods inherited from interface com.pnfsoftware.jeb.core.IPlugin
dispose, getData, getPluginInformation, setData
-
Field Details
-
DEOBFUSCATOR
A well-known optimizer tag used to indicate that an optimizer is categorized as an explicit deobfuscator.- See Also:
-
DEAD_CODE_REMOVER
A well-known optimizer tag used to indicate that an optimizer is removing code it deems useless or dead.- See Also:
-
PRIORITY_LOW
static final double PRIORITY_LOWA priority value well-suited for low-priority optimizers.- See Also:
-
PRIORITY_STANDARD
static final double PRIORITY_STANDARDA priority value well-suited for normal-priority optimizers.- See Also:
-
PRIORITY_HIGH
static final double PRIORITY_HIGHA priority value well-suited for high-priority optimizers.- See Also:
-
-
Method Details
-
getRequiredModeThreshold
OptimizerMode getRequiredModeThreshold()Specify the minimum bar requested from the orchestrator in order to run. If that bar is not met, the orchestrator should not run the optimizer. Refer toAbstractMasterOptimizerfor existing thresholds.- Returns:
-
getType
OptimizerType getType()Retrieve the type of this optimizer.- Returns:
-
getTags
Get the optimizer tags. An optimizer may have 0, 1, or more tags. A tag is a non-null, non-empty string.- Returns:
- a collection of tags; may be empty (tags are optional), but never null
-
getPreferredExecutionStage
int getPreferredExecutionStage()This method is used for on-demand optimizers only.- Returns:
-
getPriority
double getPriority()Get the optimizer priority. A higher value means higher priority. Priorities are used bymaster optimizersto order optimizers.- Returns:
- the optimizer priority
-
getMasterOptimizer
IMasterOptimizer<T> getMasterOptimizer()Retrieve the optional master optimizer that manages this optimizer.- Returns:
- optional reference
-
setMasterOptimizer
Set an optional master optimizer that manages this optimizer.- Parameters:
mo- optional
-
performOnTarget
Perform the optimization pass.- Parameters:
target-- Returns:
- the number of optimizations performed; if negative, an error has occurred and the optimizing process should be aborted
-