Correction of ESIL code generated for ROL, ROR and OR instructions on X86 (#5873)

* Esil equivalent of x86 cmp instruction now set the overflow flag.

* Fixed ESIL code generated for ROL instruction.

* Fixed ESIL code generated for OR instruction.
This commit is contained in:
Markus Lottmann 2016-09-29 09:41:33 +02:00 committed by radare
parent ccda50b1a2
commit c02be8da7d

View File

@ -642,8 +642,8 @@ static void anop_esil (RAnal *a, RAnalOp *op, ut64 addr, const ut8 *buf, int len
// - Set flags
{
char *src = getarg (&gop, 1, 0, NULL);
char *dst = getarg (&gop, 0, 1, NULL);
esilprintf (op, "%s,%s,<<<,%s", src, dst, dst);
char *dst = getarg (&gop, 0, 0, NULL);
esilprintf (op, "%s,%s,<<<,%s,=", src, dst, dst);
free (src);
free (dst);
}
@ -654,8 +654,8 @@ static void anop_esil (RAnal *a, RAnalOp *op, ut64 addr, const ut8 *buf, int len
// - Set flags
{
char *src = getarg (&gop, 1, 0, NULL);
char *dst = getarg (&gop, 0, 1, NULL);
esilprintf (op, "%s,%s,>>>,%s", src, dst, dst);
char *dst = getarg (&gop, 0, 0, NULL);
esilprintf (op, "%s,%s,>>>,%s,=", src, dst, dst);
free (src);
free (dst);
}
@ -1059,8 +1059,9 @@ static void anop_esil (RAnal *a, RAnalOp *op, ut64 addr, const ut8 *buf, int len
// mistake.
{
char *src = getarg (&gop, 1, 0, NULL);
char *dst = getarg (&gop, 0, 0, NULL);
esilprintf (op, "%s,%s,|=,$s,sf,=,$z,zf,=,$p,pf,=,$0,of,=,$0,cf,=", src, dst);
char *dst = getarg (&gop, 0, 1, "|");
esilprintf (op, "%s,%s,$s,sf,=,$z,zf,=,$p,pf,=,$0,of,=,$0,cf,=",
src, dst);
free (src);
free (dst);
}