Add hack for Unicorn YMM registers (#239)

This commit is contained in:
Mark Mossberg
2017-05-08 15:14:37 -04:00
committed by GitHub
parent 395a40a646
commit fca086ea45

View File

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