diff options
| author | serpilliere <devnull@localhost> | 2014-06-24 15:00:33 +0200 |
|---|---|---|
| committer | serpilliere <devnull@localhost> | 2014-06-24 15:00:33 +0200 |
| commit | 70e7237106321ddf6fb2db198cdf45d06b74581a (patch) | |
| tree | ac4f26904f54e23820b35e7b1a1f975dcb879b2d | |
| parent | d5a38769bfbd94ed46bf654c4dac1733e088d5bf (diff) | |
| download | miasm-70e7237106321ddf6fb2db198cdf45d06b74581a.tar.gz miasm-70e7237106321ddf6fb2db198cdf45d06b74581a.zip | |
Fix operand unify irem/imod
| -rw-r--r-- | miasm2/expression/expression_helper.py | 2 | ||||
| -rw-r--r-- | miasm2/expression/simplifications_common.py | 4 | ||||
| -rw-r--r-- | miasm2/ir/ir2C.py | 4 | ||||
| -rw-r--r-- | miasm2/jitter/jitload.py | 2 |
4 files changed, 4 insertions, 8 deletions
diff --git a/miasm2/expression/expression_helper.py b/miasm2/expression/expression_helper.py index 0a4dd3ca..92f46324 100644 --- a/miasm2/expression/expression_helper.py +++ b/miasm2/expression/expression_helper.py @@ -128,7 +128,7 @@ def merge_sliceto_slice(args): op_propag_cst = ['+', '*', '^', '&', '|', '>>', - '<<', "a>>", ">>>", "<<<", "/", "%", 'idiv', 'irem'] + '<<', "a>>", ">>>", "<<<", "/", "%", 'idiv', 'imod'] def is_pure_int(e): diff --git a/miasm2/expression/simplifications_common.py b/miasm2/expression/simplifications_common.py index fc85f118..208870eb 100644 --- a/miasm2/expression/simplifications_common.py +++ b/miasm2/expression/simplifications_common.py @@ -60,7 +60,7 @@ def simp_cst_propagation(e_s, e): x1 = mod_size2int[i1.arg.size](i1.arg) x2 = mod_size2int[i2.arg.size](i2.arg) o = mod_size2uint[i1.arg.size](x1 / x2) - elif op == 'irem': + elif op == 'imod': assert(i2.arg) x1 = mod_size2int[i1.arg.size](i1.arg) x2 = mod_size2int[i2.arg.size](i2.arg) @@ -110,7 +110,7 @@ def simp_cst_propagation(e_s, e): # op A => A if op in ['+', '*', '^', '&', '|', '>>', '<<', - 'a>>', '<<<', '>>>', 'idiv', 'irem'] and len(args) == 1: + 'a>>', '<<<', '>>>', 'idiv', 'imod'] and len(args) == 1: return args[0] # A-B => A + (-B) diff --git a/miasm2/ir/ir2C.py b/miasm2/ir/ir2C.py index 64591b44..59901e02 100644 --- a/miasm2/ir/ir2C.py +++ b/miasm2/ir/ir2C.py @@ -46,10 +46,6 @@ def ExprOp_toC(self): 'div16': "div_op", 'div32': "div_op", 'idiv32': "div_op", # XXX to test - 'rem8': "rem_op", - 'rem16': "rem_op", - 'rem32': "rem_op", - 'irem32': "rem_op", # XXX to test '<<<c_rez': 'rcl_rez_op', '<<<c_cf': 'rcl_cf_op', '>>>c_rez': 'rcr_rez_op', diff --git a/miasm2/jitter/jitload.py b/miasm2/jitter/jitload.py index c410730a..b597e5f4 100644 --- a/miasm2/jitter/jitload.py +++ b/miasm2/jitter/jitload.py @@ -934,7 +934,7 @@ class jitter_x86_64(jitter): return x def get_stack_arg(self, n): - x = upck64(self.vm.vm_get_mem(self.cpu.RSP + 4 * n, 4)) + x = upck64(self.vm.vm_get_mem(self.cpu.RSP + 8 * n, 8)) return x def init_run(self, *args, **kwargs): |