Question: 6. (8pts) Consider the silly read function in C and X86-64. void read) read: char buf[3] gets(buf)i subg $8x18, Xrsp call gets addq sexie, rsp
6. (8pts) Consider the silly read function in C and X86-64. void read) read: char buf[3] gets(buf)i subg $8x18, Xrsp call gets addq sexie, rsp retq a. What is the maximum length of the input string without overwriting return a (hint: watch out for the null character) b. What would be the return address when input is: 01234567890123456789centery stack That is, assuming read) was called by read callerC), fill in the last 8 bytes of read caller) frame in the figure below. Each box should hold one byte represented in hex Notes ascii codes for characters 0 through 9 are 0x30 through Ox39 . assume little endian machine read caller) stack frame Address increase [it's a stackl) - Filinthis part Address increase 6. (8pts) Consider the silly read function in C and X86-64. void read) read: char buf[3] gets(buf)i subg $8x18, Xrsp call gets addq sexie, rsp retq a. What is the maximum length of the input string without overwriting return a (hint: watch out for the null character) b. What would be the return address when input is: 01234567890123456789centery stack That is, assuming read) was called by read callerC), fill in the last 8 bytes of read caller) frame in the figure below. Each box should hold one byte represented in hex Notes ascii codes for characters 0 through 9 are 0x30 through Ox39 . assume little endian machine read caller) stack frame Address increase [it's a stackl) - Filinthis part Address increase
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
