public interface

IERoutineContext

com.pnfsoftware.jeb.core.units.code.asm.decompiler.IERoutineContext

Summary

Constants
String CFGTAG_FINAL
String CFGTAG_FINAL_PRENORM
String CFGTAG_STKANA
String CFGTAG_SYMBOLICALLY_SIMPLIFIED
String CFGTAG_TYPED
String CFGTAG_UNFLATTENED
Public Methods
abstract Long convertIntermediateOffset(int offset)
Conversion FROM IR offset TO native address.
abstract Long convertIntermediateOffset(int offset, boolean logConversionErrors)
abstract Long convertNativeAddress(long address, boolean logConversionErrors)
abstract Long convertNativeAddress(long address)
Conversion FROM native address to IR offset.
abstract IEAssign createAssign(IEGeneric dst, IEGeneric src)
abstract IEAssign createAssignIf(IEAssign assignTpl, IEGeneric predicate)
abstract IEAssign createBranchAssign(IEGeneric dst, IEGeneric src, boolean subroutineCall)
abstract IECall createCall(IEGeneric callsite, IEGeneric retloc, List<IEGeneric> returns, List<IEGeneric> params, int stackPointerDelta, List<IEGeneric> spoiledExpressions)
abstract IECompose createCompose(Collection<IEGeneric> elts)
abstract IECompose createCompose(IEGeneric... elts)
abstract IECond createCond(IEGeneric p, IEGeneric a, IEGeneric b)
abstract IEVar createGlobalSymbol(INativeItem item)
abstract IEImm createImm(long v, int bitsize)
abstract IEImm createImm(byte[] v, int bitsize)
abstract IEJump createJump(int branchAddress, IEGeneric condition)
abstract IEJump createJump(int branchAddress)
abstract IEJumpFar createJumpFar(IEGeneric jumpSite, IEGeneric condition)
abstract IEJumpFar createJumpFar(IEGeneric jumpSite)
abstract IEMem createMem(IEGeneric segment, IEGeneric opaddr, int bitsize)
abstract IEMem createMem(IEGeneric opaddr, int bitsize)
abstract IENop createNop()
abstract IENop createNop(IEStatement template)
abstract IEOperation createOperation(OperationType optype, IEGeneric op1)
abstract IEOperation createOperation(OperationType optype, IEGeneric op1, IEGeneric op2)
abstract IEReturn createReturn(IEGeneric value)
abstract IEReturn createReturn()
abstract IEReturn createReturn(List<IEGeneric> values)
abstract IESwitch createSwitch(IEGeneric controlExpression, int defaultAddress)
abstract IEUntranslatedInstruction createUntranslatedInstruction(long nativeAddress, String nativeMnemonic, IEGeneric... irOperands)
abstract IEVar createVar(String name, int bitsize)
Create or retrieve a special routine-scope variable.
abstract IEVar createVirtualVar(String name, int bitsize)
Create or retrieve a virtual routine-scope variable.
abstract CFG<IEStatement> getCfg(String tag)
abstract CFG<IEStatement> getCfg()
abstract String getCfgDefaultTag()
abstract INativeDecompilerUnit<?> getDecompiler()
abstract IEGlobalContext getGlobalContext()
abstract int getProgramCounterId()
Convenience method.
abstract INativeMethodItem getRoutine()
abstract INativeMethodDataItem getRoutineData()
abstract int getStackPointerId()
Convenience method.
abstract List<IEStatement> getStatements()
Retrieve the raw list of converted IR-statements.
abstract ITypeManager getTypeManager()
abstract IEVar getVariableByName(String name)
Retrieve a routine-scope variable by name.
abstract IWildcardTypeManager getWildcardTypeManager()
abstract boolean isKeepingNonDefaultCfgs()
abstract boolean isTyped()
abstract void registerAdditionalConvertedAddress(long nativeAddress, int expectedOffset)
abstract void registerConvertedAddress(long nativeAddress, int intermediateOffset)
abstract void registerConvertedAddressRange(long nativeAddress, int intermediateOffset, int interOffsetEnd)
abstract void setCfg(String tag, CFG<IEStatement> cfg, boolean makeDefault)
abstract void setCfgDefaultTag(String tag)
abstract void setStatements(List<IEStatement> statements, boolean verify, boolean buildCfg)

Constants

public static final String CFGTAG_FINAL

Constant Value: "final"

public static final String CFGTAG_FINAL_PRENORM

Constant Value: "finalPrenorm"

public static final String CFGTAG_STKANA

Constant Value: "stkana"

public static final String CFGTAG_SYMBOLICALLY_SIMPLIFIED

Constant Value: "symbolicallySimplified"

public static final String CFGTAG_TYPED

Constant Value: "typed"

public static final String CFGTAG_UNFLATTENED

