title: How to replace the return address on the stack using a buffer overflow attack
body: <p>For a homework assignment, I am performing a series of buffer overflow attacks. I was given a program to disassemble, the source code in C for a function that improperly calls <code>gets()</code>, and the source code for several other functions that I am supposed to force the program to call. For one of the tasks, I have to:</p>
  
  <ul>
  <li>Inject some code that changes a value, then</li>
  <li>Return to one of the aforementioned methods</li>
  </ul>
  
  <p>The main thing that I don't understand where the program looks in the stack when determining where to return. Where is the return address for a method stored on the stack?</p>
  
  <p>The program was compiled for x86.</p>