mirror of
https://github.com/yuzu-emu/unicorn.git
synced 2024-12-23 04:35:36 +00:00
Fix
This commit is contained in:
parent
0a3799eada
commit
3038726a5b
|
@ -246,6 +246,8 @@ class Uc(object):
|
||||||
|
|
||||||
# write to a register
|
# write to a register
|
||||||
def reg_write(self, reg_id, value):
|
def reg_write(self, reg_id, value):
|
||||||
|
reg = None
|
||||||
|
|
||||||
if self._arch == UC_ARCH_X86:
|
if self._arch == UC_ARCH_X86:
|
||||||
if reg_id in [ x86_const.UC_X86_REG_IDTR, x86_const.UC_X86_REG_GDTR, x86_const.UC_X86_REG_LDTR, x86_const.UC_X86_REG_TR]:
|
if reg_id in [ x86_const.UC_X86_REG_IDTR, x86_const.UC_X86_REG_GDTR, x86_const.UC_X86_REG_LDTR, x86_const.UC_X86_REG_TR]:
|
||||||
assert isinstance(value, tuple) and len(value)==4
|
assert isinstance(value, tuple) and len(value)==4
|
||||||
|
@ -258,7 +260,8 @@ class Uc(object):
|
||||||
reg = uc_x86_float80()
|
reg = uc_x86_float80()
|
||||||
reg.mantissa = value[0]
|
reg.mantissa = value[0]
|
||||||
reg.exponent = value[1]
|
reg.exponent = value[1]
|
||||||
else:
|
|
||||||
|
if reg is None:
|
||||||
# convert to 64bit number to be safe
|
# convert to 64bit number to be safe
|
||||||
reg = ctypes.c_int64(value)
|
reg = ctypes.c_int64(value)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue