diff options
Diffstat (limited to 'miasm2/ir/symbexec_top.py')
| -rw-r--r-- | miasm2/ir/symbexec_top.py | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/miasm2/ir/symbexec_top.py b/miasm2/ir/symbexec_top.py index 1e1e76e9..f5ecb566 100644 --- a/miasm2/ir/symbexec_top.py +++ b/miasm2/ir/symbexec_top.py @@ -2,7 +2,6 @@ from miasm2.ir.symbexec import SymbolicExecutionEngine, StateEngine from miasm2.expression.simplifications import expr_simp from miasm2.expression.expression import ExprId, ExprInt, ExprSlice,\ ExprMem, ExprCond, ExprCompose, ExprOp -from miasm2.core import asmblock TOPSTR = "TOP" @@ -121,14 +120,20 @@ class SymbExecTopNoMem(SymbolicExecutionEngine): def eval_exprid(self, expr, **kwargs): """[DEV]: Evaluate an ExprId using the current state""" - if isinstance(expr.name, asmblock.AsmLabel) and expr.name.offset is not None: - ret = ExprInt(expr.name.offset, expr.size) - elif expr in self.regstop: + if expr in self.regstop: ret = exprid_top(expr) else: ret = self.symbols.read(expr) return ret + def eval_exprloc(self, expr, **kwargs): + offset = self.ir_arch.loc_db.get_location_offset(expr.loc_key) + if offset is not None: + ret = ExprInt(offset, expr.size) + else: + ret = expr + return ret + def eval_exprcond(self, expr, **kwargs): """[DEV]: Evaluate an ExprCond using the current state""" cond = self.eval_expr_visitor(expr.cond, **kwargs) |