diff options
| author | Fabrice Desclaux <fabrice.desclaux@cea.fr> | 2019-02-25 11:09:54 +0100 |
|---|---|---|
| committer | Fabrice Desclaux <fabrice.desclaux@cea.fr> | 2019-03-05 16:52:49 +0100 |
| commit | 02bbb30efea4980c9d133947cbbf69fb599071ad (patch) | |
| tree | 3fea6826fcc5354840a27cb1dc99ff31eef81896 /example/expression/basic_op.py | |
| parent | eab809932871f91d6f4aa770fc321af9e156e0f5 (diff) | |
| download | focaccia-miasm-02bbb30efea4980c9d133947cbbf69fb599071ad.tar.gz focaccia-miasm-02bbb30efea4980c9d133947cbbf69fb599071ad.zip | |
Support python2/python3
Diffstat (limited to 'example/expression/basic_op.py')
| -rw-r--r-- | example/expression/basic_op.py | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/example/expression/basic_op.py b/example/expression/basic_op.py index 6032f483..8b5d7e2b 100644 --- a/example/expression/basic_op.py +++ b/example/expression/basic_op.py @@ -1,31 +1,32 @@ +from __future__ import print_function from miasm2.expression.expression import * -print """ +print(""" Simple expression manipulation demo -""" +""") # define 2 ID a = ExprId('eax', 32) b = ExprId('ebx', 32) -print a, b +print(a, b) # eax ebx # add those ID c = ExprOp('+', a, b) -print c +print(c) # (eax + ebx) # + automatically generates ExprOp('+', a, b) c = a + b -print c +print(c) # (eax + ebx) # ax is a slice of eax ax = a[:16] -print ax +print(ax) # eax[0:16] # memory deref d = ExprMem(c, 32) -print d +print(d) # @32[(eax + ebx)] |