public interface

INativeDecompilerExtension

implements IPlugin
com.pnfsoftware.jeb.core.units.code.asm.decompiler.INativeDecompilerExtension
Known Indirect Subclasses

Class Overview

Decompiler extension plugins. Refer to AbstractNativeDecompilerExtension for additional details concerning the lifecycle of those objects.

Important notes:
- Be careful with state data stored in decompiler extensions; those plugins are shared among all decompilers (except for a decompiler primary extension)
- Methods must not return null

Summary

Public Methods
abstract ChainedOperationResult<Boolean> applyAdditionalTypes(IDecompiledMethod target, CFG<IEStatement> cfg)
This method is called by the decompiler just before type propagation on the IR-CFG takes place.
abstract ChainedOperationResult<Boolean> augmentSimulationContext(IDecompilerManager decompiler, IERoutineContext ctx, IESimulationResults simulationContext, long offset, IEStatement insn, EState state)
This method is called during the early simulation phase (unoptimized IR emulation) in the decompilation pipeline.
abstract ChainedOperationResult<Boolean> convertInstruction(IEConverter<?> converter, IERoutineContext ctx, ConverterInstructionEntry<?> e)
Convert a native instruction to IR code.
abstract ChainedOperationResult<Boolean> convertToInlinedCall(IEConverter<?> converter, IERoutineContext ctx, ConverterInstructionEntry<?> e, long target)
abstract ChainedOperationResult<Boolean> customizeIntermediateOptimizer(IDecompilerManager decompiler, IEMasterOptimizer mo)
This method is called by a decompiler unit to customize a master IR optimizer.
abstract ChainedOperationResult<DecompilationStatus> executePostPipelineStage(NativeDecompilationStage stage, IDecompiledMethod target)
Extensions may customize the decompilation pipeline by implementing this method.
abstract ChainedOperationResult<DecompilationStatus> executePrePipelineStage(NativeDecompilationStage stage, IDecompiledMethod target)
Extensions may customize the decompilation pipeline by implementing this method.
abstract ChainedOperationResult<Boolean> isMemoryResolutionAllowed(IDecompilerManager decompiler, IERoutineContext ctx, IEMem mem)
This method is called when the decompiler is attempting to dereference memory in order to replace a memory access by an actual immediate value.
abstract ChainedOperationResult<VariableArgumentInformation> resolveVariableArgumentInformation(IERoutineContext ctx, CFG<IEStatement> cfg, int iblk, IWildcardPrototype proto)
[Expand]
Inherited Methods
From interface com.pnfsoftware.jeb.core.IPlugin

Public Methods

public abstract ChainedOperationResult<Boolean> applyAdditionalTypes (IDecompiledMethod target, CFG<IEStatement> cfg)

This method is called by the decompiler just before type propagation on the IR-CFG takes place. Extensions can use it to set additional types on IR expressions.

public abstract ChainedOperationResult<Boolean> augmentSimulationContext (IDecompilerManager decompiler, IERoutineContext ctx, IESimulationResults simulationContext, long offset, IEStatement insn, EState state)

This method is called during the early simulation phase (unoptimized IR emulation) in the decompilation pipeline. Extensions can provide additional details to enhance further decompilation stages.

For an example of this method, refer to the MIPS decompiler primary extension code.

Parameters
simulationContext simulation context, the extension may record information in this context
offset IR offset
insn IR instruction
state input pre-execution state at the provided instruction

public abstract ChainedOperationResult<Boolean> convertInstruction (IEConverter<?> converter, IERoutineContext ctx, ConverterInstructionEntry<?> e)

Convert a native instruction to IR code. It is the responsibility of native code converters to decide whether they want to call this method, before attempting to convert the instruction themselves. Extensions implementing this method have a chance to provide alternate conversion of low-level instructions or even provide conversion support for instructions not supported by a converter.

Parameters
e the entry to be converted, holding references to the IInstruction and current state of the IR basic block
Returns
  • success indicator - upon success, an extension must return TRUE/STOP, else another conversion will be attempted, leading to undefined behavior

public abstract ChainedOperationResult<Boolean> convertToInlinedCall (IEConverter<?> converter, IERoutineContext ctx, ConverterInstructionEntry<?> e, long target)

public abstract ChainedOperationResult<Boolean> customizeIntermediateOptimizer (IDecompilerManager decompiler, IEMasterOptimizer mo)

This method is called by a decompiler unit to customize a master IR optimizer. Extensions may use it to change settings of the master optimizer, provide additional IR optimizers, etc.

Parameters
mo IR master optimizer

public abstract ChainedOperationResult<DecompilationStatus> executePostPipelineStage (NativeDecompilationStage stage, IDecompiledMethod target)

Extensions may customize the decompilation pipeline by implementing this method. It is called by the pipeline at the end of each stage of method decompilation.

Parameters
target the method being decompiled

public abstract ChainedOperationResult<DecompilationStatus> executePrePipelineStage (NativeDecompilationStage stage, IDecompiledMethod target)

Extensions may customize the decompilation pipeline by implementing this method. It is called by the pipeline at the beginning of each stage of method decompilation.

Parameters
target the method being decompiled

public abstract ChainedOperationResult<Boolean> isMemoryResolutionAllowed (IDecompilerManager decompiler, IERoutineContext ctx, IEMem mem)

This method is called when the decompiler is attempting to dereference memory in order to replace a memory access by an actual immediate value. Extension can prevent a resolution that could normally take place.

public abstract ChainedOperationResult<VariableArgumentInformation> resolveVariableArgumentInformation (IERoutineContext ctx, CFG<IEStatement> cfg, int iblk, IWildcardPrototype proto)