Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 checkStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started