diff options
| author | Christian Krinitsin <mail@krinitsin.com> | 2025-09-11 11:31:07 +0200 |
|---|---|---|
| committer | Theofilos Augoustis <theofilos.augoustis@gmail.com> | 2025-10-09 15:26:04 +0000 |
| commit | 89f6bfbae7ea6779d9424d8b1fd84843bf8ee23f (patch) | |
| tree | 89c1ed41a32ec71097bc4d4f71326ee6cb84f1b6 /miasm/arch/x86/sem.py | |
| parent | c4ca7286a6c9e1f48bf35cd9c2d4c0c80987b15d (diff) | |
| download | focaccia-miasm-89f6bfbae7ea6779d9424d8b1fd84843bf8ee23f.tar.gz focaccia-miasm-89f6bfbae7ea6779d9424d8b1fd84843bf8ee23f.zip | |
Fix carry flag of BLSI instruction
Diffstat (limited to 'miasm/arch/x86/sem.py')
| -rw-r--r-- | miasm/arch/x86/sem.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/miasm/arch/x86/sem.py b/miasm/arch/x86/sem.py index cb638bc7..15db7424 100644 --- a/miasm/arch/x86/sem.py +++ b/miasm/arch/x86/sem.py @@ -4379,10 +4379,9 @@ def blsi(_, instr, dst, src): e += update_flag_nf(result) e.append(m2_expr.ExprAssign(of, m2_expr.ExprInt(0, of.size))) - if src == 0: - e.append(m2_expr.ExprAssign(cf, m2_expr.ExprInt(0, cf.size))) - else: - e.append(m2_expr.ExprAssign(cf, m2_expr.ExprInt(1, cf.size))) + e.append(m2_expr.ExprAssign(cf, m2_expr.ExprCond(src, + m2_expr.ExprInt(1, 1), + m2_expr.ExprInt(0, 1)))) e.append(m2_expr.ExprAssign(dst, result)) return e, [] |