diff options
| author | serpilliere <devnull@localhost> | 2012-06-21 14:58:59 +0200 |
|---|---|---|
| committer | serpilliere <devnull@localhost> | 2012-06-21 14:58:59 +0200 |
| commit | 19fe36322489198269f449d653fff71195af9805 (patch) | |
| tree | 279d8a7fd12ede184300cbf896c42673e91c363c | |
| parent | 3af3f8e0f4ad616c9077fec6efa58cb6c7240812 (diff) | |
| download | miasm-19fe36322489198269f449d653fff71195af9805.tar.gz miasm-19fe36322489198269f449d653fff71195af9805.zip | |
expression: now, 1 bit flags are *real* 1 bit flags.
| -rw-r--r-- | miasm/arch/ia32_sem.py | 35 | ||||
| -rw-r--r-- | miasm/expression/expression.py | 2 | ||||
| -rw-r--r-- | miasm/tools/modint.py | 2 |
3 files changed, 20 insertions, 19 deletions
diff --git a/miasm/arch/ia32_sem.py b/miasm/arch/ia32_sem.py index 622719d4..5fdf305c 100644 --- a/miasm/arch/ia32_sem.py +++ b/miasm/arch/ia32_sem.py @@ -139,28 +139,27 @@ init_tsc2 = ExprId("init_tsc2") init_cr0 = ExprId("init_cr0") -init_zf = ExprId("init_zf") -init_nf = ExprId("init_nf") -init_pf = ExprId("init_pf") -init_of = ExprId("init_of") -init_cf = ExprId("init_cf") -init_tf = ExprId("init_tf") -init_i_f = ExprId("init_i_f") -init_df = ExprId("init_df") -init_af = ExprId("init_af") -init_iopl = ExprId("init_iopl") -init_nt = ExprId("init_nt") -init_rf = ExprId("init_rf") -init_vm = ExprId("init_vm") -init_ac = ExprId("init_ac") -init_vif = ExprId("init_vif") -init_vip = ExprId("init_vip") -init_i_d = ExprId("init_i_d") +init_zf = ExprId("init_zf", size=1) +init_nf = ExprId("init_nf", size=1) +init_pf = ExprId("init_pf", size=1) +init_of = ExprId("init_of", size=1) +init_cf = ExprId("init_cf", size=1) +init_tf = ExprId("init_tf", size=1) +init_i_f = ExprId("init_i_f", size=1) +init_df = ExprId("init_df", size=1) +init_af = ExprId("init_af", size=1) +init_iopl = ExprId("init_iopl", size=2) +init_nt = ExprId("init_nt", size=1) +init_rf = ExprId("init_rf", size=1) +init_vm = ExprId("init_vm", size=1) +init_ac = ExprId("init_ac", size=1) +init_vif = ExprId("init_vif", size=1) +init_vip = ExprId("init_vip", size=1) +init_i_d = ExprId("init_i_d", size=1) init_tsc1 = ExprId("init_tsc1") init_tsc2 = ExprId("init_tsc2") - eax = ExprId(reg_eax) ebx = ExprId(reg_ebx) ecx = ExprId(reg_ecx) diff --git a/miasm/expression/expression.py b/miasm/expression/expression.py index aa164ed4..921b1166 100644 --- a/miasm/expression/expression.py +++ b/miasm/expression/expression.py @@ -759,7 +759,7 @@ def canonize_expr_list_compose(l): l.sort(cmp=compare_exprs_compose) return l -tab_uintsize ={1:uint8,# XXX todo hack +tab_uintsize ={1:uint1, 8:uint8, 16:uint16, 32:uint32, diff --git a/miasm/tools/modint.py b/miasm/tools/modint.py index dda29b4a..2dee2b38 100644 --- a/miasm/tools/modint.py +++ b/miasm/tools/modint.py @@ -130,6 +130,8 @@ class moduint(object): return self.__class__(self.arg ^ y) def __hex__(self): return hex(self.arg) + def __abs__(self): + return abs(self.arg) class modint(moduint): def __init__(self, arg): |