title: get return address GDB
body: <p>I recently started using GDB for a class and I've been struggling a bit. I have <a href="http://css.csail.mit.edu/6.858/2013/labs/lab1.html" rel="noreferrer">an assignment</a> where I have to do the Lab 1 exercise 2 that needs me to search for two vulnerabilities within the code and do the following with them:</p>
  
  <blockquote>
    <p><em>The first must overwrite a return address on the stack, and the second must overwrite some other data structure that you will use to take over the control flow of the program.</em></p>
  </blockquote>
  
  <p>I already overflowed the data structure, which what I think it's talking about is the EIP which points to what other instruction it will do.</p>
  
  <p>Now how do I get to the return address (RET) of the frame? Any frame, it doesn't matter, I just want to know how I can calculate the bytes between the RET and maybe the ESP so I can subtract it and get the length.  I just started with GDB so take it easy on me.</p>