public class

CMethodState

extends Object
java.lang.Object
   ↳ com.pnfsoftware.jeb.core.units.code.asm.decompiler.ast.simulator.CMethodState

Class Overview

State of a simulated method.

  • the concrete value associated to each ICIdentifier
  • the concrete return value, if the execution terminated
  • a CMethodState.ControlWord value to select the next instruction to execute
The state also provides an equivalence relationship #isEquivalent(CMethodState), to test if another state might represent the same computation.

Summary

Nested Classes
enum CMethodState.ControlWord Control word. 
Public Constructors
CMethodState(List<ICStatement> statements)
Public Methods
static boolean areEquivalent(CMethodState state1, CMethodState state2, boolean checkProducedValues, boolean checkControlWords)
Checks if two states might represent the same computation, namely:
  • if the return values are the same
  • conditionally, if the same values got produced in both states
  • conditionally, if the final control words are the same
CMethodState.ControlWord getControlWord()
int getControlWordIndex()
ICIdentifier getIdentifier(ICElement element)
Long getLocalVarValue(ICElement element)
Map<ICIdentifier, Long> getLocalVarValues()
Long getReturnValue()
List<ICStatement> getStatements()
boolean isMethodParametersSpoiled()
If true, parameters of methods called are considered spoiled; the corresponding variables' values will be modified by the simulation.
void setControlWord(CMethodState.ControlWord controlWord)
void setControlWordIndex(int controlWordIndex)
void setLocalVarValue(ICIdentifier id, Long value)
void setMethodParametersSpoiled(boolean methodParametersSpoiled)
void setReturnValue(Long returnValue)
void setValue(ICElement element, Long value, CEnvironment environment)
Sets a variable --either local or global-- value.
String toString()
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public CMethodState (List<ICStatement> statements)

Public Methods

public static boolean areEquivalent (CMethodState state1, CMethodState state2, boolean checkProducedValues, boolean checkControlWords)

Checks if two states might represent the same computation, namely:

  • if the return values are the same
  • conditionally, if the same values got produced in both states
  • conditionally, if the final control words are the same

public CMethodState.ControlWord getControlWord ()

public int getControlWordIndex ()

public ICIdentifier getIdentifier (ICElement element)

public Long getLocalVarValue (ICElement element)

public Map<ICIdentifier, Long> getLocalVarValues ()

public Long getReturnValue ()

public List<ICStatement> getStatements ()

public boolean isMethodParametersSpoiled ()

If true, parameters of methods called are considered spoiled; the corresponding variables' values will be modified by the simulation. If false, they are left intact.

public void setControlWord (CMethodState.ControlWord controlWord)

public void setControlWordIndex (int controlWordIndex)

public void setLocalVarValue (ICIdentifier id, Long value)

public void setMethodParametersSpoiled (boolean methodParametersSpoiled)

public void setReturnValue (Long returnValue)

public void setValue (ICElement element, Long value, CEnvironment environment)

Sets a variable --either local or global-- value.

public String toString ()