add libafl_qemu_read_user_sp_unchecked
This commit is contained in:
parent
cc3a167325
commit
b67c9ae8ab
13
cpu-target.c
13
cpu-target.c
@ -160,6 +160,19 @@ int libafl_qemu_num_regs(CPUState* cpu)
|
||||
return cc->gdb_num_core_regs;
|
||||
}
|
||||
|
||||
#ifdef TARGET_ARM
|
||||
// use-case: get the user-stack pointer and return addr from at an isr-return
|
||||
#include "target/arm/cpu.h"
|
||||
#include "target/arm/internals.h"
|
||||
|
||||
int libafl_qemu_read_user_sp_unchecked(CPUState* cpu);
|
||||
int libafl_qemu_read_user_sp_unchecked(CPUState* cpu) {
|
||||
CPUARMState *env = cpu_env(cpu);
|
||||
return env->v7m.other_sp;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#ifndef CONFIG_USER_ONLY
|
||||
hwaddr libafl_qemu_current_paging_id(CPUState* cpu)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user