Advice for the buffer overflow assignment

Understanding roughly how to solve the phases of the buffer overflow assignment isn't too hard once you get the idea. But it is very easy to be off by a byte or two, or to misunderstand some small detail that then prevents your solution from working at all. This can be very frustrating.

The main tool you need to help cut through the confusion is the ability to use gdb, so you can step through the code and watch what happens when you use a particular collection of bytes to overflow your buffer. Usually, if you step carefully through your code and pay attention to rsp and the memory it points to (i.e., the stuff on the top of the stack), you can see what's happening when and why.

How to debug ctarget with gdb

Good luck!