Fix IP value for UC_MODE_16 (#1321)
This commit is contained in:
parent
c03f50f76a
commit
c1c0baec7d
|
@ -27,7 +27,12 @@ const int X86_REGS_STORAGE_SIZE = offsetof(CPUX86State, tlb_table);
|
|||
|
||||
static void x86_set_pc(struct uc_struct *uc, uint64_t address)
|
||||
{
|
||||
((CPUX86State *)uc->current_cpu->env_ptr)->eip = address;
|
||||
CPUState* cpu = uc->cpu;
|
||||
int16_t cs = (uint16_t)X86_CPU(uc, cpu)->env.segs[R_CS].selector;
|
||||
if(uc->mode == UC_MODE_16)
|
||||
((CPUX86State *)uc->current_cpu->env_ptr)->eip = address - cs*16;
|
||||
else
|
||||
((CPUX86State *)uc->current_cpu->env_ptr)->eip = address;
|
||||
}
|
||||
|
||||
void x86_release(void *ctx);
|
||||
|
|
Loading…
Reference in New Issue