![]() |
miasm
Reverse engineering framework
|


Public Member Functions | |
| def | __init__ (self, machine, loc_db, produce_solution=PRODUCE_SOLUTION_CODE_COV, known_solutions=None, **kwargs) |
| def | take_snapshot (self, *args, **kwargs) |
| def | restore_snapshot (self, snapshot, keep_known_solutions=True, **kwargs) |
| def | produce_solution (self, destination) |
| def | handle_solution (self, model, destination) |
| def | handle_correct_destination (self, destination, path_constraints) |
| def | handle (self, cur_addr) |
Public Member Functions inherited from miasm.analysis.dse.DSEEngine | |
| def | __init__ (self, machine, loc_db) |
| def | prepare (self) |
| def | attach (self, emulator) |
| def | add_handler (self, addr, callback) |
| def | add_lib_handler (self, libimp, namespace) |
| def | add_instrumentation (self, addr, callback) |
| def | callback (self, _) |
| def | take_snapshot (self) |
| def | restore_snapshot (self, snapshot, memory=True) |
| def | update_state (self, assignblk) |
| def | update_state_from_concrete (self, cpu=True, mem=False) |
| def | eval_expr (self, expr) |
| def | symbolize_memory (self, memory_range) |
Public Attributes | |
| cur_solver | |
| new_solutions | |
| z3_trans | |
Public Attributes inherited from miasm.analysis.dse.DSEEngine | |
| machine | |
| loc_db | |
| handler | |
| instrumentation | |
| addr_to_cacheblocks | |
| ir_arch | |
| ircfg | |
| jitter | |
| symb | |
| Prepare symbexec engines. More... | |
| symb_concrete | |
| mdis | |
Static Public Attributes | |
| int | MAX_MEMORY_INJECT = 0x10000 |
| int | PRODUCE_NO_SOLUTION = 0 |
| int | PRODUCE_SOLUTION_CODE_COV = 1 |
| int | PRODUCE_SOLUTION_BRANCH_COV = 2 |
| int | PRODUCE_SOLUTION_PATH_COV = 3 |
Static Public Attributes inherited from miasm.analysis.dse.DSEEngine | |
| SYMB_ENGINE = ESETrackModif | |
Additional Inherited Members | |
Static Public Member Functions inherited from miasm.analysis.dse.DSEEngine | |
| def | memory_to_expr (addr) |
Dynamic Symbolic Execution Engine keeping the path constraint Possible new "solutions" are produced along the path, by inversing concrete path constraint. Thus, a "solution" is a potential initial context leading to a new path. In order to produce a new solution, one can extend this class, and override 'handle_solution' to produce a solution which fit its needs. It could avoid computing new solution by overriding 'produce_solution'. If one is only interested in constraints associated to its path, the option "produce_solution" should be set to False, to speed up emulation. The constraints are accumulated in the .z3_cur z3.Solver object.
| def miasm.analysis.dse.DSEPathConstraint.__init__ | ( | self, | |
| machine, | |||
| loc_db, | |||
produce_solution = PRODUCE_SOLUTION_CODE_COV, |
|||
known_solutions = None, |
|||
| ** | kwargs | ||
| ) |
Init a DSEPathConstraint @machine: Machine of the targeted architecture instance @produce_solution: (optional) if set, new solutions will be computed
| def miasm.analysis.dse.DSEPathConstraint.handle | ( | self, | |
| cur_addr | |||
| ) |
Handle destination @cur_addr: Expr of the next address in concrete execution /!\ cur_addr may be a loc_key In this method, self.symb is in the "just before branching" state
Reimplemented from miasm.analysis.dse.DSEEngine.

| def miasm.analysis.dse.DSEPathConstraint.handle_correct_destination | ( | self, | |
| destination, | |||
| path_constraints | |||
| ) |
[DEV] Called by handle() to update internal structures giving the correct destination (the concrete execution one).


| def miasm.analysis.dse.DSEPathConstraint.handle_solution | ( | self, | |
| model, | |||
| destination | |||
| ) |
Called when a new solution for destination @destination is founded @model: z3 model instance @destination: Expr instance for an addr which is not on the DSE path


| def miasm.analysis.dse.DSEPathConstraint.produce_solution | ( | self, | |
| destination | |||
| ) |
Called to determine if a solution for @destination should be test for satisfiability and computed @destination: Expr instance of the target @destination


| def miasm.analysis.dse.DSEPathConstraint.restore_snapshot | ( | self, | |
| snapshot, | |||
keep_known_solutions = True, |
|||
| ** | kwargs | ||
| ) |
Restore a DSEPathConstraint snapshot @keep_known_solutions: if set, do not forget solutions already found. -> They will not appear in 'new_solutions'

| def miasm.analysis.dse.DSEPathConstraint.take_snapshot | ( | self, | |
| * | args, | ||
| ** | kwargs | ||
| ) |
| miasm.analysis.dse.DSEPathConstraint.cur_solver |
|
static |
| miasm.analysis.dse.DSEPathConstraint.new_solutions |
|
static |
|
static |
|
static |
|
static |
| miasm.analysis.dse.DSEPathConstraint.z3_trans |