anal_x86_cs fix esil expr for neg instruction (#15252) ##emu

This commit is contained in:
condret 2019-10-12 00:43:42 +02:00 committed by radare
parent 9ed199d64e
commit 73d6b8e930

View File

@ -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: