Presentation is loading. Please wait.

Presentation is loading. Please wait.

©2002, Ed Skoudis Format String Stack View main() { char user_input[100]; char buffer[100]; int x; … /*get user_input*/ … snprintf(buffer, sizeof buffer,

Similar presentations


Presentation on theme: "©2002, Ed Skoudis Format String Stack View main() { char user_input[100]; char buffer[100]; int x; … /*get user_input*/ … snprintf(buffer, sizeof buffer,"— Presentation transcript:

1 ©2002, Ed Skoudis Format String Stack View main() { char user_input[100]; char buffer[100]; int x; … /*get user_input*/ … snprintf(buffer, sizeof buffer, user_input); }

2 ©2002, Ed Skoudis Format String Stack View main() { char user_input[100]; char buffer[100]; int x; … /*get user_input*/ … snprintf(buffer, sizeof buffer, user_input); } Top of Memory Bottom of Memory Fill Direction Value to Change

3 ©2002, Ed Skoudis Format String Stack View main() { char user_input[100]; char buffer[100]; int x; … /*get user_input*/ … snprintf(buffer, sizeof buffer, user_input); } Top of Memory Bottom of Memory int x Fill Direction Buffer (100 char) Value to Change

4 ©2002, Ed Skoudis Format String Stack View main() { char user_input[100]; char buffer[100]; int x; … /*get user_input*/ … snprintf(buffer, sizeof buffer, user_input); } Top of Memory Bottom of Memory int x Return Pointer Fill Direction Buffer (100 char) Pointer to user_input sizeof buffer Pointer to Buffer Value to Change

5 ©2002, Ed Skoudis Format String Stack View main() { char user_input[100]; char buffer[100]; int x; … /*get user_input*/ … snprintf(buffer, sizeof buffer, user_input); } Top of Memory Bottom of Memory int x Return Pointer Fill Direction Buffer (100 char) Pointer to user_input sizeof buffer Pointer to Buffer c0faffbf%d%n Value to Change

6 ©2002, Ed Skoudis Format String Stack View main() { char user_input[100]; char buffer[100]; int x; … /*get user_input*/ … snprintf(buffer, sizeof buffer, user_input); } Top of Memory Bottom of Memory int x Return Pointer Fill Direction Buffer (100 char) Pointer to user_input sizeof buffer Pointer to Buffer c0faffbf%d%n c0faffbf Value to Change

7 ©2002, Ed Skoudis Format String Stack View main() { char user_input[100]; char buffer[100]; int x; … /*get user_input*/ … snprintf(buffer, sizeof buffer, user_input); } Top of Memory Bottom of Memory int x Return Pointer Fill Direction Buffer (100 char) Pointer to user_input sizeof buffer Pointer to Buffer c0faffbf%d%n c0faffbf value of x Value to Change

8 ©2002, Ed Skoudis Format String Stack View main() { char user_input[100]; char buffer[100]; int x; … /*get user_input*/ … snprintf(buffer, sizeof buffer, user_input); } Top of Memory Bottom of Memory int x Return Pointer Fill Direction Buffer (100 char) Pointer to user_input sizeof buffer Pointer to Buffer c0faffbf%d%n c0faffbf value of x Value to Change

9 ©2002, Ed Skoudis Format String Stack View main() { char user_input[100]; char buffer[100]; int x; … /*get user_input*/ … snprintf(buffer, sizeof buffer, user_input); } Top of Memory Bottom of Memory int x Return Pointer Fill Direction Buffer (100 char) Pointer to user_input sizeof buffer Pointer to Buffer c0faffbf%d%n c0faffbf value of x 5

10 ©2002, Ed Skoudis Format String Stack View main() { char user_input[100]; char buffer[100]; int x; … /*get user_input*/ … snprintf(buffer, sizeof buffer, user_input); } Top of Memory Bottom of Memory int x Return Pointer Fill Direction Buffer (100 char) Pointer to user_input sizeof buffer Pointer to Buffer c0faffbf%.255d%n c0faffbf value of x 259


Download ppt "©2002, Ed Skoudis Format String Stack View main() { char user_input[100]; char buffer[100]; int x; … /*get user_input*/ … snprintf(buffer, sizeof buffer,"

Similar presentations


Ads by Google