Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Draw the stack and detail what is located on the stack and where at the following points : before your code starts executing the function
Draw the stack and detail what is located on the stack and where at the following points :
before your code starts executing the function Gets (so the instance after the call is executed, but before any code from gets executed) you should show where any information from the functions test and getbuf is located on the stack
just before the ret in your exploit string gets executed
just before hexmatch has executed its ret
Be sure to include what address rsp and rbp are referencing in your diagram
1 Compare string to hex represention of unsigned value / 2 int hexmatch (unsigned val, char sval) char cbuf [110]; /Make position of check string unpredictable/ char *s cbuf + random ( ) % 100; sprintf (s, "%.8x", val); return strncmp (sval, s, 9)0; 7 10 11 void touch3 (char sval) 12 f 13 14 15 16 17 18 19 20 21 /Part of validation protocol vlevel - 3; if (hexmatch (cookie, sval)) called touch3(\"%s\") ", sval); printf("Touch31: validate (3) You else t called touch3(\"%s\") ", sval); printf ("Misfire: fail (3) You exit (0) 1 Compare string to hex represention of unsigned value / 2 int hexmatch (unsigned val, char sval) char cbuf [110]; /Make position of check string unpredictable/ char *s cbuf + random ( ) % 100; sprintf (s, "%.8x", val); return strncmp (sval, s, 9)0; 7 10 11 void touch3 (char sval) 12 f 13 14 15 16 17 18 19 20 21 /Part of validation protocol vlevel - 3; if (hexmatch (cookie, sval)) called touch3(\"%s\") ", sval); printf("Touch31: validate (3) You else t called touch3(\"%s\") ", sval); printf ("Misfire: fail (3) You exit (0)Step 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