add libafl_qemu_read_user_sp_unchecked

This commit is contained in:
Alwin Berger 2024-06-14 13:54:57 +02:00
parent eb21c70c3b
commit 9a0a6ebc35

View File

@ -163,6 +163,19 @@ int libafl_qemu_num_regs(CPUState* cpu)
return cc->gdb_num_core_regs; 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 --- //// --- Begin LibAFL code ---
#ifndef CONFIG_USER_ONLY #ifndef CONFIG_USER_ONLY