Reference no: EM132654239
Compile exercise.c with the following command
gcc -ggdb -m32 -fno-stack-protector -fcf-protection=none exercise.c
If you are using some old gcc versions, you can take out the option
-fcf-protection=none
if it is not available.
(1) Draw the stack layout before get_ssn returns, with a normal SSN input.
(2) What is the return address (RA) of get_ssn?
(3) Construct an input to cause segmentation fault.
Explain what is an segmentation fault and why your input cause the segmentation fault.
(4) Draw the stack layout before get_ssn returns, with an input longer than 10 characters. You may use your input for (1).
(5) Construct an input to cause the program to print SSN (input) twice as we did in this week's live demo. Report what value you use to overwrite the get_ssn return address.
(6) Can you construct an input to print SSN more twice? Explain and report your solution.
What to submit:
A report, with screenshots or transcript, and drawings (memory layout).
Attachment:- exercise.rar