Question: The following code: #include #include #include #include int len(char *s) { return strlen(s); } void lptoa(char *s, long *p) { long val = *p; sprintf(s,%ld,val);
The following code:
#include#include #include #include int len(char *s) { return strlen(s); } void lptoa(char *s, long *p) { long val = *p; sprintf(s,"%ld",val); } long longlen(long x) { long v; char buf[8]; v = x; lptoa(buf,&v); return len(buf); } int main() { intlen(TMAX-1); }
Compile the code with and without stack protector.
Fill the table with appropriate values. Leave the entries empty if not applicable no stack protector stack protector gcc flag assembly for allocating stack stack size in decimal assembly for freeing stack assembly for allocating stack stack size in decimal assemblv for freeing stack "char *s" address relative to rsp after entering lptoa "long *p" address relative to rsp after entering lptoa "val" address relative to rsp after entering lptoa assembly for allocating stack stack size in decimal assembly for freeing stack x" address relative to rsp after entering longlen "v" address relative to rsp after entering longlen en oa nglen "buf" address relative to rsp after ent canary register name canary address relative to rsp canary value assembly for erasing canary value assembly for canary cross check Fill the table with appropriate values. Leave the entries empty if not applicable no stack protector stack protector gcc flag assembly for allocating stack stack size in decimal assembly for freeing stack assembly for allocating stack stack size in decimal assemblv for freeing stack "char *s" address relative to rsp after entering lptoa "long *p" address relative to rsp after entering lptoa "val" address relative to rsp after entering lptoa assembly for allocating stack stack size in decimal assembly for freeing stack x" address relative to rsp after entering longlen "v" address relative to rsp after entering longlen en oa nglen "buf" address relative to rsp after ent canary register name canary address relative to rsp canary value assembly for erasing canary value assembly for canary cross check
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
