Change Program Counter in C
<p>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. </p>

<p>However, I got the pointer in the stack, But I don't know exactly where the return address is stored on the Stack Frame.</p>

<pre><code>void signal_handler(int signal){

   char* ptr = (char*) &amp; 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).
}
</code></pre>