add libafl_qemu_read_user_sp_unchecked
This commit is contained in:
parent
eb21c70c3b
commit
9a0a6ebc35
13
cpu-target.c
13
cpu-target.c
@ -163,6 +163,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
|
||||
|
||||
//// --- Begin LibAFL code ---
|
||||
|
||||
#ifndef CONFIG_USER_ONLY
|
||||
|
Loading…
x
Reference in New Issue
Block a user