#57 Challenge - Buffer Overflow part 2

Credits: Computer Systems: A Programmer's Perspective
Authors: Randal E. Bryant and David R. O'Hallaron
Samples of book: http://csapp.cs.cmu.edu/public/manuscript.html
Disclaimer: I have written permission from the author to post his labs on my site.

This is a continuation to chalenge #55 You don't have to complete that challege to solve this one, however the skills learned in that challenge will help you with this one. If you don't know how to disassemble a program please go back and read challenge #55.

The bufbomb program contains the following code:



void fizz(int val) {


	if (val == cookie) { 


 		printf ("Fizz!: You called fizz(0x%x)\n", val);


		validate(1);


	} else


		printf("Misfire: You called fizz(0x%x)\n", val);


	exit(0);


}	


You can download the files you need for this challenge here: bufferOverflow.tar.gz

Similar to challenge #55, your task is to get bufbom to execute the code for fizz rather than returning to test. In this case, however, you must make it appear to fizz as if you have passed your cookie as its argument. You can do this by encoding your cookie in the appropriate place within your exploit string.

Some advice:
Note that the program won't really call fizz - it will simply execute its code. This has important implications for where on the stack you want to place your cookie.