I want to change the content of the Program Counter (Instruction Pointer). I thought by overriding the system signal handler in C, I can get the pointer in the system stack frame. From there I can get the return address of the function and change it.
However, I got the pointer in the stack, But I don't know exactly where the return address is stored on the Stack Frame.
void signal_handler(int signal){
char* ptr = (char*) & signal;
// As, signal is stored on the paramter list of the stack,
// I get the address in the current stack frame. From , here
// I want to change the return address(that is stored in the
// current stack frame).
}