public interface

IEGlobalContext

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

Summary

Public Methods
abstract void addRoutineContext(IERoutineContext ctx)
Register a routine context with this global context.
abstract EState buildEmptyState()
Create a machine state for IR emulation.
abstract EState buildState(boolean initRegisters, boolean initSymbols, boolean initGlobals)
Create a machine state for IR emulation.
abstract EState buildState()
Create a machine state for IR emulation with all defined registers, symbols, and globals reset to 0.
abstract boolean canCreateVariable(int id, int bitsize)
abstract IEBranchDetails createBranchDetails(List<IEVar> def, List<IEVar> use, List<IEVar> spoiled, int fallbackStackPointerDelta, IPrototypeItem nativePrototypeHint, List<IBranchTarget> dynamicTargetCandidates)
Create basic branch details information.
abstract IEBranchDetails createBranchDetails(List<IEVar> def, List<IEVar> use, List<IEVar> spoiled, int fallbackStackPointerDelta)
Create basic branch details information.
abstract IECompose createCompose(Collection<IEGeneric> elts)
abstract IECompose createCompose(IEGeneric... elts)
abstract IECond createCond(IEGeneric p, IEGeneric a, IEGeneric b)
abstract IEOperation createConversionOperation(OperationType convOperator, IEGeneric src, int dstSize)
Create a conversion operation: an integer truncation, integer extension (zero or signed), float truncation or extension, float-to-int and int-to-float conversion.
abstract IEVar createGlobalReference(String name, Long address)
abstract IEVar createGlobalVariable(long address, int bitsize)
Create a global, memory-mapped variable.
abstract IEGroupElt createGroupElt(IEGroup collection, IEGeneric index)
abstract IEImm createImm(double v)
abstract IEImm createImm(BigInteger v, int bitsize)
abstract IEImm createImm(float v)
abstract IEImm createImm(long v, int bitsize)
abstract IEImm createImm(byte[] v, int bitsize)
abstract IEImm createImm(String v, int bitsize)
abstract IEMem createMem(IEGeneric segment, IEGeneric opaddr, int bitsize)
abstract IEMem createMem(IEGeneric opaddr, int bitsize)
abstract IEOperation createOperation(OperationType optype, IEGeneric op1)
abstract IEOperation createOperation(OperationType optype, IEGeneric op1, IEGeneric op2)
abstract IERange createRange(int begin, int end)
abstract IEVar createRegister(int id, String name, int bitsize)
Create a physical register with a manually assigned id (use with care).
abstract IEVar createRegister(String name, int bitsize)
Create a physical register.
abstract IEOperation createResizeOperation(IEGeneric opnd, int bitsize, boolean signed)
Create a resize operation operation: truncation, zero-extension, or sign-extension.
abstract IERoutineContext createRoutineContext(INativeMethodItem routine)
Create a new routine context.
abstract IERoutineContext createRoutineContext()
Create a new routine-less routine context.
abstract IESlice createSlice(IEGeneric e, IERange range)
abstract IESlice createSlice(IEGeneric e, int bitstart, int bitend)
abstract IEVar createSymbolForData(INativeDataItem data, IERoutineContext userctx)
abstract IEVar createSymbolForRoutine(INativeMethodItem routine, IERoutineContext userctx)
abstract IEVar createVirtualRegister(int id, String name, int bitsize)
Create a virtual register with a manually assigned id (use with care).
abstract IEVar createVirtualRegister(String name, int bitsize)
Create a virtual register.
abstract int getAddressBitsize()
abstract Collection<IEVar> getAllRegisters()
abstract Collection<IEVar> getAllRegisters(Set<Integer> exclusions)
abstract Collection<IEVar> getAllVariables()
abstract IWildcardPrototype getCandidatePrototype(INativeMethodItem routine)
abstract AbstractConverter<?> getConverter()
abstract Object getData(Object key)
Retrieve a piece of transient data.
abstract IEVar getGlobalVariable(long address)
abstract Collection<IEVar> getGlobalVariables()
Retrieve the list of globals (memory) variables defined in this context.
abstract INativeContext getNativeContext()
abstract IVirtualMemory getNativeMemory()
Convenience method.
abstract INativeObjectTracker getObjectTracker()
abstract int getRegisterBitsize()
abstract IERoutineContext getRoutineContext(int index)
abstract List<IERoutineContext> getRoutineContexts()
Retrieve a list of all converted routines.
abstract IEVar getVar(int id)
Retrieve a global context EVar by id.
abstract IEVar getVarSafe(int id)
abstract IEVar getVariableByName(String name)
Retrieve a global-scope variable by name.
abstract Collection<IEVar> getVariables(int idStart, int idEnd)
abstract IWildcardTypeManager getWildcardTypeManager()
abstract boolean isBigEndian()
abstract boolean removeRoutineContext(IERoutineContext ctx, boolean stopTrackingNativeDeps)
Delete a converted routine.
abstract INativeDataItem retrieveDataFromSymbol(IEVar var)
abstract INativeMethodItem retrieveRoutineFromSymbol(IEVar var)
abstract boolean setCandidatePrototype(INativeMethodItem routine, IWildcardPrototype proto, int guarantee)
abstract void setData(Object key, Object value)
Store a piece of transient data.

Public Methods

public abstract void addRoutineContext (IERoutineContext ctx)

Register a routine context with this global context.

public abstract EState buildEmptyState ()

Create a machine state for IR emulation.

Same as buildState(false, false, false)

Returns
  • a fresh state

public abstract EState buildState (boolean initRegisters, boolean initSymbols, boolean initGlobals)

Create a machine state for IR emulation.

Parameters
initRegisters initialize all global EVar-registers to 0
initSymbols initialize all global symbols EVars to 0
initGlobals initialize all global memory EVars to 0
Returns
  • a fresh state

