Package com.pnfsoftware.jeb.core.units.code.android.ir
package com.pnfsoftware.jeb.core.units.code.android.ir
This package contains types used to publicly access and manipulate JEB's DEX Decompiler (referred
to as
Additional resources: refer to the User Manual and Technical Blogs, at https://www.pnfsoftware.com.
dexdec
) Intermediate Representation (IR) objects. Users can use this API to write
custom IR optimizers, that will be run by dexdec
when decompiling code. Interfaces and
classes/enums in this package start with ID...
or D...
, respectively -- for
"(Interface) dexdec
" (or dex/dalvik)). Exception classes are named
DexDec...Exception
.
Design note: Note the symmetry with JEB's Generic Decompiler (gendec
) naming
conventions, whose public interfaces and types start with IE...
or E...
. That
symmetry does not extend to naming only: dexdec
IR type structure closely mirror,
whenever possible, gendec
's.
dexdec
IR optimizer plugins may be written in Python or Java.
A sample skeleton plugin, in Python:
#?type=dexdec-ir from com.pnfsoftware.jeb.core.units.code.android.ir import AbstractDOptimizer class DOptSamplePython(AbstractDOptimizer): def perform(self): # do not perform optimizations, simply print out each IR instruction of the current IR CFG for blk in self.cfg: # BasicBlock (of IDInstruction) for insn in blk: # IDInstruction logger.info("%04X: %s" % (insn.getOffset(), insn)) # no optimization performed return 0
The same sample plugin, in Java:
//?type=dexdec-ir import com.pnfsoftware.jeb.core.units.code.android.controlflow.BasicBlock; import com.pnfsoftware.jeb.core.units.code.android.ir.AbstractDOptimizer; import com.pnfsoftware.jeb.core.units.code.android.ir.IDInstruction; public class DOptSampleJava extends AbstractDOptimizer { // note: implicit no-arg constructor is calling super() @Override public int perform() { // do not perform optimizations, simply print out each IR instruction of the current IR CFG for(BasicBlock<IDInstruction> b: cfg) { for(IDInstruction insn: b) { logger.info("%04X: %s", insn.getOffset(), insn); } } // no optimization performed return 0; } }Refer to the sub-directory
coreplugins/
, located in the JEB installation folder, for
examples.Additional resources: refer to the User Manual and Technical Blogs, at https://www.pnfsoftware.com.
-
ClassDescriptionBase class for
dexdec
(DEX decompiler) IR optimizer plugins working on a collection of IR contexts.Skeleton for an IR Master Optimizer instrumenter.Base class fordexdec
(DEX decompiler) IR optimizer plugins.copy()
options for IR expressions.The emulation policy for API methods relying or depending on the execution environment, the date and time, and random number generators.A Dalvik-to-IR conversion exception.Those objects are used to wrap throwables raised by the emulated code.The emulation of some Dalvik code failed because there was an error reported when translating to IR.The emulation is taking too long (maximum iteration count exceeded).An error occurred while executing code in the emulator-controlled sandbox.An internal exception used when attempting to emulate a method whose body was removed.The emulation is taking too long (timeout exceeded).This exception and its sub-types are throw by theState components
andevaluate
methods.An error occurred in code running in a restricted thread not directly managed by the emulator.An error occurred while evaluating native code.dexdec
IR emulation parameters object.dexdec
IR formatting context, providing an output sink and specifications for the output.dexdec
IR types of invocation, used to specifyIDCallInfo
.This enumeration defines the opcode types of the intermediate representation (IR)instructions
used bydexdec
.dexdec
IR optimizer type.Type information object used to collect typing results when propagating types through an SSA'ed IR.Details about a typing conflict.dexdec
IR access and manipulation utility methods.Visit result object, provided to the call-back methods of adexdec
IR visitor object.dexdec
IR array element.Base interface for alldexdec
IR elements.An emulated class, represent the type of an emulated object.An emulator context, used bydexdec
State objects.An emulator frame, used bydexdec
State objects.An interface for user-defined hooks called bydexdec
's IR emulator when executing internal (in DEX) code.An emulated object, representing an internal emulated object.dexdec
exception handler definition.dexdec
exception item definition.Base interface for alldexdec
IR expressions, such as IR instructions, fields/attributes, immediates, variables/identifiers, operations, etc.dexdec
IR generic interface for field elements, that is, static fields and instance fields.dexdec
IR global context.This dual-purposedexdec
IR element serves to encode immediate values (primitives and pooled strings) andevaluated
values (primitives and objects).dexdec
IR interface for objects representing a pool index (e.g.dexdec
IR instance field.dexdec
IR instruction object.dexdec
IR generic interface holding invocation information forIDCallInfo
,IDNewInfo
,IDNewArrayInfo
,IDAllocObjectInfo
.A manager ofIR optimizers
.Instrumenter interface for IRmaster optimizer
(MO).dexdec
IR method context.Method execution helper interface, to be registered with adexdec
IR state
.dexdec
IR element holdingnew
array creation information.dexdec
IR operation expression.Plugin interface fordexdec
(DEX decompiler) IR optimizer plugins.dexdec
IR reference type object.An interface for user-defined hooks called bydexdec
's IR sandbox when executing external (not in DEX) code.dexdec
IR state (referred as "State"), used to perform IR evaluations, emulation and sandboxing.dexdec
IR static field, including a type'sclass
pseudo-attribute.dexdec
IR switch data, used to specify the case and target values of a high-levelswitch
instruction
.dexdec
IR target information, containing an intra-method IR offset.dexdec
exception handling information, optionally provided by anIR method context
.Type information provider interface.dexdec
IR interface used to represent a variable (a.k.a.Specialized tree node visitor interface fordexdec
IR expressions
.