| com.pnfsoftware.jeb.core.units.code.asm.decompiler.IEGlobalContext |
Global IR context. A native decompiler instance holds a single global IR context. The global context is also a factory for non-local IR objects, such as IR constants or IR operations.
| 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)
Create a composition of IR elements.
| ||||||||||
| 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 FunctionOptype |
createFunctionType(String name, int flags, int minOpndCount, int maxOpndCount, int resultBitsize)
Create a new function operation type.
| ||||||||||
| abstract IEVar |
createGlobalReference(String name, Long address)
Create or retrieve a variable referencing a global element.
| ||||||||||
| 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(FunctionOptype functionOptype, IEGeneric... opnds) | ||||||||||
| 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 FunctionOptype |
getFunctionType(String name)
Retrieve a function operation type by name.
| ||||||||||
| 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
IEVar 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.
| ||||||||||
Register a routine context with this global context.
Create a machine state for IR emulation.
Same as buildState(false, false, false)
Create a machine state for IR emulation.
| initRegisters | initialize all global IEVar-registers to 0 |
|---|---|
| initSymbols | initialize all global symbols IEVars to 0 |
| initGlobals | initialize all global memory IEVars to 0 |
Create a machine state for IR emulation with all defined registers, symbols, and globals reset to 0.
Same as buildState(true, true, true)
Create basic branch details information.
Create basic branch details information.
| fallbackStackPointerDelta | the provided SP delta will have unknown guarantee and unknown origin |
|---|
Create a composition of IR elements.
| elts | at least two elements, from lowest-significant to highest-significant |
|---|
Create a conversion operation: an integer truncation, integer extension (zero or signed), float truncation or extension, float-to-int and int-to-float conversion.
| 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 |
Create a new function operation type.
| name | function name (cannot be blank) |
|---|---|
| flags | function flags, see FLAG_xxx in FunctionOptype for a list of
legal flags |
| minOpndCount | 0+ |
| maxOpndCount | 0+ |
| resultBitsize | leave to 0 to signify that the resulting bitsize must be the same as the first operand's (in which case minOpndCount must be at least 1), else a valid positive bitsize must be specified |
Create or retrieve a variable referencing a global element. Reference variables cannot be assigned to. The reference is not tracked.
| name | optional name |
|---|---|
| address | optional address referenced (e.g. if the reference is a concrete data element); if the name is null, an address must be specified |
Create a global, memory-mapped variable.
Create a physical register with a manually assigned id (use with care). Shared across routines boundaries. No address, no type.
Create a physical register. Shared across routines boundaries. No address, no type.
Create a resize operation operation: truncation, zero-extension, or sign-extension.
| 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 |
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.
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.
Create a virtual register with a manually assigned id (use with care). Preserved/not shared across routines boundaries. No address, no type.
Create a virtual register. Preserved/not shared across routines boundaries. No address, no type.
Retrieve a piece of transient data.
Retrieve a function operation type by name.
| name | function name |
|---|
Retrieve the list of globals (memory) variables defined in this context.
Retrieve a list of all converted routines.
Retrieve a global context IEVar by id. Throws if does not exist.
Retrieve a global-scope variable by name.
Delete a converted routine.
| guarantee | use 0 for an unknown guarantee |
|---|
Store a piece of transient data.