about summary refs log tree commit diff stats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--miasm/expression/expression_helper.py6
-rw-r--r--miasm/tools/pe_helper.py2
2 files changed, 7 insertions, 1 deletions
diff --git a/miasm/expression/expression_helper.py b/miasm/expression/expression_helper.py
index c6bcfa8e..99f8331e 100644
--- a/miasm/expression/expression_helper.py
+++ b/miasm/expression/expression_helper.py
@@ -231,6 +231,12 @@ def expr_simp_w(e):
             args0 = args[0].args[0]
             args = [args0, ExprInt(args1)]
 
+        if op in ['+'] and isinstance(args[1], ExprInt) and isinstance(args[0], ExprOp) and args[0].op in ['+', '-'] and isinstance(args[0].args[0], ExprInt):
+            op = args[0].op
+            args1 = args[0].args[0].arg + args[1].arg
+            args0 = args[0].args[1]
+            args = [ExprInt(args1), args0]
+
         #0 - (a-b) => b-a
         if op == '-' and isinstance(args[0], ExprInt) and args[0].arg == 0 and isinstance(args[1], ExprOp) and args[1].op == "-":
             return expr_simp(args[1].args[1] - args[1].args[0])
diff --git a/miasm/tools/pe_helper.py b/miasm/tools/pe_helper.py
index ef46e4d9..09b341e7 100644
--- a/miasm/tools/pe_helper.py
+++ b/miasm/tools/pe_helper.py
@@ -387,7 +387,7 @@ class libimp:
 
     def lib_get_add_base(self, name):
         name = name.lower()
-        if not name.lower().endswith('.dll'):
+        if not "." in name:
             print 'warning adding .dll to modulename'
             name += '.dll'
             print name