public abstract EState buildState ()

Create a machine state for IR emulation with all defined registers, symbols, and globals reset to 0.

Same as buildState(true, true, true)

Returns
  • a fresh state

public abstract boolean canCreateVariable (int id, int bitsize)

public abstract IEBranchDetails createBranchDetails (List<IEVar> def, List<IEVar> use, List<IEVar> spoiled, int fallbackStackPointerDelta, IPrototypeItem nativePrototypeHint, List<IBranchTarget> dynamicTargetCandidates)

Create basic branch details information.

public abstract IEBranchDetails createBranchDetails (List<IEVar> def, List<IEVar> use, List<IEVar> spoiled, int fallbackStackPointerDelta)

Create basic branch details information.

Parameters
fallbackStackPointerDelta the provided SP delta will have unknown guarantee and unknown origin

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 IEOperation createConversionOperation (OperationType convOperator, IEGeneric src, int dstSize)

Create a conversion operation: an integer truncation, integer extension (zero or signed), float truncation or extension, float-to-int and int-to-float conversion.

Parameters
convOperator one of for which isConversion() returns true (eg, CAST, CAST_S, FP2FP, FP2INT, INT2FP)
src operand to be extended, truncated, or converted
dstSize resulting bitsize
Returns
  • the operation IRE

public abstract IEVar createGlobalReference (String name, Long address)

public abstract IEVar createGlobalVariable (long address, int bitsize)

Create a global, memory-mapped variable.

public abstract IEGroupElt createGroupElt (IEGroup collection, IEGeneric index)

public abstract IEImm createImm (double v)

public abstract IEImm createImm (BigInteger v, int bitsize)

public abstract IEImm createImm (float v)

public abstract IEImm createImm (long v, int bitsize)

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

public abstract IEImm createImm (String v, int bitsize)

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

public abstract IEMem createMem (IEGeneric opaddr, int bitsize)

public abstract IEOperation createOperation (OperationType optype, IEGeneric op1)

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

public abstract IERange createRange (int begin, int end)

public abstract IEVar createRegister (int id, String name, int bitsize)

Create a physical register with a manually assigned id (use with care). Shared across routines boundaries. No address, no type.

public abstract IEVar createRegister (String name, int bitsize)

Create a physical register. Shared across routines boundaries. No address, no type.

public abstract IEOperation createResizeOperation (IEGeneric opnd, int bitsize, boolean signed)

Create a resize operation operation: truncation, zero-extension, or sign-extension.

Parameters
opnd the source to be extended (dstSize > srcSize) or truncated (dstSize < srcSize)
bitsize the destination size; should be different than the source's
signed for extensions, else N/A
Returns
  • the operation IRE

public abstract IERoutineContext createRoutineContext (INativeMethodItem routine)

Create a new routine context. The newly created routine context is not attached to this global context. Use addRoutineContext(IERoutineContext) to add it to the global context.

public abstract IERoutineContext createRoutineContext ()

Create a new routine-less routine context. The newly created routine context is not attached to this global context. Use addRoutineContext(IERoutineContext) to add it to the global context.

public abstract IESlice createSlice (IEGeneric e, IERange range)

public abstract IESlice createSlice (IEGeneric e, int bitstart, int bitend)

public abstract IEVar createSymbolForData (INativeDataItem data, IERoutineContext userctx)

public abstract IEVar createSymbolForRoutine (INativeMethodItem routine, IERoutineContext userctx)

public abstract IEVar createVirtualRegister (int id, String name, int bitsize)

Create a virtual register with a manually assigned id (use with care). Preserved/not shared across routines boundaries. No address, no type.

public abstract IEVar createVirtualRegister (String name, int bitsize)

Create a virtual register. Preserved/not shared across routines boundaries. No address, no type.

public abstract int getAddressBitsize ()

public abstract Collection<IEVar> getAllRegisters ()

public abstract Collection<IEVar> getAllRegisters (Set<Integer> exclusions)

public abstract Collection<IEVar> getAllVariables ()

public abstract IWildcardPrototype getCandidatePrototype (INativeMethodItem routine)

public abstract AbstractConverter<?> getConverter ()

public abstract Object getData (Object key)

Retrieve a piece of transient data.

public abstract IEVar getGlobalVariable (long address)

public abstract Collection<IEVar> getGlobalVariables ()

Retrieve the list of globals (memory) variables defined in this context.

public abstract INativeContext getNativeContext ()

public abstract IVirtualMemory getNativeMemory ()

Convenience method.

public abstract INativeObjectTracker getObjectTracker ()

public abstract int getRegisterBitsize ()

public abstract IERoutineContext getRoutineContext (int index)

public abstract List<IERoutineContext> getRoutineContexts ()

Retrieve a list of all converted routines.

public abstract IEVar getVar (int id)

Retrieve a global context EVar by id. Throws if does not exist.

public abstract IEVar getVarSafe (int id)

public abstract IEVar getVariableByName (String name)

Retrieve a global-scope variable by name.

Returns
  • the variable or null

public abstract Collection<IEVar> getVariables (int idStart, int idEnd)

public abstract IWildcardTypeManager getWildcardTypeManager ()

public abstract boolean isBigEndian ()

public abstract boolean removeRoutineContext (IERoutineContext ctx, boolean stopTrackingNativeDeps)

Delete a converted routine.

public abstract INativeDataItem retrieveDataFromSymbol (IEVar var)

public abstract INativeMethodItem retrieveRoutineFromSymbol (IEVar var)

public abstract boolean setCandidatePrototype (INativeMethodItem routine, IWildcardPrototype proto, int guarantee)

Parameters
guarantee use 0 for an unknown guarantee

public abstract void setData (Object key, Object value)

Store a piece of transient data.