Fix IP value for UC_MODE_16 (#1321)
This commit is contained in:
@ -27,6 +27,11 @@ const int X86_REGS_STORAGE_SIZE = offsetof(CPUX86State, tlb_table);
|
|||||||
|
|
||||||
static void x86_set_pc(struct uc_struct *uc, uint64_t address)
|
static void x86_set_pc(struct uc_struct *uc, uint64_t 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;
|
((CPUX86State *)uc->current_cpu->env_ptr)->eip = address;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user