This is an old paper that it explains the basics: https://www.eecs.umich.edu/courses/eecs588/static/stack_smashing.pdf
Today there are a lot of mitigations where the steps of the paper don't work anymore, but the general ideas should be still valid. I'll hope you find the example you are looking for in there.
On another note: What is your intention? And can I participate 😈