mirror of
https://github.com/radareorg/radare2.git
synced 2025-01-10 15:33:04 +00:00
anal_x86_cs fix esil expr for neg instruction (#15252) ##emu
This commit is contained in:
parent
9ed199d64e
commit
73d6b8e930
@ -1615,8 +1615,25 @@ static void anop_esil(RAnal *a, RAnalOp *op, ut64 addr, const ut8 *buf, int len,
|
||||
ut32 bitsize;
|
||||
src = getarg (&gop, 0, 0, NULL, SRC_AR, NULL);
|
||||
dst = getarg (&gop, 0, 1, NULL, DST_AR, &bitsize);
|
||||
esilprintf (op, "0,cf,:=,0,%s,>,?{,1,cf,:=,},%s,0,-,%s,$z,zf,:=,0,of,:=,%d,$s,sf,:=,%d,$o,pf,:=",
|
||||
src, src, dst, bitsize - 1, bitsize - 1); //is this correct ?
|
||||
ut64 xor = 0;
|
||||
switch (bitsize) {
|
||||
case 8:
|
||||
xor = 0xff;
|
||||
break;
|
||||
case 16:
|
||||
xor = 0xffff;
|
||||
break;
|
||||
case 32:
|
||||
xor = 0xffffffff;
|
||||
break;
|
||||
case 64:
|
||||
xor = 0xffffffffffffffff;
|
||||
break;
|
||||
default:
|
||||
eprintf ("Neg: Unhandled bitsize %d\n", bitsize);
|
||||
}
|
||||
esilprintf (op, "%s,!,!,cf,:=,%s,0x%"PFMT64x",^,1,+,%s,$z,zf,:=,0,of,:=,%d,$s,sf,:=,%d,$o,pf,:=",
|
||||
src, src, xor, dst, bitsize - 1, bitsize - 1);
|
||||
}
|
||||
break;
|
||||
case X86_INS_NOT:
|
||||
|
Loading…
Reference in New Issue
Block a user