com.pnfsoftware.jeb.core.units.code.android.ir.IDGlobalContext |
dexdec
IR global context. This object also provides factory methods to create
non-instruction elements
. (IR instructions can be created using a
method context
).
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
abstract IDArrayElt |
createArrayElt(IDExpression array, IDExpression index, IJavaType type)
Create an array element.
| ||||||||||
abstract IDInstanceField | createArrayLength(IDExpression instance) | ||||||||||
abstract IDImm |
createBoolean(boolean value)
Wrapper used to create boolean constants. | ||||||||||
abstract IDImm |
createByte(byte value)
Wrapper used to create byte constants. | ||||||||||
abstract IDNewArrayInfo | createByteArray(byte[] bytes) | ||||||||||
abstract IDCallInfo | createCallInfo(DInvokeType invoketype, int methodindex, List<IDExpression> arguments) | ||||||||||
abstract IDCallInfo | createCallInfo(IDIndex methodindex, IDExpression[] arguments, IJavaType returntype, String methodsig, DInvokeType invoketype) | ||||||||||
abstract IDCallInfo | createCallInfo(IDIndex methodindex, List<IDExpression> arguments, IJavaType returntype, String methodsig, DInvokeType invoketype) | ||||||||||
abstract IDOperation |
createCast(IJavaType casttype, IDExpression e)
Convenience operation.
| ||||||||||
abstract IDOperation |
createCastOperation(IJavaType castType, IDExpression exp)
Create a cast operation.
| ||||||||||
abstract IDImm |
createChar(char value)
Wrapper used to create char constants. | ||||||||||
abstract IDStaticField | createClassObject(String csig) | ||||||||||
abstract IDOperation |
createConditional(IDPredicate pred, IDExpression expTrue, IDExpression expFalse)
Convenience operation.
| ||||||||||
abstract IDImm |
createConstant(long rawvalue, IJavaType type)
Create immediate constants.
| ||||||||||
abstract IDImm |
createDouble(double value)
Wrapper used to create double constants. | ||||||||||
abstract IDImm |
createFloat(float value)
Wrapper used to create float constants. | ||||||||||
abstract IDImm |
createImm(long rawvalue, IJavaType type)
Create immediate constants.
| ||||||||||
abstract IDIndex |
createIndex(int value)
Create an immutable pool index value.
| ||||||||||
abstract IDInstanceField | createInstanceField(IDExpression instance, IDIndex index, IJavaType fieldtype, String fieldname) | ||||||||||
abstract IDImm |
createInt(int value)
Wrapper used to create int constants. | ||||||||||
abstract IDImm |
createLong(long value)
Wrapper used to create long constants. | ||||||||||
abstract IDMasterOptimizer |
createMasterOptimizer(IDMethodContext methodContext)
Create a pre-initialized master optimized targeting the provided method.
| ||||||||||
abstract IDMasterOptimizer |
createMasterOptimizer(IDMethodContext methodContext, boolean registerBuiltinOptimizers, boolean initializeWithDexdecSettings, boolean registerExternalOptimizers)
Create a master optimizer targeting the provided method.
| ||||||||||
abstract IDNewArrayInfo | createNewArrayInfo(IJavaType type, IDExpression size, List<IDExpression> initvals) | ||||||||||
abstract IDNewInfo | createNewInfo(IJavaType objecttype, IJavaType constclasstype, IDIndex constructorindex, List<IDExpression> arguments, String methodsig) | ||||||||||
abstract IDNewInfo |
createNewInfo(String constructorSig, IDExpression... arguments)
Convenience method to create a
new SomeObject(..) operand. | ||||||||||
abstract IDNewInfo | createNewInfo(IJavaType objecttype, IJavaType constclasstype, IDIndex constructorindex, IDExpression[] arguments, String methodsig) | ||||||||||
abstract IDImm |
createNull()
Wrapper used to create the null constant. | ||||||||||
abstract IDOperation |
createOperation(IDExpression left, IJavaOperator operator, IDExpression right)
Create an operation element, such an an arithmetic or bitwise expression, conditional, string
concatenation, or cast operation.
| ||||||||||
abstract IDOperation |
createOperation(JavaOperatorType optype, IDExpression opnd1, IDExpression opnd2)
Create an operation element, such an an arithmetic or bitwise expression, conditional, string
concatenation, or cast operation.
| ||||||||||
abstract IDPredicate |
createPredicate(JavaOperatorType optype, IDExpression opnd1, IDExpression opnd2)
Create a predicate expression.
| ||||||||||
abstract IDPredicate |
createPredicate(IDExpression left, IJavaOperator operator, IDExpression right)
Create a predicate expression.
| ||||||||||
abstract IDPredicate |
createPredicate(IDExpression e)
Create a predicate expression.
| ||||||||||
abstract IDReferenceType |
createReferenceType(String csig)
Create a reference type expression.
| ||||||||||
abstract IDReferenceType |
createReferenceType(IDIndex cindex, IJavaType ctype)
Create a reference type expression.
| ||||||||||
abstract IDImm |
createShort(short value)
Wrapper used to create short constants. | ||||||||||
abstract IDState |
createState(boolean initForEmulation, boolean loadDexdecEmuSettings)
Create a fresh IR state (~ IR emulator).
| ||||||||||
abstract IDState |
createState()
Create a fresh, uninitialized IR state (~ IR emulator).
| ||||||||||
abstract IDStaticField | createStaticField(IDIndex index, IJavaType fieldtype, String csig, String fieldname) | ||||||||||
abstract IDImm |
createString(IDIndex stringIndex)
Wrapper used to create string constants. | ||||||||||
abstract IDImm |
createString(String value)
Wrapper used to create string constants. | ||||||||||
abstract IDSwitchData |
createSwitchData()
Create a switch data element used in Switch instructions.
| ||||||||||
abstract IDTarget | createTarget(int offset) | ||||||||||
abstract IDVar |
createVar(int reg, IJavaType type)
Create a single-slot variable.
| ||||||||||
abstract IDVar |
createVar(int regLo, int regHi, IJavaType type)
Create a double-slot variable.
| ||||||||||
abstract Object |
getData(String key)
Retrieve an arbitrary object in this global context.
| ||||||||||
abstract Set<String> |
getDataKeys()
Retrieve the set of objects keys for data elements stored using
setData . | ||||||||||
abstract IDexDecompilerUnit |
getDecompiler()
Retrieve the managing dex decompiler object.
| ||||||||||
abstract IDexUnit |
getDex()
Retrieve the underlying dex unit object.
| ||||||||||
abstract IDState |
getEmulator()
Retrieve the current IR state (~ IR emulator) associated with the current thread.
| ||||||||||
abstract IJavaOperatorFactory |
getOperatorFactory()
Retrieve the global high-level operator factory.
| ||||||||||
abstract IDState |
getThreadSharedState()
Retrieve the current IR state (~ IR emulator) associated with the current thread.
| ||||||||||
abstract IJavaTypeFactory |
getTypeFactory()
Retrieve the global high-level type factory.
| ||||||||||
abstract IDTypeInfoProvider |
getTypeInfoProvider()
Retrieve the type information provider.
| ||||||||||
abstract void |
resetDeobfuscatorCounters(String entryName)
Reset deobfuscators counters, generally updated by IR optimizers that rely on IR emulation.
| ||||||||||
abstract void |
resetDeobfuscatorCounters()
Reset deobfuscators counters, generally updated by IR optimizers that rely on IR emulation.
| ||||||||||
abstract Object |
setData(String key, Object value)
Store an arbitrary object in this global context.
|
Create an array element.
Create a cast operation.
Convenience operation.
Create immediate constants. The same as createImm(long, IJavaType)
.
Create an immutable pool index value.
value | index value |
---|
Create a pre-initialized master optimized targeting the provided method. This convenience
method is equivalent to
createMasterOptimizer(ctx, true, true, true)
.
Create a master optimizer targeting the provided method.
Convenience method to create a new SomeObject(..)
operand.
Create an operation element, such an an arithmetic or bitwise expression, conditional, string concatenation, or cast operation.
Create an operation element, such an an arithmetic or bitwise expression, conditional, string concatenation, or cast operation.
Create a predicate expression.
Create a predicate expression.
Create a reference type expression.
Create a reference type expression.
Create a fresh IR state (~ IR emulator). The IR state is context-less (no
context
is created).
initForEmulation | if true, the state settings are changed to allow for IR emulation |
---|---|
loadDexdecEmuSettings | if true, the global dexdec emulator configuration file
(dexdec-emu.cfg in your plugins folder) is used to further configure the
State |
Create a fresh, uninitialized IR state (~ IR emulator). The IR state is context-less (no
context
is created). Settings are left on default
values, in particular, the maximum iteration count and duration are set to the default values
(see DEFAULT_MAX_ITERCOUNT
, DEFAULT_MAX_DURATION
). The
emulator may is disabled, sandbox is disabled, etc. The client should use the State's setters
before proceeding with emulation.
Create a switch data element used in Switch instructions.
Create a double-slot variable.
regLo | positive number, the underlying register number; physical registers have an id
less than LIM ; virtual registers have an id greater or equal then
LIM |
---|---|
regHi | the second-register value; for a variable rooted in physical registers, this id
should be equals to regLow+1 ; for virtual identifiers, it may be any
number, although regLow+1 is strongly recommended |
type | mandatory type |
Retrieve an arbitrary object in this global context.
Retrieve the set of objects keys for data elements stored using
setData
.
Retrieve the current IR state (~ IR emulator) associated with the current thread. Each thread has its own associated State: the first time this method is called by thread T, a new state object will be created; the subsequent times this method is called by thread T, the previously created state is returned.
This method also performs two important tasks:
- the first time it is called, the State is initialized with settings to allow for practical
emulation (large emulation count and timeout, emulation and sandboxing enabled, etc.)
- each time this method is called, settings from the global dexdec emulator configuration
file (dexdec-emu.cfg
in your plugins folder) is pulled and applied to the State if
they have changed
Retrieve the global high-level operator factory. The type factory can be used to create all operators, including conditionals, string concatenation, and create cast operators.
Retrieve the current IR state (~ IR emulator) associated with the current thread. Each thread has its own associated State: the first time this method is called by thread T, a new state object will be created; the subsequent times this method is called by thread T, the previously created state is returned.
Retrieve the type information provider. This provider can access additional, user-provided libraries (jar, dex) to retrieve information on types referenced but not defined in the underlying dex unit.
Reset deobfuscators counters, generally updated by IR optimizers that rely on IR emulation. Counters are used to track emulation successes and failures for methods. Some optimizers may check the counters to avoid attempting to emulate methods for which too many failures were reported. Calling this method resets such counters, allowing emulation to be re-attempted.
This method resets a specific counter.
entryName | counter name; generally, a method fully-qualified name, e.g.
Lcom/abc/Foo->bar(I)V
|
---|
Reset deobfuscators counters, generally updated by IR optimizers that rely on IR emulation. Counters are used to track emulation successes and failures for methods. Some optimizers may check the counters to avoid attempting to emulate methods for which too many failures were reported. Calling this method resets such counters, allowing emulation to be re-attempted.
This method resets all counters.
Store an arbitrary object in this global context.
key | non-null key |
---|---|
value | null means remove the entry |