Constant Value: "unflattened"

Public Methods

public abstract Long convertIntermediateOffset (int offset)

Conversion FROM IR offset TO native address.

Parameters
offset IR offset
Returns
  • physical address or null on error

public abstract Long convertIntermediateOffset (int offset, boolean logConversionErrors)

public abstract Long convertNativeAddress (long address, boolean logConversionErrors)

public abstract Long convertNativeAddress (long address)

Conversion FROM native address to IR offset. The IR offset is an int, but returned as a long to conveniently manipulate it with IInstruction.

Parameters
address physical address
Returns
  • IR offset or null on error

public abstract IEAssign createAssign (IEGeneric dst, IEGeneric src)

public abstract IEAssign createAssignIf (IEAssign assignTpl, IEGeneric predicate)

public abstract IEAssign createBranchAssign (IEGeneric dst, IEGeneric src, boolean subroutineCall)

public abstract IECall createCall (IEGeneric callsite, IEGeneric retloc, List<IEGeneric> returns, List<IEGeneric> params, int stackPointerDelta, List<IEGeneric> spoiledExpressions)

public abstract IECompose createCompose (Collection<IEGeneric> elts)

public abstract IECompose createCompose (IEGeneric... elts)

public abstract IECond createCond (IEGeneric p, IEGeneric a, IEGeneric b)

public abstract IEVar createGlobalSymbol (INativeItem item)

public abstract IEImm createImm (long v, int bitsize)

public abstract IEImm createImm (byte[] v, int bitsize)

public abstract IEJump createJump (int branchAddress, IEGeneric condition)

public abstract IEJump createJump (int branchAddress)

public abstract IEJumpFar createJumpFar (IEGeneric jumpSite, IEGeneric condition)

public abstract IEJumpFar createJumpFar (IEGeneric jumpSite)

public abstract IEMem createMem (IEGeneric segment, IEGeneric opaddr, int bitsize)

public abstract IEMem createMem (IEGeneric opaddr, int bitsize)

public abstract IENop createNop ()

public abstract IENop createNop (IEStatement template)

public abstract IEOperation createOperation (OperationType optype, IEGeneric op1)

public abstract IEOperation createOperation (OperationType optype, IEGeneric op1, IEGeneric op2)

public abstract IEReturn createReturn (IEGeneric value)

public abstract IEReturn createReturn ()

public abstract IEReturn createReturn (List<IEGeneric> values)

public abstract IESwitch createSwitch (IEGeneric controlExpression, int defaultAddress)

public abstract IEUntranslatedInstruction createUntranslatedInstruction (long nativeAddress, String nativeMnemonic, IEGeneric... irOperands)

public abstract IEVar createVar (String name, int bitsize)

Create or retrieve a special routine-scope variable. The varible id is in the [SPECIAL, SPECIAL_END] range.

Clients should avoid using this method. Non-stack routine-scope variables created by third-party code should generally be in the VIRTUAL range. See the createVirtualVar(String, int) method.

public abstract IEVar createVirtualVar (String name, int bitsize)

Create or retrieve a virtual routine-scope variable. The varible id is in the [VIRTUAL, VIRTUAL_END] range.

public abstract CFG<IEStatement> getCfg (String tag)

public abstract CFG<IEStatement> getCfg ()

public abstract String getCfgDefaultTag ()

public abstract INativeDecompilerUnit<?> getDecompiler ()

public abstract IEGlobalContext getGlobalContext ()

public abstract int getProgramCounterId ()

Convenience method.

public abstract INativeMethodItem getRoutine ()

public abstract INativeMethodDataItem getRoutineData ()

public abstract int getStackPointerId ()

Convenience method.

public abstract List<IEStatement> getStatements ()

Retrieve the raw list of converted IR-statements. Beware: this list gets stale very quickly, as the decompiler deals with and optimizes an IR-CFG (initially built from this list), instead.

Returns
  • the initial IR-statements raw list

public abstract ITypeManager getTypeManager ()

public abstract IEVar getVariableByName (String name)

Retrieve a routine-scope variable by name.

Returns
  • the variable or null

public abstract IWildcardTypeManager getWildcardTypeManager ()

public abstract boolean isKeepingNonDefaultCfgs ()

public abstract boolean isTyped ()

public abstract void registerAdditionalConvertedAddress (long nativeAddress, int expectedOffset)

public abstract void registerConvertedAddress (long nativeAddress, int intermediateOffset)

public abstract void registerConvertedAddressRange (long nativeAddress, int intermediateOffset, int interOffsetEnd)

public abstract void setCfg (String tag, CFG<IEStatement> cfg, boolean makeDefault)

public abstract void setCfgDefaultTag (String tag)

public abstract void setStatements (List<IEStatement> statements, boolean verify, boolean buildCfg)