public interface

IDEmuFrame

com.pnfsoftware.jeb.core.units.code.android.ir.IDEmuFrame

Class Overview

An emulator frame, used by dexdec State objects. A frame of method execution holds the PC, variable values, the raised exception exception (if any). Frames are stacked: each sub-routine call creates another frame in the stack. A frame is part of an emulation context.

Summary

Public Methods
abstract IDEmuFrame copy()
Perform a deep copy of this frame.
abstract boolean deleteVariable(int id)
Remove (unset) a variable.
abstract void deleteVariables()
Remove (unset) all variables.
abstract int getIterationCount()
Retrieve the current iteration count in the frame.
abstract String getMethodSignature()
Retrieve the method signature for this frame.
abstract Integer getNextPC()
Retrieve the optional next PC, if one was set.
abstract int getPC()
Retrieve the current PC.
abstract IDImm getRaisedException()
Retrieve the emulated exception raised by the emulation of this method.
abstract Map<Integer, IDImm> getVarMap()
Reserved for internal use.
abstract IDImm getVariable(int id, boolean readNullIfUnset)
Read a variable.
abstract IDImm getVariable(int id)
Read a variable.
abstract boolean hasVariable(int id)
Determine whether a variable is set (has a value).
abstract boolean isExecutionComplete()
Determine whether the emulation of the method is complete.
abstract void setExecutionComplete(boolean done)
This method is used by the emulator to specify that the emulation of the method is complete.
abstract void setPC(int PC)
Set the current PC.
abstract void setRaisedException(IDImm ex)
This method is used by the emulator to specify that the emulation of the method raised an exception.
abstract void setVarMap(Map<Integer, IDImm> varmap)
Reserved for internal use.
abstract void setVariable(int id, IDImm val)
Write a variable.
abstract int updatePC()
Update the current PC with the next PC and return it.

Public Methods

public abstract IDEmuFrame copy ()

Perform a deep copy of this frame.

public abstract boolean deleteVariable (int id)

Remove (unset) a variable.

Parameters
id variable id
Returns
  • true if the variable existed and was deleted

public abstract void deleteVariables ()

Remove (unset) all variables.

public abstract int getIterationCount ()

Retrieve the current iteration count in the frame.

public abstract String getMethodSignature ()

Retrieve the method signature for this frame.

public abstract Integer getNextPC ()

Retrieve the optional next PC, if one was set. The next PC is set when evaluating an instruction via IDInstruction#evaluate. The PC can be updated with the next PC with updatePC().

public abstract int getPC ()

Retrieve the current PC.

public abstract IDImm getRaisedException ()

Retrieve the emulated exception raised by the emulation of this method.

public abstract Map<Integer, IDImm> getVarMap ()

Reserved for internal use.

Returns
  • a full-access map of variables

public abstract IDImm getVariable (int id, boolean readNullIfUnset)

Read a variable.

Parameters
id variable id
readNullIfUnset fail-safe to avoid throwing if the variable is unset
Returns
  • a value, null if the variable is unset and `readNullIfUnset` is true
Throws
DexDecEvaluationException if the variable is unset and `readNullIfUnset` is false

public abstract IDImm getVariable (int id)

Read a variable. The variable must exist.

Parameters
id variable id
Returns
  • non-null value
Throws
DexDecEvaluationException if the variable is unset

public abstract boolean hasVariable (int id)

Determine whether a variable is set (has a value).

Parameters
id variable id

public abstract boolean isExecutionComplete ()

Determine whether the emulation of the method is complete. If an exception is raised, the emulation is not considered complete.

Returns
  • true if the method has "returned"

public abstract void setExecutionComplete (boolean done)

This method is used by the emulator to specify that the emulation of the method is complete. If an exception is raised, the emulation is not considered complete.

Parameters
done true if the method has "returned"

public abstract void setPC (int PC)

Set the current PC.

public abstract void setRaisedException (IDImm ex)

This method is used by the emulator to specify that the emulation of the method raised an exception.

Parameters
ex an emulated exception

public abstract void setVarMap (Map<Integer, IDImm> varmap)

Reserved for internal use.

Parameters
varmap a map of variables

public abstract void setVariable (int id, IDImm val)

Write a variable.

Parameters
id variable id
val non-null value

public abstract int updatePC ()

Update the current PC with the next PC and return it.

Returns
  • the now current PC (was the next PC)