Pass the correct size integers
This commit is contained in:
parent
47275c18f4
commit
98980c904c
17
uc.c
17
uc.c
@ -754,12 +754,13 @@ uc_err uc_emu_start(uc_engine *uc, uint64_t begin, uint64_t until,
|
||||
}
|
||||
uc->nested_level++;
|
||||
|
||||
uint32_t begin_pc32 = READ_DWORD(begin);
|
||||
switch (uc->arch) {
|
||||
default:
|
||||
break;
|
||||
#ifdef UNICORN_HAS_M68K
|
||||
case UC_ARCH_M68K:
|
||||
uc_reg_write(uc, UC_M68K_REG_PC, &begin);
|
||||
uc_reg_write(uc, UC_M68K_REG_PC, &begin_pc32);
|
||||
break;
|
||||
#endif
|
||||
#ifdef UNICORN_HAS_X86
|
||||
@ -778,7 +779,7 @@ uc_err uc_emu_start(uc_engine *uc, uint64_t begin, uint64_t until,
|
||||
break;
|
||||
}
|
||||
case UC_MODE_32:
|
||||
uc_reg_write(uc, UC_X86_REG_EIP, &begin);
|
||||
uc_reg_write(uc, UC_X86_REG_EIP, &begin_pc32);
|
||||
break;
|
||||
case UC_MODE_64:
|
||||
uc_reg_write(uc, UC_X86_REG_RIP, &begin);
|
||||
@ -788,7 +789,7 @@ uc_err uc_emu_start(uc_engine *uc, uint64_t begin, uint64_t until,
|
||||
#endif
|
||||
#ifdef UNICORN_HAS_ARM
|
||||
case UC_ARCH_ARM:
|
||||
uc_reg_write(uc, UC_ARM_REG_R15, &begin);
|
||||
uc_reg_write(uc, UC_ARM_REG_R15, &begin_pc32);
|
||||
break;
|
||||
#endif
|
||||
#ifdef UNICORN_HAS_ARM64
|
||||
@ -799,7 +800,7 @@ uc_err uc_emu_start(uc_engine *uc, uint64_t begin, uint64_t until,
|
||||
#ifdef UNICORN_HAS_MIPS
|
||||
case UC_ARCH_MIPS:
|
||||
// TODO: MIPS32/MIPS64/BIGENDIAN etc
|
||||
uc_reg_write(uc, UC_MIPS_REG_PC, &begin);
|
||||
uc_reg_write(uc, UC_MIPS_REG_PC, &begin_pc32);
|
||||
break;
|
||||
#endif
|
||||
#ifdef UNICORN_HAS_SPARC
|
||||
@ -815,7 +816,11 @@ uc_err uc_emu_start(uc_engine *uc, uint64_t begin, uint64_t until,
|
||||
#endif
|
||||
#ifdef UNICORN_HAS_RISCV
|
||||
case UC_ARCH_RISCV:
|
||||
uc_reg_write(uc, UC_RISCV_REG_PC, &begin);
|
||||
if (uc->mode & UC_MODE_RISCV64) {
|
||||
uc_reg_write(uc, UC_RISCV_REG_PC, &begin);
|
||||
} else {
|
||||
uc_reg_write(uc, UC_RISCV_REG_PC, &begin_pc32);
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
#ifdef UNICORN_HAS_S390X
|
||||
@ -825,7 +830,7 @@ uc_err uc_emu_start(uc_engine *uc, uint64_t begin, uint64_t until,
|
||||
#endif
|
||||
#ifdef UNICORN_HAS_TRICORE
|
||||
case UC_ARCH_TRICORE:
|
||||
uc_reg_write(uc, UC_TRICORE_REG_PC, &begin);
|
||||
uc_reg_write(uc, UC_TRICORE_REG_PC, &begin_pc32);
|
||||
break;
|
||||
#endif
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user