diff options
| author | serpilliere <devnull@localhost> | 2012-01-03 10:28:03 +0100 |
|---|---|---|
| committer | serpilliere <devnull@localhost> | 2012-01-03 10:28:03 +0100 |
| commit | b617192330c9f0738e1f6c06a6dd3e7cbc651743 (patch) | |
| tree | 4bf5b8af042c895b3790a12a3a17251a90c2ebe4 | |
| parent | 18f20b328a4b72cfd80f8b0e64771ee032e8674e (diff) | |
| download | miasm-b617192330c9f0738e1f6c06a6dd3e7cbc651743.tar.gz miasm-b617192330c9f0738e1f6c06a6dd3e7cbc651743.zip | |
emulation fix
| -rw-r--r-- | miasm/arch/ia32_sem.py | 4 | ||||
| -rwxr-xr-x | miasm/tools/emul_helper.py | 16 |
2 files changed, 10 insertions, 10 deletions
diff --git a/miasm/arch/ia32_sem.py b/miasm/arch/ia32_sem.py index aab8d6eb..4f921708 100644 --- a/miasm/arch/ia32_sem.py +++ b/miasm/arch/ia32_sem.py @@ -1411,8 +1411,8 @@ def cdq(info): ) else: e = [] - e.append(ExprAff(dx, - ExprCond(ExprOp('==', get_op_msb(ax), ExprInt(uint32(0))), + e.append(ExprAff(edx[0:16], + ExprCond(ExprOp('==', get_op_msb(eax[:16]), ExprInt(uint32(0))), ExprInt(uint16(0x0)), ExprInt(uint16(0xffff))) ) diff --git a/miasm/tools/emul_helper.py b/miasm/tools/emul_helper.py index f89d3bf5..1944e873 100755 --- a/miasm/tools/emul_helper.py +++ b/miasm/tools/emul_helper.py @@ -168,23 +168,23 @@ def get_instr_expr_args(name, modifs, mnemo_mode, args, my_eip): #""" ###XXX for eval abs -def get_instr_expr_args(name, modifs, mnemo_mode, args, my_eip): +def get_instr_expr_args(name, modifs, opmode, admode, args, my_eip): for a in args: if type(a) in [int, long]: raise ValueError('int deprec in args') - + info = (opmode, admode) if name in ['jmp']: if isinstance(args[0], ExprInt): - e = mnemo_func[name](args[0]) + e = mnemo_func[name](info, args[0]) else: - e = mnemo_func[name](*args) + e = mnemo_func[name](info, *args) elif name in jcc: - e = mnemo_func[name](my_eip, args[0]) + e = mnemo_func[name](info, my_eip, args[0]) elif name in ['call']: - e = mnemo_func[name](my_eip, args[0]) + e = mnemo_func[name](info, my_eip, args[0]) else: - e = mnemo_func[name](*args) + e = mnemo_func[name](info, *args) return e #""" @@ -194,7 +194,7 @@ def get_instr_expr(l, my_eip, args = None, segm_to_do = {}): for x in l.arg: args.append(dict_to_Expr(x, l.m.modifs, l.opmode, l.admode, segm_to_do)) l.arg_expr = args - return get_instr_expr_args(l.m.name, l.m.modifs, l.mnemo_mode, args, my_eip) + return get_instr_expr_args(l.m.name, l.m.modifs, l.opmode, l.admode, args, my_eip) |