Fix wrong location of UC_ARM64_REG_CP_REG in python bindings

This commit is contained in:
Mio 2022-07-23 19:21:31 +08:00
parent 1ec1352995
commit 5b5905695d
No known key found for this signature in database
GPG Key ID: DFF27E34A47CB873
1 changed files with 3 additions and 4 deletions

View File

@ -357,15 +357,14 @@ def reg_write(reg_write_func, arch, reg_id, value):
reg = uc_arm64_neon128() reg = uc_arm64_neon128()
reg.low_qword = value & 0xffffffffffffffff reg.low_qword = value & 0xffffffffffffffff
reg.high_qword = value >> 64 reg.high_qword = value >> 64
elif reg_id == arm64_const.UC_ARM64_REG_CP_REG:
if arch == uc.UC_ARCH_ARM:
if reg_id == arm64_const.UC_ARM64_REG_CP_REG:
reg = uc_arm64_cp_reg() reg = uc_arm64_cp_reg()
if not isinstance(value, tuple) or len(value) != 6: if not isinstance(value, tuple) or len(value) != 6:
raise UcError(uc.UC_ERR_ARG) raise UcError(uc.UC_ERR_ARG)
reg.crn, reg.crm, reg.op0, reg.op1, reg.op2, reg.val = value reg.crn, reg.crm, reg.op0, reg.op1, reg.op2, reg.val = value
elif reg_id == arm_const.UC_ARM_REG_CP_REG: if arch == uc.UC_ARCH_ARM:
if reg_id == arm_const.UC_ARM_REG_CP_REG:
reg = uc_arm_cp_reg() reg = uc_arm_cp_reg()
if not isinstance(value, tuple) or len(value) != 8: if not isinstance(value, tuple) or len(value) != 8:
raise UcError(uc.UC_ERR_ARG) raise UcError(uc.UC_ERR_ARG)