Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Draw the stack (with pencil and paper) and detail what is located on the stack and where at the following points : -before your code

Draw the stack (with pencil and paper) 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

/* Compare string to hex represention of unsigned value */

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; } void touch3(char *sval) { vlevel = 3; /* Part of validation protocol */ if (hexmatch(cookie, sval)) { printf("Touch3!: You called touch3(\"%s\") ", sval); validate(3); } else { printf("Misfire: You called touch3(\"%s\") ", sval); fail(3); } exit(0); }

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Practical Database Programming With Visual Basic.NET

Authors: Ying Bai

1st Edition

0521712351, 978-0521712354

More Books

Students also viewed these Databases questions

Question

4. I can tell when team members dont mean what they say.

Answered: 1 week ago