Consider the following C code1 # i n c l u d e 23 voi d my c a l l e e ( i n t s

Consider the following C code1 # i n c l u d e 23 voi d my c a l l e e ( i n t s i n t e c h a r buf )4 {5 f o r ( ; s6 r e t u r n ;7 }89 voi d my c a l l e r ( void )10 {11 i n t i ;12 c h a r buf [ 1 6 ] ;1314 my c a l l e e ( 9 1 6 buf ) ;15 f o r ( i =0; i 16 r e t u r n ;17 }1819 i n t main ( void )20 {21 my c a l l e r ( ) ;22 r e t u r n 0 ;23 }and the following dissasembly:1 Dump of assembler code for function mycaller :2 0 x080483c4 : push %ebp3 0 x080483c5 : mov %esp %ebp4 0 x080483c7 : sub $0x38 %e sp5 0 x080483ca : l e a -0x14(%ebp ) %eax6 0 x080483cd : mov %eax 0 x8(%e sp )7 0 x080483d1 : movl $0x10 0 x4(%e sp )8 0 x080483d9 : movl $0x9 (% e sp )9 0 x080483e0 : c a l l 0 x80483a4 10 0 x080483e5 : movl $0x0 -0x4(%ebp )11 . . .Given the above update the memory diagram on the next page assuming the following starting values and executionup to 0x080483e5:pc = 0x080483c5esp = 0xbfffea58Memory values not updated maybe left blank. Remember that an int value is 4 bytes located with the least significantbyte at the address and the remaining 3 bytes in the successive byte addresses. Eg. If we know that six bytes startingat 0xbfffec10 is 0x01 0x02 0x03 0x04 0x05 0x06 then we would have to write down :0xbfffec10: 040302010xbfffec14: 0605Individual bytes of an int that whose value are unknown should be specifed as .Address int hex value Description0xbfffea5c 0x08048432 return address for call to mycaller0xbfffea58 0xbfffea68 old frame pointer0xbfffea540xbfffea500xbfffea4c0xbfffea480xbfffea440xbfffea400xbfffea3c0xbfffea380xbfffea340xbfffea300xbfffea2c0xbfffea280xbfffea240xbfffea200xbfffea1cIn the descriptions be sure to indicate if an address corresponds to a specific variable and its value or if an address is a return address and its value.

You can leave a response, or trackback from your own site.
error: Content is protected !!