public class DexBody extends Object
| Modifier and Type | Class and Description |
|---|---|
protected class |
DexBody.RegDbgEntry
An entry of debug information for a register from the dex file.
|
| Modifier and Type | Field and Description |
|---|---|
protected DanglingInstruction |
dangling |
protected RefType |
declaringClassType |
protected List<DeferableInstruction> |
deferredInstructions |
protected org.jf.dexlib2.iface.MultiDexContainer.DexEntry<? extends org.jf.dexlib2.iface.DexFile> |
dexEntry |
protected Map<Integer,DexlibAbstractInstruction> |
instructionAtAddress |
protected List<DexlibAbstractInstruction> |
instructions |
protected Set<RetypeableInstruction> |
instructionsToRetype |
protected boolean |
isStatic |
protected JimpleBody |
jBody |
protected org.jf.dexlib2.iface.Method |
method |
protected int |
numParameterRegisters |
protected int |
numRegisters |
protected List<String> |
parameterNames |
protected List<Type> |
parameterTypes |
protected List<PseudoInstruction> |
pseudoInstructionData |
protected Local[] |
registerLocals |
protected Local |
storeResultLocal |
protected Set<String> |
takenLocalNames |
protected List<? extends org.jf.dexlib2.iface.TryBlock<? extends org.jf.dexlib2.iface.ExceptionHandler>> |
tries |
| Modifier | Constructor and Description |
|---|---|
protected |
DexBody(org.jf.dexlib2.iface.MultiDexContainer.DexEntry<? extends org.jf.dexlib2.iface.DexFile> dexFile,
org.jf.dexlib2.iface.Method method,
RefType declaringClassType) |
| Modifier and Type | Method and Description |
|---|---|
void |
add(Unit u)
Add unit to this body.
|
void |
addDeferredJimplification(DeferableInstruction i)
Add a deferred instruction to this body.
|
void |
addRetype(RetypeableInstruction i)
Add a retypeable instruction to this body.
|
protected void |
extractDexInstructions(org.jf.dexlib2.iface.MethodImplementation code)
Extracts the list of dalvik instructions from dexlib and converts them into our own instruction
data model
|
protected void |
fixLineNumbers()
Fixes the line numbers.
|
protected String |
freshLocalName(String hint)
Allocate a fresh name for Jimple local
|
Body |
getBody()
Return the associated JimpleBody.
|
protected CopyPropagator |
getCopyPopagator() |
protected LocalSplitter |
getLocalSplitter() |
Local |
getRegisterLocal(int num)
Return the Local that are associated with the number in the current register state.
|
Local[] |
getRegisterLocals()
Return the Locals that are associated with the current register state.
|
Local |
getStoreResultLocal() |
protected UnreachableCodeEliminator |
getUnreachableCodeEliminator() |
DexlibAbstractInstruction |
instructionAtAddress(int address)
Return the instruction that is present at the byte code address.
|
List<DexlibAbstractInstruction> |
instructionsAfter(DexlibAbstractInstruction instruction)
Return the instructions that appear (lexically) after the given instruction.
|
List<DexlibAbstractInstruction> |
instructionsBefore(DexlibAbstractInstruction instruction)
Return the instructions that appear (lexically) before the given instruction.
|
Body |
jimplify(Body b,
SootMethod m)
Return the jimple equivalent of this body.
|
void |
setDanglingInstruction(DanglingInstruction i)
Set a dangling instruction for this body.
|
Set<Type> |
usedTypes()
Return the types that are used in this body.
|
protected List<DexlibAbstractInstruction> instructions
protected Local[] registerLocals
protected Local storeResultLocal
protected Map<Integer,DexlibAbstractInstruction> instructionAtAddress
protected List<DeferableInstruction> deferredInstructions
protected Set<RetypeableInstruction> instructionsToRetype
protected DanglingInstruction dangling
protected int numRegisters
protected int numParameterRegisters
protected boolean isStatic
protected JimpleBody jBody
protected List<? extends org.jf.dexlib2.iface.TryBlock<? extends org.jf.dexlib2.iface.ExceptionHandler>> tries
protected RefType declaringClassType
protected final org.jf.dexlib2.iface.MultiDexContainer.DexEntry<? extends org.jf.dexlib2.iface.DexFile> dexEntry
protected final org.jf.dexlib2.iface.Method method
protected List<PseudoInstruction> pseudoInstructionData
protected DexBody(org.jf.dexlib2.iface.MultiDexContainer.DexEntry<? extends org.jf.dexlib2.iface.DexFile> dexFile,
org.jf.dexlib2.iface.Method method,
RefType declaringClassType)
code - the codeitem that is contained in this bodymethod - the method that is associated with this bodyprotected String freshLocalName(String hint)
hint - A name that the fresh name will look likeprotected void extractDexInstructions(org.jf.dexlib2.iface.MethodImplementation code)
code - The dexlib method implementationpublic void add(Unit u)
u - Unit to add.public void addDeferredJimplification(DeferableInstruction i)
i - the deferred instruction.public void addRetype(RetypeableInstruction i)
i - the retypeable instruction.public Body getBody()
RuntimeException - if no jimplification happened yet.public Local[] getRegisterLocals()
public Local getRegisterLocal(int num) throws InvalidDalvikBytecodeException
Handles if the register number actually points to a method parameter.
num - the register numberInvalidDalvikBytecodeExceptionpublic Local getStoreResultLocal()
public DexlibAbstractInstruction instructionAtAddress(int address)
address - the byte code address.RuntimeException - if address is not part of this body.public Body jimplify(Body b, SootMethod m)
m - the SootMethod that contains this bodyprotected void fixLineNumbers()
protected LocalSplitter getLocalSplitter()
protected UnreachableCodeEliminator getUnreachableCodeEliminator()
protected CopyPropagator getCopyPopagator()
public void setDanglingInstruction(DanglingInstruction i)
public List<DexlibAbstractInstruction> instructionsAfter(DexlibAbstractInstruction instruction)
instruction - the instruction which successors will be returned.public List<DexlibAbstractInstruction> instructionsBefore(DexlibAbstractInstruction instruction)
The instruction immediately before the given is the first instruction and so on.
instruction - the instruction which successors will be returned.Copyright © 2020 Soot OSS. All rights reserved.