diff options
| author | serpilliere <devnull@localhost> | 2012-05-24 10:13:31 +0200 |
|---|---|---|
| committer | serpilliere <devnull@localhost> | 2012-05-24 10:13:31 +0200 |
| commit | cc9f77d1b57455f65d22a4f83f1f52988a01295e (patch) | |
| tree | 64d0c74e8af472527b0386773f630ac362665d07 /miasm/expression/expression.py | |
| parent | 8fa775d94bdcb0e040e39bd28e66b118a596ed9b (diff) | |
| download | focaccia-miasm-cc9f77d1b57455f65d22a4f83f1f52988a01295e.tar.gz focaccia-miasm-cc9f77d1b57455f65d22a4f83f1f52988a01295e.zip | |
use macro for int cast
Diffstat (limited to 'miasm/expression/expression.py')
| -rw-r--r-- | miasm/expression/expression.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/miasm/expression/expression.py b/miasm/expression/expression.py index 45d1dc66..bb4a1983 100644 --- a/miasm/expression/expression.py +++ b/miasm/expression/expression.py @@ -751,3 +751,12 @@ def canonize_expr_list_compose(l): l = l[:] l.sort(cmp=compare_exprs_compose) return l + +tab_uintsize ={8:uint8, + 16:uint16, + 32:uint32, + 64:uint64 + } + +def ExprInt_from(e, i): + return ExprInt(tab_uintsize[e.get_size()](i)) |