diff options
| author | serpilliere <devnull@localhost> | 2012-02-27 10:46:29 +0100 |
|---|---|---|
| committer | serpilliere <devnull@localhost> | 2012-02-27 10:46:29 +0100 |
| commit | c12642d1d0ab242054a95db52d79f8e208f02355 (patch) | |
| tree | 3a91aea9c79bc85b086882e8fd97c804749c25db /example/expression/manip_expression3.py | |
| parent | 9ada5b417a2b92aa855791fb2d4c3e282c2dcb2e (diff) | |
| download | miasm-c12642d1d0ab242054a95db52d79f8e208f02355.tar.gz miasm-c12642d1d0ab242054a95db52d79f8e208f02355.zip | |
example: add expression manipulation demo
Diffstat (limited to 'example/expression/manip_expression3.py')
| -rw-r--r-- | example/expression/manip_expression3.py | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/example/expression/manip_expression3.py b/example/expression/manip_expression3.py new file mode 100644 index 00000000..06b3f77a --- /dev/null +++ b/example/expression/manip_expression3.py @@ -0,0 +1,20 @@ +from miasm.arch.ia32_sem import * +from miasm.expression.expression_helper import * + +print 'simple expression simplification demo' +print + +a = ExprId('eax') +b = ExprId('ebx') +c = a + b +d = c - a +print d +# ((eax + ebx) - eax) +print "=>", expr_simp(d) +print +# ebx +e = ExprInt(uint32(0x12)) + ExprInt(uint32(0x30)) - a +print e +# ((0x12 + 0x30) - eax) +print "=>", expr_simp(e) +# (0x42 - eax) |