/* Similar to p2.c, but now blah has a potential overflow you must exploit. You need to create a string which when read (via stdin by main), will cause this progam to print "You are a wizard". Notes: The string that overflows the buffer must have the new return address in the right place (so it overwrites the real return address). The actual values placed in the buffer are irrelevant (only the new return address is important). Use gdb to find the number of bytes of padding you need to put in your string. */ #include void wizard() { printf("You are a wizard\n"); } void blah(char *s) { char buff[12]; strcpy(buff,s); } /* main calls read to get a string from stdin, then passes the address of this string to blah. You want to create a string that will cause blah to "return to wizard()". */ int main(void) { char x[10000]; read(0,x,2000); blah(x); printf("Done\n"); }