1 / 7

Instructions for test_function

Text Segment. Source Code. void test_function ( int a) { int flag = a*a; } int main( ) { int num = 8; test_function ( num ); }. Instructions for test_function. gcc , gdb. Instructions for main. ~. ~. Text Segment. Source Code. void test_function ( int a) {

uzuri
Download Presentation

Instructions for test_function

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Text Segment Source Code void test_function(int a) { int flag = a*a; } int main( ) { intnum = 8; test_function(num); } Instructions for test_function gcc, gdb Instructions for main ~ ~

  2. Text Segment Source Code void test_function(int a) { int flag = a*a; } int main( ) { intnum = 8; test_function(num); } Instructions for test_function Instructions for main eip ~ ~ ~ ~ Stack Registers esp Stack frame for main ebp

  3. Text Segment Source Code void test_function(int a) { int flag = a*a; } int main( ) { intnum = 8; test_function(num); } Instructions for test_function Instructions for main eip ~ ~ ~ ~ Stack Registers esp Stack frame for main ebp

  4. Text Segment Source Code void test_function(int a) { int flag = a*a; } int main( ) { intnum = 8; test_function(num); } Instructions for test_function Instructions for main eip Note: this is the address we want to return to after the function call (i.e. the return address) ~ ~ ~ ~ Stack Registers esp Stack frame for main ebp

  5. Text Segment Source Code void test_function(int a) { int flag = a*a; } int main( ) { intnum = 8; test_function(num); } eip Instructions for test_function Instructions for main ~ ~ ~ ~ Stack Stack frame for test_function Registers Stack frame for main esp ebp

  6. Text Segment Source Code void test_function(int a) { int flag = a*a; } int main( ) { intnum = 8; test_function(num); } eip Instructions for test_function Instructions for main ~ ~ ~ ~ Stack Stack frame for test_function Registers Stack frame for main esp ebp

  7. Text Segment Source Code void test_function(int a) { int flag = a*a; } int main( ) { intnum = 8; test_function(num); } eip Instructions for test_function Instructions for main ~ ~ ~ ~ Stack Registers esp Stack frame for main ebp

More Related