- 论坛徽章:
- 0
|
gcc (GCC) 4.1.2 20080704 (Red Hat 4.1.2-44)
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
(gdb) disassemble main
Dump of assembler code for function main:
0x080483d3 <main+0>: lea 0x4(%esp),%ecx
0x080483d7 <main+4>: and $0xfffffff0,%esp
0x080483da <main+7>: pushl -0x4(%ecx)
0x080483dd <main+10>: push %ebp
0x080483de <main+11>: mov %esp,%ebp
0x080483e0 <main+13>: push %ecx
0x080483e1 <main+14>: sub $0x14,%esp
0x080483e4 <main+17>: call 0x8048398 <foo>
0x080483e9 <main+22>: movl $0x80484dd,(%esp)
0x080483f0 <main+29>: call 0x8048294 <puts@plt>
0x080483f5 <main+34>: add $0x14,%esp
0x080483f8 <main+37>: pop %ecx
0x080483f9 <main+38>: pop %ebp
0x080483fa <main+39>: lea -0x4(%ecx),%esp
0x080483fd <main+42>: ret
End of assembler dump.
(gdb) disassemble foo
Dump of assembler code for function foo:
0x08048398 <foo+0>: push %ebp
0x08048399 <foo+1>: mov %esp,%ebp
0x0804839b <foo+3>: sub $0x10,%esp
0x0804839e <foo+6>: lea -0x8(%ebp),%eax
0x080483a1 <foo+9>: add $0xc,%eax
0x080483a4 <foo+12>: mov (%eax),%eax
0x080483a6 <foo+14>: mov %eax,-0x4(%ebp)
0x080483a9 <foo+17>: lea -0x8(%ebp),%eax
0x080483ac <foo+20>: add $0xc,%eax
0x080483af <foo+23>: mov $0x8048384,%edx
0x080483b4 <foo+28>: mov %edx,(%eax)
0x080483b6 <foo+30>: lea -0x8(%ebp),%edx
0x080483b9 <foo+33>: add $0x10,%edx
0x080483bc <foo+36>: lea -0x8(%ebp),%eax
0x080483bf <foo+39>: add $0x8,%eax
0x080483c2 <foo+42>: mov (%eax),%eax
0x080483c4 <foo+44>: mov %eax,(%edx)
0x080483c6 <foo+46>: lea -0x8(%ebp),%eax
0x080483c9 <foo+49>: add $0x14,%eax
0x080483cc <foo+52>: mov -0x4(%ebp),%edx
0x080483cf <foo+55>: mov %edx,(%eax)
0x080483d1 <foo+57>: leave
0x080483d2 <foo+58>: ret
End of assembler dump.
(gdb) disassemble attack
Dump of assembler code for function attack:
0x08048384 <attack+0>: push %ebp
0x08048385 <attack+1>: mov %esp,%ebp
0x08048387 <attack+3>: sub $0x8,%esp
0x0804838a <attack+6>: movl $0x80484d0,(%esp)
0x08048391 <attack+13>: call 0x8048294 <puts@plt>
0x08048396 <attack+18>: leave
0x08048397 <attack+19>: ret
End of assembler dump.
|
|
|