程序代码:
(gdb) disass main Dump of assembler code for function main: 0x08048433 <+0>: push %ebp 0x08048434 <+1>: mov %esp,%ebp ;create stack frame equal to instruction "enter" 0x08048436 <+3>: and $0xfffffff0,%esp ;esp align to 0x10 0x08048439 <+6>: sub $0x10,%esp ;stack allocate memory size = 0x10 for function parameters 0x0804843c <+9>: movl $0x4,0xc(%esp) ;stack transfer parameters 0x08048444 <+17>: movl $0x3,0x8(%esp) 0x0804844c <+25>: movl $0x2,0x4(%esp) 0x08048454 <+33>: movl $0x1,(%esp) 0x0804845b <+40>: call 0x8048404 <test_function> ;test_function(1, 2, 3, 4); 0x08048460 <+45>: leave ;(>386 instuction pair instruction to "enter") equal to mov esp,ebp pop ebp 0x08048461 <+46>: ret ;return; End of assembler dump. (gdb) disass test_function Dump of assembler code for function test_function: 0x08048404 <+0>: push %ebp 0x08048405 <+1>: mov %esp,%ebp 0x08048407 <+3>: sub $0x28,%esp 0x0804840a <+6>: mov %gs:0x14,%eax 0x08048410 <+12>: mov %eax,-0xc(%ebp) 0x08048413 <+15>: xor %eax,%eax 0x08048415 <+17>: movl $0x6,-0x1c(%ebp) ;flag = 6; 0x0804841c <+24>: movb $0x41,-0x16(%ebp) ;buffer[0] = 'A'; 0x08048420 <+28>: mov -0xc(%ebp),%eax 0x08048423 <+31>: xor %gs:0x14,%eax 0x0804842a <+38>: je 0x8048431 <test_function+45> 0x0804842c <+40>: call 0x8048340 <__stack_chk_fail@plt> 0x08048431 <+45>: leave 0x08048432 <+46>: ret End of assembler dump. (gdb)不明白就慢慢明白,急什么
技术问题,请不要以短消息方式提问