allow to change PC during callback. this solves issue #210
This commit is contained in:
@@ -656,9 +656,15 @@ int x86_reg_write(struct uc_struct *uc, unsigned int regid, const void *value)
|
||||
break;
|
||||
case UC_X86_REG_EIP:
|
||||
X86_CPU(uc, mycpu)->env.eip = *(uint32_t *)value;
|
||||
// force to quit execution and flush TB
|
||||
uc->quit_request = true;
|
||||
uc_emu_stop(uc);
|
||||
break;
|
||||
case UC_X86_REG_IP:
|
||||
WRITE_WORD(X86_CPU(uc, mycpu)->env.eip, *(uint16_t *)value);
|
||||
// force to quit execution and flush TB
|
||||
uc->quit_request = true;
|
||||
uc_emu_stop(uc);
|
||||
break;
|
||||
case UC_X86_REG_CS:
|
||||
X86_CPU(uc, mycpu)->env.segs[R_CS].base = *(uint32_t *)value;
|
||||
@@ -806,12 +812,21 @@ int x86_reg_write(struct uc_struct *uc, unsigned int regid, const void *value)
|
||||
break;
|
||||
case UC_X86_REG_RIP:
|
||||
X86_CPU(uc, mycpu)->env.eip = *(uint64_t *)value;
|
||||
// force to quit execution and flush TB
|
||||
uc->quit_request = true;
|
||||
uc_emu_stop(uc);
|
||||
break;
|
||||
case UC_X86_REG_EIP:
|
||||
WRITE_DWORD(X86_CPU(uc, mycpu)->env.eip, *(uint32_t *)value);
|
||||
// force to quit execution and flush TB
|
||||
uc->quit_request = true;
|
||||
uc_emu_stop(uc);
|
||||
break;
|
||||
case UC_X86_REG_IP:
|
||||
WRITE_WORD(X86_CPU(uc, mycpu)->env.eip, *(uint16_t *)value);
|
||||
// force to quit execution and flush TB
|
||||
uc->quit_request = true;
|
||||
uc_emu_stop(uc);
|
||||
break;
|
||||
case UC_X86_REG_CS:
|
||||
X86_CPU(uc, mycpu)->env.segs[R_CS].base = *(uint64_t *)value;
|
||||
|
||||
Reference in New Issue
Block a user