I recently started using GDB for a class and I've been struggling a bit. I have an assignment 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:
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.
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.
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.