Class CMethodSimulator
java.lang.Object
com.pnfsoftware.jeb.core.units.code.asm.decompiler.ast.simulator.CMethodSimulator
Pseudo-C method simulator.
Note that a simulator serves for one method only, and the simulation might happen only once.
-
Constructor Summary
ConstructorsConstructorDescriptionCMethodSimulator
(ICMethod method, CEnvironment environment) CMethodSimulator
(ICMethod method, CEnvironment environment, boolean strictMode) CMethodSimulator
(ICMethod method, CEnvironment environment, int traceMaxSize) -
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
areEquivalentSimulations
(CSimulationLogger simLogger1, CSimulationLogger simLogger2) Check if two simulations are equivalent, i.e.simulate()
Run the simulation from an empty input state.simulate
(CMethodState inputState) Run the simulation from the given input state.
-
Constructor Details
-
CMethodSimulator
-
CMethodSimulator
-
CMethodSimulator
- Parameters:
method
-environment
-strictMode
- if true simulator will follow strict C emulation, otherwise some tweaks will be made to ensure simulation can be done even when AST contains errors (e.g. dereferencement of non-pointers)
-
-
Method Details
-
simulate
Run the simulation from an empty input state. -
simulate
Run the simulation from the given input state. -
areEquivalentSimulations
public static boolean areEquivalentSimulations(CSimulationLogger simLogger1, CSimulationLogger simLogger2) Check if two simulations are equivalent, i.e. if:- their final states are equivalents, see
CMethodState.areEquivalent(CMethodState, CMethodState, boolean, boolean)
- their final environments are equivalents, see
CEnvironment.areEquivalent(CEnvironment, CEnvironment)
- their method calls are the same (same routines called in the same order)
- their final states are equivalents, see
-
getStmtsFlatList
-