From fca086ea458cd2b2ab31c174078bacebca461ff1 Mon Sep 17 00:00:00 2001 From: Mark Mossberg Date: Mon, 8 May 2017 15:14:37 -0400 Subject: [PATCH] Add hack for Unicorn YMM registers (#239) --- manticore/utils/emulate.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/manticore/utils/emulate.py b/manticore/utils/emulate.py index 13a9988..2cd98de 100644 --- a/manticore/utils/emulate.py +++ b/manticore/utils/emulate.py @@ -201,6 +201,15 @@ class UnicornEmulator(object): registers -= set(['CF','PF','AF','ZF','SF','IF','DF','OF']) registers.add('EFLAGS') + # TODO(mark): Unicorn 1.0.1 does not support reading YMM registers, + # and simply returns back zero. If a unicorn emulated instruction writes to an + # XMM reg, we will read back the corresponding YMM register, resulting in an + # incorrect zero value being actually written to the XMM register. This is + # fixed in Unicorn PR #819, so when that is included in a release, delete + # these two lines. + registers -= set(['YMM0', 'YMM1', 'YMM2', 'YMM3', 'YMM4', 'YMM5', 'YMM6', 'YMM7', 'YMM8', 'YMM9', 'YMM10', 'YMM11', 'YMM12', 'YMM13', 'YMM14', 'YMM15']) + registers |= set(['XMM0', 'XMM1', 'XMM2', 'XMM3', 'XMM4', 'XMM5', 'XMM6', 'XMM7', 'XMM8', 'XMM9', 'XMM10', 'XMM11', 'XMM12', 'XMM13', 'XMM14', 'XMM15']) + # XXX(yan): This concretizes the entire register state. This is overly # aggressive. Once capstone adds consistent support for accessing # referred registers, make this only concretize those registers being