public interface

IOptimizer

implements IPlugin
com.pnfsoftware.jeb.core.units.code.asm.decompiler.opt.IOptimizer<T extends com.pnfsoftware.jeb.core.units.code.asm.decompiler.opt.IOptimizerTarget>
Known Indirect Subclasses

Class Overview

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.

Summary

Constants
String DEAD_CODE_REMOVER A well-known optimizer tag used to indicate that an optimizer is removing code it deems useless or dead.
String DEOBFUSCATOR A well-known optimizer tag used to indicate that an optimizer is categorized as an explicit deobfuscator.
double PRIORITY_HIGH A priority value well-suited for high-priority optimizers.
double PRIORITY_LOW A priority value well-suited for low-priority optimizers.
double PRIORITY_STANDARD A priority value well-suited for normal-priority optimizers.
Public Methods
abstract IMasterOptimizer<T> getMasterOptimizer()
Retrieve the optional master optimizer that manages this optimizer.
abstract int getPreferredExecutionStage()
This method is used for on-demand optimizers only.
abstract double getPriority()
Get the optimizer priority.
abstract OptimizerMode getRequiredModeThreshold()
Specify the minimum bar requested from the orchestrator in order to run.
abstract Set<String> getTags()
Get the optimizer tags.
abstract OptimizerType getType()
Retrieve the type of this optimizer.
abstract int performOnTarget(T target)
Perform the optimization pass.
abstract void setMasterOptimizer(IMasterOptimizer<T> mo)
Set an optional master optimizer that manages this optimizer.
[Expand]
Inherited Methods
From interface com.pnfsoftware.jeb.core.IPlugin

Constants

public static final String DEAD_CODE_REMOVER

A well-known optimizer tag used to indicate that an optimizer is removing code it deems useless or dead.

Constant Value: "dcr"

public static final String DEOBFUSCATOR

A well-known optimizer tag used to indicate that an optimizer is categorized as an explicit deobfuscator.

Constant Value: "deobfuscator"

public static final double PRIORITY_HIGH

A priority value well-suited for high-priority optimizers.

Constant Value: 10.0

public static final double PRIORITY_LOW

A priority value well-suited for low-priority optimizers.

Constant Value: -10.0

public static final double PRIORITY_STANDARD

A priority value well-suited for normal-priority optimizers.

Constant Value: 0.0

Public Methods

public abstract IMasterOptimizer<T> getMasterOptimizer ()

Retrieve the optional master optimizer that manages this optimizer.

Returns
  • optional reference

public abstract int getPreferredExecutionStage ()

This method is used for on-demand optimizers only.

public abstract double getPriority ()

Get the optimizer priority. A higher value means higher priority. Priorities are used by master optimizers to order optimizers.

Returns
  • the optimizer priority

public abstract 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 to AbstractMasterOptimizer for existing thresholds.

public abstract Set<String> 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

public abstract OptimizerType getType ()

Retrieve the type of this optimizer.

public abstract int performOnTarget (T target)

Perform the optimization pass.

Returns
  • the number of optimizations performed; if negative, an error has occurred and the optimizing process should be aborted

public abstract void setMasterOptimizer (IMasterOptimizer<T> mo)

Set an optional master optimizer that manages this optimizer.

Parameters
mo optional